54#ifndef vtkStaticEdgeLocatorTemplate_h
55#define vtkStaticEdgeLocatorTemplate_h
57#include "vtkABINamespace.h"
69VTK_ABI_NAMESPACE_BEGIN
70template <
typename TId,
typename TED>
87 if (this->V0 > this->V1)
89 std::swap(this->V0, this->V1);
115 return this->V0 == v0 && this->V1 == v1;
119 return this->V0 == v1 && this->V1 == v0;
125 if (this->V0 < tup.
V0)
127 if (tup.
V0 < this->V0)
129 if (this->V1 < tup.
V1)
139template <
typename IDType,
typename EdgeData>
228 const IDType curBin = this->
HashBin(v0);
236 const IDType binEnd = this->
EdgeOffsets[curBin + 1];
237 while (curId < binEnd && this->
EdgeArray[curId].V0 < v0)
241 if (curId >= binEnd || this->
EdgeArray[curId].V0 > v0)
246 while (curId < binEnd && this->
EdgeArray[curId].V0 == v0 && this->
EdgeArray[curId].V1 < v1)
250 if (curId >= binEnd || this->
EdgeArray[curId].V0 != v0 || this->
EdgeArray[curId].V1 > v1)
275 IDType
HashBin(IDType v)
const {
return ((v - this->MinV0) / this->NumEdgesPerBin); }
279 return (this->EdgeOffsets[bin + 1] - this->EdgeOffsets[bin]);
292#include "vtkStaticEdgeLocatorTemplate.txx"
int NDivs
Some convenient typedefs.
IDType V0Range
Some convenient typedefs.
IDType MinV0
Some convenient typedefs.
vtkIdType NumEdgesPerBin
Some convenient typedefs.
vtkStaticEdgeLocatorTemplate()
)
IDType * EdgeOffsets
Some convenient typedefs.
const IDType * MergeEdges(vtkIdType numEdges, EdgeTupleType *edgeArray, vtkIdType &numUniqueEdges)
This method sorts (in place) an array of EdgeTupleType (of length numEdges) into separate groups,...
IDType GetNumberOfEdgesInBin(IDType bin) const
Some convenient typedefs.
IDType MaxV0
Some convenient typedefs.
~vtkStaticEdgeLocatorTemplate()
Delete internal offset array.
IDType IsInsertedEdge(IDType v0, IDType v1) const
Return the id of the edge indicated.
std::vector< IDType > MergeOffsets
Some convenient typedefs.
IDType HashBin(IDType v) const
Some convenient typedefs.
const EdgeTupleType & GetEdge(IDType i) const
Return the ith edge in the edge array.
IDType GetNumberOfEdges()
Return the number of edges in the edge array.
vtkIdType BuildLocator(vtkIdType numEdges, EdgeTupleType *edgeArray)
This method constructs the edge locator to be used when searching for edges.
vtkIdType NumEdges
Some convenient typedefs.
EdgeTupleType * EdgeArray
Some convenient typedefs.
EdgeTuple< IDType, EdgeData > EdgeTupleType
Some convenient typedefs.
EdgeTupleType * MergeArray
Some convenient typedefs.
Definition of an edge tuple.
bool IsEdge(TId v0, TId v1) const
bool operator==(const EdgeTuple &et) const
EdgeTuple(TId v0, TId v1, TED data)
bool operator<(const EdgeTuple &tup) const
bool operator!=(const EdgeTuple &et) const
void Define(TId v0, TId v1)