#ifndef MMFLOOR_H #define MMFLOOR_H #include "MapLayer.h" #include "MMFloorOutline.h" #include "MMFloorObstacles.h" #include "MMFloorAccessPoints.h" #include "MMFloorBeacons.h" #include "MMFloorUnderlays.h" #include "MMFloorPOIs.h" #include "IHasParams.h" #include /** * floor-layer containing one floor * and its outline, obstacles, access-points, ... */ class MMFloor : public MapLayer, public IHasParams { private: /** the underlying data-structure */ Floorplan::Floor* floor; public: /** ctor. existing floor */ MMFloor(MapLayer* parent, Floorplan::Floor* floor) : MapLayer(parent, MapLayerType::FLOOR), floor(floor) { new MMFloorUnderlays(this, floor); elements.push_back(new MMFloorOutline(this, floor)); new MMFloorObstacles(this, floor); new MMFloorAccessPoints(this, floor); new MMFloorBeacons(this, floor); new MMFloorPOIs(this, floor); } /** ctor. new floor. */ MMFloor(MapLayer* parent) : MapLayer(parent), floor(nullptr) { throw "not yet implemented"; } /** get the underlying model */ Floorplan::Floor& getFloor() {return *floor;} std::string getLayerName() const override {return floor->name;} virtual int getNumParams() const override { return 1; } virtual Param getParamDesc(const int idx) const override { switch(idx) { case 0: return Param("anem", ParamType::STRING); } throw 1; } virtual ParamValue getParamValue(const int idx) const override { switch(idx) { case 0: return floor->name; } throw 1; } virtual void setParamValue(const int idx, const ParamValue& val) const override { switch(idx) { case 0: floor->name = val.toString(); break; } } }; #endif // MMFLOOR_H