SceneEditorMainWindow.cpp
Go to the documentation of this file.
1/*
2 * This file is part of ArmarX.
3 *
4 * Copyright (C) 2012-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5 *
6 * ArmarX is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * ArmarX is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 *
18 * @package MemoryX::gui-plugins::SceneEditor
19 * @date 2015
20 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
21 * GNU General Public License
22 */
23
25
26#include <QActionGroup>
27#include <QDockWidget>
28
30
33 QPointer<dialog::GroupExplorerDialog> groupEditorDialog,
34 QWidget* parent) :
35 QMainWindow(parent), groupEditorDialog(groupEditorDialog)
36{
37 // create DockWidget for Object Inspector
38 objectInspectorDock = new gui::CollapsibleDockWidget(tr("Object Inspector"), this);
39 objectInspectorDock->setFeatures(QDockWidget::NoDockWidgetFeatures);
40 objectInspectorDock->setAllowedAreas(Qt::LeftDockWidgetArea);
41 objectInspector = new ObjectInspectorWidget(control, objectInspectorDock);
42 objectInspectorDock->setCollapsibleWidget(objectInspector);
43 addDockWidget(Qt::LeftDockWidgetArea, objectInspectorDock);
44
45 // create DockWidget for Object Explorer
46 objectExplorerDock = new gui::CollapsibleDockWidget(tr("Object Explorer"), this);
47 objectExplorerDock->setFeatures(QDockWidget::NoDockWidgetFeatures);
48 objectExplorerDock->setAllowedAreas(Qt::RightDockWidgetArea);
49 objectExplorer = new ObjectExplorerWidget(control, objectExplorerDock);
50 objectExplorerDock->setCollapsibleWidget(objectExplorer);
51 addDockWidget(Qt::RightDockWidgetArea, objectExplorerDock);
52
53 // create DockWidget for Minimap
54 minimapDock = new gui::CollapsibleDockWidget(tr("Minimap"), this);
55 minimapDock->setFeatures(QDockWidget::NoDockWidgetFeatures);
56 minimapDock->setAllowedAreas(Qt::LeftDockWidgetArea);
57 minimap = new MinimapWidget(control, minimapDock);
58 minimapDock->setCollapsibleWidget(minimap);
59 addDockWidget(Qt::LeftDockWidgetArea, minimapDock);
60
61 // create DockWidget for Group Explorer
62 groupExplorerDock = new gui::CollapsibleDockWidget(tr("Group Explorer"), this);
63 groupExplorerDock->setFeatures(QDockWidget::NoDockWidgetFeatures);
64 groupExplorerDock->setAllowedAreas(Qt::RightDockWidgetArea);
65 groupExplorer = new GroupExplorerWidget(control, groupEditorDialog, groupExplorerDock);
66 groupExplorerDock->setCollapsibleWidget(groupExplorer);
67 addDockWidget(Qt::RightDockWidgetArea, groupExplorerDock);
68
69 mainControl = control;
70}
71
75
76void
78{
79 // set SceneEditorWidget as centralWidget
80 scene = new SceneEditorWidget(mainControl, this->centralWidget());
81 setCentralWidget(scene);
82 this->setEnabled(false);
83
84 scene->postDocking();
85}
86
87void
89{
90 objectExplorer->onConnect();
91}
92
93void
97
98void
100{
101 if (event->type() == QEvent::LanguageChange)
102 {
103 groupExplorer->retranslate();
104 objectInspector->retranslate();
105 objectExplorer->retranslate();
106 scene->retranslate();
107 groupEditorDialog->retranslate();
108 objectExplorerDock->setWindowTitle(tr("Object Explorer"));
109 objectExplorerDock->windowTitleChanged();
110 objectInspectorDock->setWindowTitle(tr("Object Inspector"));
111 objectInspectorDock->windowTitleChanged();
112 groupExplorerDock->setWindowTitle(tr("Group Explorer"));
113 groupExplorerDock->windowTitleChanged();
114 minimapDock->setWindowTitle(tr("Minimap"));
115 minimapDock->windowTitleChanged();
116
118 }
119 else
120 {
121 QMainWindow::changeEvent(event);
122 }
123}
A QDockWidget which provides the possibility to collapse the dock.
This class provides a QWidget which displays all existing groups in the local scene.
This class is a widget which provides a scene3D::MinimapViewer to render the scene graph in bird pers...
This class provides a QWidget which displays all object classes from PriorKnowledge in their collecti...
This class provides a widget which displays all class and instance attributes of a currently selected...
void changeEvent(QEvent *event) override
Reimplements Qt::QWidget:changeEvent().
~SceneEditorMainWindow() override
Destructor.
void languageChangedByUser()
Signal emitted when user changed current language.
void onConnect()
Enables main window and updates its widgets.
void onDisconnect()
Disables main window.
SceneEditorMainWindow(const controller::ControllerPtr &control, QPointer< dialog::GroupExplorerDialog > groupEditorDialog, QWidget *parent=0)
Constructor.
This class provides a widget which contains all buttons for the scene.
This file is part of ArmarX.
std::shared_ptr< Controller > ControllerPtr