Control Panel.
Contains controls for modifying epsilon, and for running algorithms.
- Author
- Peter Schäfer
Definition at line 23 of file controlpanel.h.
#include <controlpanel.h>
Inherits QWidget.
|
| void | epsilonChanged (double eps) |
| | raised when the value of epsilon changes (e.g. when the user operates the slider control). This signal triggers a number of subsequent actions (e.g. updating the free-space diagram). More...
|
| |
| void | showGreedyResult () |
| | raised when the user clicks the "Show" button in the k-Frechet panel. Updates the free-space diagram to show the results of the "greedy" algorithm. More...
|
| |
| void | showOptimalResult () |
| | raised when the user clicks the "Show" button in the k-Frechet panel. Updates the free-space diagram to show the results of the "brute force" algorithm. More...
|
| |
| void | hideResult () |
| | raised when the user clicks the "Hide" button in the k-Frechet panel. Resets the free-space diagram to default. More...
|
| |
|
| static const int | DECIMALS = 8 |
| | number of decimals in the epsilon control More...
|
| |
| static QMovie * | loaderMovie = nullptr |
| | displays a rotatin icon (during a long-running algorithm) More...
|
| |
| static QString | POLY_STATUS [] |
| | texts to display for algorithm results More...
|
| |
◆ ControlPanel()
| ControlPanel::ControlPanel |
( |
QWidget * |
parent = 0 | ) |
|
default constructor
- Parameters
-
| parent | parent widget (optional) |
Definition at line 18 of file controlpanel.cpp.
◆ clearResults
| void ControlPanel::clearResults |
( |
| ) |
|
|
slot |
◆ epsilonChanged
| void frechet::view::ControlPanel::epsilonChanged |
( |
double |
eps | ) |
|
|
signal |
raised when the value of epsilon changes (e.g. when the user operates the slider control). This signal triggers a number of subsequent actions (e.g. updating the free-space diagram).
- Parameters
-
◆ fromSliderValue()
| double ControlPanel::fromSliderValue |
( |
int |
i | ) |
|
|
private |
map a slider location to a value of epsilon
- Parameters
-
- Returns
- epsilon value
Definition at line 118 of file controlpanel.cpp.
◆ getEpsilon()
| double frechet::view::ControlPanel::getEpsilon |
( |
| ) |
|
|
inline |
- Returns
- the current value of epsilon
Definition at line 36 of file controlpanel.h.
◆ hideResult
| void frechet::view::ControlPanel::hideResult |
( |
| ) |
|
|
signal |
raised when the user clicks the "Hide" button in the k-Frechet panel. Resets the free-space diagram to default.
◆ keyPressEvent()
| void ControlPanel::keyPressEvent |
( |
QKeyEvent * |
event | ) |
|
|
overrideprotected |
◆ lockInput
| void frechet::view::ControlPanel::lockInput |
( |
bool |
| ) |
|
|
inlineslot |
◆ onAlgorithmChanged
| void ControlPanel::onAlgorithmChanged |
( |
int |
algorithm | ) |
|
|
slot |
called when the user selects a algorithm panel. Calls on FrechetViewApplication to update the current algorithm.
- Parameters
-
Definition at line 442 of file controlpanel.cpp.
◆ onBFButton
| void ControlPanel::onBFButton |
( |
| ) |
|
|
slot |
called when the user clicks the "Show" button in the "brute-force" section. Triggers showOptimalResult(), which in turn triggers an update to the Free-Space diagram.
Definition at line 466 of file controlpanel.cpp.
◆ onCurveFinished
| void ControlPanel::onCurveFinished |
( |
bool |
ok | ) |
|
|
slot |
called when the curve algorithm finishes; update the "curve" panel to show latest results
Definition at line 418 of file controlpanel.cpp.
◆ onEdit
| void ControlPanel::onEdit |
( |
| ) |
|
|
slot |
called after the user has edited the value of epsilon. Triggers epsilonChanged(), which in turn triggers a number of update operations.
Definition at line 436 of file controlpanel.cpp.
◆ onGreedyButton
| void ControlPanel::onGreedyButton |
( |
| ) |
|
|
slot |
called when the user clicks the "Show" button in the "greedy" section. Triggers showGreedyResult(), which in turn triggers an update to the Free-Space diagram.
Definition at line 453 of file controlpanel.cpp.
◆ onShowBounds
| void ControlPanel::onShowBounds |
( |
bool |
| ) |
|
|
slot |
called when the user clicks the "Show Bounds" button
Definition at line 408 of file controlpanel.cpp.
◆ onSlider
| void ControlPanel::onSlider |
( |
int |
value | ) |
|
|
slot |
called when the user moves the slider control for epsilon. Triggers epsilonChanged(), which in turn triggers a number of update operations.
- Parameters
-
| value | new value of epsilon |
Definition at line 449 of file controlpanel.cpp.
◆ restoreSettings()
| void ControlPanel::restoreSettings |
( |
QSettings & |
settings, |
|
|
QString |
group |
|
) |
| |
load settings from application preferences
- Parameters
-
| settings | application preferences |
| group | section where to store settings |
Definition at line 68 of file controlpanel.cpp.
◆ saveSettings()
| void ControlPanel::saveSettings |
( |
QSettings & |
settings, |
|
|
QString |
group |
|
) |
| |
store settings to application preferences
- Parameters
-
| settings | application preferences |
| group | section where to store settings |
Definition at line 57 of file controlpanel.cpp.
◆ setEpsilon
| void ControlPanel::setEpsilon |
( |
double |
eps, |
|
|
bool |
notify |
|
) |
| |
|
slot |
updates the value of epsilon
- Parameters
-
| eps | new value of epsilon |
| notify | if true, raise signals to update other parts of the GUI. if false, update silently. |
Definition at line 81 of file controlpanel.cpp.
◆ setEpsilonMax
| void ControlPanel::setEpsilonMax |
( |
double |
eps_max | ) |
|
|
slot |
update the maximum value of epsilon; adjusts the slider control
- Parameters
-
| eps_max | maximum value for epsilon |
Definition at line 123 of file controlpanel.cpp.
◆ setEpsilonWithNotify
| void frechet::view::ControlPanel::setEpsilonWithNotify |
( |
double |
eps | ) |
|
|
inlineslot |
update the value of epsilon and raise signals
- Parameters
-
Definition at line 126 of file controlpanel.h.
◆ setEpsilonWithoutNotify
| void frechet::view::ControlPanel::setEpsilonWithoutNotify |
( |
double |
eps | ) |
|
|
inlineslot |
update the value of epsilon without raising signals
- Parameters
-
Definition at line 121 of file controlpanel.h.
◆ setIcon()
| void ControlPanel::setIcon |
( |
QLabel * |
label, |
|
|
QString |
text, |
|
|
QString |
tooltip = "" |
|
) |
| |
|
private |
show a status icon in the control panel
- Parameters
-
| label | widget that contains the icon |
| text | status text |
| tooltip | tooltip (mouse over) text |
Definition at line 525 of file controlpanel.cpp.
◆ showGreedyResult
| void frechet::view::ControlPanel::showGreedyResult |
( |
| ) |
|
|
signal |
raised when the user clicks the "Show" button in the k-Frechet panel. Updates the free-space diagram to show the results of the "greedy" algorithm.
◆ showIcon()
| void ControlPanel::showIcon |
( |
QLabel * |
label, |
|
|
int |
status |
|
) |
| |
|
private |
show a status icon in the control panel
- Parameters
-
| label | widget that contains the icon |
| status | algorithm status |
- See also
- kAlgorith::Result
Definition at line 497 of file controlpanel.cpp.
◆ showOptimalResult
| void frechet::view::ControlPanel::showOptimalResult |
( |
| ) |
|
|
signal |
raised when the user clicks the "Show" button in the k-Frechet panel. Updates the free-space diagram to show the results of the "brute force" algorithm.
◆ toDouble()
| double ControlPanel::toDouble |
( |
QString |
text | ) |
|
|
private |
parse a number input
- Parameters
-
- Returns
- a number
Definition at line 106 of file controlpanel.cpp.
◆ toSliderValue()
| int ControlPanel::toSliderValue |
( |
double |
x | ) |
|
|
private |
map an epsilon value to a slider location
- Parameters
-
- Returns
- location on slider
Definition at line 113 of file controlpanel.cpp.
◆ toString()
| QString ControlPanel::toString |
( |
double |
x | ) |
|
|
private |
format a number for display, with appropriate locale
- Parameters
-
- Returns
- string representation
Definition at line 97 of file controlpanel.cpp.
◆ updateGreedyResult() [1/2]
update results of the k-Frechet greedy algorithm
- Parameters
-
| kalg | results of the greedy algorithm |
◆ updateGreedyResult() [2/2]
update results of the k-Frechet greedy algorithm
- Parameters
-
| k1 | results of the greedy algorithm |
| k2 | results of the greedy algorithm |
◆ updateOptimalResult() [1/2]
update results of the k-Frechet brute-force algorithm
- Parameters
-
| bfres | results of the brute-force algorithm |
◆ updateOptimalResult() [2/2]
update results of the k-Frechet brute-force algorithm
- Parameters
-
| kres | results of the brute-force algorithm |
◆ updatePolyResult
| void ControlPanel::updatePolyResult |
( |
| ) |
|
|
slot |
update the "Polygon" pabel to show the lastest results of the poly-algorithm
Definition at line 327 of file controlpanel.cpp.
◆ updateResults
| void ControlPanel::updateResults |
( |
| ) |
|
|
slot |
update the k-Frechet panel to show the latest results of the k-Frechet algorithm
Definition at line 156 of file controlpanel.cpp.
◆ wheelEvent()
| void ControlPanel::wheelEvent |
( |
QWheelEvent * |
wh | ) |
|
|
overrideprotected |
◆ curve_was_ok
| bool frechet::view::ControlPanel::curve_was_ok |
|
private |
latest result of the decision algorithm for curves
Definition at line 217 of file controlpanel.h.
◆ DECIMALS
| const int ControlPanel::DECIMALS = 8 |
|
staticprivate |
number of decimals in the epsilon control
Definition at line 165 of file controlpanel.h.
◆ eps
| double frechet::view::ControlPanel::eps |
|
private |
◆ eps_step
| double frechet::view::ControlPanel::eps_step |
|
private |
◆ epsValidator
| QDoubleValidator* frechet::view::ControlPanel::epsValidator |
|
private |
◆ loaderMovie
| QMovie * ControlPanel::loaderMovie = nullptr |
|
staticprivate |
displays a rotatin icon (during a long-running algorithm)
Definition at line 213 of file controlpanel.h.
◆ locale
| QLocale frechet::view::ControlPanel::locale |
|
private |
◆ movieLabel
| QLabel* frechet::view::ControlPanel::movieLabel |
|
private |
◆ POLY_STATUS
| QString ControlPanel::POLY_STATUS |
|
staticprivate |
Initial value:= {
"OK", "no solution",
"NOT_SET_UP",
"",
"P is empty", "Q is empty",
"P is not closed", "Q is not closed",
"P is not simple", "Q is not simple",
"P_NOT_COUNTER_CLOCKWISE", "Q_NOT_COUNTER_CLOCKWISE",
"P is convex", "Q is convex"
}
texts to display for algorithm results
Definition at line 220 of file controlpanel.h.
◆ ui
| Ui::ControlPanel frechet::view::ControlPanel::ui |
|
private |
◆ epsilon
| double frechet::view::ControlPanel::epsilon |
|
readwrite |
The documentation for this class was generated from the following files: