------------------------------------------------------------------------------
| 1726 | |
| 1727 | //------------------------------------------------------------------------------ |
| 1728 | void vtkGraph::ForceOwnership() |
| 1729 | { |
| 1730 | // If the reference count == 1, we own it and can change it. |
| 1731 | // If the reference count > 1, we must make a copy to avoid |
| 1732 | // changing the structure of other graphs. |
| 1733 | if (this->Internals->GetReferenceCount() > 1) |
| 1734 | { |
| 1735 | vtkGraphInternals* internals = vtkGraphInternals::New(); |
| 1736 | internals->Adjacency = this->Internals->Adjacency; |
| 1737 | internals->NumberOfEdges = this->Internals->NumberOfEdges; |
| 1738 | this->SetInternals(internals); |
| 1739 | internals->Delete(); |
| 1740 | } |
| 1741 | if (this->EdgePoints && this->EdgePoints->GetReferenceCount() > 1) |
| 1742 | { |
| 1743 | vtkGraphEdgePoints* oldEdgePoints = this->EdgePoints; |
| 1744 | vtkGraphEdgePoints* edgePoints = vtkGraphEdgePoints::New(); |
| 1745 | edgePoints->Storage = oldEdgePoints->Storage; |
| 1746 | this->EdgePoints = edgePoints; |
| 1747 | oldEdgePoints->Delete(); |
| 1748 | } |
| 1749 | } |
| 1750 | |
| 1751 | //------------------------------------------------------------------------------ |
| 1752 | vtkFieldData* vtkGraph::GetAttributesAsFieldData(int type) |
no test coverage detected