VTK: Imaging/Stencil/vtkImageStencil.h Source File

| VTK 9.3.1

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
23 #ifndef vtkImageStencil_h
24 #define vtkImageStencil_h
25
26 #include "vtkImagingStencilModule.h" // For export macro
27 #include "vtkThreadedImageAlgorithm.h"
28
29 VTK_ABI_NAMESPACE_BEGIN
30 class vtkImageStencilData;
31
32 class VTKIMAGINGSTENCIL_EXPORT vtkImageStencil : public vtkThreadedImageAlgorithm
33 {
34 public:
35 static vtkImageStencil* New();
36 vtkTypeMacro(vtkImageStencil, vtkThreadedImageAlgorithm);
37 void PrintSelf(ostream& os, vtkIndent indent) override;
38
40
45 virtual void SetStencilData(vtkImageStencilData* stencil);
46 vtkImageStencilData* GetStencil();
48
52 void SetStencilConnection(vtkAlgorithmOutput* outputPort)
53 {
54 this->SetInputConnection(2, outputPort);
55 }
56
58
61 vtkSetMacro(ReverseStencil, vtkTypeBool);
62 vtkBooleanMacro(ReverseStencil, vtkTypeBool);
63 vtkGetMacro(ReverseStencil, vtkTypeBool);
65
67
72 virtual void SetBackgroundInputData(vtkImageData* input);
73 vtkImageData* GetBackgroundInput();
75
77
80 void SetBackgroundValue(double val) { this->SetBackgroundColor(val, val, val, val); }
81 double GetBackgroundValue() { return this->BackgroundColor[0]; }
83
85
89 vtkSetVector4Macro(BackgroundColor, double);
90 vtkGetVector4Macro(BackgroundColor, double);
92
93 protected:
94 vtkImageStencil();
95 ~vtkImageStencil() override;
96
97 void ThreadedRequestData(vtkInformation* request, vtkInformationVector** inputVector,
98 vtkInformationVector* outputVector, vtkImageData*** inData, vtkImageData** outData,
99 int extent[6], int id) override;
100
101 vtkTypeBool ReverseStencil;
102 double BackgroundColor[4];
103
104 int FillInputPortInformation(int, vtkInformation*) override;
105
106 private:
107 vtkImageStencil(const vtkImageStencil&) = delete;
108 void operator=(const vtkImageStencil&) = delete;
109 };
110
111 VTK_ABI_NAMESPACE_END
112 #endif
vtkAlgorithmOutput
Proxy object to connect input/output ports.
Definition: vtkAlgorithmOutput.h:41
vtkAlgorithm::SetInputConnection
virtual void SetInputConnection(int port, vtkAlgorithmOutput *input)
Set the connection for the given input port index.
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:52
vtkImageStencilData
efficient description of an image stencil
Definition: vtkImageStencilData.h:26
vtkImageStencil
combine images via a cookie-cutter operation
Definition: vtkImageStencil.h:33
vtkImageStencil::SetStencilData
virtual void SetStencilData(vtkImageStencilData *stencil)
Specify the stencil to use.
vtkImageStencil::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkImageStencil::SetBackgroundInputData
virtual void SetBackgroundInputData(vtkImageData *input)
Set the second input.
vtkImageStencil::ReverseStencil
vtkTypeBool ReverseStencil
Definition: vtkImageStencil.h:101
vtkImageStencil::GetBackgroundValue
double GetBackgroundValue()
Set the default output value to use when the second input is not set.
Definition: vtkImageStencil.h:81
vtkImageStencil::~vtkImageStencil
~vtkImageStencil() override
vtkImageStencil::GetBackgroundInput
vtkImageData * GetBackgroundInput()
Set the second input.
vtkImageStencil::SetBackgroundValue
void SetBackgroundValue(double val)
Set the default output value to use when the second input is not set.
Definition: vtkImageStencil.h:80
vtkImageStencil::FillInputPortInformation
int FillInputPortInformation(int, vtkInformation *) override
These method should be reimplemented by subclasses that have more than a single input or single outpu...
vtkImageStencil::SetStencilConnection
void SetStencilConnection(vtkAlgorithmOutput *outputPort)
Specify the stencil to use.
Definition: vtkImageStencil.h:52
vtkImageStencil::GetStencil
vtkImageStencilData * GetStencil()
Specify the stencil to use.
vtkImageStencil::vtkImageStencil
vtkImageStencil()
vtkImageStencil::New
static vtkImageStencil * New()
vtkImageStencil::ThreadedRequestData
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,...
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:40
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:72
vtkThreadedImageAlgorithm
Generic filter that has one input.
Definition: vtkThreadedImageAlgorithm.h:34
vtkX3D::extent
@ extent
Definition: vtkX3D.h:345
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:64
vtkThreadedImageAlgorithm.h