------------------------------------------------------------------------------
| 953 | |
| 954 | //------------------------------------------------------------------------------ |
| 955 | double* 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 | //------------------------------------------------------------------------------ |
| 993 | void vtkGraph::SetEdgePoint(vtkIdType e, vtkIdType i, const double x[3]) |