| VRS - The Virtual Rendering System |
| version 3.3 |
#include <vrs/sg/trackball.h>

Public Member Functions | |
| TrackBall (SceneThing *thing, InputEvent::Button button=InputEvent::MouseButton1, InputEvent::Modifier modifier=InputEvent::NoModifier, InputEvent::Modifier must_not_modifier=InputEvent::NoModifier, double speed=1.0, double ballsize=1.0, BehaviorNode::InvalidationHint redrawPolicy=BehaviorNode::RedrawWorld) | |
| A Trackball is constructed with a SceneThing, which is used for rotation. | |
| void | setSpeed (double s) |
| double | getSpeed () const |
| void | setSize (double size) |
| double | getSize () const |
| void | setThing (SceneThing *node) |
| SceneThing * | getThing () const |
| void | reset () |
| void | setRedrawPolicy (BehaviorNode::InvalidationHint) |
| BehaviorNode::InvalidationHint | getRedrawPolicy () const |
| virtual BehaviorNode::InvalidationHint | dragStart (int x, int y, ButtonEvent *e) |
| virtual BehaviorNode::InvalidationHint | dragMotion (int x, int y, MotionEvent *e) |
| virtual BehaviorNode::InvalidationHint | dragEnd (int x, int y, ButtonEvent *e) |
| Overloaded drag methods which implement the trackball. | |
| void | setAutoRotation (bool enabled, int minRadiusInPixel=20) |
| bool | getAutoRotation () const |
| int | getAutoRadius () const |
| bool | isAutoRotating () const |
| virtual BehaviorNode::InvalidationHint | handle (Event *) |
| VRS_TYPEINFO (TrackBall, Manipulator) | |
| VRS_SERIALIZABLE (TrackBall) | |
Protected Member Functions | |
| TrackBall () | |
| VRS::TrackBall::TrackBall | ( | SceneThing * | thing, | |
| InputEvent::Button | button = InputEvent::MouseButton1, |
|||
| InputEvent::Modifier | modifier = InputEvent::NoModifier, |
|||
| InputEvent::Modifier | must_not_modifier = InputEvent::NoModifier, |
|||
| double | speed = 1.0, |
|||
| double | ballsize = 1.0, |
|||
| BehaviorNode::InvalidationHint | redrawPolicy = BehaviorNode::RedrawWorld | |||
| ) |
A Trackball is constructed with a SceneThing, which is used for rotation.
| VRS::TrackBall::TrackBall | ( | ) | [protected] |
| void VRS::TrackBall::setSpeed | ( | double | s | ) |
| double VRS::TrackBall::getSpeed | ( | ) | const [inline] |
The speed specifies how fast a mouse movement rotates the target object. The default is 1.0. Negative values invert the rotation direction.
| void VRS::TrackBall::setSize | ( | double | size | ) |
| double VRS::TrackBall::getSize | ( | void | ) | const [inline] |
Trackball size, i.e., the radius of the virtual sphere around the object.
| void VRS::TrackBall::setThing | ( | SceneThing * | node | ) |
| SceneThing * VRS::TrackBall::getThing | ( | ) | const [inline] |
The trackball is applied to the geometry subgraph specified by the given SceneThing.
| void VRS::TrackBall::reset | ( | ) |
sets the transformation of the trackball back to its initial value.
| void VRS::TrackBall::setRedrawPolicy | ( | BehaviorNode::InvalidationHint | ) |
| BehaviorNode::InvalidationHint VRS::TrackBall::getRedrawPolicy | ( | ) | const [inline] |
The redraw policy flag will be returned by `dragMotion'. It specifies what to redraw after each motion event. See the behavior node class for more information.
| virtual BehaviorNode::InvalidationHint VRS::TrackBall::dragStart | ( | int | x, | |
| int | y, | |||
| ButtonEvent * | e | |||
| ) | [virtual] |
Implements VRS::Manipulator.
| virtual BehaviorNode::InvalidationHint VRS::TrackBall::dragMotion | ( | int | x, | |
| int | y, | |||
| MotionEvent * | e | |||
| ) | [virtual] |
Implements VRS::Manipulator.
| virtual BehaviorNode::InvalidationHint VRS::TrackBall::dragEnd | ( | int | x, | |
| int | y, | |||
| ButtonEvent * | e | |||
| ) | [virtual] |
| void VRS::TrackBall::setAutoRotation | ( | bool | enabled, | |
| int | minRadiusInPixel = 20 | |||
| ) |
| bool VRS::TrackBall::getAutoRotation | ( | ) | const |
| int VRS::TrackBall::getAutoRadius | ( | ) | const |
| bool VRS::TrackBall::isAutoRotating | ( | ) | const |
Automatic rotation can be enabled and disabled. If enabled, it is activated if the user moves the mouse fastly before he releases the mouse button. The sensitivity can be controlled by the min distance given in pixels. Auto rotation always stops if the users presses the mouse.
| virtual BehaviorNode::InvalidationHint VRS::TrackBall::handle | ( | Event * | ) | [virtual] |
An TrackBall handles `TimeEvent's if auto rotation is activated. Otherwise, the handle method of its base class is executed.
Reimplemented from VRS::Interaction.
| VRS::TrackBall::VRS_TYPEINFO | ( | TrackBall | , | |
| Manipulator | ||||
| ) |
| VRS::TrackBall::VRS_SERIALIZABLE | ( | TrackBall | ) |