#include <Mapping.h>


Public Types | |
| typedef TIn | In |
| Input Model Type. | |
| typedef TOut | Out |
| Output Model Type. | |
Public Member Functions | |
| Mapping (In *from=NULL, Out *to=NULL) | |
| Constructor, taking input and output models as parameters. | |
| virtual | ~Mapping () |
| Destructor. | |
| virtual void | setModels (In *from, Out *to) |
| Specify the input and output models. | |
| In * | getFromModel () |
| Return the pointer to the input model. | |
| Out * | getToModel () |
| Return the pointer to the output model. | |
| objectmodel::BaseObject * | getFrom () |
| Return the pointer to the input model. | |
| objectmodel::BaseObject * | getTo () |
| Return the pointer to the output model. | |
| virtual void | apply (typename Out::VecCoord &out, const typename In::VecCoord &in)=0 |
| Apply the mapping on position vectors. | |
| virtual void | applyJ (typename Out::VecDeriv &out, const typename In::VecDeriv &in)=0 |
| Apply the mapping on derived (velocity, displacement) vectors. | |
| virtual void | init () |
| Initialization method called at graph modification, during bottom-up traversal. | |
| virtual void | updateMapping () |
| Apply the mapping to position and velocity vectors. | |
| virtual void | disable () |
| Disable the mapping to get the original coordinates of the mapped model. | |
| virtual std::string | getTemplateName () const |
| Get the template type names (if any) used to instantiate this object. | |
Static Public Member Functions | |
| template<class T > | |
| static bool | canCreate (T *&obj, core::objectmodel::BaseContext *context, core::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 Mapping< TIn, TOut > *=NULL) |
Protected Member Functions | |
| bool | getShow () const |
| If true, display the mapping. | |
Protected Attributes | |
| In * | fromModel |
| Input Model. | |
| Out * | toModel |
| Output Model. | |
| Data< std::string > | object1 |
| Name of the Input Model. | |
| Data< std::string > | object2 |
| Name of the Output Model. | |
This Interface is used for the Mappings. A Mapping can convert one model to an other. For example, we can have a mapping from a BehaviorModel to a VisualModel.
Definition at line 47 of file Mapping.h.
| typedef TIn sofa::core::Mapping< TIn, TOut >::In |
| typedef TOut sofa::core::Mapping< TIn, TOut >::Out |
| sofa::core::Mapping< In, Out >::Mapping | ( | In * | from = NULL, |
|
| Out * | to = NULL | |||
| ) | [inline] |
Constructor, taking input and output models as parameters.
Note that if you do not specify these models here, you must called setModels with non-NULL value before the intialization (i.e. before init() is called).
Definition at line 42 of file Mapping.inl.
| sofa::core::Mapping< In, Out >::~Mapping | ( | ) | [inline, virtual] |
| virtual void sofa::core::Mapping< TIn, TOut >::apply | ( | typename Out::VecCoord & | out, | |
| const typename In::VecCoord & | in | |||
| ) | [pure virtual] |
Apply the mapping on position vectors.
If the Mapping can be represented as a matrix J, this method computes $ out = J in $
This method must be reimplemented by all mappings.
Referenced by sofa::core::componentmodel::behavior::MechanicalMapping< In, Out >::propagateX(), sofa::core::componentmodel::behavior::MechanicalMapping< In, Out >::propagateXfree(), and sofa::core::Mapping< TIn, TOut >::updateMapping().
| virtual void sofa::core::Mapping< TIn, TOut >::applyJ | ( | typename Out::VecDeriv & | out, | |
| const typename In::VecDeriv & | in | |||
| ) | [pure virtual] |
Apply the mapping on derived (velocity, displacement) vectors.
If the Mapping can be represented as a matrix J, this method computes $ out = J in $
This method must be reimplemented by all mappings.
Referenced by sofa::core::componentmodel::behavior::MechanicalMapping< In, Out >::propagateDx(), sofa::core::componentmodel::behavior::MechanicalMapping< In, Out >::propagateV(), and sofa::core::Mapping< TIn, TOut >::updateMapping().
| static bool sofa::core::Mapping< TIn, TOut >::canCreate | ( | T *& | obj, | |
| core::objectmodel::BaseContext * | context, | |||
| core::objectmodel::BaseObjectDescription * | arg | |||
| ) | [inline, static] |
Pre-construction check method called by ObjectFactory.
This implementation read the object1 and object2 attributes and check if they are compatible with the input and output model types of this mapping.
Reimplemented from sofa::core::objectmodel::BaseObject.
Definition at line 122 of file Mapping.h.
Referenced by sofa::core::Mapping< BaseMeshTopology, BaseMeshTopology >::canCreate().
| static void sofa::core::Mapping< TIn, TOut >::create | ( | T *& | obj, | |
| core::objectmodel::BaseContext * | context, | |||
| core::objectmodel::BaseObjectDescription * | arg | |||
| ) | [inline, static] |
Construction method called by ObjectFactory.
This implementation read the object1 and object2 attributes to find the input and output models of this mapping.
Reimplemented from sofa::core::objectmodel::BaseObject.
| void sofa::core::Mapping< In, Out >::disable | ( | ) | [inline, virtual] |
Disable the mapping to get the original coordinates of the mapped model.
It is for instance used in RigidMapping to get the local coordinates of the object.
Implements sofa::core::BaseMapping.
Definition at line 85 of file Mapping.inl.
| objectmodel::BaseObject * sofa::core::Mapping< In, Out >::getFrom | ( | ) | [inline, virtual] |
Return the pointer to the input model.
Implements sofa::core::BaseMapping.
Definition at line 67 of file Mapping.inl.
References sofa::core::Mapping< TIn, TOut >::fromModel.
Referenced by sofa::component::mapping::SPHFluidSurfaceMapping< In, Out >::init().
| In * sofa::core::Mapping< In, Out >::getFromModel | ( | ) | [inline] |
Return the pointer to the input model.
Definition at line 55 of file Mapping.inl.
References sofa::core::Mapping< TIn, TOut >::fromModel.
| bool sofa::core::Mapping< TIn, TOut >::getShow | ( | ) | const [inline, protected] |
If true, display the mapping.
Reimplemented in sofa::core::componentmodel::behavior::MechanicalMapping< In, Out >.
| virtual std::string sofa::core::Mapping< TIn, TOut >::getTemplateName | ( | ) | const [inline, virtual] |
Get the template type names (if any) used to instantiate this object.
Reimplemented from sofa::core::objectmodel::Base.
| objectmodel::BaseObject * sofa::core::Mapping< In, Out >::getTo | ( | ) | [inline, virtual] |
Return the pointer to the output model.
Implements sofa::core::BaseMapping.
Definition at line 73 of file Mapping.inl.
References sofa::core::Mapping< TIn, TOut >::toModel.
| Out * sofa::core::Mapping< In, Out >::getToModel | ( | ) | [inline] |
Return the pointer to the output model.
Definition at line 61 of file Mapping.inl.
References sofa::core::Mapping< TIn, TOut >::toModel.
| void sofa::core::Mapping< In, Out >::init | ( | ) | [inline, virtual] |
Initialization method called at graph modification, during bottom-up traversal.
Reimplemented from sofa::core::objectmodel::BaseObject.
Reimplemented in sofa::core::componentmodel::behavior::MechanicalMapping< In, Out >, sofa::component::mapping::ImplicitSurfaceMapping< In, Out >, and sofa::component::mapping::SPHFluidSurfaceMapping< In, Out >.
Definition at line 79 of file Mapping.inl.
References sofa::core::Mapping< TIn, TOut >::updateMapping().
Referenced by sofa::component::mapping::SPHFluidSurfaceMapping< In, Out >::init().
| void sofa::core::Mapping< In, Out >::setModels | ( | In * | from, | |
| Out * | to | |||
| ) | [inline, virtual] |
Specify the input and output models.
Definition at line 90 of file Mapping.inl.
References sofa::core::Mapping< TIn, TOut >::fromModel, and sofa::core::Mapping< TIn, TOut >::toModel.
| static std::string sofa::core::Mapping< TIn, TOut >::templateName | ( | const Mapping< TIn, TOut > * | = NULL |
) | [inline, static] |
Definition at line 165 of file Mapping.h.
Referenced by sofa::core::Mapping< BaseMeshTopology, BaseMeshTopology >::getTemplateName().
| void sofa::core::Mapping< In, Out >::updateMapping | ( | ) | [inline, virtual] |
Apply the mapping to position and velocity vectors.
This method call the internal apply(Out::VecCoord&,const In::VecCoord&) and applyJ(Out::VecDeriv&,const In::VecDeriv&) methods.
Implements sofa::core::BaseMapping.
Definition at line 96 of file Mapping.inl.
References sofa::core::Mapping< TIn, TOut >::apply(), sofa::core::Mapping< TIn, TOut >::applyJ(), sofa::core::Mapping< TIn, TOut >::fromModel, and sofa::core::Mapping< TIn, TOut >::toModel.
Referenced by sofa::core::Mapping< TIn, TOut >::init(), and sofa::core::componentmodel::behavior::MechanicalMapping< In, Out >::init().
In* sofa::core::Mapping< TIn, TOut >::fromModel [protected] |
Input Model.
Definition at line 57 of file Mapping.h.
Referenced by sofa::core::componentmodel::behavior::MechanicalMapping< In, Out >::accumulateConstraint(), sofa::core::componentmodel::behavior::MechanicalMapping< In, Out >::accumulateDf(), sofa::core::componentmodel::behavior::MechanicalMapping< In, Out >::accumulateForce(), sofa::core::Mapping< TIn, TOut >::getFrom(), sofa::core::Mapping< TIn, TOut >::getFromModel(), sofa::core::componentmodel::behavior::MechanicalMapping< In, Out >::getMechFrom(), sofa::core::componentmodel::behavior::MechanicalMapping< In, Out >::propagateDx(), sofa::core::componentmodel::behavior::MechanicalMapping< In, Out >::propagateV(), sofa::core::componentmodel::behavior::MechanicalMapping< In, Out >::propagateX(), sofa::core::componentmodel::behavior::MechanicalMapping< In, Out >::propagateXfree(), sofa::core::Mapping< TIn, TOut >::setModels(), and sofa::core::Mapping< TIn, TOut >::updateMapping().
Data< std::string > sofa::core::Mapping< TIn, TOut >::object1 [protected] |
Data< std::string > sofa::core::Mapping< TIn, TOut >::object2 [protected] |
Out* sofa::core::Mapping< TIn, TOut >::toModel [protected] |
Output Model.
Definition at line 59 of file Mapping.h.
Referenced by sofa::core::componentmodel::behavior::MechanicalMapping< In, Out >::accumulateConstraint(), sofa::core::componentmodel::behavior::MechanicalMapping< In, Out >::accumulateDf(), sofa::core::componentmodel::behavior::MechanicalMapping< In, Out >::accumulateForce(), sofa::component::mapping::SPHFluidSurfaceMapping< In, Out >::draw(), sofa::core::componentmodel::behavior::MechanicalMapping< In, Out >::getMechTo(), sofa::core::Mapping< TIn, TOut >::getTo(), sofa::core::Mapping< TIn, TOut >::getToModel(), sofa::core::componentmodel::behavior::MechanicalMapping< In, Out >::propagateDx(), sofa::core::componentmodel::behavior::MechanicalMapping< In, Out >::propagateV(), sofa::core::componentmodel::behavior::MechanicalMapping< In, Out >::propagateX(), sofa::core::componentmodel::behavior::MechanicalMapping< In, Out >::propagateXfree(), sofa::core::Mapping< TIn, TOut >::setModels(), and sofa::core::Mapping< TIn, TOut >::updateMapping().
1.5.7.1