DebugLayerControlWidget.h
Go to the documentation of this file.
1 /*
2 * This file is part of ArmarX.
3 *
4 * ArmarX is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * ArmarX is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * @package MemoryX::WorkingMemoryGui
17 * @author Dominik Muth
18 * @copyright 2015 KIT
19 * @license http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 
22 */
23 
24 #pragma once
25 
26 /* ArmarX headers */
27 
30 
31 /* QT headers */
32 #include <QWidget>
33 #include <QCheckBox>
34 #include <QSignalMapper>
35 #include <QPushButton>
36 
37 /* STD headers */
38 #include <unordered_map>
39 
40 /* Inventor headers */
41 #include <Inventor/sensors/SoTimerSensor.h>
42 #include <Inventor/SoDB.h>
43 #include <Inventor/Qt/SoQt.h>
44 
45 /* System headers */
46 #include <string>
47 
48 
49 namespace Ui
50 {
52 }
53 
54 class DebugLayerControlWidget : public QWidget
55 {
56  Q_OBJECT
57 
58 public:
59  DebugLayerControlWidget(QWidget* parent = 0);
60  ~DebugLayerControlWidget() override;
62 
63 public slots:
64  void updateLayers();
65 
66  void layerToggleVisibility(QString layerName);
67 
68 protected:
70  SoTimerSensor* timerSensor;
71  /**
72  * @brief Maps events to toggle a layer's visibility from checkboxes contained in the table to layerToggleVisibility.
73  */
74  QSignalMapper layerSignalMapperVisible;
75  /**
76  * @brief Maps events to remove a layer.
77  */
78  QSignalMapper layerSignalMapperRemove;
79  /**
80  * @brief Stores whether a layer is currently visible.
81  */
82  std::unordered_map<std::string, bool> layerVisibility;
83 
84  static void onTimer(void* data, SoSensor* sensor);
85 
86 protected slots:
87  void layerRemove(QString layerName);
88 private:
89  Ui::DebugLayerControlWidget* ui;
90 };
91 
DebugDrawerComponent.h
DebugLayerControlWidget::setEntityDrawer
void setEntityDrawer(armarx::DebugDrawerComponentPtr entityDrawer)
Definition: DebugLayerControlWidget.cpp:58
DebugLayerControlWidget::layerSignalMapperVisible
QSignalMapper layerSignalMapperVisible
Maps events to toggle a layer's visibility from checkboxes contained in the table to layerToggleVisib...
Definition: DebugLayerControlWidget.h:74
DebugLayerControlWidget::entityDrawer
armarx::DebugDrawerComponentPtr entityDrawer
Definition: DebugLayerControlWidget.h:69
DebugLayerControlWidget::updateLayers
void updateLayers()
Definition: DebugLayerControlWidget.cpp:63
DebugLayerControlWidget::timerSensor
SoTimerSensor * timerSensor
Definition: DebugLayerControlWidget.h:70
DebugLayerControlWidget::~DebugLayerControlWidget
~DebugLayerControlWidget() override
Definition: DebugLayerControlWidget.cpp:47
DebugLayerControlWidget::onTimer
static void onTimer(void *data, SoSensor *sensor)
Definition: DebugLayerControlWidget.cpp:135
IceInternal::Handle< DebugDrawerComponent >
Ui
ArmarX Headers.
Definition: ArmarXMainWindow.h:54
DebugLayerControlWidget::layerVisibility
std::unordered_map< std::string, bool > layerVisibility
Stores whether a layer is currently visible.
Definition: DebugLayerControlWidget.h:82
DebugLayerControlWidget
Definition: DebugLayerControlWidget.h:54
DebugLayerControlWidget::DebugLayerControlWidget
DebugLayerControlWidget(QWidget *parent=0)
Definition: DebugLayerControlWidget.cpp:29
data
uint8_t data[1]
Definition: EtherCATFrame.h:68
DebugLayerControlWidget::layerSignalMapperRemove
QSignalMapper layerSignalMapperRemove
Maps events to remove a layer.
Definition: DebugLayerControlWidget.h:78
Component.h
DebugLayerControlWidget::layerToggleVisibility
void layerToggleVisibility(QString layerName)
Definition: DebugLayerControlWidget.cpp:103
DebugLayerControlWidget::layerRemove
void layerRemove(QString layerName)
Definition: DebugLayerControlWidget.cpp:120