VTK
9.1.0
|
Templated on types of ids defining an edge, and any data associated with the edge. More...
#include <vtkStaticEdgeLocatorTemplate.h>
typedef EdgeTuple< IDType, EdgeData > | EdgeTupleType |
Some convenient typedefs. More... | |
vtkIdType | NumEdges |
Some convenient typedefs. More... | |
vtkIdType | NumEdgesPerBin |
Some convenient typedefs. More... | |
EdgeTupleType * | EdgeArray |
Some convenient typedefs. More... | |
IDType * | EdgeOffsets |
Some convenient typedefs. More... | |
IDType | MinV0 |
Some convenient typedefs. More... | |
IDType | MaxV0 |
Some convenient typedefs. More... | |
IDType | V0Range |
Some convenient typedefs. More... | |
int | NDivs |
Some convenient typedefs. More... | |
EdgeTupleType * | MergeArray |
Some convenient typedefs. More... | |
std::vector< IDType > | MergeOffsets |
Some convenient typedefs. More... | |
vtkStaticEdgeLocatorTemplate () | |
@) More... | |
~vtkStaticEdgeLocatorTemplate () | |
Delete internal offset array. More... | |
IDType | GetNumberOfEdges () |
Return the number of edges in the edge array. More... | |
const IDType * | MergeEdges (vtkIdType numEdges, EdgeTupleType *edgeArray, vtkIdType &numUniqueEdges) |
This method sorts (in place) an array of EdgeTupleType (of length numEdges) into separate groups, and allocates and returns an offset array providing access to each group. More... | |
vtkIdType | BuildLocator (vtkIdType numEdges, EdgeTupleType *edgeArray) |
This method constructs the edge locator to be used when searching for edges. More... | |
IDType | IsInsertedEdge (IDType v0, IDType v1) const |
Return the id of the edge indicated. More... | |
const EdgeTupleType & | GetEdge (IDType i) const |
Return the ith edge in the edge array. More... | |
IDType | HashBin (IDType v) const |
Some convenient typedefs. More... | |
IDType | GetNumberOfEdgesInBin (IDType bin) const |
Some convenient typedefs. More... | |
Templated on types of ids defining an edge, and any data associated with the edge.
templated locator for managing edges and associated data on edges
vtkStaticEdgeLocatorTemplate provides methods for ordering and tracking edges, as well as associating data with edges. (An edge is a tuple (v0,v1) with v0 < v1.) Typically this class may be used for isocontouring or any operation that operates on edges and needs to determine whether duplicates exist. The class is templated on 1) the type used to represent the id tuple; and 2) the data associated with the edge.
This class is non-incremental (i.e., static). That is, an array of edges must be provided and the locator is built from this array. Once the locator is built, incremental additions of new edges is not allowed (analogoues to vtkStaticPointLocator and vtkStaticCellLocator).
Finally, there are two distinct usage patterns for this class. One is to inject edges and then later search for them. This pattern begins with BuildLocator() and then is followed by repeated calls to IsInsertedEdge(). Internally this operates on an array of EdgeTupleType. The second pattern also operates on an array of EdgeTupleType. It simply sorts an array of vtkEdgeTupleType using MergeEdges(), thereby grouping identical edges. An offset array is created that refers to the beginning of each group, hence indirectly indicating the number of unique edges, and providing O(1) access to each edge. Typically the offset array can be uses to renumber duplicate edges and/or data (such as points) associated with the edge.
Definition at line 151 of file vtkStaticEdgeLocatorTemplate.h.
typedef EdgeTuple<IDType, EdgeData> vtkStaticEdgeLocatorTemplate< IDType, EdgeData >::EdgeTupleType |
Some convenient typedefs.
Definition at line 158 of file vtkStaticEdgeLocatorTemplate.h.
|
inline |
|
inline |
Delete internal offset array.
The edgeArray is provided from outside the class and so not deleted.
Definition at line 181 of file vtkStaticEdgeLocatorTemplate.h.
|
inline |
Return the number of edges in the edge array.
Definition at line 186 of file vtkStaticEdgeLocatorTemplate.h.
const IDType * vtkStaticEdgeLocatorTemplate< IDType, EdgeData >::MergeEdges | ( | vtkIdType | numEdges, |
EdgeTupleType * | edgeArray, | ||
vtkIdType & | numUniqueEdges | ||
) |
This method sorts (in place) an array of EdgeTupleType (of length numEdges) into separate groups, and allocates and returns an offset array providing access to each group.
Each grouping is a list of duplicate edges. The method indicates the number of unique edges numUniqueEdges. Note that the offset array end value offsets[numUniqueEdges] = numEdges, i.e., total allocation of the offsets array is numUniqueEdges+1. Also note that the EId contained in the sorted EdgeTuples can be used to represent data on edges, and perform operations such as renumber edges from initial edge ids (possibly one of several duplicates) to unique edge ids.
vtkIdType vtkStaticEdgeLocatorTemplate< IDType, EdgeData >::BuildLocator | ( | vtkIdType | numEdges, |
EdgeTupleType * | edgeArray | ||
) |
This method constructs the edge locator to be used when searching for edges.
Basically it does a sort of the provided numEdges edges (which likely contains duplicates), and builds an offset table to provide rapid access to edge (v0,v1). The sort is performed via a parallel vtkSMPTools::Sort(). The provided array is modified in place. The method returns the number of unique edges.
|
inline |
Return the id of the edge indicated.
If the edge has not been inserted return <0. Note that the vertices (v0,v1) do not have to be in any particular (ascending/descending) order. BuildLocator() should be called prior to using this method.
Definition at line 218 of file vtkStaticEdgeLocatorTemplate.h.
|
inline |
Return the ith edge in the edge array.
Either obtain a non-negative value i from IsInsertedEdge(); or use 0<=i<NumberOfEdges().
Definition at line 280 of file vtkStaticEdgeLocatorTemplate.h.
|
inlineprotected |
Some convenient typedefs.
Definition at line 294 of file vtkStaticEdgeLocatorTemplate.h.
|
inlineprotected |
Some convenient typedefs.
Definition at line 296 of file vtkStaticEdgeLocatorTemplate.h.
|
protected |
Some convenient typedefs.
Definition at line 283 of file vtkStaticEdgeLocatorTemplate.h.
|
protected |
Some convenient typedefs.
Definition at line 286 of file vtkStaticEdgeLocatorTemplate.h.
|
protected |
Some convenient typedefs.
Definition at line 287 of file vtkStaticEdgeLocatorTemplate.h.
|
protected |
Some convenient typedefs.
Definition at line 288 of file vtkStaticEdgeLocatorTemplate.h.
|
protected |
Some convenient typedefs.
Definition at line 289 of file vtkStaticEdgeLocatorTemplate.h.
|
protected |
Some convenient typedefs.
Definition at line 290 of file vtkStaticEdgeLocatorTemplate.h.
|
protected |
Some convenient typedefs.
Definition at line 291 of file vtkStaticEdgeLocatorTemplate.h.
|
protected |
Some convenient typedefs.
Definition at line 292 of file vtkStaticEdgeLocatorTemplate.h.
|
protected |
Some convenient typedefs.
Definition at line 302 of file vtkStaticEdgeLocatorTemplate.h.
|
protected |
Some convenient typedefs.
Definition at line 303 of file vtkStaticEdgeLocatorTemplate.h.