IMP logo

IMP::algebra::Transformation3D Class Reference


Detailed Description

Simple 3D transformation class.

See also:
IMP::core::Transform
Note:
This class is a geometric primitive. Also, this class is not not initialized by its default constructor.

Public Member Functions

Transformation3D get_inverse () const
const Rotation3Dget_rotation () const
VectorD< 3 > get_transformed (const VectorD< 3 > &o) const
 transform
const VectorD< 3 > & get_translation () const
Transformation3D operator* (const Transformation3D &tr) const
VectorD< 3 > operator* (const VectorD< 3 > &v) const
 apply transformation (rotate and then translate)
const Transformation3Doperator*= (const Transformation3D &o)
Transformation3D operator/ (const Transformation3D &b) const
const Transformation3Doperator/= (const Transformation3D &o)
 Transformation3D (const VectorD< 3 > &t)
 Transformation3D (const Rotation3D &r, const VectorD< 3 > &t=VectorD< 3 >(0, 0, 0))
 Transformation3D ()
 construct an invalid transformation

Related Functions

(Note that these are not member functions.)

Transformation3D compose (const Transformation3D &a, const Transformation3D &b)
 compose two transformations
Transformation3D get_identity_transformation_3d ()
 Return a transformation that does not do anything.
Transformation3D get_rotation_about_point (const VectorD< 3 > &point, const Rotation3D &rotation)
 Generate a Transformation3D object from a rotation around a point.
template<class Vector3DsOrXYZs0 , class Vector3DsOrXYZs1 >
IMP::algebra::Transformation3D get_transformation_aligning_first_to_second (const Vector3DsOrXYZs0 &from, const Vector3DsOrXYZs1 &to)
 Compute the rigid transform bringing the first point set to the second.
Transformation3D get_transformation_from_reference_frame (const VectorD< 3 > &u, const VectorD< 3 > &w, const VectorD< 3 > &base)
 A rotation from the natural reference frame to one defined by u,w and base. The x-axis lies on u-base. The y-axis is perpendicular to both x and z. The z-axis is perpendicular to the u-base , w-base plane.

Constructor & Destructor Documentation

IMP::algebra::Transformation3D::Transformation3D ( const Rotation3D r,
const VectorD< 3 > &  t = VectorD<3>(0,0,0) 
)

basic constructor

IMP::algebra::Transformation3D::Transformation3D ( const VectorD< 3 > &  t  ) 

Construct a transformation with an identity rotation.


Member Function Documentation

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

compose two rigid transformation such that for any vector v (rt1*rt2)*v = rt1*(rt2*v)

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

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

For consistency, this should probably have a nice name, but I don't know what name to give it.


Friends And Related Function Documentation

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

compose two transformations

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

Transformation3D get_identity_transformation_3d (  )  [related]

Return a transformation that does not do anything.

Transformation3D get_rotation_about_point ( const VectorD< 3 > &  point,
const Rotation3D rotation 
) [related]

Generate a Transformation3D object from a rotation around a point.

Rotate about a point rather than the origin.

Parameters:
[in] point Center to rotate about
[in] rotation The rotation to perform

template<class Vector3DsOrXYZs0 , class Vector3DsOrXYZs1 >
IMP::algebra::Transformation3D get_transformation_aligning_first_to_second ( const Vector3DsOrXYZs0 &  from,
const Vector3DsOrXYZs1 &  to 
) [related]

Compute the rigid transform bringing the first point set to the second.

The points are assumed to be corresponding (that is, from[0] is aligned to to[0] etc.). The alignment computed is that which minimized the sum of squared distances between corresponding points. Return the

\[ \operatornamewithlimits{argmin}_T \sum \left|T\left(f\left[i\right]\right)-t[i]\right|^2 \]

If the point sets lie in a 1 or 2 dimensional subspace, the alignment algorithm is unstable and not guaranteed to work. A warning is printed in this case.

See also:
VectorD<3>

Transformation3D get_transformation_from_reference_frame ( const VectorD< 3 > &  u,
const VectorD< 3 > &  w,
const VectorD< 3 > &  base 
) [related]

A rotation from the natural reference frame to one defined by u,w and base. The x-axis lies on u-base. The y-axis is perpendicular to both x and z. The z-axis is perpendicular to the u-base , w-base plane.

Generate a transformation from the natural reference-frame to a different one

Parameters:
[in] u vector used to define the new reference frame
[in] w vector used to define the new reference frame
[in] base the center of the new reference frame
Note:
This function is poorly designed and liable the change. The main problem comes from having the three arguments of the same type with no natural order amongst them.


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