hpp-gui  4.10.1
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 
11 #include <gepetto/gui/plugin-interface.hh>
12 #include <hpp/corbaserver/manipulation/client.hh>
13 #undef __robot_hh__
14 #undef __problem_hh__
16 
17 class QListWidgetItem;
18 
19 namespace hpp {
20  namespace gui {
23  // , public PluginInterface, public ModelInterface, public ConnectionInterface
24  {
25  Q_OBJECT
26  Q_INTERFACES (gepetto::gui::PluginInterface
27  gepetto::gui::ModelInterface
28  gepetto::gui::ConnectionInterface)
29 
30 #if (QT_VERSION >= QT_VERSION_CHECK(5,0,0))
31  Q_PLUGIN_METADATA (IID "hpp-gui.hppmanipulationwidgetsplugin")
32 #endif
33 
34  public:
35  typedef hpp::corbaServer::manipulation::Client HppManipClient;
36 
37  explicit HppManipulationWidgetsPlugin ();
38 
39  virtual ~HppManipulationWidgetsPlugin ();
40 
41  // PluginInterface interface
42  public:
44  void init();
45 
47  QString name() const;
48 
49  // ModelInterface interface
50  public:
53  void loadRobotModel (gepetto::gui::DialogLoadRobot::RobotDefinition rd);
54 
57  void loadEnvironmentModel (gepetto::gui::DialogLoadEnvironment::EnvironmentDefinition ed);
58 
61  std::string getBodyFromJoint (const std::string& jointName) const;
62 
63  // ConnectionInterface
64  public:
66  virtual void openConnection ();
67 
69  virtual void closeConnection();
70 
71  public:
73  HppManipClient* manipClient () const;
74 
77  virtual Roadmap* createRoadmap (const std::string& jointName);
78 
79  public slots:
81  void drawRobotContacts ();
82 
85 
87  void drawHandlesFrame ();
88 
90  void drawGrippersFrame ();
91 
93  void autoBuildGraph();
94 
95  private slots:
97  void buildGraph();
98 
99  private:
100  // Type used to make one function to build datas needed for autoBuild
101  typedef std::pair<hpp::Names_t, hpp::corbaserver::manipulation::Namess_t> NamesPair;
102  typedef std::map<std::string, std::list<std::string> > MapNames;
103 
105  NamesPair convertMap(MapNames& mapNames);
106 
108  hpp::Names_t_var convertToNames(const QList<QListWidgetItem *>& l);
109 
110  MapNames getObjects();
111  void fillMap(MapNames& map, const QList<QListWidgetItem *>& l);
112  void mergeShapes(MapNames& handles, MapNames& shapes);
113 
122  void drawContactSurface(const std::string& name, hpp::intSeq_var& indexes,
123  hpp::floatSeqSeq_var& points, CORBA::ULong j, float epsilon = 0.0001f);
124 
125  HppManipClient* hpp_;
126 
127  QToolBar *toolBar_;
128  QTabWidget *tw_;
129  QDialog* graphBuilder_;
130  };
131  } // namespace gui
132 } // namespace hpp
133 
134 #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
HppManipulationWidgetsPlugin add functionalities to interact with hpp-manipulation-corba.
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 autoBuildGraph()
Create the widget to select what to include in constraint&#39;s graph autobuild.
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:29