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

Method AddEdgePoint

Common/DataModel/vtkGraph.cxx:1066–1097  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1064
1065//------------------------------------------------------------------------------
1066void vtkGraph::AddEdgePoint(vtkIdType e, const double x[3])
1067{
1068 if (vtkDistributedGraphHelper* helper = this->GetDistributedGraphHelper())
1069 {
1070 int myRank = this->Information->Get(vtkDataObject::DATA_PIECE_NUMBER());
1071 if (myRank != helper->GetEdgeOwner(e))
1072 {
1073 vtkErrorMacro("vtkGraph cannot set edge points for a non-local vertex");
1074 return;
1075 }
1076
1077 e = helper->GetEdgeIndex(e);
1078 }
1079 if (e < 0 || e > this->Internals->NumberOfEdges)
1080 {
1081 vtkErrorMacro("Invalid edge id.");
1082 return;
1083 }
1084 if (!this->EdgePoints)
1085 {
1086 this->EdgePoints = vtkGraphEdgePoints::New();
1087 }
1088 std::vector<std::vector<double>>::size_type numEdges = this->Internals->NumberOfEdges;
1089 if (this->EdgePoints->Storage.size() < numEdges)
1090 {
1091 this->EdgePoints->Storage.resize(numEdges);
1092 }
1093 for (int c = 0; c < 3; ++c)
1094 {
1095 this->EdgePoints->Storage[e].push_back(x[c]);
1096 }
1097}
1098
1099//------------------------------------------------------------------------------
1100void vtkGraph::ShallowCopyEdgePoints(vtkGraph* g)

Callers 4

AddEdgePointFunction · 0.80
RequestDataMethod · 0.80
TestArcEdgesFunction · 0.80
RequestDataMethod · 0.80

Calls 8

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

Tested by 1

TestArcEdgesFunction · 0.64