fixed some issues
added new tools for creating APs, Beacons, GTP, POI, Fingerprints fixed selection issue changed new-element creation added missing layer parameters
This commit is contained in:
@@ -18,7 +18,7 @@ public:
|
||||
}
|
||||
|
||||
void becomesActive() override {
|
||||
create(); // start adding an new element
|
||||
//create(); // start adding an new element
|
||||
emit onHelpTextChange("click for the stair's starting point");
|
||||
}
|
||||
|
||||
@@ -30,23 +30,59 @@ public:
|
||||
return "new Stair";
|
||||
}
|
||||
|
||||
void createEmptyElement() override {
|
||||
|
||||
foEL = new Floorplan::StairFreeform();
|
||||
foEL->parts.resize(1);
|
||||
MMFloorStairs* stairs = (MMFloorStairs*)layer;
|
||||
mmEL = stairs->create(foEL);
|
||||
|
||||
}
|
||||
|
||||
/** mouse is currently moved */
|
||||
void moving(const Point2 mapPoint) override {
|
||||
|
||||
if (idx == 0) {
|
||||
if (idx > 0) {
|
||||
setPoint(idx, mapPoint);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/** next point */
|
||||
void leftMouse(const Point2 mapPoint) override {
|
||||
|
||||
(void) mapPoint;
|
||||
|
||||
// start a new stair here
|
||||
if (idx == 0) {
|
||||
createEmptyElement();
|
||||
} else {
|
||||
;
|
||||
}
|
||||
|
||||
// add a new part to the stair
|
||||
Floorplan::StairPart sp;
|
||||
sp.connectWithPrev = false;
|
||||
sp.width = 1.5;
|
||||
foEL->parts.push_back(sp);
|
||||
|
||||
setPoint(idx, mapPoint); // current element (finished)
|
||||
++idx;
|
||||
setPoint(idx, mapPoint); // new element (start at the current)
|
||||
|
||||
emit onHelpTextChange("right-click: set end + start new part, left-click set end + finish");
|
||||
|
||||
}
|
||||
|
||||
void rightMouse(const Point2 mapPoint) override {
|
||||
|
||||
(void) mapPoint;
|
||||
|
||||
finalizeCurrent();
|
||||
disableMe();
|
||||
idx = 0;
|
||||
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
void setPoint(const int idx, const Point2 mapPoint) {
|
||||
|
||||
if (idx == 0) {
|
||||
Floorplan::StairPart& part = foEL->parts[0];
|
||||
part.connectWithPrev = false;
|
||||
part.width = 1.5;
|
||||
part.start = Point3(mapPoint.x, mapPoint.y, 0);
|
||||
part.end = part.start;
|
||||
|
||||
@@ -54,10 +90,9 @@ public:
|
||||
Floorplan::StairPart& part = foEL->parts[0];
|
||||
part.end = Point3(mapPoint.x, mapPoint.y, 0);
|
||||
|
||||
} else {
|
||||
} else if (idx > 1) {
|
||||
Floorplan::StairPart& p1 = foEL->parts[idx-2];
|
||||
Floorplan::StairPart& p2 = foEL->parts[idx-1];
|
||||
p2.width = 1.5;
|
||||
p2.start = p1.end;
|
||||
p2.end = Point3(mapPoint.x, mapPoint.y, 0);
|
||||
|
||||
@@ -65,16 +100,12 @@ public:
|
||||
|
||||
}
|
||||
|
||||
/** next point */
|
||||
void leftMouse() override {
|
||||
++idx;
|
||||
foEL->parts.resize(idx);
|
||||
emit onHelpTextChange("right-click: set end + start new part, left-click set end + finish");
|
||||
}
|
||||
void createEmptyElement() {
|
||||
|
||||
foEL = new Floorplan::StairFreeform();
|
||||
MMFloorStairs* stairs = (MMFloorStairs*)layer;
|
||||
mmEL = stairs->create(foEL);
|
||||
|
||||
void rightMouse() override {
|
||||
finalizeCurrent();
|
||||
disableMe();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user