------------------------------------------------------------------------------
| 492 | |
| 493 | //------------------------------------------------------------------------------ |
| 494 | void vtkDataObjectTree::DeepCopy(vtkDataObject* src) |
| 495 | { |
| 496 | if (src == this) |
| 497 | { |
| 498 | return; |
| 499 | } |
| 500 | |
| 501 | this->Internals->Children.clear(); |
| 502 | this->Superclass::DeepCopy(src); |
| 503 | |
| 504 | if (auto from = vtkDataObjectTree::SafeDownCast(src)) |
| 505 | { |
| 506 | unsigned int numChildren = from->GetNumberOfChildren(); |
| 507 | this->SetNumberOfChildren(numChildren); |
| 508 | for (unsigned int cc = 0; cc < numChildren; cc++) |
| 509 | { |
| 510 | if (auto fromChild = from->GetChild(cc)) |
| 511 | { |
| 512 | vtkDataObject* toChild = fromChild->NewInstance(); |
| 513 | toChild->DeepCopy(fromChild); |
| 514 | this->SetChild(cc, toChild); |
| 515 | toChild->FastDelete(); |
| 516 | if (from->HasChildMetaData(cc)) |
| 517 | { |
| 518 | vtkInformation* toInfo = this->GetChildMetaData(cc); |
| 519 | toInfo->Copy(from->GetChildMetaData(cc), /*deep=*/1); |
| 520 | } |
| 521 | } |
| 522 | } |
| 523 | } |
| 524 | this->Modified(); |
| 525 | } |
| 526 | |
| 527 | //------------------------------------------------------------------------------ |
| 528 | void vtkDataObjectTree::ShallowCopy(vtkDataObject* src) |
nothing calls this directly
no test coverage detected