MCPcopy Create free account
hub / github.com/Kitware/VTK / CompositeShallowCopy

Method CompositeShallowCopy

Common/DataModel/vtkDataObjectTree.cxx:453–491  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

451
452//------------------------------------------------------------------------------
453void vtkDataObjectTree::CompositeShallowCopy(vtkCompositeDataSet* src)
454{
455 if (src == this)
456 {
457 return;
458 }
459
460 this->Internals->Children.clear();
461 this->Superclass::CompositeShallowCopy(src);
462
463 if (auto from = vtkDataObjectTree::SafeDownCast(src))
464 {
465 unsigned int numChildren = from->GetNumberOfChildren();
466 this->SetNumberOfChildren(numChildren);
467 for (unsigned int cc = 0; cc < numChildren; cc++)
468 {
469 if (auto child = from->GetChild(cc))
470 {
471 if (auto childTree = vtkDataObjectTree::SafeDownCast(child))
472 {
473 vtkDataObjectTree* clone = childTree->NewInstance();
474 clone->CompositeShallowCopy(childTree);
475 this->SetChild(cc, clone);
476 clone->FastDelete();
477 }
478 else
479 {
480 this->SetChild(cc, child);
481 }
482 }
483 if (from->HasChildMetaData(cc))
484 {
485 vtkInformation* toInfo = this->GetChildMetaData(cc);
486 toInfo->Copy(from->GetChildMetaData(cc), 0);
487 }
488 }
489 }
490 this->Modified();
491}
492
493//------------------------------------------------------------------------------
494void vtkDataObjectTree::DeepCopy(vtkDataObject* src)

Callers

nothing calls this directly

Calls 11

SetNumberOfChildrenMethod · 0.95
SetChildMethod · 0.95
GetChildMetaDataMethod · 0.95
FastDeleteMethod · 0.80
HasChildMetaDataMethod · 0.80
clearMethod · 0.45
GetNumberOfChildrenMethod · 0.45
GetChildMethod · 0.45
NewInstanceMethod · 0.45
CopyMethod · 0.45
ModifiedMethod · 0.45

Tested by

no test coverage detected