PrimitiveExtractionConfigDialog.cpp
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
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
24
25#include <QMessageBox>
26#include <QPushButton>
27#include <QTimer>
28
29#include <IceUtil/UUID.h>
30
32
33#include <VisionX/gui-plugins/PrimitiveExtraction/ui_PrimitiveExtractionConfigDialog.h>
34#include <VisionX/interface/components/AffordancePipelineVisualization.h>
35#include <VisionX/interface/components/FakePointCloudProviderInterface.h>
36#include <VisionX/interface/components/PointCloudSegmenter.h>
37#include <VisionX/interface/components/PrimitiveMapper.h>
38
39namespace armarx
40{
42 QDialog(parent), ui(new Ui::PrimitiveExtractionConfigDialog), uuid(IceUtil::generateUUID())
43 {
44 ui->setupUi(this);
45
46 connect(this->ui->buttonBox, SIGNAL(accepted()), this, SLOT(verifyConfig()));
47 ui->buttonBox->button(QDialogButtonBox::Ok)->setDefault(true);
48
49 pointCloudProviderProxyFinder =
51 pointCloudSegmenterProxyFinder =
53 primitiveExtractorProxyFinder =
55 pipelineVisualizationProxyFinder =
57
58 pointCloudProviderProxyFinder->setSearchMask("*");
59 pointCloudSegmenterProxyFinder->setSearchMask("*");
60 primitiveExtractorProxyFinder->setSearchMask("*");
61 pipelineVisualizationProxyFinder->setSearchMask("*");
62
63 ui->gridLayout->addWidget(pointCloudProviderProxyFinder, 0, 1, 1, 2);
64 ui->gridLayout->addWidget(pointCloudSegmenterProxyFinder, 1, 1, 1, 2);
65 ui->gridLayout->addWidget(primitiveExtractorProxyFinder, 2, 1, 1, 2);
66 ui->gridLayout->addWidget(pipelineVisualizationProxyFinder, 3, 1, 1, 2);
67 }
68
73
74 void
76 {
77 pointCloudProviderProxyFinder->setIceManager(getIceManager());
78 pointCloudSegmenterProxyFinder->setIceManager(getIceManager());
79 primitiveExtractorProxyFinder->setIceManager(getIceManager());
80 pipelineVisualizationProxyFinder->setIceManager(getIceManager());
81 }
82
83 void
87
88 void
90 {
91 QObject::disconnect();
92 }
93
94 void
96 {
97 unsigned int l1 = pointCloudProviderProxyFinder->getSelectedProxyName().trimmed().length();
98 unsigned int l3 = primitiveExtractorProxyFinder->getSelectedProxyName().trimmed().length();
99 unsigned int l4 =
100 pipelineVisualizationProxyFinder->getSelectedProxyName().trimmed().length();
101
102 if (!l1 || !l3 || !l4)
103 {
104 QMessageBox::critical(
105 this, "Invalid Configuration", "The proxy names must not be empty");
106 return;
107 }
108
109 this->accept();
110 }
111} // namespace armarx
Widget to conveniently retrieve a proxy instance name of a specific interface type (the template para...
IceManagerPtr getIceManager() const
Returns the IceManager.
void onInitComponent() override
Pure virtual hook for the subclass.
void onConnectComponent() override
Pure virtual hook for the subclass.
ArmarX Headers.
This file offers overloads of toIce() and fromIce() functions for STL container types.