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
k-a-z-u bce771d6d6 worked on 3D viz
scaling, moving by finger
some fixes / improvement
2018-02-06 17:35:10 +01:00

61 lines
1.3 KiB
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::IndoorMap* map;
Floorplan::Floor* floor;
public:
/** ctor with the underlying model */
MMFloorStairs(MapLayer* parent, Floorplan::IndoorMap* map, Floorplan::Floor* floor) : MapLayer(parent, MapLayerType::FLOOR_STAIRS), map(map), floor(floor) {
// add all floors
for (Floorplan::Stair* stair : floor->stairs) {
if (dynamic_cast<Floorplan::StairFreeform*>(stair)) {
addElement( new MMFloorStair(this, map, floor, (Floorplan::StairFreeform*)stair) );
}
}
}
bool isVisible() const override {
return floor->stairs.enabled;
}
void setVisible(const bool visible) override {
this-> floor->stairs.enabled = visible;
onVisibilityChanged(visible);
}
MMFloorStair* create(Floorplan::StairFreeform* stair) {
// add to underlying model
floor->stairs.push_back(stair);
// add to myself as element
MMFloorStair* mm = new MMFloorStair(this, map, floor, stair);
addElement(mm);
return mm;
}
std::string getLayerName() const override {return "stairs";}
};
#endif // MMFLOORSTAIRS_H