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