------------------------------------------------------------------------------
| 343 | |
| 344 | //------------------------------------------------------------------------------ |
| 345 | int vtkXMLMultiBlockDataReader::RequestInformation( |
| 346 | vtkInformation* request, vtkInformationVector** inputVector, vtkInformationVector* outputVector) |
| 347 | { |
| 348 | this->Superclass::RequestInformation(request, inputVector, outputVector); |
| 349 | |
| 350 | if (this->GetFileMajorVersion() < 1) |
| 351 | { |
| 352 | return 1; |
| 353 | } |
| 354 | |
| 355 | // HACK: for now, if this is a multiblock of multipieces alone, |
| 356 | // we can use a piece-based strategy for distributing pieces. |
| 357 | bool is_multiblock_of_multipieces = true; |
| 358 | auto elem = this->GetPrimaryElement(); |
| 359 | for (unsigned int cc = 0, max = elem->GetNumberOfNestedElements(); |
| 360 | is_multiblock_of_multipieces && cc < max; ++cc) |
| 361 | { |
| 362 | auto childXML = elem->GetNestedElement(cc); |
| 363 | if (childXML == nullptr || childXML->GetName() == nullptr) |
| 364 | { |
| 365 | continue; |
| 366 | } |
| 367 | |
| 368 | is_multiblock_of_multipieces = (strcmp(childXML->GetName(), "Piece") == 0); |
| 369 | } |
| 370 | this->DistributePiecesInMultiPieces = is_multiblock_of_multipieces; |
| 371 | |
| 372 | const std::string filePath = this->GetFilePath(); |
| 373 | vtkInformation* info = outputVector->GetInformationObject(0); |
| 374 | vtkSmartPointer<vtkMultiBlockDataSet> metadata = vtkSmartPointer<vtkMultiBlockDataSet>::New(); |
| 375 | unsigned int dataSetIndex = 0; |
| 376 | if (!this->FillMetaData(metadata, this->GetPrimaryElement(), filePath, dataSetIndex)) |
| 377 | { |
| 378 | return 0; |
| 379 | } |
| 380 | info->Set(vtkCompositeDataPipeline::COMPOSITE_DATA_META_DATA(), metadata); |
| 381 | |
| 382 | return 1; |
| 383 | } |
| 384 | VTK_ABI_NAMESPACE_END |
nothing calls this directly
no test coverage detected