sofa::component::constraint::AttachConstraint< DataTypes > Class Template Reference

Attach given pair of particles, projecting the positions of the second particles to the first ones. More...

#include <AttachConstraint.h>

Inheritance diagram for sofa::component::constraint::AttachConstraint< DataTypes >:

Inheritance graph
[legend]
Collaboration diagram for sofa::component::constraint::AttachConstraint< DataTypes >:

Collaboration graph
[legend]

Public Types

typedef DataTypes::VecCoord VecCoord
typedef DataTypes::VecDeriv VecDeriv
typedef DataTypes::Coord Coord
typedef DataTypes::Deriv Deriv
typedef DataTypes::Real Real
typedef topology::PointSubset SetIndex
typedef helper::vector
< unsigned int > 
SetIndexArray

Public Member Functions

 AttachConstraint ()
virtual ~AttachConstraint ()
void clearConstraints ()
void addConstraint (unsigned int index1, unsigned int index2)
void init ()
 Initialization method called at graph modification, during bottom-up traversal.
void projectResponse (VecDeriv &dx1, VecDeriv &dx2)
 Project dx to constrained space (dx models an acceleration).
virtual void projectVelocity (VecDeriv &v1, VecDeriv &v2)
 Project v to constrained space (v models a velocity).
virtual void projectPosition (VecCoord &x1, VecCoord &x2)
 Project x to constrained space (x models a position).
void applyConstraint (defaulttype::BaseMatrix *mat, unsigned int &offset)
 Project the global Mechanical Matrix to constrained space using offset parameter.
void applyConstraint (defaulttype::BaseVector *vect, unsigned int &offset)
 Project the global Mechanical Vector to constrained space using offset parameter.
virtual void draw ()
 Render internal data of this object, for debugging purposes.
