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

Method RequestData

IO/NetCDF/vtkMPASReader.cxx:1128–1201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1126//------------------------------------------------------------------------------
1127
1128int vtkMPASReader::RequestData(vtkInformation* vtkNotUsed(reqInfo),
1129 vtkInformationVector** vtkNotUsed(inVector), vtkInformationVector* outVector)
1130{
1131 vtkDebugMacro(<< "In vtkMPASReader::RequestData" << endl);
1132
1133 // get the info object
1134 vtkInformation* outInfo = outVector->GetInformationObject(0);
1135
1136 // Output will be an ImageData
1137 vtkUnstructuredGrid* output =
1138 vtkUnstructuredGrid::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT()));
1139
1140 this->DestroyData();
1141 if (!this->ReadAndOutputGrid())
1142 {
1143 this->DestroyData();
1144 return 0;
1145 }
1146
1147 // Collect the time step requested
1148 this->DTime = 0;
1149 if (outInfo->Has(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEP()))
1150 {
1151 this->DTime = outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEP());
1152 }
1153 output->GetInformation()->Set(vtkDataObject::DATA_TIME_STEP(), this->DTime);
1154
1155 // Examine each variable to see if it is selected
1156 int numPointVars = static_cast<int>(this->Internals->pointVars.size());
1157 for (int var = 0; var < numPointVars; var++)
1158 {
1159 // Is this variable requested
1160 if (this->PointDataArraySelection->GetArraySetting(var))
1161 {
1162 vtkDataArray* array = this->LoadPointVarData(var);
1163 if (!array)
1164 {
1165 char name[NC_MAX_NAME + 1];
1166 if (!this->Internals->nc_err(
1167 nc_inq_varname(this->Internals->ncFile, this->Internals->pointVars[var], name)))
1168 {
1169 vtkWarningMacro(<< "Error loading point variable '" << name << "'.");
1170 }
1171 continue;
1172 }
1173 output->GetPointData()->AddArray(array);
1174 }
1175 }
1176
1177 int numCellVars = static_cast<int>(this->Internals->cellVars.size());
1178 for (int var = 0; var < numCellVars; var++)
1179 {
1180 if (this->CellDataArraySelection->GetArraySetting(var))
1181 {
1182 vtkDataArray* array = this->LoadCellVarData(var);
1183 if (!array)
1184 {
1185 char name[NC_MAX_NAME + 1];

Callers

nothing calls this directly

Calls 15

DestroyDataMethod · 0.95
ReadAndOutputGridMethod · 0.95
LoadPointVarDataMethod · 0.95
LoadCellVarDataMethod · 0.95
LoadTimeFieldDataMethod · 0.95
nc_inq_varnameFunction · 0.85
GetInformationObjectMethod · 0.80
GetMethod · 0.45
HasMethod · 0.45
SetMethod · 0.45
GetInformationMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected