71 lines
1.6 KiB
C++
71 lines
1.6 KiB
C++
/*
|
||
* © 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 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
|