bool isHolonomic ()
 says if the constraint is holonomic or not holonomic constraints can be processed using different methods such as : projection - reducing the degrees of freedom - simple lagrange multiplier process Non-holonomic constraints (like contact, friction.
template<>
void projectPosition (Coord &x1, Coord &x2, bool freeRotations, unsigned index)
template<>
void projectPosition (Coord &x1, Coord &x2, bool freeRotations, unsigned)
template<>
void projectPosition (Coord &x1, Coord &x2, bool freeRotations, unsigned)
template<>
void projectPosition (Coord &x1, Coord &x2, bool freeRotations, unsigned)
template<>
void projectVelocity (Deriv &x1, Deriv &x2, bool freeRotations, unsigned)
template<>
void projectVelocity (Deriv &x1, Deriv &x2, bool freeRotations, unsigned)
template<>
void projectVelocity (Deriv &x1, Deriv &x2, bool freeRotations, unsigned)
template<>
void projectVelocity (Deriv &x1, Deriv &x2, bool freeRotations, unsigned)
template<>
void projectResponse (Deriv &dx1, Deriv &dx2, bool freeRotations, bool twoway, unsigned)
template<>
void projectResponse (Deriv &dx1, Deriv &dx2, bool freeRotations, bool twoway, unsigned)
template<>
void projectResponse (Deriv &dx1, Deriv &dx2, bool freeRotations, bool twoway, unsigned)
template<>
void projectResponse (Deriv &dx1, Deriv &dx2, bool freeRotations, bool twoway, unsigned)
template<>
unsigned int DerivConstrainedSize (bool freeRotations)
template<>
unsigned int DerivConstrainedSize (bool freeRotations)
template<>
unsigned int DerivConstrainedSize (bool freeRotations)
template<>
unsigned int DerivConstrainedSize (bool freeRotations)
template<>
void calcRestRotations ()

Data Fields

Data< SetIndex > f_indices1
Data< SetIndex > f_indices2
Data< Real > f_radius
Data< bool > f_twoWay
Data< bool > f_freeRotations
Data< bool > f_lastFreeRotation
Data< bool > f_restRotations
Data< defaulttype::Vector3 > f_lastPos
Data< defaulttype::Vector3 > f_lastDir
Data< bool > f_clamp
helper::vector< bool > activeFlags
helper::vector< Real > lastDist
helper::vector< defaulttype::Quat > restRotations

Protected Member Functions

void projectPosition (Coord &x1, Coord &x2, bool, unsigned)
void projectVelocity (Deriv &x1, Deriv &x2, bool, unsigned)
void projectResponse (Deriv &dx1, Deriv &dx2, bool, bool twoway, unsigned)
void calcRestRotations ()

Static Protected Member Functions

static unsigned int DerivConstrainedSize (bool)

Protected Attributes

AttachConstraintInternalData
< DataTypes > 
data
sofa::core::componentmodel::topology::BaseMeshTopology * topology

Detailed Description

template<class DataTypes>
class sofa::component::constraint::AttachConstraint< DataTypes >

Attach given pair of particles, projecting the positions of the second particles to the first ones.

Definition at line 60 of file AttachConstraint.h.


Member Typedef Documentation

template<class DataTypes >
typedef DataTypes::Coord sofa::component::constraint::AttachConstraint< DataTypes >::Coord

template<class DataTypes >
typedef DataTypes::Deriv sofa::component::constraint::AttachConstraint< DataTypes >::Deriv

template<class DataTypes >
typedef DataTypes::Real sofa::component::constraint::AttachConstraint< DataTypes >::Real

Definition at line 68 of file AttachConstraint.h.

Definition at line 69 of file AttachConstraint.h.

template<class DataTypes >
typedef DataTypes::VecCoord sofa::component::constraint::AttachConstraint< DataTypes >::VecCoord

template<class DataTypes >
typedef DataTypes::VecDeriv sofa::component::constraint::AttachConstraint< DataTypes >::VecDeriv


Constructor & Destructor Documentation

template<class DataTypes >
sofa::component::constraint::AttachConstraint< DataTypes >::AttachConstraint (  )  [inline]

Definition at line 297 of file AttachConstraint.inl.

template<class DataTypes >
sofa::component::constraint::AttachConstraint< DataTypes >::~AttachConstraint (  )  [inline, virtual]

Definition at line 328 of file AttachConstraint.inl.


Member Function Documentation

template<class DataTypes >
void sofa::component::constraint::AttachConstraint< DataTypes >::addConstraint ( unsigned int  index1,
unsigned int  index2 
) [inline]

template<class DataTypes >
void sofa::component::constraint::AttachConstraint< DataTypes >::applyConstraint ( defaulttype::BaseVector *  ,
unsigned int &   
) [inline, virtual]

template<class DataTypes >
void sofa::component::constraint::AttachConstraint< DataTypes >::applyConstraint ( defaulttype::BaseMatrix *  ,
unsigned int &   
) [inline, virtual]

template<>
void sofa::component::constraint::AttachConstraint< Rigid3dTypes >::calcRestRotations (  )  [inline]

template<class DataTypes >
void sofa::component::constraint::AttachConstraint< DataTypes >::calcRestRotations (  )  [inline, protected]

template<class DataTypes >
void sofa::component::constraint::AttachConstraint< DataTypes >::clearConstraints (  )  [inline]

template<>
unsigned int sofa::component::constraint::AttachConstraint< defaulttype::Rigid2fTypes >::DerivConstrainedSize ( bool  freeRotations  )  [inline]

Definition at line 263 of file AttachConstraint.inl.

template<>
unsigned int sofa::component::constraint::AttachConstraint< defaulttype::Rigid2dTypes >::DerivConstrainedSize ( bool  freeRotations  )  [inline]

Definition at line 254 of file AttachConstraint.inl.

template<>
unsigned int sofa::component::constraint::AttachConstraint< defaulttype::Rigid3fTypes >::DerivConstrainedSize ( bool  freeRotations  )  [inline]

Definition at line 245 of file AttachConstraint.inl.

template<>
unsigned int sofa::component::constraint::AttachConstraint< defaulttype::Rigid3dTypes >::DerivConstrainedSize ( bool  freeRotations  )  [inline]

Definition at line 236 of file AttachConstraint.inl.

template<class DataTypes >
static unsigned int sofa::component::constraint::AttachConstraint< DataTypes >::DerivConstrainedSize ( bool   )  [inline, static, protected]

template<class DataTypes >
void sofa::component::constraint::AttachConstraint< DataTypes >::draw (  )  [inline, virtual]

template<class DataTypes >
void sofa::component::constraint::AttachConstraint< DataTypes >::init ( void   )  [inline, virtual]

template<class DataTypes >
bool sofa::component::constraint::AttachConstraint< DataTypes >::isHolonomic (  )  [inline, virtual]

says if the constraint is holonomic or not holonomic constraints can be processed using different methods such as : projection - reducing the degrees of freedom - simple lagrange multiplier process Non-holonomic constraints (like contact, friction.

..) need more specific treatments

Reimplemented from sofa::core::componentmodel::behavior::BaseConstraint.

Definition at line 116 of file AttachConstraint.h.

template<>
void sofa::component::constraint::AttachConstraint< defaulttype::Rigid2fTypes >::projectPosition ( Coord &  x1,
Coord &  x2,
bool  freeRotations,
unsigned   
) [inline]

Definition at line 95 of file AttachConstraint.inl.

template<>
void sofa::component::constraint::AttachConstraint< defaulttype::Rigid2dTypes >::projectPosition ( Coord &  x1,
Coord &  x2,
bool  freeRotations,
unsigned   
) [inline]

Definition at line 87 of file AttachConstraint.inl.

template<>
void sofa::component::constraint::AttachConstraint< defaulttype::Rigid3fTypes >::projectPosition ( Coord &  x1,
Coord &  x2,
bool  freeRotations,
unsigned   
) [inline]

Definition at line 79 of file AttachConstraint.inl.

template<>
void sofa::component::constraint::AttachConstraint< defaulttype::Rigid3dTypes >::projectPosition ( Coord &  x1,
Coord &  x2,
bool  freeRotations,
unsigned  index 
) [inline]

template<class DataTypes >
void sofa::component::constraint::AttachConstraint< DataTypes >::projectPosition ( Coord &  x1,
Coord &  x2,
bool  ,
unsigned   
) [inline, protected]

Definition at line 119 of file AttachConstraint.h.

template<class DataTypes >
void sofa::component::constraint::AttachConstraint< DataTypes >::projectPosition ( VecCoord &  x1,
VecCoord &  x2 
) [inline, virtual]

template<>
void sofa::component::constraint::AttachConstraint< defaulttype::Rigid2fTypes >::projectResponse ( Deriv &  dx1,
Deriv &  dx2,
bool  freeRotations,
bool  twoway,
unsigned   
) [inline]

Definition at line 211 of file AttachConstraint.inl.

template<>
void sofa::component::constraint::AttachConstraint< defaulttype::Rigid2dTypes >::projectResponse ( Deriv &  dx1,
Deriv &  dx2,
bool  freeRotations,
bool  twoway,
unsigned   
) [inline]

Definition at line 186 of file AttachConstraint.inl.

template<>
void sofa::component::constraint::AttachConstraint< defaulttype::Rigid3fTypes >::projectResponse ( Deriv &  dx1,
Deriv &  dx2,
bool  freeRotations,
bool  twoway,
unsigned   
) [inline]

Definition at line 161 of file AttachConstraint.inl.

template<>
void sofa::component::constraint::AttachConstraint< defaulttype::Rigid3dTypes >::projectResponse ( Deriv &  dx1,
Deriv &  dx2,
bool  freeRotations,
bool  twoway,
unsigned   
) [inline]

Definition at line 136 of file AttachConstraint.inl.

template<class DataTypes >
void sofa::component::constraint::AttachConstraint< DataTypes >::projectResponse ( Deriv &  dx1,
Deriv &  dx2,
bool  ,
bool  twoway,
unsigned   
) [inline, protected]

Definition at line 121 of file AttachConstraint.h.

template<class DataTypes >
void sofa::component::constraint::AttachConstraint< DataTypes >::projectResponse ( VecDeriv &  dx1,
VecDeriv &  dx2 
) [inline, virtual]

template<>
void sofa::component::constraint::AttachConstraint< defaulttype::Rigid2fTypes >::projectVelocity ( Deriv &  x1,
Deriv &  x2,
bool  freeRotations,
unsigned   
) [inline]

Definition at line 128 of file AttachConstraint.inl.

template<>
void sofa::component::constraint::AttachConstraint< defaulttype::Rigid2dTypes >::projectVelocity ( Deriv &  x1,
Deriv &  x2,
bool  freeRotations,
unsigned   
) [inline]

Definition at line 120 of file AttachConstraint.inl.

template<>
void sofa::component::constraint::AttachConstraint< defaulttype::Rigid3fTypes >::projectVelocity ( Deriv &  x1,
Deriv &  x2,
bool  freeRotations,
unsigned   
) [inline]

Definition at line 112 of file AttachConstraint.inl.

template<>
void sofa::component::constraint::AttachConstraint< defaulttype::Rigid3dTypes >::projectVelocity ( Deriv &  x1,
Deriv &  x2,
bool  freeRotations,
unsigned   
) [inline]

Definition at line 103 of file AttachConstraint.inl.

template<class DataTypes >
void sofa::component::constraint::AttachConstraint< DataTypes >::projectVelocity ( Deriv &  x1,
Deriv &  x2,
bool  ,
unsigned   
) [inline, protected]

Definition at line 120 of file AttachConstraint.h.

template<class DataTypes >
void sofa::component::constraint::AttachConstraint< DataTypes >::projectVelocity ( VecDeriv &  v1,
VecDeriv &  v2 
) [inline, virtual]


Field Documentation

Definition at line 73 of file AttachConstraint.h.


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

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