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

Method RequestData

IO/NetCDF/vtkNetCDFCFReader.cxx:954–1099  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

952
953//------------------------------------------------------------------------------
954int vtkNetCDFCFReader::RequestData(
955 vtkInformation* request, vtkInformationVector** inputVector, vtkInformationVector* outputVector)
956{
957 // If the output does not directly support 3D extents, then we have to make
958 // some from the piece information so the superclass knows what portion of
959 // arrays to load.
960 vtkDataObject* output = vtkDataObject::GetData(outputVector);
961 if (output)
962 {
963 if (output->GetExtentType() == VTK_3D_EXTENT)
964 {
965 // Do nothing. 3D extents already set.
966 }
967 else if (output->GetExtentType() == VTK_PIECES_EXTENT)
968 {
969 int pieceNumber, numberOfPieces, ghostLevels;
970 vtkInformation* outInfo = outputVector->GetInformationObject(0);
971 pieceNumber = outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_PIECE_NUMBER());
972 numberOfPieces = outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_PIECES());
973 ghostLevels = outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_GHOST_LEVELS());
974
975 int extent[6];
976 this->ExtentForDimensionsAndPiece(pieceNumber, numberOfPieces, ghostLevels, extent);
977
978 // Store the update extent in the output's information object to make it
979 // easy to find whenever loading data for this object.
980 output->GetInformation()->Set(vtkStreamingDemandDrivenPipeline::UPDATE_EXTENT(), extent, 6);
981 }
982 else
983 {
984 vtkWarningMacro(<< "Invalid extent type encountered. Data arrays may"
985 << " be loaded incorrectly.");
986 }
987 }
988 else // output == nullptr
989 {
990 vtkErrorMacro(<< "No output object.");
991 return 0;
992 }
993
994 // Let the superclass do the heavy lifting.
995 if (!this->Superclass::RequestData(request, inputVector, outputVector))
996 {
997 return 0;
998 }
999
1000 // Add spacing information defined by the COARDS conventions.
1001
1002 vtkImageData* imageOutput = vtkImageData::GetData(outputVector);
1003 if (imageOutput)
1004 {
1005 this->AddRectilinearCoordinates(imageOutput);
1006 }
1007
1008 vtkRectilinearGrid* rectilinearOutput = vtkRectilinearGrid::GetData(outputVector);
1009 if (rectilinearOutput)
1010 {
1011 switch (this->CoordinateType(this->LoadingDimensions))

Callers

nothing calls this directly

Tested by

no test coverage detected