VTK
/Users/kitware/Dashboards/MyTests/VTK_BLD_Release_docs/Utilities/Doxygen/dox/Common/ExecutionModel/vtkStreamingDemandDrivenPipeline.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkStreamingDemandDrivenPipeline.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00031 #ifndef vtkStreamingDemandDrivenPipeline_h
00032 #define vtkStreamingDemandDrivenPipeline_h
00033 
00034 #include "vtkCommonExecutionModelModule.h" // For export macro
00035 #include "vtkDemandDrivenPipeline.h"
00036 
00037 #define VTK_UPDATE_EXTENT_COMBINE 1
00038 #define VTK_UPDATE_EXTENT_REPLACE 2
00039 
00040 class vtkInformationDoubleKey;
00041 class vtkInformationDoubleVectorKey;
00042 class vtkInformationIdTypeKey;
00043 class vtkInformationIntegerKey;
00044 class vtkInformationIntegerVectorKey;
00045 class vtkInformationObjectBaseKey;
00046 class vtkInformationStringKey;
00047 class vtkInformationStringKey;
00048 class vtkInformationUnsignedLongKey;
00049 
00050 class VTKCOMMONEXECUTIONMODEL_EXPORT vtkStreamingDemandDrivenPipeline : public vtkDemandDrivenPipeline
00051 {
00052 public:
00053   static vtkStreamingDemandDrivenPipeline* New();
00054   vtkTypeMacro(vtkStreamingDemandDrivenPipeline,vtkDemandDrivenPipeline);
00055   void PrintSelf(ostream& os, vtkIndent indent);
00056 
00058 
00060   virtual int ProcessRequest(vtkInformation* request,
00061                              vtkInformationVector** inInfo,
00062                              vtkInformationVector* outInfo);
00064 
00066 
00067   virtual int Update();
00068   virtual int Update(int port);
00069   virtual int UpdateWholeExtent();
00071 
00074   int PropagateUpdateExtent(int outputPort);
00075 
00076 
00078 
00080   int PropagateTime(int outputPort);
00081   int UpdateTimeDependentInformation(int outputPort);
00083 
00085 
00088   static int SetWholeExtent(vtkInformation *, int extent[6]);
00089   static void GetWholeExtent(vtkInformation *, int extent[6]);
00090   static int* GetWholeExtent(vtkInformation *);
00092 
00094 
00098   int SetUpdateExtentToWholeExtent(int port);
00099   static int SetUpdateExtentToWholeExtent(vtkInformation *);
00101 
00103 
00104   int SetUpdateExtent(int port, int extent[6]);
00105   int SetUpdateExtent(int port, int x0, int x1, int y0, int y1, int z0, int z1);
00106   static int SetUpdateExtent(vtkInformation *, int extent[6]);
00107   static void GetUpdateExtent(vtkInformation *, int extent[6]);
00108   static int* GetUpdateExtent(vtkInformation *);
00110 
00112 
00114   int SetUpdateExtent(int port,
00115                       int piece, int numPieces, int ghostLevel);
00116   static int SetUpdateExtent(vtkInformation *,
00117                              int piece, int numPieces, int ghostLevel);
00118   static int SetUpdatePiece(vtkInformation *, int piece);
00119   static int GetUpdatePiece(vtkInformation *);
00120   static int SetUpdateNumberOfPieces(vtkInformation *, int n);
00121   static int GetUpdateNumberOfPieces(vtkInformation *);
00122   static int SetUpdateGhostLevel(vtkInformation *, int n);
00123   static int GetUpdateGhostLevel(vtkInformation *);
00125 
00127 
00128   int SetUpdateTimeStep(int port, double time);
00129   static int SetUpdateTimeStep(vtkInformation *, double time);
00131 
00133 
00139   int SetRequestExactExtent(int port, int flag);
00140   int GetRequestExactExtent(int port);
00142 
00145   static vtkInformationRequestKey* REQUEST_UPDATE_EXTENT();
00146 
00149   static vtkInformationRequestKey* REQUEST_UPDATE_TIME();
00152   static vtkInformationRequestKey* REQUEST_TIME_DEPENDENT_INFORMATION();
00153 
00156   static vtkInformationIntegerKey* CONTINUE_EXECUTING();
00157 
00160   static vtkInformationIntegerKey* UPDATE_EXTENT_INITIALIZED();
00162   static vtkInformationIntegerVectorKey* UPDATE_EXTENT();
00164   static vtkInformationIntegerKey* UPDATE_PIECE_NUMBER();
00166   static vtkInformationIntegerKey* UPDATE_NUMBER_OF_PIECES();
00168   static vtkInformationIntegerKey* UPDATE_NUMBER_OF_GHOST_LEVELS();
00169 
00173   static vtkInformationIntegerVectorKey* COMBINED_UPDATE_EXTENT();
00174 
00177   static vtkInformationIntegerVectorKey* WHOLE_EXTENT();
00178 
00182   static vtkInformationIntegerKey* UNRESTRICTED_UPDATE_EXTENT();
00183 
00186   static vtkInformationIntegerKey* EXACT_EXTENT();
00187 
00189   static vtkInformationDoubleVectorKey* TIME_STEPS();
00190 
00193   static vtkInformationDoubleVectorKey* TIME_RANGE();
00194 
00196   static vtkInformationDoubleKey* UPDATE_TIME_STEP();
00197 
00201   static vtkInformationIntegerKey* TIME_DEPENDENT_INFORMATION();
00202 
00204   static vtkInformationDoubleVectorKey *BOUNDS();
00205 
00206 protected:
00207   vtkStreamingDemandDrivenPipeline();
00208   ~vtkStreamingDemandDrivenPipeline();
00209 
00217   static vtkInformationDoubleKey* PREVIOUS_UPDATE_TIME_STEP();
00218 
00219   // Does the time request correspond to what is in the data?
00220   // Returns 0 if yes, 1 otherwise.
00221   virtual int NeedToExecuteBasedOnTime(vtkInformation* outInfo,
00222                                        vtkDataObject* dataObject);
00223 
00224   // Setup default information on the output after the algorithm
00225   // executes information.
00226   virtual int ExecuteInformation(vtkInformation* request,
00227                                  vtkInformationVector** inInfoVec,
00228                                  vtkInformationVector* outInfoVec);
00229 
00230   // Copy information for the given request.
00231   virtual void CopyDefaultInformation(vtkInformation* request, int direction,
00232                                       vtkInformationVector** inInfoVec,
00233                                       vtkInformationVector* outInfoVec);
00234 
00235   // Helper to check output information before propagating it to inputs.
00236   virtual int VerifyOutputInformation(int outputPort,
00237                                       vtkInformationVector** inInfoVec,
00238                                       vtkInformationVector* outInfoVec);
00239 
00240 
00241   // Override this check to account for update extent.
00242   virtual int NeedToExecuteData(int outputPort,
00243                                 vtkInformationVector** inInfoVec,
00244                                 vtkInformationVector* outInfoVec);
00245 
00246   // Override these to handle the continue-executing option.
00247   virtual void ExecuteDataStart(vtkInformation* request,
00248                                 vtkInformationVector** inInfoVec,
00249                                 vtkInformationVector* outInfoVec);
00250   virtual void ExecuteDataEnd(vtkInformation* request,
00251                               vtkInformationVector** inInfoVec,
00252                               vtkInformationVector* outInfoVec);
00253 
00254   // Override this to handle cropping and ghost levels.
00255   virtual void MarkOutputsGenerated(vtkInformation* request,
00256                                     vtkInformationVector** inInfoVec,
00257                                     vtkInformationVector* outInfoVec);
00258 
00259 
00260   // Remove update/whole extent when resetting pipeline information.
00261   virtual void ResetPipelineInformation(int port, vtkInformation*);
00262 
00263   // Flag for when an algorithm returns with CONTINUE_EXECUTING in the
00264   // request.
00265   int ContinueExecuting;
00266 
00267   vtkInformation *UpdateExtentRequest;
00268 
00269   // did the most recent PUE do anything ?
00270   int LastPropogateUpdateExtentShortCircuited;
00271 
00272 private:
00273   vtkStreamingDemandDrivenPipeline(const vtkStreamingDemandDrivenPipeline&);  // Not implemented.
00274   void operator=(const vtkStreamingDemandDrivenPipeline&);  // Not implemented.
00275 };
00276 
00277 #endif