many changes :P
This commit is contained in:
@@ -2,35 +2,61 @@
|
||||
#define MAPVIEWELEMENTACCESSPOINT_H
|
||||
|
||||
#include "MapModelElement.h"
|
||||
#include "IHasMAC.h"
|
||||
#include "IHasName.h"
|
||||
#include "IHasParams.h"
|
||||
|
||||
#include "../elements/MV2DElementAccessPoint.h"
|
||||
#include "../3D/MV3DElementAccessPoint.h"
|
||||
|
||||
#include <Indoor/floorplan/v2/Floorplan.h>
|
||||
|
||||
class MMFloorAccessPoint : public MapModelElement, public IHasMAC, public IHasName {
|
||||
class MMFloorAccessPoint : public MapModelElement, public IHasParams {
|
||||
|
||||
private:
|
||||
|
||||
Floorplan::Floor* floor;
|
||||
Floorplan::AccessPoint* ap;
|
||||
MV2DElementAccessPoint mv2d;
|
||||
MV3DElementAccessPoint mv3d;
|
||||
|
||||
public:
|
||||
|
||||
MMFloorAccessPoint(MapLayer* parent, Floorplan::Floor* floor, Floorplan::AccessPoint* ap) :
|
||||
MapModelElement(parent), floor(floor), ap(ap), mv2d(ap) {
|
||||
MapModelElement(parent), floor(floor), ap(ap), mv2d(ap), mv3d(floor, ap) {
|
||||
|
||||
}
|
||||
|
||||
virtual void setMAC(const std::string& mac) override {ap->mac = mac;}
|
||||
virtual const std::string& getMAC() const override {return ap->mac;}
|
||||
virtual int getNumParams() const override {
|
||||
return 3;
|
||||
}
|
||||
|
||||
virtual void setName(const std::string& name) override {ap->name = name;}
|
||||
virtual const std::string& getName() const override {return ap->name;}
|
||||
virtual Param getParamDesc(const int idx) const override {
|
||||
switch(idx) {
|
||||
case 0: return Param("name", ParamType::STRING);
|
||||
case 1: return Param("MAC", ParamType::STRING);
|
||||
case 2: return Param("Position", ParamType::POINT3);
|
||||
}
|
||||
throw 1;
|
||||
}
|
||||
|
||||
virtual ParamValue getParamValue(const int idx) const override {
|
||||
switch(idx) {
|
||||
case 0: return ap->name;
|
||||
case 1: return ap->mac;
|
||||
case 2: return ap->pos;
|
||||
}
|
||||
throw 1;
|
||||
}
|
||||
|
||||
virtual void setParamValue(const int idx, const ParamValue& val) const override {
|
||||
switch(idx) {
|
||||
case 0: ap->name = val.toString(); break;
|
||||
case 1: ap->mac = val.toString(); break;
|
||||
case 2: ap->pos = val.toPoint3(); break;
|
||||
}
|
||||
}
|
||||
|
||||
MV2DElement* getMV2D() const override {return (MV2DElement*) &mv2d;}
|
||||
MV3DElement* getMV3D() const override {return (MV3DElement*) &mv3d;}
|
||||
|
||||
void deleteMe() const override {
|
||||
parent->removeElement(this);
|
||||
|
||||
Reference in New Issue
Block a user