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

vtkExecutive.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkExecutive.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 =========================================================================*/
00026 #ifndef __vtkExecutive_h
00027 #define __vtkExecutive_h
00028 
00029 #include "vtkObject.h"
00030 
00031 class vtkAlgorithm;
00032 class vtkAlgorithmOutput;
00033 class vtkAlgorithmToExecutiveFriendship;
00034 class vtkDataObject;
00035 class vtkExecutiveInternals;
00036 class vtkInformation;
00037 class vtkInformationExecutivePortKey;
00038 class vtkInformationExecutivePortVectorKey;
00039 class vtkInformationIntegerKey;
00040 class vtkInformationRequestKey;
00041 class vtkInformationKeyVectorKey;
00042 class vtkInformationVector;
00043 
00044 class VTK_FILTERING_EXPORT vtkExecutive : public vtkObject
00045 {
00046 public:
00047   vtkTypeRevisionMacro(vtkExecutive,vtkObject);
00048   void PrintSelf(ostream& os, vtkIndent indent);
00049 
00051   vtkAlgorithm* GetAlgorithm();
00052 
00054 
00056   virtual int ProcessRequest(vtkInformation* request,
00057                              vtkInformationVector** inInfo,
00058                              vtkInformationVector* outInfo);
00060 
00062 
00071   virtual int
00072   ComputePipelineMTime(vtkInformation* request,
00073                        vtkInformationVector** inInfoVec,
00074                        vtkInformationVector* outInfoVec,
00075                        int requestFromOutputPort,
00076                        unsigned long* mtime);
00078 
00080 
00082   virtual int Update();
00083   virtual int Update(int port);
00085 
00087 
00089   int GetNumberOfInputPorts();
00090   int GetNumberOfOutputPorts();
00092 
00094   int GetNumberOfInputConnections(int port);
00095 
00097   virtual vtkInformation* GetOutputInformation(int port);
00098 
00100   vtkInformationVector* GetOutputInformation();
00101 
00103   vtkInformation* GetInputInformation(int port, int connection);
00104 
00106   vtkInformationVector* GetInputInformation(int port);  
00107   
00109   vtkInformationVector** GetInputInformation();
00110 
00112   vtkExecutive* GetInputExecutive(int port, int connection);
00113 
00115 
00116   virtual vtkDataObject* GetOutputData(int port);
00117   virtual void SetOutputData(int port, vtkDataObject*, vtkInformation *info);
00118   virtual void SetOutputData(int port, vtkDataObject*);
00120 
00122 
00123   virtual vtkDataObject* GetInputData(int port, int connection);
00124   virtual vtkDataObject* GetInputData(int port, int connection, 
00125                                       vtkInformationVector **inInfoVec);
00127 
00129   virtual vtkAlgorithmOutput* GetProducerPort(vtkDataObject*);
00130 
00132 
00138   void SetSharedInputInformation(vtkInformationVector** inInfoVec);
00139   void SetSharedOutputInformation(vtkInformationVector* outInfoVec);
00141 
00143 
00144   virtual void Register(vtkObjectBase* o);
00145   virtual void UnRegister(vtkObjectBase* o);
00147 
00150   static vtkInformationExecutivePortKey* PRODUCER();
00151 
00154   static vtkInformationExecutivePortVectorKey* CONSUMERS();
00155 
00158   static vtkInformationIntegerKey* FROM_OUTPUT_PORT();
00159 
00161 
00163   static vtkInformationIntegerKey* ALGORITHM_BEFORE_FORWARD();
00164   static vtkInformationIntegerKey* ALGORITHM_AFTER_FORWARD();
00165   static vtkInformationIntegerKey* ALGORITHM_DIRECTION();
00166   static vtkInformationIntegerKey* FORWARD_DIRECTION();
00167   static vtkInformationKeyVectorKey* KEYS_TO_COPY();
00168   //BTX
00169   enum { RequestUpstream, RequestDownstream };
00170   enum { BeforeForward, AfterForward };
00171   //ETX
00173 
00175 
00177   virtual int CallAlgorithm(vtkInformation* request, int direction,
00178                             vtkInformationVector** inInfo,
00179                             vtkInformationVector* outInfo);
00181 
00182 protected:
00183   vtkExecutive();
00184   ~vtkExecutive();
00185 
00186   // Helper methods for subclasses.
00187   int InputPortIndexInRange(int port, const char* action);
00188   int OutputPortIndexInRange(int port, const char* action);
00189 
00190   // Called by methods to check for a recursive pipeline update.  A
00191   // request should be fulfilled without making another request.  This
00192   // is used to help enforce that behavior.  Returns 1 if no recursive
00193   // request is occurring, and 0 otherwise.  An error message is
00194   // produced automatically if 0 is returned.  The first argument is
00195   // the name of the calling method (the one that should not be
00196   // invoked recursively during an update).  The second argument is
00197   // the recursive request information object, if any.  It is used to
00198   // construct the error message.
00199   int CheckAlgorithm(const char* method, vtkInformation* request);
00200 
00201   virtual int ForwardDownstream(vtkInformation* request);
00202   virtual int ForwardUpstream(vtkInformation* request);
00203   virtual void CopyDefaultInformation(vtkInformation* request, int direction,
00204                                       vtkInformationVector** inInfo,
00205                                       vtkInformationVector* outInfo);
00206 
00207   // Reset the pipeline update values in the given output information object.
00208   virtual void ResetPipelineInformation(int port, vtkInformation*)=0;
00209 
00210   // Bring the existence of output data objects up to date.
00211   virtual int UpdateDataObject()=0;
00212 
00213   // Garbage collection support.
00214   virtual void ReportReferences(vtkGarbageCollector*);
00215 
00216   virtual void SetAlgorithm(vtkAlgorithm* algorithm);
00217 
00218   // The algorithm managed by this executive.
00219   vtkAlgorithm* Algorithm;
00220 
00221   // Flag set when the algorithm is processing a request.
00222   int InAlgorithm;
00223 
00224   // Pointers to an outside instance of input or output information.
00225   // No references are held.  These are used to implement internal
00226   // pipelines.
00227   vtkInformationVector** SharedInputInformation;
00228   vtkInformationVector* SharedOutputInformation;
00229 
00230 private:
00231   // Store an information object for each output port of the algorithm.
00232   vtkInformationVector* OutputInformation;
00233 
00234   // Internal implementation details.
00235   vtkExecutiveInternals* ExecutiveInternal;
00236 
00237   //BTX
00238   friend class vtkAlgorithmToExecutiveFriendship;
00239   //ETX
00240 private:
00241   vtkExecutive(const vtkExecutive&);  // Not implemented.
00242   void operator=(const vtkExecutive&);  // Not implemented.
00243 };
00244 
00245 #endif

Generated on Mon Jan 21 23:07:19 2008 for VTK by  doxygen 1.4.3-20050530