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

impose a motion to given DOFs (translation and rotation) The motion between 2 key times is linearly interpolated More...

#include <LinearMovementConstraint.h>

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

Inheritance graph
[legend]
Collaboration diagram for sofa::component::constraint::LinearMovementConstraint< 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

 LinearMovementConstraint ()
virtual ~LinearMovementConstraint ()
void clearIndices ()
 methods to add/remove some indices, keyTimes, keyMovement
void addIndex (unsigned int index)
void removeIndex (unsigned int index)
void clearKeyMovements ()
void addKeyMovement (Real time, Deriv movement)
 add a new key movement
void init ()
 -- Constraint interface
void projectResponse (VecDeriv &dx)
 Project dx to constrained space (dx models an acceleration).
virtual void projectVelocity (VecDeriv &dx)
 project dx to constrained space (dx models a velocity)
virtual void projectPosition (VecCoord &x)
 project x to constrained space (x models a position)
virtual void handleTopologyChange ()
 Handle topological changes.
virtual void draw ()
 Render internal data of this object, for debugging purposes.
bool isHolonomic ()
 this constraint is holonomic
template<>
void draw ()
 Render internal data of this object, for debugging purposes.
template<>
void draw ()
 Render internal data of this object, for debugging purposes.
template<>
void draw ()
 Render internal data of this object, for debugging purposes.
template<>
void draw ()
 Render internal data of this object, for debugging purposes.

Data Fields

Data< SetIndex > m_indices
 indices of the DOFs the constraint is applied to
Data< helper::vector< Real > > m_keyTimes
 the key frames when the motion is defined by the user
Data< VecDeriv > m_keyMovements
 the motions corresponding to the key frames
Real prevT
 the key times surrounding the current simulation time (for interpolation)
Real nextT
Deriv prevM
 the motions corresponding to the surrouding key times
Deriv nextM
VecCoord x0
 initial constrained DOFs position

Static Protected Member Functions

static bool FCTestNewPointFunction (int, void *, const sofa::helper::vector< unsigned int > &, const sofa::helper::vector< double > &)
 Define TestNewPointFunction (for topology changes).
static void FCRemovalFunction (int, void *)
 Define RemovalFunction (for topology changes).

Protected Attributes

sofa::core::componentmodel::topology::BaseMeshTopology * topology

Detailed Description

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

impose a motion to given DOFs (translation and rotation) The motion between 2 key times is linearly interpolated

Definition at line 56 of file LinearMovementConstraint.h.


Member Typedef Documentation

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

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

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

Definition at line 64 of file LinearMovementConstraint.h.

template<class DataTypes >
typedef helper::vector<unsigned int> sofa::component::constraint::LinearMovementConstraint< DataTypes >::SetIndexArray

Definition at line 65 of file LinearMovementConstraint.h.

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

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


Constructor & Destructor Documentation

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

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

Definition at line 110 of file LinearMovementConstraint.inl.


Member Function Documentation

template<class DataTypes >
void sofa::component::constraint::LinearMovementConstraint< DataTypes >::addIndex ( unsigned int  index  )  [inline]

template<class DataTypes >
void sofa::component::constraint::LinearMovementConstraint< DataTypes >::addKeyMovement ( Real  time,
Deriv  movement 
) [inline]

add a new key movement

Parameters:
time : the simulation time you want to set a movement (in sec)
movement : the corresponding motion for instance, addKeyMovement(1.0, Deriv(5,0,0) ) will set a translation of 5 in x direction a time 1.0s

Definition at line 145 of file LinearMovementConstraint.inl.

References sofa::component::constraint::LinearMovementConstraint< DataTypes >::m_keyMovements, and sofa::component::constraint::LinearMovementConstraint< DataTypes >::m_keyTimes.

template<class DataTypes >
void sofa::component::constraint::LinearMovementConstraint< DataTypes >::clearIndices (  )  [inline]

methods to add/remove some indices, keyTimes, keyMovement

Definition at line 115 of file LinearMovementConstraint.inl.

References sofa::component::constraint::LinearMovementConstraint< DataTypes >::m_indices.

template<class DataTypes >
void sofa::component::constraint::LinearMovementConstraint< DataTypes >::clearKeyMovements (  )  [inline]

template<>
void sofa::component::constraint::LinearMovementConstraint< Rigid3fTypes >::draw (  )  [inline, virtual]

Render internal data of this object, for debugging purposes.

Reimplemented from sofa::core::objectmodel::BaseObject.

template<>
void sofa::component::constraint::LinearMovementConstraint< Rigid3dTypes >::draw (  )  [inline, virtual]

Render internal data of this object, for debugging purposes.

Reimplemented from sofa::core::objectmodel::BaseObject.

template<>
void sofa::component::constraint::LinearMovementConstraint< Rigid3fTypes >::draw (  )  [inline, virtual]

template<>
void sofa::component::constraint::LinearMovementConstraint< Rigid3dTypes >::draw (  )  [inline, virtual]

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

template<class DataTypes >
void sofa::component::constraint::LinearMovementConstraint< DataTypes >::FCRemovalFunction ( int  pointIndex,
void *  param 
) [inline, static, protected]

template<class DataTypes >
bool sofa::component::constraint::LinearMovementConstraint< DataTypes >::FCTestNewPointFunction ( int  ,
void *  param,
const sofa::helper::vector< unsigned int > &  ,
const sofa::helper::vector< double > &   
) [inline, static, protected]

Define TestNewPointFunction (for topology changes).

Definition at line 59 of file LinearMovementConstraint.inl.

Referenced by sofa::component::constraint::LinearMovementConstraint< DataTypes >::init().

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

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

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

this constraint is holonomic

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

Definition at line 111 of file LinearMovementConstraint.h.

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

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

Project dx to constrained space (dx models an acceleration).

This method must be implemented by the component, and is usually called by the generic Constraint::projectResponse() method.

Implements sofa::core::componentmodel::behavior::Constraint< DataTypes >.

Definition at line 179 of file LinearMovementConstraint.inl.

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

template<class DataTypes >
void sofa::component::constraint::LinearMovementConstraint< DataTypes >::removeIndex ( unsigned int  index  )  [inline]


Field Documentation

template<class DataTypes >
Deriv sofa::component::constraint::LinearMovementConstraint< DataTypes >::nextM

template<class DataTypes >
Real sofa::component::constraint::LinearMovementConstraint< DataTypes >::nextT

template<class DataTypes >
Deriv sofa::component::constraint::LinearMovementConstraint< DataTypes >::prevM

template<class DataTypes >
Real sofa::component::constraint::LinearMovementConstraint< DataTypes >::prevT

template<class DataTypes >
VecCoord sofa::component::constraint::LinearMovementConstraint< DataTypes >::x0


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

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