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

Method GetSourceVertex

Common/DataModel/vtkGraph.cxx:756–785  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

754
755//------------------------------------------------------------------------------
756vtkIdType vtkGraph::GetSourceVertex(vtkIdType e)
757{
758 if (vtkDistributedGraphHelper* helper = this->GetDistributedGraphHelper())
759 {
760 int myRank = this->Information->Get(vtkDataObject::DATA_PIECE_NUMBER());
761 if (myRank != helper->GetEdgeOwner(e))
762 {
763 if (e != this->Internals->LastRemoteEdgeId)
764 {
765 helper->FindEdgeSourceAndTarget(
766 e, &this->Internals->LastRemoteEdgeSource, &this->Internals->LastRemoteEdgeTarget);
767 }
768
769 return this->Internals->LastRemoteEdgeSource;
770 }
771
772 e = helper->GetEdgeIndex(e);
773 }
774
775 if (e < 0 || e >= this->GetNumberOfEdges())
776 {
777 vtkErrorMacro("Edge index out of range.");
778 return -1;
779 }
780 if (!this->EdgeList)
781 {
782 this->BuildEdgeList();
783 }
784 return this->EdgeList->GetValue(2 * e);
785}
786
787//------------------------------------------------------------------------------
788vtkIdType vtkGraph::GetTargetVertex(vtkIdType e)

Callers 15

RemoveEdgeInternalMethod · 0.95
ToDirectedGraphMethod · 0.95
ToUndirectedGraphMethod · 0.95
WriteEdgesMethod · 0.80
WriteDataMethod · 0.80
EdgePositionMethod · 0.80
ComputeBoundsMethod · 0.80
PaintBuffersMethod · 0.80
TestGraphIteratorsFunction · 0.80
TestGraphDeletionFunction · 0.80
vtkBundlingMetadataMethod · 0.80

Calls 7

GetNumberOfEdgesMethod · 0.95
BuildEdgeListMethod · 0.95
GetEdgeOwnerMethod · 0.80
GetEdgeIndexMethod · 0.80
GetMethod · 0.45
GetValueMethod · 0.45

Tested by 3

TestGraphIteratorsFunction · 0.64
TestGraphDeletionFunction · 0.64