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

vtkThreadedImageAlgorithm.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkThreadedImageAlgorithm.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 =========================================================================*/
00037 #ifndef __vtkThreadedImageAlgorithm_h
00038 #define __vtkThreadedImageAlgorithm_h
00039 
00040 #include "vtkImageAlgorithm.h"
00041 
00042 class vtkImageData;
00043 class vtkMultiThreader;
00044 
00045 class VTK_FILTERING_EXPORT vtkThreadedImageAlgorithm : public vtkImageAlgorithm
00046 {
00047 public:
00048   vtkTypeRevisionMacro(vtkThreadedImageAlgorithm,vtkImageAlgorithm);
00049   void PrintSelf(ostream& os, vtkIndent indent);
00050 
00052 
00056   virtual void ThreadedRequestData(vtkInformation *request, 
00057                                    vtkInformationVector *inputVector, 
00058                                    vtkInformationVector *outputVector,
00059                                    vtkImageData ***inData, 
00060                                    vtkImageData **outData,
00061                                    int extent[6], int threadId);
00063   
00064   // also support the old signature
00065   virtual void ThreadedExecute(vtkImageData *inData, 
00066                                vtkImageData *outData,
00067                                int extent[6], int threadId);
00068   
00070 
00071   vtkSetClampMacro( NumberOfThreads, int, 1, VTK_MAX_THREADS );
00072   vtkGetMacro( NumberOfThreads, int );
00074 
00076 
00077   virtual int SplitExtent(int splitExt[6], int startExt[6], 
00078                           int num, int total); 
00080 
00081 protected:
00082   vtkThreadedImageAlgorithm();
00083   ~vtkThreadedImageAlgorithm();
00084 
00085   vtkMultiThreader *Threader;
00086   int NumberOfThreads;
00087 
00088   // This is called by the superclass.
00089   // This is the method you should override.
00090   virtual void RequestData(vtkInformation *request, 
00091                            vtkInformationVector *inputVector, 
00092                            vtkInformationVector *outputVector);
00093 
00094 private:
00095   vtkThreadedImageAlgorithm(const vtkThreadedImageAlgorithm&);  // Not implemented.
00096   void operator=(const vtkThreadedImageAlgorithm&);  // Not implemented.
00097 };
00098 
00099 #endif
00100 
00101 
00102 
00103 
00104 
00105 
00106