added support for pillars

minor fixes
new 3D models
This commit is contained in:
2018-05-22 11:50:56 +02:00
parent 1bc95d9c55
commit 37b3011e5d
14 changed files with 352 additions and 77 deletions

View File

@@ -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

View File

@@ -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;
}