Fawkes API
Fawkes Development Version
|
Base class for homogeneous primitives (vector and point). More...
#include <geometry/hom_coord.h>
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 HomCoord & | x (float x) |
Setter function for x. | |
virtual float | y () const |
RO-getter for y. | |
virtual float & | y () |
RW-getter for y. | |
virtual HomCoord & | y (float y) |
Setter function for y. | |
virtual float | z () const |
RO-getter for z. | |
virtual float & | z () |
RW-getter for z. | |
virtual HomCoord & | z (float z) |
Setter function for z. | |
virtual float | w () const |
RO-getter for w. | |
virtual float & | w () |
RW-getter for w. | |
virtual HomCoord & | w (float w) |
Setter function for w. | |
virtual HomCoord & | rotate_x (float rad) |
Convenience function to rotate the HomCoord around the x-axis. | |
virtual HomCoord & | rotate_y (float rad) |
Convenience function to rotate the HomCoord around the y-axis. | |
virtual HomCoord & | rotate_z (float rad) |
Convenience function to rotate the HomCoord around the z-axis. | |
HomCoord & | transform (const HomTransform &t) |
Transform the vector with the given transform. | |
virtual HomCoord | operator- (const HomCoord &h) const |
Subtraction operator. | |
virtual HomCoord & | operator-= (const HomCoord &h) |
Substraction-assignment operator. | |
virtual HomCoord | operator+ (const HomCoord &h) const |
Addition operator. | |
virtual HomCoord & | operator+= (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 HomCoord & | operator*= (const float s) |
Multiplication-assignment operator. | |
virtual HomCoord & | operator= (const HomCoord &h) |
Assignment operator. | |
virtual bool | operator== (const HomCoord &h) const |
Comparison operator. | |
virtual bool | operator!= (const HomCoord &h) const |
Inequality operator. | |
![]() | |
Printable () | |
Constructor. | |
virtual | ~Printable () |
Destructor. |
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::ostream & | print (std::ostream &stream) const |
Appends the components of the HomCoord to the ostream. |
Protected Attributes | |
Vector * | m_vector |
The internal data container. |
Base class for homogeneous primitives (vector and point).
Definition at line 34 of file hom_coord.h.
fawkes::HomCoord::HomCoord | ( | const HomCoord & | c | ) |
Copy constructor.
c | another HomCoord |
Definition at line 61 of file hom_coord.cpp.
References m_vector.
|
virtual |
|
protected |
Constructor.
x | the x-coordinate |
y | the y-coordinate |
z | the z-coordinate |
w | the w-coordinate |
Definition at line 48 of file hom_coord.cpp.
References m_vector, and fawkes::Vector::set().
|
protected |
Constructor.
v | a vector |
Definition at line 70 of file hom_coord.cpp.
References m_vector.
|
virtual |
Inequality operator.
h | the other HomCoord |
Definition at line 367 of file hom_coord.cpp.
References m_vector.
|
virtual |
|
virtual |
|
virtual |
Multiplication-assignment operator.
Multiply the vector with a scalar.
s | a scalar |
Definition at line 343 of file hom_coord.cpp.
Assignment operator.
h | the rhs HomCoord |
Definition at line 303 of file hom_coord.cpp.
References m_vector.
|
virtual |
Comparison operator.
h | the other HomCoord |
Definition at line 357 of file hom_coord.cpp.
References m_vector.
|
protectedvirtual |
Appends the components of the HomCoord to the ostream.
stream | to be extended |
Implements fawkes::Printable.
Definition at line 377 of file hom_coord.cpp.
|
virtual |
Convenience function to rotate the HomCoord around the x-axis.
rad | the roation angle in rad |
Reimplemented in fawkes::HomPose, and fawkes::HomPolar.
Definition at line 206 of file hom_coord.cpp.
References fawkes::HomTransform::rotate_x(), and transform().
|
virtual |
Convenience function to rotate the HomCoord around the y-axis.
rad | the roation angle in rad |
Reimplemented in fawkes::HomPose, and fawkes::HomPolar.
Definition at line 220 of file hom_coord.cpp.
References fawkes::HomTransform::rotate_y(), and transform().
|
virtual |
Convenience function to rotate the HomCoord around the z-axis.
rad | the roation angle in rad |
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(), WorldModelThread::loop(), and fawkes::HomPose2d::yaw().
HomCoord & fawkes::HomCoord::transform | ( | const HomTransform & | t | ) |
Transform the vector with the given transform.
t | a transform |
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().
|
virtual |
RO-getter for w.
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().
|
virtual |
RW-getter for w.
Definition at line 184 of file hom_coord.cpp.
References fawkes::Vector::get(), and m_vector.
|
virtual |
Setter function for w.
w | the new w value |
Definition at line 195 of file hom_coord.cpp.
References m_vector, and fawkes::Vector::set().
|
virtual |
RO-getter for x.
Definition at line 85 of file hom_coord.cpp.
References fawkes::Vector::get(), and m_vector.
Referenced by fawkes::HomVector::angle_xy(), fawkes::HomPoint::distance(), fawkes::LineSegmentDrawer::draw(), fawkes::HomPointDrawer::draw(), fawkes::HomVectorDrawer::draw(), fawkes::HomPolar::get_vector(), fawkes::HomPolar::HomPolar(), fawkes::HomPose2d::HomPose2d(), fawkes::HomVector::length_square(), fawkes::Line::Line(), WorldModelThread::loop(), fawkes::HomPoint::move(), fawkes::HomPoint::move_to(), FieldView::on_draw(), operator*(), operator*=(), fawkes::HomPolar::operator+(), fawkes::HomPoint::operator-(), fawkes::HomPolar::operator-(), fawkes::HomPolar::phi(), fawkes::HomPolar::phi_y(), fawkes::HomPolar::phi_z(), fawkes::HomPose::pos(), fawkes::HomPose2d::post_transform(), print(), fawkes::HomPolar::r(), fawkes::HomPolar::rotate_x(), fawkes::HomPolar::rotate_y(), fawkes::HomVector::set_length(), and fawkes::HomPose2d::x().
|
virtual |
RW-getter for x.
Definition at line 94 of file hom_coord.cpp.
References fawkes::Vector::get(), and m_vector.
|
virtual |
Setter function for x.
x | the new x value |
Definition at line 105 of file hom_coord.cpp.
References m_vector, and fawkes::Vector::set().
|
virtual |
RO-getter for y.
Definition at line 115 of file hom_coord.cpp.
References fawkes::Vector::get(), and m_vector.
Referenced by fawkes::HomVector::angle_xy(), fawkes::HomPoint::distance(), fawkes::LineSegmentDrawer::draw(), fawkes::HomPointDrawer::draw(), fawkes::HomVectorDrawer::draw(), fawkes::HomPolar::get_vector(), fawkes::HomPolar::HomPolar(), fawkes::HomPose2d::HomPose2d(), fawkes::HomVector::length_square(), fawkes::Line::Line(), WorldModelThread::loop(), fawkes::HomPoint::move(), fawkes::HomPoint::move_to(), FieldView::on_draw(), operator*(), operator*=(), fawkes::HomPolar::operator+(), fawkes::HomPoint::operator-(), fawkes::HomPolar::operator-(), fawkes::HomPolar::phi(), fawkes::HomPolar::phi_y(), fawkes::HomPolar::phi_z(), fawkes::HomPose::pos(), fawkes::HomPose2d::post_transform(), print(), fawkes::HomPolar::r(), fawkes::HomPolar::rotate_x(), fawkes::HomPolar::rotate_y(), fawkes::HomVector::set_length(), and fawkes::HomPose2d::y().
|
virtual |
RW-getter for y.
Definition at line 124 of file hom_coord.cpp.
References fawkes::Vector::get(), and m_vector.
|
virtual |
Setter function for y.
y | the new y value |
Definition at line 135 of file hom_coord.cpp.
References m_vector, and fawkes::Vector::set().
|
virtual |
RO-getter for z.
Definition at line 145 of file hom_coord.cpp.
References fawkes::Vector::get(), and m_vector.
Referenced by fawkes::HomPoint::distance(), fawkes::HomPolar::get_vector(), fawkes::HomPolar::HomPolar(), fawkes::HomVector::length_square(), fawkes::Line::Line(), fawkes::HomPoint::move(), fawkes::HomPoint::move_to(), operator*(), operator*=(), fawkes::HomPolar::operator+(), fawkes::HomPoint::operator-(), fawkes::HomPolar::operator-(), fawkes::HomPolar::phi(), fawkes::HomPolar::phi_y(), fawkes::HomPolar::phi_z(), fawkes::HomPose::pos(), print(), fawkes::HomPolar::r(), fawkes::HomPolar::rotate_x(), fawkes::HomPolar::rotate_y(), and fawkes::HomVector::set_length().
|
virtual |
RW-getter for z.
Definition at line 154 of file hom_coord.cpp.
References fawkes::Vector::get(), and m_vector.
|
virtual |
Setter function for z.
z | the new z value |
Definition at line 165 of file hom_coord.cpp.
References m_vector, and fawkes::Vector::set().
|
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().