VTK
|
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 00061 virtual void SetBackgroundInput(vtkImageData *input); 00062 vtkImageData *GetBackgroundInput(); 00064 00066 00067 void SetBackgroundValue(double val) { 00068 this->SetBackgroundColor(val,val,val,val); }; 00069 double GetBackgroundValue() { 00070 return this->BackgroundColor[0]; }; 00072 00074 00076 vtkSetVector4Macro(BackgroundColor, double); 00077 vtkGetVector4Macro(BackgroundColor, double); 00079 00080 protected: 00081 vtkImageStencil(); 00082 ~vtkImageStencil(); 00083 00084 virtual int RequestInformation (vtkInformation *, vtkInformationVector **, vtkInformationVector *); 00085 00086 void ThreadedRequestData(vtkInformation *request, 00087 vtkInformationVector **inputVector, 00088 vtkInformationVector *outputVector, 00089 vtkImageData ***inData, vtkImageData **outData, 00090 int extent[6], int id); 00091 00092 int ReverseStencil; 00093 double BackgroundColor[4]; 00094 00095 virtual int FillInputPortInformation(int, vtkInformation*); 00096 00097 private: 00098 vtkImageStencil(const vtkImageStencil&); // Not implemented. 00099 void operator=(const vtkImageStencil&); // Not implemented. 00100 }; 00101 00102 #endif