Main Page | Directories | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

vtkDemandDrivenPipeline.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkDemandDrivenPipeline.h,v $
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 __vtkDemandDrivenPipeline_h
00032 #define __vtkDemandDrivenPipeline_h
00033 
00034 #include "vtkDistributedExecutive.h"
00035 
00036 class vtkDataArray;
00037 class vtkDataSetAttributes;
00038 class vtkDemandDrivenPipelineInternals;
00039 class vtkFieldData;
00040 class vtkInformation;
00041 class vtkInformationIntegerKey;
00042 class vtkInformationVector;
00043 class vtkInformationKeyVectorKey;
00044 
00045 class VTK_FILTERING_EXPORT vtkDemandDrivenPipeline : public vtkDistributedExecutive
00046 {
00047 public:
00048   static vtkDemandDrivenPipeline* New();
00049   vtkTypeRevisionMacro(vtkDemandDrivenPipeline,vtkDistributedExecutive);
00050   void PrintSelf(ostream& os, vtkIndent indent);
00051 
00053 
00055   virtual int Update();
00056   virtual int Update(int port);
00057   virtual int Update(vtkAlgorithm* algorithm);
00058   virtual int Update(vtkAlgorithm* algorithm, int port);
00060 
00062 
00063   virtual vtkInformation* GetOutputInformation(int port);
00064   virtual vtkInformation* GetOutputInformation(vtkAlgorithm* algorithm,
00065                                                int port);
00067 
00069 
00070   vtkGetMacro(PipelineMTime, unsigned long);
00072     
00074 
00075   virtual vtkDataObject* GetOutputData(int port);
00076   virtual vtkDataObject* GetOutputData(vtkAlgorithm* algorithm, int port);
00077   virtual void SetOutputData(int port, vtkDataObject*);
00078   virtual void SetOutputData(vtkAlgorithm* algorithm, int port, vtkDataObject*);
00080 
00082 
00083   virtual vtkDataObject* GetInputData(vtkAlgorithm* algorithm, 
00084                                       int port, int connection);
00085   virtual vtkDataObject* GetInputData(int port, int connection);
00087 
00090   virtual int SetReleaseDataFlag(int port, int n);
00091 
00093   virtual int GetReleaseDataFlag(int port);
00094 
00095   static vtkInformationKeyVectorKey* DOWNSTREAM_KEYS_TO_COPY();
00096   static vtkInformationIntegerKey* REQUEST_DATA_OBJECT();
00097   static vtkInformationIntegerKey* REQUEST_INFORMATION();
00098   static vtkInformationIntegerKey* REQUEST_DATA();
00099   static vtkInformationIntegerKey* FROM_OUTPUT_PORT();
00100   static vtkInformationIntegerKey* RELEASE_DATA();
00101 
00102   virtual int UpdateDataObject();
00103   virtual int UpdateInformation();
00104   virtual int UpdateData(int outputPort);
00105 
00106   vtkDemandDrivenPipeline* GetConnectedInputExecutive(int port, int index);
00107   vtkInformation* GetConnectedInputInformation(int port, int index);
00108 
00109 protected:
00110   vtkDemandDrivenPipeline();
00111   ~vtkDemandDrivenPipeline();
00112 
00113   virtual int ExecuteDataObject();
00114   virtual int ExecuteInformation();
00115   virtual int ExecuteData(int outputPort);
00116 
00117   // Put default information in output information objects.
00118   virtual void FillDefaultOutputInformation(int port, vtkInformation*);
00119 
00120   // Reset the pipeline update values in the given output information object.
00121   virtual void ResetPipelineInformation(int port, vtkInformation*);
00122 
00123 
00124   vtkInformation* GetRequestInformation();
00125   vtkInformationVector* GetInputInformation();
00126   vtkInformation* GetInputInformation(int port);
00127   vtkInformationVector* GetOutputInformation();
00128 
00129   void PrepareDownstreamRequest(vtkInformationIntegerKey* rkey);
00130   void PrepareUpstreamRequest(vtkInformationIntegerKey* rkey);
00131   virtual void CopyDefaultDownstreamInformation();
00132   virtual int CheckDataObject(int port);
00133 
00134   // Input connection validity checkers.
00135   int InputCountIsValid();
00136   int InputCountIsValid(int port);
00137   int InputTypeIsValid();
00138   int InputTypeIsValid(int port);
00139   int InputTypeIsValid(int port, int index);
00140   int InputFieldsAreValid();
00141   int InputFieldsAreValid(int port);
00142   int InputFieldsAreValid(int port, int index);
00143 
00144   // Field existence checkers.
00145   int DataSetAttributeExists(vtkDataSetAttributes* dsa, vtkInformation* field);
00146   int FieldArrayExists(vtkFieldData* data, vtkInformation* field);
00147   int ArrayIsValid(vtkDataArray* array, vtkInformation* field);
00148 
00149   // Input port information checkers.
00150   int InputIsOptional(int port);
00151   int InputIsRepeatable(int port);
00152 
00153   vtkDataObject* NewDataObject(const char* type);
00154 
00155   // Support garbage collection.
00156   virtual void ReportReferences(vtkGarbageCollector*);
00157   virtual void RemoveReferences();
00158 
00159   // Decide whether the output data need to be generated.
00160   virtual int NeedToExecuteData(int outputPort);
00161 
00162   // Largest MTime of any algorithm on this executive or preceding
00163   // executives.
00164   unsigned long PipelineMTime;
00165 
00166   // Time when information or data were last generated.
00167   vtkTimeStamp DataObjectTime;
00168   vtkTimeStamp InformationTime;
00169   vtkTimeStamp DataTime;
00170 
00171   int InProcessRequest;
00172 
00173 private:
00174   vtkDemandDrivenPipelineInternals* DemandDrivenInternal;
00175 
00176   vtkDemandDrivenPipeline(const vtkDemandDrivenPipeline&);  // Not implemented.
00177   void operator=(const vtkDemandDrivenPipeline&);  // Not implemented.
00178 };
00179 
00180 #endif