/* * © Copyright 2014 – Urheberrechtshinweis * Alle Rechte vorbehalten / All Rights Reserved * * Programmcode ist urheberrechtlich geschuetzt. * Das Urheberrecht liegt, soweit nicht ausdruecklich anders gekennzeichnet, bei Frank Ebner. * Keine Verwendung ohne explizite Genehmigung. * (vgl. § 106 ff UrhG / § 97 UrhG) */ #ifndef TOOLNEWOBJECT_H #define TOOLNEWOBJECT_H #include "ToolNewElement.h" #include "../../model/MMFloorObstacles.h" #include "../../model/MMFloorObstacleObject.h" class ToolNewObject : public ToolNewElement { 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), Point3(1,1,1)); MMFloorObstacles* obs = (MMFloorObstacles*)layer; mmEL = obs->createObject(foEL); } void rightMouse(const Point2 mapPoint) override { (void) mapPoint; finalizeCurrent(); disableMe(); } }; #endif // TOOLNEWOBJECT_H