VTK  9.3.20240419
List of all members
vtkStaticEdgeLocatorTemplate< IDType, EdgeData > Class Template Reference

Templated on types of ids defining an edge, and any data associated with the edge. More...

#include <vtkStaticEdgeLocatorTemplate.h>

Collaboration diagram for vtkStaticEdgeLocatorTemplate< IDType, EdgeData >:
[legend]
typedef EdgeTuple< IDType, EdgeData > EdgeTupleType
 Some convenient typedefs. More...
 
vtkIdType NumEdges
 Some convenient typedefs. More...
 
vtkIdType NumEdgesPerBin
 Some convenient typedefs. More...
 
EdgeTupleTypeEdgeArray
 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...
 
EdgeTupleTypeMergeArray
 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 EdgeTupleTypeGetEdge (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...
 

Detailed Description

template<typename IDType, typename EdgeData>
class vtkStaticEdgeLocatorTemplate< IDType, EdgeData >

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.

Warning
The id tuple type can be specified via templating to reduce memory and speed processing.
Data is associated with edges (e.g., a parametric coordinate, or original id). By using the appropriate template parameter it is possible to associate other data with each edge. Note however that this data is not used when comparing and sorting the edges. (This could be changed - define appropriate comparison operators.)
This class has been threaded with vtkSMPTools. Using TBB or other non-sequential type (set in the CMake variable VTK_SMP_IMPLEMENTATION_TYPE) may improve performance significantly.
See also
vtkEdgeTable vtkStaticPointLocator vtkStaticCellLocator

Definition at line 136 of file vtkStaticEdgeLocatorTemplate.h.

Member Typedef Documentation

◆ EdgeTupleType

template<typename IDType , typename EdgeData >
typedef EdgeTuple<IDType, EdgeData> vtkStaticEdgeLocatorTemplate< IDType, EdgeData >::EdgeTupleType

Some convenient typedefs.

Definition at line 143 of file vtkStaticEdgeLocatorTemplate.h.

Constructor & Destructor Documentation

◆ vtkStaticEdgeLocatorTemplate()

template<typename IDType , typename EdgeData >
vtkStaticEdgeLocatorTemplate< IDType, EdgeData >::vtkStaticEdgeLocatorTemplate ( )
inline

@)

Construct an empty edge locator.

Definition at line 149 of file vtkStaticEdgeLocatorTemplate.h.

◆ ~vtkStaticEdgeLocatorTemplate()

template<typename IDType , typename EdgeData >
vtkStaticEdgeLocatorTemplate< IDType, EdgeData >::~vtkStaticEdgeLocatorTemplate ( )
inline

Delete internal offset array.

The edgeArray is provided from outside the class and so not deleted.

Definition at line 166 of file vtkStaticEdgeLocatorTemplate.h.

Member Function Documentation

◆ GetNumberOfEdges()

template<typename IDType , typename EdgeData >
IDType vtkStaticEdgeLocatorTemplate< IDType, EdgeData >::GetNumberOfEdges ( )
inline

Return the number of edges in the edge array.

Definition at line 171 of file vtkStaticEdgeLocatorTemplate.h.

◆ MergeEdges()

template<typename IDType , typename EdgeData >
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.

◆ BuildLocator()

template<typename IDType , typename EdgeData >
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.

◆ IsInsertedEdge()

template<typename IDType , typename EdgeData >
IDType vtkStaticEdgeLocatorTemplate< IDType, EdgeData >::IsInsertedEdge ( IDType  v0,
IDType  v1 
) const
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 203 of file vtkStaticEdgeLocatorTemplate.h.

◆ GetEdge()

template<typename IDType , typename EdgeData >
const EdgeTupleType& vtkStaticEdgeLocatorTemplate< IDType, EdgeData >::GetEdge ( IDType  i) const
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 262 of file vtkStaticEdgeLocatorTemplate.h.

◆ HashBin()

template<typename IDType , typename EdgeData >
IDType vtkStaticEdgeLocatorTemplate< IDType, EdgeData >::HashBin ( IDType  v) const
inlineprotected

Some convenient typedefs.

Definition at line 276 of file vtkStaticEdgeLocatorTemplate.h.

◆ GetNumberOfEdgesInBin()

template<typename IDType , typename EdgeData >
IDType vtkStaticEdgeLocatorTemplate< IDType, EdgeData >::GetNumberOfEdgesInBin ( IDType  bin) const
inlineprotected

Some convenient typedefs.

Definition at line 278 of file vtkStaticEdgeLocatorTemplate.h.

Member Data Documentation

◆ NumEdges

template<typename IDType , typename EdgeData >
vtkIdType vtkStaticEdgeLocatorTemplate< IDType, EdgeData >::NumEdges
protected

Some convenient typedefs.

Definition at line 265 of file vtkStaticEdgeLocatorTemplate.h.

◆ NumEdgesPerBin

template<typename IDType , typename EdgeData >
vtkIdType vtkStaticEdgeLocatorTemplate< IDType, EdgeData >::NumEdgesPerBin
protected

Some convenient typedefs.

Definition at line 268 of file vtkStaticEdgeLocatorTemplate.h.

◆ EdgeArray

template<typename IDType , typename EdgeData >
EdgeTupleType* vtkStaticEdgeLocatorTemplate< IDType, EdgeData >::EdgeArray
protected

Some convenient typedefs.

Definition at line 269 of file vtkStaticEdgeLocatorTemplate.h.

◆ EdgeOffsets

template<typename IDType , typename EdgeData >
IDType* vtkStaticEdgeLocatorTemplate< IDType, EdgeData >::EdgeOffsets
protected

Some convenient typedefs.

Definition at line 270 of file vtkStaticEdgeLocatorTemplate.h.

◆ MinV0

template<typename IDType , typename EdgeData >
IDType vtkStaticEdgeLocatorTemplate< IDType, EdgeData >::MinV0
protected

Some convenient typedefs.

Definition at line 271 of file vtkStaticEdgeLocatorTemplate.h.

◆ MaxV0

template<typename IDType , typename EdgeData >
IDType vtkStaticEdgeLocatorTemplate< IDType, EdgeData >::MaxV0
protected

Some convenient typedefs.

Definition at line 272 of file vtkStaticEdgeLocatorTemplate.h.

◆ V0Range

template<typename IDType , typename EdgeData >
IDType vtkStaticEdgeLocatorTemplate< IDType, EdgeData >::V0Range
protected

Some convenient typedefs.

Definition at line 273 of file vtkStaticEdgeLocatorTemplate.h.

◆ NDivs

template<typename IDType , typename EdgeData >
int vtkStaticEdgeLocatorTemplate< IDType, EdgeData >::NDivs
protected

Some convenient typedefs.

Definition at line 274 of file vtkStaticEdgeLocatorTemplate.h.

◆ MergeArray

template<typename IDType , typename EdgeData >
EdgeTupleType* vtkStaticEdgeLocatorTemplate< IDType, EdgeData >::MergeArray
protected

Some convenient typedefs.

Definition at line 284 of file vtkStaticEdgeLocatorTemplate.h.

◆ MergeOffsets

template<typename IDType , typename EdgeData >
std::vector<IDType> vtkStaticEdgeLocatorTemplate< IDType, EdgeData >::MergeOffsets
protected

Some convenient typedefs.

Definition at line 285 of file vtkStaticEdgeLocatorTemplate.h.


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