------------------------------------------------------------------------------
| 69 | |
| 70 | //------------------------------------------------------------------------------ |
| 71 | int vtkHyperTreeGridRemoveGhostCells::ProcessTrees(vtkHyperTreeGrid* input, vtkDataObject* outputDO) |
| 72 | { |
| 73 | // Downcast output data object to hyper tree grid |
| 74 | vtkHyperTreeGrid* output = vtkHyperTreeGrid::SafeDownCast(outputDO); |
| 75 | if (!output) |
| 76 | { |
| 77 | vtkErrorMacro("Incorrect type of output: " << outputDO->GetClassName()); |
| 78 | return 0; |
| 79 | } |
| 80 | |
| 81 | output->ShallowCopy(input); |
| 82 | |
| 83 | // Retrieve ghost array |
| 84 | if (!input->HasAnyGhostCells()) |
| 85 | { |
| 86 | vtkWarningMacro(<< "Input does not have a ghost array. Filter will do nothing."); |
| 87 | output->SetMask(input->GetMask()); |
| 88 | return 1; |
| 89 | } |
| 90 | |
| 91 | // Retrieve and copy input mask if it exists |
| 92 | vtkNew<vtkBitArray> outMask; |
| 93 | if (input->HasMask()) |
| 94 | { |
| 95 | outMask->DeepCopy(input->GetMask()); |
| 96 | } |
| 97 | else |
| 98 | { |
| 99 | outMask->SetNumberOfTuples(output->GetNumberOfCells()); |
| 100 | } |
| 101 | output->SetMask(outMask); |
| 102 | |
| 103 | // Iterate over output HTG and mask ghost cells |
| 104 | vtkIdType inIndex = 0; |
| 105 | vtkHyperTreeGrid::vtkHyperTreeGridIterator it; |
| 106 | output->InitializeTreeIterator(it); |
| 107 | vtkNew<vtkHyperTreeGridNonOrientedCursor> outCursor; |
| 108 | while (it.GetNextTree(inIndex)) |
| 109 | { |
| 110 | if (this->CheckAbort()) |
| 111 | { |
| 112 | break; |
| 113 | } |
| 114 | |
| 115 | output->InitializeNonOrientedCursor(outCursor, inIndex, true); |
| 116 | ::RecursivelyMaskGhost(outCursor, input->GetMask(), input->GetGhostCells()); |
| 117 | } |
| 118 | |
| 119 | // Remove ghost cells array |
| 120 | output->GetCellData()->RemoveArray(input->GetGhostCells()->GetName()); |
| 121 | |
| 122 | return 1; |
| 123 | } |
| 124 | VTK_ABI_NAMESPACE_END |
nothing calls this directly
no test coverage detected