GCC Code Coverage Report


Directory: plugins/
File: plugins/hppwidgetsplugin/solverwidget.hh
Date: 2024-12-13 15:51:58
Exec Total Coverage
Lines: 0 7 0.0%
Branches: 0 2 0.0%

Line Branch Exec Source
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"
12 #include "hppwidgetsplugin/hppwidgetsplugin.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 {
28 Planner,
29 Optimizer,
30 Projector,
31 Validation,
32 SteeringMethod,
33 All
34 };
35
36 SolverWidget(HppWidgetsPlugin* plugin, QWidget* parent = 0);
37
38 ~SolverWidget();
39
40 public slots:
41 /// Update the field in the widget.
42 /// \param s which field to update
43 virtual void update(Select s = All);
44
45 signals:
46 void problemSolved();
47
48 protected slots:
49 /// Change the path planner use in hpp.
50 /// \param text name of the path planner
51 void selectPathPlanner(const QString& text);
52
53 /// Change the path Optimizers in hpp.
54 /// \param list list of path optimizers
55 void selectPathOptimizers(const QStringList& list);
56 void openPathOptimizerSelector();
57
58 /// Change the path projector in hpp.
59 /// \param name name of the path projector
60 void selectPathProjector(const QString& name);
61
62 /// Change the path validation in hpp.
63 /// \param name name of the path validation
64 void selectPathValidation(const QString& name);
65
66 /// Change the steering method in hpp.
67 /// \param name name of the path projector
68 void selectSteeringMethod(const QString& name);
69
70 /// Change the allowed discontinuity in hpp
71 /// \param value new value of discontinuity
72 void discontinuityChanged(double value);
73
74 /// Change the allowed penetration in hpp
75 /// \param value new value of penetration
76 void penetrationChanged(double value);
77
78 /// Ask hpp to solve the problem.
79 void solve();
80
81 /// Ask hpp to solve the problem and display the roadmap of the joint
82 /// selected in the joint tree.
83 void solveAndDisplay();
84
85 /// Interrupt the solver.
86 void interrupt();
87
88 /// Load a roadmap in hpp.
89 void loadRoadmap();
90
91 /// Save the roadmap from hpp.
92 void saveRoadmap();
93
94 /// Reset the roadmap in hpp.
95 void clearRoadmap();
96
97 /// Optimize the path currently selected in PathPlayer widget.
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
143