------------------------------------------------------------------------------
| 244 | |
| 245 | //------------------------------------------------------------------------------ |
| 246 | int vtkHyperTreeGridAxisClip::ProcessTrees(vtkHyperTreeGrid* input, vtkDataObject* outputDO) |
| 247 | { |
| 248 | // Downcast output data object to hyper tree grid |
| 249 | vtkHyperTreeGrid* output = vtkHyperTreeGrid::SafeDownCast(outputDO); |
| 250 | if (!output) |
| 251 | { |
| 252 | vtkErrorMacro("Incorrect type of output: " << outputDO->GetClassName()); |
| 253 | return 0; |
| 254 | } |
| 255 | |
| 256 | this->OutMask = vtkBitArray::New(); |
| 257 | |
| 258 | // Retrieve input dimension |
| 259 | unsigned int dimension = input->GetDimension(); |
| 260 | |
| 261 | // This filter works only with 3D grids |
| 262 | if (dimension == 2 && static_cast<unsigned int>(this->PlaneNormalAxis) == input->GetOrientation()) |
| 263 | { |
| 264 | vtkErrorMacro(<< "In 2D axis clip direction cannot be normal to grid plane:" |
| 265 | << input->GetOrientation()); |
| 266 | return 0; |
| 267 | } |
| 268 | else if (dimension == 1 && |
| 269 | static_cast<unsigned int>(this->PlaneNormalAxis) == input->GetOrientation()) |
| 270 | { |
| 271 | vtkErrorMacro(<< "In 1D axis clip direction cannot be that of grid axis:" |
| 272 | << input->GetOrientation()); |
| 273 | return 0; |
| 274 | } |
| 275 | |
| 276 | // Set identical grid parameters |
| 277 | output->Initialize(); |
| 278 | output->CopyEmptyStructure(input); |
| 279 | |
| 280 | // Initialize output point data |
| 281 | this->InData = input->GetCellData(); |
| 282 | this->OutData = output->GetCellData(); |
| 283 | this->OutData->CopyAllocate(this->InData); |
| 284 | |
| 285 | // Output indices begin at 0 |
| 286 | this->CurrentId = 0; |
| 287 | |
| 288 | // Retrieve material mask |
| 289 | this->InMask = input->HasMask() ? input->GetMask() : nullptr; |
| 290 | |
| 291 | // Storage for Cartesian indices |
| 292 | unsigned int cart[3]; |
| 293 | |
| 294 | // Storage for global indices of clipped out root cells |
| 295 | std::set<vtkIdType> clipped; |
| 296 | |
| 297 | // First pass across tree roots: compute extent of output grid indices |
| 298 | unsigned int inSize[3]; |
| 299 | input->GetCellDims(inSize); |
| 300 | |
| 301 | unsigned int minId[] = { 0, 0, 0 }; |
| 302 | unsigned int maxId[] = { 0, 0, 0 }; |
| 303 | unsigned int outSize[3]; |
nothing calls this directly
no test coverage detected