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

Method GetEdgePoints

Common/DataModel/vtkGraph.cxx:881–920  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

879
880//------------------------------------------------------------------------------
881void vtkGraph::GetEdgePoints(vtkIdType e, vtkIdType& npts, double*& pts)
882{
883 if (vtkDistributedGraphHelper* helper = this->GetDistributedGraphHelper())
884 {
885 int myRank = this->Information->Get(vtkDataObject::DATA_PIECE_NUMBER());
886 if (myRank != helper->GetEdgeOwner(e))
887 {
888 vtkErrorMacro("vtkGraph cannot retrieve edge points for a non-local vertex");
889 return;
890 }
891
892 e = helper->GetEdgeIndex(e);
893 }
894
895 if (e < 0 || e > this->Internals->NumberOfEdges)
896 {
897 vtkErrorMacro("Invalid edge id.");
898 return;
899 }
900 if (!this->EdgePoints)
901 {
902 npts = 0;
903 pts = nullptr;
904 return;
905 }
906 std::vector<std::vector<double>>::size_type numEdges = this->Internals->NumberOfEdges;
907 if (this->EdgePoints->Storage.size() < numEdges)
908 {
909 this->EdgePoints->Storage.resize(numEdges);
910 }
911 npts = static_cast<vtkIdType>(this->EdgePoints->Storage[e].size() / 3);
912 if (npts > 0)
913 {
914 pts = this->EdgePoints->Storage[e].data();
915 }
916 else
917 {
918 pts = nullptr;
919 }
920}
921
922//------------------------------------------------------------------------------
923vtkIdType vtkGraph::GetNumberOfEdgePoints(vtkIdType e)

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected