VTK  9.3.20240328
vtkImageLogic.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
15 #ifndef vtkImageLogic_h
16 #define vtkImageLogic_h
17 
18 // Operation options.
19 #define VTK_AND 0
20 #define VTK_OR 1
21 #define VTK_XOR 2
22 #define VTK_NAND 3
23 #define VTK_NOR 4
24 #define VTK_NOT 5
25 #define VTK_NOP 6
26 
27 #include "vtkImagingMathModule.h" // For export macro
29 
30 VTK_ABI_NAMESPACE_BEGIN
31 class VTKIMAGINGMATH_EXPORT vtkImageLogic : public vtkThreadedImageAlgorithm
32 {
33 public:
34  static vtkImageLogic* New();
36  void PrintSelf(ostream& os, vtkIndent indent) override;
37 
39 
42  vtkSetMacro(Operation, int);
43  vtkGetMacro(Operation, int);
44  void SetOperationToAnd() { this->SetOperation(VTK_AND); }
45  void SetOperationToOr() { this->SetOperation(VTK_OR); }
46  void SetOperationToXor() { this->SetOperation(VTK_XOR); }
47  void SetOperationToNand() { this->SetOperation(VTK_NAND); }
48  void SetOperationToNor() { this->SetOperation(VTK_NOR); }
49  void SetOperationToNot() { this->SetOperation(VTK_NOT); }
51 
53 
56  vtkSetMacro(OutputTrueValue, double);
57  vtkGetMacro(OutputTrueValue, double);
59 
63  virtual void SetInput1Data(vtkDataObject* input) { this->SetInputData(0, input); }
64 
68  virtual void SetInput2Data(vtkDataObject* input) { this->SetInputData(1, input); }
69 
70 protected:
72  ~vtkImageLogic() override = default;
73 
74  int Operation;
76 
78  vtkInformationVector* outputVector, vtkImageData*** inData, vtkImageData** outData, int ext[6],
79  int id) override;
81 
82 private:
83  vtkImageLogic(const vtkImageLogic&) = delete;
84  void operator=(const vtkImageLogic&) = delete;
85 };
86 
87 VTK_ABI_NAMESPACE_END
88 #endif
general representation of visualization data
void SetInputData(vtkDataObject *)
Assign a data object as input.
topologically and geometrically regular array of data
Definition: vtkImageData.h:155
And, or, xor, nand, nor, not.
Definition: vtkImageLogic.h:32
void SetOperationToXor()
Set/Get the Operation to perform.
Definition: vtkImageLogic.h:46
virtual void SetInput2Data(vtkDataObject *input)
Set the Input2 of this filter.
Definition: vtkImageLogic.h:68
double OutputTrueValue
Definition: vtkImageLogic.h:75
void SetOperationToNor()
Set/Get the Operation to perform.
Definition: vtkImageLogic.h:48
void SetOperationToNand()
Set/Get the Operation to perform.
Definition: vtkImageLogic.h:47
void SetOperationToAnd()
Set/Get the Operation to perform.
Definition: vtkImageLogic.h:44
void SetOperationToOr()
Set/Get the Operation to perform.
Definition: vtkImageLogic.h:45
~vtkImageLogic() override=default
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void ThreadedRequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector, vtkImageData ***inData, vtkImageData **outData, int ext[6], int id) override
If the subclass does not define an Execute method, then the task will be broken up,...
virtual void SetInput1Data(vtkDataObject *input)
Set the Input1 of this filter.
Definition: vtkImageLogic.h:63
int FillInputPortInformation(int port, vtkInformation *info) override
These method should be reimplemented by subclasses that have more than a single input or single outpu...
void SetOperationToNot()
Set/Get the Operation to perform.
Definition: vtkImageLogic.h:49
static vtkImageLogic * New()
a simple class to control print indentation
Definition: vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Generic filter that has one input.
@ info
Definition: vtkX3D.h:376
@ port
Definition: vtkX3D.h:447
#define VTK_NAND
Definition: vtkImageLogic.h:22
#define VTK_AND
Definition: vtkImageLogic.h:19
#define VTK_XOR
Definition: vtkImageLogic.h:21
#define VTK_NOR
Definition: vtkImageLogic.h:23
#define VTK_OR
Definition: vtkImageLogic.h:20
#define VTK_NOT
Definition: vtkImageLogic.h:24