a lot of work on th map-creator
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user