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

Method SetEdgePoints

Common/DataModel/vtkGraph.cxx:845–878  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

843
844//------------------------------------------------------------------------------
845void vtkGraph::SetEdgePoints(vtkIdType e, vtkIdType npts, const double pts[])
846{
847 if (vtkDistributedGraphHelper* helper = this->GetDistributedGraphHelper())
848 {
849 int myRank = this->Information->Get(vtkDataObject::DATA_PIECE_NUMBER());
850 if (myRank != helper->GetEdgeOwner(e))
851 {
852 vtkErrorMacro("vtkGraph cannot set edge points for a non-local vertex");
853 return;
854 }
855
856 e = helper->GetEdgeIndex(e);
857 }
858
859 if (e < 0 || e > this->Internals->NumberOfEdges)
860 {
861 vtkErrorMacro("Invalid edge id.");
862 return;
863 }
864 if (!this->EdgePoints)
865 {
866 this->EdgePoints = vtkGraphEdgePoints::New();
867 }
868 std::vector<std::vector<double>>::size_type numEdges = this->Internals->NumberOfEdges;
869 if (this->EdgePoints->Storage.size() < numEdges)
870 {
871 this->EdgePoints->Storage.resize(numEdges);
872 }
873 this->EdgePoints->Storage[e].clear();
874 for (vtkIdType i = 0; i < 3 * npts; ++i, ++pts)
875 {
876 this->EdgePoints->Storage[e].push_back(*pts);
877 }
878}
879
880//------------------------------------------------------------------------------
881void vtkGraph::GetEdgePoints(vtkIdType e, vtkIdType& npts, double*& pts)

Callers 9

ShallowCopyEdgePointsMethod · 0.95
DeepCopyEdgePointsMethod · 0.95
LayoutMethod · 0.80
LayoutMethod · 0.80
GeneratePointsMethod · 0.80
GenerateBSplineMethod · 0.80
LayoutMethod · 0.80
BuildTreeMethod · 0.80
RequestDataMethod · 0.80

Calls 9

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

Tested by

no test coverage detected