MCPcopy Create free account
hub / github.com/Kitware/VTK / RequestData

Method RequestData

Filters/Sources/vtkHyperTreeGridSource.cxx:350–596  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

348
349//------------------------------------------------------------------------------
350int 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:

Callers

nothing calls this directly

Calls 15

ProcessTreesMethod · 0.95
GetInformationObjectMethod · 0.80
SetBranchFactorMethod · 0.80
SetVectorsMethod · 0.80
GetDataFunction · 0.50
GetClassNameMethod · 0.45
GetMethod · 0.45
InitializeMethod · 0.45
SetMaskMethod · 0.45
GetCellDataMethod · 0.45

Tested by

no test coverage detected