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

Method GetEdgePoint

Common/DataModel/vtkGraph.cxx:955–990  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

953
954//------------------------------------------------------------------------------
955double* vtkGraph::GetEdgePoint(vtkIdType e, vtkIdType i)
956{
957 if (vtkDistributedGraphHelper* helper = this->GetDistributedGraphHelper())
958 {
959 int myRank = this->Information->Get(vtkDataObject::DATA_PIECE_NUMBER());
960 if (myRank != helper->GetEdgeOwner(e))
961 {
962 vtkErrorMacro("vtkGraph cannot receive edge points for a non-local vertex");
963 return nullptr;
964 }
965
966 e = helper->GetEdgeIndex(e);
967 }
968
969 if (e < 0 || e > this->Internals->NumberOfEdges)
970 {
971 vtkErrorMacro("Invalid edge id.");
972 return nullptr;
973 }
974 if (!this->EdgePoints)
975 {
976 this->EdgePoints = vtkGraphEdgePoints::New();
977 }
978 std::vector<std::vector<double>>::size_type numEdges = this->Internals->NumberOfEdges;
979 if (this->EdgePoints->Storage.size() < numEdges)
980 {
981 this->EdgePoints->Storage.resize(numEdges);
982 }
983 vtkIdType npts = static_cast<vtkIdType>(this->EdgePoints->Storage[e].size() / 3);
984 if (i >= npts)
985 {
986 vtkErrorMacro("Edge point index out of range.");
987 return nullptr;
988 }
989 return &this->EdgePoints->Storage[e][3 * i];
990}
991
992//------------------------------------------------------------------------------
993void vtkGraph::SetEdgePoint(vtkIdType e, vtkIdType i, const double x[3])

Callers 2

EdgePositionMethod · 0.80
TestArcEdgesFunction · 0.80

Calls 7

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

Tested by 1

TestArcEdgesFunction · 0.64