VTK
dox/Imaging/vtkImageStencil.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkImageStencil.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 =========================================================================*/
00028 #ifndef __vtkImageStencil_h
00029 #define __vtkImageStencil_h
00030 
00031 #include "vtkThreadedImageAlgorithm.h"
00032 
00033 class vtkImageStencilData;
00034 
00035 class VTK_IMAGING_EXPORT vtkImageStencil : public vtkThreadedImageAlgorithm
00036 {
00037 public:
00038   static vtkImageStencil *New();
00039   vtkTypeMacro(vtkImageStencil, vtkThreadedImageAlgorithm);
00040   void PrintSelf(ostream& os, vtkIndent indent);
00041 
00043 
00045   virtual void SetStencil(vtkImageStencilData *stencil);
00046   vtkImageStencilData *GetStencil();
00048 
00050 
00051   vtkSetMacro(ReverseStencil, int);
00052   vtkBooleanMacro(ReverseStencil, int);
00053   vtkGetMacro(ReverseStencil, int);
00055 
00057 
00060   virtual void SetBackgroundInput(vtkImageData *input);
00061   vtkImageData *GetBackgroundInput();
00063 
00065 
00066   void SetBackgroundValue(double val) {
00067     this->SetBackgroundColor(val,val,val,val); };
00068   double GetBackgroundValue() {
00069     return this->BackgroundColor[0]; };
00071 
00073 
00075   vtkSetVector4Macro(BackgroundColor, double);
00076   vtkGetVector4Macro(BackgroundColor, double);
00078 
00079 protected:
00080   vtkImageStencil();
00081   ~vtkImageStencil();
00082   
00083   void ThreadedRequestData(vtkInformation *request,
00084                            vtkInformationVector **inputVector,
00085                            vtkInformationVector *outputVector,
00086                            vtkImageData ***inData, vtkImageData **outData,
00087                            int extent[6], int id);
00088   
00089   int ReverseStencil;
00090   double BackgroundColor[4];
00091 
00092   virtual int FillInputPortInformation(int, vtkInformation*);
00093 
00094 private:
00095   vtkImageStencil(const vtkImageStencil&);  // Not implemented.
00096   void operator=(const vtkImageStencil&);  // Not implemented.
00097 };
00098 
00099 #endif