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

Method RequestData

IO/XML/vtkXMLWriter.cxx:536–572  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

534
535//------------------------------------------------------------------------------
536int 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//------------------------------------------------------------------------------
575int vtkXMLWriter::OpenStream()

Callers 1

ProcessRequestMethod · 0.95

Calls 5

SetProgressRangeMethod · 0.95
WriteInternalMethod · 0.95
DeleteAFileMethod · 0.95
UpdateProgressMethod · 0.45

Tested by

no test coverage detected