------------------------------------------------------------------------------ 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 ------------------------------------------------------------------------------
| 367 | // Field data is parallel, blade and ground only on processor 0 |
| 368 | //------------------------------------------------------------------------------ |
| 369 | int 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 |
nothing calls this directly
no test coverage detected