The ActiveCoordinateFrame class. More...
#include <activecoordinateframe.h>
Public Member Functions | |
ActiveCoordinateFrame (float size) | |
The constructor. | |
virtual void | AlignWith (const Point3f primary, const Point3f secondary, const char axis_1, const char axis_2) |
Align the coordinate frame to one or two directions. | |
void | ButtonDown (int button) |
Interface function relative to keyboard down event in QT. | |
void | ButtonUp (int button) |
Interface function relative to keyboard up event in QT. | |
void | MouseDown (int x, int y, int button) |
Interface function relative to mouse down event in QT. | |
void | MouseMove (int x, int y) |
Interface function relative to mouse move event in QT. | |
void | MouseUp (int x, int y, int button) |
Interface function relative to mouse up event in QT. | |
virtual void | Render (QGLWidget *glw) |
Render the active coordinate frame in its position. | |
virtual void | Reset (bool reset_position, bool reset_alignment) |
Reset the position and/or the rotation of the coordinate frame. | |
virtual void | SetPosition (const Point3f new_position) |
Set the position of the coordinate frame. | |
virtual void | SetRotation (const Quaternionf rotation) |
Set the rotation of the coordinate frame. | |
void | SetSnap (float value) |
Set rotational snap value. | |
virtual | ~ActiveCoordinateFrame () |
Public Attributes | |
bool | drawmoves |
The flag that enables moves feedback rendering. | |
bool | drawrotations |
The flag that enables rotations feedback rendering. | |
Trackball * | manipulator |
The eulerian trackball. | |
Protected Member Functions | |
virtual void | Move (const Similarityf) |
void | Update () |
Protected Attributes | |
float | mov_snap |
const int | move_button |
float | rot_snap_rad |
const int | rotate_button |
Point3f | x_axis |
const int | x_modifier |
Point3f | y_axis |
const int | y_modifier |
Point3f | z_axis |
const int | z_modifier |
Private Attributes | |
int | movx |
int | movy |
int | movz |
int | rotx |
int | roty |
int | rotz |
The ActiveCoordinateFrame class.
This class implements an eulerian trackball over a Movable Coordinate Frame.
Definition at line 45 of file activecoordinateframe.h.
ActiveCoordinateFrame::ActiveCoordinateFrame | ( | float | size | ) |
The constructor.
Initialize the ActiveCoordinateFrame data.
size | the distance from the origin to the endpoint of the arrows. |
Definition at line 41 of file activecoordinateframe.cpp.
ActiveCoordinateFrame::~ActiveCoordinateFrame | ( | ) | [virtual] |
The destructor.
Definition at line 55 of file activecoordinateframe.cpp.
void ActiveCoordinateFrame::AlignWith | ( | const Point3f | primary, | |
const Point3f | secondary, | |||
const char | axis_1, | |||
const char | axis_2 | |||
) | [virtual] |
Align the coordinate frame to one or two directions.
If the primary direction of alignment is null this function does nothing, otherwise two rotations are performed: the first rotation aligns the axis named axis_1 to the primary direction of alignment, the second rotation never moves axis_1 away from the primary direction.
If the secondary direction of alignment is not null and is not parallel to the primary direction the axis named axis_2 is rotated as much as possible to be aligned to secondary direction.
If the secondary direction of alignment is null the axis named axis_2 is rotated as much as possible to be realigned to its old direction, if this is impossible the remaining axis is used.
primary | the primary direction of alignment. | |
secondary | the secondary direction of alignment. | |
axis_1 | the name of the axis to align to the primary direction, must be a char choosen from 'X', 'Y' and 'Z' | |
axis_2 | the name of the axis to align to the secondary direction, must be different from axis_1 and must be a char choosen from 'X', 'Y', 'Z' and ' '; if the char is ' ' the axis is choosen automatically. |
Reimplemented from vcg::MovableCoordinateFrame.
Definition at line 199 of file activecoordinateframe.cpp.
void ActiveCoordinateFrame::ButtonDown | ( | int | button | ) |
Interface function relative to keyboard down event in QT.
button | the keyboard modifiers state. |
Definition at line 232 of file activecoordinateframe.cpp.
void ActiveCoordinateFrame::ButtonUp | ( | int | button | ) |
Interface function relative to keyboard up event in QT.
button | the keyboard modifiers state. |
Definition at line 225 of file activecoordinateframe.cpp.
void ActiveCoordinateFrame::MouseDown | ( | int | x, | |
int | y, | |||
int | button | |||
) |
Interface function relative to mouse down event in QT.
x | the x coordinate of the cursor. | |
y | the y coordinate of the cursor. | |
button | the keyboard modifiers state. |
Definition at line 206 of file activecoordinateframe.cpp.
void ActiveCoordinateFrame::MouseMove | ( | int | x, | |
int | y | |||
) |
Interface function relative to mouse move event in QT.
x | the x coordinate of the cursor. | |
y | the y coordinate of the cursor. |
Definition at line 213 of file activecoordinateframe.cpp.
void ActiveCoordinateFrame::MouseUp | ( | int | x, | |
int | y, | |||
int | button | |||
) |
Interface function relative to mouse up event in QT.
x | the x coordinate of the cursor. | |
y | the y coordinate of the cursor. | |
button | the keyboard modifiers state. |
Definition at line 218 of file activecoordinateframe.cpp.
void ActiveCoordinateFrame::Move | ( | const Similarityf | track | ) | [protected, virtual] |
Reimplemented from vcg::MovableCoordinateFrame.
Definition at line 246 of file activecoordinateframe.cpp.
void ActiveCoordinateFrame::Render | ( | QGLWidget * | glw | ) | [virtual] |
Render the active coordinate frame in its position.
glw | the GL widget. |
Reimplemented from vcg::MovableCoordinateFrame.
Definition at line 63 of file activecoordinateframe.cpp.
void ActiveCoordinateFrame::Reset | ( | bool | reset_position, | |
bool | reset_alignment | |||
) | [virtual] |
Reset the position and/or the rotation of the coordinate frame.
reset_position | set to true to reset the position. | |
reset_alignment | set to true to reset the rotation. |
Reimplemented from vcg::MovableCoordinateFrame.
Definition at line 178 of file activecoordinateframe.cpp.
void ActiveCoordinateFrame::SetPosition | ( | const Point3f | new_position | ) | [virtual] |
Set the position of the coordinate frame.
new_position | the new position of the coordinate frame. |
Reimplemented from vcg::MovableCoordinateFrame.
Definition at line 185 of file activecoordinateframe.cpp.
void ActiveCoordinateFrame::SetRotation | ( | const Quaternionf | rotation | ) | [virtual] |
Set the rotation of the coordinate frame.
new_rotation | the new rotation of the coordinate frame. |
Reimplemented from vcg::MovableCoordinateFrame.
Definition at line 192 of file activecoordinateframe.cpp.
void ActiveCoordinateFrame::SetSnap | ( | float | value | ) |
Set rotational snap value.
value | the new rotational snap value, in degrees. |
Definition at line 239 of file activecoordinateframe.cpp.
void ActiveCoordinateFrame::Update | ( | ) | [protected] |
Definition at line 252 of file activecoordinateframe.cpp.
The flag that enables moves feedback rendering.
Definition at line 158 of file activecoordinateframe.h.
The flag that enables rotations feedback rendering.
Definition at line 161 of file activecoordinateframe.h.
The eulerian trackball.
Definition at line 155 of file activecoordinateframe.h.
float vcg::ActiveCoordinateFrame::mov_snap [protected] |
Definition at line 167 of file activecoordinateframe.h.
const int vcg::ActiveCoordinateFrame::move_button [protected] |
Definition at line 164 of file activecoordinateframe.h.
int vcg::ActiveCoordinateFrame::movx [private] |
Definition at line 172 of file activecoordinateframe.h.
int vcg::ActiveCoordinateFrame::movy [private] |
Definition at line 172 of file activecoordinateframe.h.
int vcg::ActiveCoordinateFrame::movz [private] |
Definition at line 172 of file activecoordinateframe.h.
float vcg::ActiveCoordinateFrame::rot_snap_rad [protected] |
Definition at line 167 of file activecoordinateframe.h.
const int vcg::ActiveCoordinateFrame::rotate_button [protected] |
Definition at line 164 of file activecoordinateframe.h.
int vcg::ActiveCoordinateFrame::rotx [private] |
Definition at line 172 of file activecoordinateframe.h.
int vcg::ActiveCoordinateFrame::roty [private] |
Definition at line 172 of file activecoordinateframe.h.
int vcg::ActiveCoordinateFrame::rotz [private] |
Definition at line 172 of file activecoordinateframe.h.
Point3f vcg::ActiveCoordinateFrame::x_axis [protected] |
Definition at line 166 of file activecoordinateframe.h.
const int vcg::ActiveCoordinateFrame::x_modifier [protected] |
Definition at line 165 of file activecoordinateframe.h.
Point3f vcg::ActiveCoordinateFrame::y_axis [protected] |
Definition at line 166 of file activecoordinateframe.h.
const int vcg::ActiveCoordinateFrame::y_modifier [protected] |
Definition at line 165 of file activecoordinateframe.h.
Point3f vcg::ActiveCoordinateFrame::z_axis [protected] |
Definition at line 166 of file activecoordinateframe.h.
const int vcg::ActiveCoordinateFrame::z_modifier [protected] |
Definition at line 165 of file activecoordinateframe.h.