Classes | Public Types | Static Public Member Functions
vcg::tri::Allocator< MeshType > Class Template Reference

Class to safely add and delete elements in a mesh. More...

#include <allocate.h>

List of all members.

Classes

class  PointerUpdater
 Accessory class to update pointers after eventual reallocation caused by adding elements. More...

Public Types

typedef std::set
< PointerToAttribute >
::const_iterator 
AttrConstIterator
typedef std::set
< PointerToAttribute >
::iterator 
AttrIterator
typedef MeshType::CoordType CoordType
typedef MeshType::EdgeContainer EdgeContainer
typedef MeshType::EdgeIterator EdgeIterator
typedef MeshType::EdgePointer EdgePointer
typedef MeshType::EdgeType EdgeType
typedef MeshType::FaceContainer FaceContainer
typedef MeshType::FaceIterator FaceIterator
typedef MeshType::FacePointer FacePointer
typedef MeshType::FaceType FaceType
typedef MeshType::HEdgeContainer HEdgeContainer
typedef MeshType::HEdgeIterator HEdgeIterator
typedef MeshType::HEdgePointer HEdgePointer
typedef MeshType::HEdgeType HEdgeType
typedef std::set
< PointerToAttribute >
::iterator 
PAIte
typedef
MeshType::PointerToAttribute 
PointerToAttribute
typedef MeshType::VertContainer VertContainer
typedef MeshType::VertexIterator VertexIterator
typedef MeshType::VertexPointer VertexPointer
typedef MeshType::VertexType VertexType

Static Public Member Functions

static EdgeIterator AddEdge (MeshType &m, VertexPointer v0, VertexPointer v1)
static EdgeIterator AddEdge (MeshType &m, CoordType p0, CoordType p1)
static EdgeIterator AddEdges (MeshType &m, size_t n, PointerUpdater< EdgePointer > &pu)
 Add n edges to the mesh. Function to add n edges to the mesh. The elements are added always to the end of the vector. No attempt of reusing previously deleted element is done.
static EdgeIterator AddEdges (MeshType &m, size_t n)
static EdgeIterator AddEdges (MeshType &m, size_t n, std::vector< EdgePointer * > &local_vec)
static FaceIterator AddFace (MeshType &m, VertexPointer v0, VertexPointer v1, VertexPointer v2)
static FaceIterator AddFace (MeshType &m, size_t v0, size_t v1, size_t v2)
static FaceIterator AddFace (MeshType &m, CoordType p0, CoordType p1, CoordType p2)
static FaceIterator AddFaces (MeshType &m, size_t n)
 Function to add n faces to the mesh. First wrapper, with no parameters.
static FaceIterator AddFaces (MeshType &m, size_t n, std::vector< FacePointer * > &local_vec)
 Function to add n faces to the mesh. Second Wrapper, with a vector of face pointer to be updated.
static FaceIterator AddFaces (MeshType &m, size_t n, PointerUpdater< FacePointer > &pu)
 Function to add n faces to the mesh. This is the only full featured function that is able to manage correctly all the official internal pointers of the mesh (like the VF and FF adjacency relations)
static HEdgeIterator AddHEdges (MeshType &m, size_t n, PointerUpdater< HEdgePointer > &pu)
static HEdgeIterator AddHEdges (MeshType &m, size_t n)
static HEdgeIterator AddHEdges (MeshType &m, size_t n, std::vector< HEdgePointer * > &local_vec)
template<class ATTR_TYPE >
static MeshType::template
PerEdgeAttributeHandle
< ATTR_TYPE > 
AddPerEdgeAttribute (MeshType &m, std::string name)
template<class ATTR_TYPE >
static MeshType::template
PerEdgeAttributeHandle
< ATTR_TYPE > 
AddPerEdgeAttribute (MeshType &m)
template<class ATTR_TYPE >
static MeshType::template
PerFaceAttributeHandle
< ATTR_TYPE > 
AddPerFaceAttribute (MeshType &m, std::string name)
template<class ATTR_TYPE >
static MeshType::template
PerFaceAttributeHandle
< ATTR_TYPE > 
AddPerFaceAttribute (MeshType &m)
template<class ATTR_TYPE >
static MeshType::template
PerMeshAttributeHandle
< ATTR_TYPE > 
AddPerMeshAttribute (MeshType &m, std::string name)
template<class ATTR_TYPE >
static MeshType::template
PerVertexAttributeHandle
< ATTR_TYPE > 
AddPerVertexAttribute (MeshType &m, std::string name)
 Add a Per-Vertex Attribute of the given ATTR_TYPE with the given name.
template<class ATTR_TYPE >
static MeshType::template
PerVertexAttributeHandle
< ATTR_TYPE > 
AddPerVertexAttribute (MeshType &m)
static FaceIterator AddQuadFace (MeshType &m, VertexPointer v0, VertexPointer v1, VertexPointer v2, VertexPointer v3)
static VertexIterator AddVertex (MeshType &m, const CoordType &p)
 Wrapper to AddVertices() to add a single vertex with given coords.
