VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkImageMultipleInputFilter.h 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 =========================================================================*/ 00025 #ifndef __vtkImageMultipleInputFilter_h 00026 #define __vtkImageMultipleInputFilter_h 00027 00028 #include "vtkImageSource.h" 00029 00030 class vtkMultiThreader; 00031 00032 class VTK_FILTERING_EXPORT vtkImageMultipleInputFilter : public vtkImageSource 00033 { 00034 public: 00035 vtkTypeMacro(vtkImageMultipleInputFilter,vtkImageSource); 00036 void PrintSelf(ostream& os, vtkIndent indent); 00037 00039 virtual void SetInput(int num, vtkImageData *input); 00040 00042 00044 virtual void AddInput(vtkImageData *input); 00045 virtual void RemoveInput(vtkImageData *input); 00047 00049 00050 vtkImageData *GetInput(int num); 00051 vtkImageData *GetInput(); 00053 00055 00058 vtkSetMacro(Bypass,int); 00059 vtkGetMacro(Bypass,int); 00060 vtkBooleanMacro(Bypass,int); 00062 00064 00065 vtkSetClampMacro( NumberOfThreads, int, 1, VTK_MAX_THREADS ); 00066 vtkGetMacro( NumberOfThreads, int ); 00068 00070 00071 virtual int SplitExtent(int splitExt[6], int startExt[6], 00072 int num, int total); 00074 00076 00079 virtual void ThreadedExecute(vtkImageData **inDatas, 00080 vtkImageData *outData, 00081 int extent[6], int threadId); 00083 00084 00085 00086 protected: 00087 vtkImageMultipleInputFilter(); 00088 ~vtkImageMultipleInputFilter(); 00089 00090 vtkMultiThreader *Threader; 00091 int Bypass; 00092 int NumberOfThreads; 00093 00094 void ComputeInputUpdateExtents( vtkDataObject *output ); 00095 00096 virtual void ComputeInputUpdateExtent( int inExt[6], 00097 int outExt[6], 00098 int whichInput ); 00099 00100 00101 void ExecuteData(vtkDataObject *output); 00102 void MultiThread(vtkImageData **indatas, vtkImageData *outdata); 00103 00104 // This one gets called by the superclass. 00105 void ExecuteInformation(); 00106 // This is the one you should override. 00107 virtual void ExecuteInformation(vtkImageData **, vtkImageData *) {}; 00108 00109 virtual int FillInputPortInformation(int, vtkInformation*); 00110 00111 private: 00112 // hide the superclass' AddInput() from the user and the compiler 00113 void AddInput(vtkDataObject *) 00114 { vtkErrorMacro( << "AddInput() must be called with a vtkImageData not a vtkDataObject."); }; 00115 void RemoveInput(vtkDataObject *) 00116 { vtkErrorMacro( << "RemoveInput() must be called with a vtkImageData not a vtkDataObject."); }; 00117 private: 00118 vtkImageMultipleInputFilter(const vtkImageMultipleInputFilter&); // Not implemented. 00119 void operator=(const vtkImageMultipleInputFilter&); // Not implemented. 00120 }; 00121 00122 #endif 00123 00124 00125 00126 00127 00128 00129