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 <QPointer>
28#include <QTableWidgetItem>
29#include <QWidget>
30
33
34namespace Ui
35{
36 class GroupExplorerWidget;
37}
38
39namespace 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 * Constructor.
53 * Constructs an instance of the GroupExplorerWidget.
54 * It expects a constant reference to controller::ControllerPtr to get information about the scene, a <i>groupEditorDialog</i> and a <i>parent</i> widget.
55 *
56 * @param control shared pointer to @link{controller::ControllerPtr}
57 * @param groupEditorDialog QPointer to the group editor dialog
58 * @param parent parent widget
59 *
60 */
62 QPointer<dialog::GroupExplorerDialog> groupEditorDialog,
63 QWidget* parent = 0);
64 ~GroupExplorerWidget() override;
65
66 /**
67 * Translates all translatable strings in this dialog.
68 */
69 void retranslate();
70
71 Q_SIGNALS:
72 /**
73 * Signal emitted to add selected group to current selection in the scene.
74 *
75 */
77
78 /**
79 * Signal emitted to add current selection in scene to selected group.
80 *
81 */
83
84 /**
85 * Signal emitted when click event on group name triggered.
86 *
87 */
89
90 private Q_SLOTS:
91 void customContextMenuRequested(const QPoint& position);
92 void openGroupEditorDialog();
93 void listAllGroups();
94 void addSelectionToNewGroup();
95 void addSelectionToGroup();
96 void addGroupToSelection();
97 void groupRemoveClicked();
98 void triggerOperation(QTableWidgetItem* item);
99 void triggerOpenGroupEditor(QModelIndex index);
100
101 private:
102 Ui::GroupExplorerWidget* ui;
104 QPointer<dialog::GroupExplorerDialog> groupEditorDialog;
105 QTableWidgetItem* currentItem;
106
107 void createAddToGroupOperations(std::string groupName);
108 };
109} // namespace gui
uint8_t index
void addToGroupClicked()
Signal emitted to add current selection in scene to selected group.
void groupNameClicked()
Signal emitted when click event on group name triggered.
GroupExplorerWidget(const controller::ControllerPtr &control, QPointer< dialog::GroupExplorerDialog > groupEditorDialog, QWidget *parent=0)
Constructor.
void retranslate()
Translates all translatable strings in this dialog.
void addToSelectionClicked()
Signal emitted to add selected group to current selection in the scene.
ArmarX Headers.
This file is part of ArmarX.
std::weak_ptr< Controller > ControllerWeakPtr
std::shared_ptr< Controller > ControllerPtr