sofa::core::componentmodel::behavior::PairInteractionConstraint< TDataTypes > Class Template Reference

Component computing constraints between a pair of simulated body. More...

#include <PairInteractionConstraint.h>

Inheritance diagram for sofa::core::componentmodel::behavior::PairInteractionConstraint< TDataTypes >:

Inheritance graph
[legend]
Collaboration diagram for sofa::core::componentmodel::behavior::PairInteractionConstraint< TDataTypes >:

Collaboration graph
[legend]

Public Types

typedef TDataTypes DataTypes
typedef DataTypes::VecCoord VecCoord
typedef DataTypes::VecDeriv VecDeriv
typedef DataTypes::VecConst VecConst
typedef DataTypes::Coord Coord
typedef DataTypes::Deriv Deriv
typedef DataTypes::Real Real

Public Member Functions

 PairInteractionConstraint (MechanicalState< DataTypes > *mm1=NULL, MechanicalState< DataTypes > *mm2=NULL)
virtual ~PairInteractionConstraint ()
virtual bool isActive () const
 if false, the constraint does nothing
virtual void init ()
 Initialization method called at graph modification, during bottom-up traversal.
MechanicalState< DataTypes > * getMState1 ()
 Retrieve the associated MechanicalState.
BaseMechanicalState * getMechModel1 ()
 Get the first MechanicalState.
MechanicalState< DataTypes > * getMState2 ()
 Retrieve the associated MechanicalState.
BaseMechanicalState * getMechModel2 ()
 Get the first MechanicalState.
virtual void applyConstraint (unsigned int &contactId)
virtual void applyConstraint (VecConst &, VecConst &, unsigned int &)
virtual std::string getTemplateName () const
 Get the template type names (if any) used to instantiate this object.
Vector operations
virtual void projectResponse ()
 Project dx to constrained space (dx models an acceleration).
virtual void projectVelocity ()
 Project v to constrained space (v models a velocity).
virtual void projectPosition ()
 Project x to constrained space (x models a position).
virtual void projectFreeVelocity ()
 Project vFree to constrained space (vFree models a velocity).
virtual void projectFreePosition ()
 Project xFree to constrained space (xFree models a position).
virtual void projectResponse (VecDeriv &dx1, VecDeriv &dx2)=0
 Project dx to constrained space (dx models an acceleration).
virtual void projectVelocity (VecDeriv &v1, VecDeriv &v2)=0
 Project v to constrained space (v models a velocity).
virtual void projectPosition (VecCoord &x1, VecCoord &x2)=0
 Project x to constrained space (x models a position).

Static Public Member Functions

template<class T >
static bool canCreate (T *&obj, objectmodel::BaseContext *context, objectmodel::BaseObjectDescription *arg)
 Pre-construction check method called by ObjectFactory.
template<class T >
static void create (T *&obj, core::objectmodel::BaseContext *context, core::objectmodel::BaseObjectDescription *arg)
 Construction method called by ObjectFactory.
static std::string templateName (const PairInteractionConstraint< DataTypes > *=NULL)

Data Fields

Data< double > endTime
 Time when the constraint becomes inactive (-1 for infinitely active).

Protected Attributes

Data< std::string > object1
Data< std::string > object2
MechanicalState< DataTypes > * mstate1
MechanicalState< DataTypes > * mstate2

Detailed Description

template<class TDataTypes>
class sofa::core::componentmodel::behavior::PairInteractionConstraint< TDataTypes >

Component computing constraints between a pair of simulated body.

This class define the abstract API common to interaction constraints between a pair of bodies using a given type of DOFs.

Definition at line 52 of file PairInteractionConstraint.h.


Member Typedef Documentation

template<class TDataTypes >
typedef DataTypes::Coord sofa::core::componentmodel::behavior::PairInteractionConstraint< TDataTypes >::Coord

template<class TDataTypes >
typedef TDataTypes sofa::core::componentmodel::behavior::PairInteractionConstraint< TDataTypes >::DataTypes

Definition at line 55 of file PairInteractionConstraint.h.

