VTK
vtkStreamingDemandDrivenPipeline.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkStreamingDemandDrivenPipeline.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
26 #ifndef vtkStreamingDemandDrivenPipeline_h
27 #define vtkStreamingDemandDrivenPipeline_h
28 
29 #include "vtkCommonExecutionModelModule.h" // For export macro
31 
32 #define VTK_UPDATE_EXTENT_COMBINE 1
33 #define VTK_UPDATE_EXTENT_REPLACE 2
34 
44 
45 class VTKCOMMONEXECUTIONMODEL_EXPORT vtkStreamingDemandDrivenPipeline : public vtkDemandDrivenPipeline
46 {
47 public:
50  void PrintSelf(ostream& os, vtkIndent indent) override;
51 
56  int ProcessRequest(vtkInformation* request,
57  vtkInformationVector** inInfo,
58  vtkInformationVector* outInfo) override;
59 
61 
64  int Update() override;
65  int Update(int port) override;
66  virtual int UpdateWholeExtent();
68 
91  virtual int Update(int port, vtkInformationVector* requests);
92 
98  int PropagateUpdateExtent(int outputPort);
99 
101 
105  int PropagateTime(int outputPort);
106  int UpdateTimeDependentInformation(int outputPort);
108 
110 
115  static int SetWholeExtent(vtkInformation *, int extent[6]);
116  static void GetWholeExtent(vtkInformation *, int extent[6]);
117  static int* GetWholeExtent(vtkInformation *) VTK_SIZEHINT(6);
119 
121 
129  int SetRequestExactExtent(int port, int flag);
130  int GetRequestExactExtent(int port);
132 
137  static vtkInformationRequestKey* REQUEST_UPDATE_EXTENT();
138 
143  static vtkInformationRequestKey* REQUEST_UPDATE_TIME();
148  static vtkInformationRequestKey* REQUEST_TIME_DEPENDENT_INFORMATION();
149 
155  static vtkInformationIntegerKey* CONTINUE_EXECUTING();
156 
161  static vtkInformationIntegerKey* UPDATE_EXTENT_INITIALIZED();
165  static vtkInformationIntegerVectorKey* UPDATE_EXTENT();
169  static vtkInformationIntegerKey* UPDATE_PIECE_NUMBER();
173  static vtkInformationIntegerKey* UPDATE_NUMBER_OF_PIECES();
177  static vtkInformationIntegerKey* UPDATE_NUMBER_OF_GHOST_LEVELS();
178 
184  static vtkInformationIntegerVectorKey* COMBINED_UPDATE_EXTENT();
185 
190  static vtkInformationIntegerVectorKey* WHOLE_EXTENT();
191 
198  static vtkInformationIntegerKey* UNRESTRICTED_UPDATE_EXTENT();
199 
204  static vtkInformationIntegerKey* EXACT_EXTENT();
205 
210  static vtkInformationDoubleVectorKey* TIME_STEPS();
211 
216  static vtkInformationDoubleVectorKey* TIME_RANGE();
217 
222  static vtkInformationDoubleKey* UPDATE_TIME_STEP();
223 
230  static vtkInformationIntegerKey* TIME_DEPENDENT_INFORMATION();
231 
236  static vtkInformationDoubleVectorKey *BOUNDS();
237 
239 
242  static void GetUpdateExtent(vtkInformation *, int extent[6]);
243  static int* GetUpdateExtent(vtkInformation *);
245 
246 
251  static int GetUpdatePiece(vtkInformation *);
252  static int GetUpdateNumberOfPieces(vtkInformation *);
253  static int GetUpdateGhostLevel(vtkInformation *);
255 
256 protected:
259 
270  static vtkInformationDoubleKey* PREVIOUS_UPDATE_TIME_STEP();
271 
272  // Does the time request correspond to what is in the data?
273  // Returns 0 if yes, 1 otherwise.
274  virtual int NeedToExecuteBasedOnTime(vtkInformation* outInfo,
275  vtkDataObject* dataObject);
276 
277  // Setup default information on the output after the algorithm
278  // executes information.
279  int ExecuteInformation(vtkInformation* request,
280  vtkInformationVector** inInfoVec,
281  vtkInformationVector* outInfoVec) override;
282 
283  // Copy information for the given request.
285  vtkInformationVector** inInfoVec,
286  vtkInformationVector* outInfoVec) override;
287 
288  // Helper to check output information before propagating it to inputs.
289  virtual int VerifyOutputInformation(int outputPort,
290  vtkInformationVector** inInfoVec,
291  vtkInformationVector* outInfoVec);
292 
293 
294  // Override this check to account for update extent.
295  int NeedToExecuteData(int outputPort,
296  vtkInformationVector** inInfoVec,
297  vtkInformationVector* outInfoVec) override;
298 
299  // Override these to handle the continue-executing option.
300  void ExecuteDataStart(vtkInformation* request,
301  vtkInformationVector** inInfoVec,
302  vtkInformationVector* outInfoVec) override;
303  void ExecuteDataEnd(vtkInformation* request,
304  vtkInformationVector** inInfoVec,
305  vtkInformationVector* outInfoVec) override;
306 
307  // Override this to handle cropping and ghost levels.
308  void MarkOutputsGenerated(vtkInformation* request,
309  vtkInformationVector** inInfoVec,
310  vtkInformationVector* outInfoVec) override;
311 
312 
313  // Remove update/whole extent when resetting pipeline information.
314  void ResetPipelineInformation(int port, vtkInformation*) override;
315 
316  // Flag for when an algorithm returns with CONTINUE_EXECUTING in the
317  // request.
319 
321 
322  // did the most recent PUE do anything ?
324 
325 private:
327  void operator=(const vtkStreamingDemandDrivenPipeline&) = delete;
328 };
329 
330 #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.
virtual void MarkOutputsGenerated(vtkInformation *request, vtkInformationVector **inInfoVec, vtkInformationVector *outInfoVec)
Key for string values in vtkInformation.
virtual void ExecuteDataStart(vtkInformation *request, vtkInformationVector **inInfoVec, vtkInformationVector *outInfoVec)
virtual int ExecuteInformation(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo)
Key for double vector values.
a simple class to control print indentation
Definition: vtkIndent.h:33
Key for pointer to pointer.
Key for integer values in vtkInformation.
Executive supporting on-demand execution.
virtual void CopyDefaultInformation(vtkInformation *request, int direction, vtkInformationVector **inInfo, vtkInformationVector *outInfo)
Key for vtkObjectBase values.
virtual int NeedToExecuteData(int outputPort, vtkInformationVector **inInfoVec, vtkInformationVector *outInfoVec)
void ResetPipelineInformation(int, vtkInformation *) override
#define VTK_SIZEHINT(...)
static vtkDemandDrivenPipeline * New()
int Update() override
Bring the algorithm's outputs up-to-date.
Key for double values in vtkInformation.
int ProcessRequest(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo) override
Generalized interface for asking the executive to fulfill update requests.
Store zero or more vtkInformation instances.
Executive supporting partial updates.
virtual void ExecuteDataEnd(vtkInformation *request, vtkInformationVector **inInfoVec, vtkInformationVector *outInfoVec)
general representation of visualization data
Definition: vtkDataObject.h:58
Key for vtkIdType values in vtkInformation.