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 =========================================================================*/
32 #ifndef vtkStreamingDemandDrivenPipeline_h
33 #define vtkStreamingDemandDrivenPipeline_h
34 
35 #include "vtkCommonExecutionModelModule.h" // For export macro
37 
38 #define VTK_UPDATE_EXTENT_COMBINE 1
39 #define VTK_UPDATE_EXTENT_REPLACE 2
40 
51 
52 class VTKCOMMONEXECUTIONMODEL_EXPORT vtkStreamingDemandDrivenPipeline : public vtkDemandDrivenPipeline
53 {
54 public:
57  void PrintSelf(ostream& os, vtkIndent indent) override;
58 
63  int ProcessRequest(vtkInformation* request,
64  vtkInformationVector** inInfo,
65  vtkInformationVector* outInfo) override;
66 
68 
71  int Update() override;
72  int Update(int port) override;
73  virtual int UpdateWholeExtent();
75 
98  virtual int Update(int port, vtkInformationVector* requests);
99 
105  int PropagateUpdateExtent(int outputPort);
106 
108 
112  int PropagateTime(int outputPort);
113  int UpdateTimeDependentInformation(int outputPort);
115 
117 
122  static int SetWholeExtent(vtkInformation *, int extent[6]);
123  static void GetWholeExtent(vtkInformation *, int extent[6]);
124  static int* GetWholeExtent(vtkInformation *) VTK_SIZEHINT(6);
126 
128 
136  int SetRequestExactExtent(int port, int flag);
137  int GetRequestExactExtent(int port);
139 
144  static vtkInformationRequestKey* REQUEST_UPDATE_EXTENT();
145 
150  static vtkInformationRequestKey* REQUEST_UPDATE_TIME();
155  static vtkInformationRequestKey* REQUEST_TIME_DEPENDENT_INFORMATION();
156 
162  static vtkInformationIntegerKey* CONTINUE_EXECUTING();
163 
168  static vtkInformationIntegerKey* UPDATE_EXTENT_INITIALIZED();
172  static vtkInformationIntegerVectorKey* UPDATE_EXTENT();
176  static vtkInformationIntegerKey* UPDATE_PIECE_NUMBER();
180  static vtkInformationIntegerKey* UPDATE_NUMBER_OF_PIECES();
184  static vtkInformationIntegerKey* UPDATE_NUMBER_OF_GHOST_LEVELS();
185 
191  static vtkInformationIntegerVectorKey* COMBINED_UPDATE_EXTENT();
192 
197  static vtkInformationIntegerVectorKey* WHOLE_EXTENT();
198 
205  static vtkInformationIntegerKey* UNRESTRICTED_UPDATE_EXTENT();
206 
211  static vtkInformationIntegerKey* EXACT_EXTENT();
212 
217  static vtkInformationDoubleVectorKey* TIME_STEPS();
218 
223  static vtkInformationDoubleVectorKey* TIME_RANGE();
224 
229  static vtkInformationDoubleKey* UPDATE_TIME_STEP();
230 
237  static vtkInformationIntegerKey* TIME_DEPENDENT_INFORMATION();
238 
243  static vtkInformationDoubleVectorKey *BOUNDS();
244 
246 
249  static void GetUpdateExtent(vtkInformation *, int extent[6]);
250  static int* GetUpdateExtent(vtkInformation *);
252 
253 
258  static int GetUpdatePiece(vtkInformation *);
259  static int GetUpdateNumberOfPieces(vtkInformation *);
260  static int GetUpdateGhostLevel(vtkInformation *);
262 
263 protected:
265  ~vtkStreamingDemandDrivenPipeline() override;
266 
277  static vtkInformationDoubleKey* PREVIOUS_UPDATE_TIME_STEP();
278 
279  // Does the time request correspond to what is in the data?
280  // Returns 0 if yes, 1 otherwise.
281  virtual int NeedToExecuteBasedOnTime(vtkInformation* outInfo,
282  vtkDataObject* dataObject);
283 
284  // Setup default information on the output after the algorithm
285  // executes information.
286  int ExecuteInformation(vtkInformation* request,
287  vtkInformationVector** inInfoVec,
288  vtkInformationVector* outInfoVec) override;
289 
290  // Copy information for the given request.
291  void CopyDefaultInformation(vtkInformation* request, int direction,
292  vtkInformationVector** inInfoVec,
293  vtkInformationVector* outInfoVec) override;
294 
295  // Helper to check output information before propagating it to inputs.
296  virtual int VerifyOutputInformation(int outputPort,
297  vtkInformationVector** inInfoVec,
298  vtkInformationVector* outInfoVec);
299 
300 
301  // Override this check to account for update extent.
302  int NeedToExecuteData(int outputPort,
303  vtkInformationVector** inInfoVec,
304  vtkInformationVector* outInfoVec) override;
305 
306  // Override these to handle the continue-executing option.
307  void ExecuteDataStart(vtkInformation* request,
308  vtkInformationVector** inInfoVec,
309  vtkInformationVector* outInfoVec) override;
310  void ExecuteDataEnd(vtkInformation* request,
311  vtkInformationVector** inInfoVec,
312  vtkInformationVector* outInfoVec) override;
313 
314  // Override this to handle cropping and ghost levels.
315  void MarkOutputsGenerated(vtkInformation* request,
316  vtkInformationVector** inInfoVec,
317  vtkInformationVector* outInfoVec) override;
318 
319 
320  // Remove update/whole extent when resetting pipeline information.
321  void ResetPipelineInformation(int port, vtkInformation*) override;
322 
323  // Flag for when an algorithm returns with CONTINUE_EXECUTING in the
324  // request.
325  int ContinueExecuting;
326 
327  vtkInformation *UpdateExtentRequest;
328  vtkInformation *UpdateTimeRequest;
329  vtkInformation *TimeDependentInformationRequest;
330  vtkInformationIterator *InformationIterator;
331 
332  // did the most recent PUE do anything ?
333  int LastPropogateUpdateExtentShortCircuited;
334 
335 private:
336  vtkStreamingDemandDrivenPipeline(const vtkStreamingDemandDrivenPipeline&) = delete;
337  void operator=(const vtkStreamingDemandDrivenPipeline&) = delete;
338 };
339 
340 #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.
Key for double vector values.
a simple class to control print indentation
Definition: vtkIndent.h:39
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()
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.
general representation of visualization data
Definition: vtkDataObject.h:64
Key for vtkIdType values in vtkInformation.