ObjectInspectorWidget.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 <QWidget>
28 #include <QPointer>
29 
30 #include "../controller/Controller.h"
31 #include "../scene3D/SceneObject.h"
32 #include "../scene3D/ObjectPreviewViewer.h"
33 #include "PropertyBrowserWidget.h"
34 
35 namespace Ui
36 {
37  class ObjectInspectorWidget;
38 }
39 
40 using ObjectPreviewViewerPtr = std::shared_ptr<scene3D::ObjectPreviewViewer>;
41 
42 namespace gui
43 {
44  /**
45  * This class provides a widget which displays all class and instance attributes of a currently selected scene3D::SceneObject or a memoryx::ObjectClassPtr in a tree view.
46  *
47  */
48  class ObjectInspectorWidget : public QWidget
49  {
50  Q_OBJECT
51 
52  public:
53 
54  /**
55  * Constructor.
56  * Constructs an instance of ObjectInspectorWidget.
57  * Expects a controller::ControllerPtr to get information about the scene and the MemoryX.
58  *
59  */
60  explicit ObjectInspectorWidget(const controller::ControllerPtr& control, QWidget* parent = 0);
61 
62  /**
63  * Destructor.
64  *
65  */
66  ~ObjectInspectorWidget() override;
67 
68  /**
69  * Translates all translatable strings in this dialog.
70  */
71  void retranslate();
72 
73  private Q_SLOTS:
74  void setAllAttributes(scene3D::SceneObjectPtr sceneObject);
75  void setClassAttributes(const std::string& objectClass, const std::string& collection);
76  void sceneObjectsUpdated(controller::vector_string objectIds);
77 
78  private:
80  QPointer<gui::PropertyBrowserWidget> propertyBrowser;
82  std::string currentObjectId;
83 
84  void showPreviewImage(const memoryx::ObjectClassPtr& objectClass);
85  memoryx::ObjectClassPtr getObjectClass(const std::string& objectClass, const std::string& collection);
86  };
87 }
88 
controller::ControllerWeakPtr
std::weak_ptr< Controller > ControllerWeakPtr
Definition: ClassDefinitions.h:42
ObjectPreviewViewerPtr
std::shared_ptr< scene3D::ObjectPreviewViewer > ObjectPreviewViewerPtr
Definition: ObjectInspectorWidget.h:40
IceInternal::Handle< ObjectClass >
controller::vector_string
std::vector< std::string > vector_string
Definition: Controller.h:47
gui::ObjectInspectorWidget
This class provides a widget which displays all class and instance attributes of a currently selected...
Definition: ObjectInspectorWidget.h:48
Ui
ArmarX Headers.
Definition: ArmarXMainWindow.h:54
controller::ControllerPtr
std::shared_ptr< Controller > ControllerPtr
Definition: ClassDefinitions.h:41
PropertyBrowserWidget.h
gui::ObjectInspectorWidget::ObjectInspectorWidget
ObjectInspectorWidget(const controller::ControllerPtr &control, QWidget *parent=0)
Constructor.
Definition: ObjectInspectorWidget.cpp:35
gui::ObjectInspectorWidget::~ObjectInspectorWidget
~ObjectInspectorWidget() override
Destructor.
Definition: ObjectInspectorWidget.cpp:61
gui::ObjectInspectorWidget::retranslate
void retranslate()
Translates all translatable strings in this dialog.
Definition: ObjectInspectorWidget.cpp:134
scene3D::SceneObjectPtr
boost::intrusive_ptr< SceneObject > SceneObjectPtr
Definition: PointerDefinitions.h:40
control
This file is part of ArmarX.