AffordancePipelineGuiWidgetController.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 VisionX::gui-plugins::AffordancePipelineGuiWidgetController
17 * @author Peter Kaiser ( peter dot kaiser at kit dot edu )
18 * @date 2016
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22
23#pragma once
24
25#include <QTimer>
26#include <QToolBar>
27
29
32
33#include <RobotAPI/interface/core/RobotState.h>
34
35#include <VisionX/gui-plugins/AffordancePipelineGui/ui_AffordancePipelineGuiWidget.h>
36#include <VisionX/interface/components/AffordanceExtraction.h>
37#include <VisionX/interface/components/AffordancePipelineVisualization.h>
38#include <VisionX/interface/components/PointCloudFilter.h>
39#include <VisionX/interface/components/PointCloudSegmenter.h>
40#include <VisionX/interface/components/PrimitiveMapper.h>
41#include <VisionX/interface/core/PointCloudProviderInterface.h>
42
43namespace armarx
44{
46
47 /**
48 \page VisionX-GuiPlugins-AffordancePipelineGui AffordancePipelineGui
49 \brief The AffordancePipelineGui provides access to a running affordance extraction pipeline.
50 It allows to start/stop the procession of point clouds as well as to specify certain segmentation parameters.
51
52 API Documentation \ref AffordancePipelineGuiWidgetController
53
54 \see AffordancePipelineGuiGuiPlugin
55 */
56
57 /**
58 * \class AffordancePipelineGuiWidgetController
59 * \brief AffordancePipelineGuiWidgetController brief one line description
60 *
61 * Detailed description
62 */
64 public ArmarXComponentWidgetControllerTemplate<AffordancePipelineGuiWidgetController>
65 {
66 Q_OBJECT
67
68 public:
69 /**
70 * Controller Constructor
71 */
73
74 /**
75 * Controller destructor
76 */
78
79 /**
80 * @see ArmarXWidgetController::loadSettings()
81 */
82 void loadSettings(QSettings* settings) override;
83
84 /**
85 * @see ArmarXWidgetController::saveSettings()
86 */
87 void saveSettings(QSettings* settings) override;
88
89 QPointer<QDialog> getConfigDialog(QWidget* parent = 0) override;
90
91 void configured() override;
92
93 /**
94 * Returns the Widget name displayed in the ArmarXGui to create an
95 * instance of this class.
96 */
97 static QString
99 {
100 return "VisionX.AffordancePipelineGui";
101 }
102
103 QPointer<QWidget> getCustomTitlebarWidget(QWidget* parent = 0) override;
104
105 /**
106 * \see armarx::Component::onInitComponent()
107 */
108 void onInitComponent() override;
109
110 /**
111 * \see armarx::Component::onConnectComponent()
112 */
113 void onConnectComponent() override;
114 void onDisconnectComponent() override;
115
116 public slots:
117 void updatePipelineStatus();
118 void startPipeline();
119 void pausePipeline();
120 void stepPipeline();
121 void croppingSelected(int index);
122 void pointCloudSourceSelected(int index);
123 void segmentationSetupSelected(int index);
124 void visualizationOptionsChanged(bool prm = false);
125 void loadScene();
126 void saveScene();
127
128 private:
129 QString formatTimestamp(long timestamp);
130
131 private:
132 /**
133 * Widget Form
134 */
135 Ui::AffordancePipelineGuiWidget widget;
136 QPointer<AffordancePipelineGuiConfigDialog> configDialog;
137
138 QToolBar* customToolbar;
139
140 std::vector<std::string> pointCloudProviderNames;
141 std::vector<std::string> filteredPointCloudProviderNames;
142 std::vector<std::string> pointCloudProviderDisplayNames;
143
144 std::vector<std::string> pipelineConfigFiles;
145
146 std::string pointCloudSegmenterName;
147 std::string primitiveExtractorName;
148 std::string affordanceExtractionName;
149 std::string pipelineVisualizationName;
150 std::string robotStateComponentName;
151 std::string platform;
152
153 std::vector<visionx::CapturingPointCloudProviderInterfacePrx> pointCloudProviders;
154 std::vector<armarx::PointCloudFilterInterfacePrx> filteredPointCloudProviders;
155 unsigned int currentPointCloudProvider;
156
157 visionx::PointCloudSegmenterInterfacePrx pointCloudSegmenter;
158 visionx::PrimitiveMapperInterfacePrx primitiveExtractor;
159 AffordanceExtractionInterfacePrx affordanceExtraction;
160 AffordancePipelineVisualizationInterfacePrx pipelineVisualization;
161 RobotStateComponentInterfacePrx robotStateComponent;
162
163 QTimer* updateTimer;
164 };
165} // namespace armarx
std::string timestamp()
uint8_t index
#define ARMARXCOMPONENT_IMPORT_EXPORT
QPointer< QDialog > getConfigDialog(QWidget *parent=0) override
getConfigDialog returns a pointer to the a configuration widget of this controller.
void configured() override
This function must be implemented by the user, if he supplies a config dialog.
static QString GetWidgetName()
Returns the Widget name displayed in the ArmarXGui to create an instance of this class.
This file offers overloads of toIce() and fromIce() functions for STL container types.
::IceInternal::ProxyHandle<::IceProxy::armarx::RobotStateComponentInterface > RobotStateComponentInterfacePrx