a whole lotta work!!
- refactoring - completely changed the tooling (adding elements) - better re-use for more stable editing - new elements - ui adjustments - LINT for stair-editing - many more changes
This commit is contained in:
83
mapview/2D/MapView2D.h
Normal file
83
mapview/2D/MapView2D.h
Normal file
@@ -0,0 +1,83 @@
|
||||
#ifndef MAP2D_H
|
||||
#define MAP2D_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QOpenGLWidget>
|
||||
|
||||
#include "Scaler.h"
|
||||
class MapModel;
|
||||
class MV2DElement;
|
||||
|
||||
#include "tools/Tools.h"
|
||||
|
||||
|
||||
/**
|
||||
* view to render (and edit) MapElements
|
||||
*/
|
||||
class MapView2D : public QOpenGLWidget {
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
private:
|
||||
|
||||
/** scaling within the map */
|
||||
Scaler s;
|
||||
|
||||
/** the currently active tool (if any) */
|
||||
Tools tools;
|
||||
|
||||
/** the underlying data-model */
|
||||
MapModel* model = nullptr;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
/** ctor */
|
||||
MapView2D(QWidget* parent = nullptr);
|
||||
|
||||
void layerChange() {
|
||||
update();
|
||||
tools.layerChange(this);
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
void paintGL();
|
||||
void initializeGL();
|
||||
void resizeGL();
|
||||
|
||||
|
||||
Tools& getTools() {return tools;}
|
||||
|
||||
/** get the underlying data-model */
|
||||
MapModel* getModel() {return model;}
|
||||
|
||||
/** set the underlying data-model */
|
||||
void setModel(MapModel* mdl) {
|
||||
this->model = mdl;
|
||||
update();
|
||||
}
|
||||
|
||||
/** get the underlying scaling device */
|
||||
Scaler& getScaler() {return s;}
|
||||
|
||||
|
||||
signals:
|
||||
|
||||
void onElementChange(MV2DElement*e);
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
void mousePressEvent(QMouseEvent* e);
|
||||
void mouseMoveEvent(QMouseEvent* e);
|
||||
void mouseReleaseEvent(QMouseEvent* e);
|
||||
|
||||
void wheelEvent(QWheelEvent* e);
|
||||
|
||||
void keyPressEvent(QKeyEvent* e);
|
||||
|
||||
};
|
||||
|
||||
#endif // MAP2D_H
|
||||
Reference in New Issue
Block a user