refactoring/cleanups
This commit is contained in:
@@ -4,8 +4,7 @@
|
||||
#include "MapModelElement.h"
|
||||
#include "../2D/MapViewElementHelper.h"
|
||||
|
||||
#include "IHasMaterial.h"
|
||||
#include "IHasObstacleType.h"
|
||||
#include "EElementParams.h"
|
||||
#include "IHasParams.h"
|
||||
|
||||
#include "../2D/MV2DElementFloorObstacleLine.h"
|
||||
@@ -13,7 +12,7 @@
|
||||
#include <Indoor/floorplan/v2/Floorplan.h>
|
||||
|
||||
|
||||
class MMFloorObstacleLine : public MapModelElement, public IHasMaterial, public IHasObstacleType, public IHasParams {
|
||||
class MMFloorObstacleLine : public MapModelElement, public IHasParams {
|
||||
|
||||
public:
|
||||
|
||||
@@ -28,11 +27,11 @@ public:
|
||||
;
|
||||
}
|
||||
|
||||
void setMaterial(const Floorplan::Material m) override {fo->material = m;}
|
||||
Floorplan::Material getMaterial() const override {return fo->material;}
|
||||
// void setMaterial(const Floorplan::Material m) override {fo->material = m;}
|
||||
// Floorplan::Material getMaterial() const override {return fo->material;}
|
||||
|
||||
void setObstacleType(const Floorplan::ObstacleType t) override {fo->type = t;}
|
||||
Floorplan::ObstacleType getObatcleType() const override {return fo->type;}
|
||||
// void setObstacleType(const Floorplan::ObstacleType t) override {fo->type = t;}
|
||||
// Floorplan::ObstacleType getObatcleType() const override {return fo->type;}
|
||||
|
||||
MV2DElement* getMV2D() const override {return (MV2DElement*) &mv2d;}
|
||||
|
||||
@@ -42,7 +41,7 @@ public:
|
||||
}
|
||||
|
||||
int getNumParams() const override {
|
||||
return 3;
|
||||
return 5;
|
||||
}
|
||||
|
||||
virtual Param getParamDesc(const int idx) const override {
|
||||
@@ -50,6 +49,8 @@ public:
|
||||
case 0: return Param("thickness (m)", ParamType::FLOAT);
|
||||
case 1: return Param("height (m)", ParamType::FLOAT);
|
||||
case 2: return Param("length", ParamType::FLOAT, true);
|
||||
case 3: return Param("material", ParamType::ENUM, getMaterialStrings());
|
||||
case 4: return Param("type", ParamType::ENUM, getObstacleTypeStrings());
|
||||
}
|
||||
throw 1;
|
||||
}
|
||||
@@ -59,6 +60,8 @@ public:
|
||||
case 0: return fo->thickness_m;
|
||||
case 1: return fo->height_m;
|
||||
case 2: return fo->from.getDistance(fo->to);
|
||||
case 3: return (int) fo->material;
|
||||
case 4: return (int) fo->type;
|
||||
}
|
||||
throw 1;
|
||||
}
|
||||
@@ -68,6 +71,8 @@ public:
|
||||
case 0: fo->thickness_m = val.toFloat(); return;
|
||||
case 1: fo->height_m = val.toFloat(); return;
|
||||
case 2: return;
|
||||
case 3: fo->material = (Floorplan::Material) val.toInt(); return;
|
||||
case 4: fo->type = (Floorplan::ObstacleType) val.toInt(); return;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user