72 lines
2.0 KiB
C++
72 lines
2.0 KiB
C++
/*
|
||
* © Copyright 2014 – Urheberrechtshinweis
|
||
* Alle Rechte vorbehalten / All Rights Reserved
|
||
*
|
||
* Programmcode ist urheberrechtlich geschuetzt.
|
||
* Das Urheberrecht liegt, soweit nicht ausdruecklich anders gekennzeichnet, bei Frank Ebner.
|
||
* Keine Verwendung ohne explizite Genehmigung.
|
||
* (vgl. § 106 ff UrhG / § 97 UrhG)
|
||
*/
|
||
|
||
#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
|