A lookup type map, maps indices in a large range to indices in a smaller one.
More...
|
| 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.
|
| |
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.