This repository has been archived on 2020-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
Files
IndoorMap/mapview/model/MMFloorGroundTruthPoint.h
2018-10-25 12:19:36 +02:00

72 lines
2.0 KiB
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* © 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