PrimitiveExtractionWidgetController.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::PrimitiveExtractionWidgetController
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 <QListWidgetItem>
26 
28 
31 
32 #include <RobotAPI/interface/visualization/DebugDrawerInterface.h>
33 
34 #include <VisionX/gui-plugins/PrimitiveExtraction/ui_PrimitiveExtractionWidget.h>
35 #include <VisionX/interface/components/AffordancePipelineVisualization.h>
36 #include <VisionX/interface/components/FakePointCloudProviderInterface.h>
37 #include <VisionX/interface/components/PointCloudSegmenter.h>
38 #include <VisionX/interface/components/PrimitiveMapper.h>
39 
41 #include <MemoryX/interface/components/WorkingMemoryInterface.h>
42 
43 namespace armarx
44 {
45  /**
46  \page VisionX-GuiPlugins-PrimitiveExtraction PrimitiveExtraction
47  \brief The PrimitiveExtractionGui provides a convenient way for evaluating parameter
48  setups for the segmentation of point clouds into geometric primitives.
49 
50  API Documentation \ref PrimitiveExtractionWidgetController
51 
52  \see PrimitiveExtractionGuiPlugin
53  */
54 
55  /**
56  * \class PrimitiveExtractionWidgetController
57  * \brief PrimitiveExtractionWidgetController brief one line description
58  *
59  * Detailed description
60  */
62  public ArmarXComponentWidgetControllerTemplate<PrimitiveExtractionWidgetController>
63  {
64  Q_OBJECT
65 
66  public:
67  /**
68  * Controller Constructor
69  */
71 
72  /**
73  * Controller destructor
74  */
76 
77  /**
78  * @see ArmarXWidgetController::loadSettings()
79  */
80  void loadSettings(QSettings* settings) override;
81 
82  /**
83  * @see ArmarXWidgetController::saveSettings()
84  */
85  void saveSettings(QSettings* settings) override;
86 
87  QPointer<QDialog> getConfigDialog(QWidget* parent = 0) override;
88 
89  void configured() override;
90 
91  /**
92  * Returns the Widget name displayed in the ArmarXGui to create an
93  * instance of this class.
94  */
95  static QString
97  {
98  return "VisionX.PrimitiveExtractionConfig";
99  }
100 
101  /**
102  * \see armarx::Component::onInitComponent()
103  */
104  void onInitComponent() override;
105 
106  /**
107  * \see armarx::Component::onConnectComponent()
108  */
109  void onConnectComponent() override;
110  void onDisconnectComponent() override;
111 
112  public slots:
113  void loadPointCloud();
114  void run();
115  void setParameters();
116  void visualizationOptionsChanged();
117  void applyPointCloudTransformation();
118  void importConfig();
119  void exportConfig();
120  void applyAutoRotation();
121 
122  signals:
123  void providersChanged();
124 
125  private:
126  /**
127  * Widget Form
128  */
129  Ui::PrimitiveExtractionWidget widget;
130  QPointer<PrimitiveExtractionConfigDialog> configDialog;
131 
132  std::string pointCloudProviderName;
133  std::string pointCloudSegmenterName;
134  std::string primitiveExtractorName;
135  std::string pipelineVisualizationName;
136  std::string workingMemoryName;
137 
138  visionx::PointCloudProviderInterfacePrx pointCloudProvider;
139  visionx::PointCloudSegmenterInterfacePrx pointCloudSegmenter;
140  visionx::PrimitiveMapperInterfacePrx primitiveExtractor;
141  AffordancePipelineVisualizationInterfacePrx pipelineVisualization;
142  memoryx::WorkingMemoryInterfacePrx workingMemory;
143  DebugDrawerInterfacePrx debugDrawer;
144  };
145 } // namespace armarx
armarx::ArmarXComponentWidgetControllerTemplate
Definition: ArmarXComponentWidgetController.h:69
armarx::PrimitiveExtractionWidgetController::GetWidgetName
static QString GetWidgetName()
Returns the Widget name displayed in the ArmarXGui to create an instance of this class.
Definition: PrimitiveExtractionWidgetController.h:96
ArmarXGuiPlugin.h
ArmarXComponentWidgetController.h
ARMARXCOMPONENT_IMPORT_EXPORT
#define ARMARXCOMPONENT_IMPORT_EXPORT
Definition: ImportExportComponent.h:38
PrimitiveExtractionConfigDialog.h
armarx::PrimitiveExtractionWidgetController
PrimitiveExtractionWidgetController brief one line description.
Definition: PrimitiveExtractionWidgetController.h:61
IceInternal::ProxyHandle<::IceProxy::armarx::DebugDrawerInterface >
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27
ImportExportComponent.h