a lot of work on th map-creator

This commit is contained in:
2016-07-04 15:11:10 +02:00
parent 6243165084
commit 2935f468fc
61 changed files with 2612 additions and 3342 deletions

View File

@@ -21,6 +21,10 @@
#include <QFileDialog>
#include <QTreeView>
#include "mapview/3DGrid/GridRenderer.h"
MainController::MainController() {
mw = new MainWindow();
@@ -53,6 +57,7 @@ MainController::MainController() {
connect(layerTree, SIGNAL(clicked(QModelIndex)), this, SLOT(layerSelected(QModelIndex)));
connect(mapSelector, SIGNAL(onMapElementSelected(MapModelElement*)), this, SLOT(mapElementSelected(MapModelElement*)));
connect(mw->getMapView2D(), SIGNAL(onElementChange(MV2DElement*)), this, SLOT(curMapElementChanged()));
// model events
connect(mapModel, SIGNAL(aboutToReset()), this, SLOT(onMapModelAboutToReset()));
@@ -63,11 +68,17 @@ MainController::MainController() {
connect(mw->getActionWidget(), SIGNAL(onSave()), this, SLOT(onSave()));
// 3D view change
connect(mw->getShow3DFloorplan(), SIGNAL(triggered(bool)), this, SLOT(onShow3DFloorplan()));
connect(mw->getShow3DGrid(), SIGNAL(triggered(bool)), this, SLOT(onShow3DGrid()));
connect(mw, SIGNAL(onShow3DFloorplan()), this, SLOT(onShow3DFloorplan()));
connect(mw, SIGNAL(onShow3DGrid()), this, SLOT(onShow3DGrid()));
// 3D grid view config
connect(mw, &MainWindow::onGridNodeColorImp, [&] () {mw->getMapView3D()->getGridRenderer()->setNodeColorMode(GridRendererColorMode::SHOW_NODE_IMPORTANCE);} );
connect(mw, &MainWindow::onGridNodeColorType, [&] () {mw->getMapView3D()->getGridRenderer()->setNodeColorMode(GridRendererColorMode::SHOW_NODE_TYPE);} );
connect(mw, &MainWindow::onGridShowEdges, [&] (const bool show) {mw->getMapView3D()->getGridRenderer()->setShowEdges(show);} );
mapModel->load("../IndoorMap/maps/SHL9.xml");
mapModel->load("../IndoorMap/maps/SHL17.xml");
//mapModel->load("../IndoorMap/maps/test.xml");
}
@@ -84,9 +95,13 @@ void MainController::layerSelected(QModelIndex idx) {
MapLayer* ml = static_cast<MapLayer*>(idx.internalPointer());
mapModel->setSelectedLayer(ml);
mw->getMapView2D()->layerChange();
mw->getMapView3D()->layerChange();
mw->getLayerParamWidget()->setElement(ml);
mw->getToolBoxWidget()->setSelectedLayer(ml);
}
void MainController::curMapElementChanged() {
mw->getElementParamWidget()->refresh();
}
void MainController::mapElementSelected(MapModelElement* el) {