DefaultWidgetDescriptions.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 RobotAPI::RobotUnit
17  * @author Raphael Grimm ( raphael dot grimm at kit dot edu )
18  * @date 2017
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 #pragma once
24 
25 #include <set>
26 #include <string>
27 
28 #include <VirtualRobot/Robot.h>
29 
30 #include <ArmarXGui/interface/WidgetDescription.h>
32 
34 {
35  StringComboBoxPtr makeStringSelectionComboBox(std::string name,
36  std::vector<std::string> options);
37 
38  StringComboBoxPtr makeStringSelectionComboBox(std::string name,
39  std::vector<std::string> options,
40  const std::set<std::string>& preferredSet);
41 
42  inline StringComboBoxPtr
43  makeStringSelectionComboBox(std::string name,
44  std::vector<std::string> options,
45  const std::initializer_list<std::string>& preferredSet)
46  {
48  std::move(name), std::move(options), std::set<std::string>{preferredSet});
49  }
50 
51  StringComboBoxPtr makeStringSelectionComboBox(std::string name,
52  std::vector<std::string> options,
53  const std::string& mostPreferred);
54 
55  StringComboBoxPtr makeStringSelectionComboBox(std::string name,
56  std::vector<std::string> options,
57  const std::set<std::string>& preferredSet,
58  const std::string& mostPreferred);
59 
60  inline StringComboBoxPtr
61  makeStringSelectionComboBox(std::string name,
62  std::vector<std::string> options,
63  const std::string& mostPreferred,
64  const std::set<std::string>& preferredSet)
65  {
67  std::move(name), std::move(options), preferredSet, mostPreferred);
68  }
69 
70  inline StringComboBoxPtr
72  std::string name = "RobotNodeSet",
73  const std::set<std::string>& preferredSet = {},
74  const std::string& mostPreferred = "")
75  {
77  std::move(name), robot->getRobotNodeSetNames(), preferredSet, mostPreferred);
78  }
79 
80  inline StringComboBoxPtr
82  std::string name = "RobotNode",
83  const std::set<std::string>& preferredSet = {},
84  const std::string& mostPreferred = "")
85  {
87  std::move(name), robot->getRobotNodeNames(), preferredSet, mostPreferred);
88  }
89 } // namespace armarx::WidgetDescription
armarx::WidgetDescription::makeRobotNodeComboBox
StringComboBoxPtr makeRobotNodeComboBox(const VirtualRobot::RobotPtr &robot, std::string name="RobotNode", const std::set< std::string > &preferredSet={}, const std::string &mostPreferred="")
Definition: DefaultWidgetDescriptions.h:81
armarx::WidgetDescription::makeStringSelectionComboBox
StringComboBoxPtr makeStringSelectionComboBox(std::string name, std::vector< std::string > options)
Definition: DefaultWidgetDescriptions.cpp:28
armarx::WidgetDescription
Definition: DefaultWidgetDescriptions.cpp:27
DefaultWidgetDescriptions.h
armarx::WidgetDescription::makeRNSComboBox
StringComboBoxPtr makeRNSComboBox(const VirtualRobot::RobotPtr &robot, std::string name="RobotNodeSet", const std::set< std::string > &preferredSet={}, const std::string &mostPreferred="")
Definition: DefaultWidgetDescriptions.h:71
VirtualRobot::RobotPtr
std::shared_ptr< class Robot > RobotPtr
Definition: Bus.h:18