- refactoring - completely changed the tooling (adding elements) - better re-use for more stable editing - new elements - ui adjustments - LINT for stair-editing - many more changes
65 lines
1.5 KiB
C++
65 lines
1.5 KiB
C++
#ifndef MAPVIEWELEMENTIBEACON_H
|
|
#define MAPVIEWELEMENTIBEACON_H
|
|
|
|
#include "MapModelElement.h"
|
|
#include "IHasParams.h"
|
|
|
|
#include "../2D/MV2DElementBeacon.h"
|
|
|
|
#include <Indoor/floorplan/v2/Floorplan.h>
|
|
|
|
class MMFloorBeacon : public MapModelElement, public IHasParams {
|
|
|
|
private:
|
|
|
|
Floorplan::Floor* floor;
|
|
Floorplan::Beacon* b;
|
|
MV2DElementBeacon mv2d;
|
|
|
|
public:
|
|
|
|
MMFloorBeacon(MapLayer* parent, Floorplan::Floor* floor, Floorplan::Beacon* b) : MapModelElement(parent), floor(floor), b(b), mv2d(b) {
|
|
;
|
|
}
|
|
|
|
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("MAC", ParamType::STRING);
|
|
case 2: return Param("Position", ParamType::POINT3);
|
|
}
|
|
throw 1;
|
|
}
|
|
|
|
virtual ParamValue getParamValue(const int idx) const override {
|
|
switch(idx) {
|
|
case 0: return b->name;
|
|
case 1: return b->mac;
|
|
case 2: return b->pos;
|
|
}
|
|
throw 1;
|
|
}
|
|
|
|
virtual void setParamValue(const int idx, const ParamValue& val) const override {
|
|
switch(idx) {
|
|
case 0: b->name = val.toString(); break;
|
|
case 1: b->mac = val.toString(); break;
|
|
case 2: b->pos = val.toPoint3(); break;
|
|
}
|
|
}
|
|
|
|
MV2DElement* getMV2D() const override {return (MV2DElement*) &mv2d;}
|
|
|
|
void deleteMe() const override {
|
|
parent->removeElement(this);
|
|
floor->beacons.erase(std::remove(floor->beacons.begin(), floor->beacons.end(), b), floor->beacons.end());
|
|
}
|
|
|
|
};
|
|
|
|
#endif // MAPVIEWELEMENTIBEACON_H
|