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 =========================================================================*/
31 #ifndef __vtkStreamingDemandDrivenPipeline_h
32 #define __vtkStreamingDemandDrivenPipeline_h
33 
34 #include "vtkDemandDrivenPipeline.h"
35 
36 #define VTK_UPDATE_EXTENT_COMBINE 1
37 #define VTK_UPDATE_EXTENT_REPLACE 2
38 
47 
48 class VTK_FILTERING_EXPORT vtkStreamingDemandDrivenPipeline : public vtkDemandDrivenPipeline
49 {
50 public:
52  vtkTypeMacro(vtkStreamingDemandDrivenPipeline,vtkDemandDrivenPipeline);
53  void PrintSelf(ostream& os, vtkIndent indent);
54 
56 
58  virtual int ProcessRequest(vtkInformation* request,
59  vtkInformationVector** inInfo,
60  vtkInformationVector* outInfo);
62 
64 
65  virtual int Update();
66  virtual int Update(int port);
67  virtual int UpdateWholeExtent();
69 
72  int PropagateUpdateExtent(int outputPort);
73 
75 
79  int SetMaximumNumberOfPieces(int port, int n);
80  int SetMaximumNumberOfPieces(vtkInformation *, int n);
81  int GetMaximumNumberOfPieces(int port);
82  int GetMaximumNumberOfPieces(vtkInformation *);
84 
86 
89  int SetWholeExtent(vtkInformation *, int extent[6]);
90  void GetWholeExtent(vtkInformation *, int extent[6]);
91  int* GetWholeExtent(vtkInformation *);
93 
95 
99  int SetUpdateExtentToWholeExtent(int port);
100  int SetUpdateExtentToWholeExtent(vtkInformation *);
102 
104 
105  int SetUpdateExtent(int port, int extent[6]);
106  int SetUpdateExtent(vtkInformation *, int extent[6]);
107  void GetUpdateExtent(vtkInformation *, int extent[6]);
108  int* GetUpdateExtent(vtkInformation *);
110 
112 
114  int SetUpdateExtent(int port,
115  int piece, int numPieces, int ghostLevel);
116  int SetUpdateExtent(vtkInformation *,
117  int piece, int numPieces, int ghostLevel);
118  int SetUpdatePiece(vtkInformation *, int piece);
119  int GetUpdatePiece(vtkInformation *);
120  int SetUpdateNumberOfPieces(vtkInformation *, int n);
121  int GetUpdateNumberOfPieces(vtkInformation *);
122  int SetUpdateGhostLevel(vtkInformation *, int n);
123  int GetUpdateGhostLevel(vtkInformation *);
124  int SetUpdateResolution(int port, double r);
125  int SetUpdateResolution(vtkInformation *, double r);
126  double GetUpdateResolution(vtkInformation *);
128 
130 
131  int SetUpdateTimeSteps(int port, double *times, int length);
132  int SetUpdateTimeSteps(vtkInformation *, double *times, int length);
133  int SetUpdateTimeStep(int port, double time);
134  //void GetUpdateTimeSteps(vtkInformation *, int extent[6]);
136 
138 
144  int SetRequestExactExtent(int port, int flag);
145  int GetRequestExactExtent(int port);
147 
149 
151  int SetExtentTranslator(int port, vtkExtentTranslator* translator);
152  int SetExtentTranslator(vtkInformation *, vtkExtentTranslator* translator);
153  vtkExtentTranslator* GetExtentTranslator(int port);
154  vtkExtentTranslator* GetExtentTranslator(vtkInformation *info);
156 
158 
161  int SetWholeBoundingBox(int port, double bb[6]);
162  void GetWholeBoundingBox(int port, double bb[6]);
163  double* GetWholeBoundingBox(int port);
165 
167 
170  int SetPieceBoundingBox(int port, double bb[6]);
171  void GetPieceBoundingBox(int port, double bb[6]);
172  double* GetPieceBoundingBox(int port);
174 
176  static vtkInformationRequestKey* REQUEST_UPDATE_EXTENT();
177 
180  static vtkInformationRequestKey* REQUEST_UPDATE_EXTENT_INFORMATION();
181 
183  static vtkInformationRequestKey* REQUEST_RESOLUTION_PROPAGATE();
184 
187  static vtkInformationIntegerKey* CONTINUE_EXECUTING();
188 
190  static vtkInformationObjectBaseKey* EXTENT_TRANSLATOR();
191 
193 
194  static vtkInformationIntegerKey* UPDATE_EXTENT_INITIALIZED();
195  static vtkInformationIntegerVectorKey* UPDATE_EXTENT();
196  static vtkInformationIntegerKey* UPDATE_PIECE_NUMBER();
197  static vtkInformationIntegerKey* UPDATE_NUMBER_OF_PIECES();
198  static vtkInformationIntegerKey* UPDATE_NUMBER_OF_GHOST_LEVELS();
200 
203  static vtkInformationIntegerVectorKey* COMBINED_UPDATE_EXTENT();
204 
207  static vtkInformationIntegerKey* UPDATE_EXTENT_TRANSLATED();
208 
210  static vtkInformationIntegerVectorKey* WHOLE_EXTENT();
211 
215  static vtkInformationIntegerKey* UNRESTRICTED_UPDATE_EXTENT();
216 
219  static vtkInformationIntegerKey* MAXIMUM_NUMBER_OF_PIECES();
220 
223  static vtkInformationDoubleVectorKey* WHOLE_BOUNDING_BOX();
224 
227  static vtkInformationDoubleVectorKey* PIECE_BOUNDING_BOX();
228 
230  static vtkInformationIntegerKey* EXACT_EXTENT();
231 
233  static vtkInformationDoubleVectorKey* TIME_STEPS();
234 
236  static vtkInformationDoubleVectorKey* TIME_RANGE();
237 
239  static vtkInformationDoubleVectorKey* UPDATE_TIME_STEPS();
240 
243  static vtkInformationDoubleKey* PRIORITY();
244 
247  static vtkInformationDoubleKey* UPDATE_RESOLUTION();
248 
251  static vtkInformationIntegerKey* REMOVE_ATTRIBUTE_INFORMATION();
252 
259  // Key to allow a reader to advertise that it supports a fast-path
260  // for reading data over time.
261  static vtkInformationIntegerKey* FAST_PATH_FOR_TEMPORAL_DATA();
262  // The type of data being requested.
263  // Possible values: POINT, CELL, EDGE, FACE
264  static vtkInformationStringKey* FAST_PATH_OBJECT_TYPE();
265  // Possible values: INDEX, GLOBAL
266  static vtkInformationStringKey* FAST_PATH_ID_TYPE();
267  // The id (either index or global id) being requested
268  static vtkInformationIdTypeKey* FAST_PATH_OBJECT_ID();
269 
271 
276  {
277  return this->ComputePriority(0);
278  }
279  virtual double ComputePriority(int port);
281 
282 protected:
285 
287 
290  virtual void ResetUpdateInformation(vtkInformation* request,
291  vtkInformationVector** inInfoVec,
292  vtkInformationVector* outInfoVec);
294 
295  // Keep track of the update time request corresponding to the
296  // previous executing. If the previous update request did not
297  // correspond to an existing time step and the reader chose
298  // a time step with it's own logic, the data time step will
299  // be different than the request. If the same time step is
300  // requested again, there is no need to re-execute the algorithm.
301  // We know that it does not have this time step.
302  static vtkInformationDoubleVectorKey* PREVIOUS_UPDATE_TIME_STEPS();
303 
304  // Keep track of the fast path keys corresponding to the
305  // previous executing. If all key values are the same as their
306  // counterparts in the previous request, we do not need to re-execute.
307  static vtkInformationIdTypeKey* PREVIOUS_FAST_PATH_OBJECT_ID();
308  static vtkInformationStringKey* PREVIOUS_FAST_PATH_OBJECT_TYPE();
309  static vtkInformationStringKey* PREVIOUS_FAST_PATH_ID_TYPE();
310 
311  // Does the time request correspond to what is in the data?
312  // Returns 0 if yes, 1 otherwise.
313  virtual int NeedToExecuteBasedOnTime(vtkInformation* outInfo,
314  vtkDataObject* dataObject);
315 
316  // If the request contains a fast path key for temporal data, always execute
317  virtual int NeedToExecuteBasedOnFastPathData(vtkInformation* outInfo);
318 
319  // Setup default information on the output after the algorithm
320  // executes information.
321  virtual int ExecuteInformation(vtkInformation* request,
322  vtkInformationVector** inInfoVec,
323  vtkInformationVector* outInfoVec);
324 
325  // Copy information for the given request.
326  virtual void CopyDefaultInformation(vtkInformation* request, int direction,
327  vtkInformationVector** inInfoVec,
328  vtkInformationVector* outInfoVec);
329 
330  // Helper to check output information before propagating it to inputs.
331  virtual int VerifyOutputInformation(int outputPort,
332  vtkInformationVector** inInfoVec,
333  vtkInformationVector* outInfoVec);
334 
335 
336  // Override this check to account for update extent.
337  virtual int NeedToExecuteData(int outputPort,
338  vtkInformationVector** inInfoVec,
339  vtkInformationVector* outInfoVec);
340 
341  // Override these to handle the continue-executing option.
342  virtual void ExecuteDataStart(vtkInformation* request,
343  vtkInformationVector** inInfoVec,
344  vtkInformationVector* outInfoVec);
345  virtual void ExecuteDataEnd(vtkInformation* request,
346  vtkInformationVector** inInfoVec,
347  vtkInformationVector* outInfoVec);
348 
349  // Override this to handle cropping and ghost levels.
350  virtual void MarkOutputsGenerated(vtkInformation* request,
351  vtkInformationVector** inInfoVec,
352  vtkInformationVector* outInfoVec);
353 
354 
355  // Remove update/whole extent when resetting pipeline information.
356  virtual void ResetPipelineInformation(int port, vtkInformation*);
357 
358  // Flag for when an algorithm returns with CONTINUE_EXECUTING in the
359  // request.
361 
363 
364  // did the most recent PUE do anything ?
366 
367 private:
369  void operator=(const vtkStreamingDemandDrivenPipeline&); // Not implemented.
370 };
371 
372 #endif