sofa::component::topology::EdgeSubsetData< T > Class Template Reference

A class for storing Edge related data. More...

#include <EdgeSubsetData.h>

Inheritance diagram for sofa::component::topology::EdgeSubsetData< T >:

Inheritance graph
[legend]
Collaboration diagram for sofa::component::topology::EdgeSubsetData< T >:

Collaboration graph
[legend]

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

Detailed Description

template<class T>
class sofa::component::topology::EdgeSubsetData< T >

A class for storing Edge related data.

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.


Member Typedef Documentation

template<class T >
typedef std::map<unsigned int,T>::const_reference sofa::component::topology::EdgeSubsetData< T >::const_reference

const reference to a value (read only)

Definition at line 79 of file EdgeSubsetData.h.

template<class T >
typedef std::map<unsigned int,T>::reference sofa::component::topology::EdgeSubsetData< T >::reference

reference to a value (read-write)

Definition at line 77 of file EdgeSubsetData.h.

template<class T >
typedef std::map<unsigned int,T>::size_type sofa::component::topology::EdgeSubsetData< T >::size_type

size_type

Definition at line 75 of file EdgeSubsetData.h.


Constructor & Destructor Documentation

template<class T >
sofa::component::topology::EdgeSubsetData< T >::EdgeSubsetData ( size_type  n,
const T &  value 
) [inline]

Constructor.

Definition at line 83 of file EdgeSubsetData.h.

template<class T >
sofa::component::topology::EdgeSubsetData< T >::EdgeSubsetData ( int  n,
const T &  value 
) [inline]

Constructor.

Definition at line 85 of file EdgeSubsetData.h.

template<class T >
sofa::component::topology::EdgeSubsetData< T >::EdgeSubsetData ( long  n,
const T &  value 
) [inline]

Constructor.

Definition at line 87 of file EdgeSubsetData.h.

template<class T >
sofa::component::topology::EdgeSubsetData< T >::EdgeSubsetData ( size_type  n  )  [inline, explicit]

Constructor.

Definition at line 89 of file EdgeSubsetData.h.

template<class T >
sofa::component::topology::EdgeSubsetData< T >::EdgeSubsetData ( const std::map< unsigned int, T > &  x  )  [inline]

Constructor.

Definition at line 91 of file EdgeSubsetData.h.

template<class T >
sofa::component::topology::EdgeSubsetData< T >::EdgeSubsetData ( typename EdgeSubsetData< T >::const_iterator  first,
typename EdgeSubsetData< T >::const_iterator  last 
) [inline]

Constructor.

Definition at line 99 of file EdgeSubsetData.h.

template<class T >
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.


Member Function Documentation

template<typename T >
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]

template<typename T >
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]

template<typename T >
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.

template<class T >
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.

template<class T >
void sofa::component::topology::EdgeSubsetData< T >::setCreateParameter ( void *  createParam  )  [inline]

Definition at line 135 of file EdgeSubsetData.h.

template<class T >
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.

template<class T >
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.

template<class T >
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.

template<class T >
void sofa::component::topology::EdgeSubsetData< T >::setDestroyFunction ( void(*)(unsigned int, void *, T &)  destroyFunc  )  [inline]

Definition at line 125 of file EdgeSubsetData.h.

template<class T >
void sofa::component::topology::EdgeSubsetData< T >::setDestroyParameter ( void *  destroyParam  )  [inline]

Definition at line 130 of file EdgeSubsetData.h.

template<class T >
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.

template<class T >
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.

template<class T >
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.

template<class T >
void sofa::component::topology::EdgeSubsetData< T >::setTotalEdgeSetArraySize ( const unsigned int  s  )  [inline, private]


Field Documentation

template<class T >
unsigned int sofa::component::topology::EdgeSubsetData< T >::lastEdgeIndex [private]

template<class T >
void(* sofa::component::topology::EdgeSubsetData< T >::m_createFunc)(unsigned int, void *, T &, const Edge &, const std::vector< unsigned int > &, const std::vector< double > &) [private]

template<class T >
void* sofa::component::topology::EdgeSubsetData< T >::m_createParam [private]

template<class T >
void(* sofa::component::topology::EdgeSubsetData< T >::m_createQuadFunc)(const std::vector< unsigned int > &, void *, std::map< unsigned int, T > &) [private]

template<class T >
void(* sofa::component::topology::EdgeSubsetData< T >::m_createTetrahedronFunc)(const std::vector< unsigned int > &, void *, std::map< unsigned int, T > &) [private]

template<class T >
void(* sofa::component::topology::EdgeSubsetData< T >::m_createTriangleFunc)(const std::vector< unsigned int > &, void *, std::map< unsigned int, T > &) [private]

template<class T >
void(* sofa::component::topology::EdgeSubsetData< T >::m_destroyFunc)(unsigned int, void *, T &) [private]

template<class T >
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().

template<class T >
void(* sofa::component::topology::EdgeSubsetData< T >::m_destroyQuadFunc)(const std::vector< unsigned int > &, void *, std::map< unsigned int, T > &) [private]

template<class T >
void(* sofa::component::topology::EdgeSubsetData< T >::m_destroyTetrahedronFunc)(const std::vector< unsigned int > &, void *, std::map< unsigned int, T > &) [private]

template<class T >
void(* sofa::component::topology::EdgeSubsetData< T >::m_destroyTriangleFunc)(const std::vector< unsigned int > &, void *, std::map< unsigned int, T > &) [private]


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

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