Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

Filtering/vtkImageMultipleInputFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkImageMultipleInputFilter.h,v $
00005   Language:  C++
00006 
00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
00008   All rights reserved.
00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00010 
00011      This software is distributed WITHOUT ANY WARRANTY; without even 
00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00013      PURPOSE.  See the above copyright notice for more information.
00014 
00015 =========================================================================*/
00041 #ifndef __vtkImageMultipleInputFilter_h
00042 #define __vtkImageMultipleInputFilter_h
00043 
00044 #include "vtkImageSource.h"
00045 
00046 class vtkMultiThreader;
00047 
00048 class VTK_FILTERING_EXPORT vtkImageMultipleInputFilter : public vtkImageSource
00049 {
00050 public:
00051   vtkTypeRevisionMacro(vtkImageMultipleInputFilter,vtkImageSource);
00052   void PrintSelf(ostream& os, vtkIndent indent);
00053 
00055   virtual void SetInput(int num, vtkImageData *input);
00056 
00058 
00060   virtual void AddInput(vtkImageData *input);
00061   virtual void RemoveInput(vtkImageData *input);
00063   
00065 
00066   vtkImageData *GetInput(int num);
00067   vtkImageData *GetInput();
00069 
00071 
00074   vtkSetMacro(Bypass,int);
00075   vtkGetMacro(Bypass,int);
00076   vtkBooleanMacro(Bypass,int);
00078 
00080 
00081   vtkSetClampMacro( NumberOfThreads, int, 1, VTK_MAX_THREADS );
00082   vtkGetMacro( NumberOfThreads, int );
00084 
00086 
00087   virtual int SplitExtent(int splitExt[6], int startExt[6], 
00088                           int num, int total);
00090 
00092 
00095   virtual void ThreadedExecute(vtkImageData **inDatas, 
00096                                vtkImageData *outData,
00097                                int extent[6], int threadId);
00099 
00100 
00101 
00102 protected:
00103   vtkImageMultipleInputFilter();
00104   ~vtkImageMultipleInputFilter();
00105 
00106   vtkMultiThreader *Threader;
00107   int Bypass;
00108   int NumberOfThreads;
00109 
00110   void ComputeInputUpdateExtents( vtkDataObject *output );
00111   
00112   virtual void ComputeInputUpdateExtent( int inExt[6], 
00113                                          int outExt[6], 
00114                                          int whichInput );
00115 
00116 
00117   void ExecuteData(vtkDataObject *output);
00118 
00119   // This one gets called by the superclass.
00120   void ExecuteInformation();
00121   // This is the one you should override.
00122   virtual void ExecuteInformation(vtkImageData **, vtkImageData *) {};
00123 
00124 private:
00125   // hide the superclass' AddInput() from the user and the compiler
00126   void AddInput(vtkDataObject *)
00127     { vtkErrorMacro( << "AddInput() must be called with a vtkImageData not a vtkDataObject."); };
00128   void RemoveInput(vtkDataObject *)
00129     { vtkErrorMacro( << "RemoveInput() must be called with a vtkImageData not a vtkDataObject."); };
00130 private:
00131   vtkImageMultipleInputFilter(const vtkImageMultipleInputFilter&);  // Not implemented.
00132   void operator=(const vtkImageMultipleInputFilter&);  // Not implemented.
00133 };
00134 
00135 #endif
00136 
00137 
00138 
00139 
00140 
00141 
00142