------------------------------------------------------------------------------
| 786 | |
| 787 | //------------------------------------------------------------------------------ |
| 788 | vtkIdType vtkGraph::GetTargetVertex(vtkIdType e) |
| 789 | { |
| 790 | if (vtkDistributedGraphHelper* helper = this->GetDistributedGraphHelper()) |
| 791 | { |
| 792 | int myRank = this->Information->Get(vtkDataObject::DATA_PIECE_NUMBER()); |
| 793 | if (myRank != helper->GetEdgeOwner(e)) |
| 794 | { |
| 795 | if (e != this->Internals->LastRemoteEdgeId) |
| 796 | { |
| 797 | this->Internals->LastRemoteEdgeId = e; |
| 798 | helper->FindEdgeSourceAndTarget( |
| 799 | e, &this->Internals->LastRemoteEdgeSource, &this->Internals->LastRemoteEdgeTarget); |
| 800 | } |
| 801 | |
| 802 | return this->Internals->LastRemoteEdgeTarget; |
| 803 | } |
| 804 | |
| 805 | e = helper->GetEdgeIndex(e); |
| 806 | } |
| 807 | |
| 808 | if (e < 0 || e >= this->GetNumberOfEdges()) |
| 809 | { |
| 810 | vtkErrorMacro("Edge index out of range."); |
| 811 | return -1; |
| 812 | } |
| 813 | if (!this->EdgeList) |
| 814 | { |
| 815 | this->BuildEdgeList(); |
| 816 | } |
| 817 | return this->EdgeList->GetValue(2 * e + 1); |
| 818 | } |
| 819 | |
| 820 | //------------------------------------------------------------------------------ |
| 821 | void vtkGraph::BuildEdgeList() |