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/MMFloorFingerprintLocation.h
kazu 92e279aefc added option for underlay opacity change
adjusted interface [removed invalid const]
2017-03-20 15:25:54 +01:00

79 lines
2.0 KiB
C++

#ifndef MMFLOORFINGERPRINTLOCATIONS_H
#define MMFLOORFINGERPRINTLOCATIONS_H
#include "MapModelElement.h"
#include "IHasParams.h"
#include "IHasEditableMeta.h"
#include "../2D/MV2DElementFingerprintLocation.h"
#include "../3D/MV3DElementFingerprintLocation.h"
#include <Indoor/floorplan/v2/Floorplan.h>
class MMFloorFingerprintLocation : public MapModelElement, public IHasParams, public IHasEditableMeta {
private:
Floorplan::Floor* floor;
Floorplan::FingerprintLocation* fpl;
MV2DElementFingerprintLocation mv2d;
MV3DElementFingerprintLocation mv3d;
public:
MMFloorFingerprintLocation(MapLayer* parent, Floorplan::Floor* floor, Floorplan::FingerprintLocation* fpl) :
MapModelElement(parent), floor(floor), fpl(fpl), mv2d(fpl), mv3d(floor, fpl) {
}
virtual int getNumParams() const override {
return 3;
}
virtual Param getParamDesc(const int idx) const override {
switch(idx) {
case 0: return Param("name", ParamType::STRING);
case 1: return Param("Position", ParamType::POINT2);
case 2: return Param("at height", ParamType::FLOAT);
}
throw 1;
}
virtual ParamValue getParamValue(const int idx) const override {
switch(idx) {
case 0: return fpl->name;
case 1: return fpl->posOnFloor;
case 2: return fpl->heightAboveFloor;
}
throw 1;
}
virtual void setParamValue(const int idx, const ParamValue& val) override {
switch(idx) {
case 0: fpl->name = val.toString(); break;
case 1: fpl->posOnFloor = val.toPoint2(); break;
case 2: fpl->heightAboveFloor = val.toFloat(); break;
}
}
virtual Floorplan::Meta* getMeta() override {
return fpl->getMeta();
}
virtual void setMeta(Floorplan::Meta* meta) override {
fpl->setMeta(meta);
}
MV2DElement* getMV2D() const override {return (MV2DElement*) &mv2d;}
MV3DElement* getMV3D() const override {return (MV3DElement*) &mv3d;}
void deleteMe() const override {
parent->removeElement(this);
floor->fpLocations.erase(std::remove(floor->fpLocations.begin(), floor->fpLocations.end(), fpl), floor->fpLocations.end());
}
};
#endif // MMFLOORFINGERPRINTLOCATIONS_H