template<class TDataTypes >
typedef DataTypes::Deriv sofa::core::componentmodel::behavior::PairInteractionConstraint< TDataTypes >::Deriv

template<class TDataTypes >
typedef DataTypes::Real sofa::core::componentmodel::behavior::PairInteractionConstraint< TDataTypes >::Real

template<class TDataTypes >
typedef DataTypes::VecConst sofa::core::componentmodel::behavior::PairInteractionConstraint< TDataTypes >::VecConst

Definition at line 58 of file PairInteractionConstraint.h.

template<class TDataTypes >
typedef DataTypes::VecCoord sofa::core::componentmodel::behavior::PairInteractionConstraint< TDataTypes >::VecCoord

template<class TDataTypes >
typedef DataTypes::VecDeriv sofa::core::componentmodel::behavior::PairInteractionConstraint< TDataTypes >::VecDeriv


Constructor & Destructor Documentation

Definition at line 46 of file PairInteractionConstraint.inl.

Definition at line 55 of file PairInteractionConstraint.inl.


Member Function Documentation

template<class TDataTypes >
virtual void sofa::core::componentmodel::behavior::PairInteractionConstraint< TDataTypes >::applyConstraint ( VecConst &  ,
VecConst &  ,
unsigned int &   
) [inline, virtual]

Definition at line 140 of file PairInteractionConstraint.h.

template<class DataTypes >
void sofa::core::componentmodel::behavior::PairInteractionConstraint< DataTypes >::applyConstraint ( unsigned int &  contactId  )  [inline, virtual]

Todo:
What is the difference with BaseConstraint::applyConstraint(unsigned int&, double&) ?

Definition at line 117 of file PairInteractionConstraint.inl.

template<class TDataTypes >
template<class T >
static bool sofa::core::componentmodel::behavior::PairInteractionConstraint< TDataTypes >::canCreate ( T *&  obj,
objectmodel::BaseContext *  context,
objectmodel::BaseObjectDescription *  arg 
) [inline, static]

Pre-construction check method called by ObjectFactory.

Check that DataTypes matches the MechanicalState.

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

Definition at line 145 of file PairInteractionConstraint.h.

Referenced by sofa::core::componentmodel::behavior::PairInteractionConstraint< DataTypes >::canCreate().

template<class TDataTypes >
template<class T >
static void sofa::core::componentmodel::behavior::PairInteractionConstraint< TDataTypes >::create ( T *&  obj,
core::objectmodel::BaseContext *  context,
core::objectmodel::BaseObjectDescription *  arg 
) [inline, static]

template<class TDataTypes >
BaseMechanicalState* sofa::core::componentmodel::behavior::PairInteractionConstraint< TDataTypes >::getMechModel1 (  )  [inline, virtual]

Get the first MechanicalState.

Todo:
Rename to getMechState1()
Todo:
Replace with an accessor to a list of states, as an InteractionConstraint can be applied to more than two.

Implements sofa::core::componentmodel::behavior::InteractionConstraint.

Definition at line 74 of file PairInteractionConstraint.h.

template<class TDataTypes >
BaseMechanicalState* sofa::core::componentmodel::behavior::PairInteractionConstraint< TDataTypes >::getMechModel2 (  )  [inline, virtual]

Get the first MechanicalState.

Todo:
Rename to getMechState2()
Todo:
Replace with an accessor to a list of states, as an InteractionConstraint can be applied to more than two.

Implements sofa::core::componentmodel::behavior::InteractionConstraint.

Definition at line 77 of file PairInteractionConstraint.h.

template<class TDataTypes >
MechanicalState<DataTypes>* sofa::core::componentmodel::behavior::PairInteractionConstraint< TDataTypes >::getMState1 (  )  [inline]

Retrieve the associated MechanicalState.

Definition at line 73 of file PairInteractionConstraint.h.

template<class TDataTypes >
MechanicalState<DataTypes>* sofa::core::componentmodel::behavior::PairInteractionConstraint< TDataTypes >::getMState2 (  )  [inline]

Retrieve the associated MechanicalState.

Definition at line 76 of file PairInteractionConstraint.h.

