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

Method DeepCopy

Common/DataModel/vtkCellArray.cxx:728–775  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

726
727//------------------------------------------------------------------------------
728void vtkCellArray::DeepCopy(vtkAbstractCellArray* ca)
729{
730 auto other = vtkCellArray::SafeDownCast(ca);
731 if (!other)
732 {
733 vtkErrorMacro("Cannot copy from non-vtkCellArray.");
734 return;
735 }
736 if (other == this)
737 {
738 return;
739 }
740
741 switch (other->GetStorageType())
742 {
743 case StorageTypes::FixedSizeInt32:
744 {
745 this->UseFixedSize32BitStorage(1 /*dummy, ImplicitDeepCopy will fix it*/);
746 this->GetOffsetsAffineArray32()->ImplicitDeepCopy(
747 AffineArray32::FastDownCast(other->Offsets));
748 this->Connectivity->DeepCopy(other->Connectivity);
749 this->Modified();
750 break;
751 }
752 case StorageTypes::FixedSizeInt64:
753 {
754 this->UseFixedSize64BitStorage(1 /*dummy, ImplicitDeepCopy will fix it*/);
755 this->GetOffsetsAffineArray64()->ImplicitDeepCopy(
756 AffineArray64::FastDownCast(other->Offsets));
757 this->Connectivity->DeepCopy(other->Connectivity);
758 this->Modified();
759 break;
760 }
761 case StorageTypes::Int32:
762 case StorageTypes::Int64:
763 case StorageTypes::Generic:
764 default:
765 {
766 this->Offsets = vtk::TakeSmartPointer(other->Offsets->NewInstance());
767 this->Offsets->DeepCopy(other->Offsets);
768 this->Connectivity = vtk::TakeSmartPointer(other->Connectivity->NewInstance());
769 this->Connectivity->DeepCopy(other->Connectivity);
770 this->StorageType = other->StorageType;
771 this->Modified();
772 break;
773 }
774 }
775}
776
777//------------------------------------------------------------------------------
778void vtkCellArray::ShallowCopy(vtkAbstractCellArray* ca)

Callers 1

ProcessMethod · 0.45

Calls 5

FastDownCastFunction · 0.50
ModifiedMethod · 0.45
NewInstanceMethod · 0.45

Tested by

no test coverage detected