Public Member Functions | Protected Member Functions | Protected Attributes
vcg::MovableCoordinateFrame Class Reference

The MovableCoordinateFrame class. More...

#include <coordinateframe.h>

Inheritance diagram for vcg::MovableCoordinateFrame:
Inheritance graph
[legend]

List of all members.

Public Member Functions

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.
virtual Point3f GetPosition ()
 Get the position of the coordinate frame.
virtual Quaternionf GetRotation ()
 Get the rotation of the coordinate frame.
virtual void GetTransform (Matrix44f &m)
 Computes the transformation matrix relative to the current rototranslation.
 MovableCoordinateFrame (float)
 The constructor.
virtual void Render (QGLWidget *glw, QPainter *p=NULL)
 Render the movable 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 Rot (float angle, const Point3f axis)
 Rotates the coordinate frame wrt itself.
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.
virtual ~MovableCoordinateFrame ()

Protected Member Functions

virtual void Move (const Similarityf)
void RotateToAlign (const Point3f, const Point3f)

Protected Attributes

Point3f position
Quaternionf rotation

Detailed Description

The MovableCoordinateFrame class.

This class extends the coordinate frame with the ability of being programmatically rototranslated.

Definition at line 127 of file coordinateframe.h.


Constructor & Destructor Documentation

The constructor.

Initialize the MovableCoordinateFrame data.

Parameters:
sizethe distance from the origin to the endpoint of the arrows.

Definition at line 202 of file coordinateframe.cpp.

The destructor.

Definition at line 144 of file coordinateframe.h.


Member Function Documentation

void MovableCoordinateFrame::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.

Parameters:
primarythe primary direction of alignment.
secondarythe secondary direction of alignment.
axis_1the name of the axis to align to the primary direction, must be a char choosen from 'X', 'Y' and 'Z'
axis_2the 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 in vcg::ActiveCoordinateFrame.

Definition at line 279 of file coordinateframe.cpp.

Get the position of the coordinate frame.

Returns:
the position of the coordinate frame.

Definition at line 262 of file coordinateframe.cpp.

Get the rotation of the coordinate frame.

Returns:
the rotation of the coordinate frame.

Definition at line 267 of file coordinateframe.cpp.

Computes the transformation matrix relative to the current rototranslation.

Parameters:
mis set to the transformation matrix.

Definition at line 223 of file coordinateframe.cpp.

void MovableCoordinateFrame::Move ( const Similarityf  track) [protected, virtual]

Reimplemented in vcg::ActiveCoordinateFrame.

Definition at line 339 of file coordinateframe.cpp.

void MovableCoordinateFrame::Render ( QGLWidget *  glw,
QPainter *  p = NULL 
) [virtual]

Render the movable coordinate frame in its position.

Parameters:
glwthe GL widget.

Reimplemented from vcg::CoordinateFrame.

Definition at line 208 of file coordinateframe.cpp.

void MovableCoordinateFrame::Reset ( bool  reset_position,
bool  reset_alignment 
) [virtual]

Reset the position and/or the rotation of the coordinate frame.

Parameters:
reset_positionset to true to reset the position.
reset_alignmentset to true to reset the rotation.

Reimplemented in vcg::ActiveCoordinateFrame.

Definition at line 244 of file coordinateframe.cpp.

void MovableCoordinateFrame::Rot ( float  angle,
const Point3f  axis 
) [virtual]

Rotates the coordinate frame wrt itself.

Parameters:
anglethe angle of the rotation, in degrees.
axisthe axis of the rotation.

Definition at line 272 of file coordinateframe.cpp.

void MovableCoordinateFrame::RotateToAlign ( const Point3f  source,
const Point3f  dest 
) [protected]

Definition at line 345 of file coordinateframe.cpp.

void MovableCoordinateFrame::SetPosition ( const Point3f  new_position) [virtual]

Set the position of the coordinate frame.

Parameters:
new_positionthe new position of the coordinate frame.

Reimplemented in vcg::ActiveCoordinateFrame.

Definition at line 252 of file coordinateframe.cpp.

void MovableCoordinateFrame::SetRotation ( const Quaternionf  rotation) [virtual]

Set the rotation of the coordinate frame.

Parameters:
new_rotationthe new rotation of the coordinate frame.

Reimplemented in vcg::ActiveCoordinateFrame.

Definition at line 257 of file coordinateframe.cpp.


Member Data Documentation

Definition at line 222 of file coordinateframe.h.

Definition at line 223 of file coordinateframe.h.


The documentation for this class was generated from the following files:


shape_reconstruction
Author(s): Roberto Martín-Martín
autogenerated on Sat Jun 8 2019 18:41:19