some refactoring
hopefully improved rendering speed added support to add .obj obstacles
This commit is contained in:
49
mapview/2D/tools/ToolNewObject.h
Normal file
49
mapview/2D/tools/ToolNewObject.h
Normal file
@@ -0,0 +1,49 @@
|
||||
#ifndef TOOLNEWOBJECT_H
|
||||
#define TOOLNEWOBJECT_H
|
||||
|
||||
|
||||
#include "ToolNewElement.h"
|
||||
#include "../../model/MMFloorObstacles.h"
|
||||
#include "../../model/MMFloorObstacleObject.h"
|
||||
|
||||
class ToolNewObject : public ToolNewElement<Floorplan::FloorObstacleObject, MMFloorObstacleObject> {
|
||||
|
||||
public:
|
||||
|
||||
ToolNewObject(Tools& tools, MapLayer* layer) : ToolNewElement(tools, layer) {
|
||||
;
|
||||
}
|
||||
|
||||
void becomesActive() override {
|
||||
emit onHelpTextChange("left-click where to place a new object. right-click to end.");
|
||||
}
|
||||
|
||||
void becomesInactive() override {
|
||||
;
|
||||
}
|
||||
|
||||
const std::string getName() const override {
|
||||
return "new Object/Furniture/...";
|
||||
}
|
||||
|
||||
void moving(const Point2 mapPoint) override {
|
||||
(void) mapPoint;
|
||||
}
|
||||
|
||||
/** next point */
|
||||
void leftMouse(const Point2 mapPoint) override {
|
||||
foEL = new Floorplan::FloorObstacleObject("", Point3(mapPoint.x, mapPoint.y, 0.0), Point3(0,0,0));
|
||||
MMFloorObstacles* obs = (MMFloorObstacles*)layer;
|
||||
mmEL = obs->createObject(foEL);
|
||||
}
|
||||
|
||||
void rightMouse(const Point2 mapPoint) override {
|
||||
(void) mapPoint;
|
||||
finalizeCurrent();
|
||||
disableMe();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif // TOOLNEWOBJECT_H
|
||||
Reference in New Issue
Block a user