IMP logo

IMP::algebra::Transformation2D Class Reference


Detailed Description

Simple 2D transformation class.

Note:
This class is a geometric primitive. Also, this class is not not initialized by its default constructor.

Public Member Functions

Transformation2D get_inverse () const
 Returns the inverse transformation.
const Rotation2D get_rotation () const
 Returns the rotation.
VectorD< 2 > get_transformed (const VectorD< 2 > &o) const
 Perform the transformation on an 2D vector.
const VectorD< 2 > get_translation () const
 Returns the translation.
Transformation2D operator* (const Transformation2D &tr) const
 compose two transformations
VectorD< 2 > operator* (const VectorD< 2 > &v) const
 Perform the transformation on an 2D vector.
const Transformation2Doperator*= (const Transformation2D &o)
 See help for operator*.
Transformation2D operator/ (const Transformation2D &b) const
const Transformation2Doperator/= (const Transformation2D &o)
 See help for operator/.
void set_rotation (double angle)
template<typename T1 >
void set_translation (T1 &v)
 Sets the translation.
void show (std::ostream &out=std::cout) const
 Prints the transformation.
 Transformation2D (const VectorD< 2 > &t)
 Constructor for a transformation with an identity rotation.
 Transformation2D (const Rotation2D &r, const VectorD< 2 > &t=VectorD< 2 >(0.0, 0.0))
 basic constructor from a Rotation2D and translation vector
 Transformation2D ()
 public for swig

Related Functions

(Note that these are not member functions.)

Transformation2D compose (const Transformation2D &a, const Transformation2D &b)
 compose two transformations
Transformation2D get_identity_transformation_2d ()
 Returns a transformation that does not do anything.
Transformation2D get_rotation_about_point (const VectorD< 2 > &point, const Rotation2D &rotation)
 Generates a Transformation2D object from a rotation around a point.

Constructor & Destructor Documentation

IMP::algebra::Transformation2D::Transformation2D (  ) 

public for swig

constructor. An invalid transformation is built


Member Function Documentation

VectorD<2> IMP::algebra::Transformation2D::get_transformed ( const VectorD< 2 > &  o  )  const

Perform the transformation on an 2D vector.

Parameters:
[in] o vector where the transformation is applied
Note:
: The transformation is done firstly applying the rotation and then the translation

Transformation2D IMP::algebra::Transformation2D::operator* ( const Transformation2D tr  )  const

compose two transformations

\ note The transformations are composed such that for any vector v (rt1*rt2)*v = rt1*(rt2*v)

VectorD<2> IMP::algebra::Transformation2D::operator* ( const VectorD< 2 > &  v  )  const

Perform the transformation on an 2D vector.

Note:
: The transformation is done firstly applying the rotation and then the translation

Transformation2D IMP::algebra::Transformation2D::operator/ ( const Transformation2D b  )  const

Compute the transformation d which, when composed with b, gives this one. That is a(x)== d(b(x)) for all x.


Friends And Related Function Documentation

Transformation2D compose ( const Transformation2D a,
const Transformation2D b 
) [related]

compose two transformations

For any vector v (a*b)*v = a*(b*v).

Transformation2D get_rotation_about_point ( const VectorD< 2 > &  point,
const Rotation2D rotation 
) [related]

Generates a Transformation2D object from a rotation around a point.

Generates a Transformation2D to rotate about a point rather than the origin.

Parameters:
[in] point Center to rotate about
[in] rotation The rotation to perform (defined taking the origin as reference, not the new point).


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

Generated on Mon Mar 8 23:08:47 2010 for IMP by doxygen 1.5.8