00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00029 #ifndef __vtkExecutive_h
00030 #define __vtkExecutive_h
00031 
00032 #include "vtkObject.h"
00033 
00034 class vtkAlgorithm;
00035 class vtkAlgorithmOutput;
00036 class vtkAlgorithmToExecutiveFriendship;
00037 class vtkDataObject;
00038 class vtkExecutiveInternals;
00039 class vtkInformation;
00040 class vtkInformationExecutivePortKey;
00041 class vtkInformationExecutivePortVectorKey;
00042 class vtkInformationIntegerKey;
00043 class vtkInformationRequestKey;
00044 class vtkInformationKeyVectorKey;
00045 class vtkInformationVector;
00046 
00047 class VTK_FILTERING_EXPORT vtkExecutive : public vtkObject
00048 {
00049 public:
00050   vtkTypeMacro(vtkExecutive,vtkObject);
00051   void PrintSelf(ostream& os, vtkIndent indent);
00052 
00054   vtkAlgorithm* GetAlgorithm();
00055 
00057 
00059   virtual int ProcessRequest(vtkInformation* request,
00060                              vtkInformationVector** inInfo,
00061                              vtkInformationVector* outInfo);
00063 
00065 
00074   virtual int
00075   ComputePipelineMTime(vtkInformation* request,
00076                        vtkInformationVector** inInfoVec,
00077                        vtkInformationVector* outInfoVec,
00078                        int requestFromOutputPort,
00079                        unsigned long* mtime);
00081 
00083 
00085   virtual int Update();
00086   virtual int Update(int port);
00088 
00090 
00092   int GetNumberOfInputPorts();
00093   int GetNumberOfOutputPorts();
00095 
00097   int GetNumberOfInputConnections(int port);
00098 
00100   virtual vtkInformation* GetOutputInformation(int port);
00101 
00103   vtkInformationVector* GetOutputInformation();
00104 
00106   vtkInformation* GetInputInformation(int port, int connection);
00107 
00109   vtkInformationVector* GetInputInformation(int port);  
00110   
00112   vtkInformationVector** GetInputInformation();
00113 
00115   vtkExecutive* GetInputExecutive(int port, int connection);
00116 
00118 
00119   virtual vtkDataObject* GetOutputData(int port);
00120   virtual void SetOutputData(int port, vtkDataObject*, vtkInformation *info);
00121   virtual void SetOutputData(int port, vtkDataObject*);
00123 
00125 
00126   virtual vtkDataObject* GetInputData(int port, int connection);
00127   virtual vtkDataObject* GetInputData(int port, int connection, 
00128                                       vtkInformationVector **inInfoVec);
00130 
00132   virtual vtkAlgorithmOutput* GetProducerPort(vtkDataObject*);
00133 
00135 
00141   void SetSharedInputInformation(vtkInformationVector** inInfoVec);
00142   void SetSharedOutputInformation(vtkInformationVector* outInfoVec);
00144 
00146 
00147   virtual void Register(vtkObjectBase* o);
00148   virtual void UnRegister(vtkObjectBase* o);
00150 
00153   static vtkInformationExecutivePortKey* PRODUCER();
00154 
00157   static vtkInformationExecutivePortVectorKey* CONSUMERS();
00158 
00161   static vtkInformationIntegerKey* FROM_OUTPUT_PORT();
00162 
00164 
00166   static vtkInformationIntegerKey* ALGORITHM_BEFORE_FORWARD();
00167   static vtkInformationIntegerKey* ALGORITHM_AFTER_FORWARD();
00168   static vtkInformationIntegerKey* ALGORITHM_DIRECTION();
00169   static vtkInformationIntegerKey* FORWARD_DIRECTION();
00170   static vtkInformationKeyVectorKey* KEYS_TO_COPY();
00171   
00172   enum { RequestUpstream, RequestDownstream };
00173   enum { BeforeForward, AfterForward };
00174   
00176 
00178 
00180   virtual int CallAlgorithm(vtkInformation* request, int direction,
00181                             vtkInformationVector** inInfo,
00182                             vtkInformationVector* outInfo);
00184 
00185 protected:
00186   vtkExecutive();
00187   ~vtkExecutive();
00188 
00189   
00190   int InputPortIndexInRange(int port, const char* action);
00191   int OutputPortIndexInRange(int port, const char* action);
00192 
00193   
00194   
00195   
00196   
00197   
00198   
00199   
00200   
00201   
00202   int CheckAlgorithm(const char* method, vtkInformation* request);
00203 
00204   virtual int ForwardDownstream(vtkInformation* request);
00205   virtual int ForwardUpstream(vtkInformation* request);
00206   virtual void CopyDefaultInformation(vtkInformation* request, int direction,
00207                                       vtkInformationVector** inInfo,
00208                                       vtkInformationVector* outInfo);
00209 
00210   
00211   virtual void ResetPipelineInformation(int port, vtkInformation*)=0;
00212 
00213   
00214   virtual int UpdateDataObject()=0;
00215 
00216   
00217   virtual void ReportReferences(vtkGarbageCollector*);
00218 
00219   virtual void SetAlgorithm(vtkAlgorithm* algorithm);
00220 
00221   
00222   vtkAlgorithm* Algorithm;
00223 
00224   
00225   int InAlgorithm;
00226 
00227   
00228   
00229   
00230   vtkInformationVector** SharedInputInformation;
00231   vtkInformationVector* SharedOutputInformation;
00232 
00233 private:
00234   
00235   vtkInformationVector* OutputInformation;
00236 
00237   
00238   vtkExecutiveInternals* ExecutiveInternal;
00239 
00240   
00241   friend class vtkAlgorithmToExecutiveFriendship;
00242   
00243 private:
00244   vtkExecutive(const vtkExecutive&);  
00245   void operator=(const vtkExecutive&);  
00246 };
00247 
00248 #endif