static VertexIterator AddVertex (MeshType &m, const CoordType &p, const CoordType &n)
 Wrapper to AddVertices() to add a single vertex with given coords and normal.
static VertexIterator AddVertex (MeshType &m, const CoordType &p, const Color4b &c)
 Wrapper to AddVertices() to add a single vertex with given coords and color.
static VertexIterator AddVertices (MeshType &m, size_t n, PointerUpdater< VertexPointer > &pu)
 Add n vertices to the mesh. Function to add n vertices to the mesh. The elements are added always to the end of the vector. No attempt of reusing previously deleted element is done.
static VertexIterator AddVertices (MeshType &m, size_t n)
 Wrapper to AddVertices(); no PointerUpdater.
static VertexIterator AddVertices (MeshType &m, size_t n, std::vector< VertexPointer * > &local_vec)
 Wrapper to AddVertices() no PointerUpdater but a vector of VertexPointer pointers to be updated.
template<class ATTR_TYPE >
static void ClearPerVertexAttribute (MeshType &m, typename MeshType::template PerVertexAttributeHandle< ATTR_TYPE > &h)
static void CompactEdgeVector (MeshType &m, PointerUpdater< EdgePointer > &pu)
 Compact vector of edges removing deleted elements.
static void CompactEdgeVector (MeshType &m)
 Wrapper without the PointerUpdater.
static void CompactEveryVector (MeshType &m)
static void CompactFaceVector (MeshType &m, PointerUpdater< FacePointer > &pu)
 Compact face vector by removing deleted elements.
static void CompactFaceVector (MeshType &m)
 Wrapper without the PointerUpdater.
static void CompactVertexVector (MeshType &m, PointerUpdater< VertexPointer > &pu)
 Compact vector of vertices removing deleted elements. Deleted elements are put to the end of the vector and the vector is resized. Order between elements is preserved but not their position (hence the PointerUpdater) After calling this function the IsD() test in the scanning a vector, is no more necessary.
static void CompactVertexVector (MeshType &m)
 Wrapper without the PointerUpdater.
static void DeleteEdge (MeshType &m, EdgeType &e)
static void DeleteFace (MeshType &m, FaceType &f)
static void DeleteHEdge (MeshType &m, HEdgeType &h)
template<class ATTR_TYPE >
static void DeletePerEdgeAttribute (MeshType &m, typename MeshType::template PerEdgeAttributeHandle< ATTR_TYPE > &h)
 If the per-edge attribute exists, delete it.
static bool DeletePerEdgeAttribute (MeshType &m, std::string name)
template<class ATTR_TYPE >
static void DeletePerFaceAttribute (MeshType &m, typename MeshType::template PerFaceAttributeHandle< ATTR_TYPE > &h)
 If the per-face attribute exists, delete it.
static bool DeletePerFaceAttribute (MeshType &m, std::string name)
template<class ATTR_TYPE >
static void DeletePerMeshAttribute (MeshType &m, typename MeshType::template PerMeshAttributeHandle< ATTR_TYPE > &h)
 If the per-mesh attribute exists, delete it.
static void DeletePerMeshAttribute (MeshType &m, std::string name)
template<class ATTR_TYPE >
static void DeletePerVertexAttribute (MeshType &m, typename MeshType::template PerVertexAttributeHandle< ATTR_TYPE > &h)
 If the per-vertex attribute exists, delete it.
static bool DeletePerVertexAttribute (MeshType &m, std::string name)
static void DeleteVertex (MeshType &m, VertexType &v)
template<class ATTR_TYPE >
static MeshType::template
PerEdgeAttributeHandle
< ATTR_TYPE > 
FindPerEdgeAttribute (MeshType &m, const std::string &name)
template<class ATTR_TYPE >
static MeshType::template
PerFaceAttributeHandle
< ATTR_TYPE > 
FindPerFaceAttribute (MeshType &m, const std::string &name)
template<class ATTR_TYPE >
static MeshType::template
PerMeshAttributeHandle
< ATTR_TYPE > 
FindPerMeshAttribute (MeshType &m, const std::string &name)
template<class ATTR_TYPE >
static MeshType::template
PerVertexAttributeHandle
< ATTR_TYPE > 
FindPerVertexAttribute (MeshType &m, const std::string &name)
 Try to retrieve an handle to an attribute with a given name and ATTR_TYPE.
template<class ATTR_TYPE >
static void FixPaddedPerEdgeAttribute (MeshType &m, PointerToAttribute &pa)
template<class ATTR_TYPE >
static void FixPaddedPerFaceAttribute (MeshType &m, PointerToAttribute &pa)
template<class ATTR_TYPE >
static void FixPaddedPerMeshAttribute (MeshType &, PointerToAttribute &pa)
template<class ATTR_TYPE >
static void FixPaddedPerVertexAttribute (MeshType &m, PointerToAttribute &pa)
template<class ATTR_TYPE >
static void GetAllPerEdgeAttribute (const MeshType &m, std::vector< std::string > &all)
template<class ATTR_TYPE >
static void GetAllPerFaceAttribute (MeshType &m, std::vector< std::string > &all)
template<class ATTR_TYPE >
static void GetAllPerMeshAttribute (const MeshType &m, std::vector< std::string > &all)
template<class ATTR_TYPE >
static void GetAllPerVertexAttribute (MeshType &m, std::vector< std::string > &all)
 query the mesh for all the attributes per vertex
