------------------------------------------------------------------------------
| 921 | |
| 922 | //------------------------------------------------------------------------------ |
| 923 | vtkIdType 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 | //------------------------------------------------------------------------------ |
| 955 | double* vtkGraph::GetEdgePoint(vtkIdType e, vtkIdType i) |