GVectors::VisualVector Class Reference

Class intended to visualize a GVector. More...

#include <visualvector.h>

Inheritance diagram for GVectors::VisualVector:

GVectors::GVector GVectors::Coordinates List of all members.

Public Member Functions

 VisualVector ()
 Constructor.
 VisualVector (double x, double y, double z)
 Constructor.
 VisualVector (const std::string &t, double x, double y, double z)
 Constructor.
 VisualVector (const GVector &v)
 Constructor.
 VisualVector (const std::string &t, const GVector &v)
 Constructor.
 VisualVector (double x, double y, double z, const Coordinates &origin)
 Constructor.
 VisualVector (const std::string &t, double x, double y, double z, const Coordinates &origin)
 Constructor.
 VisualVector (const GVector &v, const Coordinates &origin)
 Constructor.
 VisualVector (const std::string &t, const GVector &v, const Coordinates &origin)
 Constructor.
virtual ~VisualVector ()
 Destructor.
 VisualVector (const VisualVector &vv)
 Copy constructor.
void set_scale (double s)
 Set the scale.
void set_origin (const Coordinates &c)
 Set the origin (tail) of the vector.
void set_arrow_length (double len)
 Set the length of the arrow.
void set_arrow_angle (double ang, Angle_Type at=ANG_RAD)
 Set the angle of the arrow.
void set_rotation (const Rotation &rot)
 Set the rotation of the vector.
void set_tag (const std::string &t)
 Set the tag of the VisualVector.
void set_color (const Color &c)
 Set the color of the segment used to draw the vector.
double get_scale () const
 Get the scale used to draw the vector.
Coordinates get_origin () const
 Get the start point of the segment used to draw the vector.
Coordinates get_end () const
 Get the end point of the segment used to draw the vector.
double get_arrow_length () const
 Get length of the arrow.
double get_arrow_angle (Angle_Type at=ANG_RAD) const
 Get the angle of the arrow.
Rotation get_rotation () const
 Get the rotation used to draw the vector.
std::string get_tag () const
 Get the tag of the VisualVector.
Color get_color () const
 Get the color of the segment used to draw the vector.
void draw (Drawer &d)
 Draw the VisualVector.
const VisualVectoroperator= (const VisualVector &v)
 Assignment operator for VisualVectors.
const VisualVectoroperator= (const GVector &gv)
 Assignment operator for GVectors.

Protected Member Functions

void transform_vector_2d ()
 Transform the vector to a 2D plane.

Private Member Functions

void init_matrices ()
 Initialize the matrices.

Private Attributes

Rotation rotation
 Rotation of the VisualVector.
Segment segment
 The segment used to draw the vector.
double scale
 The scale.
double arrow_length
 The length of the arrow.
double arrow_angle
 The angle of the arrow Segments.
std::string tag
 A std::string holding the optional tag of the vector.
Matrix4x4 m_rot_x
 Rotation matrix in x direction.
Matrix4x4 m_rot_y
 Rotation matrix in y direction.
Matrix4x4 m_rot_z
 Rotation matrix in z direction.
Matrix4x4 m_rot_ix
 Inverse rotation matrix in x direction.
Matrix4x4 m_rot_iy
 Inverse rotation matrix in y direction.
Matrix4x4 m_rot_iz
 Inverse rotation matrix in z direction.
Matrix4x4 m_scale
 The scale matrix.
Matrix4x4 m_otrans
 The object translation matrix.
Matrix4x4 m_iotrans
 The inverse object translation matrix.

Detailed Description

This class is intended to visualize a GVector. The 'how' is left to the Drawer class.

All lengths used in this class are to be interpreted by the Drawer class. It is made no assumption about the unit of the lengths.


Constructor & Destructor Documentation

VisualVector::VisualVector (  ) 

Constructor. Initializes the VisualVector as zero vector.

VisualVector::VisualVector ( double  x,
double  y,
double  z 
)

Constructor.

Parameters:
x The value of the x component.
y The value of the y component.
z The value of the z component.

VisualVector::VisualVector ( const std::string &  t,
double  x,
double  y,
double  z 
)

Constructor.

Parameters:
t String holding the tag of the VisualVector.
x The value of the x component.
y The value of the y component.
z The value of the z component.

VisualVector::VisualVector ( const GVector v  ) 

Constructor.

Parameters:
v A const reference to a GVector used to initialize the components.

VisualVector::VisualVector ( const std::string &  t,
const GVector v 
)

Constructor.

Parameters:
t String holding the tag of the VisualVector.
v A const reference to a GVector used to initialize the components.

VisualVector::VisualVector ( double  x,
double  y,
double  z,
const Coordinates origin 
)

Constructor.

Parameters:
x The value of the x component.
y The value of the y component.
z The value of the z component.
origin The origin in the 2D plane.

VisualVector::VisualVector ( const std::string &  t,
double  x,
double  y,
double  z,
const Coordinates origin 
)

Constructor.

Parameters:
t String holding the tag of the VisualVector.
x The value of the x component.
y The value of the y component.
z The value of the z component.
origin The origin in the 2D plane.

VisualVector::VisualVector ( const GVector v,
const Coordinates origin 
)

Constructor.

Parameters:
v A const reference to a GVector used to initialize the components.
origin The origin in the 2D plane.

VisualVector::VisualVector ( const std::string &  t,
const GVector v,
const Coordinates origin 
)

Constructor.

Parameters:
t String holding the tag of the VisualVector.
v A const reference to a GVector used to initialize the components.
origin The origin in the 2D plane.