template<class ATTR_TYPE >
static MeshType::template
PerEdgeAttributeHandle
< ATTR_TYPE > 
GetPerEdgeAttribute (MeshType &m, std::string name=std::string(""))
 gives a handle to a per-edge attribute with a given name and ATTR_TYPE
template<class ATTR_TYPE >
static MeshType::template
PerFaceAttributeHandle
< ATTR_TYPE > 
GetPerFaceAttribute (MeshType &m, std::string name=std::string(""))
 gives a handle to a per-edge attribute with a given name and ATTR_TYPE
template<class ATTR_TYPE >
static MeshType::template
PerMeshAttributeHandle
< ATTR_TYPE > 
GetPerMeshAttribute (MeshType &m, std::string name=std::string(""))
 gives a handle to a per-edge attribute with a given name and ATTR_TYPE
template<class ATTR_TYPE >
static MeshType::template
PerVertexAttributeHandle
< ATTR_TYPE > 
GetPerVertexAttribute (MeshType &m, std::string name=std::string(""))
 gives a handle to a per-vertex attribute with a given name and ATTR_TYPE
template<class ATTR_TYPE >
static bool IsValidHandle (MeshType &m, const typename MeshType::template PerVertexAttributeHandle< ATTR_TYPE > &a)
 Check if an handle to a Per-Vertex Attribute is valid.
template<class ATTR_TYPE >
static bool IsValidHandle (MeshType &m, const typename MeshType::template PerEdgeAttributeHandle< ATTR_TYPE > &a)
 Per Edge Attributes.
template<class ATTR_TYPE >
static bool IsValidHandle (MeshType &m, const typename MeshType::template PerFaceAttributeHandle< ATTR_TYPE > &a)
 Per Face Attributes.
template<class ATTR_TYPE >
static bool IsValidHandle (MeshType &m, const typename MeshType::template PerMeshAttributeHandle< ATTR_TYPE > &a)
 Per Mesh Attributes.
static void PermutateVertexVector (MeshType &m, PointerUpdater< VertexPointer > &pu)

Detailed Description

template<class MeshType>
class vcg::tri::Allocator< MeshType >

Class to safely add and delete elements in a mesh.

Adding elements to a mesh, like faces and vertices can involve the reallocation of the vectors of the involved elements. This class provide the only safe methods to add elements. It also provide an accessory class vcg::tri::PointerUpdater for updating pointers to mesh elements that are kept by the user.

Definition at line 85 of file allocate.h.


Member Typedef Documentation

template<class MeshType>
typedef std::set<PointerToAttribute>::const_iterator vcg::tri::Allocator< MeshType >::AttrConstIterator

Definition at line 114 of file allocate.h.

template<class MeshType>
typedef std::set<PointerToAttribute>::iterator vcg::tri::Allocator< MeshType >::AttrIterator

Definition at line 113 of file allocate.h.

template<class MeshType>
typedef MeshType::CoordType vcg::tri::Allocator< MeshType >::CoordType

Definition at line 109 of file allocate.h.

template<class MeshType>
typedef MeshType::EdgeContainer vcg::tri::Allocator< MeshType >::EdgeContainer

Definition at line 97 of file allocate.h.

template<class MeshType>
typedef MeshType::EdgeIterator vcg::tri::Allocator< MeshType >::EdgeIterator

Definition at line 96 of file allocate.h.

template<class MeshType>
typedef MeshType::EdgePointer vcg::tri::Allocator< MeshType >::EdgePointer

Definition at line 95 of file allocate.h.

template<class MeshType>
typedef MeshType::EdgeType vcg::tri::Allocator< MeshType >::EdgeType

Definition at line 94 of file allocate.h.

template<class MeshType>
typedef MeshType::FaceContainer vcg::tri::Allocator< MeshType >::FaceContainer

Definition at line 102 of file allocate.h.

template<class MeshType>
typedef MeshType::FaceIterator vcg::tri::Allocator< MeshType >::FaceIterator

Definition at line 101 of file allocate.h.

template<class MeshType>
typedef MeshType::FacePointer vcg::tri::Allocator< MeshType >::FacePointer

Definition at line 100 of file allocate.h.

template<class MeshType>
typedef MeshType::FaceType vcg::tri::Allocator< MeshType >::FaceType

Definition at line 99 of file allocate.h.

template<class MeshType>
typedef MeshType::HEdgeContainer vcg::tri::Allocator< MeshType >::HEdgeContainer

Definition at line 107 of file allocate.h.

template<class MeshType>
typedef MeshType::HEdgeIterator vcg::tri::Allocator< MeshType >::HEdgeIterator

Definition at line 106 of file allocate.h.

template<class MeshType>
typedef MeshType::HEdgePointer vcg::tri::Allocator< MeshType >::HEdgePointer

Definition at line 105 of file allocate.h.

template<class MeshType>
typedef MeshType::HEdgeType vcg::tri::Allocator< MeshType >::HEdgeType

