GroupExplorerWidget.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 #include <QTableWidgetItem>
31 
32 #include "../controller/Controller.h"
33 
34 namespace Ui
35 {
36  class GroupExplorerWidget;
37 }
38 
39 namespace gui
40 {
41  /**
42  * This class provides a QWidget which displays all existing groups in the local scene.
43  * It supports simple functions to edit groups.
44  *
45  */
46  class GroupExplorerWidget : public QWidget
47  {
48  Q_OBJECT
49 
50  public:
51 
52  /**
53  * Constructor.
54  * Constructs an instance of the GroupExplorerWidget.
55  * It expects a constant reference to controller::ControllerPtr to get information about the scene, a <i>groupEditorDialog</i> and a <i>parent</i> widget.
56  *
57  * @param control shared pointer to @link{controller::ControllerPtr}
58  * @param groupEditorDialog QPointer to the group editor dialog
59  * @param parent parent widget
60  *
61  */
62  explicit GroupExplorerWidget(const controller::ControllerPtr& control, QPointer<dialog::GroupExplorerDialog> groupEditorDialog, QWidget* parent = 0);
63  ~GroupExplorerWidget() override;
64 
65  /**
66  * Translates all translatable strings in this dialog.
67  */
68  void retranslate();
69 
70  Q_SIGNALS:
71  /**
72  * Signal emitted to add selected group to current selection in the scene.
73  *
74  */
75  void addToSelectionClicked();
76 
77  /**
78  * Signal emitted to add current selection in scene to selected group.
79  *
80  */
81  void addToGroupClicked();
82 
83  /**
84  * Signal emitted when click event on group name triggered.
85  *
86  */
87  void groupNameClicked();
88 
89  private Q_SLOTS:
90  void customContextMenuRequested(const QPoint& position);
91  void openGroupEditorDialog();
92  void listAllGroups();
93  void addSelectionToNewGroup();
94  void addSelectionToGroup();
95  void addGroupToSelection();
96  void groupRemoveClicked();
97  void triggerOperation(QTableWidgetItem* item);
98  void triggerOpenGroupEditor(QModelIndex index);
99 
100  private:
101  Ui::GroupExplorerWidget* ui;
103  QPointer<dialog::GroupExplorerDialog> groupEditorDialog;
104  QTableWidgetItem* currentItem;
105 
106  void createAddToGroupOperations(std::string groupName);
107 
108  };
109 }
110 
gui::GroupExplorerWidget
This class provides a QWidget which displays all existing groups in the local scene.
Definition: GroupExplorerWidget.h:46
gui::GroupExplorerWidget::GroupExplorerWidget
GroupExplorerWidget(const controller::ControllerPtr &control, QPointer< dialog::GroupExplorerDialog > groupEditorDialog, QWidget *parent=0)
Constructor.
Definition: GroupExplorerWidget.cpp:44
gui::GroupExplorerWidget::addToGroupClicked
void addToGroupClicked()
Signal emitted to add current selection in scene to selected group.
index
uint8_t index
Definition: EtherCATFrame.h:59
GroupExplorerDialog.h
gui::GroupExplorerWidget::groupNameClicked
void groupNameClicked()
Signal emitted when click event on group name triggered.
gui::GroupExplorerWidget::addToSelectionClicked
void addToSelectionClicked()
Signal emitted to add selected group to current selection in the scene.
controller::ControllerWeakPtr
std::weak_ptr< Controller > ControllerWeakPtr
Definition: ClassDefinitions.h:42
Ui
ArmarX Headers.
Definition: ArmarXMainWindow.h:58
controller::ControllerPtr
std::shared_ptr< Controller > ControllerPtr
Definition: ClassDefinitions.h:41
gui::GroupExplorerWidget::retranslate
void retranslate()
Translates all translatable strings in this dialog.
Definition: GroupExplorerWidget.cpp:301
gui::GroupExplorerWidget::~GroupExplorerWidget
~GroupExplorerWidget() override
Definition: GroupExplorerWidget.cpp:84
control
This file is part of ArmarX.