This repository has been archived on 2020-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
Files
IndoorMap/mapview/model/MMFloorStairs.h
2016-07-04 15:11:10 +02:00

49 lines
977 B
C++

#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