SceneEditorWidget.h
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
24#pragma once
25
26/* Qt headers */
27#include <QButtonGroup>
28#include <QLabel>
29#include <QPointer>
30#include <QPushButton>
31#include <QResizeEvent>
32#include <QVBoxLayout>
33#include <QWidget>
34
36#include "ScenegraphWidget.h"
37
38namespace Ui
39{
40 class SceneEditorWidget;
41}
42
43namespace gui
44{
45 /**
46 * This class provides a widget which contains all buttons for the scene.
47 *
48 * @see gui::SceneGraphWidget
49 *
50 */
51 class SceneEditorWidget : public QWidget
52 {
53 Q_OBJECT
54
55 public:
56 /**
57 * Constructor.
58 * Constructs a scene editor widget.
59 * Expects controller::ControllerPtr to trigger operations.
60 *
61 * @param control shared pointer to controller::Controller
62 * @param parent parent widget
63 *
64 */
65 explicit SceneEditorWidget(const controller::ControllerPtr& control, QWidget* parent = 0);
66
67 ~SceneEditorWidget() override;
68
69 /**
70 * Translates all translatable strings in this dialog.
71 */
72 void retranslate();
73
74 void postDocking();
75
76 Q_SIGNALS:
77
78 /**
79 * Signal emitted when the size of the widget has changed.
80 *
81 */
82 void sizeChangedSignal(QSize newSize);
83
84 private Q_SLOTS:
85 void sizeChanged(QSize newSize);
86 void undoButtonReleased();
87 void redoButtonReleased();
88 void removeSelectedObjectsButtonReleased();
89 void collisionMeshToggleButtonToggled(bool checked);
90 void rotateManipulatorToggleButtonToggled(bool checked);
91 void translateManipulatorToggleButtonToggled(bool checked);
92 void editorViewerButtonGroupButtonClicked(int id);
93 void toggleEditorViewerMode();
94
95 private:
96 void resizeEvent(QResizeEvent* event) override;
97
99 QPointer<ScenegraphWidget> sceneGraph;
100 QPointer<QPushButton> collisionMeshToggleButton;
101 QPointer<QPushButton> rotateManipulatorToggleButton;
102 QPointer<QPushButton> translateManipulatorToggleButton;
103 QPointer<QPushButton> undoButton;
104 QPointer<QPushButton> redoButton;
105 QPointer<QPushButton> removeSelectedObjectsButton;
106 QPointer<QPushButton> editorToggleButton;
107 QPointer<QPushButton> viewerToggleButton;
108 QPointer<QButtonGroup> editorViewerButtonGroup;
109 QPointer<QVBoxLayout> mainLayout;
110 QSize leftButtonsSize;
111 QString buttonColor;
112 int margin;
113 int spacing;
114 static const int VIEWER_BUTTON_ID = 0;
115 static const int EDITOR_BUTTON_ID = 1;
116 bool showCollisionMesh;
117 bool showTranslateManipulator;
118 bool showRotateManipulator;
119 };
120} // namespace gui
void sizeChangedSignal(QSize newSize)
Signal emitted when the size of the widget has changed.
void retranslate()
Translates all translatable strings in this dialog.
SceneEditorWidget(const controller::ControllerPtr &control, QWidget *parent=0)
Constructor.
ArmarX Headers.
This file is part of ArmarX.
std::weak_ptr< Controller > ControllerWeakPtr
std::shared_ptr< Controller > ControllerPtr