hpp-gui  4.15.1
Graphical interface for HPP
solverwidget.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_SOLVERWIDGET_HH
7 #define HPP_GUI_SOLVERWIDGET_HH
8 
9 #include <QWidget>
10 
11 #include "gepetto/gui/fwd.hh"
13 
14 class QComboBox;
15 class QDoubleSpinBox;
16 
17 namespace Ui {
18 class SolverWidget;
19 }
20 
21 namespace hpp {
22 namespace gui {
23 class SolverWidget : public QWidget {
24  Q_OBJECT
25 
26  public:
27  enum Select {
33  All
34  };
35 
36  SolverWidget(HppWidgetsPlugin* plugin, QWidget* parent = 0);
37 
38  ~SolverWidget();
39 
40  public slots:
43  virtual void update(Select s = All);
44 
45  signals:
46  void problemSolved();
47 
48  protected slots:
51  void selectPathPlanner(const QString& text);
52 
55  void selectPathOptimizers(const QStringList& list);
56  void openPathOptimizerSelector();
57 
60  void selectPathProjector(const QString& name);
61 
64  void selectPathValidation(const QString& name);
65 
68  void selectSteeringMethod(const QString& name);
69 
72  void discontinuityChanged(double value);
73 
76  void penetrationChanged(double value);
77 
79  void solve();
80 
83  void solveAndDisplay();
84 
86  void interrupt();
87 
89  void loadRoadmap();
90 
92  void saveRoadmap();
93 
95  void clearRoadmap();
96 
98  void optimizePath();
99 
100  void solveDone();
101 
102  private:
103  struct Solve {
104  bool interrupt, stepByStep, isSolved;
105  QFuture<void> status;
106  QFutureWatcher<void> watcher;
107  HppWidgetsPlugin* plugin;
108  SolverWidget* parent;
109  void solve();
110  void optimize(const int pathId);
111  void solveAndDisplay();
112  bool done();
113  Solve(HppWidgetsPlugin* p, SolverWidget* par)
114  : interrupt(false),
115  stepByStep(false),
116  isSolved(false),
117  plugin(p),
118  parent(par) {}
119  };
120 
121  void setSelected(QComboBox* cb, QString const& what);
122  void selectButtonSolve(bool solve);
123  QComboBox* planner();
124  QComboBox* projector();
125  QComboBox* validation();
126  QComboBox* steeringMethod();
127  QDoubleSpinBox* projectorDiscontinuity();
128  QDoubleSpinBox* validationPenetration();
129 
130  ::Ui::SolverWidget* ui_;
131  HppWidgetsPlugin* plugin_;
132  gepetto::gui::MainWindow* main_;
133 
134  QStringList optimizers_;
135 
136  Solve solve_;
137  friend struct Solve;
138 };
139 } // namespace gui
140 } // namespace hpp
141 
142 #endif // HPP_GUI_SOLVERWIDGET_HH
Definition: solverwidget.hh:31
Definition: solverwidget.hh:30
namespace that encapsulate all the softwares of humanoid-path-planner
Definition: __init__.py:1
Definition: configurationlistwidget.hh:18
Select
Definition: solverwidget.hh:27
Definition: solverwidget.hh:23
Definition: solverwidget.hh:28
Definition: solverwidget.hh:32
Plugin that add a lot of features to work with hpp.
Definition: hppwidgetsplugin.hh:30
Definition: solverwidget.hh:29