GroupExplorerDialog.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 #include <QDialog>
27 #include <QStandardItemModel>
28 #include <QHash>
29 
30 #include "../../controller/Controller.h"
31 #include "../../scene3D/SceneGroup.h"
32 #include <Inventor/Qt/viewers/SoQtExaminerViewer.h>
33 
34 namespace Ui
35 {
36  class GroupExplorerDialog;
37 }
38 
39 using SoQtExaminerPtr = std::shared_ptr<SoQtExaminerViewer>;
40 
41 namespace gui::dialog
42 {
43  class GroupExplorerDialog : public QDialog
44  {
45  Q_OBJECT
46 
47  public:
48  /**
49  * Constructor.
50  * Basic constructor for GroupExplorerDialog.
51  *
52  * @param control The controller containing all managers needed in this Dialog
53  * @param parent Parent widget
54  */
55  explicit GroupExplorerDialog(controller::ControllerPtr control, QWidget* parent = 0);
56 
57  /**
58  * Destructor.
59  *
60  */
61  ~GroupExplorerDialog() override;
62 
63  /**
64  * Sets the currently selected Group.
65  *
66  * @param groupId The Id of the group to be selected
67  */
68  void setCurrentGroup(QString groupId);
69 
70  /**
71  * Translates all translatable strings in this dialog.
72  */
73  void retranslate();
74 
75  private Q_SLOTS:
76  void groupClicked(QModelIndex index);
77  void objectClicked(QModelIndex index);
78  void groupAddClicked();
79  void groupRemoveClicked();
80  void groupRenameClicked();
81  void objectRemoveClicked();
82 
83  void reloadGroups();
84  void reloadObjects();
85  void reloadProperties();
86  void checkButtons();
87 
88  private:
89  void showEvent(QShowEvent* event) override;
90  void refreshGroups();
91  void loadGroup(QString groupId);
92  void showPreviewImage(const memoryx::ObjectClassPtr& objectClass);
93 
94  SoQtExaminerPtr viewer;
96  Ui::GroupExplorerDialog* ui;
97  std::vector<scene3D::SceneGroupPtr> allGroups;
98  QString activeGroup;
99  QString activeObject;
100  };
101 }
index
uint8_t index
Definition: EtherCATFrame.h:59
gui::dialog::GroupExplorerDialog::retranslate
void retranslate()
Translates all translatable strings in this dialog.
Definition: GroupExplorerDialog.cpp:355
SoQtExaminerPtr
std::shared_ptr< SoQtExaminerViewer > SoQtExaminerPtr
Definition: GroupExplorerDialog.h:39
gui::dialog::GroupExplorerDialog
Definition: GroupExplorerDialog.h:43
gui::dialog
Definition: GroupExplorerDialog.h:41
controller::ControllerWeakPtr
std::weak_ptr< Controller > ControllerWeakPtr
Definition: ClassDefinitions.h:42
gui::dialog::GroupExplorerDialog::~GroupExplorerDialog
~GroupExplorerDialog() override
Destructor.
Definition: GroupExplorerDialog.cpp:63
IceInternal::Handle< ObjectClass >
Ui
ArmarX Headers.
Definition: ArmarXMainWindow.h:58
controller::ControllerPtr
std::shared_ptr< Controller > ControllerPtr
Definition: ClassDefinitions.h:41
gui::dialog::GroupExplorerDialog::setCurrentGroup
void setCurrentGroup(QString groupId)
Sets the currently selected Group.
Definition: GroupExplorerDialog.cpp:217
gui::dialog::GroupExplorerDialog::GroupExplorerDialog
GroupExplorerDialog(controller::ControllerPtr control, QWidget *parent=0)
Constructor.
Definition: GroupExplorerDialog.cpp:39
control
This file is part of ArmarX.