------------------------------------------------------------------------------
| 1064 | |
| 1065 | //------------------------------------------------------------------------------ |
| 1066 | void vtkGraph::AddEdgePoint(vtkIdType e, const double x[3]) |
| 1067 | { |
| 1068 | if (vtkDistributedGraphHelper* helper = this->GetDistributedGraphHelper()) |
| 1069 | { |
| 1070 | int myRank = this->Information->Get(vtkDataObject::DATA_PIECE_NUMBER()); |
| 1071 | if (myRank != helper->GetEdgeOwner(e)) |
| 1072 | { |
| 1073 | vtkErrorMacro("vtkGraph cannot set edge points for a non-local vertex"); |
| 1074 | return; |
| 1075 | } |
| 1076 | |
| 1077 | e = helper->GetEdgeIndex(e); |
| 1078 | } |
| 1079 | if (e < 0 || e > this->Internals->NumberOfEdges) |
| 1080 | { |
| 1081 | vtkErrorMacro("Invalid edge id."); |
| 1082 | return; |
| 1083 | } |
| 1084 | if (!this->EdgePoints) |
| 1085 | { |
| 1086 | this->EdgePoints = vtkGraphEdgePoints::New(); |
| 1087 | } |
| 1088 | std::vector<std::vector<double>>::size_type numEdges = this->Internals->NumberOfEdges; |
| 1089 | if (this->EdgePoints->Storage.size() < numEdges) |
| 1090 | { |
| 1091 | this->EdgePoints->Storage.resize(numEdges); |
| 1092 | } |
| 1093 | for (int c = 0; c < 3; ++c) |
| 1094 | { |
| 1095 | this->EdgePoints->Storage[e].push_back(x[c]); |
| 1096 | } |
| 1097 | } |
| 1098 | |
| 1099 | //------------------------------------------------------------------------------ |
| 1100 | void vtkGraph::ShallowCopyEdgePoints(vtkGraph* g) |