sofa::defaulttype::RigidCoord< 2, real > Class Template Reference

#include <RigidTypes.h>

Collaboration diagram for sofa::defaulttype::RigidCoord< 2, real >:

Collaboration graph
[legend]

Public Types

enum  { static_size = 2 }
typedef real value_type
typedef real Real
typedef Vec< 2, Real > Vec2

Public Member Functions

 RigidCoord (const Vec2 &posCenter, const Real &orient)
 RigidCoord ()
void clear ()
void operator+= (const RigidDeriv< 2, real > &a)
RigidCoord< 2, real > operator+ (const RigidDeriv< 2, real > &a) const
RigidCoord< 2, real > operator- (const RigidCoord< 2, real > &a) const
void operator+= (const RigidCoord< 2, real > &a)
template<typename real2 >
void operator*= (real2 a)
template<typename real2 >
RigidCoord< 2, real > operator* (real2 a) const
Real operator* (const RigidCoord< 2, real > &a) const
 dot product, mostly used to compute residuals as sqrt(x*x)
real norm2 () const
 Squared norm.
real norm () const
 Euclidean norm.
Vec2 & getCenter ()
Real & getOrientation ()
const Vec2 & getCenter () const
const Real & getOrientation () const
Vec2 rotate (const Vec2 &v) const
Vec2 inverseRotate (const Vec2 &v) const
void multRight (const RigidCoord< 2, real > &c)
 Apply a transformation with respect to itself.
RigidCoord< 2, real > mult (const RigidCoord< 2, real > &c) const
 compute the product with another frame on the right
template<class Mat >
void writeRotationMatrix (Mat &m) const
template<class Mat >
void fromMatrix (const Mat &m) const
 Set from the given matrix.
template<class Mat >
void toMatrix (Mat &m) const
 Write to the given matrix.
void writeOpenGlMatrix (float m[16]) const
 Write the OpenGL transformation matrix.
Vec2 vectorToChild (const Vec2 &v) const
 compute the projection of a vector from the parent frame to the child
real * ptr ()
const real * ptr () const
real & operator[] (int i)
 Access to i-th element.
const real & operator[] (int i) const
 Const access to i-th element.

Static Public Member Functions

static RigidCoord< 2, real > identity ()
static int max_size ()
static unsigned int size ()

Private Attributes

Vec2 center
Real orientation

Friends

std::ostream & operator<< (std::ostream &out, const RigidCoord< 2, real > &v)
 write to an output stream
std::istream & operator>> (std::istream &in, RigidCoord< 2, real > &v)
 read from an input stream

Detailed Description

template<typename real>
class sofa::defaulttype::RigidCoord< 2, real >

Definition at line 783 of file RigidTypes.h.


Member Typedef Documentation

template<typename real >
typedef real sofa::defaulttype::RigidCoord< 2, real >::Real

Definition at line 787 of file RigidTypes.h.

template<typename real >
typedef real sofa::defaulttype::RigidCoord< 2, real >::value_type

Definition at line 786 of file RigidTypes.h.

template<typename real >
typedef Vec<2,Real> sofa::defaulttype::RigidCoord< 2, real >::Vec2

Definition at line 788 of file RigidTypes.h.


Member Enumeration Documentation

template<typename real >
anonymous enum

Enumerator:
static_size 

Definition at line 973 of file RigidTypes.h.


Constructor & Destructor Documentation

template<typename real >
sofa::defaulttype::RigidCoord< 2, real >::RigidCoord ( const Vec2 &  posCenter,
const Real &  orient 
) [inline]

Definition at line 793 of file RigidTypes.h.

template<typename real >
sofa::defaulttype::RigidCoord< 2, real >::RigidCoord (  )  [inline]

Definition at line 795 of file RigidTypes.h.

References sofa::component::clear().


Member Function Documentation

template<typename real >
void sofa::defaulttype::RigidCoord< 2, real >::clear (  )  [inline]

Definition at line 797 of file RigidTypes.h.

template<typename real >
template<class Mat >
void sofa::defaulttype::RigidCoord< 2, real >::fromMatrix ( const Mat &  m  )  const [inline]

Set from the given matrix.

Definition at line 911 of file RigidTypes.h.

template<typename real >
const Vec2& sofa::defaulttype::RigidCoord< 2, real >::getCenter (  )  const [inline]

Definition at line 862 of file RigidTypes.h.

template<typename real >
Vec2& sofa::defaulttype::RigidCoord< 2, real >::getCenter (  )  [inline]

Definition at line 860 of file RigidTypes.h.

Referenced by multRight(), operator+=(), and operator-().

template<typename real >
const Real& sofa::defaulttype::RigidCoord< 2, real >::getOrientation ( void   )  const [inline]

Definition at line 863 of file RigidTypes.h.

template<typename real >
Real& sofa::defaulttype::RigidCoord< 2, real >::getOrientation ( void   )  [inline]

Definition at line 861 of file RigidTypes.h.

Referenced by mult(), multRight(), and operator+=().

template<typename real >
static RigidCoord<2,real> sofa::defaulttype::RigidCoord< 2, real >::identity (  )  [inline, static]

Definition at line 880 of file RigidTypes.h.

template<typename real >
Vec2 sofa::defaulttype::RigidCoord< 2, real >::inverseRotate ( const Vec2 &  v  )  const [inline]

Definition at line 872 of file RigidTypes.h.

template<typename real >
static int sofa::defaulttype::RigidCoord< 2, real >::max_size (  )  [inline, static]

Definition at line 968 of file RigidTypes.h.

