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

dox/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 =========================================================================*/
00030 #ifndef __vtkImageMultipleInputFilter_h
00031 #define __vtkImageMultipleInputFilter_h
00032 
00033 #include "vtkImageSource.h"
00034 
00035 class vtkMultiThreader;
00036 
00037 class VTK_FILTERING_EXPORT vtkImageMultipleInputFilter : public vtkImageSource
00038 {
00039 public:
00040   vtkTypeRevisionMacro(vtkImageMultipleInputFilter,vtkImageSource);
00041   void PrintSelf(ostream& os, vtkIndent indent);
00042 
00044   virtual void SetInput(int num, vtkImageData *input);
00045 
00047 
00049   virtual void AddInput(vtkImageData *input);
00050   virtual void RemoveInput(vtkImageData *input);
00052   
00054 
00055   vtkImageData *GetInput(int num);
00056   vtkImageData *GetInput();
00058 
00060 
00063   vtkSetMacro(Bypass,int);
00064   vtkGetMacro(Bypass,int);
00065   vtkBooleanMacro(Bypass,int);
00067 
00069 
00070   vtkSetClampMacro( NumberOfThreads, int, 1, VTK_MAX_THREADS );
00071   vtkGetMacro( NumberOfThreads, int );
00073 
00075 
00076   virtual int SplitExtent(int splitExt[6], int startExt[6], 
00077                           int num, int total);
00079 
00081 
00084   virtual void ThreadedExecute(vtkImageData **inDatas, 
00085                                vtkImageData *outData,
00086                                int extent[6], int threadId);
00088 
00089 
00090 
00091 protected:
00092   vtkImageMultipleInputFilter();
00093   ~vtkImageMultipleInputFilter();
00094 
00095   vtkMultiThreader *Threader;
00096   int Bypass;
00097   int NumberOfThreads;
00098 
00099   void ComputeInputUpdateExtents( vtkDataObject *output );
00100   
00101   virtual void ComputeInputUpdateExtent( int inExt[6], 
00102                                          int outExt[6], 
00103                                          int whichInput );
00104 
00105 
00106   void ExecuteData(vtkDataObject *output);
00107 
00108   // This one gets called by the superclass.
00109   void ExecuteInformation();
00110   // This is the one you should override.
00111   virtual void ExecuteInformation(vtkImageData **, vtkImageData *) {};
00112 
00113 private:
00114   // hide the superclass' AddInput() from the user and the compiler
00115   void AddInput(vtkDataObject *)
00116     { vtkErrorMacro( << "AddInput() must be called with a vtkImageData not a vtkDataObject."); };
00117   void RemoveInput(vtkDataObject *)
00118     { vtkErrorMacro( << "RemoveInput() must be called with a vtkImageData not a vtkDataObject."); };
00119 private:
00120   vtkImageMultipleInputFilter(const vtkImageMultipleInputFilter&);  // Not implemented.
00121   void operator=(const vtkImageMultipleInputFilter&);  // Not implemented.
00122 };
00123 
00124 #endif
00125 
00126 
00127 
00128 
00129 
00130 
00131