#include <SolidTypes.h>

Public Member Functions | |
| Transform () | |
| The default constructor does not initialize the transform. | |
| Transform (const Vec &origin, const Rot &orientation) | |
| Origin of the child in parent coordinates, orientation of the child wrt to parent. | |
| Transform (const Rot &q, const Vec &o) | |
| WARNING: using Featherstone's conventions (see class documentation). | |
| void | set (const Vec &t, const Rot &q) |
| Origin of the child in the parent coordinate system and the orientation of the child wrt the parent (i.e. standard way). | |
| void | clear () |
| Reset this to identity. | |
| Transform (const SpatialVector &v) | |
| Origin of the child in the parent coordinate system and the orientation of the child wrt the parent (i.e. standard way). | |
| Transform | inversed () const |
| The inverse transform i.e. parent wrt child. | |
| const Vec & | getOriginOfParentInChild () const |
| Parent origin in child coordinates (the way it is actually stored internally). | |
| Vec | getOrigin () const |
| Origin of child in parent coordinates. | |
| void | setOrigin (const Vec &) |
| Origin of child in parent coordinates. | |
| const Rot & | getOrientation () const |
| Orientation of the child coordinate axes wrt the parent coordinate axes. | |
| void | setOrientation (const Rot &) |
| Orientation of the child coordinate axes wrt the parent coordinate axes. | |
| Mat | getRotationMatrix () const |
| Matrix which projects vectors from child coordinates to parent coordinates. The columns of the matrix are the axes of the child base axes in the parent coordinate system. | |
| Vec | projectVector (const Vec &vectorInChild) const |
| Project a vector (i.e. a direction or a displacement) from child coordinates to parent coordinates. | |
| Vec | projectPoint (const Vec &pointInChild) const |
| Project a point from child coordinates to parent coordinates. | |
| Vec | backProjectVector (const Vec &vectorInParent) const |
| Projected a vector (i.e. a direction or a displacement) from parent coordinates to child coordinates. | |
| Vec | backProjectPoint (const Vec &pointInParent) const |
| Project point from parent coordinates to this coordinates. | |
| Transform | operator* (const Transform &f2) const |
| Combine two transforms. If (*this) locates frame B (child) wrt frame A (parent) and if f2 locates frame C (child) wrt frame B (parent) then the result locates frame C wrt to Frame A. | |
| Transform & | operator*= (const Transform &f2) |
| Combine two transforms. If (*this) locates frame B (child) wrt frame A (parent) and if f2 locates frame C (child) wrt frame B (parent) then the result locates frame C wrt to Frame A. | |
| SpatialVector | operator* (const SpatialVector &sv) const |
| Project a spatial vector from child to parent. | |
| SpatialVector | operator/ (const SpatialVector &sv) const |
| Project a spatial vector from parent to child (the inverse of operator *). This method computes (*this).inversed()*sv without inverting (*this). | |
| void | writeOpenGlMatrix (double *m) const |
| Write an OpenGL matrix encoding the transformation of the coordinate system of the child wrt the coordinate system of the parent. | |
| void | glDraw () const |
| Draw the axes of the child coordinate system in the parent coordinate system. | |
| void | printInternal (std::ostream &) const |
| Print the internal values (i.e. using Featherstone's conventions, see class documentation). | |
Time integration | |
Methods used in time integration | |
| Transform & | operator+= (const SpatialVector &a) |
| Transform & | operator+= (const Transform &a) |
| template<class Real2 > | |
| Transform & | operator*= (Real2 a) |
| template<class Real2 > | |
| Transform | operator* (Real2 a) const |
Static Public Member Functions | |
| static Transform | identity () |
| The identity transform (child = parent). | |
Protected Attributes | |
| Rot | orientation_ |
| child wrt parent | |
| Vec | origin_ |
| parent wrt child | |
Friends | |
| std::ostream & | operator<< (std::ostream &out, const Transform &t) |
| Print the origin of the child in the parent coordinate system and the quaternion defining the orientation of the child wrt the parent. | |
A frame represents a local coordinate system.
Internal data represents the orientation of the child wrt the parent, BUT the translation vector represents the origin of the parent with respect to the child. For example, the coordinates M_p of point M in parent given the coordinates M_c of the same point in child are given by: M_p = orientation * ( M_c - origin ). This is due to Featherstone's conventions. Use method setTranslationRotation( const Vec& t, const Rot& q ) to model the Transform the standard way (i.e. translation givne in the parent frame).
Definition at line 183 of file SolidTypes.h.
| sofa::defaulttype::SolidTypes< R >::Transform::Transform | ( | ) | [inline] |
The default constructor does not initialize the transform.
Definition at line 143 of file SolidTypes.inl.
References sofa::defaulttype::SolidTypes< R >::Transform::identity().
Referenced by sofa::defaulttype::SolidTypes< R >::Transform::identity(), sofa::defaulttype::SolidTypes< R >::Transform::inversed(), sofa::defaulttype::SolidTypes< R >::Transform::operator*(), and sofa::defaulttype::SolidTypes< R >::Transform::operator+=().
| sofa::defaulttype::SolidTypes< R >::Transform::Transform | ( | const Vec & | origin, | |
| const Rot & | orientation | |||
| ) | [inline] |
Origin of the child in parent coordinates, orientation of the child wrt to parent.
Define using standard conventions.
Definition at line 155 of file SolidTypes.inl.
| sofa::defaulttype::SolidTypes< R >::Transform::Transform | ( | const Rot & | q, | |
| const Vec & | o | |||
| ) | [inline] |
WARNING: using Featherstone's conventions (see class documentation).
Define using Featherstone's conventions.
Definition at line 150 of file SolidTypes.inl.
| sofa::defaulttype::SolidTypes< R >::Transform::Transform | ( | const SpatialVector & | v | ) | [inline] |
Origin of the child in the parent coordinate system and the orientation of the child wrt the parent (i.e. standard way).
Define as a given SpatialVector integrated during one second. The spatial vector is given in parent coordinates.
Define child as a given SpatialVector integrated during one second, starting from the parent (used for time integration). The spatial vector is given in parent coordinates.
Definition at line 184 of file SolidTypes.inl.
References sofa::helper::Quater< Real >::createFromRotationVector(), sofa::defaulttype::SolidTypes< R >::SpatialVector::freeVec, sofa::helper::Quater< Real >::inverseRotate(), sofa::defaulttype::SolidTypes< R >::SpatialVector::lineVec, sofa::defaulttype::SolidTypes< R >::Transform::orientation_, and sofa::defaulttype::SolidTypes< R >::Transform::origin_.
| SolidTypes< R >::Vec sofa::defaulttype::SolidTypes< R >::Transform::backProjectPoint | ( | const Vec & | pointInParent | ) | const [inline] |
Project point from parent coordinates to this coordinates.
Definition at line 241 of file SolidTypes.inl.
References sofa::helper::Quater< Real >::inverseRotate(), sofa::defaulttype::SolidTypes< R >::Transform::orientation_, and sofa::defaulttype::SolidTypes< R >::Transform::origin_.
| SolidTypes< R >::Vec sofa::defaulttype::SolidTypes< R >::Transform::backProjectVector | ( | const Vec & | vectorInParent | ) | const [inline] |
Projected a vector (i.e. a direction or a displacement) from parent coordinates to child coordinates.
Definition at line 235 of file SolidTypes.inl.
References sofa::helper::Quater< Real >::inverseRotate(), and sofa::defaulttype::SolidTypes< R >::Transform::orientation_.
Referenced by sofa::core::objectmodel::Context::getLocalGravity().
| void sofa::defaulttype::SolidTypes< R >::Transform::clear | ( | ) | [inline] |
Reset this to identity.
Definition at line 265 of file SolidTypes.inl.
References sofa::helper::Quater< Real >::clear(), sofa::defaulttype::SolidTypes< R >::Transform::orientation_, and sofa::defaulttype::SolidTypes< R >::Transform::origin_.
| const SolidTypes< R >::Rot & sofa::defaulttype::SolidTypes< R >::Transform::getOrientation | ( | void | ) | const [inline] |
Orientation of the child coordinate axes wrt the parent coordinate axes.
Definition at line 211 of file SolidTypes.inl.
References sofa::defaulttype::SolidTypes< R >::Transform::orientation_.
Referenced by sofa::component::contextobject::CoordinateSystem::getOrientation(), sofa::defaulttype::SolidTypes< R >::Transform::operator*(), sofa::defaulttype::SolidTypes< R >::Transform::operator*=(), and sofa::defaulttype::SolidTypes< R >::Transform::operator+=().
| SolidTypes< R >::Vec sofa::defaulttype::SolidTypes< R >::Transform::getOrigin | ( | ) | const [inline] |
Origin of child in parent coordinates.
Definition at line 199 of file SolidTypes.inl.
References sofa::defaulttype::SolidTypes< R >::Transform::orientation_, sofa::defaulttype::SolidTypes< R >::Transform::origin_, and sofa::helper::Quater< Real >::rotate().
Referenced by sofa::component::contextobject::CoordinateSystem::getOrigin(), and sofa::defaulttype::SolidTypes< R >::Transform::writeOpenGlMatrix().
| const SolidTypes< R >::Vec & sofa::defaulttype::SolidTypes< R >::Transform::getOriginOfParentInChild | ( | ) | const [inline] |
Parent origin in child coordinates (the way it is actually stored internally).
Definition at line 193 of file SolidTypes.inl.
References sofa::defaulttype::SolidTypes< R >::Transform::origin_.
Referenced by sofa::defaulttype::SolidTypes< R >::RigidInertia::operator*(), sofa::defaulttype::SolidTypes< R >::Transform::operator*(), sofa::defaulttype::SolidTypes< R >::Transform::operator*=(), and sofa::defaulttype::SolidTypes< R >::Transform::operator+=().
| SolidTypes< R >::Mat sofa::defaulttype::SolidTypes< R >::Transform::getRotationMatrix | ( | ) | const [inline] |
Matrix which projects vectors from child coordinates to parent coordinates. The columns of the matrix are the axes of the child base axes in the parent coordinate system.
Definition at line 247 of file SolidTypes.inl.
References sofa::defaulttype::SolidTypes< R >::Transform::orientation_.
Referenced by sofa::defaulttype::SolidTypes< R >::RigidInertia::operator*().
| void sofa::defaulttype::SolidTypes< R >::Transform::glDraw | ( | ) | const [inline] |
Draw the axes of the child coordinate system in the parent coordinate system.
Definition at line 325 of file SolidTypes.inl.
| SolidTypes< R >::Transform sofa::defaulttype::SolidTypes< R >::Transform::identity | ( | ) | [inline, static] |
The identity transform (child = parent).
Define given the origin of the child wrt the parent and the orientation of the child wrt the parent (i.e. standard way).
Definition at line 177 of file SolidTypes.inl.
References sofa::helper::Quater< Real >::identity(), and sofa::defaulttype::SolidTypes< R >::Transform::Transform().
Referenced by sofa::defaulttype::SolidTypes< R >::Transform::Transform().
| SolidTypes< R >::Transform sofa::defaulttype::SolidTypes< R >::Transform::inversed | ( | ) | const [inline] |
The inverse transform i.e. parent wrt child.
Definition at line 305 of file SolidTypes.inl.
References sofa::helper::Quater< Real >::inverse(), sofa::defaulttype::SolidTypes< R >::Transform::orientation_, sofa::defaulttype::SolidTypes< R >::Transform::origin_, sofa::helper::Quater< Real >::rotate(), and sofa::defaulttype::SolidTypes< R >::Transform::Transform().
Referenced by sofa::defaulttype::SolidTypes< R >::Transform::operator/().
| Transform sofa::defaulttype::SolidTypes< R >::Transform::operator* | ( | Real2 | a | ) | const [inline] |
Definition at line 265 of file SolidTypes.h.
| SolidTypes< R >::SpatialVector sofa::defaulttype::SolidTypes< R >::Transform::operator* | ( | const SpatialVector & | sv | ) | const [inline] |
Project a spatial vector from child to parent.
Definition at line 287 of file SolidTypes.inl.
References sofa::defaulttype::cross(), sofa::defaulttype::SolidTypes< R >::SpatialVector::freeVec, sofa::defaulttype::SolidTypes< R >::SpatialVector::lineVec, sofa::defaulttype::SolidTypes< R >::Transform::orientation_, sofa::defaulttype::SolidTypes< R >::Transform::origin_, and sofa::helper::Quater< Real >::rotate().
| SolidTypes< R >::Transform sofa::defaulttype::SolidTypes< R >::Transform::operator* | ( | const Transform & | f2 | ) | const [inline] |
Combine two transforms. If (*this) locates frame B (child) wrt frame A (parent) and if f2 locates frame C (child) wrt frame B (parent) then the result locates frame C wrt to Frame A.
Definition at line 272 of file SolidTypes.inl.
References sofa::defaulttype::SolidTypes< R >::Transform::getOrientation(), sofa::defaulttype::SolidTypes< R >::Transform::getOriginOfParentInChild(), sofa::helper::Quater< Real >::inverseRotate(), sofa::defaulttype::SolidTypes< R >::Transform::orientation_, sofa::defaulttype::SolidTypes< R >::Transform::origin_, and sofa::defaulttype::SolidTypes< R >::Transform::Transform().
| Transform& sofa::defaulttype::SolidTypes< R >::Transform::operator*= | ( | Real2 | a | ) | [inline] |
Definition at line 256 of file SolidTypes.h.
References sofa::defaulttype::SolidTypes< R >::Transform::origin_.
| SolidTypes< R >::Transform & sofa::defaulttype::SolidTypes< R >::Transform::operator*= | ( | const Transform & | f2 | ) | [inline] |
Combine two transforms. If (*this) locates frame B (child) wrt frame A (parent) and if f2 locates frame C (child) wrt frame B (parent) then the result locates frame C wrt to Frame A.
Definition at line 279 of file SolidTypes.inl.
References sofa::defaulttype::SolidTypes< R >::Transform::getOrientation(), sofa::defaulttype::SolidTypes< R >::Transform::getOriginOfParentInChild(), sofa::helper::Quater< Real >::inverseRotate(), sofa::defaulttype::SolidTypes< R >::Transform::orientation_, and sofa::defaulttype::SolidTypes< R >::Transform::origin_.
| SolidTypes< R >::Transform & sofa::defaulttype::SolidTypes< R >::Transform::operator+= | ( | const Transform & | a | ) | [inline] |
Definition at line 378 of file SolidTypes.inl.
References sofa::defaulttype::SolidTypes< R >::Transform::getOrientation(), sofa::defaulttype::SolidTypes< R >::Transform::getOriginOfParentInChild(), sofa::helper::Quater< Real >::normalize(), sofa::defaulttype::SolidTypes< R >::Transform::orientation_, and sofa::defaulttype::SolidTypes< R >::Transform::origin_.
| SolidTypes< R >::Transform & sofa::defaulttype::SolidTypes< R >::Transform::operator+= | ( | const SpatialVector & | a | ) | [inline] |
(*this) *= Transform(v) Used for time integration. SHOULD WE RATHER APPLY (*this)=Transform(v)*(*this) ???
Definition at line 349 of file SolidTypes.inl.
References sofa::defaulttype::SolidTypes< R >::Transform::Transform().
| SolidTypes< R >::SpatialVector sofa::defaulttype::SolidTypes< R >::Transform::operator/ | ( | const SpatialVector & | sv | ) | const [inline] |
Project a spatial vector from parent to child (the inverse of operator *). This method computes (*this).inversed()*sv without inverting (*this).
Definition at line 296 of file SolidTypes.inl.
References sofa::defaulttype::SolidTypes< R >::Transform::inversed().
| void sofa::defaulttype::SolidTypes< R >::Transform::printInternal | ( | std::ostream & | out | ) | const [inline] |
Print the internal values (i.e. using Featherstone's conventions, see class documentation).
Definition at line 341 of file SolidTypes.inl.
References sofa::defaulttype::SolidTypes< R >::Transform::orientation_, and sofa::defaulttype::SolidTypes< R >::Transform::origin_.
| SolidTypes< R >::Vec sofa::defaulttype::SolidTypes< R >::Transform::projectPoint | ( | const Vec & | pointInChild | ) | const [inline] |
Project a point from child coordinates to parent coordinates.
Definition at line 229 of file SolidTypes.inl.
References sofa::defaulttype::SolidTypes< R >::Transform::orientation_, sofa::defaulttype::SolidTypes< R >::Transform::origin_, and sofa::helper::Quater< Real >::rotate().
| SolidTypes< R >::Vec sofa::defaulttype::SolidTypes< R >::Transform::projectVector | ( | const Vec & | vectorInChild | ) | const [inline] |
Project a vector (i.e. a direction or a displacement) from child coordinates to parent coordinates.
Definition at line 223 of file SolidTypes.inl.
References sofa::defaulttype::SolidTypes< R >::Transform::orientation_, and sofa::helper::Quater< Real >::rotate().
Referenced by sofa::component::contextobject::CoordinateSystem::apply().
| void sofa::defaulttype::SolidTypes< R >::Transform::set | ( | const Vec & | t, | |
| const Rot & | q | |||
| ) | [inline] |
Origin of the child in the parent coordinate system and the orientation of the child wrt the parent (i.e. standard way).
Define given the origin of the child wrt the parent and the orientation of the child wrt the parent (i.e. standard way).
Definition at line 162 of file SolidTypes.inl.
References sofa::helper::Quater< Real >::inverseRotate().
| void sofa::defaulttype::SolidTypes< R >::Transform::setOrientation | ( | const Rot & | q | ) | [inline] |
Orientation of the child coordinate axes wrt the parent coordinate axes.
Definition at line 217 of file SolidTypes.inl.
References sofa::defaulttype::SolidTypes< R >::Transform::orientation_.
| void sofa::defaulttype::SolidTypes< R >::Transform::setOrigin | ( | const Vec & | op | ) | [inline] |
Origin of child in parent coordinates.
Definition at line 205 of file SolidTypes.inl.
References sofa::helper::Quater< Real >::inverseRotate(), sofa::defaulttype::SolidTypes< R >::Transform::orientation_, and sofa::defaulttype::SolidTypes< R >::Transform::origin_.
| void sofa::defaulttype::SolidTypes< R >::Transform::writeOpenGlMatrix | ( | double * | m | ) | const [inline] |
Write an OpenGL matrix encoding the transformation of the coordinate system of the child wrt the coordinate system of the parent.
Definition at line 312 of file SolidTypes.inl.
References sofa::defaulttype::SolidTypes< R >::Transform::getOrigin(), sofa::defaulttype::SolidTypes< R >::Transform::orientation_, and sofa::helper::Quater< Real >::writeOpenGlMatrix().
| std::ostream& operator<< | ( | std::ostream & | out, | |
| const Transform & | t | |||
| ) | [friend] |
Print the origin of the child in the parent coordinate system and the quaternion defining the orientation of the child wrt the parent.
Definition at line 237 of file SolidTypes.h.
Rot sofa::defaulttype::SolidTypes< R >::Transform::orientation_ [protected] |
child wrt parent
Definition at line 275 of file SolidTypes.h.
Referenced by sofa::defaulttype::SolidTypes< R >::Transform::backProjectPoint(), sofa::defaulttype::SolidTypes< R >::Transform::backProjectVector(), sofa::defaulttype::SolidTypes< R >::Transform::clear(), sofa::defaulttype::SolidTypes< R >::Transform::getOrientation(), sofa::defaulttype::SolidTypes< R >::Transform::getOrigin(), sofa::defaulttype::SolidTypes< R >::Transform::getRotationMatrix(), sofa::defaulttype::SolidTypes< R >::Transform::inversed(), sofa::defaulttype::SolidTypes< R >::Transform::operator*(), sofa::defaulttype::SolidTypes< R >::Transform::operator*=(), sofa::defaulttype::SolidTypes< R >::Transform::operator+=(), sofa::defaulttype::SolidTypes< R >::Transform::printInternal(), sofa::defaulttype::SolidTypes< R >::Transform::projectPoint(), sofa::defaulttype::SolidTypes< R >::Transform::projectVector(), sofa::defaulttype::SolidTypes< R >::Transform::setOrientation(), sofa::defaulttype::SolidTypes< R >::Transform::setOrigin(), sofa::defaulttype::SolidTypes< R >::Transform::Transform(), and sofa::defaulttype::SolidTypes< R >::Transform::writeOpenGlMatrix().
Vec sofa::defaulttype::SolidTypes< R >::Transform::origin_ [protected] |
parent wrt child
Definition at line 276 of file SolidTypes.h.
Referenced by sofa::defaulttype::SolidTypes< R >::Transform::backProjectPoint(), sofa::defaulttype::SolidTypes< R >::Transform::clear(), sofa::defaulttype::SolidTypes< R >::Transform::getOrigin(), sofa::defaulttype::SolidTypes< R >::Transform::getOriginOfParentInChild(), sofa::defaulttype::SolidTypes< R >::Transform::inversed(), sofa::defaulttype::SolidTypes< R >::Transform::operator*(), sofa::defaulttype::SolidTypes< R >::Transform::operator*=(), sofa::defaulttype::SolidTypes< R >::Transform::operator+=(), sofa::defaulttype::SolidTypes< R >::Transform::printInternal(), sofa::defaulttype::SolidTypes< R >::Transform::projectPoint(), sofa::defaulttype::SolidTypes< R >::Transform::setOrigin(), and sofa::defaulttype::SolidTypes< R >::Transform::Transform().
1.5.7.1