61 #ifndef vtkStaticEdgeLocatorTemplate_h 62 #define vtkStaticEdgeLocatorTemplate_h 73 template<
typename TId,
typename TED>
88 if ( this->V0 > this->V1 )
97 {
return ( (this->V0 == et.
V0 && this->V1 == et.
V1) ?
true :
false ); }
103 return ( (this->V0 == v0 && this->V1 == v1) ?
true :
false );
107 return ( (this->V0 == v1 && this->V1 == v0) ?
true :
false );
113 if ( this->V0 < tup.
V0 )
return true;
114 if ( tup.
V0 < this->V0 )
return false;
115 if ( this->V1 < tup.
V1 )
return true;
127 template<
typename TId,
typename TED>
143 if ( this->V0 > this->V1 )
152 {
return ( (this->V0 == et.
V0 && this->V1 == et.
V1) ?
true :
false ); }
155 {
return ( (this->V0 != et.
V0 || this->V1 != et.
V1) ?
true :
false ); }
160 if ( this->V0 < tup.
V0 )
return true;
161 if ( tup.
V0 < this->V0 )
return false;
162 if ( this->V1 < tup.
V1 )
return true;
172 template <
typename IDType,
typename EdgeData>
256 IDType curBin = this->
HashBin(V0);
260 for ( IDType i=0; i < num; ++i )
316 {
return ( (v - this->MinV0) / this->NumEdgesPerBin ); }
319 {
return (this->EdgeOffsets[bin+1] - this->EdgeOffsets[bin]); }
332 #include "vtkStaticEdgeLocatorTemplate.txx"
~vtkStaticEdgeLocatorTemplate()
Delete internal offset array.
bool IsEdge(TId v0, TId v1) const
bool operator<(const MergeTuple &tup) const
const IDType * MergeEdges(vtkIdType numEdges, MergeTupleType *edgeArray, vtkIdType &numUniqueEdges)
This method sorts (in place) an array of MergeTupleType (of length numEdges) into separate groups...
bool operator==(const MergeTuple &et) const
Templated on types of ids defining an edge, and any data associated with the edge.
Definition of an edge tuple using for creating an edge merge table.
const EdgeTupleType & GetEdge(IDType i) const
Return the ith edge in the edge array.
vtkIdType NumEdgesPerBin
Some convenient typedefs.
IDType GetNumberOfEdges()
Return the number of edges in the edge array.
vtkIdType NumEdges
Some convenient typedefs.
IDType GetNumberOfEdgesInBin(IDType bin) const
Some convenient typedefs.
std::vector< IDType > MergeOffsets
Some convenient typedefs.
EdgeTuple< IDType, EdgeData > EdgeTupleType
Some convenient typedefs.
EdgeTupleType * EdgeArray
Some convenient typedefs.
EdgeTuple(TId v0, TId v1, TED data)
IDType MinV0
Some convenient typedefs.
vtkStaticEdgeLocatorTemplate()
Construct an empty edge locator.
vtkIdType BuildLocator(vtkIdType numEdges, EdgeTupleType *edgeArray)
This method contructs the edge locator to be used when searching for edges.
Definition of an edge tuple.
IDType IsInsertedEdge(IDType v0, IDType v1) const
Return the id of the edge indicated.
IDType * EdgeOffsets
Some convenient typedefs.
bool operator==(const EdgeTuple &et) const
int NDivs
Some convenient typedefs.
bool operator!=(const MergeTuple &et) const
MergeTuple< IDType, EdgeData > MergeTupleType
Some convenient typedefs.
IDType V0Range
Some convenient typedefs.
bool operator<(const EdgeTuple &tup) const
MergeTuple(TId v0, TId v1, TId eid, TED data)
IDType MaxV0
Some convenient typedefs.
IDType HashBin(IDType v) const
Some convenient typedefs.
MergeTupleType * MergeArray
Some convenient typedefs.