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

Method RequestInformation

IO/XML/vtkXMLMultiBlockDataReader.cxx:345–383  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

343
344//------------------------------------------------------------------------------
345int 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}
384VTK_ABI_NAMESPACE_END

Callers

nothing calls this directly

Calls 9

FillMetaDataMethod · 0.95
GetPrimaryElementMethod · 0.80
GetNestedElementMethod · 0.80
GetInformationObjectMethod · 0.80
NewFunction · 0.50
GetNameMethod · 0.45
GetFilePathMethod · 0.45
SetMethod · 0.45

Tested by

no test coverage detected