ClutteredSceneGeneratorWidgetController.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 ArmarXSimulation::gui-plugins::ClutteredSceneGeneratorWidgetController
17  * @author Patrick Hegemann ( patrick dot hegemann at kit dot edu )
18  * @date 2021
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 #pragma once
23 
25 #include <ArmarXSimulation/gui-plugins/ClutteredSceneGenerator/ui_ClutteredSceneGeneratorWidget.h>
26 
29 
32 
33 #include <QListWidgetItem>
34 
35 #include <filesystem>
36 
37 namespace armarx
38 {
39  /**
40  \page ArmarXSimulation-GuiPlugins-ClutteredSceneGenerator ClutteredSceneGenerator
41  \brief The ClutteredSceneGenerator allows visualizing ...
42 
43  \image html ClutteredSceneGenerator.png
44  The user can
45 
46  API Documentation \ref ClutteredSceneGeneratorWidgetController
47 
48  \see ClutteredSceneGeneratorGuiPlugin
49  */
50 
51  /**
52  * \class ClutteredSceneGeneratorGuiPlugin
53  * \ingroup ArmarXGuiPlugins
54  * \brief ClutteredSceneGeneratorGuiPlugin brief description
55  *
56  * Detailed description
57  */
58 
59  /**
60  * \class ClutteredSceneGeneratorWidgetController
61  * \brief ClutteredSceneGeneratorWidgetController brief one line description
62  *
63  * Detailed description
64  */
67  public armarx::ArmarXComponentWidgetControllerTemplate < ClutteredSceneGeneratorWidgetController >
68  {
69  Q_OBJECT
70 
71  public:
72  /// Controller Constructor
74  /// Controller destructor
76 
77  //// @see ArmarXWidgetController::loadSettings()
78  void loadSettings(QSettings* settings) override;
79  /// @see ArmarXWidgetController::saveSettings()
80  void saveSettings(QSettings* settings) override;
81 
82  /**
83  * Returns the Widget name displayed in the ArmarXGui to create an
84  * instance of this class.
85  */
86  static QString GetWidgetName()
87  {
88  return "ClutteredSceneGenerator";
89  }
90 
91  /// \see armarx::Component::onInitComponent()
92  void onInitComponent() override;
93 
94  /// \see armarx::Component::onConnectComponent()
95  void onConnectComponent() override;
96 
97  public slots:
98  /* QT slot declarations */
99  // Objects tab
100  void generateObjects();
101 
102  // Scene generation tab
103  void refreshSets();
104  void updateObjectPoseConstraints();
105  void generateScene();
106 
107  signals:
108  /* QT signal declarations */
109 
110  private:
111  /**
112  * Widget Form
113  */
114  Ui::ClutteredSceneGeneratorWidget widget_{};
115 
116  // Items in the list of object sets
117  std::vector<QListWidgetItem*> objectSetListItems_;
118 
119  // (Logic) object sets
120  std::map<std::string, simulation::scene_generation::ObjectSet> objectSets_;
121 
122  // Generate the configuration for the cluttered scene generator
123  simulation::scene_generation::ClutteredSceneGenerator::Config getGenConfig();
124 
125  // Simulator proxy
126  std::string simulatorProxyName_ = "Simulator";
127  SimulatorInterfacePrx simulator_;
128 
129  std::map<std::string, simulation::scene_generation::ObjectSet>
130  getObjectSets(const armarx::PackagePath& packagePath);
131  };
132 } // namespace armarx
armarx::ArmarXComponentWidgetControllerTemplate
Definition: ArmarXComponentWidgetController.h:69
ArmarXGuiPlugin.h
ArmarXComponentWidgetController.h
ARMARXCOMPONENT_IMPORT_EXPORT
#define ARMARXCOMPONENT_IMPORT_EXPORT
Definition: ImportExportComponent.h:38
armarx::ClutteredSceneGeneratorWidgetController
ClutteredSceneGeneratorWidgetController brief one line description.
Definition: ClutteredSceneGeneratorWidgetController.h:65
armarx::ClutteredSceneGeneratorWidgetController::GetWidgetName
static QString GetWidgetName()
Returns the Widget name displayed in the ArmarXGui to create an instance of this class.
Definition: ClutteredSceneGeneratorWidgetController.h:86
ClutteredSceneGenerator.h
armarx::PackagePath
Definition: PackagePath.h:55
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
PackagePath.h
ImportExportComponent.h