/* * © Copyright 2014 – Urheberrechtshinweis * Alle Rechte vorbehalten / All Rights Reserved * * Programmcode ist urheberrechtlich geschuetzt. * Das Urheberrecht liegt, soweit nicht ausdruecklich anders gekennzeichnet, bei Frank Ebner. * Keine Verwendung ohne explizite Genehmigung. * (vgl. § 106 ff UrhG / § 97 UrhG) */ #include "fixC11.h" #include "MainWindow.h" #include "ui_MainWindow.h" #include #include #include "misc/LINTView.h" #include "mapview/2D/MapView2D.h" #include "mapview/model/MMFloorObstacleLine.h" #include #include "mapview/3D/MapView3D.h" #include "mapview/2D/tools/ToolMoveMap.h" #include "mapview/2D/tools/ToolRuler.h" #include "mapview/2D/tools/ToolMapZoom.h" #include "params/ElementParamWidget.h" #include "params/LayerParamWidget.h" #include "params/ActionWidget.h" #include "params/ToolBoxWidget.h" #include "params/LayerTree.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); { layerTree = new LayerTree(); QString css; //css += "QTreeView::item:selected:active {background-color: #888888;}"; //css += "QTreeView::item:selected:!active {background-color: #888888;}"; layerTree->setStyleSheet(css); } mapView2D = new MapView2D(); mapView3D = new MapView3D(); lintView = new LINTView(); elementParamWidget = new ElementParamWidget(); layerParamWidget = new LayerParamWidget(); actionWidget = new ActionWidget(); toolBoxWidget = new ToolBoxWidget(mapView2D); // toolbox QDockWidget* toolBoxWidgetDock = new QDockWidget("", this); toolBoxWidgetDock->setWidget(toolBoxWidget); toolBoxWidgetDock->setFixedWidth(64-11); addDockWidget(Qt::LeftDockWidgetArea, toolBoxWidgetDock); // layers QDockWidget* layerTreeDock = new QDockWidget("layers", this); layerTreeDock->setWidget(layerTree); addDockWidget(Qt::RightDockWidgetArea, layerTreeDock); // layer params QDockWidget* layerParamWidgetDock = new QDockWidget("layer params", this); layerParamWidgetDock->setWidget(layerParamWidget); addDockWidget(Qt::RightDockWidgetArea, layerParamWidgetDock); // element params QDockWidget* elementParamWidgetDock = new QDockWidget("element params", this); elementParamWidgetDock->setWidget(elementParamWidget); addDockWidget(Qt::RightDockWidgetArea, elementParamWidgetDock); // actions QDockWidget* actionWidgetDock = new QDockWidget("actions", this); actionWidgetDock->setWidget(actionWidget); addDockWidget(Qt::RightDockWidgetArea, actionWidgetDock); // status statusBar = new QStatusBar(); this->setStatusBar(statusBar); QHBoxLayout* layStatus = new QHBoxLayout(statusBar); statusBar->setLayout(layStatus); statusBarText1 = new QLabel(statusBar); layStatus->addWidget(statusBarText1); statusBarText1->setMinimumWidth(400); // tools connect(&mapView2D->getTools(), &Tools::onHelpTextChange, [&] (QString txt) { statusBarText1->setText(txt); }); QSplitter* splitter = new QSplitter(Qt::Orientation::Vertical); setCentralWidget(splitter); splitter->addWidget(mapView2D); splitter->addWidget(mapView3D); splitter->addWidget(lintView); // // 2D View // QDockWidget* mapView2DDoc = new QDockWidget("2D", this); mapView2DDoc->setWidget(mapView2D); // addDockWidget(Qt::AllDockWidgetAreas, mapView2DDoc); // // 3D View // QDockWidget* mapView3DDoc = new QDockWidget("3D", this); mapView3DDoc->setWidget(mapView3D); // addDockWidget(Qt::AllDockWidgetAreas, mapView3DDoc); // 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 (radio buttons) // QActionGroup* grpMode = new QActionGroup(this); // grpMode->addAction(ui->actShow3DFloorplan); // grpMode->addAction(ui->actShow3DGrid); // grpMode->addAction(ui->actShow3DNavMesh); connect(ui->actShow2D, SIGNAL(triggered(bool)), this, SIGNAL(onShow2D())); connect(ui->actShow3DGrid, SIGNAL(triggered(bool)), this, SIGNAL(onShow3DGrid(bool))); connect(ui->actShow3DFloorplan, SIGNAL(triggered(bool)), this, SIGNAL(onShow3DFloorplan(bool))); connect(ui->actShow3DNavMesh, SIGNAL(triggered(bool)), this, SIGNAL(onShow3DNavMesh(bool))); // 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; }