added support for object-sizing

added support for wall-heights
This commit is contained in:
k-a-z-u
2018-07-04 20:29:09 +02:00
parent 2f37baf497
commit ba9c8359d7
5 changed files with 19 additions and 11 deletions

View File

@@ -46,13 +46,14 @@ public:
virtual int getNumParams() const override {
return 2;
return 3;
}
virtual Param getParamDesc(const int idx) const override {
switch(idx) {
case 0: return Param("thickness (m)", ParamType::FLOAT);
case 1: return Param("length", ParamType::FLOAT, true);
case 1: return Param("height (m)", ParamType::FLOAT);
case 2: return Param("length", ParamType::FLOAT, true);
}
throw 1;
}
@@ -60,7 +61,8 @@ public:
virtual ParamValue getParamValue(const int idx) const override {
switch(idx) {
case 0: return fo->thickness_m;
case 1: return fo->from.getDistance(fo->to);
case 1: return fo->height_m;
case 2: return fo->from.getDistance(fo->to);
}
throw 1;
}
@@ -68,7 +70,8 @@ public:
virtual void setParamValue(const int idx, const ParamValue& val) override {
switch(idx) {
case 0: fo->thickness_m = val.toFloat(); break;
case 1: break;
case 1: fo->height_m = val.toFloat(); break;
case 2: break;
}
}

View File

@@ -41,7 +41,7 @@ public:
/** get the number of parameters */
int getNumParams() const override {
return 3;
return 4;
}
/** get the description of the idx-th parameter */
@@ -50,6 +50,7 @@ public:
case 0: return Param("file", ParamType::STRING);
case 1: return Param("pos", ParamType::POINT3);
case 2: return Param("rot", ParamType::POINT3);
case 3: return Param("scale", ParamType::POINT3);
default: throw Exception("out of bounds");
}
}
@@ -60,6 +61,7 @@ public:
case 0: return fo->file;
case 1: return fo->pos;
case 2: return fo->rot;
case 3: return fo->scale;
default: throw Exception("out of bounds");
}
}
@@ -70,6 +72,7 @@ public:
case 0: fo->file = val.toString(); break;
case 1: fo->pos = val.toPoint3(); break;
case 2: fo->rot = val.toPoint3(); break;
case 3: fo->scale = val.toPoint3(); break;
default: throw Exception("out of bounds");
}
}