------------------------------------------------------------------------------
| 1073 | |
| 1074 | //------------------------------------------------------------------------------ |
| 1075 | void vtkHyperTreeGrid::DeepCopy(vtkDataObject* src) |
| 1076 | { |
| 1077 | assert("pre: src_exists" && src != nullptr); |
| 1078 | vtkHyperTreeGrid* htg = vtkHyperTreeGrid::SafeDownCast(src); |
| 1079 | assert("pre: same_type" && htg != nullptr); |
| 1080 | |
| 1081 | // Copy grid parameters |
| 1082 | this->Dimension = htg->Dimension; |
| 1083 | this->Orientation = htg->Orientation; |
| 1084 | this->BranchFactor = htg->BranchFactor; |
| 1085 | this->NumberOfChildren = htg->NumberOfChildren; |
| 1086 | this->DepthLimiter = htg->DepthLimiter; |
| 1087 | this->TransposedRootIndexing = htg->TransposedRootIndexing; |
| 1088 | memcpy(this->Axis, htg->GetAxes(), 2 * sizeof(unsigned int)); |
| 1089 | |
| 1090 | this->HasInterface = htg->HasInterface; |
| 1091 | this->SetInterfaceNormalsName(htg->InterfaceNormalsName); |
| 1092 | this->SetInterfaceInterceptsName(htg->InterfaceInterceptsName); |
| 1093 | |
| 1094 | if (htg->Mask) |
| 1095 | { |
| 1096 | vtkNew<vtkBitArray> mask; |
| 1097 | this->SetMask(mask); |
| 1098 | this->Mask->DeepCopy(htg->Mask); |
| 1099 | } |
| 1100 | |
| 1101 | if (htg->PureMask) |
| 1102 | { |
| 1103 | if (!this->PureMask) |
| 1104 | { |
| 1105 | this->PureMask = vtkBitArray::New(); |
| 1106 | } |
| 1107 | this->PureMask->DeepCopy(htg->PureMask); |
| 1108 | } |
| 1109 | |
| 1110 | this->CellData->DeepCopy(htg->GetCellData()); |
| 1111 | |
| 1112 | // Rectilinear part |
| 1113 | memcpy(this->Dimensions, htg->GetDimensions(), 3 * sizeof(unsigned int)); |
| 1114 | memcpy(this->Extent, htg->GetExtent(), 6 * sizeof(int)); |
| 1115 | memcpy(this->CellDims, htg->GetCellDims(), 3 * sizeof(unsigned int)); |
| 1116 | this->DataDescription = htg->DataDescription; |
| 1117 | |
| 1118 | this->WithCoordinates = htg->WithCoordinates; |
| 1119 | |
| 1120 | if (this->WithCoordinates) |
| 1121 | { |
| 1122 | vtkDoubleArray* s; |
| 1123 | s = vtkDoubleArray::New(); |
| 1124 | s->DeepCopy(htg->XCoordinates); |
| 1125 | this->SetXCoordinates(s); |
| 1126 | s->Delete(); |
| 1127 | s = vtkDoubleArray::New(); |
| 1128 | s->DeepCopy(htg->YCoordinates); |
| 1129 | this->SetYCoordinates(s); |
| 1130 | s->Delete(); |
| 1131 | s = vtkDoubleArray::New(); |
| 1132 | s->DeepCopy(htg->ZCoordinates); |
no test coverage detected