sofa::component::topology::QuadData< T, Alloc > Class Template Reference

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

#include <QuadData.h>

Inheritance diagram for sofa::component::topology::QuadData< T, Alloc >:

Inheritance graph
[legend]
Collaboration diagram for sofa::component::topology::QuadData< T, Alloc >:

Collaboration graph
[legend]

Public Types

typedef sofa::helper::vector
< T, Alloc >::size_type 
size_type
 size_type
typedef sofa::helper::vector
< T, Alloc >::reference 
reference
 reference to a value (read-write)
typedef sofa::helper::vector
< T, Alloc >::const_reference 
const_reference
 const reference to a value (read only)

Public Member Functions

 QuadData (size_type n, const T &value)
 Constructor.
 QuadData (int n, const T &value)
 Constructor.
 QuadData (long n, const T &value)
 Constructor.
 QuadData (size_type n)
 Constructor.
 QuadData (const sofa::helper::vector< T, Alloc > &x)
 Constructor.
 QuadData (typename QuadData< T >::const_iterator first, typename QuadData< T, Alloc >::const_iterator last)
 Constructor.
 QuadData (void(*createFunc)(int, void *, T &, const Quad &, const sofa::helper::vector< unsigned int > &, const sofa::helper::vector< double > &)=trd_basicCreateFunc, void *createParam=(void *) NULL, void(*destroyFunc)(int, void *, T &)=qd_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)
 Handle QuadSetTopology related events, ignore others.
void setCreateFunction (void(*createFunc)(int, void *, T &, const Quad &, const sofa::helper::vector< unsigned int > &, const sofa::helper::vector< double > &))
void setDestroyFunction (void(*destroyFunc)(int, void *, T &))
void setDestroyParameter (void *destroyParam)
void setCreateParameter (void *createParam)

Private Member Functions

void swap (unsigned int i1, unsigned int i2)
 Swaps values at indices i1 and i2.
void add (unsigned int nbQuads, const sofa::helper::vector< Quad > &quad, 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 sofa::helper::vector< unsigned int > &index)
 Remove the values corresponding to the Quads removed.

Private Attributes

void(* m_createFunc )(int, void *, T &, const Quad &, const sofa::helper::vector< unsigned int > &, const sofa::helper::vector< double > &)
 Creation function, called when adding elements.
void(* m_destroyFunc )(int, void *, T &)
 Destruction function, called when deleting elements.
void * m_createParam
 Creation function, called when adding hexahedra elements.
void * m_destroyParam
 Parameter to be passed to destruction function.

Detailed Description

template<class T, class Alloc = std::allocator<T>>
class sofa::component::topology::QuadData< T, Alloc >

A class for storing Quad 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: Quads added, removed, fused, renumbered).

Definition at line 71 of file QuadData.h.


Member Typedef Documentation

template<class T , class Alloc = std::allocator<T>>
typedef sofa::helper::vector<T,Alloc>::const_reference sofa::component::topology::QuadData< T, Alloc >::const_reference

const reference to a value (read only)

Reimplemented from sofa::helper::vector< T, Alloc >.

Definition at line 79 of file QuadData.h.

template<class T , class Alloc = std::allocator<T>>
typedef sofa::helper::vector<T,Alloc>::reference sofa::component::topology::QuadData< T, Alloc >::reference

reference to a value (read-write)

Reimplemented from sofa::helper::vector< T, Alloc >.

Definition at line 77 of file QuadData.h.

template<class T , class Alloc = std::allocator<T>>
typedef sofa::helper::vector<T,Alloc>::size_type sofa::component::topology::QuadData< T, Alloc >::size_type

size_type

Reimplemented from sofa::helper::vector< T, Alloc >.

Definition at line 75 of file QuadData.h.


Constructor & Destructor Documentation

template<class T , class Alloc = std::allocator<T>>
sofa::component::topology::QuadData< T, Alloc >::QuadData ( size_type  n,
const T &  value 
) [inline]

Constructor.

Definition at line 83 of file QuadData.h.

template<class T , class Alloc = std::allocator<T>>
sofa::component::topology::QuadData< T, Alloc >::QuadData ( int  n,
const T &  value 
) [inline]

Constructor.

Definition at line 85 of file QuadData.h.

template<class T , class Alloc = std::allocator<T>>
sofa::component::topology::QuadData< T, Alloc >::QuadData ( long  n,
const T &  value 
) [inline]

Constructor.

Definition at line 87 of file QuadData.h.

template<class T , class Alloc = std::allocator<T>>
sofa::component::topology::QuadData< T, Alloc >::QuadData ( size_type  n  )  [inline, explicit]

