$darkmode
VCG Library
Public Member Functions | Public Attributes | List of all members
vcg::tri::Allocator< MeshType >::PointerUpdater< SimplexPointerType > Class Template Reference

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

#include <allocate.h>

Public Member Functions

void Clear ()
 
void Update (SimplexPointerType &vp)
 Update a pointer to an element of a mesh after a reallocation. More...
 
bool NeedUpdate ()
 return true if the allocation operation that initialized this PointerUpdater has caused a reallocation
 

Public Attributes

SimplexPointerType newBase
 
SimplexPointerType oldBase
 
SimplexPointerType newEnd
 
SimplexPointerType oldEnd
 
std::vector< size_t > remap
 
bool preventUpdateFlag
 

Detailed Description

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

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

This class is used whenever you trigger some allocation operation that can cause the invalidation of the pointers to mesh elements. Typical situations are when you are allocating new vertexes, edges, halfedges of faces or when you compact their containers to get rid of deleted elements. This object allows you to update an invalidate pointer immediately after an action that invalidate it.

Note
It can also be used to prevent any update of the various internal pointers caused by an invalidation. This can be useful in case you are building all the internal connections by hand as it happens in a importer;
See also
Allocating and Deleting mesh elements

Member Function Documentation

◆ Update()

template<class MeshType >
template<class SimplexPointerType >
void vcg::tri::Allocator< MeshType >::PointerUpdater< SimplexPointerType >::Update ( SimplexPointerType &  vp)
inline

Update a pointer to an element of a mesh after a reallocation.

 The updating is correctly done only if this PointerUpdater have been passed to the corresponing allocation call. \sa \ref allocation

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