Fawkes API  Fawkes Development Version
fawkes::HomCoord Class Reference

Base class for homogeneous primitives (vector and point). More...

#include <geometry/hom_coord.h>

Inheritance diagram for fawkes::HomCoord:

List of all members.

Public Member Functions

 HomCoord (const HomCoord &c)
 Copy constructor.
virtual ~HomCoord ()
 Destructor.
virtual float x () const
 RO-getter for x.
virtual float & x ()
 RW-getter for x.
virtual HomCoordx (float x)
 Setter function for x.
virtual float y () const
 RO-getter for y.
virtual float & y ()
 RW-getter for y.
virtual HomCoordy (float y)
 Setter function for y.
virtual float z () const
 RO-getter for z.
virtual float & z ()
 RW-getter for z.
virtual HomCoordz (float z)
 Setter function for z.
virtual float w () const
 RO-getter for w.
virtual float & w ()
 RW-getter for w.
virtual HomCoordw (float w)
 Setter function for w.
virtual HomCoordrotate_x (float rad)
 Convenience function to rotate the HomCoord around the x-axis.
virtual HomCoordrotate_y (float rad)
 Convenience function to rotate the HomCoord around the y-axis.
virtual HomCoordrotate_z (float rad)
 Convenience function to rotate the HomCoord around the z-axis.
HomCoordtransform (const HomTransform &t)
 Transform the vector with the given transform.
virtual HomCoord operator- (const HomCoord &h) const
 Subtraction operator.
virtual HomCoordoperator-= (const HomCoord &h)
 Substraction-assignment operator.
virtual HomCoord operator+ (const HomCoord &h) const
 Addition operator.
virtual HomCoordoperator+= (const HomCoord &h)
 Addition-assignment operator.
virtual float operator* (const HomCoord &h) const
 Calculates the dot product of two coords.
virtual HomCoord operator* (const float s) const
 Mulitplication operator.
virtual HomCoordoperator*= (const float s)
 Multiplication-assignment operator.
virtual HomCoordoperator= (const HomCoord &h)
 Assignment operator.
virtual bool operator== (const HomCoord &h) const
 Comparison operator.
virtual bool operator!= (const HomCoord &h) const
 Inequality operator.

Protected Member Functions

 HomCoord (float x=0.0, float y=0.0, float z=0.0, float w=0.0)
 Constructor.
 HomCoord (const Vector &v)
 Constructor.
virtual std::ostreamprint (std::ostream &stream) const
 Appends the components of the HomCoord to the ostream.

Protected Attributes

Vectorm_vector
 The internal data container.

Detailed Description

Base class for homogeneous primitives (vector and point).

Author:
Daniel Beck

Constructor & Destructor Documentation

fawkes::HomCoord::HomCoord ( const HomCoord c)

Copy constructor.

Parameters:
canother HomCoord

Definition at line 61 of file hom_coord.cpp.

References m_vector.

fawkes::HomCoord::~HomCoord ( ) [virtual]

Destructor.

Definition at line 76 of file hom_coord.cpp.

References m_vector.

fawkes::HomCoord::HomCoord ( float  x = 0.0,
float  y = 0.0,
float  z = 0.0,
float  w = 0.0 
) [protected]

Constructor.

Parameters:
xthe x-coordinate
ythe y-coordinate
zthe z-coordinate
wthe w-coordinate

Definition at line 48 of file hom_coord.cpp.

References m_vector, and fawkes::Vector::set().

fawkes::HomCoord::HomCoord ( const Vector v) [protected]

Constructor.

Parameters:
va vector

Definition at line 70 of file hom_coord.cpp.

References m_vector.


Member Function Documentation

bool fawkes::HomCoord::operator!= ( const HomCoord h) const [virtual]

Inequality operator.

Parameters:
hthe other HomCoord
Returns:
true if h is not equal to *this, false otherwise

Definition at line 367 of file hom_coord.cpp.

References m_vector.

float fawkes::HomCoord::operator* ( const HomCoord h) const [virtual]

Calculates the dot product of two coords.

Parameters:
hthe rhs HomCoord
Returns:
the scalar product

Definition at line 315 of file hom_coord.cpp.

References x(), y(), and z().

HomCoord fawkes::HomCoord::operator* ( const float  s) const [virtual]

Mulitplication operator.

Multiply the vector with a scalar.

Parameters:
sa scalar
Returns:
the result of multiplying the vector with the scalar

Definition at line 326 of file hom_coord.cpp.

References x(), y(), z(), and w().

HomCoord & fawkes::HomCoord::operator*= ( const float  s) [virtual]

Multiplication-assignment operator.

Multiply the vector with a scalar.

Parameters:
sa scalar
Returns:
a reference to the modified vector (this)

Definition at line 343 of file hom_coord.cpp.

References x(), y(), and z().

HomCoord fawkes::HomCoord::operator+ ( const HomCoord h) const [virtual]

Addition operator.

Parameters:
hthe rhs HomCoord
Returns:
the resulting HomCoord

Definition at line 275 of file hom_coord.cpp.

References m_vector, and w().

HomCoord & fawkes::HomCoord::operator+= ( const HomCoord h) [virtual]

Addition-assignment operator.

Parameters:
hthe rhs HomCoord
Returns:
reference to the resulting HomCoord

Definition at line 289 of file hom_coord.cpp.

References m_vector, and w().

HomCoord fawkes::HomCoord::operator- ( const HomCoord h) const [virtual]

Subtraction operator.

Parameters:
hthe rhs HomCoord
Returns:
the resulting HomCoord

