VTK  9.7.20261111
vtkStaticEdgeLocatorTemplate< IDType, EdgeData > Class Template Reference

#include <vtkStaticEdgeLocatorTemplate.h>

Detailed Description

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

templated locator for managing edges and associated data on edges

vtkStaticEdgeLocatorTemplate is a vtkStaticElementLocator of EdgeTuple, the edges (v0,v1) with v0 < v1 and their data, with its former API: BuildLocator() then IsInsertedEdge() to search the unique edges, or MergeEdges() to group the identical edges, whose offsets give the number of unique edges and O(1) access to every group, e.g., to renumber duplicate edges or their data. The data of the edges is not used when comparing and sorting them.

Warning
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 vtkStaticElementLocator

Definition at line 42 of file vtkStaticEdgeLocatorTemplate.h.

Inheritance diagram for vtkStaticEdgeLocatorTemplate< IDType, EdgeData >:
[legend]
Collaboration diagram for vtkStaticEdgeLocatorTemplate< IDType, EdgeData >:
[legend]

Public Types

using EdgeTupleType = EdgeTuple<IDType, EdgeData>
 The edges, and the element locator of the edges.
using Superclass = vtkStaticElementLocator<IDType, EdgeTupleType>
 The edges, and the element locator of the edges.
Public Types inherited from vtkStaticElementLocator< TId, EdgeTuple< TId, TData > >
using IDType
using ElementType
using KeysType
using GroupedElements
 The groups of equal elements of GroupElements(), see vtk::keys::GroupedElements.

Public Member Functions

 vtkStaticEdgeLocatorTemplate ()=default
 Construct an empty edge locator.
 ~vtkStaticEdgeLocatorTemplate ()=default
IDType GetNumberOfEdges () const
 Return the number of unique edges, after BuildLocator().
const IDType * MergeEdges (vtkIdType numEdges, EdgeTupleType *edgeArray, vtkIdType &numGroups)
 Sort edgeArray so that identical edges are contiguous, and return the start of every group of identical edges, of size (numGroups + 1).
IDType IsInsertedEdge (IDType v0, IDType v1) const
 Return the id of the edge (v0,v1), in any order, or a negative value if it was not inserted, after BuildLocator().
const EdgeTupleType & GetEdge (IDType i) const
 Return the ith unique edge, e.g., of a non-negative IsInsertedEdge(), 0 <= i < GetNumberOfEdges().
Public Member Functions inherited from vtkStaticElementLocator< TId, EdgeTuple< TId, TData > >
 vtkStaticElementLocator ()=default
 Construct an empty element locator.
 ~vtkStaticElementLocator ()=default
 vtkStaticElementLocator (vtkStaticElementLocator &&)=default
 Move a locator.
vtkStaticElementLocator & operator= (vtkStaticElementLocator &&)=default
vtkIdType BuildLocator (vtkIdType numElements, ElementType *elementArray)
 Build the locator from the numElements elements of elementArray, which may contain duplicates: the unique elements are moved to its front, sorted by key, see vtkKeys.h.
IDType IsInsertedElement (const ElementType &query) const
 Return the id of an element, or a negative value if it was not inserted.
IDType IsInsertedElement (Arg0 &&arg0, Arg1 &&arg1, Args &&... args) const
 Same as above, with the query constructed in place from its arguments, as emplace_back(), e.g., IsInsertedElement(v0, v1) for an element.
IDType GetNumberOfElements () const
 Return the number of unique elements, after BuildLocator().
const ElementType & GetElement (IDType i) const
 Return the element of id i, i.e., the ith unique element, 0 <= i < GetNumberOfElements().
const GroupedElements & GroupElements (vtkIdType numElements, ElementType *elementArray)
 Sort the numElements elements of elementArray in place into groups of equal elements, and return them: group g is [GetGroupOffset(g), GetGroupOffset(g + 1)) of elementArray, the number of unique elements is GetNumberOfGroups(), and GetGroupOffset(GetNumberOfGroups()) is numElements.

Protected Attributes

std::vector< IDType > MergeOffsets
Protected Attributes inherited from vtkStaticElementLocator< TId, EdgeTuple< TId, TData > >
IDType NumElements
ElementType * ElementArray
vtk::keys::ReducedKeys< KeysType > Index
GroupedElements Groups

Member Typedef Documentation

◆ EdgeTupleType

template<typename IDType, typename EdgeData>
using vtkStaticEdgeLocatorTemplate< IDType, EdgeData >::EdgeTupleType = EdgeTuple<IDType, EdgeData>

The edges, and the element locator of the edges.

Definition at line 51 of file vtkStaticEdgeLocatorTemplate.h.

◆ Superclass

template<typename IDType, typename EdgeData>
using vtkStaticEdgeLocatorTemplate< IDType, EdgeData >::Superclass = vtkStaticElementLocator<IDType, EdgeTupleType>

The edges, and the element locator of the edges.

Definition at line 52 of file vtkStaticEdgeLocatorTemplate.h.

Constructor & Destructor Documentation

◆ vtkStaticEdgeLocatorTemplate()

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

Construct an empty edge locator.

◆ ~vtkStaticEdgeLocatorTemplate()

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

Member Function Documentation

◆ GetNumberOfEdges()

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

Return the number of unique edges, after BuildLocator().

Definition at line 64 of file vtkStaticEdgeLocatorTemplate.h.

◆ MergeEdges()

template<typename IDType, typename EdgeData>
const IDType * vtkStaticEdgeLocatorTemplate< IDType, EdgeData >::MergeEdges ( vtkIdType numEdges,
EdgeTupleType * edgeArray,
vtkIdType & numGroups )
inline

Sort edgeArray so that identical edges are contiguous, and return the start of every group of identical edges, of size (numGroups + 1).

The offsets are owned by the locator and remain valid until the next call of MergeEdges(). This does not affect BuildLocator().

Warning
The offsets are of IDType, so the number of edges must fit IDType, see GroupElements().

Definition at line 74 of file vtkStaticEdgeLocatorTemplate.h.

◆ IsInsertedEdge()

template<typename IDType, typename EdgeData>
IDType vtkStaticEdgeLocatorTemplate< IDType, EdgeData >::IsInsertedEdge ( IDType v0,
IDType v1 ) const
inline

Return the id of the edge (v0,v1), in any order, or a negative value if it was not inserted, after BuildLocator().

Definition at line 100 of file vtkStaticEdgeLocatorTemplate.h.

◆ GetEdge()

template<typename IDType, typename EdgeData>
const EdgeTupleType & vtkStaticEdgeLocatorTemplate< IDType, EdgeData >::GetEdge ( IDType i) const
inline

Return the ith unique edge, e.g., of a non-negative IsInsertedEdge(), 0 <= i < GetNumberOfEdges().

Definition at line 106 of file vtkStaticEdgeLocatorTemplate.h.

Member Data Documentation

◆ MergeOffsets

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

Definition at line 109 of file vtkStaticEdgeLocatorTemplate.h.


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