VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 "vtkCommonExecutionModelModule.h" // For export macro
36 
37 #define VTK_UPDATE_EXTENT_COMBINE 1
38 #define VTK_UPDATE_EXTENT_REPLACE 2
39 
50 
52 {
53 public:
56  void PrintSelf(ostream& os, vtkIndent indent);
57 
59 
61  virtual int ProcessRequest(vtkInformation* request,
62  vtkInformationVector** inInfo,
63  vtkInformationVector* outInfo);
65 
67 
68  virtual int Update();
69  virtual int Update(int port);
70  virtual int UpdateWholeExtent();
72 
75  int PropagateUpdateExtent(int outputPort);
76 
77 
79 
81  int PropagateTime(int outputPort);
82  int UpdateTimeDependentInformation(int outputPort);
84 
85 
87 
91  int SetMaximumNumberOfPieces(int port, int n);
92  static int SetMaximumNumberOfPieces(vtkInformation *, int n);
93  int GetMaximumNumberOfPieces(int port);
94  static int GetMaximumNumberOfPieces(vtkInformation *);
96 
98 
101  static int SetWholeExtent(vtkInformation *, int extent[6]);
102  static void GetWholeExtent(vtkInformation *, int extent[6]);
103  static int* GetWholeExtent(vtkInformation *);
105 
107 
111  int SetUpdateExtentToWholeExtent(int port);
112  static int SetUpdateExtentToWholeExtent(vtkInformation *);
114 
116 
117  int SetUpdateExtent(int port, int extent[6]);
118  int SetUpdateExtent(int port, int x0, int x1, int y0, int y1, int z0, int z1);
119  static int SetUpdateExtent(vtkInformation *, int extent[6]);
120  static void GetUpdateExtent(vtkInformation *, int extent[6]);
121  static int* GetUpdateExtent(vtkInformation *);
123 
125 
127  int SetUpdateExtent(int port,
128  int piece, int numPieces, int ghostLevel);
129  static int SetUpdateExtent(vtkInformation *,
130  int piece, int numPieces, int ghostLevel);
131  static int SetUpdatePiece(vtkInformation *, int piece);
132  static int GetUpdatePiece(vtkInformation *);
133  static int SetUpdateNumberOfPieces(vtkInformation *, int n);
134  static int GetUpdateNumberOfPieces(vtkInformation *);
135  static int SetUpdateGhostLevel(vtkInformation *, int n);
136  static int GetUpdateGhostLevel(vtkInformation *);
137  int SetUpdateResolution(int port, double r);
138  int SetUpdateResolution(vtkInformation *, double r);
139  double GetUpdateResolution(vtkInformation *);
141 
143 
144  int SetUpdateTimeStep(int port, double time);
145  static int SetUpdateTimeStep(vtkInformation *, double time);
147 
149 
155  int SetRequestExactExtent(int port, int flag);
156  int GetRequestExactExtent(int port);
158 
160 
162  int SetExtentTranslator(int port, vtkExtentTranslator* translator);
163  static int SetExtentTranslator(vtkInformation *, vtkExtentTranslator* translator);
164  vtkExtentTranslator* GetExtentTranslator(int port);
165  static vtkExtentTranslator* GetExtentTranslator(vtkInformation *info);
167 
169 
172  int SetWholeBoundingBox(int port, double bb[6]);
173  void GetWholeBoundingBox(int port, double bb[6]);
174  double* GetWholeBoundingBox(int port);
176 
178 
181  int SetPieceBoundingBox(int port, double bb[6]);
182  void GetPieceBoundingBox(int port, double bb[6]);
183  double* GetPieceBoundingBox(int port);
185 
187  static vtkInformationRequestKey* REQUEST_UPDATE_EXTENT();
188 
189  // Key defining a request to propagate the update extent upstream.
190  static vtkInformationRequestKey* REQUEST_UPDATE_TIME();
193  static vtkInformationRequestKey* REQUEST_TIME_DEPENDENT_INFORMATION();
194 
195 
197 
199  static vtkInformationRequestKey* REQUEST_UPDATE_EXTENT_INFORMATION();
200  static vtkInformationRequestKey* REQUEST_MANAGE_INFORMATION();
202 
204  static vtkInformationRequestKey* REQUEST_RESOLUTION_PROPAGATE();
205 
208  static vtkInformationIntegerKey* CONTINUE_EXECUTING();
209 
211  static vtkInformationObjectBaseKey* EXTENT_TRANSLATOR();
212 
214 
215  static vtkInformationIntegerKey* UPDATE_EXTENT_INITIALIZED();
216  static vtkInformationIntegerVectorKey* UPDATE_EXTENT();
217  static vtkInformationIntegerKey* UPDATE_PIECE_NUMBER();
218  static vtkInformationIntegerKey* UPDATE_NUMBER_OF_PIECES();
219  static vtkInformationIntegerKey* UPDATE_NUMBER_OF_GHOST_LEVELS();
221 
223  static vtkInformationIntegerKey* UPDATE_AMR_LEVEL();
224 
227  static vtkInformationIntegerVectorKey* COMBINED_UPDATE_EXTENT();
228 
231  static vtkInformationIntegerKey* UPDATE_EXTENT_TRANSLATED();
232 
234  static vtkInformationIntegerVectorKey* WHOLE_EXTENT();
235 
239  static vtkInformationIntegerKey* UNRESTRICTED_UPDATE_EXTENT();
240 
243  static vtkInformationIntegerKey* MAXIMUM_NUMBER_OF_PIECES();
244 
247  static vtkInformationDoubleVectorKey* WHOLE_BOUNDING_BOX();
248 
251  static vtkInformationDoubleVectorKey* PIECE_BOUNDING_BOX();
252 
254  static vtkInformationDoubleVectorKey* PIECE_NORMAL();
255 
257  static vtkInformationIntegerKey* EXACT_EXTENT();
258 
260  static vtkInformationDoubleVectorKey* TIME_STEPS();
261 
263  static vtkInformationDoubleVectorKey* TIME_RANGE();
264 
267  static vtkInformationStringKey* TIME_LABEL_ANNOTATION();
268 
270  static vtkInformationDoubleKey* UPDATE_TIME_STEP();
271 
275  static vtkInformationIntegerKey* TIME_DEPENDENT_INFORMATION();
276 
279  static vtkInformationDoubleKey* PRIORITY();
280 
283  static vtkInformationUnsignedLongKey* ORIGINAL_NUMBER_OF_CELLS();
284 
287  static vtkInformationDoubleKey* UPDATE_RESOLUTION();
288 
291  static vtkInformationIntegerKey* REMOVE_ATTRIBUTE_INFORMATION();
292 
299  // Key to allow a reader to advertise that it supports a fast-path
300  // for reading data over time.
301  static vtkInformationIntegerKey* FAST_PATH_FOR_TEMPORAL_DATA();
302  // The type of data being requested.
303  // Possible values: POINT, CELL, EDGE, FACE
304  static vtkInformationStringKey* FAST_PATH_OBJECT_TYPE();
305  // Possible values: INDEX, GLOBAL
306  static vtkInformationStringKey* FAST_PATH_ID_TYPE();
307  // The id (either index or global id) being requested
308  static vtkInformationIdTypeKey* FAST_PATH_OBJECT_ID();
309 
310 
312  static vtkInformationDoubleVectorKey *BOUNDS();
313 
314 
316 
321  {
322  return this->ComputePriority(0);
323  }
324  virtual double ComputePriority(int port);
326 
327 protected:
330 
332 
335  virtual void ResetUpdateInformation(vtkInformation* request,
336  vtkInformationVector** inInfoVec,
337  vtkInformationVector* outInfoVec);
339 
340  // Keep track of the update time request corresponding to the
341  // previous executing. If the previous update request did not
342  // correspond to an existing time step and the reader chose
343  // a time step with it's own logic, the data time step will
344  // be different than the request. If the same time step is
345  // requested again, there is no need to re-execute the algorithm.
346  // We know that it does not have this time step.
347  static vtkInformationDoubleKey* PREVIOUS_UPDATE_TIME_STEP();
348 
349  // Keep track of the fast path keys corresponding to the
350  // previous executing. If all key values are the same as their
351  // counterparts in the previous request, we do not need to re-execute.
352  static vtkInformationIdTypeKey* PREVIOUS_FAST_PATH_OBJECT_ID();
353  static vtkInformationStringKey* PREVIOUS_FAST_PATH_OBJECT_TYPE();
354  static vtkInformationStringKey* PREVIOUS_FAST_PATH_ID_TYPE();
355 
356  // Does the time request correspond to what is in the data?
357  // Returns 0 if yes, 1 otherwise.
358  virtual int NeedToExecuteBasedOnTime(vtkInformation* outInfo,
359  vtkDataObject* dataObject);
360 
361  // If the request contains a fast path key for temporal data, always execute
362  virtual int NeedToExecuteBasedOnFastPathData(vtkInformation* outInfo);
363 
364  // Setup default information on the output after the algorithm
365  // executes information.
366  virtual int ExecuteInformation(vtkInformation* request,
367  vtkInformationVector** inInfoVec,
368  vtkInformationVector* outInfoVec);
369 
370  // Copy information for the given request.
371  virtual void CopyDefaultInformation(vtkInformation* request, int direction,
372  vtkInformationVector** inInfoVec,
373  vtkInformationVector* outInfoVec);
374 
375  // Helper to check output information before propagating it to inputs.
376  virtual int VerifyOutputInformation(int outputPort,
377  vtkInformationVector** inInfoVec,
378  vtkInformationVector* outInfoVec);
379 
380 
381  // Override this check to account for update extent.
382  virtual int NeedToExecuteData(int outputPort,
383  vtkInformationVector** inInfoVec,
384  vtkInformationVector* outInfoVec);
385 
386  // Override these to handle the continue-executing option.
387  virtual void ExecuteDataStart(vtkInformation* request,
388  vtkInformationVector** inInfoVec,
389  vtkInformationVector* outInfoVec);
390  virtual void ExecuteDataEnd(vtkInformation* request,
391  vtkInformationVector** inInfoVec,
392  vtkInformationVector* outInfoVec);
393 
394  // Override this to handle cropping and ghost levels.
395  virtual void MarkOutputsGenerated(vtkInformation* request,
396  vtkInformationVector** inInfoVec,
397  vtkInformationVector* outInfoVec);
398 
399 
400  // Remove update/whole extent when resetting pipeline information.
401  virtual void ResetPipelineInformation(int port, vtkInformation*);
402 
403  // Flag for when an algorithm returns with CONTINUE_EXECUTING in the
404  // request.
406 
408 
409  // did the most recent PUE do anything ?
411 
412 private:
414  void operator=(const vtkStreamingDemandDrivenPipeline&); // Not implemented.
415 };
416 
417 #endif
#define VTKCOMMONEXECUTIONMODEL_EXPORT
Key for unsigned long values in vtkInformation.
virtual void ResetPipelineInformation(int, vtkInformation *)
Store vtkAlgorithm input/output information.
virtual int ProcessRequest(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo)
Generates a structured extent from unstructured.
virtual void MarkOutputsGenerated(vtkInformation *request, vtkInformationVector **inInfoVec, vtkInformationVector *outInfoVec)
GLdouble GLdouble GLdouble r
Definition: vtkgl.h:11610
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:38
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)
static vtkDemandDrivenPipeline * New()
Key for double values in vtkInformation.
GLclampd n
Definition: vtkgl.h:14370
Store zero or more vtkInformation instances.
Executive supporting partial updates.
void PrintSelf(ostream &os, vtkIndent indent)
virtual void ExecuteDataEnd(vtkInformation *request, vtkInformationVector **inInfoVec, vtkInformationVector *outInfoVec)
general representation of visualization data
Definition: vtkDataObject.h:64
Key for vtkIdType values in vtkInformation.