------------------------------------------------------------------------------
| 613 | |
| 614 | //------------------------------------------------------------------------------ |
| 615 | void vtkGraph::CopyStructure(vtkGraph* g) |
| 616 | { |
| 617 | // Copy on write. |
| 618 | this->SetInternals(g->Internals); |
| 619 | if (g->Points) |
| 620 | { |
| 621 | if (!this->Points) |
| 622 | { |
| 623 | this->Points = vtkPoints::New(); |
| 624 | } |
| 625 | this->Points->ShallowCopy(g->Points); |
| 626 | } |
| 627 | else if (this->Points) |
| 628 | { |
| 629 | this->Points->Delete(); |
| 630 | this->Points = nullptr; |
| 631 | } |
| 632 | |
| 633 | // Propagate information used by distributed graphs |
| 634 | this->Information->Set( |
| 635 | vtkDataObject::DATA_PIECE_NUMBER(), g->Information->Get(vtkDataObject::DATA_PIECE_NUMBER())); |
| 636 | this->Information->Set(vtkDataObject::DATA_NUMBER_OF_PIECES(), |
| 637 | g->Information->Get(vtkDataObject::DATA_NUMBER_OF_PIECES())); |
| 638 | } |
| 639 | |
| 640 | //------------------------------------------------------------------------------ |
| 641 | void vtkGraph::CopyInternal(vtkGraph* g, bool deep) |