------------------------------------------------------------------------------
| 843 | |
| 844 | //------------------------------------------------------------------------------ |
| 845 | void vtkGraph::SetEdgePoints(vtkIdType e, vtkIdType npts, const double pts[]) |
| 846 | { |
| 847 | if (vtkDistributedGraphHelper* helper = this->GetDistributedGraphHelper()) |
| 848 | { |
| 849 | int myRank = this->Information->Get(vtkDataObject::DATA_PIECE_NUMBER()); |
| 850 | if (myRank != helper->GetEdgeOwner(e)) |
| 851 | { |
| 852 | vtkErrorMacro("vtkGraph cannot set edge points for a non-local vertex"); |
| 853 | return; |
| 854 | } |
| 855 | |
| 856 | e = helper->GetEdgeIndex(e); |
| 857 | } |
| 858 | |
| 859 | if (e < 0 || e > this->Internals->NumberOfEdges) |
| 860 | { |
| 861 | vtkErrorMacro("Invalid edge id."); |
| 862 | return; |
| 863 | } |
| 864 | if (!this->EdgePoints) |
| 865 | { |
| 866 | this->EdgePoints = vtkGraphEdgePoints::New(); |
| 867 | } |
| 868 | std::vector<std::vector<double>>::size_type numEdges = this->Internals->NumberOfEdges; |
| 869 | if (this->EdgePoints->Storage.size() < numEdges) |
| 870 | { |
| 871 | this->EdgePoints->Storage.resize(numEdges); |
| 872 | } |
| 873 | this->EdgePoints->Storage[e].clear(); |
| 874 | for (vtkIdType i = 0; i < 3 * npts; ++i, ++pts) |
| 875 | { |
| 876 | this->EdgePoints->Storage[e].push_back(*pts); |
| 877 | } |
| 878 | } |
| 879 | |
| 880 | //------------------------------------------------------------------------------ |
| 881 | void vtkGraph::GetEdgePoints(vtkIdType e, vtkIdType& npts, double*& pts) |
no test coverage detected