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

Method RequestData

IO/Geometry/vtkWindBladeReader.cxx:369–409  ·  view source on GitHub ↗

------------------------------------------------------------------------------ RequestData populates the output object with data for rendering Uses three output ports (field, turbine blades, and ground). Field data is parallel, blade and ground only on processor 0 ------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

367// Field data is parallel, blade and ground only on processor 0
368//------------------------------------------------------------------------------
369int vtkWindBladeReader::RequestData(vtkInformation* reqInfo,
370 vtkInformationVector** vtkNotUsed(inVector), vtkInformationVector* outVector)
371{
372 int port = reqInfo->Get(vtkDemandDrivenPipeline::FROM_OUTPUT_PORT());
373
374 // Request data for field port
375 if (port == 0)
376 {
377 std::ostringstream fileName;
378 vtkStructuredGrid* field = this->GetFieldOutput();
379 this->InitFieldData(outVector, fileName, field);
380 this->Internal->FilePtr = vtksys::SystemTools::Fopen(fileName.str(), "rb");
381 if (this->Internal->FilePtr == nullptr)
382 {
383 vtkWarningMacro(<< "Could not open file " << fileName.str());
384 return 0;
385 }
386 this->SetUpFieldVars(field);
387 // Close file after all data is read
388 fclose(this->Internal->FilePtr);
389
390 return 1;
391 }
392 // Request data is on blade
393 // Even if the blade is turned off, it must update with time along with field
394 else if (port == 1)
395 {
396 if (this->UseTurbineFile == 1)
397 {
398 this->InitBladeData(outVector);
399 }
400 return 1;
401 }
402 // Request data in on ground
403 else if (port == 2)
404 {
405 this->SetUpGroundData(outVector);
406 }
407
408 return 1;
409}
410
411//------------------------------------------------------------------------------
412// Divide data variable by density for display

Callers

nothing calls this directly

Calls 7

GetFieldOutputMethod · 0.95
InitFieldDataMethod · 0.95
SetUpFieldVarsMethod · 0.95
InitBladeDataMethod · 0.95
SetUpGroundDataMethod · 0.95
GetMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected