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/MMFloor.h
2016-06-06 22:08:53 +02:00

82 lines
1.7 KiB
C++

#ifndef MMFLOOR_H
#define MMFLOOR_H
#include "MapLayer.h"
#include "MMFloorOutline.h"
#include "MMFloorObstacles.h"
#include "MMFloorAccessPoints.h"
#include "MMFloorBeacons.h"
#include "MMFloorUnderlays.h"
#include "MMFloorPOIs.h"
#include "IHasParams.h"
#include <Indoor/floorplan/v2/Floorplan.h>
/**
* floor-layer containing one floor
* and its outline, obstacles, access-points, ...
*/
class MMFloor : public MapLayer, public IHasParams {
private:
/** the underlying data-structure */
Floorplan::Floor* floor;
public:
/** ctor. existing floor */
MMFloor(MapLayer* parent, Floorplan::Floor* floor) : MapLayer(parent, MapLayerType::FLOOR), floor(floor) {
new MMFloorUnderlays(this, floor);
elements.push_back(new MMFloorOutline(this, floor));
new MMFloorObstacles(this, floor);
new MMFloorAccessPoints(this, floor);
new MMFloorBeacons(this, floor);
new MMFloorPOIs(this, floor);
}
/** ctor. new floor. */
MMFloor(MapLayer* parent) : MapLayer(parent), floor(nullptr) {
throw "not yet implemented";
}
/** get the underlying model */
Floorplan::Floor& getFloor() {return *floor;}
std::string getLayerName() const override {return floor->name;}
virtual int getNumParams() const override {
return 1;
}
virtual Param getParamDesc(const int idx) const override {
switch(idx) {
case 0: return Param("anem", ParamType::STRING);
}
throw 1;
}
virtual ParamValue getParamValue(const int idx) const override {
switch(idx) {
case 0: return floor->name;
}
throw 1;
}
virtual void setParamValue(const int idx, const ParamValue& val) const override {
switch(idx) {
case 0: floor->name = val.toString(); break;
}
}
};
#endif // MMFLOOR_H