split line(old) and wall(new)
added new walling started working on windows
This commit is contained in:
@@ -9,7 +9,6 @@
|
||||
#include "IHasParams.h"
|
||||
|
||||
#include "../2D/MV2DElementFloorObstacleLine.h"
|
||||
//#include "../3D/MV3DElementFloorObstacleWall.h"
|
||||
|
||||
#include <Indoor/floorplan/v2/Floorplan.h>
|
||||
|
||||
@@ -21,13 +20,12 @@ public:
|
||||
Floorplan::Floor* mf;
|
||||
Floorplan::FloorObstacleLine* fo;
|
||||
MV2DElementFloorObstacleLine mv2d;
|
||||
//MV3DElementFloorObstacleWall mv3d;
|
||||
|
||||
public:
|
||||
|
||||
MMFloorObstacleLine(MapLayer* parent, Floorplan::Floor* mf, Floorplan::FloorObstacleLine* fo) :
|
||||
MapModelElement(parent), mf(mf), fo(fo), mv2d(mf, fo) {//, mv3d(mf,fo) {
|
||||
|
||||
MapModelElement(parent), mf(mf), fo(fo), mv2d(mf, fo) {
|
||||
;
|
||||
}
|
||||
|
||||
void setMaterial(const Floorplan::Material m) override {fo->material = m;}
|
||||
@@ -37,44 +35,41 @@ public:
|
||||
Floorplan::ObstacleType getObatcleType() const override {return fo->type;}
|
||||
|
||||
MV2DElement* getMV2D() const override {return (MV2DElement*) &mv2d;}
|
||||
//MV3DElement* getMV3D() const override {return (MV3DElement*) &mv3d;}
|
||||
|
||||
void deleteMe() const override {
|
||||
parent->removeElement(this);
|
||||
mf->obstacles.erase(std::remove(mf->obstacles.begin(), mf->obstacles.end(), fo), mf->obstacles.end());
|
||||
}
|
||||
|
||||
|
||||
virtual int getNumParams() const override {
|
||||
int getNumParams() const override {
|
||||
return 3;
|
||||
}
|
||||
|
||||
virtual Param getParamDesc(const int idx) const override {
|
||||
switch(idx) {
|
||||
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 0: return Param("thickness (m)", ParamType::FLOAT);
|
||||
case 1: return Param("height (m)", ParamType::FLOAT);
|
||||
case 2: return Param("length", ParamType::FLOAT, true);
|
||||
}
|
||||
throw 1;
|
||||
}
|
||||
|
||||
virtual ParamValue getParamValue(const int idx) const override {
|
||||
switch(idx) {
|
||||
case 0: return fo->thickness_m;
|
||||
case 1: return fo->height_m;
|
||||
case 2: return fo->from.getDistance(fo->to);
|
||||
case 0: return fo->thickness_m;
|
||||
case 1: return fo->height_m;
|
||||
case 2: return fo->from.getDistance(fo->to);
|
||||
}
|
||||
throw 1;
|
||||
}
|
||||
|
||||
virtual void setParamValue(const int idx, const ParamValue& val) override {
|
||||
switch(idx) {
|
||||
case 0: fo->thickness_m = val.toFloat(); break;
|
||||
case 1: fo->height_m = val.toFloat(); break;
|
||||
case 2: break;
|
||||
case 0: fo->thickness_m = val.toFloat(); return;
|
||||
case 1: fo->height_m = val.toFloat(); return;
|
||||
case 2: return;
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif // MAPELEMENTOBSTACLE_H
|
||||
|
||||
Reference in New Issue
Block a user