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

Method GetNumberOfEdgePoints

Common/DataModel/vtkGraph.cxx:923–952  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

921
922//------------------------------------------------------------------------------
923vtkIdType vtkGraph::GetNumberOfEdgePoints(vtkIdType e)
924{
925 if (vtkDistributedGraphHelper* helper = this->GetDistributedGraphHelper())
926 {
927 int myRank = this->Information->Get(vtkDataObject::DATA_PIECE_NUMBER());
928 if (myRank != helper->GetEdgeOwner(e))
929 {
930 vtkErrorMacro("vtkGraph cannot retrieve edge points for a non-local vertex");
931 return 0;
932 }
933
934 e = helper->GetEdgeIndex(e);
935 }
936
937 if (e < 0 || e > this->Internals->NumberOfEdges)
938 {
939 vtkErrorMacro("Invalid edge id.");
940 return 0;
941 }
942 if (!this->EdgePoints)
943 {
944 return 0;
945 }
946 std::vector<std::vector<double>>::size_type numEdges = this->Internals->NumberOfEdges;
947 if (this->EdgePoints->Storage.size() < numEdges)
948 {
949 this->EdgePoints->Storage.resize(numEdges);
950 }
951 return static_cast<vtkIdType>(this->EdgePoints->Storage[e].size() / 3);
952}
953
954//------------------------------------------------------------------------------
955double* vtkGraph::GetEdgePoint(vtkIdType e, vtkIdType i)

Callers 2

NumberOfEdgePointsMethod · 0.80
TestArcEdgesFunction · 0.80

Calls 6

GetEdgeOwnerMethod · 0.80
GetEdgeIndexMethod · 0.80
GetMethod · 0.45
sizeMethod · 0.45
resizeMethod · 0.45

Tested by 1

TestArcEdgesFunction · 0.64