Constructor.

Definition at line 89 of file QuadData.h.

template<class T , class Alloc = std::allocator<T>>
sofa::component::topology::QuadData< T, Alloc >::QuadData ( const sofa::helper::vector< T, Alloc > &  x  )  [inline]

Constructor.

Definition at line 91 of file QuadData.h.

template<class T , class Alloc = std::allocator<T>>
sofa::component::topology::QuadData< T, Alloc >::QuadData ( typename QuadData< T >::const_iterator  first,
typename QuadData< T, Alloc >::const_iterator  last 
) [inline]

Constructor.

Definition at line 100 of file QuadData.h.

template<class T , class Alloc = std::allocator<T>>
sofa::component::topology::QuadData< T, Alloc >::QuadData ( void(*)(int, void *, T &, const Quad &, const sofa::helper::vector< unsigned int > &, const sofa::helper::vector< double > &)  createFunc = trd_basicCreateFunc,
void *  createParam = (void*)NULL,
void(*)(int, void *, T &)  destroyFunc = qd_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 105 of file QuadData.h.


Member Function Documentation

template<typename T , typename Alloc >
void sofa::component::topology::QuadData< T, Alloc >::add ( unsigned int  nbQuads,
const sofa::helper::vector< Quad > &  quad,
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 106 of file QuadData.inl.

References sofa::component::topology::QuadData< T, Alloc >::m_createFunc, and sofa::component::topology::QuadData< T, Alloc >::m_createParam.

template<typename T , typename Alloc >
void sofa::component::topology::QuadData< T, Alloc >::handleTopologyEvents ( std::list< const core::componentmodel::topology::TopologyChange * >::const_iterator  changeIt,
std::list< const core::componentmodel::topology::TopologyChange * >::const_iterator &  end 
) [inline]

template<typename T , typename Alloc >
void sofa::component::topology::QuadData< T, Alloc >::remove ( const sofa::helper::vector< unsigned int > &  index  )  [inline, private]

template<class T , class Alloc = std::allocator<T>>
void sofa::component::topology::QuadData< T, Alloc >::setCreateFunction ( void(*)(int, void *, T &, const Quad &, const sofa::helper::vector< unsigned int > &, const sofa::helper::vector< double > &)  createFunc  )  [inline]

template<class T , class Alloc = std::allocator<T>>
void sofa::component::topology::QuadData< T, Alloc >::setCreateParameter ( void *  createParam  )  [inline]

template<class T , class Alloc = std::allocator<T>>
void sofa::component::topology::QuadData< T, Alloc >::setDestroyFunction ( void(*)(int, void *, T &)  destroyFunc  )  [inline]

template<class T , class Alloc = std::allocator<T>>
void sofa::component::topology::QuadData< T, Alloc >::setDestroyParameter ( void *  destroyParam  )  [inline]

template<typename T , typename Alloc >
void sofa::component::topology::QuadData< T, Alloc >::swap ( unsigned int  i1,
unsigned int  i2 
) [inline, private]

Swaps values at indices i1 and i2.

Definition at line 98 of file QuadData.inl.

Referenced by sofa::component::topology::QuadData< T, Alloc >::remove().


Field Documentation

template<class T , class Alloc = std::allocator<T>>
void(* sofa::component::topology::QuadData< T, Alloc >::m_createFunc)(int, void *, T &, const Quad &, const sofa::helper::vector< unsigned int > &, const sofa::helper::vector< double > &) [private]

template<class T , class Alloc = std::allocator<T>>
void* sofa::component::topology::QuadData< T, Alloc >::m_createParam [private]

Creation function, called when adding hexahedra elements.

Destruction function, called when removing hexahedra elements. Parameter to be passed to creation function.

Warning : construction and destruction of this object is not of the responsibility of QuadData.

Definition at line 185 of file QuadData.h.

Referenced by sofa::component::topology::QuadData< T, Alloc >::add(), and sofa::component::topology::QuadData< T, Alloc >::setCreateParameter().

template<class T , class Alloc = std::allocator<T>>
void(* sofa::component::topology::QuadData< T, Alloc >::m_destroyFunc)(int, void *, T &) [private]

template<class T , class Alloc = std::allocator<T>>
void* sofa::component::topology::QuadData< T, Alloc >::m_destroyParam [private]

Parameter to be passed to destruction function.

Warning : construction and destruction of this object is not of the responsibility of QuadData.

Definition at line 191 of file QuadData.h.

Referenced by sofa::component::topology::QuadData< T, Alloc >::remove(), and sofa::component::topology::QuadData< T, Alloc >::setDestroyParameter().


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

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