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