Definition at line 104 of file allocate.h.

template<class MeshType>
typedef std::set<PointerToAttribute >::iterator vcg::tri::Allocator< MeshType >::PAIte

Definition at line 115 of file allocate.h.

template<class MeshType>
typedef MeshType::PointerToAttribute vcg::tri::Allocator< MeshType >::PointerToAttribute

Definition at line 112 of file allocate.h.

template<class MeshType>
typedef MeshType::VertContainer vcg::tri::Allocator< MeshType >::VertContainer

Definition at line 92 of file allocate.h.

template<class MeshType>
typedef MeshType::VertexIterator vcg::tri::Allocator< MeshType >::VertexIterator

Definition at line 91 of file allocate.h.

template<class MeshType>
typedef MeshType::VertexPointer vcg::tri::Allocator< MeshType >::VertexPointer

Definition at line 90 of file allocate.h.

template<class MeshType>
typedef MeshType::VertexType vcg::tri::Allocator< MeshType >::VertexType

Definition at line 89 of file allocate.h.


Member Function Documentation

template<class MeshType>
static EdgeIterator vcg::tri::Allocator< MeshType >::AddEdge ( MeshType &  m,
VertexPointer  v0,
VertexPointer  v1 
) [inline, static]

Function to add a single edge to the mesh. and initializing it with two VertexPointer

Definition at line 337 of file allocate.h.

template<class MeshType>
static EdgeIterator vcg::tri::Allocator< MeshType >::AddEdge ( MeshType &  m,
CoordType  p0,
CoordType  p1 
) [inline, static]

Function to add a face to the mesh and initializing it with the three given coords

Definition at line 347 of file allocate.h.

template<class MeshType>
static EdgeIterator vcg::tri::Allocator< MeshType >::AddEdges ( MeshType &  m,
size_t  n,
PointerUpdater< EdgePointer > &  pu 
) [inline, static]

Add n edges to the mesh. Function to add n edges to the mesh. The elements are added always to the end of the vector. No attempt of reusing previously deleted element is done.

See also:
PointerUpdater
Parameters:
mthe mesh to be modified
nthe number of elements to be added
pua PointerUpdater initialized so that it can be used to update pointers to edges that could have become invalid after this adding.
Return values:
theiterator to the first element added.

Definition at line 288 of file allocate.h.

template<class MeshType>
static EdgeIterator vcg::tri::Allocator< MeshType >::AddEdges ( MeshType &  m,
size_t  n 
) [inline, static]

Function to add n edges to the mesh. First wrapper, with no parameters

Definition at line 361 of file allocate.h.

template<class MeshType>
static EdgeIterator vcg::tri::Allocator< MeshType >::AddEdges ( MeshType &  m,
size_t  n,
std::vector< EdgePointer * > &  local_vec 
) [inline, static]

Function to add n edges to the mesh. Second Wrapper, with a vector of vertex pointers to be updated.

Definition at line 370 of file allocate.h.

template<class MeshType>
static FaceIterator vcg::tri::Allocator< MeshType >::AddFace ( MeshType &  m,
VertexPointer  v0,
VertexPointer  v1,
VertexPointer  v2 
) [inline, static]

Function to add a face to the mesh and initializing it with the three given VertexPointers

Definition at line 478 of file allocate.h.

template<class MeshType>
static FaceIterator vcg::tri::Allocator< MeshType >::AddFace ( MeshType &  m,
size_t  v0,
size_t  v1,
size_t  v2 
) [inline, static]

Function to add a face to the mesh and initializing it with three indexes

Definition at line 496 of file allocate.h.

template<class MeshType>
static FaceIterator vcg::tri::Allocator< MeshType >::AddFace ( MeshType &  m,
CoordType  p0,
CoordType  p1,
CoordType  p2 
) [inline, static]

Function to add a face to the mesh and initializing it with the three given coords

Definition at line 506 of file allocate.h.

template<class MeshType>
static FaceIterator vcg::tri::Allocator< MeshType >::AddFaces ( MeshType &  m,
size_t  n 
) [inline, static]

Function to add n faces to the mesh. First wrapper, with no parameters.

Definition at line 554 of file allocate.h.

template<class MeshType>
static FaceIterator vcg::tri::Allocator< MeshType >::AddFaces ( MeshType &  m,
size_t  n,
std::vector< FacePointer * > &  local_vec 
) [inline, static]

Function to add n faces to the mesh. Second Wrapper, with a vector of face pointer to be updated.

Definition at line 563 of file allocate.h.

template<class MeshType>
static FaceIterator vcg::tri::Allocator< MeshType >::AddFaces ( MeshType &  m,
size_t  n,
PointerUpdater< FacePointer > &  pu 
) [inline, static]

Function to add n faces to the mesh. This is the only full featured function that is able to manage correctly all the official internal pointers of the mesh (like the VF and FF adjacency relations)

Warning:
Calling this function can cause the invalidation of any not-managed FacePointer just because we resize the face vector. If you have such pointers you need to update them by mean of the PointerUpdater object.
See also:
PointerUpdater
Parameters:
mthe mesh to be modified
nthe number of elements to be added
pua PointerUpdater initialized so that it can be used to update pointers to edges that could have become invalid after this adding.
Return values:
theiterator to the first element added.

