hpp-gui  5.1.0
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 {
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);
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();
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
hpp.gui::SolverWidget::Optimizer
@ Optimizer
Definition: solverwidget.hh:29
hpp.gui::SolverWidget::loadRoadmap
void loadRoadmap()
Load a roadmap in hpp.
hpp.gui::SolverWidget::solve
void solve()
Ask hpp to solve the problem.
hpp.gui::SolverWidget::problemSolved
void problemSolved()
hpp.gui::SolverWidget::Validation
@ Validation
Definition: solverwidget.hh:31
hpp.gui::SolverWidget::Projector
@ Projector
Definition: solverwidget.hh:30
hpp.gui::SolverWidget::solveAndDisplay
void solveAndDisplay()
hppwidgetsplugin.hh
hpp.gui::SolverWidget::saveRoadmap
void saveRoadmap()
Save the roadmap from hpp.
hpp.gui::SolverWidget::optimizePath
void optimizePath()
Optimize the path currently selected in PathPlayer widget.
hpp.gui::SolverWidget::Planner
@ Planner
Definition: solverwidget.hh:28
hpp.gui::SolverWidget::interrupt
void interrupt()
Interrupt the solver.
hpp.gui::SolverWidget::Select
Select
Definition: solverwidget.hh:27
hpp.gui::SolverWidget::Solve
friend struct Solve
Definition: solverwidget.hh:137
Ui
Definition: configurationlistwidget.hh:18
hpp.gui::SolverWidget::selectPathOptimizers
void selectPathOptimizers(const QStringList &list)
hpp.gui::SolverWidget::SteeringMethod
@ SteeringMethod
Definition: solverwidget.hh:32
hpp.gui::SolverWidget::~SolverWidget
~SolverWidget()
hpp
namespace that encapsulate all the softwares of humanoid-path-planner
Definition: __init__.py:1
hpp.gui::SolverWidget::selectPathPlanner
void selectPathPlanner(const QString &text)
hpp.gui::SolverWidget::selectPathValidation
void selectPathValidation(const QString &name)
hpp.gui::SolverWidget::clearRoadmap
void clearRoadmap()
Reset the roadmap in hpp.
hpp.gui::SolverWidget::openPathOptimizerSelector
void openPathOptimizerSelector()
hpp.gui::SolverWidget::All
@ All
Definition: solverwidget.hh:33
hpp.gui::SolverWidget::discontinuityChanged
void discontinuityChanged(double value)
hpp.gui::HppWidgetsPlugin
Plugin that add a lot of features to work with hpp.
Definition: hppwidgetsplugin.hh:30
hpp.gui::SolverWidget::selectSteeringMethod
void selectSteeringMethod(const QString &name)
hpp.gui::SolverWidget::SolverWidget
SolverWidget(HppWidgetsPlugin *plugin, QWidget *parent=0)
hpp.gui::SolverWidget::selectPathProjector
void selectPathProjector(const QString &name)
hpp.gui::SolverWidget
Definition: solverwidget.hh:23
hpp.gui::SolverWidget::update
virtual void update(Select s=All)
hpp.gui::SolverWidget::solveDone
void solveDone()
hpp.gui::SolverWidget::penetrationChanged
void penetrationChanged(double value)