#ifndef MMREGISTRATIONPOINT_H #define MMREGISTRATIONPOINT_H #include "IHasParams.h" #include "MapModelElement.h" #include "../2D/MV2DElementRegistrationPoint.h" #include "../3D/MV3DElementRegistrationPoint.h" #include /** * one earth <-> map correspondcen */ class MMRegistrationPoint : public MapModelElement, public IHasParams { private: Floorplan::IndoorMap* map; Floorplan::EarthPosMapPos* reg; MV2DElementRegistrationPoint mv2d; MV3DElementRegistrationPoint mv3d; std::string fileName; public: /** ctor */ MMRegistrationPoint(MapLayer* parent, Floorplan::IndoorMap* map, Floorplan::EarthPosMapPos* reg) : MapModelElement(parent), map(map), reg(reg), mv2d(reg), mv3d(reg) { ; } MV2DElement* getMV2D() const override {return (MV2DElement*) &mv2d;} MV3DElement* getMV3D() const override {return (MV3DElement*) &mv3d;} void deleteMe() const override { parent->removeElement(this); map->earthReg.correspondences.erase(std::remove(map->earthReg.correspondences.begin(), map->earthReg.correspondences.end(), reg), map->earthReg.correspondences.end()); } int getNumParams() const override { return 4; } virtual Param getParamDesc(const int idx) const override { switch (idx) { case 0: return Param("map", ParamType::POINT3); case 1: return Param("lat", ParamType::DOUBLE); case 2: return Param("lon", ParamType::DOUBLE); case 3: return Param("alt", ParamType::FLOAT); default: throw 1; } } virtual ParamValue getParamValue(const int idx) const override { switch(idx) { case 0: return ParamValue(reg->posOnMap_m); case 1: return ParamValue(reg->posOnEarth.lat); case 2: return ParamValue(reg->posOnEarth.lon); case 3: return ParamValue(reg->posOnEarth.height); default: throw 1; } } virtual void setParamValue(const int idx, const ParamValue& val) override { switch (idx) { case 0: reg->posOnMap_m = val.toPoint3(); break; case 1: reg->posOnEarth.lat = val.toDouble(); break; case 2: reg->posOnEarth.lon = val.toDouble(); break; case 3: reg->posOnEarth.height = val.toFloat(); break; default: throw 1; } } }; #endif // MMREGISTRATIONPOINT_H