Definition at line 586 of file allocate.h.

template<class MeshType>
static HEdgeIterator vcg::tri::Allocator< MeshType >::AddHEdges ( MeshType &  m,
size_t  n,
PointerUpdater< HEdgePointer > &  pu 
) [inline, static]

Function to add n halfedges to the mesh. The second parameter hold a vector of pointers to pointer to elements of the mesh that should be updated after a possible vector realloc.

See also:
PointerUpdater
Parameters:
mthe mesh to be modified
nthe number of elements to be added
pua PointerUpdater initialized so that it can be used to update pointers to edges that could have become invalid after this adding.
Return values:
theiterator to the first element added.

Definition at line 392 of file allocate.h.

template<class MeshType>
static HEdgeIterator vcg::tri::Allocator< MeshType >::AddHEdges ( MeshType &  m,
size_t  n 
) [inline, static]

Function to add n vertices to the mesh. First wrapper, with no parameters

Definition at line 454 of file allocate.h.

template<class MeshType>
static HEdgeIterator vcg::tri::Allocator< MeshType >::AddHEdges ( MeshType &  m,
size_t  n,
std::vector< HEdgePointer * > &  local_vec 
) [inline, static]

Function to add n vertices to the mesh. Second Wrapper, with a vector of vertex pointers to be updated.

Definition at line 463 of file allocate.h.

template<class MeshType>
template<class ATTR_TYPE >
static MeshType::template PerEdgeAttributeHandle<ATTR_TYPE> vcg::tri::Allocator< MeshType >::AddPerEdgeAttribute ( MeshType &  m,
std::string  name 
) [inline, static]

Definition at line 1197 of file allocate.h.

template<class MeshType>
template<class ATTR_TYPE >
static MeshType::template PerEdgeAttributeHandle<ATTR_TYPE> vcg::tri::Allocator< MeshType >::AddPerEdgeAttribute ( MeshType &  m) [inline, static]

Definition at line 1218 of file allocate.h.

template<class MeshType>
template<class ATTR_TYPE >
static MeshType::template PerFaceAttributeHandle<ATTR_TYPE> vcg::tri::Allocator< MeshType >::AddPerFaceAttribute ( MeshType &  m,
std::string  name 
) [inline, static]

Definition at line 1320 of file allocate.h.

template<class MeshType>
template<class ATTR_TYPE >
static MeshType::template PerFaceAttributeHandle<ATTR_TYPE> vcg::tri::Allocator< MeshType >::AddPerFaceAttribute ( MeshType &  m) [inline, static]

Definition at line 1341 of file allocate.h.

template<class MeshType>
template<class ATTR_TYPE >
static MeshType::template PerMeshAttributeHandle<ATTR_TYPE> vcg::tri::Allocator< MeshType >::AddPerMeshAttribute ( MeshType &  m,
std::string  name 
) [inline, static]

Definition at line 1439 of file allocate.h.

template<class MeshType>
template<class ATTR_TYPE >
static MeshType::template PerVertexAttributeHandle<ATTR_TYPE> vcg::tri::Allocator< MeshType >::AddPerVertexAttribute ( MeshType &  m,
std::string  name 
) [inline, static]

Add a Per-Vertex Attribute of the given ATTR_TYPE with the given name.

No attribute with that name must exists (even of different type)

Definition at line 1056 of file allocate.h.

template<class MeshType>
template<class ATTR_TYPE >
static MeshType::template PerVertexAttributeHandle<ATTR_TYPE> vcg::tri::Allocator< MeshType >::AddPerVertexAttribute ( MeshType &  m) [inline, static]

Definition at line 1076 of file allocate.h.

template<class MeshType>
static FaceIterator vcg::tri::Allocator< MeshType >::AddQuadFace ( MeshType &  m,
VertexPointer  v0,
VertexPointer  v1,
VertexPointer  v2,
VertexPointer  v3 
) [inline, static]

Function to add a quad face to the mesh and initializing it with the four given VertexPointers

Note that this function add a single polygonal face if the mesh has polygonal info or two tris with the corresponding faux bit set in the standard common case of a triangular mesh.

Definition at line 524 of file allocate.h.

template<class MeshType>
static VertexIterator vcg::tri::Allocator< MeshType >::AddVertex ( MeshType &  m,
const CoordType p 
) [inline, static]

Wrapper to AddVertices() to add a single vertex with given coords.

Definition at line 250 of file allocate.h.

template<class MeshType>
static VertexIterator vcg::tri::Allocator< MeshType >::AddVertex ( MeshType &  m,
const CoordType p,
const CoordType n 
) [inline, static]

Wrapper to AddVertices() to add a single vertex with given coords and normal.

Definition at line 259 of file allocate.h.

template<class MeshType>
static VertexIterator vcg::tri::Allocator< MeshType >::AddVertex ( MeshType &  m,
const CoordType p,
const Color4b c 
) [inline, static]

Wrapper to AddVertices() to add a single vertex with given coords and color.

