VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkThreadedImageAlgorithm.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 =========================================================================*/ 00030 #ifndef __vtkThreadedImageAlgorithm_h 00031 #define __vtkThreadedImageAlgorithm_h 00032 00033 #include "vtkImageAlgorithm.h" 00034 00035 class vtkImageData; 00036 class vtkMultiThreader; 00037 00038 class VTK_FILTERING_EXPORT vtkThreadedImageAlgorithm : public vtkImageAlgorithm 00039 { 00040 public: 00041 vtkTypeMacro(vtkThreadedImageAlgorithm,vtkImageAlgorithm); 00042 void PrintSelf(ostream& os, vtkIndent indent); 00043 00045 00049 virtual void ThreadedRequestData(vtkInformation *request, 00050 vtkInformationVector **inputVector, 00051 vtkInformationVector *outputVector, 00052 vtkImageData ***inData, 00053 vtkImageData **outData, 00054 int extent[6], int threadId); 00056 00057 // also support the old signature 00058 virtual void ThreadedExecute(vtkImageData *inData, 00059 vtkImageData *outData, 00060 int extent[6], int threadId); 00061 00063 00064 vtkSetClampMacro( NumberOfThreads, int, 1, VTK_MAX_THREADS ); 00065 vtkGetMacro( NumberOfThreads, int ); 00067 00069 00070 virtual int SplitExtent(int splitExt[6], int startExt[6], 00071 int num, int total); 00073 00074 protected: 00075 vtkThreadedImageAlgorithm(); 00076 ~vtkThreadedImageAlgorithm(); 00077 00078 vtkMultiThreader *Threader; 00079 int NumberOfThreads; 00080 00082 00084 virtual int RequestData(vtkInformation* request, 00085 vtkInformationVector** inputVector, 00086 vtkInformationVector* outputVector); 00088 00089 private: 00090 vtkThreadedImageAlgorithm(const vtkThreadedImageAlgorithm&); // Not implemented. 00091 void operator=(const vtkThreadedImageAlgorithm&); // Not implemented. 00092 }; 00093 00094 #endif 00095 00096 00097 00098 00099 00100 00101