hpp-gui  4.13.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 "configurationlist.hh"
12 #include "gepetto/gui/fwd.hh"
13 #include "gepetto/gui/mainwindow.hh"
14 #include "hpp/common-idl.hh"
15 
16 Q_DECLARE_METATYPE(hpp::floatSeq*)
17 
18 namespace Ui {
19 class ConfigurationListWidget;
20 }
21 
22 namespace hpp {
23 namespace gui {
24 class HppWidgetsPlugin;
25 
27 class ConfigurationListWidget : public QWidget {
28  Q_OBJECT
29 
30  public:
31  static const int ConfigRole;
33  inline QListWidget* list();
34 
36  void setInitConfig(hpp::floatSeq& config);
37 
38  ConfigurationListWidget(HppWidgetsPlugin* plugin, QWidget* parent = 0);
39 
40  virtual ~ConfigurationListWidget();
41 
42  static QListWidgetItem* makeItem(QString text, const hpp::floatSeq& q);
43 
44  static hpp::floatSeq& getConfig(QListWidgetItem* item);
45 
46  public slots:
48  void onSaveClicked();
49 
53  void updateCurrentConfig(QListWidgetItem* current, QListWidgetItem* previous);
54 
56 
57  private slots:
60  void resetGoalConfigs(bool doEmpty = true);
61 
63  void setConfigs();
64 
65  private:
67  inline QLineEdit* name();
68 
71  void renameConfig(QListWidgetItem* item);
72 
73  HppWidgetsPlugin* plugin_;
74  ::Ui::ConfigurationListWidget* ui_;
75  QListWidget* previous_;
76 
77  gepetto::gui::MainWindow* main_;
78  QString basename_;
79  int count_;
80 };
81 
82 QDataStream& operator>>(QDataStream& os, hpp::floatSeq& tab);
83 QDataStream& operator<<(QDataStream& os, const hpp::floatSeq& tab);
84 } // namespace gui
85 } // namespace hpp
86 
87 #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:18
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:27
static const int ConfigRole
Definition: configurationlistwidget.hh:31
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:30