------------------------------------------------------------------------------
| 534 | |
| 535 | //------------------------------------------------------------------------------ |
| 536 | int vtkXMLWriter::RequestData(vtkInformation* vtkNotUsed(request), |
| 537 | vtkInformationVector** vtkNotUsed(inputVector), vtkInformationVector* vtkNotUsed(outputVector)) |
| 538 | { |
| 539 | this->SetErrorCode(vtkErrorCode::NoError); |
| 540 | |
| 541 | // Make sure we have a file to write. |
| 542 | if (!this->Stream && !this->FileName && !this->WriteToOutputString) |
| 543 | { |
| 544 | vtkErrorMacro("Writer called with no FileName set."); |
| 545 | this->SetErrorCode(vtkErrorCode::NoFileNameError); |
| 546 | return 0; |
| 547 | } |
| 548 | |
| 549 | // We are just starting to write. Do not call |
| 550 | // UpdateProgressDiscrete because we want a 0 progress callback the |
| 551 | // first time. |
| 552 | this->UpdateProgress(0); |
| 553 | |
| 554 | // Initialize progress range to entire 0..1 range. |
| 555 | float wholeProgressRange[2] = { 0.f, 1.f }; |
| 556 | this->SetProgressRange(wholeProgressRange, 0, 1); |
| 557 | |
| 558 | // Check input validity and call the real writing code. |
| 559 | int result = this->WriteInternal(); |
| 560 | |
| 561 | // If writing failed, delete the file. |
| 562 | if (!result) |
| 563 | { |
| 564 | vtkErrorMacro("Ran out of disk space; deleting file: " << this->FileName); |
| 565 | this->DeleteAFile(); |
| 566 | } |
| 567 | |
| 568 | // We have finished writing. |
| 569 | this->UpdateProgressDiscrete(1); |
| 570 | |
| 571 | return result; |
| 572 | } |
| 573 | |
| 574 | //------------------------------------------------------------------------------ |
| 575 | int vtkXMLWriter::OpenStream() |
no test coverage detected