VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkImageMaskBits.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 =========================================================================*/ 00026 #ifndef __vtkImageMaskBits_h 00027 #define __vtkImageMaskBits_h 00028 00029 #include "vtkImagingMathModule.h" // For export macro 00030 #include "vtkImageLogic.h" //For VTK_AND, VTK_OR ... 00031 #include "vtkThreadedImageAlgorithm.h" 00032 00033 class VTKIMAGINGMATH_EXPORT vtkImageMaskBits : public vtkThreadedImageAlgorithm 00034 { 00035 public: 00036 static vtkImageMaskBits *New(); 00037 vtkTypeMacro(vtkImageMaskBits,vtkThreadedImageAlgorithm); 00038 void PrintSelf(ostream& os, vtkIndent indent); 00039 00041 00042 vtkSetVector4Macro(Masks, unsigned int); 00043 void SetMask(unsigned int mask) 00044 {this->SetMasks(mask, mask, mask, mask);} 00045 void SetMasks(unsigned int mask1, unsigned int mask2) 00046 {this->SetMasks(mask1, mask2, 0xffffffff, 0xffffffff);} 00047 void SetMasks(unsigned int mask1, unsigned int mask2, unsigned int mask3) 00048 {this->SetMasks(mask1, mask2, mask3, 0xffffffff);} 00049 vtkGetVector4Macro(Masks, unsigned int); 00051 00053 00054 vtkSetMacro(Operation,int); 00055 vtkGetMacro(Operation,int); 00056 void SetOperationToAnd() {this->SetOperation(VTK_AND);}; 00057 void SetOperationToOr() {this->SetOperation(VTK_OR);}; 00058 void SetOperationToXor() {this->SetOperation(VTK_XOR);}; 00059 void SetOperationToNand() {this->SetOperation(VTK_NAND);}; 00060 void SetOperationToNor() {this->SetOperation(VTK_NOR);}; 00062 00063 protected: 00064 vtkImageMaskBits(); 00065 ~vtkImageMaskBits() {} 00066 00067 void ThreadedExecute (vtkImageData *inData, vtkImageData *outData, 00068 int ext[6], int id); 00069 00070 unsigned int Masks[4]; 00071 int Operation; 00072 private: 00073 vtkImageMaskBits(const vtkImageMaskBits&); // Not implemented. 00074 void operator=(const vtkImageMaskBits&); // Not implemented. 00075 }; 00076 00077 #endif