current revision

This commit is contained in:
2016-09-28 12:16:45 +02:00
parent 075d8bb633
commit d47322e73b
90 changed files with 8228 additions and 606 deletions

37
ui/map/2D/Renderable2D.h Normal file
View File

@@ -0,0 +1,37 @@
#ifndef RENDERABLE2D_H
#define RENDERABLE2D_H
#include <QPainter>
#include "Scaler2D.h"
#include "RenderParams2D.h"
class Renderable2D {
private:
bool visible = true;
public:
virtual ~Renderable2D() {;}
/** show/hide this element */
void setVisible(const bool visible) {this->visible = visible;}
/** is this element currently visible? */
bool isVisible() const {return this->visible;}
/** render this element */
void render(QPainter& qp, const Scaler2D& s, const RenderParams2D& p) {
if (!visible) {return;}
doRender(qp, s, p);
}
protected:
/** subclasses render themselves here */
virtual void doRender(QPainter& qp, const Scaler2D& s, const RenderParams2D& p) = 0;
};
#endif // RENDERABLE2D_H