------------------------------------------------------------------------------
| 991 | |
| 992 | //------------------------------------------------------------------------------ |
| 993 | void vtkGraph::SetEdgePoint(vtkIdType e, vtkIdType i, const double x[3]) |
| 994 | { |
| 995 | if (vtkDistributedGraphHelper* helper = this->GetDistributedGraphHelper()) |
| 996 | { |
| 997 | int myRank = this->Information->Get(vtkDataObject::DATA_PIECE_NUMBER()); |
| 998 | if (myRank != helper->GetEdgeOwner(e)) |
| 999 | { |
| 1000 | vtkErrorMacro("vtkGraph cannot set edge points for a non-local vertex"); |
| 1001 | return; |
| 1002 | } |
| 1003 | |
| 1004 | e = helper->GetEdgeIndex(e); |
| 1005 | } |
| 1006 | |
| 1007 | if (e < 0 || e > this->Internals->NumberOfEdges) |
| 1008 | { |
| 1009 | vtkErrorMacro("Invalid edge id."); |
| 1010 | return; |
| 1011 | } |
| 1012 | if (!this->EdgePoints) |
| 1013 | { |
| 1014 | this->EdgePoints = vtkGraphEdgePoints::New(); |
| 1015 | } |
| 1016 | std::vector<std::vector<double>>::size_type numEdges = this->Internals->NumberOfEdges; |
| 1017 | if (this->EdgePoints->Storage.size() < numEdges) |
| 1018 | { |
| 1019 | this->EdgePoints->Storage.resize(numEdges); |
| 1020 | } |
| 1021 | vtkIdType npts = static_cast<vtkIdType>(this->EdgePoints->Storage[e].size() / 3); |
| 1022 | if (i >= npts) |
| 1023 | { |
| 1024 | vtkErrorMacro("Edge point index out of range."); |
| 1025 | return; |
| 1026 | } |
| 1027 | for (int c = 0; c < 3; ++c) |
| 1028 | { |
| 1029 | this->EdgePoints->Storage[e][3 * i + c] = x[c]; |
| 1030 | } |
| 1031 | } |
| 1032 | |
| 1033 | //------------------------------------------------------------------------------ |
| 1034 | void vtkGraph::ClearEdgePoints(vtkIdType e) |