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

Method RequestData

IO/NetCDF/vtkNetCDFUGRIDReader.cxx:118–195  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

116
117//--------------------------------------------------------------------------------------------------
118int vtkNetCDFUGRIDReader::RequestData(
119 vtkInformation*, vtkInformationVector**, vtkInformationVector* outputVector)
120{
121 this->UpdateProgress(0.0);
122
123 if (!this->Open())
124 {
125 vtkErrorMacro("Can not open file.");
126 return 0;
127 }
128
129 this->UpdateProgress(0.125);
130
131 if (!this->ParseHeader())
132 {
133 vtkErrorMacro("Can not parse header.");
134 this->Close();
135 return 0;
136 }
137
138 vtkInformation* outInfo = outputVector->GetInformationObject(0);
139 vtkUnstructuredGrid* output =
140 vtkUnstructuredGrid::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT()));
141
142 vtkInformationDoubleKey* timeKey =
143 vtkInformationDoubleKey::SafeDownCast(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEP());
144
145 double time{};
146 if (outInfo->Has(timeKey))
147 {
148 time = outInfo->Get(timeKey);
149 }
150
151 output->GetInformation()->Set(vtkDataObject::DATA_TIME_STEP(), time);
152
153 std::size_t timeStep{};
154 for (std::size_t step{}; step < this->TimeSteps.size(); step++)
155 {
156 if (this->TimeSteps[step] >= time)
157 {
158 timeStep = step;
159 break;
160 }
161 }
162
163 this->UpdateProgress(0.25);
164
165 if (!this->FillPoints(output))
166 {
167 vtkErrorMacro("Failed to get point data");
168 this->Close();
169 return 0;
170 }
171
172 this->UpdateProgress(0.5);
173
174 if (!this->FillCells(output))
175 {

Callers

nothing calls this directly

Calls 13

OpenMethod · 0.95
ParseHeaderMethod · 0.95
CloseMethod · 0.95
FillPointsMethod · 0.95
FillCellsMethod · 0.95
FillArraysMethod · 0.95
GetInformationObjectMethod · 0.80
UpdateProgressMethod · 0.45
GetMethod · 0.45
HasMethod · 0.45
SetMethod · 0.45
GetInformationMethod · 0.45

Tested by

no test coverage detected