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/MMFloorAccessPoints.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

60 lines
1.3 KiB
C++

#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