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:
2016-08-29 19:05:46 +02:00
parent 86c76b1284
commit fa06320219
51 changed files with 880 additions and 318 deletions

58
mapview/2D/tools/Tool.h Normal file
View File

@@ -0,0 +1,58 @@
#ifndef TOOL_H
#define TOOL_H
#include <QKeyEvent>
#include <QMouseEvent>
#include <QObject>
#include "../Painter.h"
class MapView2D;
/**
* interface for every MapView tool.
* a tool may be a background tool (e.g. a ruler-display, grid, ..)
* or a foreground (active) one, which e.g. selects nodes, creates a new element, ...
*/
class Tool : public QObject {
Q_OBJECT
public:
Tool() {;}
virtual ~Tool() {;}
/** the tool must return its name here */
virtual const std::string getName() const = 0;
/** the tool was activated (by user or by code) */
virtual void becomesActive() {;}
/** the tool was deactivated (by user or by code) */
virtual void becomesInactive() {;}
/** events: return TRUE when you consumed the event */
virtual bool mousePressEvent(MapView2D* m, QMouseEvent* e) { (void) m; (void) e; return false; }
virtual bool mouseMoveEvent(MapView2D* m, QMouseEvent* e) { (void) m; (void) e; return false; }
virtual bool mouseReleaseEvent(MapView2D* m, QMouseEvent* e) { (void) m; (void) e; return false; }
virtual bool wheelEvent(MapView2D* m, QWheelEvent* e) { (void) m; (void) e; return false; }
virtual bool keyPressEvent(MapView2D* m, QKeyEvent* e) { (void) m; (void) e; return false; }
virtual void paintBefore(MapView2D* m, Painter& p) { (void) m; (void) p; }
virtual void paintAfter(MapView2D* m, Painter& p) { (void) m; (void) p; }
virtual void layerChange(MapView2D* m) { (void) m; }
signals:
void onHelpTextChange(QString str);
};
#endif // TOOL_H