Definition at line 269 of file allocate.h.

template<class MeshType>
static VertexIterator vcg::tri::Allocator< MeshType >::AddVertices ( MeshType &  m,
size_t  n,
PointerUpdater< VertexPointer > &  pu 
) [inline, static]

Add n vertices to the mesh. Function to add n vertices to the mesh. The elements are added always to the end of the vector. No attempt of reusing previously deleted element is done.

See also:
PointerUpdater
Parameters:
mthe mesh to be modified
nthe number of elements to be added
pua PointerUpdater initialized so that it can be used to update pointers to vertices that could have become invalid after this adding.
Return values:
theiterator to the first element added.

Definition at line 174 of file allocate.h.

template<class MeshType>
static VertexIterator vcg::tri::Allocator< MeshType >::AddVertices ( MeshType &  m,
size_t  n 
) [inline, static]

Wrapper to AddVertices(); no PointerUpdater.

Definition at line 229 of file allocate.h.

template<class MeshType>
static VertexIterator vcg::tri::Allocator< MeshType >::AddVertices ( MeshType &  m,
size_t  n,
std::vector< VertexPointer * > &  local_vec 
) [inline, static]

Wrapper to AddVertices() no PointerUpdater but a vector of VertexPointer pointers to be updated.

Definition at line 237 of file allocate.h.

template<class MeshType>
template<class ATTR_TYPE >
static void vcg::tri::Allocator< MeshType >::ClearPerVertexAttribute ( MeshType &  m,
typename MeshType::template PerVertexAttributeHandle< ATTR_TYPE > &  h 
) [inline, static]

Definition at line 1144 of file allocate.h.

template<class MeshType>
static void vcg::tri::Allocator< MeshType >::CompactEdgeVector ( MeshType &  m,
PointerUpdater< EdgePointer > &  pu 
) [inline, static]

Compact vector of edges removing deleted elements.

Deleted elements are put to the end of the vector and the vector is resized. Order between elements is preserved but not their position (hence the PointerUpdater) After calling this function the IsD() test in the scanning a vector, is no more necessary.

Warning:
It should not be called when TemporaryData is active (but works correctly if attributes are present)

Definition at line 825 of file allocate.h.

template<class MeshType>
static void vcg::tri::Allocator< MeshType >::CompactEdgeVector ( MeshType &  m) [inline, static]

Wrapper without the PointerUpdater.

Definition at line 910 of file allocate.h.

template<class MeshType>
static void vcg::tri::Allocator< MeshType >::CompactEveryVector ( MeshType &  m) [inline, static]

Definition at line 771 of file allocate.h.

template<class MeshType>
static void vcg::tri::Allocator< MeshType >::CompactFaceVector ( MeshType &  m,
PointerUpdater< FacePointer > &  pu 
) [inline, static]

Compact face vector by removing deleted elements.

Deleted elements are put to the end of the vector and the vector is resized. Order between elements is preserved, but not their position (hence the PointerUpdater) Immediately after calling this function the IsD() test during the scanning a vector, is no more necessary.

Warning:
It should not be called when some TemporaryData is active (but works correctly if attributes are present)

Definition at line 923 of file allocate.h.

template<class MeshType>
static void vcg::tri::Allocator< MeshType >::CompactFaceVector ( MeshType &  m) [inline, static]

Wrapper without the PointerUpdater.

Definition at line 1029 of file allocate.h.

template<class MeshType>
static void vcg::tri::Allocator< MeshType >::CompactVertexVector ( MeshType &  m,
PointerUpdater< VertexPointer > &  pu 
) [inline, static]

Compact vector of vertices removing deleted elements. Deleted elements are put to the end of the vector and the vector is resized. Order between elements is preserved but not their position (hence the PointerUpdater) After calling this function the IsD() test in the scanning a vector, is no more necessary.

Warning:
It should not be called when TemporaryData is active (but works correctly if attributes are present)

Definition at line 786 of file allocate.h.

template<class MeshType>
static void vcg::tri::Allocator< MeshType >::CompactVertexVector ( MeshType &  m) [inline, static]

Wrapper without the PointerUpdater.

Definition at line 812 of file allocate.h.

template<class MeshType>
static void vcg::tri::Allocator< MeshType >::DeleteEdge ( MeshType &  m,
EdgeType e 
) [inline, static]

Function to delete an edge from the mesh. NOTE: THIS FUNCTION ALSO UPDATE en

Definition at line 677 of file allocate.h.

template<class MeshType>
static void vcg::tri::Allocator< MeshType >::DeleteFace ( MeshType &  m,
FaceType f 
) [inline, static]

Function to delete a face from the mesh. NOTE: THIS FUNCTION ALSO UPDATE FN

Definition at line 654 of file allocate.h.

template<class MeshType>
static void vcg::tri::Allocator< MeshType >::DeleteHEdge ( MeshType &  m,
HEdgeType h 
) [inline, static]

Function to delete a hedge from the mesh. NOTE: THIS FUNCTION ALSO UPDATE en

Definition at line 688 of file allocate.h.

