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

Method DeepCopy

Testing/GenericBridge/vtkBridgeCell.cxx:942–974  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Description: Recursive copy of `other' into `this'. \pre other_exists: other!=0 \pre other_differ: this!=other

Source from the content-addressed store, hash-verified

940// \pre other_exists: other!=0
941// \pre other_differ: this!=other
942void vtkBridgeCell::DeepCopy(vtkBridgeCell* other)
943{
944 assert("pre: other_exists" && other != nullptr);
945 assert("pre: other_differ" && this != other);
946
947 vtkCell* tmp;
948
949 if (this->InternalIterator == nullptr)
950 {
951 this->InternalIterator = vtkBridgeCellIterator::New();
952 }
953 this->Id = other->Id;
954 this->BoolIsInDataSet = other->BoolIsInDataSet;
955 if (other->BoolIsInDataSet)
956 {
957 vtkSetObjectBodyMacro(DataSet, vtkBridgeDataSet, other->DataSet);
958 tmp = this->DataSet->Implementation->GetCell(this->Id);
959 vtkSetObjectBodyMacro(Cell, vtkCell, tmp);
960 this->InternalIterator->InitWithOneCell(this);
961 this->InternalIterator->Begin();
962 }
963 else
964 {
965 vtkSetObjectBodyMacro(DataSet, vtkBridgeDataSet, static_cast<vtkBridgeDataSet*>(nullptr));
966 tmp = other->Cell->NewInstance();
967 vtkSetObjectBodyMacro(Cell, vtkCell, tmp);
968 this->Cell->Delete(); // because newinstance+macro=2 ref
969 this->Cell->DeepCopy(other->Cell);
970 this->InternalIterator->InitWithOneCell(this);
971 this->InternalIterator->Begin();
972 }
973 this->Modified();
974}
975
976//------------------------------------------------------------------------------
977vtkBridgeCell::vtkBridgeCell()

Callers 10

GetCellMethod · 0.45
InitWithCellMethod · 0.45
TestExtentFunction · 0.45
TestCoordsFunction · 0.45
TestDataFailuresFunction · 0.45
TestPointsFunction · 0.45
TestDataSetFailuresFunction · 0.45
TestTableFailuresFunction · 0.45

Calls 8

DeleteMethod · 0.65
assertFunction · 0.50
NewFunction · 0.50
GetCellMethod · 0.45
InitWithOneCellMethod · 0.45
BeginMethod · 0.45
NewInstanceMethod · 0.45
ModifiedMethod · 0.45

Tested by 8

TestExtentFunction · 0.36
TestCoordsFunction · 0.36
TestDataFailuresFunction · 0.36
TestPointsFunction · 0.36
TestDataSetFailuresFunction · 0.36
TestTableFailuresFunction · 0.36