hpp-gui  4.12.0
Graphical interface for HPP
configurationlistwidget.hh
Go to the documentation of this file.
1 //
2 // Copyright (c) CNRS
3 // Author: Joseph Mirabel and Heidy Dallard
4 //
5 
6 #ifndef HPP_GUI_CONFIGURATIONLISTWIDGET_HH
7 #define HPP_GUI_CONFIGURATIONLISTWIDGET_HH
8 
9 #include <QWidget>
10 
11 #include "gepetto/gui/fwd.hh"
12 #include "gepetto/gui/mainwindow.hh"
13 
14 #include "hpp/common-idl.hh"
15 
16 #include "configurationlist.hh"
17 
18 Q_DECLARE_METATYPE (hpp::floatSeq*)
19 
20 namespace Ui {
21  class ConfigurationListWidget;
22 }
23 
24 namespace hpp {
25  namespace gui {
26  class HppWidgetsPlugin;
27 
29  class ConfigurationListWidget : public QWidget
30  {
31  Q_OBJECT
32 
33  public:
34  static const int ConfigRole;
36  inline QListWidget* list ();
37 
39  void setInitConfig(hpp::floatSeq& config);
40 
41  ConfigurationListWidget(HppWidgetsPlugin* plugin, QWidget* parent = 0);
42 
43  virtual ~ConfigurationListWidget();
44 
45  static QListWidgetItem* makeItem (QString text, const hpp::floatSeq& q);
46 
47  static hpp::floatSeq& getConfig (QListWidgetItem* item);
48 
49  public slots:
51  void onSaveClicked ();
52 
56  void updateCurrentConfig (QListWidgetItem* current,QListWidgetItem* previous);
57 
59 
60  private slots:
63  void resetGoalConfigs (bool doEmpty = true);
64 
66  void setConfigs();
67 
68  private:
70  inline QLineEdit* name ();
71 
74  void renameConfig(QListWidgetItem* item);
75 
76  HppWidgetsPlugin* plugin_;
77  ::Ui::ConfigurationListWidget* ui_;
78  QListWidget* previous_;
79 
80  gepetto::gui::MainWindow* main_;
81  QString basename_;
82  int count_;
83  };
84 
85  QDataStream& operator>>(QDataStream& os, hpp::floatSeq& tab);
86  QDataStream& operator<<(QDataStream& os, const hpp::floatSeq& tab);
87  } // namespace gui
88 } // namespace hpp
89 
90 #endif // HPP_GUI_CONFIGURATIONLISTWIDGET_HH
ConfigurationListWidget(HppWidgetsPlugin *plugin, QWidget *parent=0)
QListWidget * list()
Get the list of configurations.
namespace that encapsulate all the softwares of humanoid-path-planner
Definition: __init__.py:1
Definition: configurationlistwidget.hh:20
QDataStream & operator<<(QDataStream &os, const hpp::floatSeq &tab)
QDataStream & operator>>(QDataStream &os, hpp::floatSeq &tab)
void setInitConfig(hpp::floatSeq &config)
Set the initial configuration in the problem.
void updateCurrentConfig(QListWidgetItem *current, QListWidgetItem *previous)
static hpp::floatSeq & getConfig(QListWidgetItem *item)
Widget to define initial and goal configurations of the problem.
Definition: configurationlistwidget.hh:29
static const int ConfigRole
Definition: configurationlistwidget.hh:34
static QListWidgetItem * makeItem(QString text, const hpp::floatSeq &q)
void onSaveClicked()
Save the current configuration of the robot.
Plugin that add a lot of features to work with hpp.
Definition: hppwidgetsplugin.hh:29