90 lines
2.4 KiB
C++
90 lines
2.4 KiB
C++
#include "MainWindow.h"
|
|
#include "ui_MainWindow.h"
|
|
|
|
#include <QGraphicsScene>
|
|
|
|
#include "mapview/MapView2D.h"
|
|
|
|
#include "mapview/model/MMFloorObstacleLine.h"
|
|
|
|
#include <Indoor/floorplan/v2/Floorplan.h>
|
|
|
|
#include "mapview/3D/MapView3D.h"
|
|
|
|
#include "mapview/tools/ToolMoveMap.h"
|
|
#include "mapview/tools/ToolRuler.h"
|
|
#include "mapview/tools/ToolMapZoom.h"
|
|
|
|
#include "params/ElementParamWidget.h"
|
|
#include "params/LayerParamWidget.h"
|
|
#include "params/ActionWidget.h"
|
|
#include "params/ToolBoxWidget.h"
|
|
|
|
#include "tree/MapTreeModel.h"
|
|
|
|
|
|
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) {
|
|
|
|
ui->setupUi(this);
|
|
|
|
QString css;
|
|
css += "QPushButton { border: 1px solid #000000; background-color: #ffffff; }";
|
|
css += "QPushButton:!enabled { border: 1px solid #cccccc; background-color:none; }";
|
|
css += "QPushButton:hover { border: 1px solid #000000; background-color: #dddddd; }";
|
|
css += "QPushButton:pressed { border: 1px solid #000000; background-color: #bbbbbb; }";
|
|
|
|
this->setStyleSheet(css);
|
|
|
|
mapView2D = new MapView2D();
|
|
mapView3D = new MapView3D();
|
|
|
|
elementParamWidget = new ElementParamWidget();
|
|
layerParamWidget = new LayerParamWidget();
|
|
actionWidget = new ActionWidget();
|
|
toolBoxWidget = new ToolBoxWidget(mapView2D);
|
|
|
|
ui->layButtons->addWidget(toolBoxWidget);
|
|
|
|
ui->layMap->addWidget(mapView2D);
|
|
ui->layMap->addWidget(mapView3D);
|
|
|
|
ui->layTree->addWidget(layerParamWidget);
|
|
ui->layTree->addWidget(elementParamWidget);
|
|
ui->layTree->addWidget(actionWidget);
|
|
|
|
|
|
// show mode
|
|
QActionGroup* grpMode = new QActionGroup(this);
|
|
grpMode->addAction(ui->actShow3DFloorplan);
|
|
grpMode->addAction(ui->actShow3DGrid);
|
|
|
|
connect(ui->actShow2D, SIGNAL(triggered(bool)), this, SIGNAL(onShow2D()));
|
|
connect(ui->actShow3DGrid, SIGNAL(triggered(bool)), this, SIGNAL(onShow3DGrid()));
|
|
connect(ui->actShow3DFloorplan, SIGNAL(triggered(bool)), this, SIGNAL(onShow3DFloorplan()));
|
|
|
|
|
|
// node coloring
|
|
QActionGroup* grpNodeCol = new QActionGroup(this);
|
|
grpNodeCol->addAction(ui->actGridNodeColorImportance);
|
|
grpNodeCol->addAction(ui->actGridNodeColorType);
|
|
|
|
connect(ui->actGridNodeColorImportance, SIGNAL(triggered(bool)), this, SIGNAL(onGridNodeColorImp()));
|
|
connect(ui->actGridNodeColorType, SIGNAL(triggered(bool)), this, SIGNAL(onGridNodeColorType()));
|
|
|
|
// edges
|
|
connect(ui->actGridShowEdges, &QAction::triggered, this, &MainWindow::onGridShowEdges);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
MainWindow::~MainWindow() {
|
|
delete ui;
|
|
}
|
|
|
|
|
|
QTreeView* MainWindow::getTree() {
|
|
return ui->layerTree;
|
|
}
|