many changes :P

This commit is contained in:
kazu
2016-06-06 22:08:53 +02:00
parent db6b479d86
commit 6243165084
56 changed files with 4399 additions and 245 deletions

View File

@@ -4,6 +4,7 @@
#include "mapview/model/MapModel.h"
#include "mapview/model/MapModelElement.h"
#include "mapview/tools/ToolSelector.h"
#include "mapview/tools/ToolMoveMap.h"
#include "mapview/tools/ToolMapZoom.h"
@@ -26,11 +27,17 @@ MainController::MainController() {
mw->resize(1000, 700);
MapView2D* mapView2D = mw->getMapView2D();
MapView3D* mapView3D = mw->getMapView3D();
QTreeView* layerTree = mw->getTree();
// model setup
mapModel = new MapModel();
//mapModel->load("/apps/android/workspace/IndoorApp/res/map.xml");
mapView2D->setModel(mapModel);
mapView3D->setModel(mapModel);
mapTreeModel = new MapTreeModel(mapModel);
layerTree->setModel(mapTreeModel);
ToolMoveMap* moveMap = new ToolMoveMap();
ToolRuler* ruler = new ToolRuler();
@@ -44,19 +51,32 @@ MainController::MainController() {
mapView2D->getTools().enable(mapSelector);
mapView2D->getTools().enable(ruler);
mapTreeModel = new MapTreeModel(mapModel);
layerTree->setModel(mapTreeModel);
connect(layerTree, SIGNAL(clicked(QModelIndex)), this, SLOT(layerSelected(QModelIndex)));
connect(mapSelector, SIGNAL(onMapElementSelected(MapModelElement*)), this, SLOT(mapElementSelected(MapModelElement*)));
connect(mw->getActionWidget(), SIGNAL(onLoad()), this, SLOT(onLoad()));
connect(mw->getActionWidget(), SIGNAL(onSave()), this, SLOT(onSave()));
// model events
connect(mapModel, SIGNAL(aboutToReset()), this, SLOT(onMapModelAboutToReset()));
connect(mapModel, SIGNAL(reset()), this, SLOT(onMapModelReset()));
mapModel->load("/apps/map9.xml");
// load/save
connect(mw->getActionWidget(), SIGNAL(onLoad()), this, SLOT(onLoad()));
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()));
mapModel->load("../IndoorMap/maps/SHL9.xml");
}
void MainController::onShow3DFloorplan() {
mw->getMapView3D()->showFloorplan();
}
void MainController::onShow3DGrid() {
mw->getMapView3D()->showGrid();
}
void MainController::layerSelected(QModelIndex idx) {