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 
35 
36 #define VTK_UPDATE_EXTENT_COMBINE 1
37 #define VTK_UPDATE_EXTENT_REPLACE 2
38 
48 
50 {
51 public:
54  void PrintSelf(ostream& os, vtkIndent indent);
55 
57 
59  virtual int ProcessRequest(vtkInformation* request,
60  vtkInformationVector** inInfo,
61  vtkInformationVector* outInfo);
63 
65 
66  virtual int Update();
67  virtual int Update(int port);
68  virtual int UpdateWholeExtent();
70 
73  int PropagateUpdateExtent(int outputPort);
74 
76 
80  int SetMaximumNumberOfPieces(int port, int n);
81  int SetMaximumNumberOfPieces(vtkInformation *, int n);
82  int GetMaximumNumberOfPieces(int port);
83  int GetMaximumNumberOfPieces(vtkInformation *);
85 
87 
90  int SetWholeExtent(vtkInformation *, int extent[6]);
91  void GetWholeExtent(vtkInformation *, int extent[6]);
92  int* GetWholeExtent(vtkInformation *);
94 
96 
100  int SetUpdateExtentToWholeExtent(int port);
101  int SetUpdateExtentToWholeExtent(vtkInformation *);
103 
105 
106  int SetUpdateExtent(int port, int extent[6]);
107  int SetUpdateExtent(vtkInformation *, int extent[6]);
108  void GetUpdateExtent(vtkInformation *, int extent[6]);
109  int* GetUpdateExtent(vtkInformation *);
111 
113 
115  int SetUpdateExtent(int port,
116  int piece, int numPieces, int ghostLevel);
117  int SetUpdateExtent(vtkInformation *,
118  int piece, int numPieces, int ghostLevel);
119  int SetUpdatePiece(vtkInformation *, int piece);
120  int GetUpdatePiece(vtkInformation *);
121  int SetUpdateNumberOfPieces(vtkInformation *, int n);
122  int GetUpdateNumberOfPieces(vtkInformation *);
123  int SetUpdateGhostLevel(vtkInformation *, int n);
124  int GetUpdateGhostLevel(vtkInformation *);
125  int SetUpdateResolution(int port, double r);
126  int SetUpdateResolution(vtkInformation *, double r);
127  double GetUpdateResolution(vtkInformation *);
129 
131 
132  int SetUpdateTimeSteps(int port, double *times, int length);
133  int SetUpdateTimeSteps(vtkInformation *, double *times, int length);
134  int SetUpdateTimeStep(int port, double time);
135  //void GetUpdateTimeSteps(vtkInformation *, int extent[6]);
137 
139 
145  int SetRequestExactExtent(int port, int flag);
146  int GetRequestExactExtent(int port);
148 
150 
152  int SetExtentTranslator(int port, vtkExtentTranslator* translator);
153  int SetExtentTranslator(vtkInformation *, vtkExtentTranslator* translator);
154  vtkExtentTranslator* GetExtentTranslator(int port);
155  vtkExtentTranslator* GetExtentTranslator(vtkInformation *info);
157 
159 
162  int SetWholeBoundingBox(int port, double bb[6]);
163  void GetWholeBoundingBox(int port, double bb[6]);
164  double* GetWholeBoundingBox(int port);
166 
168 
171  int SetPieceBoundingBox(int port, double bb[6]);
172  void GetPieceBoundingBox(int port, double bb[6]);
173  double* GetPieceBoundingBox(int port);
175 
177  static vtkInformationRequestKey* REQUEST_UPDATE_EXTENT();
178 
180 
182  static vtkInformationRequestKey* REQUEST_UPDATE_EXTENT_INFORMATION();
183  static vtkInformationRequestKey* REQUEST_MANAGE_INFORMATION();
185 
187  static vtkInformationRequestKey* REQUEST_RESOLUTION_PROPAGATE();
188 
191  static vtkInformationIntegerKey* CONTINUE_EXECUTING();
192 
194  static vtkInformationObjectBaseKey* EXTENT_TRANSLATOR();
195 
197 
198  static vtkInformationIntegerKey* UPDATE_EXTENT_INITIALIZED();
199  static vtkInformationIntegerVectorKey* UPDATE_EXTENT();
200  static vtkInformationIntegerKey* UPDATE_PIECE_NUMBER();
201  static vtkInformationIntegerKey* UPDATE_NUMBER_OF_PIECES();
202  static vtkInformationIntegerKey* UPDATE_NUMBER_OF_GHOST_LEVELS();
204 
207  static vtkInformationIntegerVectorKey* COMBINED_UPDATE_EXTENT();
208 
211  static vtkInformationIntegerKey* UPDATE_EXTENT_TRANSLATED();
212 
214  static vtkInformationIntegerVectorKey* WHOLE_EXTENT();
215 
219  static vtkInformationIntegerKey* UNRESTRICTED_UPDATE_EXTENT();
220 
223  static vtkInformationIntegerKey* MAXIMUM_NUMBER_OF_PIECES();
224 
227  static vtkInformationDoubleVectorKey* WHOLE_BOUNDING_BOX();
228 
231  static vtkInformationDoubleVectorKey* PIECE_BOUNDING_BOX();
232 
234  static vtkInformationDoubleVectorKey* PIECE_NORMAL();
235 
237  static vtkInformationIntegerKey* EXACT_EXTENT();
238 
240  static vtkInformationDoubleVectorKey* TIME_STEPS();
241 
243  static vtkInformationDoubleVectorKey* TIME_RANGE();
244 
246  static vtkInformationDoubleVectorKey* UPDATE_TIME_STEPS();
247 
250  static vtkInformationDoubleKey* PRIORITY();
251 
254  static vtkInformationUnsignedLongKey* ORIGINAL_NUMBER_OF_CELLS();
255 
258  static vtkInformationDoubleKey* UPDATE_RESOLUTION();
259 
262  static vtkInformationIntegerKey* REMOVE_ATTRIBUTE_INFORMATION();
263 
270  // Key to allow a reader to advertise that it supports a fast-path
271  // for reading data over time.
272  static vtkInformationIntegerKey* FAST_PATH_FOR_TEMPORAL_DATA();
273  // The type of data being requested.
274  // Possible values: POINT, CELL, EDGE, FACE
275  static vtkInformationStringKey* FAST_PATH_OBJECT_TYPE();
276  // Possible values: INDEX, GLOBAL
277  static vtkInformationStringKey* FAST_PATH_ID_TYPE();
278  // The id (either index or global id) being requested
279  static vtkInformationIdTypeKey* FAST_PATH_OBJECT_ID();
280 
282 
286  double ComputePriority()
287  {
288  return this->ComputePriority(0);
289  }
290  virtual double ComputePriority(int port);
292 
293 protected:
296 
298 
301  virtual void ResetUpdateInformation(vtkInformation* request,
302  vtkInformationVector** inInfoVec,
303  vtkInformationVector* outInfoVec);
305 
306  // Keep track of the update time request corresponding to the
307  // previous executing. If the previous update request did not
308  // correspond to an existing time step and the reader chose
309  // a time step with it's own logic, the data time step will
310  // be different than the request. If the same time step is
311  // requested again, there is no need to re-execute the algorithm.
312  // We know that it does not have this time step.
313  static vtkInformationDoubleVectorKey* PREVIOUS_UPDATE_TIME_STEPS();
314 
315  // Keep track of the fast path keys corresponding to the
316  // previous executing. If all key values are the same as their
317  // counterparts in the previous request, we do not need to re-execute.
318  static vtkInformationIdTypeKey* PREVIOUS_FAST_PATH_OBJECT_ID();
319  static vtkInformationStringKey* PREVIOUS_FAST_PATH_OBJECT_TYPE();
320  static vtkInformationStringKey* PREVIOUS_FAST_PATH_ID_TYPE();
321 
322  // Does the time request correspond to what is in the data?
323  // Returns 0 if yes, 1 otherwise.
324  virtual int NeedToExecuteBasedOnTime(vtkInformation* outInfo,
325  vtkDataObject* dataObject);
326 
327  // If the request contains a fast path key for temporal data, always execute
328  virtual int NeedToExecuteBasedOnFastPathData(vtkInformation* outInfo);
329 
330  // Setup default information on the output after the algorithm
331  // executes information.
332  virtual int ExecuteInformation(vtkInformation* request,
333  vtkInformationVector** inInfoVec,
334  vtkInformationVector* outInfoVec);
335 
336  // Copy information for the given request.
337  virtual void CopyDefaultInformation(vtkInformation* request, int direction,
338  vtkInformationVector** inInfoVec,
339  vtkInformationVector* outInfoVec);
340 
341  // Helper to check output information before propagating it to inputs.
342  virtual int VerifyOutputInformation(int outputPort,
343  vtkInformationVector** inInfoVec,
344  vtkInformationVector* outInfoVec);
345 
346 
347  // Override this check to account for update extent.
348  virtual int NeedToExecuteData(int outputPort,
349  vtkInformationVector** inInfoVec,
350  vtkInformationVector* outInfoVec);
351 
352  // Override these to handle the continue-executing option.
353  virtual void ExecuteDataStart(vtkInformation* request,
354  vtkInformationVector** inInfoVec,
355  vtkInformationVector* outInfoVec);
356  virtual void ExecuteDataEnd(vtkInformation* request,
357  vtkInformationVector** inInfoVec,
358  vtkInformationVector* outInfoVec);
359 
360  // Override this to handle cropping and ghost levels.
361  virtual void MarkOutputsGenerated(vtkInformation* request,
362  vtkInformationVector** inInfoVec,
363  vtkInformationVector* outInfoVec);
364 
365 
366  // Remove update/whole extent when resetting pipeline information.
367  virtual void ResetPipelineInformation(int port, vtkInformation*);
368 
369  // Flag for when an algorithm returns with CONTINUE_EXECUTING in the
370  // request.
372 
374 
375  // did the most recent PUE do anything ?
377 
378 private:
380  void operator=(const vtkStreamingDemandDrivenPipeline&); // Not implemented.
381 };
382 
383 #endif