template<class MeshType>
template<class ATTR_TYPE >
static void vcg::tri::Allocator< MeshType >::DeletePerEdgeAttribute ( MeshType &  m,
typename MeshType::template PerEdgeAttributeHandle< ATTR_TYPE > &  h 
) [inline, static]

If the per-edge attribute exists, delete it.

Definition at line 1284 of file allocate.h.

template<class MeshType>
static bool vcg::tri::Allocator< MeshType >::DeletePerEdgeAttribute ( MeshType &  m,
std::string  name 
) [inline, static]

Definition at line 1297 of file allocate.h.

template<class MeshType>
template<class ATTR_TYPE >
static void vcg::tri::Allocator< MeshType >::DeletePerFaceAttribute ( MeshType &  m,
typename MeshType::template PerFaceAttributeHandle< ATTR_TYPE > &  h 
) [inline, static]

If the per-face attribute exists, delete it.

Definition at line 1403 of file allocate.h.

template<class MeshType>
static bool vcg::tri::Allocator< MeshType >::DeletePerFaceAttribute ( MeshType &  m,
std::string  name 
) [inline, static]

Definition at line 1416 of file allocate.h.

template<class MeshType>
template<class ATTR_TYPE >
static void vcg::tri::Allocator< MeshType >::DeletePerMeshAttribute ( MeshType &  m,
typename MeshType::template PerMeshAttributeHandle< ATTR_TYPE > &  h 
) [inline, static]

If the per-mesh attribute exists, delete it.

Definition at line 1510 of file allocate.h.

template<class MeshType>
static void vcg::tri::Allocator< MeshType >::DeletePerMeshAttribute ( MeshType &  m,
std::string  name 
) [inline, static]

Definition at line 1519 of file allocate.h.

template<class MeshType>
template<class ATTR_TYPE >
static void vcg::tri::Allocator< MeshType >::DeletePerVertexAttribute ( MeshType &  m,
typename MeshType::template PerVertexAttributeHandle< ATTR_TYPE > &  h 
) [inline, static]

If the per-vertex attribute exists, delete it.

Definition at line 1159 of file allocate.h.

template<class MeshType>
static bool vcg::tri::Allocator< MeshType >::DeletePerVertexAttribute ( MeshType &  m,
std::string  name 
) [inline, static]

Definition at line 1172 of file allocate.h.

template<class MeshType>
static void vcg::tri::Allocator< MeshType >::DeleteVertex ( MeshType &  m,
VertexType v 
) [inline, static]

Function to delete a vertex from the mesh. NOTE: THIS FUNCTION ALSO UPDATE vn

Definition at line 666 of file allocate.h.

template<class MeshType>
template<class ATTR_TYPE >
static MeshType::template PerEdgeAttributeHandle<ATTR_TYPE> vcg::tri::Allocator< MeshType >::FindPerEdgeAttribute ( MeshType &  m,
const std::string &  name 
) [inline, static]

Definition at line 1243 of file allocate.h.

template<class MeshType>
template<class ATTR_TYPE >
static MeshType::template PerFaceAttributeHandle<ATTR_TYPE> vcg::tri::Allocator< MeshType >::FindPerFaceAttribute ( MeshType &  m,
const std::string &  name 
) [inline, static]

Definition at line 1365 of file allocate.h.

template<class MeshType>
template<class ATTR_TYPE >
static MeshType::template PerMeshAttributeHandle<ATTR_TYPE> vcg::tri::Allocator< MeshType >::FindPerMeshAttribute ( MeshType &  m,
const std::string &  name 
) [inline, static]

Definition at line 1476 of file allocate.h.

template<class MeshType>
template<class ATTR_TYPE >
static MeshType::template PerVertexAttributeHandle<ATTR_TYPE> vcg::tri::Allocator< MeshType >::FindPerVertexAttribute ( MeshType &  m,
const std::string &  name 
) [inline, static]

Try to retrieve an handle to an attribute with a given name and ATTR_TYPE.

Returns:
a invalid handle if no attribute with that name and type exists.

Definition at line 1102 of file allocate.h.

template<class MeshType>
template<class ATTR_TYPE >
static void vcg::tri::Allocator< MeshType >::FixPaddedPerEdgeAttribute ( MeshType &  m,
PointerToAttribute pa 
) [inline, static]

Definition at line 1556 of file allocate.h.

template<class MeshType>
template<class ATTR_TYPE >
static void vcg::tri::Allocator< MeshType >::FixPaddedPerFaceAttribute ( MeshType &  m,
PointerToAttribute pa 
) [inline, static]

Definition at line 1584 of file allocate.h.

template<class MeshType>
template<class ATTR_TYPE >
static void vcg::tri::Allocator< MeshType >::FixPaddedPerMeshAttribute ( MeshType &  ,
PointerToAttribute pa 
) [inline, static]

Definition at line 1613 of file allocate.h.

template<class MeshType>
template<class ATTR_TYPE >
static void vcg::tri::Allocator< MeshType >::FixPaddedPerVertexAttribute ( MeshType &  m,
PointerToAttribute pa 
) [inline, static]

Definition at line 1529 of file allocate.h.

