The constrained rotation manipulator. More...
#include <trackmode.h>
Public Member Functions | |
void | Apply (Trackball *trackball, float WheelNotch) |
Apply a rotation, function of the user mouse wheel action. | |
void | Apply (Trackball *trackball, Point3f new_point) |
Apply a rotation, function of the user mouse drag action. | |
CylinderMode (const Point3f &origin, const Point3f &direction, float s=0.0f) | |
The origin-direction constructor. | |
CylinderMode (Line3fN &ln, float s=0.0f) | |
The line constructor. | |
void | Draw (Trackball *trackball) |
Render this manipulator. | |
const char * | Name () |
Return this manipulator's name. | |
Private Attributes | |
Line3fN | axis |
The axis, stored as a normalized line. | |
float | snap |
The rotational snap value. |
The constrained rotation manipulator.
This manipulator implements a rotation manipulator, that make the rotation constrained around a given axis.
The user can either drag the mouse or scroll the wheel, in either cases the rotation's angle is influenced by the radius of the trackball.
This is a stateless manipulator, result of the Apply functions is determined only either by the mouse coordinates or by the mouse wheel notch.
Definition at line 560 of file trackmode.h.
vcg::CylinderMode::CylinderMode | ( | Line3fN & | ln, | |
float | s = 0.0f | |||
) | [inline] |
The line constructor.
This manipulator needs to be initialized with an axis. This constructor can initialize it with a Line3f.
The line will be normalized.
ln | the line that represent the axis. | |
s | a rotational snap angle non negative |
Definition at line 572 of file trackmode.h.
vcg::CylinderMode::CylinderMode | ( | const Point3f & | origin, | |
const Point3f & | direction, | |||
float | s = 0.0f | |||
) | [inline] |
The origin-direction constructor.
This manipulator needs to be initialized with a axis. This constructor can initialize it with two Point3f, representing a point and a vector.
origin | a point on the axis. | |
direction | the axis direction. | |
s | a rotational snap angle (non negative) |
Definition at line 587 of file trackmode.h.
void CylinderMode::Apply | ( | Trackball * | trackball, | |
float | WheelNotch | |||
) | [virtual] |
Apply a rotation, function of the user mouse wheel action.
The manipulated object is rotated around the axis.
trackball | the manipulator manager. | |
WheelNotch | the mouse wheel notch. |
Reimplemented from vcg::TrackMode.
Definition at line 284 of file trackmode.cpp.
Apply a rotation, function of the user mouse drag action.
The manipulated object is rotated around the axis.
if the axis is too perpendicular to view plane, the angle is specified only by the vertical component of the mouse drag and the radius.
trackball | the manipulator manager. | |
new_point | the new mouse pointer coordinate. |
Reimplemented from vcg::TrackMode.
Definition at line 291 of file trackmode.cpp.
void CylinderMode::Draw | ( | Trackball * | trackball | ) | [virtual] |
Render this manipulator.
trackball | the manipulator manager. |
Reimplemented from vcg::TrackMode.
Definition at line 316 of file trackmode.cpp.
const char* vcg::CylinderMode::Name | ( | ) | [inline, virtual] |
Return this manipulator's name.
Reimplemented from vcg::TrackMode.
Definition at line 596 of file trackmode.h.
Line3fN vcg::CylinderMode::axis [private] |
The axis, stored as a normalized line.
Definition at line 628 of file trackmode.h.
float vcg::CylinderMode::snap [private] |
The rotational snap value.
Definition at line 630 of file trackmode.h.