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

vtkImageMultipleInputFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkImageMultipleInputFilter.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 =========================================================================*/
00036 #ifndef __vtkImageMultipleInputFilter_h
00037 #define __vtkImageMultipleInputFilter_h
00038 
00039 #include "vtkImageSource.h"
00040 
00041 class vtkMultiThreader;
00042 
00043 class VTK_FILTERING_EXPORT vtkImageMultipleInputFilter : public vtkImageSource
00044 {
00045 public:
00046   vtkTypeRevisionMacro(vtkImageMultipleInputFilter,vtkImageSource);
00047   void PrintSelf(ostream& os, vtkIndent indent);
00048 
00050   virtual void SetInput(int num, vtkImageData *input);
00051 
00053 
00055   virtual void AddInput(vtkImageData *input);
00056   virtual void RemoveInput(vtkImageData *input);
00058   
00060 
00061   vtkImageData *GetInput(int num);
00062   vtkImageData *GetInput();
00064 
00066 
00069   vtkSetMacro(Bypass,int);
00070   vtkGetMacro(Bypass,int);
00071   vtkBooleanMacro(Bypass,int);
00073 
00075 
00076   vtkSetClampMacro( NumberOfThreads, int, 1, VTK_MAX_THREADS );
00077   vtkGetMacro( NumberOfThreads, int );
00079 
00081 
00082   virtual int SplitExtent(int splitExt[6], int startExt[6], 
00083                           int num, int total);
00085 
00087 
00090   virtual void ThreadedExecute(vtkImageData **inDatas, 
00091                                vtkImageData *outData,
00092                                int extent[6], int threadId);
00094 
00095 
00096 
00097 protected:
00098   vtkImageMultipleInputFilter();
00099   ~vtkImageMultipleInputFilter();
00100 
00101   vtkMultiThreader *Threader;
00102   int Bypass;
00103   int NumberOfThreads;
00104 
00105   void ComputeInputUpdateExtents( vtkDataObject *output );
00106   
00107   virtual void ComputeInputUpdateExtent( int inExt[6], 
00108                                          int outExt[6], 
00109                                          int whichInput );
00110 
00111 
00112   void ExecuteData(vtkDataObject *output);
00113   void MultiThread(vtkImageData **indatas, vtkImageData *outdata);
00114 
00115   // This one gets called by the superclass.
00116   void ExecuteInformation();
00117   // This is the one you should override.
00118   virtual void ExecuteInformation(vtkImageData **, vtkImageData *) {};
00119 
00120   virtual int FillInputPortInformation(int, vtkInformation*);
00121 
00122 private:
00123   // hide the superclass' AddInput() from the user and the compiler
00124   void AddInput(vtkDataObject *)
00125     { vtkErrorMacro( << "AddInput() must be called with a vtkImageData not a vtkDataObject."); };
00126   void RemoveInput(vtkDataObject *)
00127     { vtkErrorMacro( << "RemoveInput() must be called with a vtkImageData not a vtkDataObject."); };
00128 private:
00129   vtkImageMultipleInputFilter(const vtkImageMultipleInputFilter&);  // Not implemented.
00130   void operator=(const vtkImageMultipleInputFilter&);  // Not implemented.
00131 };
00132 
00133 #endif
00134 
00135 
00136 
00137 
00138 
00139 
00140