added support for pillars
minor fixes new 3D models
This commit is contained in:
@@ -8,12 +8,14 @@
|
||||
#include "IHasMaterial.h"
|
||||
#include "IHasObstacleType.h"
|
||||
|
||||
#include "IHasParams.h"
|
||||
|
||||
#include "../2D/MV2DElementFloorObstacleCircle.h"
|
||||
|
||||
#include <Indoor/floorplan/v2/Floorplan.h>
|
||||
|
||||
|
||||
class MMFloorObstacleCircle : public MapModelElement, public IHasMaterial {
|
||||
class MMFloorObstacleCircle : public MapModelElement, public IHasMaterial, public IHasParams {
|
||||
|
||||
private:
|
||||
|
||||
@@ -41,6 +43,38 @@ public:
|
||||
mf->obstacles.erase(std::remove(mf->obstacles.begin(), mf->obstacles.end(), c), mf->obstacles.end());
|
||||
}
|
||||
|
||||
/** get the number of parameters */
|
||||
int getNumParams() const override {
|
||||
return 2;
|
||||
}
|
||||
|
||||
/** get the description of the idx-th parameter */
|
||||
virtual Param getParamDesc(const int idx) const override {
|
||||
switch (idx) {
|
||||
case 0: return Param("radius", ParamType::FLOAT);
|
||||
case 1: return Param("height", ParamType::FLOAT);
|
||||
default: throw Exception("out of bounds");
|
||||
}
|
||||
}
|
||||
|
||||
/** get the idx-th param's value */
|
||||
virtual ParamValue getParamValue(const int idx) const override {
|
||||
switch(idx) {
|
||||
case 0: return c->radius;
|
||||
case 1: return c->height;
|
||||
default: throw Exception("out of bounds");
|
||||
}
|
||||
}
|
||||
|
||||
/** set the idx-th param's value */
|
||||
virtual void setParamValue(const int idx, const ParamValue& val) override {
|
||||
switch (idx) {
|
||||
case 0: c->radius = val.toFloat(); break;
|
||||
case 1: c->height = val.toFloat(); break;
|
||||
default: throw Exception("out of bounds");
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif // MAPMODELELEMENTFLOOROBSTACLECIRCLE_H
|
||||
|
||||
@@ -77,13 +77,15 @@ public:
|
||||
}
|
||||
|
||||
//TODO: check
|
||||
void createCircle(Floorplan::FloorObstacleCircle* obs) {
|
||||
MMFloorObstacleCircle* createCircle(Floorplan::FloorObstacleCircle* obs) {
|
||||
|
||||
// add to underlying model
|
||||
floor->obstacles.push_back(obs);
|
||||
|
||||
// add to myself as element
|
||||
addElement(new MMFloorObstacleCircle(this, floor, obs));
|
||||
MMFloorObstacleCircle* mm = new MMFloorObstacleCircle(this, floor, obs);
|
||||
addElement(mm);
|
||||
return mm;
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user