added "new map" button

fixed minor model/logic issues
This commit is contained in:
2017-05-24 17:54:09 +02:00
parent 6fb1c3a5fc
commit 489a64fd69
8 changed files with 49 additions and 7 deletions

View File

@@ -185,12 +185,21 @@ void MapView3D::showFloorplan() {
}
void MapView3D::showGrid() {
// delete the previous grid (if any)
if (gridModel) {delete gridModel; gridModel = nullptr;}
// build a new model
GridModel* gm = new GridModel();
Floorplan::IndoorMap* im = getModel()->getMap();
gm->rebuild(im);
// remember
this->gridModel = gm;
// update UI
update();
}
void MapView3D::draw() {