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 #include <VisionX/gui-plugins/PrimitiveExtraction/ui_PrimitiveExtractionConfigDialog.h>
25 
26 #include <QTimer>
27 #include <QPushButton>
28 #include <QMessageBox>
29 
31 
32 #include <VisionX/interface/components/FakePointCloudProviderInterface.h>
33 #include <VisionX/interface/components/PointCloudSegmenter.h>
34 #include <VisionX/interface/components/PrimitiveMapper.h>
35 #include <VisionX/interface/components/AffordancePipelineVisualization.h>
36 
37 #include <IceUtil/UUID.h>
38 
39 namespace armarx
40 {
42  QDialog(parent),
44  uuid(IceUtil::generateUUID())
45  {
46  ui->setupUi(this);
47 
48  connect(this->ui->buttonBox, SIGNAL(accepted()), this, SLOT(verifyConfig()));
49  ui->buttonBox->button(QDialogButtonBox::Ok)->setDefault(true);
50 
51  pointCloudProviderProxyFinder = new IceProxyFinder<visionx::PointCloudProviderInterfacePrx>(this);
52  pointCloudSegmenterProxyFinder = new IceProxyFinder<visionx::PointCloudSegmenterInterfacePrx>(this);
53  primitiveExtractorProxyFinder = new IceProxyFinder<visionx::PrimitiveMapperInterfacePrx>(this);
54  pipelineVisualizationProxyFinder = new IceProxyFinder<AffordancePipelineVisualizationInterfacePrx>(this);
55 
56  pointCloudProviderProxyFinder->setSearchMask("*");
57  pointCloudSegmenterProxyFinder->setSearchMask("*");
58  primitiveExtractorProxyFinder->setSearchMask("*");
59  pipelineVisualizationProxyFinder->setSearchMask("*");
60 
61  ui->gridLayout->addWidget(pointCloudProviderProxyFinder, 0, 1, 1, 2);
62  ui->gridLayout->addWidget(pointCloudSegmenterProxyFinder, 1, 1, 1, 2);
63  ui->gridLayout->addWidget(primitiveExtractorProxyFinder, 2, 1, 1, 2);
64  ui->gridLayout->addWidget(pipelineVisualizationProxyFinder, 3, 1, 1, 2);
65  }
66 
68  {
69  delete ui;
70  }
71 
73  {
74  pointCloudProviderProxyFinder->setIceManager(getIceManager());
75  pointCloudSegmenterProxyFinder->setIceManager(getIceManager());
76  primitiveExtractorProxyFinder->setIceManager(getIceManager());
77  pipelineVisualizationProxyFinder->setIceManager(getIceManager());
78  }
79 
81  {
82  }
83 
85  {
86  QObject::disconnect();
87  }
88 
90  {
91  unsigned int l1 = pointCloudProviderProxyFinder->getSelectedProxyName().trimmed().length();
92  unsigned int l3 = primitiveExtractorProxyFinder->getSelectedProxyName().trimmed().length();
93  unsigned int l4 = pipelineVisualizationProxyFinder->getSelectedProxyName().trimmed().length();
94 
95  if (!l1 || !l3 || !l4)
96  {
97  QMessageBox::critical(this, "Invalid Configuration", "The proxy names must not be empty");
98  return;
99  }
100 
101  this->accept();
102  }
103 }
armarx::ManagedIceObject::getIceManager
IceManagerPtr getIceManager() const
Returns the IceManager.
Definition: ManagedIceObject.cpp:353
armarx::IceProxyFinderBase::setSearchMask
void setSearchMask(const QString &searchMask)
Definition: IceProxyFinder.cpp:88
armarx::PrimitiveExtractionConfigDialog::verifyConfig
void verifyConfig()
Definition: PrimitiveExtractionConfigDialog.cpp:89
armarx::IceProxyFinderBase::setIceManager
void setIceManager(IceManagerPtr icemanager, bool fetchProxies=true)
Definition: IceProxyFinder.cpp:64
armarx::PrimitiveExtractionConfigDialog
Definition: PrimitiveExtractionConfigDialog.h:40
armarx::PrimitiveExtractionConfigDialog::PrimitiveExtractionConfigDialog
PrimitiveExtractionConfigDialog(QWidget *parent=0)
Definition: PrimitiveExtractionConfigDialog.cpp:41
armarx::PrimitiveExtractionConfigDialog::onConnectComponent
void onConnectComponent() override
Pure virtual hook for the subclass.
Definition: PrimitiveExtractionConfigDialog.cpp:80
IceUtil
Definition: Instance.h:21
armarx::PrimitiveExtractionConfigDialog::onExitComponent
void onExitComponent() override
Hook for subclass.
Definition: PrimitiveExtractionConfigDialog.cpp:84
Ui
ArmarX Headers.
Definition: ArmarXMainWindow.h:54
IceProxyFinder.h
PrimitiveExtractionConfigDialog.h
armarx::IceProxyFinderBase::getSelectedProxyName
QString getSelectedProxyName() const
Definition: IceProxyFinder.cpp:73
armarx::PrimitiveExtractionConfigDialog::onInitComponent
void onInitComponent() override
Pure virtual hook for the subclass.
Definition: PrimitiveExtractionConfigDialog.cpp:72
armarx::PrimitiveExtractionConfigDialog::~PrimitiveExtractionConfigDialog
~PrimitiveExtractionConfigDialog() override
Definition: PrimitiveExtractionConfigDialog.cpp:67
armarx::IceProxyFinder
Definition: StatechartViewerController.h:51
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28