71 lines
1.5 KiB
C++
71 lines
1.5 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 MMFLOORPOIS_H
|
||
#define MMFLOORPOIS_H
|
||
|
||
#include "MapLayer.h"
|
||
#include "MMFloorPOI.h"
|
||
|
||
#include <Indoor/floorplan/v2/Floorplan.h>
|
||
|
||
/**
|
||
* layer that contains all of one floor's POIs
|
||
*/
|
||
class MMFloorPOIs : public MapLayer {
|
||
|
||
Floorplan::Floor* floor;
|
||
|
||
public:
|
||
|
||
/** ctor with the floor */
|
||
MMFloorPOIs(MapLayer* parent, Floorplan::Floor* floor) : MapLayer(parent, MapLayerType::FLOOR_POIS), floor(floor) {
|
||
|
||
// the POIs
|
||
for (Floorplan::POI* poi : floor->pois) {
|
||
addElement(new MMFloorPOI(this, floor, poi));
|
||
}
|
||
|
||
}
|
||
|
||
bool isVisible() const override {
|
||
return floor->pois.enabled;
|
||
}
|
||
|
||
void setVisible(const bool visible) override {
|
||
this-> floor->pois.enabled = visible;
|
||
onVisibilityChanged(visible);
|
||
}
|
||
|
||
/** get the corresponding floor from the underlying model */
|
||
Floorplan::Floor* getFloor() {return floor;}
|
||
|
||
//TODO: check
|
||
MMFloorPOI* createPOI(Floorplan::POI* poi) {
|
||
|
||
// add to underlying model
|
||
floor->pois.push_back(poi);
|
||
|
||
// add to myself as element
|
||
//addElement(new MMFloorPOI(this, floor, poi));
|
||
|
||
// add to myself as element
|
||
MMFloorPOI* mm = new MMFloorPOI(this, floor, poi);
|
||
addElement(mm);
|
||
return mm;
|
||
|
||
}
|
||
|
||
std::string getLayerName() const override {return "POIs";}
|
||
|
||
};
|
||
|
||
#endif // MMFLOORPOIS_H
|