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 "vtkImagingStencilModule.h" // For export macro 00032 #include "vtkThreadedImageAlgorithm.h" 00033 00034 class vtkImageStencilData; 00035 00036 class VTKIMAGINGSTENCIL_EXPORT vtkImageStencil : public vtkThreadedImageAlgorithm 00037 { 00038 public: 00039 static vtkImageStencil *New(); 00040 vtkTypeMacro(vtkImageStencil, vtkThreadedImageAlgorithm); 00041 void PrintSelf(ostream& os, vtkIndent indent); 00042 00044 00047 virtual void SetStencilData(vtkImageStencilData *stencil); 00048 vtkImageStencilData *GetStencil(); 00050 00052 00053 void SetStencilConnection(vtkAlgorithmOutput* outputPort) 00054 { 00055 this->SetInputConnection(2, outputPort); 00056 } 00058 00060 00061 vtkSetMacro(ReverseStencil, int); 00062 vtkBooleanMacro(ReverseStencil, int); 00063 vtkGetMacro(ReverseStencil, int); 00065 00067 00070 virtual void SetBackgroundInputData(vtkImageData *input); 00071 vtkImageData *GetBackgroundInput(); 00073 00075 00076 void SetBackgroundValue(double val) { 00077 this->SetBackgroundColor(val,val,val,val); }; 00078 double GetBackgroundValue() { 00079 return this->BackgroundColor[0]; }; 00081 00083 00085 vtkSetVector4Macro(BackgroundColor, double); 00086 vtkGetVector4Macro(BackgroundColor, double); 00088 00089 protected: 00090 vtkImageStencil(); 00091 ~vtkImageStencil(); 00092 00093 void ThreadedRequestData(vtkInformation *request, 00094 vtkInformationVector **inputVector, 00095 vtkInformationVector *outputVector, 00096 vtkImageData ***inData, vtkImageData **outData, 00097 int extent[6], int id); 00098 00099 int ReverseStencil; 00100 double BackgroundColor[4]; 00101 00102 virtual int FillInputPortInformation(int, vtkInformation*); 00103 00104 private: 00105 vtkImageStencil(const vtkImageStencil&); // Not implemented. 00106 void operator=(const vtkImageStencil&); // Not implemented. 00107 }; 00108 00109 #endif