sofa::core::componentmodel::behavior::MixedInteractionConstraint< TDataTypes1, TDataTypes2 > Class Template Reference

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

#include <MixedInteractionConstraint.h>

Inheritance diagram for sofa::core::componentmodel::behavior::MixedInteractionConstraint< TDataTypes1, TDataTypes2 >:

Inheritance graph
[legend]
Collaboration diagram for sofa::core::componentmodel::behavior::MixedInteractionConstraint< TDataTypes1, TDataTypes2 >:

Collaboration graph
[legend]

Public Types

typedef TDataTypes1 DataTypes1
typedef DataTypes1::VecCoord VecCoord1
typedef DataTypes1::VecDeriv VecDeriv1
typedef DataTypes1::VecConst VecConst1
typedef DataTypes1::Coord Coord1
typedef DataTypes1::Deriv Deriv1
typedef TDataTypes2 DataTypes2
typedef DataTypes2::VecCoord VecCoord2
typedef DataTypes2::VecDeriv VecDeriv2
typedef DataTypes2::VecConst VecConst2
typedef DataTypes2::Coord Coord2
typedef DataTypes2::Deriv Deriv2

Public Member Functions

 MixedInteractionConstraint (MechanicalState< DataTypes1 > *mm1=NULL, MechanicalState< DataTypes2 > *mm2=NULL)
virtual ~MixedInteractionConstraint ()
virtual bool isActive () const
 if false, the constraint does nothing
virtual void init ()
 Initialization method called at graph modification, during bottom-up traversal.
MechanicalState< DataTypes1 > * getMState1 ()
 Retrieve the associated MechanicalState.
BaseMechanicalState * getMechModel1 ()
 Get the first MechanicalState.
MechanicalState< DataTypes2 > * getMState2 ()
 Retrieve the associated MechanicalState.
BaseMechanicalState * getMechModel2 ()
 Get the first MechanicalState.
