#include <LinearMovementConstraint.h>


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 |
Definition at line 56 of file LinearMovementConstraint.h.
| typedef DataTypes::Coord sofa::component::constraint::LinearMovementConstraint< DataTypes >::Coord |
Reimplemented from sofa::core::componentmodel::behavior::Constraint< DataTypes >.
Definition at line 61 of file LinearMovementConstraint.h.
| typedef DataTypes::Deriv sofa::component::constraint::LinearMovementConstraint< DataTypes >::Deriv |
Reimplemented from sofa::core::componentmodel::behavior::Constraint< DataTypes >.
Definition at line 62 of file LinearMovementConstraint.h.
| typedef DataTypes::Real sofa::component::constraint::LinearMovementConstraint< DataTypes >::Real |
Reimplemented from sofa::core::componentmodel::behavior::Constraint< DataTypes >.
Definition at line 63 of file LinearMovementConstraint.h.
| typedef topology::PointSubset sofa::component::constraint::LinearMovementConstraint< DataTypes >::SetIndex |
Definition at line 64 of file LinearMovementConstraint.h.
| typedef helper::vector<unsigned int> sofa::component::constraint::LinearMovementConstraint< DataTypes >::SetIndexArray |
Definition at line 65 of file LinearMovementConstraint.h.
| typedef DataTypes::VecCoord sofa::component::constraint::LinearMovementConstraint< DataTypes >::VecCoord |
Reimplemented from sofa::core::componentmodel::behavior::Constraint< DataTypes >.
Definition at line 59 of file LinearMovementConstraint.h.
| typedef DataTypes::VecDeriv sofa::component::constraint::LinearMovementConstraint< DataTypes >::VecDeriv |
Reimplemented from sofa::core::componentmodel::behavior::Constraint< DataTypes >.
Definition at line 60 of file LinearMovementConstraint.h.
| sofa::component::constraint::LinearMovementConstraint< DataTypes >::LinearMovementConstraint | ( | ) | [inline] |
Definition at line 81 of file LinearMovementConstraint.inl.
References sofa::component::constraint::LinearMovementConstraint< DataTypes >::m_indices, sofa::component::constraint::LinearMovementConstraint< DataTypes >::m_keyMovements, and sofa::component::constraint::LinearMovementConstraint< DataTypes >::m_keyTimes.
| sofa::component::constraint::LinearMovementConstraint< DataTypes >::~LinearMovementConstraint | ( | ) | [inline, virtual] |
Definition at line 110 of file LinearMovementConstraint.inl.
| void sofa::component::constraint::LinearMovementConstraint< DataTypes >::addIndex | ( | unsigned int | index | ) | [inline] |
Definition at line 122 of file LinearMovementConstraint.inl.
References sofa::component::constraint::LinearMovementConstraint< DataTypes >::m_indices.
| void sofa::component::constraint::LinearMovementConstraint< DataTypes >::addKeyMovement | ( | Real | time, | |
| Deriv | movement | |||
| ) | [inline] |
add a new key movement
| 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.
| 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.
| void sofa::component::constraint::LinearMovementConstraint< DataTypes >::clearKeyMovements | ( | ) | [inline] |
Definition at line 136 of file LinearMovementConstraint.inl.
References sofa::component::constraint::LinearMovementConstraint< DataTypes >::m_keyMovements, and sofa::component::constraint::LinearMovementConstraint< DataTypes >::m_keyTimes.
| void sofa::component::constraint::LinearMovementConstraint< Rigid3fTypes >::draw | ( | ) | [inline, virtual] |
Render internal data of this object, for debugging purposes.
Reimplemented from sofa::core::objectmodel::BaseObject.
| void sofa::component::constraint::LinearMovementConstraint< Rigid3dTypes >::draw | ( | ) | [inline, virtual] |
Render internal data of this object, for debugging purposes.
Reimplemented from sofa::core::objectmodel::BaseObject.
| void sofa::component::constraint::LinearMovementConstraint< Rigid3fTypes >::draw | ( | ) | [inline, virtual] |
Render internal data of this object, for debugging purposes.
Reimplemented from sofa::core::objectmodel::BaseObject.
Definition at line 69 of file LinearMovementConstraint.cpp.
References sofa::core::objectmodel::BaseObject::getContext(), sofa::helper::gl::glVertexT(), sofa::component::constraint::LinearMovementConstraint< DataTypes >::m_indices, sofa::component::constraint::LinearMovementConstraint< DataTypes >::m_keyMovements, and sofa::component::constraint::LinearMovementConstraint< DataTypes >::x0.
| void sofa::component::constraint::LinearMovementConstraint< Rigid3dTypes >::draw | ( | ) | [inline, virtual] |
Render internal data of this object, for debugging purposes.
Reimplemented from sofa::core::objectmodel::BaseObject.
Definition at line 49 of file LinearMovementConstraint.cpp.
References sofa::core::objectmodel::BaseObject::getContext(), sofa::helper::gl::glVertexT(), sofa::component::constraint::LinearMovementConstraint< DataTypes >::m_indices, sofa::component::constraint::LinearMovementConstraint< DataTypes >::m_keyMovements, and sofa::component::constraint::LinearMovementConstraint< DataTypes >::x0.
| void sofa::component::constraint::LinearMovementConstraint< DataTypes >::draw | ( | ) | [inline, virtual] |
Render internal data of this object, for debugging purposes.
Reimplemented from sofa::core::objectmodel::BaseObject.
Definition at line 260 of file LinearMovementConstraint.inl.
References sofa::core::objectmodel::BaseObject::getContext(), sofa::helper::gl::glVertexT(), sofa::component::constraint::LinearMovementConstraint< DataTypes >::m_indices, sofa::component::constraint::LinearMovementConstraint< DataTypes >::m_keyMovements, and sofa::component::constraint::LinearMovementConstraint< DataTypes >::x0.
| void sofa::component::constraint::LinearMovementConstraint< DataTypes >::FCRemovalFunction | ( | int | pointIndex, | |
| void * | param | |||
| ) | [inline, static, protected] |
Define RemovalFunction (for topology changes).
Definition at line 71 of file LinearMovementConstraint.inl.
References sofa::component::constraint::LinearMovementConstraint< DataTypes >::removeIndex().
Referenced by sofa::component::constraint::LinearMovementConstraint< DataTypes >::init().
| 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().
| void sofa::component::constraint::LinearMovementConstraint< DataTypes >::handleTopologyChange | ( | ) | [inline, virtual] |
Handle topological changes.
Reimplemented from sofa::core::objectmodel::BaseObject.
Definition at line 100 of file LinearMovementConstraint.inl.
References sofa::core::componentmodel::topology::BaseMeshTopology::firstChange(), sofa::core::componentmodel::behavior::Constraint< DataTypes >::getMState(), sofa::core::componentmodel::topology::BaseMeshTopology::lastChange(), sofa::component::constraint::LinearMovementConstraint< DataTypes >::m_indices, and sofa::component::constraint::LinearMovementConstraint< DataTypes >::topology.
| void sofa::component::constraint::LinearMovementConstraint< DataTypes >::init | ( | void | ) | [inline, virtual] |
-- Constraint interface
Reimplemented from sofa::core::componentmodel::behavior::Constraint< DataTypes >.
Definition at line 157 of file LinearMovementConstraint.inl.
References sofa::component::constraint::LinearMovementConstraint< DataTypes >::FCRemovalFunction(), sofa::component::constraint::LinearMovementConstraint< DataTypes >::FCTestNewPointFunction(), sofa::core::objectmodel::BaseObject::getContext(), sofa::core::objectmodel::BaseContext::getMeshTopology(), sofa::component::constraint::LinearMovementConstraint< DataTypes >::m_indices, sofa::component::constraint::LinearMovementConstraint< DataTypes >::nextM, sofa::component::constraint::LinearMovementConstraint< DataTypes >::prevM, sofa::component::topology::PointSubset::setRemovalFunction(), sofa::component::topology::PointSubset::setRemovalParameter(), sofa::component::topology::PointSubset::setTestFunction(), sofa::component::topology::PointSubset::setTestParameter(), sofa::component::constraint::LinearMovementConstraint< DataTypes >::topology, and sofa::component::constraint::LinearMovementConstraint< DataTypes >::x0.
| 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.
| void sofa::component::constraint::LinearMovementConstraint< DataTypes >::projectPosition | ( | VecCoord & | x | ) | [inline, virtual] |
project x to constrained space (x models a position)
Implements sofa::core::componentmodel::behavior::Constraint< DataTypes >.
Definition at line 231 of file LinearMovementConstraint.inl.
References sofa::core::objectmodel::BaseObject::getContext(), sofa::core::objectmodel::BaseContext::getTime(), sofa::component::constraint::LinearMovementConstraint< DataTypes >::m_indices, sofa::component::constraint::LinearMovementConstraint< DataTypes >::m_keyTimes, sofa::component::constraint::LinearMovementConstraint< DataTypes >::nextM, sofa::component::constraint::LinearMovementConstraint< DataTypes >::nextT, sofa::component::constraint::LinearMovementConstraint< DataTypes >::prevM, sofa::component::constraint::LinearMovementConstraint< DataTypes >::prevT, and sofa::component::constraint::LinearMovementConstraint< DataTypes >::x0.
| 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.
| void sofa::component::constraint::LinearMovementConstraint< DataTypes >::projectVelocity | ( | VecDeriv & | dx | ) | [inline, virtual] |
project dx to constrained space (dx models a velocity)
Implements sofa::core::componentmodel::behavior::Constraint< DataTypes >.
Definition at line 185 of file LinearMovementConstraint.inl.
References sofa::core::objectmodel::BaseObject::getContext(), sofa::core::objectmodel::BaseContext::getDt(), sofa::core::objectmodel::BaseContext::getTime(), sofa::component::constraint::LinearMovementConstraint< DataTypes >::m_indices, sofa::component::constraint::LinearMovementConstraint< DataTypes >::m_keyMovements, sofa::component::constraint::LinearMovementConstraint< DataTypes >::m_keyTimes, sofa::component::constraint::LinearMovementConstraint< DataTypes >::nextM, sofa::component::constraint::LinearMovementConstraint< DataTypes >::nextT, sofa::component::constraint::LinearMovementConstraint< DataTypes >::prevM, and sofa::component::constraint::LinearMovementConstraint< DataTypes >::prevT.
| void sofa::component::constraint::LinearMovementConstraint< DataTypes >::removeIndex | ( | unsigned int | index | ) | [inline] |
Definition at line 129 of file LinearMovementConstraint.inl.
References sofa::component::constraint::LinearMovementConstraint< DataTypes >::m_indices, and sofa::helper::removeValue().
Referenced by sofa::component::constraint::LinearMovementConstraint< DataTypes >::FCRemovalFunction().
| Data<SetIndex> sofa::component::constraint::LinearMovementConstraint< DataTypes >::m_indices |
indices of the DOFs the constraint is applied to
Definition at line 69 of file LinearMovementConstraint.h.
Referenced by sofa::component::constraint::LinearMovementConstraint< DataTypes >::addIndex(), sofa::component::constraint::LinearMovementConstraint< DataTypes >::clearIndices(), sofa::component::constraint::LinearMovementConstraint< DataTypes >::draw(), sofa::component::constraint::LinearMovementConstraint< DataTypes >::handleTopologyChange(), sofa::component::constraint::LinearMovementConstraint< DataTypes >::init(), sofa::component::constraint::LinearMovementConstraint< DataTypes >::LinearMovementConstraint(), sofa::component::constraint::LinearMovementConstraint< DataTypes >::projectPosition(), sofa::component::constraint::LinearMovementConstraint< DataTypes >::projectVelocity(), and sofa::component::constraint::LinearMovementConstraint< DataTypes >::removeIndex().
| Data<VecDeriv > sofa::component::constraint::LinearMovementConstraint< DataTypes >::m_keyMovements |
the motions corresponding to the key frames
Definition at line 73 of file LinearMovementConstraint.h.
Referenced by sofa::component::constraint::LinearMovementConstraint< DataTypes >::addKeyMovement(), sofa::component::constraint::LinearMovementConstraint< DataTypes >::clearKeyMovements(), sofa::component::constraint::LinearMovementConstraint< DataTypes >::draw(), sofa::component::constraint::LinearMovementConstraint< DataTypes >::LinearMovementConstraint(), and sofa::component::constraint::LinearMovementConstraint< DataTypes >::projectVelocity().
| Data<helper::vector<Real> > sofa::component::constraint::LinearMovementConstraint< DataTypes >::m_keyTimes |
the key frames when the motion is defined by the user
Definition at line 71 of file LinearMovementConstraint.h.
Referenced by sofa::component::constraint::LinearMovementConstraint< DataTypes >::addKeyMovement(), sofa::component::constraint::LinearMovementConstraint< DataTypes >::clearKeyMovements(), sofa::component::constraint::LinearMovementConstraint< DataTypes >::LinearMovementConstraint(), sofa::component::constraint::LinearMovementConstraint< DataTypes >::projectPosition(), and sofa::component::constraint::LinearMovementConstraint< DataTypes >::projectVelocity().
| Deriv sofa::component::constraint::LinearMovementConstraint< DataTypes >::nextM |
Definition at line 78 of file LinearMovementConstraint.h.
Referenced by sofa::component::constraint::LinearMovementConstraint< DataTypes >::init(), sofa::component::constraint::LinearMovementConstraint< DataTypes >::projectPosition(), and sofa::component::constraint::LinearMovementConstraint< DataTypes >::projectVelocity().
| Real sofa::component::constraint::LinearMovementConstraint< DataTypes >::nextT |
Definition at line 76 of file LinearMovementConstraint.h.
Referenced by sofa::component::constraint::LinearMovementConstraint< DataTypes >::projectPosition(), and sofa::component::constraint::LinearMovementConstraint< DataTypes >::projectVelocity().
| Deriv sofa::component::constraint::LinearMovementConstraint< DataTypes >::prevM |
the motions corresponding to the surrouding key times
Definition at line 78 of file LinearMovementConstraint.h.
Referenced by sofa::component::constraint::LinearMovementConstraint< DataTypes >::init(), sofa::component::constraint::LinearMovementConstraint< DataTypes >::projectPosition(), and sofa::component::constraint::LinearMovementConstraint< DataTypes >::projectVelocity().
| Real sofa::component::constraint::LinearMovementConstraint< DataTypes >::prevT |
the key times surrounding the current simulation time (for interpolation)
Definition at line 76 of file LinearMovementConstraint.h.
Referenced by sofa::component::constraint::LinearMovementConstraint< DataTypes >::projectPosition(), and sofa::component::constraint::LinearMovementConstraint< DataTypes >::projectVelocity().
sofa::core::componentmodel::topology::BaseMeshTopology* sofa::component::constraint::LinearMovementConstraint< DataTypes >::topology [protected] |
Definition at line 115 of file LinearMovementConstraint.h.
Referenced by sofa::component::constraint::LinearMovementConstraint< DataTypes >::handleTopologyChange(), and sofa::component::constraint::LinearMovementConstraint< DataTypes >::init().
| VecCoord sofa::component::constraint::LinearMovementConstraint< DataTypes >::x0 |
initial constrained DOFs position
Definition at line 80 of file LinearMovementConstraint.h.
Referenced by sofa::component::constraint::LinearMovementConstraint< DataTypes >::draw(), sofa::component::constraint::LinearMovementConstraint< DataTypes >::init(), and sofa::component::constraint::LinearMovementConstraint< DataTypes >::projectPosition().
1.5.7.1