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 
50 
51 class VTKCOMMONEXECUTIONMODEL_EXPORT vtkStreamingDemandDrivenPipeline : public vtkDemandDrivenPipeline
52 {
53 public:
56  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
57 
62  int ProcessRequest(vtkInformation* request,
63  vtkInformationVector** inInfo,
64  vtkInformationVector* outInfo) VTK_OVERRIDE;
65 
67 
70  int Update() VTK_OVERRIDE;
71  int Update(int port) VTK_OVERRIDE;
72  virtual int UpdateWholeExtent();
74 
97  virtual int Update(int port, vtkInformationVector* requests);
98 
104  int PropagateUpdateExtent(int outputPort);
105 
107 
111  int PropagateTime(int outputPort);
112  int UpdateTimeDependentInformation(int outputPort);
114 
116 
121  static int SetWholeExtent(vtkInformation *, int extent[6]);
122  static void GetWholeExtent(vtkInformation *, int extent[6]);
123  static int* GetWholeExtent(vtkInformation *);
125 
127 
135  int SetRequestExactExtent(int port, int flag);
136  int GetRequestExactExtent(int port);
138 
143  static vtkInformationRequestKey* REQUEST_UPDATE_EXTENT();
144 
149  static vtkInformationRequestKey* REQUEST_UPDATE_TIME();
154  static vtkInformationRequestKey* REQUEST_TIME_DEPENDENT_INFORMATION();
155 
161  static vtkInformationIntegerKey* CONTINUE_EXECUTING();
162 
167  static vtkInformationIntegerKey* UPDATE_EXTENT_INITIALIZED();
171  static vtkInformationIntegerVectorKey* UPDATE_EXTENT();
175  static vtkInformationIntegerKey* UPDATE_PIECE_NUMBER();
179  static vtkInformationIntegerKey* UPDATE_NUMBER_OF_PIECES();
183  static vtkInformationIntegerKey* UPDATE_NUMBER_OF_GHOST_LEVELS();
184 
190  static vtkInformationIntegerVectorKey* COMBINED_UPDATE_EXTENT();
191 
196  static vtkInformationIntegerVectorKey* WHOLE_EXTENT();
197 
204  static vtkInformationIntegerKey* UNRESTRICTED_UPDATE_EXTENT();
205 
210  static vtkInformationIntegerKey* EXACT_EXTENT();
211 
216  static vtkInformationDoubleVectorKey* TIME_STEPS();
217 
222  static vtkInformationDoubleVectorKey* TIME_RANGE();
223 
228  static vtkInformationDoubleKey* UPDATE_TIME_STEP();
229 
236  static vtkInformationIntegerKey* TIME_DEPENDENT_INFORMATION();
237 
242  static vtkInformationDoubleVectorKey *BOUNDS();
243 
245 
251  VTK_LEGACY(int SetUpdateExtentToWholeExtent(int port));
252  VTK_LEGACY(static int SetUpdateExtentToWholeExtent(vtkInformation *));
254 
256 
259  VTK_LEGACY(int SetUpdateExtent(int port, int extent[6]));
260  VTK_LEGACY(int SetUpdateExtent(int port, int x0, int x1, int y0, int y1, int z0, int z1));
261  VTK_LEGACY(static int SetUpdateExtent(vtkInformation *, int extent[6]));
262  static void GetUpdateExtent(vtkInformation *, int extent[6]);
263  static int* GetUpdateExtent(vtkInformation *);
265 
266 
271  VTK_LEGACY(int SetUpdateExtent(int port,
272  int piece, int numPieces, int ghostLevel));
273  VTK_LEGACY(static int SetUpdateExtent(vtkInformation *,
274  int piece, int numPieces, int ghostLevel));
275  VTK_LEGACY(static int SetUpdatePiece(vtkInformation *, int piece));
276  static int GetUpdatePiece(vtkInformation *);
277  VTK_LEGACY(static int SetUpdateNumberOfPieces(vtkInformation *, int n));
278  static int GetUpdateNumberOfPieces(vtkInformation *);
279  VTK_LEGACY(static int SetUpdateGhostLevel(vtkInformation *, int n));
280  static int GetUpdateGhostLevel(vtkInformation *);
282 
284 
287  VTK_LEGACY(int SetUpdateTimeStep(int port, double time));
288  VTK_LEGACY(static int SetUpdateTimeStep(vtkInformation *, double time));
290 
291 protected:
293  ~vtkStreamingDemandDrivenPipeline() VTK_OVERRIDE;
294 
305  static vtkInformationDoubleKey* PREVIOUS_UPDATE_TIME_STEP();
306 
307  // Does the time request correspond to what is in the data?
308  // Returns 0 if yes, 1 otherwise.
309  virtual int NeedToExecuteBasedOnTime(vtkInformation* outInfo,
310  vtkDataObject* dataObject);
311 
312  // Setup default information on the output after the algorithm
313  // executes information.
314  int ExecuteInformation(vtkInformation* request,
315  vtkInformationVector** inInfoVec,
316  vtkInformationVector* outInfoVec) VTK_OVERRIDE;
317 
318  // Copy information for the given request.
319  void CopyDefaultInformation(vtkInformation* request, int direction,
320  vtkInformationVector** inInfoVec,
321  vtkInformationVector* outInfoVec) VTK_OVERRIDE;
322 
323  // Helper to check output information before propagating it to inputs.
324  virtual int VerifyOutputInformation(int outputPort,
325  vtkInformationVector** inInfoVec,
326  vtkInformationVector* outInfoVec);
327 
328 
329  // Override this check to account for update extent.
330  int NeedToExecuteData(int outputPort,
331  vtkInformationVector** inInfoVec,
332  vtkInformationVector* outInfoVec) VTK_OVERRIDE;
333 
334  // Override these to handle the continue-executing option.
335  void ExecuteDataStart(vtkInformation* request,
336  vtkInformationVector** inInfoVec,
337  vtkInformationVector* outInfoVec) VTK_OVERRIDE;
338  void ExecuteDataEnd(vtkInformation* request,
339  vtkInformationVector** inInfoVec,
340  vtkInformationVector* outInfoVec) VTK_OVERRIDE;
341 
342  // Override this to handle cropping and ghost levels.
343  void MarkOutputsGenerated(vtkInformation* request,
344  vtkInformationVector** inInfoVec,
345  vtkInformationVector* outInfoVec) VTK_OVERRIDE;
346 
347 
348  // Remove update/whole extent when resetting pipeline information.
349  void ResetPipelineInformation(int port, vtkInformation*) VTK_OVERRIDE;
350 
351  // Flag for when an algorithm returns with CONTINUE_EXECUTING in the
352  // request.
353  int ContinueExecuting;
354 
355  vtkInformation *UpdateExtentRequest;
356 
357  // did the most recent PUE do anything ?
358  int LastPropogateUpdateExtentShortCircuited;
359 
360 private:
361  vtkStreamingDemandDrivenPipeline(const vtkStreamingDemandDrivenPipeline&) VTK_DELETE_FUNCTION;
362  void operator=(const vtkStreamingDemandDrivenPipeline&) VTK_DELETE_FUNCTION;
363 };
364 
365 #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 Update()
Updates the extensions string.
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.
Key for vtkObjectBase values.
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.