MCPcopy Create free account
hub / github.com/Kitware/VTK / Next

Method Next

Common/DataModel/vtkEdgeListIterator.cxx:90–122  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

88
89//------------------------------------------------------------------------------
90vtkEdgeType vtkEdgeListIterator::Next()
91{
92 // First, determine the current item.
93 vtkEdgeType e(this->Vertex, this->Current->Target, this->Current->Id);
94
95 // Next, increment the iterator.
96 this->Increment();
97 // If it is undirected, skip edges that are non-local or
98 // entirely-local edges whose source is greater than the target.
99 if (!this->Directed)
100 {
101 int myRank = -1;
102 vtkDistributedGraphHelper* helper = this->Graph->GetDistributedGraphHelper();
103
104 if (helper)
105 {
106 myRank = this->Graph->GetInformation()->Get(vtkDataObject::DATA_PIECE_NUMBER());
107 }
108
109 while (this->Current != nullptr &&
110 ( // Skip non-local edges.
111 (helper && helper->GetEdgeOwner(this->Current->Id) != myRank)
112 // Skip entirely-local edges where Source > Target
113 || (((helper && myRank == helper->GetVertexOwner(this->Current->Target)) || !helper) &&
114 this->Vertex > this->Current->Target)))
115 {
116 this->Increment();
117 }
118 }
119
120 // Return the current item.
121 return e;
122}
123
124//------------------------------------------------------------------------------
125vtkGraphEdge* vtkEdgeListIterator::NextGraphEdge()

Callers 1

NextGraphEdgeMethod · 0.95

Calls 6

IncrementMethod · 0.95
GetEdgeOwnerMethod · 0.80
GetVertexOwnerMethod · 0.80
GetMethod · 0.45
GetInformationMethod · 0.45

Tested by

no test coverage detected