template<class TDataTypes >
virtual std::string sofa::core::componentmodel::behavior::PairInteractionConstraint< TDataTypes >::getTemplateName (  )  const [inline, virtual]

Get the template type names (if any) used to instantiate this object.

Reimplemented from sofa::core::objectmodel::Base.

Definition at line 180 of file PairInteractionConstraint.h.

template<class DataTypes >
void sofa::core::componentmodel::behavior::PairInteractionConstraint< DataTypes >::init (  )  [inline, virtual]

template<class DataTypes >
bool sofa::core::componentmodel::behavior::PairInteractionConstraint< DataTypes >::isActive (  )  const [inline, virtual]

template<class DataTypes >
void sofa::core::componentmodel::behavior::PairInteractionConstraint< DataTypes >::projectFreePosition (  )  [inline, virtual]

template<class DataTypes >
void sofa::core::componentmodel::behavior::PairInteractionConstraint< DataTypes >::projectFreeVelocity (  )  [inline, virtual]

Project vFree to constrained space (vFree models a velocity).

This method retrieves the vFree vector from the MechanicalState and call the internal projectVelocity(VecDeriv&,VecDeriv&) method implemented by the component.

Implements sofa::core::componentmodel::behavior::BaseConstraint.

Definition at line 101 of file PairInteractionConstraint.inl.

template<class TDataTypes >
virtual void sofa::core::componentmodel::behavior::PairInteractionConstraint< TDataTypes >::projectPosition ( VecCoord &  x1,
VecCoord &  x2 
) [pure virtual]

Project x to constrained space (x models a position).

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

Implemented in sofa::component::constraint::AttachConstraint< DataTypes >.

template<class DataTypes >
void sofa::core::componentmodel::behavior::PairInteractionConstraint< DataTypes >::projectPosition (  )  [inline, virtual]

template<class TDataTypes >
virtual void sofa::core::componentmodel::behavior::PairInteractionConstraint< TDataTypes >::projectResponse ( VecDeriv &  dx1,
VecDeriv &  dx2 
) [pure 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.

Implemented in sofa::component::constraint::AttachConstraint< DataTypes >.

template<class DataTypes >
void sofa::core::componentmodel::behavior::PairInteractionConstraint< DataTypes >::projectResponse (  )  [inline, virtual]

template<class TDataTypes >
virtual void sofa::core::componentmodel::behavior::PairInteractionConstraint< TDataTypes >::projectVelocity ( VecDeriv &  v1,
VecDeriv &  v2 
) [pure virtual]

Project v to constrained space (v models a velocity).

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

Implemented in sofa::component::constraint::AttachConstraint< DataTypes >.

template<class DataTypes >
void sofa::core::componentmodel::behavior::PairInteractionConstraint< DataTypes >::projectVelocity (  )  [inline, virtual]

Project v to constrained space (v models a velocity).

This method retrieves the v vector from the MechanicalState and call the internal projectVelocity(VecDeriv&,VecDeriv&) method implemented by the component.

Implements sofa::core::componentmodel::behavior::BaseConstraint.

Definition at line 85 of file PairInteractionConstraint.inl.

template<class TDataTypes >
static std::string sofa::core::componentmodel::behavior::PairInteractionConstraint< TDataTypes >::templateName ( const PairInteractionConstraint< DataTypes > *  = NULL  )  [inline, static]


Field Documentation

template<class TDataTypes >
Data<double> sofa::core::componentmodel::behavior::PairInteractionConstraint< TDataTypes >::endTime

Time when the constraint becomes inactive (-1 for infinitely active).

Definition at line 67 of file PairInteractionConstraint.h.

template<class TDataTypes >
Data< std::string > sofa::core::componentmodel::behavior::PairInteractionConstraint< TDataTypes >::object1 [protected]

Definition at line 191 of file PairInteractionConstraint.h.

template<class TDataTypes >
Data< std::string > sofa::core::componentmodel::behavior::PairInteractionConstraint< TDataTypes >::object2 [protected]

Definition at line 192 of file PairInteractionConstraint.h.


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

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