#include <EdgeSubsetData.h>


Public Types | |
| typedef std::map< unsigned int, T >::size_type | size_type |
| size_type | |
| typedef std::map< unsigned int, T >::reference | reference |
| reference to a value (read-write) | |
| typedef std::map< unsigned int, T >::const_reference | const_reference |
| const reference to a value (read only) | |
Public Member Functions | |
| EdgeSubsetData (size_type n, const T &value) | |
| Constructor. | |
| EdgeSubsetData (int n, const T &value) | |
| Constructor. | |
| EdgeSubsetData (long n, const T &value) | |
| Constructor. | |
| EdgeSubsetData (size_type n) | |
| Constructor. | |
| EdgeSubsetData (const std::map< unsigned int, T > &x) | |
| Constructor. | |
| EdgeSubsetData (typename EdgeSubsetData< T >::const_iterator first, typename EdgeSubsetData< T >::const_iterator last) | |
| Constructor. | |
| EdgeSubsetData (void(*createFunc)(unsigned int, void *, T &, const Edge &, const std::vector< unsigned int > &, const std::vector< double > &)=ed_basicCreateFunc, void *createParam=(void *) NULL, void(*destroyFunc)(unsigned int, void *, T &)=ed_basicDestroyFunc, void *destroyParam=(void *) NULL) | |
| Optionnaly takes 2 parameters, a creation and a destruction function that will be called when adding/deleting elements. | |
| void | handleTopologyEvents (std::list< const core::componentmodel::topology::TopologyChange * >::const_iterator changeIt, std::list< const core::componentmodel::topology::TopologyChange * >::const_iterator &end, const unsigned int totalEdgeSetArraySize) |
| Handle EdgeSetTopology related events, ignore others. | |
| void | setCreateFunction (void(*createFunc)(unsigned int, void *, T &, const Edge &, const std::vector< unsigned int > &, const std::vector< double > &)) |
| void | setDestroyFunction (void(*destroyFunc)(unsigned int, void *, T &)) |
| void | setDestroyParameter (void *destroyParam) |
| void | setCreateParameter (void *createParam) |
| void | setCreateTriangleFunction (void(*createTriangleFunc)(const std::vector< unsigned int > &, void *, std::map< unsigned int, T > &)) |
| void | setDestroyTriangleFunction (void(*destroyTriangleFunc)(const std::vector< unsigned int > &, void *, std::map< unsigned int, T > &)) |
| void | setCreateQuadFunction (void(*createQuadFunc)(const std::vector< unsigned int > &, void *, std::map< unsigned int, T > &)) |
| void | setDestroyQuadFunction (void(*destroyQuadFunc)(const std::vector< unsigned int > &, void *, std::map< unsigned int, T > &)) |
| void | setCreateTetrahedronFunction (void(*createTetrahedronFunc)(const std::vector< unsigned int > &, void *, std::map< unsigned int, T > &)) |
| void | setDestroyTetrahedronFunction (void(*destroyTetrahedronFunc)(const std::vector< unsigned int > &, void *, std::map< unsigned int, T > &)) |
Private Member Functions | |
| void | add (unsigned int nbEdges, const sofa::helper::vector< Edge > &edge, const sofa::helper::vector< sofa::helper::vector< unsigned int > > &ancestors, const sofa::helper::vector< sofa::helper::vector< double > > &coefs) |
| Add some values. Values are added at the end of the vector. | |
| void | remove (const std::vector< unsigned int > &index) |
| Remove the values corresponding to the Edges removed. | |
| void | setTotalEdgeSetArraySize (const unsigned int s) |
Private Attributes | |
| void(* | m_createFunc )(unsigned int, void *, T &, const Edge &, const std::vector< unsigned int > &, const std::vector< double > &) |
| Creation function, called when adding elements. | |
| void(* | m_destroyFunc )(unsigned int, void *, T &) |
| Destruction function, called when deleting elements. | |
| void(* | m_createTriangleFunc )(const std::vector< unsigned int > &, void *, std::map< unsigned int, T > &) |
| Creation function, called when adding triangles elements. | |
| void(* | m_destroyTriangleFunc )(const std::vector< unsigned int > &, void *, std::map< unsigned int, T > &) |
| Destruction function, called when removing triangles elements. | |
| void(* | m_createQuadFunc )(const std::vector< unsigned int > &, void *, std::map< unsigned int, T > &) |
| Creation function, called when adding quads elements. | |
| void(* | m_destroyQuadFunc )(const std::vector< unsigned int > &, void *, std::map< unsigned int, T > &) |
| Destruction function, called when removing quads elements. | |
| void(* | m_createTetrahedronFunc )(const std::vector< unsigned int > &, void *, std::map< unsigned int, T > &) |
| Creation function, called when adding tetrahedra elements. | |
| void(* | m_destroyTetrahedronFunc )(const std::vector< unsigned int > &, void *, std::map< unsigned int, T > &) |
| Destruction function, called when removing tetrahedra elements. | |
| void * | m_createParam |
| Parameter to be passed to creation function. | |
| void * | m_destroyParam |
| Parameter to be passed to destruction function. | |
| unsigned int | lastEdgeIndex |
| to handle properly the removal of items, the container must know the index of the last element | |
Automatically manages topology changes.
This class is a wrapper of class helper::vector that is made to take care transparently of all topology changes that might happen (non exhaustive list: Edges added, removed, fused, renumbered).
Definition at line 71 of file EdgeSubsetData.h.
| typedef std::map<unsigned int,T>::const_reference sofa::component::topology::EdgeSubsetData< T >::const_reference |
| sofa::component::topology::EdgeSubsetData< T >::EdgeSubsetData | ( | size_type | n, | |
| const T & | value | |||
| ) | [inline] |
| sofa::component::topology::EdgeSubsetData< T >::EdgeSubsetData | ( | int | n, | |
| const T & | value | |||
| ) | [inline] |
| sofa::component::topology::EdgeSubsetData< T >::EdgeSubsetData | ( | long | n, | |
| const T & | value | |||
| ) | [inline] |
| sofa::component::topology::EdgeSubsetData< T >::EdgeSubsetData | ( | size_type | n | ) | [inline, explicit] |
| sofa::component::topology::EdgeSubsetData< T >::EdgeSubsetData | ( | const std::map< unsigned int, T > & | x | ) | [inline] |
| sofa::component::topology::EdgeSubsetData< T >::EdgeSubsetData | ( | typename EdgeSubsetData< T >::const_iterator | first, | |
| typename EdgeSubsetData< T >::const_iterator | last | |||
| ) | [inline] |
| sofa::component::topology::EdgeSubsetData< T >::EdgeSubsetData | ( | void(*)(unsigned int, void *, T &, const Edge &, const std::vector< unsigned int > &, const std::vector< double > &) | createFunc = ed_basicCreateFunc, |
|
| void * | createParam = (void*)NULL, |
|||
| void(*)(unsigned int, void *, T &) | destroyFunc = ed_basicDestroyFunc, |
|||
| void * | destroyParam = (void*)NULL | |||
| ) | [inline] |
Optionnaly takes 2 parameters, a creation and a destruction function that will be called when adding/deleting elements.
Definition at line 103 of file EdgeSubsetData.h.
| void sofa::component::topology::EdgeSubsetData< T >::add | ( | unsigned int | nbEdges, | |
| const sofa::helper::vector< Edge > & | edge, | |||
| const sofa::helper::vector< sofa::helper::vector< unsigned int > > & | ancestors, | |||
| const sofa::helper::vector< sofa::helper::vector< double > > & | coefs | |||
| ) | [inline, private] |
Add some values. Values are added at the end of the vector.
Definition at line 118 of file EdgeSubsetData.inl.
References sofa::component::topology::EdgeSubsetData< T >::lastEdgeIndex, sofa::component::topology::EdgeSubsetData< T >::m_createFunc, and sofa::component::topology::EdgeSubsetData< T >::m_createParam.
| void sofa::component::topology::EdgeSubsetData< T >::handleTopologyEvents | ( | std::list< const core::componentmodel::topology::TopologyChange * >::const_iterator | changeIt, | |
| std::list< const core::componentmodel::topology::TopologyChange * >::const_iterator & | end, | |||
| const unsigned int | totalEdgeSetArraySize | |||
| ) | [inline] |
Handle EdgeSetTopology related events, ignore others.
Definition at line 48 of file EdgeSubsetData.inl.
References sofa::component::topology::EdgesAdded::ancestorsList, sofa::component::topology::EdgesAdded::coefs, sofa::component::topology::EdgesAdded::edgeArray, sofa::core::componentmodel::topology::EDGESADDED, sofa::core::componentmodel::topology::EDGESREMOVED, sofa::component::topology::TrianglesRemoved::getArray(), sofa::component::topology::TetrahedraRemoved::getArray(), sofa::component::topology::EdgesAdded::getNbAddedEdges(), sofa::component::topology::EdgeSubsetData< T >::m_createParam, sofa::component::topology::EdgeSubsetData< T >::m_createTetrahedronFunc, sofa::component::topology::EdgeSubsetData< T >::m_createTriangleFunc, sofa::component::topology::EdgeSubsetData< T >::m_destroyTetrahedronFunc, sofa::component::topology::EdgeSubsetData< T >::m_destroyTriangleFunc, sofa::component::topology::EdgeSubsetData< T >::setTotalEdgeSetArraySize(), sofa::core::componentmodel::topology::TETRAHEDRAADDED, sofa::core::componentmodel::topology::TETRAHEDRAREMOVED, sofa::component::topology::TetrahedraAdded::tetrahedronIndexArray, sofa::component::topology::TrianglesAdded::triangleIndexArray, sofa::core::componentmodel::topology::TRIANGLESADDED, and sofa::core::componentmodel::topology::TRIANGLESREMOVED.
| void sofa::component::topology::EdgeSubsetData< T >::remove | ( | const std::vector< unsigned int > & | index | ) | [inline, private] |
Remove the values corresponding to the Edges removed.
the edge lastEdgeIndex is now set to index index[i]
change the key of the item associated with key lastEdgeIndex
Definition at line 146 of file EdgeSubsetData.inl.
References sofa::component::topology::EdgeSubsetData< T >::lastEdgeIndex, sofa::component::topology::EdgeSubsetData< T >::m_destroyFunc, and sofa::component::topology::EdgeSubsetData< T >::m_destroyParam.
| void sofa::component::topology::EdgeSubsetData< T >::setCreateFunction | ( | void(*)(unsigned int, void *, T &, const Edge &, const std::vector< unsigned int > &, const std::vector< double > &) | createFunc | ) | [inline] |
Definition at line 120 of file EdgeSubsetData.h.
| void sofa::component::topology::EdgeSubsetData< T >::setCreateParameter | ( | void * | createParam | ) | [inline] |
Definition at line 135 of file EdgeSubsetData.h.
| void sofa::component::topology::EdgeSubsetData< T >::setCreateQuadFunction | ( | void(*)(const std::vector< unsigned int > &, void *, std::map< unsigned int, T > &) | createQuadFunc | ) | [inline] |
Definition at line 150 of file EdgeSubsetData.h.
| void sofa::component::topology::EdgeSubsetData< T >::setCreateTetrahedronFunction | ( | void(*)(const std::vector< unsigned int > &, void *, std::map< unsigned int, T > &) | createTetrahedronFunc | ) | [inline] |
Definition at line 160 of file EdgeSubsetData.h.
| void sofa::component::topology::EdgeSubsetData< T >::setCreateTriangleFunction | ( | void(*)(const std::vector< unsigned int > &, void *, std::map< unsigned int, T > &) | createTriangleFunc | ) | [inline] |
Definition at line 140 of file EdgeSubsetData.h.
| void sofa::component::topology::EdgeSubsetData< T >::setDestroyFunction | ( | void(*)(unsigned int, void *, T &) | destroyFunc | ) | [inline] |
Definition at line 125 of file EdgeSubsetData.h.
| void sofa::component::topology::EdgeSubsetData< T >::setDestroyParameter | ( | void * | destroyParam | ) | [inline] |
Definition at line 130 of file EdgeSubsetData.h.
| void sofa::component::topology::EdgeSubsetData< T >::setDestroyQuadFunction | ( | void(*)(const std::vector< unsigned int > &, void *, std::map< unsigned int, T > &) | destroyQuadFunc | ) | [inline] |
Definition at line 155 of file EdgeSubsetData.h.
| void sofa::component::topology::EdgeSubsetData< T >::setDestroyTetrahedronFunction | ( | void(*)(const std::vector< unsigned int > &, void *, std::map< unsigned int, T > &) | destroyTetrahedronFunc | ) | [inline] |
Definition at line 165 of file EdgeSubsetData.h.
| void sofa::component::topology::EdgeSubsetData< T >::setDestroyTriangleFunction | ( | void(*)(const std::vector< unsigned int > &, void *, std::map< unsigned int, T > &) | destroyTriangleFunc | ) | [inline] |
Definition at line 145 of file EdgeSubsetData.h.
| void sofa::component::topology::EdgeSubsetData< T >::setTotalEdgeSetArraySize | ( | const unsigned int | s | ) | [inline, private] |
Definition at line 180 of file EdgeSubsetData.h.
Referenced by sofa::component::topology::EdgeSubsetData< T >::handleTopologyEvents().
unsigned int sofa::component::topology::EdgeSubsetData< T >::lastEdgeIndex [private] |
to handle properly the removal of items, the container must know the index of the last element
Definition at line 222 of file EdgeSubsetData.h.
Referenced by sofa::component::topology::EdgeSubsetData< T >::add(), sofa::component::topology::EdgeSubsetData< T >::remove(), and sofa::component::topology::EdgeSubsetData< sofa::component::forcefield::EdgePressureForceField::EdgePressureInformation >::setTotalEdgeSetArraySize().
void(* sofa::component::topology::EdgeSubsetData< T >::m_createFunc)(unsigned int, void *, T &, const Edge &, const std::vector< unsigned int > &, const std::vector< double > &) [private] |
Creation function, called when adding elements.
Referenced by sofa::component::topology::EdgeSubsetData< T >::add(), and sofa::component::topology::EdgeSubsetData< sofa::component::forcefield::EdgePressureForceField::EdgePressureInformation >::setCreateFunction().
void* sofa::component::topology::EdgeSubsetData< T >::m_createParam [private] |
Parameter to be passed to creation function.
Warning : construction and destruction of this object is not of the responsibility of EdgeSubsetData.
Definition at line 214 of file EdgeSubsetData.h.
Referenced by sofa::component::topology::EdgeSubsetData< T >::add(), sofa::component::topology::EdgeSubsetData< T >::handleTopologyEvents(), and sofa::component::topology::EdgeSubsetData< sofa::component::forcefield::EdgePressureForceField::EdgePressureInformation >::setCreateParameter().
void(* sofa::component::topology::EdgeSubsetData< T >::m_createQuadFunc)(const std::vector< unsigned int > &, void *, std::map< unsigned int, T > &) [private] |
Creation function, called when adding quads elements.
void(* sofa::component::topology::EdgeSubsetData< T >::m_createTetrahedronFunc)(const std::vector< unsigned int > &, void *, std::map< unsigned int, T > &) [private] |
Creation function, called when adding tetrahedra elements.
Referenced by sofa::component::topology::EdgeSubsetData< T >::handleTopologyEvents(), and sofa::component::topology::EdgeSubsetData< sofa::component::forcefield::EdgePressureForceField::EdgePressureInformation >::setCreateTetrahedronFunction().
void(* sofa::component::topology::EdgeSubsetData< T >::m_createTriangleFunc)(const std::vector< unsigned int > &, void *, std::map< unsigned int, T > &) [private] |
Creation function, called when adding triangles elements.
Referenced by sofa::component::topology::EdgeSubsetData< T >::handleTopologyEvents(), and sofa::component::topology::EdgeSubsetData< sofa::component::forcefield::EdgePressureForceField::EdgePressureInformation >::setCreateTriangleFunction().
void(* sofa::component::topology::EdgeSubsetData< T >::m_destroyFunc)(unsigned int, void *, T &) [private] |
Destruction function, called when deleting elements.
Referenced by sofa::component::topology::EdgeSubsetData< T >::remove(), and sofa::component::topology::EdgeSubsetData< sofa::component::forcefield::EdgePressureForceField::EdgePressureInformation >::setDestroyFunction().
void* sofa::component::topology::EdgeSubsetData< T >::m_destroyParam [private] |
Parameter to be passed to destruction function.
Warning : construction and destruction of this object is not of the responsibility of EdgeSubsetData.
Definition at line 220 of file EdgeSubsetData.h.
Referenced by sofa::component::topology::EdgeSubsetData< T >::remove(), and sofa::component::topology::EdgeSubsetData< sofa::component::forcefield::EdgePressureForceField::EdgePressureInformation >::setDestroyParameter().
void(* sofa::component::topology::EdgeSubsetData< T >::m_destroyQuadFunc)(const std::vector< unsigned int > &, void *, std::map< unsigned int, T > &) [private] |
Destruction function, called when removing quads elements.
void(* sofa::component::topology::EdgeSubsetData< T >::m_destroyTetrahedronFunc)(const std::vector< unsigned int > &, void *, std::map< unsigned int, T > &) [private] |
Destruction function, called when removing tetrahedra elements.
Referenced by sofa::component::topology::EdgeSubsetData< T >::handleTopologyEvents(), and sofa::component::topology::EdgeSubsetData< sofa::component::forcefield::EdgePressureForceField::EdgePressureInformation >::setDestroyTetrahedronFunction().
void(* sofa::component::topology::EdgeSubsetData< T >::m_destroyTriangleFunc)(const std::vector< unsigned int > &, void *, std::map< unsigned int, T > &) [private] |
Destruction function, called when removing triangles elements.
Referenced by sofa::component::topology::EdgeSubsetData< T >::handleTopologyEvents(), and sofa::component::topology::EdgeSubsetData< sofa::component::forcefield::EdgePressureForceField::EdgePressureInformation >::setDestroyTriangleFunction().
1.5.7.1