VTK
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...
 
typedef MergeTuple< IDType, EdgeData > MergeTupleType
 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...
 
MergeTupleTypeMergeArray
 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 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 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.

Warning
The id tuple type can be specified via templating to reduce memory and speed processing.
By default, a parametric coordinate T is associated with edges. 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 173 of file vtkStaticEdgeLocatorTemplate.h.

Member Typedef Documentation

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

Some convenient typedefs.

Definition at line 180 of file vtkStaticEdgeLocatorTemplate.h.

template<typename IDType , typename EdgeData >
typedef MergeTuple<IDType,EdgeData> vtkStaticEdgeLocatorTemplate< IDType, EdgeData >::MergeTupleType

Some convenient typedefs.

Definition at line 181 of file vtkStaticEdgeLocatorTemplate.h.

Constructor & Destructor Documentation

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

Construct an empty edge locator.

Definition at line 187 of file vtkStaticEdgeLocatorTemplate.h.

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 195 of file vtkStaticEdgeLocatorTemplate.h.

Member Function Documentation

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

Return the number of edges in the edge array.

Definition at line 203 of file vtkStaticEdgeLocatorTemplate.h.

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

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

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 236 of file vtkStaticEdgeLocatorTemplate.h.

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 298 of file vtkStaticEdgeLocatorTemplate.h.

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

Some convenient typedefs.

Definition at line 315 of file vtkStaticEdgeLocatorTemplate.h.

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

Some convenient typedefs.

Definition at line 318 of file vtkStaticEdgeLocatorTemplate.h.

Member Data Documentation

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

Some convenient typedefs.

Definition at line 304 of file vtkStaticEdgeLocatorTemplate.h.

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

Some convenient typedefs.

Definition at line 307 of file vtkStaticEdgeLocatorTemplate.h.

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

Some convenient typedefs.

Definition at line 308 of file vtkStaticEdgeLocatorTemplate.h.

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

Some convenient typedefs.

Definition at line 309 of file vtkStaticEdgeLocatorTemplate.h.

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

Some convenient typedefs.

Definition at line 310 of file vtkStaticEdgeLocatorTemplate.h.

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

Some convenient typedefs.

Definition at line 311 of file vtkStaticEdgeLocatorTemplate.h.

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

Some convenient typedefs.

Definition at line 312 of file vtkStaticEdgeLocatorTemplate.h.

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

Some convenient typedefs.

Definition at line 313 of file vtkStaticEdgeLocatorTemplate.h.

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

Some convenient typedefs.

Definition at line 323 of file vtkStaticEdgeLocatorTemplate.h.

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

Some convenient typedefs.

Definition at line 324 of file vtkStaticEdgeLocatorTemplate.h.


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