----------------------------------------------------------------------------
| 3503 | |
| 3504 | //---------------------------------------------------------------------------- |
| 3505 | void CloneCellData(vtkPointSet* ps, vtkPointSet* clone, ::UnstructuredDataInformation& info) |
| 3506 | { |
| 3507 | vtkCellData* cloneCellData = clone->GetCellData(); |
| 3508 | vtkCellData* psCellData = ps->GetCellData(); |
| 3509 | cloneCellData->CopyAllOn(); |
| 3510 | cloneCellData->CopyAllocate(psCellData, clone->GetNumberOfCells()); |
| 3511 | cloneCellData->SetNumberOfTuples(clone->GetNumberOfCells()); |
| 3512 | |
| 3513 | if (vtkIdList* redirectionMap = info.OutputToInputCellIdRedirectionMap) |
| 3514 | { |
| 3515 | for (int arrayId = 0; arrayId < cloneCellData->GetNumberOfArrays(); ++arrayId) |
| 3516 | { |
| 3517 | psCellData->GetAbstractArray(arrayId)->GetTuples( |
| 3518 | redirectionMap, cloneCellData->GetAbstractArray(arrayId)); |
| 3519 | } |
| 3520 | } |
| 3521 | else |
| 3522 | { |
| 3523 | for (int arrayId = 0; arrayId < cloneCellData->GetNumberOfArrays(); ++arrayId) |
| 3524 | { |
| 3525 | vtkAbstractArray* sourceArray = psCellData->GetAbstractArray(arrayId); |
| 3526 | sourceArray->GetTuples( |
| 3527 | 0, sourceArray->GetNumberOfTuples() - 1, cloneCellData->GetAbstractArray(arrayId)); |
| 3528 | } |
| 3529 | } |
| 3530 | // We need to initialize newly allocated ghosts to zero |
| 3531 | if (vtkUnsignedCharArray* ghostCells = cloneCellData->GetGhostArray()) |
| 3532 | { |
| 3533 | auto ghostRange = vtk::DataArrayValueRange<1>(ghostCells); |
| 3534 | std::fill(ghostRange.begin() + info.NumberOfInputCells, ghostRange.end(), 0); |
| 3535 | } |
| 3536 | } |
| 3537 | |
| 3538 | //---------------------------------------------------------------------------- |
| 3539 | void ClonePointData(vtkPointSet* ps, vtkPointSet* clone, ::UnstructuredDataInformation& info) |
no test coverage detected