template<typename real >
RigidCoord<2,real> sofa::defaulttype::RigidCoord< 2, real >::mult ( const RigidCoord< 2, real > &  c  )  const [inline]

compute the product with another frame on the right

Definition at line 894 of file RigidTypes.h.

References center, getOrientation(), and orientation.

template<typename real >
void sofa::defaulttype::RigidCoord< 2, real >::multRight ( const RigidCoord< 2, real > &  c  )  [inline]

Apply a transformation with respect to itself.

Definition at line 887 of file RigidTypes.h.

References getCenter(), and getOrientation().

template<typename real >
real sofa::defaulttype::RigidCoord< 2, real >::norm (  )  const [inline]

Euclidean norm.

Definition at line 855 of file RigidTypes.h.

References norm2(), and sofa::helper::rsqrt().

template<typename real >
real sofa::defaulttype::RigidCoord< 2, real >::norm2 (  )  const [inline]

Squared norm.

Definition at line 849 of file RigidTypes.h.

template<typename real >
Real sofa::defaulttype::RigidCoord< 2, real >::operator* ( const RigidCoord< 2, real > &  a  )  const [inline]

dot product, mostly used to compute residuals as sqrt(x*x)

Definition at line 842 of file RigidTypes.h.

References center, and orientation.

template<typename real >
template<typename real2 >
RigidCoord<2,real> sofa::defaulttype::RigidCoord< 2, real >::operator* ( real2  a  )  const [inline]

Definition at line 834 of file RigidTypes.h.

template<typename real >
template<typename real2 >
void sofa::defaulttype::RigidCoord< 2, real >::operator*= ( real2  a  )  [inline]

Definition at line 826 of file RigidTypes.h.

template<typename real >
RigidCoord<2,real> sofa::defaulttype::RigidCoord< 2, real >::operator+ ( const RigidDeriv< 2, real > &  a  )  const [inline]

template<typename real >
void sofa::defaulttype::RigidCoord< 2, real >::operator+= ( const RigidCoord< 2, real > &  a  )  [inline]

Definition at line 818 of file RigidTypes.h.

References getCenter(), and getOrientation().

template<typename real >
void sofa::defaulttype::RigidCoord< 2, real >::operator+= ( const RigidDeriv< 2, real > &  a  )  [inline]

template<typename real >
RigidCoord<2,real> sofa::defaulttype::RigidCoord< 2, real >::operator- ( const RigidCoord< 2, real > &  a  )  const [inline]

Definition at line 813 of file RigidTypes.h.

References getCenter(), and orientation.

template<typename real >
const real& sofa::defaulttype::RigidCoord< 2, real >::operator[] ( int  i  )  const [inline]

Const access to i-th element.

Definition at line 990 of file RigidTypes.h.

template<typename real >
real& sofa::defaulttype::RigidCoord< 2, real >::operator[] ( int  i  )  [inline]

Access to i-th element.

Definition at line 981 of file RigidTypes.h.

template<typename real >
const real* sofa::defaulttype::RigidCoord< 2, real >::ptr (  )  const [inline]

Definition at line 976 of file RigidTypes.h.

template<typename real >
real* sofa::defaulttype::RigidCoord< 2, real >::ptr (  )  [inline]

Definition at line 975 of file RigidTypes.h.

template<typename real >
Vec2 sofa::defaulttype::RigidCoord< 2, real >::rotate ( const Vec2 &  v  )  const [inline]

Definition at line 865 of file RigidTypes.h.

template<typename real >
static unsigned int sofa::defaulttype::RigidCoord< 2, real >::size ( void   )  [inline, static]

Definition at line 978 of file RigidTypes.h.

template<typename real >
template<class Mat >
void sofa::defaulttype::RigidCoord< 2, real >::toMatrix ( Mat &  m  )  const [inline]

Write to the given matrix.

Definition at line 920 of file RigidTypes.h.

References sofa::defaulttype::Mat< L, C, real >::identity().

template<typename real >
Vec2 sofa::defaulttype::RigidCoord< 2, real >::vectorToChild ( const Vec2 &  v  )  const [inline]

compute the projection of a vector from the parent frame to the child

Definition at line 951 of file RigidTypes.h.

template<typename real >
void sofa::defaulttype::RigidCoord< 2, real >::writeOpenGlMatrix ( float  m[16]  )  const [inline]

Write the OpenGL transformation matrix.

Definition at line 929 of file RigidTypes.h.

template<typename real >
template<class Mat >
void sofa::defaulttype::RigidCoord< 2, real >::writeRotationMatrix ( Mat &  m  )  const [inline]

Definition at line 903 of file RigidTypes.h.


Friends And Related Function Documentation

template<typename real >
std::ostream& operator<< ( std::ostream &  out,
const RigidCoord< 2, real > &  v 
) [friend]

write to an output stream

Definition at line 957 of file RigidTypes.h.

template<typename real >
std::istream& operator>> ( std::istream &  in,
RigidCoord< 2, real > &  v 
) [friend]

read from an input stream

Definition at line 963 of file RigidTypes.h.


Field Documentation

template<typename real >
Vec2 sofa::defaulttype::RigidCoord< 2, real >::center [private]

Definition at line 790 of file RigidTypes.h.

Referenced by mult(), operator*(), and operator+().

template<typename real >
Real sofa::defaulttype::RigidCoord< 2, real >::orientation [private]

Definition at line 791 of file RigidTypes.h.

Referenced by mult(), operator*(), operator+(), and operator-().


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

Generated on Sun Nov 23 04:23:54 2008 for Sofa by  doxygen 1.5.7.1