70 lines
1.6 KiB
C++
70 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 MMFLOORACCESSPOINTS_H
|
||
#define MMFLOORACCESSPOINTS_H
|
||
|
||
#include "MapLayer.h"
|
||
#include "MMFloorAccessPoint.h"
|
||
|
||
#include <Indoor/floorplan/v2/Floorplan.h>
|
||
|
||
/**
|
||
* layer containing all of the map's floors
|
||
*/
|
||
class MMFloorAccessPoints : public MapLayer {
|
||
|
||
private:
|
||
|
||
Floorplan::Floor* floor;
|
||
|
||
public:
|
||
|
||
/** ctor with the underlying model */
|
||
MMFloorAccessPoints(MapLayer* parent, Floorplan::Floor* floor) : MapLayer(parent, MapLayerType::FLOOR_ACCESS_POINTS), floor(floor) {
|
||
|
||
// add all APs
|
||
for (Floorplan::AccessPoint* ap : floor->accesspoints) {
|
||
addElement(new MMFloorAccessPoint(this, floor, ap));
|
||
}
|
||
|
||
}
|
||
|
||
bool isVisible() const override {
|
||
return floor->accesspoints.enabled;
|
||
}
|
||
|
||
void setVisible(const bool visible) override {
|
||
this-> floor->accesspoints.enabled = visible;
|
||
onVisibilityChanged(visible);
|
||
}
|
||
|
||
std::string getLayerName() const override {return "APs";}
|
||
|
||
//TODO: check
|
||
MMFloorAccessPoint* createAP(Floorplan::AccessPoint* ap) {
|
||
|
||
// add to underlying model
|
||
floor->accesspoints.push_back(ap);
|
||
|
||
// add to myself as element
|
||
//addElement(new MMFloorAccessPoint(this, floor, ap));
|
||
|
||
// add to myself as element
|
||
MMFloorAccessPoint* mm = new MMFloorAccessPoint(this, floor, ap);
|
||
addElement(mm);
|
||
return mm;
|
||
|
||
}
|
||
|
||
};
|
||
|
||
#endif // MMFLOORACCESSPOINTS_H
|