------------------------------------------------------------------------------ Update the progress of the process object. If a ProgressMethod exists, executes it. Then set the Progress ivar to amount. The parameter amount should range between (0,1).
| 201 | // executes it. Then set the Progress ivar to amount. The parameter amount |
| 202 | // should range between (0,1). |
| 203 | void vtkAlgorithm::UpdateProgress(double amount) |
| 204 | { |
| 205 | amount = this->GetProgressShift() + this->GetProgressScale() * amount; |
| 206 | |
| 207 | // clamp to [0, 1]. |
| 208 | amount = vtkMath::Min(amount, 1.0); |
| 209 | amount = vtkMath::Max(amount, 0.0); |
| 210 | |
| 211 | if (this->ProgressObserver) |
| 212 | { |
| 213 | this->ProgressObserver->UpdateProgress(amount); |
| 214 | } |
| 215 | else |
| 216 | { |
| 217 | this->Progress = amount; |
| 218 | this->InvokeEvent(vtkCommand::ProgressEvent, static_cast<void*>(&amount)); |
| 219 | } |
| 220 | } |
| 221 | |
| 222 | //------------------------------------------------------------------------------ |
| 223 | // Check to see if an input's ABORTED flag is set or if an upstream |
no test coverage detected