Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class 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 =========================================================================*/
00042 #ifndef __vtkImageMultipleInputFilter_h
00043 #define __vtkImageMultipleInputFilter_h
00044 
00045 #include "vtkImageSource.h"
00046 
00047 class vtkMultiThreader;
00048 
00049 class VTK_FILTERING_EXPORT vtkImageMultipleInputFilter : public vtkImageSource
00050 {
00051 public:
00052   vtkTypeRevisionMacro(vtkImageMultipleInputFilter,vtkImageSource);
00053   void PrintSelf(ostream& os, vtkIndent indent);
00054 
00056   virtual void SetInput(int num, vtkImageData *input);
00057 
00059 
00061   virtual void AddInput(vtkImageData *input);
00062   virtual void RemoveInput(vtkImageData *input);
00064   
00066 
00067   vtkImageData *GetInput(int num);
00068   vtkImageData *GetInput();
00070 
00072 
00075   vtkSetMacro(Bypass,int);
00076   vtkGetMacro(Bypass,int);
00077   vtkBooleanMacro(Bypass,int);
00079 
00081 
00082   vtkSetClampMacro( NumberOfThreads, int, 1, VTK_MAX_THREADS );
00083   vtkGetMacro( NumberOfThreads, int );
00085 
00087 
00088   virtual int SplitExtent(int splitExt[6], int startExt[6], 
00089                           int num, int total);
00091 
00093 
00096   virtual void ThreadedExecute(vtkImageData **inDatas, 
00097                                vtkImageData *outData,
00098                                int extent[6], int threadId);
00100 
00101 
00102 
00103 protected:
00104   vtkImageMultipleInputFilter();
00105   ~vtkImageMultipleInputFilter();
00106 
00107   vtkMultiThreader *Threader;
00108   int Bypass;
00109   int NumberOfThreads;
00110 
00111   void ComputeInputUpdateExtents( vtkDataObject *output );
00112   
00113   virtual void ComputeInputUpdateExtent( int inExt[6], 
00114                                          int outExt[6], 
00115                                          int whichInput );
00116 
00117 
00118   void ExecuteData(vtkDataObject *output);
00119 
00120   // This one gets called by the superclass.
00121   void ExecuteInformation();
00122   // This is the one you should override.
00123   virtual void ExecuteInformation(vtkImageData **, vtkImageData *) {};
00124 
00125 private:
00126   // hide the superclass' AddInput() from the user and the compiler
00127   void AddInput(vtkDataObject *)
00128     { vtkErrorMacro( << "AddInput() must be called with a vtkImageData not a vtkDataObject."); };
00129   void RemoveInput(vtkDataObject *)
00130     { vtkErrorMacro( << "RemoveInput() must be called with a vtkImageData not a vtkDataObject."); };
00131 private:
00132   vtkImageMultipleInputFilter(const vtkImageMultipleInputFilter&);  // Not implemented.
00133   void operator=(const vtkImageMultipleInputFilter&);  // Not implemented.
00134 };
00135 
00136 #endif
00137 
00138 
00139 
00140 
00141 
00142 
00143