------------------------------------------------------------------------------
| 348 | |
| 349 | //------------------------------------------------------------------------------ |
| 350 | int vtkHyperTreeGridSource::RequestData( |
| 351 | vtkInformation*, vtkInformationVector**, vtkInformationVector* outputVector) |
| 352 | { |
| 353 | // Retrieve the output |
| 354 | vtkDataObject* outputDO = vtkDataObject::GetData(outputVector, 0); |
| 355 | vtkHyperTreeGrid* output = vtkHyperTreeGrid::SafeDownCast(outputDO); |
| 356 | if (!output) |
| 357 | { |
| 358 | vtkErrorMacro("pre: output_not_HyperTreeGrid: " << outputDO->GetClassName()); |
| 359 | return 0; |
| 360 | } |
| 361 | |
| 362 | vtkInformation* outInfo = outputVector->GetInformationObject(0); |
| 363 | this->Piece = outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_PIECE_NUMBER()); |
| 364 | this->NumPieces = outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_PIECES()); |
| 365 | |
| 366 | output->Initialize(); |
| 367 | |
| 368 | // A mask is required when using UseMask or when assigning trees to pieces, |
| 369 | // so we create it every time. |
| 370 | vtkNew<vtkBitArray> mask; |
| 371 | output->SetMask(mask); |
| 372 | |
| 373 | vtkCellData* outData = output->GetCellData(); |
| 374 | |
| 375 | this->LevelBitsIndexCnt.clear(); |
| 376 | this->LevelBitsIndexCnt.push_back(0); |
| 377 | |
| 378 | // When using descriptor-based definition, initialize descriptor parsing |
| 379 | if (this->UseDescriptor) |
| 380 | { |
| 381 | // Calculate refined block size |
| 382 | this->BlockSize = this->BranchFactor; |
| 383 | for (unsigned int i = 1; i < this->Dimension; ++i) |
| 384 | { |
| 385 | this->BlockSize *= this->BranchFactor; |
| 386 | } |
| 387 | |
| 388 | if (!this->DescriptorBits && !this->InitializeFromStringDescriptor()) |
| 389 | { |
| 390 | vtkErrorMacro(<< "Could not initialize string descriptor."); |
| 391 | return 0; |
| 392 | } |
| 393 | else if (this->DescriptorBits && !this->InitializeFromBitsDescriptor()) |
| 394 | { |
| 395 | vtkErrorMacro(<< "Could not initialize bits descriptor."); |
| 396 | return 0; |
| 397 | } |
| 398 | } // if this->UseDescriptor |
| 399 | |
| 400 | // Set straightforward grid parameters |
| 401 | output->SetTransposedRootIndexing(this->TransposedRootIndexing); |
| 402 | output->SetBranchFactor(this->BranchFactor); |
| 403 | |
| 404 | // Set parameters that depend on dimension |
| 405 | switch (this->Dimension) |
| 406 | { |
| 407 | case 1: |
nothing calls this directly
no test coverage detected