|
Provides a simple joystick control. More...
#include <ArmarXGui/libraries/ArmarXGuiBase/widgets/JoystickControlWidget.h>
Public Slots | |
int | getSteps () |
Returns the steps of the control. More... | |
void | setNibble (QPointF pos) |
Sets the nibble to pos. More... | |
void | setSteps (int stepCount) |
Sets the steps of the control. More... | |
Signals | |
void | changed (QPointF, double) |
Passes the position and angle of the control in polar coordinates (-pi,pi]. More... | |
void | positionChanged (QPointF) |
Passes the position of the control. More... | |
void | pressed () |
Emitted when the nibble was pressed. More... | |
void | released () |
Emitted when the nibble was released. More... | |
void | rotationChanged (double) |
Passes the angle of the control in polar coordinates (-pi,pi]. More... | |
Public Member Functions | |
QPointF | getPosition () const |
Returns the position of the nibble. More... | |
double | getRotation () const |
f the control in polar coordinates (-pi,pi]. More... | |
JoystickControlWidget (bool useQuadrant3and4=true, QWidget *parent=0) | |
Protected Member Functions | |
void | resizeEvent (QResizeEvent *event) override |
Provides a simple joystick control.
The widget emits signals when the control is moved.
The signal
passes the nibble's current position. The position is in the unit circle. The x-axis is horizontal and increases to the right. The y-axis is vertical and increases upwards.
The signal
passes the position vectors rotation in polar coordinates (-pi,pi]. The up position is 0. The down position is pi. The Quadrants 1 and 4 have positive value.
If the constructor is called with useQuadrant3and4==true the control is the whole unit circle. If the constructor is called with useQuadrant3and4==false the control is the unit circle's upper semicircle. (y>=0)
Possible positions can be influenced with
Definition at line 124 of file JoystickControlWidget.h.
|
explicit |
Definition at line 68 of file JoystickControlWidget.cpp.
|
signal |
Passes the position and angle of the control in polar coordinates (-pi,pi].
QPointF getPosition | ( | ) | const |
Returns the position of the nibble.
The position is in a circle with the radius 1 around (0;0)
Definition at line 112 of file JoystickControlWidget.cpp.
double getRotation | ( | ) | const |
f the control in polar coordinates (-pi,pi].
The top position is 0. The bottom pos
Returns the angle oition is pi. The Quadrants 1 and 4 have positive value.
Definition at line 117 of file JoystickControlWidget.cpp.
|
slot |
Returns the steps of the control.
(0=> unlimited steps)
Definition at line 224 of file JoystickControlWidget.cpp.
|
signal |
Passes the position of the control.
The position is in a circle with the radius 1 around (0;0)
|
signal |
Emitted when the nibble was pressed.
|
signal |
Emitted when the nibble was released.
|
overrideprotected |
|
signal |
Passes the angle of the control in polar coordinates (-pi,pi].
The top position is 0. The bottom position is pi. The Quadrants 1 and 4 have positive value.
|
slot |
Sets the nibble to pos.
(pos will be transformed to be a valid position)
pos | The new position. |
Definition at line 148 of file JoystickControlWidget.cpp.
|
slot |
Sets the steps of the control.
(0=> unlimited steps)
stepCount | The new step count. (values <0 will be used as 0) |
Definition at line 219 of file JoystickControlWidget.cpp.