VisualVector::~VisualVector (  )  [virtual]

Destructor. Does nothing. Just for completeness.

VisualVector::VisualVector ( const VisualVector vv  ) 

Copy constructor.

Parameters:
vv A const reference to a VisualVector object.


Member Function Documentation

void VisualVector::init_matrices (  )  [private]

Initializes all matrices.

void VisualVector::transform_vector_2d (  )  [protected]

Projects the VisualVector to two dimensions and fills start and end point of the segment used to draw the vector later on.

void VisualVector::set_scale ( double  s  ) 

Sets the scale of the VisualVector used when projecting on a 2D plane.

Parameters:
s The scale to set.

void VisualVector::set_origin ( const Coordinates c  ) 

Sets the origin of the VisualVector used when projecting on a 2D plane.

Parameters:
c A const reference to the Coordinates specifying the origin.

void GVectors::VisualVector::set_arrow_length ( double  len  )  [inline]

Set the length of the arrow.

Parameters:
len The length of the arrow.

void VisualVector::set_arrow_angle ( double  ang,
Angle_Type  at = ANG_RAD 
)

Sets the angle of the arrow.

Parameters:
ang The angle.
at The units of the angle used.

void VisualVector::set_rotation ( const Rotation rot  ) 

Sets the rotation.

Parameters:
rot A const reference to a Rotation object.

void GVectors::VisualVector::set_tag ( const std::string &  t  )  [inline]

Sets the tag of the VisualVector. The use of the tag is left to the user of the VisualVector class.

Parameters:
t A const reference to a std::string holding the tag.

void GVectors::VisualVector::set_color ( const Color c  )  [inline]

Sets the color of the segment used to draw the flag. This is passed to the segment representing the vector.

Parameters:
c A const reference to a Color object.

double GVectors::VisualVector::get_scale (  )  const [inline]

Gets the scale used to draw the vector.

Returns:
The scale used to draw the vector.

Coordinates GVectors::VisualVector::get_origin (  )  const [inline]

Gets the start point of the segment used to draw the vector.

Returns:
A Coordinates object representing the start point.

Coordinates GVectors::VisualVector::get_end (  )  const [inline]

Gets the end point of the segment used to draw the vector.

Returns:
A Coordinates object representing the end point.

double GVectors::VisualVector::get_arrow_length (  )  const [inline]

Gets the length of the arrow.

Returns:
The length of the arrow.

double VisualVector::get_arrow_angle ( Angle_Type  at = ANG_RAD  )  const

Gets the angle used to draw the arrow.

Parameters:
at The units of measurement used for getting the angle.
Returns:
The angle in units specified with at.

Rotation GVectors::VisualVector::get_rotation (  )  const [inline]

Gets the rotation used to draw the vector.

Returns:
A Rotation object representing the rotation.

std::string GVectors::VisualVector::get_tag (  )  const [inline]

Gets the tag of the VisualVector.

Returns:
A std::string holding the tag.

Color GVectors::VisualVector::get_color (  )  const [inline]

Gets the color of the segment used to draw the vector.

Returns:
A Color object representing the RGB color.

void VisualVector::draw ( Drawer d  ) 

Draws the VisualVector using the Drawer specified.

Parameters:
d A reference to the Drawer object used to draw the vector.

const VisualVector & VisualVector::operator= ( const VisualVector v  ) 

Assignment operator for assigning another VisualVector to this.

Parameters:
v A const reference to a VisualVector object.
Returns:
A const reference to this having the VisualVector assigned.

const VisualVector & VisualVector::operator= ( const GVector gv  ) 

Assignment operator for assigning a GVector to this.

Parameters:
gv A const reference to a GVector object.
Returns:
A const reference to this having the GVector assigned.

Reimplemented from GVectors::GVector.


Member Data Documentation

Rotation GVectors::VisualVector::rotation [private]

The rotation of the VisualVector.

Segment GVectors::VisualVector::segment [private]

The segment used to draw the vector.

double GVectors::VisualVector::scale [private]

The scale value is filled into the m_scale matrix.

double GVectors::VisualVector::arrow_length [private]

The length of the Segment used to draw the head arrow.

double GVectors::VisualVector::arrow_angle [private]

The angle of the arrow Segments in relation to the Segment used to draw the vector itself.

std::string GVectors::VisualVector::tag [private]

A std::string holding the optional tag of the vector. The use of the tag is left to the user of the class. The VisualVector class makes no explicit use of the tag.

Matrix4x4 GVectors::VisualVector::m_rot_x [private]

Rotation matrix in x direction.

Matrix4x4 GVectors::VisualVector::m_rot_y [private]

Rotation matrix in y direction.

Matrix4x4 GVectors::VisualVector::m_rot_z [private]

Rotation matrix in z direction.

Matrix4x4 GVectors::VisualVector::m_rot_ix [private]

Inverse rotation matrix in x direction.

Matrix4x4 GVectors::VisualVector::m_rot_iy [private]

Inverse rotation matrix in y direction.

Matrix4x4 GVectors::VisualVector::m_rot_iz [private]

Inverse rotation matrix in z direction.

Matrix4x4 GVectors::VisualVector::m_scale [private]

The scale matrix. Depends on the scale value.

Matrix4x4 GVectors::VisualVector::m_otrans [private]

The object translation matrix.

Matrix4x4 GVectors::VisualVector::m_iotrans [private]

The inverse object translation matrix.


The documentation for this class was generated from the following files:
Generated on Sat Sep 8 19:37:30 2007 for libgvectors by  doxygen 1.4.7