62 lines
1.7 KiB
C++
62 lines
1.7 KiB
C++
#ifndef MMFLOORGROUNDTRUTHPOINT_H
|
|
#define MMFLOORGROUNDTRUTHPOINT_H
|
|
|
|
#include "MapModelElement.h"
|
|
#include "IHasParams.h"
|
|
|
|
#include "../2D/MV2DElementGroundTruthPoint.h"
|
|
|
|
#include <Indoor/floorplan/v2/Floorplan.h>
|
|
|
|
class MMFloorGroundTruthPoint : public MapModelElement, public IHasParams {
|
|
|
|
private:
|
|
|
|
Floorplan::Floor* floor;
|
|
Floorplan::GroundTruthPoint* gtp;
|
|
MV2DElementGroundTruthPoint mv2d;
|
|
|
|
public:
|
|
|
|
MMFloorGroundTruthPoint(MapLayer* parent, Floorplan::Floor* floor, Floorplan::GroundTruthPoint* gtp) : MapModelElement(parent), floor(floor), gtp(gtp), mv2d(gtp) {
|
|
;
|
|
}
|
|
|
|
virtual int getNumParams() const override {
|
|
return 2;
|
|
}
|
|
|
|
virtual Param getParamDesc(const int idx) const override {
|
|
switch(idx) {
|
|
case 0: return Param("id", ParamType::INT);
|
|
case 1: return Param("position", ParamType::POINT3);
|
|
}
|
|
throw 1;
|
|
}
|
|
|
|
virtual ParamValue getParamValue(const int idx) const override {
|
|
switch(idx) {
|
|
case 0: return gtp->id; //TODO: this value can be changed and isn't set incremental within the indoormap
|
|
case 1: return gtp->pos;
|
|
}
|
|
throw 1;
|
|
}
|
|
|
|
virtual void setParamValue(const int idx, const ParamValue& val) override {
|
|
switch(idx) {
|
|
case 0: gtp->id = val.toInt(); break;
|
|
case 1: gtp->pos = val.toPoint3(); break;
|
|
}
|
|
}
|
|
|
|
MV2DElement* getMV2D() const override {return (MV2DElement*) &mv2d;}
|
|
|
|
void deleteMe() const override {
|
|
parent->removeElement(this);
|
|
floor->gtpoints.erase(std::remove(floor->gtpoints.begin(), floor->gtpoints.end(), gtp), floor->gtpoints.end());
|
|
}
|
|
|
|
};
|
|
|
|
#endif // MMFLOORGROUNDTRUTHPOINT_H
|