------------------------------------------------------------------------------
| 1032 | |
| 1033 | //------------------------------------------------------------------------------ |
| 1034 | void vtkGraph::ClearEdgePoints(vtkIdType e) |
| 1035 | { |
| 1036 | if (vtkDistributedGraphHelper* helper = this->GetDistributedGraphHelper()) |
| 1037 | { |
| 1038 | int myRank = this->Information->Get(vtkDataObject::DATA_PIECE_NUMBER()); |
| 1039 | if (myRank != helper->GetEdgeOwner(e)) |
| 1040 | { |
| 1041 | vtkErrorMacro("vtkGraph cannot clear edge points for a non-local vertex"); |
| 1042 | return; |
| 1043 | } |
| 1044 | |
| 1045 | e = helper->GetEdgeIndex(e); |
| 1046 | } |
| 1047 | |
| 1048 | if (e < 0 || e > this->Internals->NumberOfEdges) |
| 1049 | { |
| 1050 | vtkErrorMacro("Invalid edge id."); |
| 1051 | return; |
| 1052 | } |
| 1053 | if (!this->EdgePoints) |
| 1054 | { |
| 1055 | this->EdgePoints = vtkGraphEdgePoints::New(); |
| 1056 | } |
| 1057 | std::vector<std::vector<double>>::size_type numEdges = this->Internals->NumberOfEdges; |
| 1058 | if (this->EdgePoints->Storage.size() < numEdges) |
| 1059 | { |
| 1060 | this->EdgePoints->Storage.resize(numEdges); |
| 1061 | } |
| 1062 | this->EdgePoints->Storage[e].clear(); |
| 1063 | } |
| 1064 | |
| 1065 | //------------------------------------------------------------------------------ |
| 1066 | void vtkGraph::AddEdgePoint(vtkIdType e, const double x[3]) |