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:
@@ -15,7 +15,7 @@ private:
|
||||
public:
|
||||
|
||||
ToolNewOutline(Tools& tools, MapLayer* layer) : ToolNewElement(tools, layer) {
|
||||
create();
|
||||
//create();
|
||||
}
|
||||
|
||||
const std::string getName() const override {
|
||||
@@ -26,32 +26,41 @@ public:
|
||||
emit onHelpTextChange("left-click for each edge of the outline. right-click to end");
|
||||
}
|
||||
|
||||
void createEmptyElement() override {
|
||||
|
||||
foEL = new Floorplan::FloorOutlinePolygon();
|
||||
foEL->poly.points.resize(1);
|
||||
foEL->outdoor = false;
|
||||
foEL->method = Floorplan::OutlineMethod::ADD;
|
||||
|
||||
MMFloorOutline* outlines = (MMFloorOutline*)layer;
|
||||
mmEL = outlines->create(foEL);
|
||||
|
||||
}
|
||||
|
||||
/** mouse is currently moved */
|
||||
void moving(const Point2 mapPoint) override {
|
||||
foEL->poly.points[idx] = mapPoint;
|
||||
if (idx > 0) {
|
||||
setPoint(idx, mapPoint);
|
||||
}
|
||||
}
|
||||
|
||||
/** next point */
|
||||
void leftMouse() override {
|
||||
void leftMouse(const Point2 mapPoint) override {
|
||||
|
||||
(void) mapPoint;
|
||||
|
||||
// 1st click
|
||||
if (idx == 0) {
|
||||
createEmptyElement();
|
||||
foEL->poly.points.resize(foEL->poly.points.size() + 1);
|
||||
} else {
|
||||
;
|
||||
}
|
||||
|
||||
foEL->poly.points.resize(foEL->poly.points.size() + 1);
|
||||
setPoint(idx, mapPoint); // current element (finished)
|
||||
++idx;
|
||||
foEL->poly.points.resize(idx+1);
|
||||
foEL->poly.points.back() = foEL->poly.points[idx-1];
|
||||
setPoint(idx, mapPoint); // new element (start at the current)
|
||||
|
||||
emit onHelpTextChange("left-click to add, right-click to end");
|
||||
|
||||
}
|
||||
|
||||
void rightMouse() override {
|
||||
void rightMouse(const Point2 mapPoint) override {
|
||||
|
||||
(void) mapPoint;
|
||||
|
||||
if (idx >= 3) {
|
||||
finalizeCurrent();
|
||||
} else {
|
||||
@@ -60,6 +69,22 @@ public:
|
||||
disableMe();
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
void setPoint(const int idx, const Point2 mapPoint) {
|
||||
foEL->poly.points[idx] = mapPoint;
|
||||
}
|
||||
|
||||
void createEmptyElement() {
|
||||
|
||||
foEL = new Floorplan::FloorOutlinePolygon();
|
||||
foEL->outdoor = false;
|
||||
foEL->method = Floorplan::OutlineMethod::ADD;
|
||||
|
||||
MMFloorOutline* outlines = (MMFloorOutline*)layer;
|
||||
mmEL = outlines->create(foEL);
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user