VTK  9.2.5
vtkImageStencil.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkImageStencil.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
65 #ifndef vtkImageStencil_h
66 #define vtkImageStencil_h
67 
68 #include "vtkImagingStencilModule.h" // For export macro
70 
72 
73 class VTKIMAGINGSTENCIL_EXPORT vtkImageStencil : public vtkThreadedImageAlgorithm
74 {
75 public:
76  static vtkImageStencil* New();
78  void PrintSelf(ostream& os, vtkIndent indent) override;
79 
81 
86  virtual void SetStencilData(vtkImageStencilData* stencil);
89 
94  {
95  this->SetInputConnection(2, outputPort);
96  }
97 
99 
102  vtkSetMacro(ReverseStencil, vtkTypeBool);
103  vtkBooleanMacro(ReverseStencil, vtkTypeBool);
104  vtkGetMacro(ReverseStencil, vtkTypeBool);
106 
108 
113  virtual void SetBackgroundInputData(vtkImageData* input);
116 
118 
121  void SetBackgroundValue(double val) { this->SetBackgroundColor(val, val, val, val); }
122  double GetBackgroundValue() { return this->BackgroundColor[0]; }
124 
126 
130  vtkSetVector4Macro(BackgroundColor, double);
131  vtkGetVector4Macro(BackgroundColor, double);
133 
134 protected:
136  ~vtkImageStencil() override;
137 
139  vtkInformationVector* outputVector, vtkImageData*** inData, vtkImageData** outData,
140  int extent[6], int id) override;
141 
143  double BackgroundColor[4];
144 
146 
147 private:
148  vtkImageStencil(const vtkImageStencil&) = delete;
149  void operator=(const vtkImageStencil&) = delete;
150 };
151 
152 #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
Definition: vtkImageData.h:163
efficient description of an image stencil
combine images via a cookie-cutter operation
virtual void SetStencilData(vtkImageStencilData *stencil)
Specify the stencil to use.
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
double GetBackgroundValue()
Set the default output value to use when the second input is not set.
~vtkImageStencil() override
vtkImageData * GetBackgroundInput()
Set the second input.
void SetBackgroundValue(double val)
Set the default output value to use when the second input is not set.
int FillInputPortInformation(int, vtkInformation *) override
These method should be reimplemented by subclasses that have more than a single input or single outpu...
void SetStencilConnection(vtkAlgorithmOutput *outputPort)
Specify the stencil to use.
vtkImageStencilData * GetStencil()
Specify the stencil to use.
static vtkImageStencil * New()
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:119
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Generic filter that has one input.
@ extent
Definition: vtkX3D.h:351
int vtkTypeBool
Definition: vtkABI.h:69