VTK  9.3.1
vtkStreamingDemandDrivenPipeline.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
20 #ifndef vtkStreamingDemandDrivenPipeline_h
21 #define vtkStreamingDemandDrivenPipeline_h
22 
23 #include "vtkCommonExecutionModelModule.h" // For export macro
25 
26 #define VTK_UPDATE_EXTENT_COMBINE 1
27 #define VTK_UPDATE_EXTENT_REPLACE 2
28 
29 VTK_ABI_NAMESPACE_BEGIN
40 
41 class VTKCOMMONEXECUTIONMODEL_EXPORT vtkStreamingDemandDrivenPipeline
43 {
44 public:
47  void PrintSelf(ostream& os, vtkIndent indent) override;
48 
54  vtkInformation* request, vtkInformationVector** inInfo, vtkInformationVector* outInfo) override;
55 
57 
60  vtkTypeBool Update() override;
61  vtkTypeBool Update(int port) override;
62  virtual vtkTypeBool UpdateWholeExtent();
64 
87  virtual vtkTypeBool Update(int port, vtkInformationVector* requests);
88 
94  int PropagateUpdateExtent(int outputPort);
95 
97 
101  int PropagateTime(int outputPort);
102  int UpdateTimeDependentInformation(int outputPort);
104 
106 
111  static int SetWholeExtent(vtkInformation*, int extent[6]);
112  static void GetWholeExtent(vtkInformation*, int extent[6]);
113  static int* GetWholeExtent(vtkInformation*) VTK_SIZEHINT(6);
115 
117 
125  int SetRequestExactExtent(int port, int flag);
126  int GetRequestExactExtent(int port);
128 
133  static vtkInformationRequestKey* REQUEST_UPDATE_EXTENT();
134 
139  static vtkInformationRequestKey* REQUEST_UPDATE_TIME();
144  static vtkInformationRequestKey* REQUEST_TIME_DEPENDENT_INFORMATION();
145 
151  static vtkInformationIntegerKey* CONTINUE_EXECUTING();
152 
157  static vtkInformationIntegerKey* UPDATE_EXTENT_INITIALIZED();
161  static vtkInformationIntegerVectorKey* UPDATE_EXTENT();
165  static vtkInformationIntegerKey* UPDATE_PIECE_NUMBER();
169  static vtkInformationIntegerKey* UPDATE_NUMBER_OF_PIECES();
173  static vtkInformationIntegerKey* UPDATE_NUMBER_OF_GHOST_LEVELS();
174 
180  static vtkInformationIntegerVectorKey* COMBINED_UPDATE_EXTENT();
181 
186  static vtkInformationIntegerVectorKey* WHOLE_EXTENT();
187 
194  static vtkInformationIntegerKey* UNRESTRICTED_UPDATE_EXTENT();
195 
200  static vtkInformationIntegerKey* EXACT_EXTENT();
201 
206  static vtkInformationDoubleVectorKey* TIME_STEPS();
207 
212  static vtkInformationDoubleVectorKey* TIME_RANGE();
213 
218  static vtkInformationDoubleKey* UPDATE_TIME_STEP();
219 
226  static vtkInformationIntegerKey* TIME_DEPENDENT_INFORMATION();
227 
232  static vtkInformationDoubleVectorKey* BOUNDS();
233 
235 
238  static void GetUpdateExtent(vtkInformation*, int extent[6]);
239  static int* GetUpdateExtent(vtkInformation*);
242 
247  static int GetUpdatePiece(vtkInformation*);
248  static int GetUpdateNumberOfPieces(vtkInformation*);
249  static int GetUpdateGhostLevel(vtkInformation*);
251 
252 protected:
254  ~vtkStreamingDemandDrivenPipeline() override;
255 
266  static vtkInformationDoubleKey* PREVIOUS_UPDATE_TIME_STEP();
267 
268  // Does the time request correspond to what is in the data?
269  // Returns 0 if yes, 1 otherwise.
270  virtual int NeedToExecuteBasedOnTime(vtkInformation* outInfo, vtkDataObject* dataObject);
271 
272  // Setup default information on the output after the algorithm
273  // executes information.
274  int ExecuteInformation(vtkInformation* request, vtkInformationVector** inInfoVec,
275  vtkInformationVector* outInfoVec) override;
276 
277  // Copy information for the given request.
278  void CopyDefaultInformation(vtkInformation* request, int direction,
279  vtkInformationVector** inInfoVec, vtkInformationVector* outInfoVec) override;
280 
281  // Helper to check output information before propagating it to inputs.
282  virtual int VerifyOutputInformation(
283  int outputPort, vtkInformationVector** inInfoVec, vtkInformationVector* outInfoVec);
284 
285  // Override this check to account for update extent.
286  int NeedToExecuteData(
287  int outputPort, vtkInformationVector** inInfoVec, vtkInformationVector* outInfoVec) override;
288 
289  // Override these to handle the continue-executing option.
290  void ExecuteDataStart(vtkInformation* request, vtkInformationVector** inInfoVec,
291  vtkInformationVector* outInfoVec) override;
292  void ExecuteDataEnd(vtkInformation* request, vtkInformationVector** inInfoVec,
293  vtkInformationVector* outInfoVec) override;
294 
295  // Override this to handle cropping and ghost levels.
296  void MarkOutputsGenerated(vtkInformation* request, vtkInformationVector** inInfoVec,
297  vtkInformationVector* outInfoVec) override;
298 
299  // Remove update/whole extent when resetting pipeline information.
300  void ResetPipelineInformation(int port, vtkInformation*) override;
301 
302  // Flag for when an algorithm returns with CONTINUE_EXECUTING in the
303  // request.
304  int ContinueExecuting;
305 
306  vtkInformation* UpdateExtentRequest;
307  vtkInformation* UpdateTimeRequest;
308  vtkInformation* TimeDependentInformationRequest;
309  vtkInformationIterator* InformationIterator;
310 
311  // did the most recent PUE do anything ?
312  int LastPropogateUpdateExtentShortCircuited;
313 
314 private:
315  vtkStreamingDemandDrivenPipeline(const vtkStreamingDemandDrivenPipeline&) = delete;
316  void operator=(const vtkStreamingDemandDrivenPipeline&) = delete;
317 };
318 
319 VTK_ABI_NAMESPACE_END
320 #endif
Key for unsigned long values in vtkInformation.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Store vtkAlgorithm input/output information.
Key for string values in vtkInformation.
vtkTypeBool Update() override
Bring the algorithm's outputs up-to-date.
int vtkTypeBool
Definition: vtkABI.h:64
Key for double vector values.
a simple class to control print indentation
Definition: vtkIndent.h:28
Key for pointer to pointer.
Key for integer values in vtkInformation.
Executive supporting on-demand execution.
Iterates over keys of an information object.
Key for vtkObjectBase values.
#define VTK_SIZEHINT(...)
static vtkDemandDrivenPipeline * New()
vtkTypeBool ProcessRequest(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo) override
Generalized interface for asking the executive to fulfill update requests.
Key for double values in vtkInformation.
Store zero or more vtkInformation instances.
Executive supporting partial updates.
general representation of visualization data
Definition: vtkDataObject.h:54
Key for vtkIdType values in vtkInformation.