template<class MeshType>
template<class ATTR_TYPE >
static void vcg::tri::Allocator< MeshType >::GetAllPerEdgeAttribute ( const MeshType &  m,
std::vector< std::string > &  all 
) [inline, static]

Definition at line 1266 of file allocate.h.

template<class MeshType>
template<class ATTR_TYPE >
static void vcg::tri::Allocator< MeshType >::GetAllPerFaceAttribute ( MeshType &  m,
std::vector< std::string > &  all 
) [inline, static]

Definition at line 1387 of file allocate.h.

template<class MeshType>
template<class ATTR_TYPE >
static void vcg::tri::Allocator< MeshType >::GetAllPerMeshAttribute ( const MeshType &  m,
std::vector< std::string > &  all 
) [inline, static]

Definition at line 1500 of file allocate.h.

template<class MeshType>
template<class ATTR_TYPE >
static void vcg::tri::Allocator< MeshType >::GetAllPerVertexAttribute ( MeshType &  m,
std::vector< std::string > &  all 
) [inline, static]

query the mesh for all the attributes per vertex

Returns:
the name of all attributes with a non-empy name.

Definition at line 1128 of file allocate.h.

template<class MeshType>
template<class ATTR_TYPE >
static MeshType::template PerEdgeAttributeHandle<ATTR_TYPE> vcg::tri::Allocator< MeshType >::GetPerEdgeAttribute ( MeshType &  m,
std::string  name = std::string("") 
) [inline, static]

gives a handle to a per-edge attribute with a given name and ATTR_TYPE

Returns:
a valid handle. If the name is not empty and an attribute with that name and type exists returns a handle to it. Otherwise return a hanlde to a newly created.

Definition at line 1229 of file allocate.h.

template<class MeshType>
template<class ATTR_TYPE >
static MeshType::template PerFaceAttributeHandle<ATTR_TYPE> vcg::tri::Allocator< MeshType >::GetPerFaceAttribute ( MeshType &  m,
std::string  name = std::string("") 
) [inline, static]

gives a handle to a per-edge attribute with a given name and ATTR_TYPE

Returns:
a valid handle. If the name is not empty and an attribute with that name and type exists returns a handle to it. Otherwise return a hanlde to a newly created.

Definition at line 1352 of file allocate.h.

template<class MeshType>
template<class ATTR_TYPE >
static MeshType::template PerMeshAttributeHandle<ATTR_TYPE> vcg::tri::Allocator< MeshType >::GetPerMeshAttribute ( MeshType &  m,
std::string  name = std::string("") 
) [inline, static]

gives a handle to a per-edge attribute with a given name and ATTR_TYPE

Returns:
a valid handle. If the name is not empty and an attribute with that name and type exists returns a handle to it. Otherwise return a hanlde to a newly created.

Definition at line 1463 of file allocate.h.

template<class MeshType>
template<class ATTR_TYPE >
static MeshType::template PerVertexAttributeHandle<ATTR_TYPE> vcg::tri::Allocator< MeshType >::GetPerVertexAttribute ( MeshType &  m,
std::string  name = std::string("") 
) [inline, static]

gives a handle to a per-vertex attribute with a given name and ATTR_TYPE

Returns:
a valid handle. If the name is not empty and an attribute with that name and type exists returns a handle to it. Otherwise return a hanlde to a newly created.

Definition at line 1087 of file allocate.h.

template<class MeshType>
template<class ATTR_TYPE >
static bool vcg::tri::Allocator< MeshType >::IsValidHandle ( MeshType &  m,
const typename MeshType::template PerVertexAttributeHandle< ATTR_TYPE > &  a 
) [inline, static]

Check if an handle to a Per-Vertex Attribute is valid.

Definition at line 1042 of file allocate.h.

template<class MeshType>
template<class ATTR_TYPE >
static bool vcg::tri::Allocator< MeshType >::IsValidHandle ( MeshType &  m,
const typename MeshType::template PerEdgeAttributeHandle< ATTR_TYPE > &  a 
) [inline, static]

Per Edge Attributes.

Definition at line 1187 of file allocate.h.

template<class MeshType>
template<class ATTR_TYPE >
static bool vcg::tri::Allocator< MeshType >::IsValidHandle ( MeshType &  m,
const typename MeshType::template PerFaceAttributeHandle< ATTR_TYPE > &  a 
) [inline, static]

Per Face Attributes.

Definition at line 1310 of file allocate.h.

template<class MeshType>
template<class ATTR_TYPE >
static bool vcg::tri::Allocator< MeshType >::IsValidHandle ( MeshType &  m,
const typename MeshType::template PerMeshAttributeHandle< ATTR_TYPE > &  a 
) [inline, static]

Per Mesh Attributes.

Definition at line 1429 of file allocate.h.

template<class MeshType>
static void vcg::tri::Allocator< MeshType >::PermutateVertexVector ( MeshType &  m,
PointerUpdater< VertexPointer > &  pu 
) [inline, static]

Definition at line 705 of file allocate.h.


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


shape_reconstruction
Author(s): Roberto Martín-Martín
autogenerated on Sat Jun 8 2019 18:41:55