VTK
dox/Imaging/Math/vtkImageLogic.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkImageLogic.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 __vtkImageLogic_h
00027 #define __vtkImageLogic_h
00028 
00029 
00030 // Operation options.
00031 #define VTK_AND          0
00032 #define VTK_OR           1
00033 #define VTK_XOR          2
00034 #define VTK_NAND         3
00035 #define VTK_NOR          4
00036 #define VTK_NOT          5
00037 #define VTK_NOP          6
00038 
00039 
00040 
00041 #include "vtkImagingMathModule.h" // For export macro
00042 #include "vtkThreadedImageAlgorithm.h"
00043 
00044 class VTKIMAGINGMATH_EXPORT vtkImageLogic : public vtkThreadedImageAlgorithm
00045 {
00046 public:
00047   static vtkImageLogic *New();
00048   vtkTypeMacro(vtkImageLogic,vtkThreadedImageAlgorithm);
00049   void PrintSelf(ostream& os, vtkIndent indent);
00050 
00052 
00053   vtkSetMacro(Operation,int);
00054   vtkGetMacro(Operation,int);
00055   void SetOperationToAnd() {this->SetOperation(VTK_AND);};
00056   void SetOperationToOr() {this->SetOperation(VTK_OR);};
00057   void SetOperationToXor() {this->SetOperation(VTK_XOR);};
00058   void SetOperationToNand() {this->SetOperation(VTK_NAND);};
00059   void SetOperationToNor() {this->SetOperation(VTK_NOR);};
00060   void SetOperationToNot() {this->SetOperation(VTK_NOT);};
00062 
00064 
00065   vtkSetMacro(OutputTrueValue, double);
00066   vtkGetMacro(OutputTrueValue, double);
00068 
00070   virtual void SetInput1Data(vtkDataObject *input) { this->SetInputData(0,input);};
00071 
00073   virtual void SetInput2Data(vtkDataObject *input) { this->SetInputData(1,input);};
00074 
00075 protected:
00076   vtkImageLogic();
00077   ~vtkImageLogic() {}
00078 
00079   int Operation;
00080   double OutputTrueValue;
00081 
00082   void ThreadedRequestData (vtkInformation* request,
00083                             vtkInformationVector** inputVector,
00084                             vtkInformationVector* outputVector,
00085                             vtkImageData ***inData, vtkImageData **outData,
00086                             int ext[6], int id);
00087   virtual int FillInputPortInformation(int port, vtkInformation* info);
00088 
00089 private:
00090   vtkImageLogic(const vtkImageLogic&);  // Not implemented.
00091   void operator=(const vtkImageLogic&);  // Not implemented.
00092 };
00093 
00094 #endif
00095 
00096 
00097 
00098 
00099 
00100 
00101 
00102 
00103 
00104 
00105 
00106 
00107