modified the groundtruthpoints to 3D
This commit is contained in:
@@ -94,7 +94,7 @@ MainController::MainController() {
|
||||
connect(mw, &MainWindow::onGridShowEdges, [&] (const bool show) {mw->getMapView3D()->getGridRenderer()->setShowEdges(show);} );
|
||||
|
||||
|
||||
mapModel->load("../IndoorMap/maps/SHL32.xml");
|
||||
mapModel->load("../IndoorMap/maps/SHL33_gt.xml");
|
||||
//mapModel->resize(0.983, 0.983, 1, -0.2, -0.3, 0);
|
||||
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ public:
|
||||
|
||||
/** get the element's minimal distance (nearest whatsoever) to the given point */
|
||||
ClickDist getMinDistanceXY(const Point2 p) const override {
|
||||
return ClickDist(p.getDistance(gtp->pos), ClickDistType::DIRECT);
|
||||
return ClickDist(p.getDistance(gtp->pos.xy()), ClickDistType::DIRECT);
|
||||
}
|
||||
|
||||
/** repaint me */
|
||||
@@ -45,20 +45,20 @@ public:
|
||||
if (selectedUserIdx == 0) {
|
||||
// p.setPenBrush(Qt::black, CFG::SEL_COLOR);
|
||||
// p.drawCircle(gtp->pos);
|
||||
p.drawPixmap(gtp->pos, pixmapSel);
|
||||
p.drawPixmap(gtp->pos.xy(), pixmapSel);
|
||||
} else if (hasFocus()) {
|
||||
// p.setPenBrush(Qt::black, Qt::NoBrush);
|
||||
// p.drawCircle(gtp->pos);
|
||||
p.drawPixmap(gtp->pos, pixmapFocused);
|
||||
p.drawPixmap(gtp->pos.xy(), pixmapFocused);
|
||||
} else {
|
||||
// p.setPenBrush(Qt::gray, Qt::NoBrush);
|
||||
// p.drawCircle(gtp->pos);
|
||||
p.drawPixmap(gtp->pos, pixmapUnfocused);
|
||||
p.drawPixmap(gtp->pos.xy(), pixmapUnfocused);
|
||||
}
|
||||
|
||||
// label
|
||||
p.setPenBrush(Qt::black, Qt::NoBrush);
|
||||
p.drawDot(gtp->pos);
|
||||
p.drawDot(gtp->pos.xy());
|
||||
if (p.getScaler().getScale() >= 10) {
|
||||
const std::string str = std::to_string(gtp->id);
|
||||
p.p->drawText(p.getScaler().xms(gtp->pos.x) + 10, p.getScaler().yms(gtp->pos.y) + 5, str.c_str());
|
||||
@@ -68,12 +68,12 @@ public:
|
||||
|
||||
|
||||
virtual std::vector<MoveableNode> getMoveableNodes() const override {
|
||||
return { MoveableNode(0, gtp->pos) };
|
||||
return { MoveableNode(0, gtp->pos.xy()) };
|
||||
}
|
||||
|
||||
virtual void onNodeMove(MapView2D* v, const int userIdx, const Point2 newPos) override {
|
||||
(void) v;
|
||||
if (userIdx == 0) {gtp->pos = newPos;}
|
||||
if (userIdx == 0) {gtp->pos.x = newPos.x; gtp->pos.y = newPos.y;}
|
||||
}
|
||||
|
||||
|
||||
@@ -87,11 +87,6 @@ public:
|
||||
virtual void mouseMove(MapView2D* v, const Point2 p) override {
|
||||
(void) v;
|
||||
(void) p;
|
||||
// if (sel) {
|
||||
// const Point2 p = v->getScaler().snap(_p);
|
||||
// gtp->pos.x = p.x;
|
||||
// gtp->pos.y = p.y;
|
||||
// }
|
||||
}
|
||||
|
||||
/** mouse released */
|
||||
|
||||
@@ -29,7 +29,7 @@ public:
|
||||
virtual Param getParamDesc(const int idx) const override {
|
||||
switch(idx) {
|
||||
case 0: return Param("id", ParamType::INT);
|
||||
case 1: return Param("position", ParamType::POINT2);
|
||||
case 1: return Param("position", ParamType::POINT3);
|
||||
}
|
||||
throw 1;
|
||||
}
|
||||
@@ -45,7 +45,7 @@ public:
|
||||
virtual void setParamValue(const int idx, const ParamValue& val) const override {
|
||||
switch(idx) {
|
||||
case 0: gtp->id = val.toInt(); break;
|
||||
case 1: gtp->pos = val.toPoint2(); break;
|
||||
case 1: gtp->pos = val.toPoint3(); break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -507,7 +507,7 @@ void ToolBoxWidget::onNewGTP() {
|
||||
|
||||
const Point2 center = view->getScaler().getCenter();
|
||||
Floorplan::GroundTruthPoint* gtp = new Floorplan::GroundTruthPoint(
|
||||
0, Point2(center.x, center.y)
|
||||
0, Point3(center.x, center.y, 0)
|
||||
);
|
||||
|
||||
MMFloorGroundTruthPoints* gtps = (MMFloorGroundTruthPoints*) curLayer;
|
||||
|
||||
Reference in New Issue
Block a user