VTK  9.5.2
vtkImageStencil.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
13
14#ifndef vtkImageStencil_h
15#define vtkImageStencil_h
16
17#include "vtkImagingStencilModule.h" // For export macro
19
20VTK_ABI_NAMESPACE_BEGIN
22
23class VTKIMAGINGSTENCIL_EXPORT vtkImageStencil : public vtkThreadedImageAlgorithm
24{
25public:
28 void PrintSelf(ostream& os, vtkIndent indent) override;
29
31
36 virtual void SetStencilData(vtkImageStencilData* stencil);
39
44 {
45 this->SetInputConnection(2, outputPort);
46 }
47
49
53 vtkBooleanMacro(ReverseStencil, vtkTypeBool);
56
58
66
68
71 void SetBackgroundValue(double val) { this->SetBackgroundColor(val, val, val, val); }
72 double GetBackgroundValue() { return this->BackgroundColor[0]; }
74
76
80 vtkSetVector4Macro(BackgroundColor, double);
81 vtkGetVector4Macro(BackgroundColor, double);
83
84protected:
86 ~vtkImageStencil() override;
87
89 vtkInformationVector* outputVector, vtkImageData*** inData, vtkImageData** outData,
90 int extent[6], int id) override;
91
93 double BackgroundColor[4];
94
96
97private:
98 vtkImageStencil(const vtkImageStencil&) = delete;
99 void operator=(const vtkImageStencil&) = delete;
100};
101
102VTK_ABI_NAMESPACE_END
103#endif
Proxy object to connect input/output ports.
virtual void SetInputConnection(int port, vtkAlgorithmOutput *input)
Set the connection for the given input port index.
topologically and geometrically regular array of data
efficient description of an image stencil
virtual void SetStencilData(vtkImageStencilData *stencil)
Specify the stencil to use.
static vtkImageStencil * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void SetBackgroundInputData(vtkImageData *input)
Set the second input.
vtkTypeBool ReverseStencil
vtkImageData * GetBackgroundInput()
Set the second input.
double GetBackgroundValue()
Set the default output value to use when the second input is not set.
~vtkImageStencil() override
virtual void SetBackgroundColor(double, double, double, double)
Set the default color to use when the second input is not set.
void SetBackgroundValue(double val)
Set the default output value to use when the second input is not set.
int FillInputPortInformation(int, vtkInformation *) override
double BackgroundColor[4]
void SetStencilConnection(vtkAlgorithmOutput *outputPort)
Specify the stencil to use.
vtkImageStencilData * GetStencil()
Specify the stencil to use.
void ThreadedRequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector, vtkImageData ***inData, vtkImageData **outData, int extent[6], int id) override
If the subclass does not define an Execute method, then the task will be broken up,...
a simple class to control print indentation
Definition vtkIndent.h:29
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
int vtkTypeBool
Definition vtkABI.h:64