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

Method ProcessRequest

IO/XML/vtkXMLTableWriter.cxx:72–219  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

70
71//------------------------------------------------------------------------------
72vtkTypeBool vtkXMLTableWriter::ProcessRequest(
73 vtkInformation* request, vtkInformationVector** inputVector, vtkInformationVector* outputVector)
74{
75
76 if (request->Has(vtkStreamingDemandDrivenPipeline::REQUEST_UPDATE_EXTENT()))
77 {
78 if ((this->WritePiece < 0) || (this->WritePiece >= this->NumberOfPieces))
79 {
80 this->SetInputUpdateExtent(this->CurrentPiece, this->NumberOfPieces);
81 }
82 else
83 {
84 this->SetInputUpdateExtent(this->WritePiece, this->NumberOfPieces);
85 }
86 return 1;
87 }
88
89 // generate the data
90 else if (request->Has(vtkDemandDrivenPipeline::REQUEST_DATA()))
91 {
92 this->SetErrorCode(vtkErrorCode::NoError);
93
94 if (!this->Stream && !this->FileName && !this->WriteToOutputString)
95 {
96 this->SetErrorCode(vtkErrorCode::NoFileNameError);
97 vtkErrorMacro("The FileName or Stream must be set first or "
98 "the output must be written to a string.");
99 return 0;
100 }
101
102 int numPieces = this->NumberOfPieces;
103
104 if (this->WritePiece >= 0)
105 {
106 this->CurrentPiece = this->WritePiece;
107 }
108 else
109 {
110 float wholeProgressRange[2] = { 0, 1 };
111 this->SetProgressRange(wholeProgressRange, this->CurrentPiece, this->NumberOfPieces);
112 }
113
114 int result = 1;
115 if ((this->CurrentPiece == 0 && this->CurrentTimeIndex == 0) || this->WritePiece >= 0)
116 {
117 // We are just starting to write. Do not call
118 // UpdateProgressDiscrete because we want a 0 progress callback the
119 // first time.
120 this->UpdateProgress(0);
121
122 // Initialize progress range to entire 0..1 range.
123 if (this->WritePiece >= 0)
124 {
125 float wholeProgressRange[2] = { 0, 1 };
126 this->SetProgressRange(wholeProgressRange, 0, 1);
127 }
128
129 if (!this->OpenStream())

Callers

nothing calls this directly

Calls 15

SetInputUpdateExtentMethod · 0.95
WriteHeaderMethod · 0.95
DeletePositionArraysMethod · 0.95
WriteAPieceMethod · 0.95
WriteFooterMethod · 0.95
SetProgressPartialMethod · 0.80
HasMethod · 0.45
SetProgressRangeMethod · 0.45
UpdateProgressMethod · 0.45
OpenStreamMethod · 0.45
GetDataSetInputMethod · 0.45

Tested by

no test coverage detected