added support for ground truth points: \n -layer for gt points \n -button with icon
-saving and loading support
This commit is contained in:
61
mapview/model/MMFloorGroundTruthPoint.h
Normal file
61
mapview/model/MMFloorGroundTruthPoint.h
Normal file
@@ -0,0 +1,61 @@
|
||||
#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::POINT2);
|
||||
}
|
||||
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) const override {
|
||||
switch(idx) {
|
||||
case 0: gtp->id = val.toInt(); break;
|
||||
case 1: gtp->pos = val.toPoint2(); 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
|
||||
Reference in New Issue
Block a user