added support for meta-data editing improved element selection changed zooming fixed some issues with layer events fixed issue with 3D outline fixed loading issue for old maps some interface changes
98 lines
2.3 KiB
C++
98 lines
2.3 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 "MMFloorStairs.h"
|
|
#include "MMFloorElevators.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:
|
|
|
|
Floorplan::IndoorMap* map;
|
|
|
|
/** the underlying data-structure */
|
|
Floorplan::Floor* floor;
|
|
|
|
public:
|
|
|
|
/** ctor. existing floor */
|
|
MMFloor(MapLayer* parent, Floorplan::IndoorMap* map, Floorplan::Floor* floor) : MapLayer(parent, MapLayerType::FLOOR), map(map), floor(floor) {
|
|
|
|
new MMFloorUnderlays(this, floor);
|
|
new MMFloorOutline(this, floor);
|
|
new MMFloorObstacles(this, floor);
|
|
new MMFloorAccessPoints(this, floor);
|
|
new MMFloorBeacons(this, floor);
|
|
new MMFloorPOIs(this, floor);
|
|
new MMFloorStairs(this, floor);
|
|
new MMFloorElevators(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 3;
|
|
}
|
|
|
|
virtual Param getParamDesc(const int idx) const override {
|
|
switch(idx) {
|
|
case 0: return Param("name", ParamType::STRING);
|
|
case 1: return Param("height", ParamType::FLOAT);
|
|
case 2: return Param("at height", ParamType::FLOAT);
|
|
}
|
|
throw 1;
|
|
}
|
|
|
|
virtual ParamValue getParamValue(const int idx) const override {
|
|
switch(idx) {
|
|
case 0: return floor->name;
|
|
case 1: return floor->height;
|
|
case 2: return floor->atHeight;
|
|
}
|
|
throw 1;
|
|
}
|
|
|
|
virtual void setParamValue(const int idx, const ParamValue& val) const override {
|
|
switch(idx) {
|
|
case 0: floor->name = val.toString(); break;
|
|
case 1: floor->height = val.toFloat(); break;
|
|
case 2: floor->atHeight = val.toFloat(); break;
|
|
}
|
|
}
|
|
|
|
void deleteMe() {
|
|
parent->removeSublayer(this);
|
|
map->floors.erase(std::remove(map->floors.begin(), map->floors.end(), floor), map->floors.end());
|
|
}
|
|
|
|
};
|
|
|
|
#endif // MMFLOOR_H
|