------------------------------------------------------------------------------
| 1384 | |
| 1385 | //------------------------------------------------------------------------------ |
| 1386 | void vtkUnstructuredGrid::DeepCopy(vtkDataObject* dataObject) |
| 1387 | { |
| 1388 | auto mkhold = vtkMemkindRAII(this->GetIsInMemkind()); |
| 1389 | vtkUnstructuredGrid* grid = vtkUnstructuredGrid::SafeDownCast(dataObject); |
| 1390 | |
| 1391 | if (grid) |
| 1392 | { |
| 1393 | // Skip the unstructured grid base implementation, as it uses a less |
| 1394 | // efficient method of copying cell data. |
| 1395 | // NOLINTNEXTLINE(bugprone-parent-virtual-call) |
| 1396 | this->vtkUnstructuredGridBase::Superclass::DeepCopy(grid); |
| 1397 | |
| 1398 | if (grid->Connectivity) |
| 1399 | { |
| 1400 | this->Connectivity = vtkSmartPointer<vtkCellArray>::New(); |
| 1401 | this->Connectivity->DeepCopy(grid->Connectivity); |
| 1402 | } |
| 1403 | else |
| 1404 | { |
| 1405 | this->Connectivity = nullptr; |
| 1406 | } |
| 1407 | if (grid->Types) |
| 1408 | { |
| 1409 | this->Types = vtk::TakeSmartPointer(grid->Types->NewInstance()); |
| 1410 | this->Types->DeepCopy(grid->Types); |
| 1411 | } |
| 1412 | else |
| 1413 | { |
| 1414 | this->Types = nullptr; |
| 1415 | } |
| 1416 | if (grid->DistinctCellTypes) |
| 1417 | { |
| 1418 | this->DistinctCellTypes = vtkSmartPointer<vtkCellTypes>::New(); |
| 1419 | this->DistinctCellTypes->DeepCopy(grid->DistinctCellTypes); |
| 1420 | } |
| 1421 | else |
| 1422 | { |
| 1423 | this->DistinctCellTypes = nullptr; |
| 1424 | } |
| 1425 | if (grid->Faces) |
| 1426 | { |
| 1427 | this->Faces = vtkSmartPointer<vtkCellArray>::New(); |
| 1428 | this->Faces->DeepCopy(grid->Faces); |
| 1429 | } |
| 1430 | else |
| 1431 | { |
| 1432 | this->Faces = nullptr; |
| 1433 | } |
| 1434 | if (grid->FaceLocations) |
| 1435 | { |
| 1436 | this->FaceLocations = vtkSmartPointer<vtkCellArray>::New(); |
| 1437 | this->FaceLocations->DeepCopy(grid->FaceLocations); |
| 1438 | } |
| 1439 | else |
| 1440 | { |
| 1441 | this->FaceLocations = nullptr; |
| 1442 | } |
| 1443 | if (grid->Links) |
no test coverage detected