VTK
|
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... | |
typedef MergeTuple< IDType, EdgeData > | MergeTupleType |
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... | |
MergeTupleType * | MergeArray |
Some convenient typedefs. More... | |
std::vector< IDType > | MergeOffsets |
Some convenient typedefs. More... | |
vtkStaticEdgeLocatorTemplate () | |
Construct an empty edge locator. More... | |
~vtkStaticEdgeLocatorTemplate () | |
Delete internal offset array. More... | |
IDType | GetNumberOfEdges () |
Return the number of edges in the edge array. More... | |
const IDType * | MergeEdges (vtkIdType numEdges, MergeTupleType *edgeArray, vtkIdType &numUniqueEdges) |
This method sorts (in place) an array of MergeTupleType (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 contructs 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 is provided and the locator is built from this array. 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 operates on an array of MergeTupleType. It simply sorts the array 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.
Definition at line 173 of file vtkStaticEdgeLocatorTemplate.h.
typedef EdgeTuple<IDType,EdgeData> vtkStaticEdgeLocatorTemplate< IDType, EdgeData >::EdgeTupleType |
Some convenient typedefs.
Definition at line 180 of file vtkStaticEdgeLocatorTemplate.h.
typedef MergeTuple<IDType,EdgeData> vtkStaticEdgeLocatorTemplate< IDType, EdgeData >::MergeTupleType |
Some convenient typedefs.
Definition at line 181 of file vtkStaticEdgeLocatorTemplate.h.
|
inline |
Construct an empty edge locator.
Definition at line 187 of file vtkStaticEdgeLocatorTemplate.h.
|
inline |
Delete internal offset array.
The edgeArray is provided from outside the class and so not deleted.
Definition at line 195 of file vtkStaticEdgeLocatorTemplate.h.
|
inline |
Return the number of edges in the edge array.
Definition at line 203 of file vtkStaticEdgeLocatorTemplate.h.
const IDType* vtkStaticEdgeLocatorTemplate< IDType, EdgeData >::MergeEdges | ( | vtkIdType | numEdges, |
MergeTupleType * | edgeArray, | ||
vtkIdType & | numUniqueEdges | ||
) |
This method sorts (in place) an array of MergeTupleType (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 MergeTuples can be used to renumber edges from initial ids (possibly one of several duplicates) to unique edge ids.
vtkIdType vtkStaticEdgeLocatorTemplate< IDType, EdgeData >::BuildLocator | ( | vtkIdType | numEdges, |
EdgeTupleType * | edgeArray | ||
) |
This method contructs 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 236 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 298 of file vtkStaticEdgeLocatorTemplate.h.
|
inlineprotected |
Some convenient typedefs.
Definition at line 315 of file vtkStaticEdgeLocatorTemplate.h.
|
inlineprotected |
Some convenient typedefs.
Definition at line 318 of file vtkStaticEdgeLocatorTemplate.h.
|
protected |
Some convenient typedefs.
Definition at line 304 of file vtkStaticEdgeLocatorTemplate.h.
|
protected |
Some convenient typedefs.
Definition at line 307 of file vtkStaticEdgeLocatorTemplate.h.
|
protected |
Some convenient typedefs.
Definition at line 308 of file vtkStaticEdgeLocatorTemplate.h.
|
protected |
Some convenient typedefs.
Definition at line 309 of file vtkStaticEdgeLocatorTemplate.h.
|
protected |
Some convenient typedefs.
Definition at line 310 of file vtkStaticEdgeLocatorTemplate.h.
|
protected |
Some convenient typedefs.
Definition at line 311 of file vtkStaticEdgeLocatorTemplate.h.
|
protected |
Some convenient typedefs.
Definition at line 312 of file vtkStaticEdgeLocatorTemplate.h.
|
protected |
Some convenient typedefs.
Definition at line 313 of file vtkStaticEdgeLocatorTemplate.h.
|
protected |
Some convenient typedefs.
Definition at line 323 of file vtkStaticEdgeLocatorTemplate.h.
|
protected |
Some convenient typedefs.
Definition at line 324 of file vtkStaticEdgeLocatorTemplate.h.