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:

Public Member Functions

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

Protected Member Functions

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

Protected Attributes

Vectorm_vector
 The internal data container. More...
 

Detailed Description

Base class for homogeneous primitives (vector and point).

Author
Daniel Beck

Definition at line 34 of file hom_coord.h.

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 w(), x(), y(), and z().

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.

Referenced by fawkes::HomPolar::operator=().

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
protectedvirtual

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 w(), x(), y(), and z().

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().

Referenced by fawkes::HomPolar::rotate_x(), and fawkes::HomPose::rotate_x().

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().

Referenced by fawkes::HomPolar::HomPolar(), fawkes::HomPolar::rotate_y(), and fawkes::HomPose::rotate_y().

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::HomPolar::HomPolar(), fawkes::HomPose2d::HomPose2d(), WorldModelThread::loop(), fawkes::HomPolar::rotate_z(), fawkes::HomPose::rotate_z(), and fawkes::HomPose2d::yaw().

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 fawkes::Vector::get(), and m_vector.

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

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 fawkes::Vector::get(), and m_vector.

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 fawkes::Vector::get(), and m_vector.

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 fawkes::Vector::get(), and m_vector.

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 fawkes::Vector::get(), and m_vector.

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

fawkes::HomCoord::m_vector
protected

The internal data container.

Definition at line 85 of file hom_coord.h.

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


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