------------------------------------------------------------------------------
| 67 | |
| 68 | //------------------------------------------------------------------------------ |
| 69 | int vtkHyperTreeGridDepthLimiter::ProcessTrees(vtkHyperTreeGrid* input, vtkDataObject* outputDO) |
| 70 | { |
| 71 | // Downcast output data object to hyper tree grid |
| 72 | vtkHyperTreeGrid* output = vtkHyperTreeGrid::SafeDownCast(outputDO); |
| 73 | if (!output) |
| 74 | { |
| 75 | vtkErrorMacro("Incorrect type of output: " << outputDO->GetClassName()); |
| 76 | return 0; |
| 77 | } |
| 78 | |
| 79 | if (this->JustCreateNewMask) |
| 80 | { |
| 81 | output->ShallowCopy(input); |
| 82 | output->SetDepthLimiter(this->Depth); |
| 83 | return 1; |
| 84 | } |
| 85 | |
| 86 | // Retrieve material mask |
| 87 | this->InMask = input->HasMask() ? input->GetMask() : nullptr; |
| 88 | |
| 89 | // Set grid parameters |
| 90 | output->SetDimensions(input->GetDimensions()); |
| 91 | output->SetTransposedRootIndexing(input->GetTransposedRootIndexing()); |
| 92 | output->SetBranchFactor(input->GetBranchFactor()); |
| 93 | output->CopyCoordinates(input); |
| 94 | output->SetHasInterface(input->GetHasInterface()); |
| 95 | output->SetInterfaceNormalsName(input->GetInterfaceNormalsName()); |
| 96 | output->SetInterfaceInterceptsName(input->GetInterfaceInterceptsName()); |
| 97 | |
| 98 | // Initialize output point data |
| 99 | this->InData = input->GetCellData(); |
| 100 | this->OutData = output->GetCellData(); |
| 101 | this->OutData->CopyAllocate(this->InData); |
| 102 | |
| 103 | // Create material mask bit array if one is present on input |
| 104 | if (!this->OutMask && input->HasMask()) |
| 105 | { |
| 106 | this->OutMask = vtkBitArray::New(); |
| 107 | } |
| 108 | |
| 109 | // Output indices begin at 0 |
| 110 | this->CurrentId = 0; |
| 111 | |
| 112 | // Iterate over all input and output hyper trees |
| 113 | vtkIdType inIndex; |
| 114 | vtkHyperTreeGrid::vtkHyperTreeGridIterator it; |
| 115 | input->InitializeTreeIterator(it); |
| 116 | vtkNew<vtkHyperTreeGridNonOrientedCursor> inCursor; |
| 117 | vtkNew<vtkHyperTreeGridNonOrientedCursor> outCursor; |
| 118 | while (it.GetNextTree(inIndex)) |
| 119 | { |
| 120 | if (this->CheckAbort()) |
| 121 | { |
| 122 | break; |
| 123 | } |
| 124 | // Initialize new grid cursor at root of current input tree |
| 125 | input->InitializeNonOrientedCursor(inCursor, inIndex); |
| 126 |
nothing calls this directly
no test coverage detected