VTK  9.3.1
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:
71  vtkImageLogic();
72  ~vtkImageLogic() override = default;
73 
74  int Operation;
76 
77  void ThreadedRequestData(vtkInformation* request, vtkInformationVector** inputVector,
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
void SetOperationToXor()
Set/Get the Operation to perform.
Definition: vtkImageLogic.h:46
Store vtkAlgorithm input/output information.
void SetOperationToAnd()
Set/Get the Operation to perform.
Definition: vtkImageLogic.h:44
void SetInputData(vtkDataObject *)
Assign a data object as input.
#define VTK_NOR
Definition: vtkImageLogic.h:23
Generic filter that has one input.
#define VTK_OR
Definition: vtkImageLogic.h:20
a simple class to control print indentation
Definition: vtkIndent.h:28
topologically and geometrically regular array of data
Definition: vtkImageData.h:42
void SetOperationToNor()
Set/Get the Operation to perform.
Definition: vtkImageLogic.h:48
#define VTK_NAND
Definition: vtkImageLogic.h:22
virtual void ThreadedRequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector, vtkImageData ***inData, vtkImageData **outData, int extent[6], int threadId)
If the subclass does not define an Execute method, then the task will be broken up, multiple threads will be spawned, and each thread will call this method.
void SetOperationToOr()
Set/Get the Operation to perform.
Definition: vtkImageLogic.h:45
void SetOperationToNand()
Set/Get the Operation to perform.
Definition: vtkImageLogic.h:47
virtual void SetInput1Data(vtkDataObject *input)
Set the Input1 of this filter.
Definition: vtkImageLogic.h:63
#define VTK_XOR
Definition: vtkImageLogic.h:21
int FillInputPortInformation(int port, vtkInformation *info) override
These method should be reimplemented by subclasses that have more than a single input or single outpu...
#define VTK_NOT
Definition: vtkImageLogic.h:24
Store zero or more vtkInformation instances.
static vtkAlgorithm * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetOperationToNot()
Set/Get the Operation to perform.
Definition: vtkImageLogic.h:49
general representation of visualization data
Definition: vtkDataObject.h:54
And, or, xor, nand, nor, not.
Definition: vtkImageLogic.h:31
#define VTK_AND
Definition: vtkImageLogic.h:19
double OutputTrueValue
Definition: vtkImageLogic.h:75
virtual void SetInput2Data(vtkDataObject *input)
Set the Input2 of this filter.
Definition: vtkImageLogic.h:68