virtual void applyConstraint (unsigned int &contactId)
virtual void applyConstraint (VecConst1 &, VecConst2 &, 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 (VecDeriv1 &dx1, VecDeriv2 &dx2)=0
 Project dx to constrained space (dx models an acceleration).
virtual void projectVelocity (VecDeriv1 &v1, VecDeriv2 &v2)=0
 Project v to constrained space (v models a velocity).
virtual void projectPosition (VecCoord1 &x1, VecCoord2 &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 MixedInteractionConstraint< DataTypes1, DataTypes2 > *=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< DataTypes1 > * mstate1
MechanicalState< DataTypes2 > * mstate2

Detailed Description

template<class TDataTypes1, class TDataTypes2>
class sofa::core::componentmodel::behavior::MixedInteractionConstraint< TDataTypes1, TDataTypes2 >

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 MixedInteractionConstraint.h.


Member Typedef Documentation

template<class TDataTypes1 , class TDataTypes2 >
typedef DataTypes1::Coord sofa::core::componentmodel::behavior::MixedInteractionConstraint< TDataTypes1, TDataTypes2 >::Coord1

Definition at line 59 of file MixedInteractionConstraint.h.

template<class TDataTypes1 , class TDataTypes2 >
typedef DataTypes2::Coord sofa::core::componentmodel::behavior::MixedInteractionConstraint< TDataTypes1, TDataTypes2 >::Coord2

Definition at line 65 of file MixedInteractionConstraint.h.

template<class TDataTypes1 , class TDataTypes2 >
typedef TDataTypes1 sofa::core::componentmodel::behavior::MixedInteractionConstraint< TDataTypes1, TDataTypes2 >::DataTypes1

Definition at line 55 of file MixedInteractionConstraint.h.

template<class TDataTypes1 , class TDataTypes2 >
typedef TDataTypes2 sofa::core::componentmodel::behavior::MixedInteractionConstraint< TDataTypes1, TDataTypes2 >::DataTypes2

Definition at line 61 of file MixedInteractionConstraint.h.

template<class TDataTypes1 , class TDataTypes2 >
typedef DataTypes1::Deriv sofa::core::componentmodel::behavior::MixedInteractionConstraint< TDataTypes1, TDataTypes2 >::Deriv1

Definition at line 60 of file MixedInteractionConstraint.h.

template<class TDataTypes1 , class TDataTypes2 >
typedef DataTypes2::Deriv sofa::core::componentmodel::behavior::MixedInteractionConstraint< TDataTypes1, TDataTypes2 >::Deriv2

Definition at line 66 of file MixedInteractionConstraint.h.

template<class TDataTypes1 , class TDataTypes2 >
typedef DataTypes1::VecConst sofa::core::componentmodel::behavior::MixedInteractionConstraint< TDataTypes1, TDataTypes2 >::VecConst1

Definition at line 58 of file MixedInteractionConstraint.h.

template<class TDataTypes1 , class TDataTypes2 >
typedef DataTypes2::VecConst sofa::core::componentmodel::behavior::MixedInteractionConstraint< TDataTypes1, TDataTypes2 >::VecConst2

Definition at line 64 of file MixedInteractionConstraint.h.

template<class TDataTypes1 , class TDataTypes2 >
typedef DataTypes1::VecCoord sofa::core::componentmodel::behavior::MixedInteractionConstraint< TDataTypes1, TDataTypes2 >::VecCoord1

Definition at line 56 of file MixedInteractionConstraint.h.

template<class TDataTypes1 , class TDataTypes2 >
typedef DataTypes2::VecCoord sofa::core::componentmodel::behavior::MixedInteractionConstraint< TDataTypes1, TDataTypes2 >::VecCoord2

Definition at line 62 of file MixedInteractionConstraint.h.

template<class TDataTypes1 , class TDataTypes2 >
typedef DataTypes1::VecDeriv sofa::core::componentmodel::behavior::MixedInteractionConstraint< TDataTypes1, TDataTypes2 >::VecDeriv1

Definition at line 57 of file MixedInteractionConstraint.h.

template<class TDataTypes1 , class TDataTypes2 >
typedef DataTypes2::VecDeriv sofa::core::componentmodel::behavior::MixedInteractionConstraint< TDataTypes1, TDataTypes2 >::VecDeriv2

Definition at line 63 of file MixedInteractionConstraint.h.


Constructor & Destructor Documentation

template<class DataTypes1 , class DataTypes2 >
sofa::core::componentmodel::behavior::MixedInteractionConstraint< DataTypes1, DataTypes2 >::MixedInteractionConstraint ( MechanicalState< DataTypes1 > *  mm1 = NULL,
MechanicalState< DataTypes2 > *  mm2 = NULL 
) [inline]

Definition at line 46 of file MixedInteractionConstraint.inl.

template<class DataTypes1 , class DataTypes2 >
sofa::core::componentmodel::behavior::MixedInteractionConstraint< DataTypes1, DataTypes2 >::~MixedInteractionConstraint (  )  [inline, virtual]

Definition at line 55 of file MixedInteractionConstraint.inl.


Member Function Documentation

template<class TDataTypes1 , class TDataTypes2 >
virtual void sofa::core::componentmodel::behavior::MixedInteractionConstraint< TDataTypes1, TDataTypes2 >::applyConstraint ( VecConst1 &  ,
VecConst2 &  ,
unsigned int &   
) [inline, virtual]

Definition at line 145 of file MixedInteractionConstraint.h.

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

template<class TDataTypes1 , class TDataTypes2 >
template<class T >
static bool sofa::core::componentmodel::behavior::MixedInteractionConstraint< TDataTypes1, TDataTypes2 >::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 150 of file MixedInteractionConstraint.h.

References sofa::core::objectmodel::BaseObjectDescription::findObject(), and sofa::core::objectmodel::BaseObjectDescription::getAttribute().

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

template<class TDataTypes1 , class TDataTypes2 >
BaseMechanicalState* sofa::core::componentmodel::behavior::MixedInteractionConstraint< TDataTypes1, TDataTypes2 >::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 79 of file MixedInteractionConstraint.h.

References sofa::core::componentmodel::behavior::MixedInteractionConstraint< TDataTypes1, TDataTypes2 >::mstate1.

template<class TDataTypes1 , class TDataTypes2 >
BaseMechanicalState* sofa::core::componentmodel::behavior::MixedInteractionConstraint< TDataTypes1, TDataTypes2 >::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 82 of file MixedInteractionConstraint.h.

References sofa::core::componentmodel::behavior::MixedInteractionConstraint< TDataTypes1, TDataTypes2 >::mstate2.

template<class TDataTypes1 , class TDataTypes2 >
MechanicalState<DataTypes1>* sofa::core::componentmodel::behavior::MixedInteractionConstraint< TDataTypes1, TDataTypes2 >::getMState1 (  )  [inline]

template<class TDataTypes1 , class TDataTypes2 >
MechanicalState<DataTypes2>* sofa::core::componentmodel::behavior::MixedInteractionConstraint< TDataTypes1, TDataTypes2 >::getMState2 (  )  [inline]

template<class TDataTypes1 , class TDataTypes2 >
virtual std::string sofa::core::componentmodel::behavior::MixedInteractionConstraint< TDataTypes1, TDataTypes2 >::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 174 of file MixedInteractionConstraint.h.

References sofa::core::componentmodel::behavior::MixedInteractionConstraint< TDataTypes1, TDataTypes2 >::templateName().

template<class DataTypes1 , class DataTypes2 >
void sofa::core::componentmodel::behavior::MixedInteractionConstraint< DataTypes1, DataTypes2 >::init (  )  [inline, virtual]

Initialization method called at graph modification, during bottom-up traversal.

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

Definition at line 60 of file MixedInteractionConstraint.inl.

template<class DataTypes1 , class DataTypes2 >
bool sofa::core::componentmodel::behavior::MixedInteractionConstraint< DataTypes1, DataTypes2 >::isActive (  )  const [inline, virtual]

template<class DataTypes1 , class DataTypes2 >
void sofa::core::componentmodel::behavior::MixedInteractionConstraint< DataTypes1, DataTypes2 >::projectFreePosition (  )  [inline, virtual]

template<class DataTypes1 , class DataTypes2 >
void sofa::core::componentmodel::behavior::MixedInteractionConstraint< DataTypes1, DataTypes2 >::projectFreeVelocity (  )  [inline, virtual]

template<class TDataTypes1 , class TDataTypes2 >
virtual void sofa::core::componentmodel::behavior::MixedInteractionConstraint< TDataTypes1, TDataTypes2 >::projectPosition ( VecCoord1 &  x1,
VecCoord2 &  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.

template<class DataTypes1 , class DataTypes2 >
void sofa::core::componentmodel::behavior::MixedInteractionConstraint< DataTypes1, DataTypes2 >::projectPosition (  )  [inline, virtual]

template<class TDataTypes1 , class TDataTypes2 >
virtual void sofa::core::componentmodel::behavior::MixedInteractionConstraint< TDataTypes1, TDataTypes2 >::projectResponse ( VecDeriv1 &  dx1,
VecDeriv2 &  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.

template<class DataTypes1 , class DataTypes2 >
void sofa::core::componentmodel::behavior::MixedInteractionConstraint< DataTypes1, DataTypes2 >::projectResponse (  )  [inline, virtual]

template<class TDataTypes1 , class TDataTypes2 >
virtual void sofa::core::componentmodel::behavior::MixedInteractionConstraint< TDataTypes1, TDataTypes2 >::projectVelocity ( VecDeriv1 &  v1,
VecDeriv2 &  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.

template<class DataTypes1 , class DataTypes2 >
void sofa::core::componentmodel::behavior::MixedInteractionConstraint< DataTypes1, DataTypes2 >::projectVelocity (  )  [inline, virtual]

template<class TDataTypes1 , class TDataTypes2 >
static std::string sofa::core::componentmodel::behavior::MixedInteractionConstraint< TDataTypes1, TDataTypes2 >::templateName ( const MixedInteractionConstraint< DataTypes1, DataTypes2 > *  = NULL  )  [inline, static]


Field Documentation

template<class TDataTypes1 , class TDataTypes2 >
Data<double> sofa::core::componentmodel::behavior::MixedInteractionConstraint< TDataTypes1, TDataTypes2 >::endTime

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

Definition at line 72 of file MixedInteractionConstraint.h.

Referenced by sofa::core::componentmodel::behavior::MixedInteractionConstraint< TDataTypes1, TDataTypes2 >::isActive().

template<class TDataTypes1 , class TDataTypes2 >
MechanicalState<DataTypes1>* sofa::core::componentmodel::behavior::MixedInteractionConstraint< TDataTypes1, TDataTypes2 >::mstate1 [protected]

template<class TDataTypes1 , class TDataTypes2 >
MechanicalState<DataTypes2>* sofa::core::componentmodel::behavior::MixedInteractionConstraint< TDataTypes1, TDataTypes2 >::mstate2 [protected]

template<class TDataTypes1 , class TDataTypes2 >
Data< std::string > sofa::core::componentmodel::behavior::MixedInteractionConstraint< TDataTypes1, TDataTypes2 >::object1 [protected]

Definition at line 185 of file MixedInteractionConstraint.h.

template<class TDataTypes1 , class TDataTypes2 >
Data< std::string > sofa::core::componentmodel::behavior::MixedInteractionConstraint< TDataTypes1, TDataTypes2 >::object2 [protected]

Definition at line 186 of file MixedInteractionConstraint.h.


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

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