hpp-gui  4.13.0
Graphical interface for HPP
hppmanipulationwidgetsplugin.hh
Go to the documentation of this file.
1 //
2 // Copyright (c) CNRS
3 // Authors: Joseph Mirabel and Heidy Dallard
4 //
5 
6 #ifndef HPP_GUI_HPPMANIPULATIONWIDGETSPLUGIN_HH
7 #define HPP_GUI_HPPMANIPULATIONWIDGETSPLUGIN_HH
8 
9 #include <QToolBar>
10 #include <gepetto/gui/plugin-interface.hh>
11 #include <hpp/corbaserver/manipulation/client.hh>
12 #undef __robot_hh__
13 #undef __problem_hh__
15 
16 class QListWidgetItem;
17 
18 namespace hpp {
19 namespace gui {
23 // , public PluginInterface, public ModelInterface, public ConnectionInterface
24 {
25  Q_OBJECT
26  Q_INTERFACES(gepetto::gui::PluginInterface gepetto::gui::ModelInterface
27  gepetto::gui::ConnectionInterface)
28 
29 #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
30  Q_PLUGIN_METADATA(IID "hpp-gui.hppmanipulationwidgetsplugin")
31 #endif
32 
33  public:
34  typedef hpp::corbaServer::manipulation::Client HppManipClient;
35 
37 
39 
40  // PluginInterface interface
41  public:
43  void init();
44 
46  QString name() const;
47 
48  // ModelInterface interface
49  public:
53  void loadRobotModel(gepetto::gui::DialogLoadRobot::RobotDefinition rd);
54 
59  gepetto::gui::DialogLoadEnvironment::EnvironmentDefinition ed);
60 
63  std::string getBodyFromJoint(const std::string& jointName) const;
64 
65  // ConnectionInterface
66  public:
68  virtual void openConnection();
69 
71  virtual void closeConnection();
72 
73  public:
75  HppManipClient* manipClient() const;
76 
79  virtual Roadmap* createRoadmap(const std::string& jointName);
80 
81  public slots:
83  void drawRobotContacts();
84 
87 
89  void drawHandlesFrame();
90 
92  void drawGrippersFrame();
93 
96  void autoBuildGraph();
97 
98  private slots:
100  void buildGraph();
101 
102  private:
103  // Type used to make one function to build datas needed for autoBuild
104  typedef std::pair<hpp::Names_t, hpp::corbaserver::manipulation::Namess_t>
105  NamesPair;
106  typedef std::map<std::string, std::list<std::string> > MapNames;
107 
109  NamesPair convertMap(MapNames& mapNames);
110 
112  hpp::Names_t_var convertToNames(const QList<QListWidgetItem*>& l);
113 
114  MapNames getObjects();
115  void fillMap(MapNames& map, const QList<QListWidgetItem*>& l);
116  void mergeShapes(MapNames& handles, MapNames& shapes);
117 
123  void drawContactSurface(const std::string& name, hpp::intSeq_var& indexes,
124  hpp::floatSeqSeq_var& points, CORBA::ULong j,
125  float epsilon = 0.0001f);
126 
127  HppManipClient* hpp_;
128 
129  QToolBar* toolBar_;
130  QTabWidget* tw_;
131  QDialog* graphBuilder_;
132 };
133 } // namespace gui
134 } // namespace hpp
135 
136 #endif // HPP_GUI_HPPMANIPULATIONWIDGETSPLUGIN_HH
Definition: roadmap.hh:16
HppManipClient * manipClient() const
Get the instance of corba manipulation client.
namespace that encapsulate all the softwares of humanoid-path-planner
Definition: __init__.py:1
virtual Roadmap * createRoadmap(const std::string &jointName)
std::string getBodyFromJoint(const std::string &jointName) const
Definition: hppmanipulationwidgetsplugin.hh:22
void loadEnvironmentModel(gepetto::gui::DialogLoadEnvironment::EnvironmentDefinition ed)
QString name() const
Return the name of the plugin.
virtual void openConnection()
Open a connection to a corba manipulation server.
void init()
Initialize the plugin.
virtual void closeConnection()
Close connection from corba manipulation server.
void drawEnvironmentContacts()
Draw environment&#39;s contacts in the viewer.
void drawRobotContacts()
Draw robot&#39;s contacts in the viewer.
void drawHandlesFrame()
Draw handles frame in the viewer.
void loadRobotModel(gepetto::gui::DialogLoadRobot::RobotDefinition rd)
void drawGrippersFrame()
Draw grippers frame in the viewer.
Plugin that add a lot of features to work with hpp.
Definition: hppwidgetsplugin.hh:30