added new param-editing to APs and Beacons
changed drawing for better debuging changed layer editing option to add and delete layers some minor changes
This commit is contained in:
@@ -25,13 +25,15 @@ class MMFloor : public MapLayer, public IHasParams {
|
||||
|
||||
private:
|
||||
|
||||
Floorplan::IndoorMap* map;
|
||||
|
||||
/** the underlying data-structure */
|
||||
Floorplan::Floor* floor;
|
||||
|
||||
public:
|
||||
|
||||
/** ctor. existing floor */
|
||||
MMFloor(MapLayer* parent, Floorplan::Floor* floor) : MapLayer(parent, MapLayerType::FLOOR), floor(floor) {
|
||||
MMFloor(MapLayer* parent, Floorplan::IndoorMap* map, Floorplan::Floor* floor) : MapLayer(parent, MapLayerType::FLOOR), map(map), floor(floor) {
|
||||
|
||||
new MMFloorUnderlays(this, floor);
|
||||
elements.push_back(new MMFloorOutline(this, floor));
|
||||
@@ -56,12 +58,14 @@ public:
|
||||
std::string getLayerName() const override {return floor->name;}
|
||||
|
||||
virtual int getNumParams() const override {
|
||||
return 1;
|
||||
return 3;
|
||||
}
|
||||
|
||||
virtual Param getParamDesc(const int idx) const override {
|
||||
switch(idx) {
|
||||
case 0: return Param("anem", ParamType::STRING);
|
||||
case 0: return Param("name", ParamType::STRING);
|
||||
case 1: return Param("height", ParamType::FLOAT);
|
||||
case 2: return Param("at height", ParamType::FLOAT);
|
||||
}
|
||||
throw 1;
|
||||
}
|
||||
@@ -69,6 +73,8 @@ public:
|
||||
virtual ParamValue getParamValue(const int idx) const override {
|
||||
switch(idx) {
|
||||
case 0: return floor->name;
|
||||
case 1: return floor->height;
|
||||
case 2: return floor->atHeight;
|
||||
}
|
||||
throw 1;
|
||||
}
|
||||
@@ -76,9 +82,16 @@ public:
|
||||
virtual void setParamValue(const int idx, const ParamValue& val) const override {
|
||||
switch(idx) {
|
||||
case 0: floor->name = val.toString(); break;
|
||||
case 1: floor->height = val.toFloat(); break;
|
||||
case 2: floor->atHeight = val.toFloat(); break;
|
||||
}
|
||||
}
|
||||
|
||||
void deleteMe() {
|
||||
parent->removeSublayer(this);
|
||||
map->floors.erase(std::remove(map->floors.begin(), map->floors.end(), floor), map->floors.end());
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif // MMFLOOR_H
|
||||
|
||||
Reference in New Issue
Block a user