------------------------------------------------------------------------------
| 639 | |
| 640 | //------------------------------------------------------------------------------ |
| 641 | void vtkGraph::CopyInternal(vtkGraph* g, bool deep) |
| 642 | { |
| 643 | if (deep) |
| 644 | { |
| 645 | vtkDataObject::DeepCopy(g); |
| 646 | } |
| 647 | else |
| 648 | { |
| 649 | vtkDataObject::ShallowCopy(g); |
| 650 | } |
| 651 | if (g->DistributedHelper) |
| 652 | { |
| 653 | if (!this->DistributedHelper) |
| 654 | { |
| 655 | this->SetDistributedGraphHelper(g->DistributedHelper->Clone()); |
| 656 | } |
| 657 | } |
| 658 | else if (this->DistributedHelper) |
| 659 | { |
| 660 | this->SetDistributedGraphHelper(nullptr); |
| 661 | } |
| 662 | |
| 663 | // Copy on write. |
| 664 | this->SetInternals(g->Internals); |
| 665 | |
| 666 | if (deep) |
| 667 | { |
| 668 | this->EdgeData->DeepCopy(g->EdgeData); |
| 669 | this->VertexData->DeepCopy(g->VertexData); |
| 670 | this->DeepCopyEdgePoints(g); |
| 671 | } |
| 672 | else |
| 673 | { |
| 674 | this->EdgeData->ShallowCopy(g->EdgeData); |
| 675 | this->VertexData->ShallowCopy(g->VertexData); |
| 676 | this->ShallowCopyEdgePoints(g); |
| 677 | } |
| 678 | |
| 679 | // Copy points |
| 680 | if (g->Points && deep) |
| 681 | { |
| 682 | if (!this->Points) |
| 683 | { |
| 684 | this->Points = vtkPoints::New(); |
| 685 | } |
| 686 | this->Points->DeepCopy(g->Points); |
| 687 | } |
| 688 | else |
| 689 | { |
| 690 | this->SetPoints(g->Points); |
| 691 | } |
| 692 | |
| 693 | // Copy edge list |
| 694 | this->Internals->NumberOfEdges = g->Internals->NumberOfEdges; |
| 695 | if (g->EdgeList && deep) |
| 696 | { |
| 697 | if (!this->EdgeList) |
| 698 | { |
no test coverage detected