Definition at line 248 of file hom_coord.cpp.

References m_vector, and w().

HomCoord & fawkes::HomCoord::operator-= ( const HomCoord h) [virtual]

Substraction-assignment operator.

Parameters:
hthe rhs HomCoord
Returns:
reference to the resulting HomCoord

Definition at line 262 of file hom_coord.cpp.

References m_vector, and w().

HomCoord & fawkes::HomCoord::operator= ( const HomCoord h) [virtual]

Assignment operator.

Parameters:
hthe rhs HomCoord
Returns:
a reference of the lhs vector (this)

Definition at line 303 of file hom_coord.cpp.

References m_vector.

bool fawkes::HomCoord::operator== ( const HomCoord h) const [virtual]

Comparison operator.

Parameters:
hthe other HomCoord
Returns:
true if h is equal to *this, false otherwise

Definition at line 357 of file hom_coord.cpp.

References m_vector.

std::ostream & fawkes::HomCoord::print ( std::ostream stream) const [protected, virtual]

Appends the components of the HomCoord to the ostream.

Parameters:
streamto be extended
Returns:
the extended stream

Implements fawkes::Printable.

Definition at line 377 of file hom_coord.cpp.

References x(), y(), z(), and w().

HomCoord & fawkes::HomCoord::rotate_x ( float  rad) [virtual]

Convenience function to rotate the HomCoord around the x-axis.

Parameters:
radthe roation angle in rad
Returns:
reference to this

Reimplemented in fawkes::HomPose, and fawkes::HomPolar.

Definition at line 206 of file hom_coord.cpp.

References fawkes::HomTransform::rotate_x(), and transform().

HomCoord & fawkes::HomCoord::rotate_y ( float  rad) [virtual]

Convenience function to rotate the HomCoord around the y-axis.

Parameters:
radthe roation angle in rad
Returns:
reference to this

Reimplemented in fawkes::HomPose, and fawkes::HomPolar.

Definition at line 220 of file hom_coord.cpp.

References fawkes::HomTransform::rotate_y(), and transform().

HomCoord & fawkes::HomCoord::rotate_z ( float  rad) [virtual]

Convenience function to rotate the HomCoord around the z-axis.

Parameters:
radthe roation angle in rad
Returns:
reference to this

Reimplemented in fawkes::HomPose, and fawkes::HomPolar.

Definition at line 234 of file hom_coord.cpp.

References fawkes::HomTransform::rotate_z(), and transform().

Referenced by fawkes::HomPose2d::HomPose2d(), fawkes::HomPose2d::yaw(), and WorldModelThread::loop().

HomCoord & fawkes::HomCoord::transform ( const HomTransform t)

Transform the vector with the given transform.

Parameters:
ta transform
Returns:
reference to the modified vector (this)

Definition at line 387 of file hom_coord.cpp.

References fawkes::HomTransform::get_matrix().

Referenced by rotate_x(), rotate_y(), rotate_z(), and fawkes::Transformable::transform().

float fawkes::HomCoord::w ( ) const [virtual]

RO-getter for w.

Returns:
the value

Definition at line 175 of file hom_coord.cpp.

References m_vector, and fawkes::Vector::get().

Referenced by operator-(), operator-=(), operator+(), operator+=(), operator*(), print(), fawkes::HomPoint::HomPoint(), and fawkes::HomVector::HomVector().

float & fawkes::HomCoord::w ( ) [virtual]

RW-getter for w.

Returns:
a reference to the w-element

Definition at line 184 of file hom_coord.cpp.

References m_vector, and fawkes::Vector::get().

HomCoord & fawkes::HomCoord::w ( float  w) [virtual]

Setter function for w.

Parameters:
wthe new w value
Returns:
reference to this

Definition at line 195 of file hom_coord.cpp.

References m_vector, and fawkes::Vector::set().

float & fawkes::HomCoord::x ( ) [virtual]

RW-getter for x.

Returns:
a reference to the x-element

Definition at line 94 of file hom_coord.cpp.

References m_vector, and fawkes::Vector::get().

HomCoord & fawkes::HomCoord::x ( float  x) [virtual]

Setter function for x.

Parameters:
xthe new x value
Returns:
reference to this

Definition at line 105 of file hom_coord.cpp.

References m_vector, and fawkes::Vector::set().

float & fawkes::HomCoord::y ( ) [virtual]

RW-getter for y.

Returns:
a reference to the y-element

Definition at line 124 of file hom_coord.cpp.

References m_vector, and fawkes::Vector::get().

HomCoord & fawkes::HomCoord::y ( float  y) [virtual]

Setter function for y.

Parameters:
ythe new y value
Returns:
reference to this

Definition at line 135 of file hom_coord.cpp.

References m_vector, and fawkes::Vector::set().

float & fawkes::HomCoord::z ( ) [virtual]

RW-getter for z.

Returns:
a reference to the z-element

Definition at line 154 of file hom_coord.cpp.

References m_vector, and fawkes::Vector::get().

HomCoord & fawkes::HomCoord::z ( float  z) [virtual]

Setter function for z.

Parameters:
zthe new z value
Returns:
reference to this

Definition at line 165 of file hom_coord.cpp.

References m_vector, and fawkes::Vector::set().


Member Data Documentation

The internal data container.

Definition at line 85 of file hom_coord.h.

Referenced by HomCoord(), ~HomCoord(), x(), y(), z(), w(), operator-(), operator-=(), operator+(), operator+=(), operator=(), operator==(), and operator!=().


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