a lot of work on th map-creator
This commit is contained in:
48
mapview/model/MMFloorStairs.h
Normal file
48
mapview/model/MMFloorStairs.h
Normal file
@@ -0,0 +1,48 @@
|
||||
#ifndef MMFLOORSTAIRS_H
|
||||
#define MMFLOORSTAIRS_H
|
||||
|
||||
#include "MapLayer.h"
|
||||
#include "MMFloorStair.h"
|
||||
|
||||
#include <Indoor/floorplan/v2/Floorplan.h>
|
||||
|
||||
/**
|
||||
* layer containing all stairs of one floor
|
||||
*/
|
||||
class MMFloorStairs : public MapLayer {
|
||||
|
||||
private:
|
||||
|
||||
Floorplan::Floor* floor;
|
||||
|
||||
public:
|
||||
|
||||
/** ctor with the underlying model */
|
||||
MMFloorStairs(MapLayer* parent, Floorplan::Floor* floor) : MapLayer(parent, MapLayerType::FLOOR_STAIRS), floor(floor) {
|
||||
|
||||
// add all floors
|
||||
for (Floorplan::Stair* stair : floor->stairs) {
|
||||
if (dynamic_cast<Floorplan::StairFreeform*>(stair)) {
|
||||
elements.push_back( new MMFloorStair(this, floor, (Floorplan::StairFreeform*)stair) );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void create(Floorplan::StairFreeform* stair) {
|
||||
|
||||
// add to underlying model
|
||||
floor->stairs.push_back(stair);
|
||||
|
||||
// add to myself as element
|
||||
elements.push_back(new MMFloorStair(this, floor, stair));
|
||||
|
||||
}
|
||||
|
||||
std::string getLayerName() const override {return "stairs";}
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif // MMFLOORSTAIRS_H
|
||||
Reference in New Issue
Block a user