Documentation 6b54b78464
Loading...
Searching...
No Matches
CVertexMap< T > Class Template Reference

A lookup type map, maps indices in a large range to indices in a smaller one. More...

#include <CVertexMap.hpp>

Inheritance diagram for CVertexMap< T >:
[legend]

Public Member Functions

bool GetIsValid () const
 Check if the current mapping is valid.
 
T GetnVertex () const
 Get the number of vertices currently mapped.
 
void Reset (unsigned long nPoint)
 Reset the map for size nPoint, marks every point as not-a-vertex.
 
bool SetIsVertex (unsigned long iPoint, bool isVertex)
 Set the vertex status of a point.
 
bool GetIsVertex (unsigned long iPoint) const
 Get wheter a point is marked as vertex.
 
T Build ()
 Build the point to vertex map.
 
bool GetVertexIndex (unsigned long &iVertex) const
 Convert a point index to vertex index.
 

Detailed Description

template<typename T = unsigned long>
class CVertexMap< T >

A lookup type map, maps indices in a large range to indices in a smaller one.

The usage case is: 1 - Initialize via Reset for the large range size. 2 - Use SetIsVertex to define what large range indices have small range correspondence. 3 - Call Build, vertices are given a sequential index in increasing order of iPoint, not in order of calls to SetIsVertex. Keep this in mind when allocating vertex data. 4 - Use GetVertexIndex to convert a point index to vertex index.

Only consider using this class if you have no reasonable way to keep track of vertices. For example if you need to assume every point might be a vertex, but you do not want to allocate data for the entire set of points.

Note
For efficiency use the smallest type that can fit the maximum number of vertices.

Member Function Documentation

◆ Build()

template<typename T = unsigned long>
T CVertexMap< T >::Build ( )
inline

Build the point to vertex map.

◆ GetIsValid()

template<typename T = unsigned long>
bool CVertexMap< T >::GetIsValid ( ) const
inline

Check if the current mapping is valid.

◆ GetIsVertex()

template<typename T = unsigned long>
bool CVertexMap< T >::GetIsVertex ( unsigned long  iPoint) const
inline

Get wheter a point is marked as vertex.

◆ GetnVertex()

template<typename T = unsigned long>
T CVertexMap< T >::GetnVertex ( ) const
inline

Get the number of vertices currently mapped.

◆ GetVertexIndex()

template<typename T = unsigned long>
bool CVertexMap< T >::GetVertexIndex ( unsigned long &  iVertex) const
inline

Convert a point index to vertex index.

Parameters
[in,out]iVertex- On entry point index, on exit vertex index.
Returns
True if conversion is successful (i.e. point is vertex).

◆ Reset()

template<typename T = unsigned long>
void CVertexMap< T >::Reset ( unsigned long  nPoint)
inline

Reset the map for size nPoint, marks every point as not-a-vertex.

◆ SetIsVertex()

template<typename T = unsigned long>
bool CVertexMap< T >::SetIsVertex ( unsigned long  iPoint,
bool  isVertex 
)
inline

Set the vertex status of a point.


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