VTK
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 =========================================================================*/
23 #ifndef vtkImageStencil_h
24 #define vtkImageStencil_h
25 
26 #include "vtkImagingStencilModule.h" // For export macro
28 
30 
31 class VTKIMAGINGSTENCIL_EXPORT vtkImageStencil : public vtkThreadedImageAlgorithm
32 {
33 public:
34  static vtkImageStencil *New();
36  void PrintSelf(ostream& os, vtkIndent indent) override;
37 
39 
44  virtual void SetStencilData(vtkImageStencilData *stencil);
45  vtkImageStencilData *GetStencil();
47 
52  {
53  this->SetInputConnection(2, outputPort);
54  }
55 
57 
60  vtkSetMacro(ReverseStencil, vtkTypeBool);
61  vtkBooleanMacro(ReverseStencil, vtkTypeBool);
62  vtkGetMacro(ReverseStencil, vtkTypeBool);
64 
66 
71  virtual void SetBackgroundInputData(vtkImageData *input);
72  vtkImageData *GetBackgroundInput();
74 
76 
79  void SetBackgroundValue(double val) {
80  this->SetBackgroundColor(val,val,val,val); };
81  double GetBackgroundValue() {
82  return this->BackgroundColor[0]; };
84 
86 
90  vtkSetVector4Macro(BackgroundColor, double);
91  vtkGetVector4Macro(BackgroundColor, double);
93 
94 protected:
96  ~vtkImageStencil() override;
97 
98  void ThreadedRequestData(vtkInformation *request,
99  vtkInformationVector **inputVector,
100  vtkInformationVector *outputVector,
101  vtkImageData ***inData, vtkImageData **outData,
102  int extent[6], int id) override;
103 
105  double BackgroundColor[4];
106 
107  int FillInputPortInformation(int, vtkInformation*) override;
108 
109 private:
110  vtkImageStencil(const vtkImageStencil&) = delete;
111  void operator=(const vtkImageStencil&) = delete;
112 };
113 
114 #endif
vtkThreadedImageAlgorithm::ThreadedRequestData
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,...
vtkImageStencil::ReverseStencil
vtkTypeBool ReverseStencil
Definition: vtkImageStencil.h:104
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
vtkThreadedImageAlgorithm
Generic filter that has one input.
Definition: vtkThreadedImageAlgorithm.h:37
vtkImageStencil::GetBackgroundValue
double GetBackgroundValue()
Definition: vtkImageStencil.h:81
vtkThreadedImageAlgorithm.h
vtkThreadedImageAlgorithm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:39
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkImageStencil::SetStencilConnection
void SetStencilConnection(vtkAlgorithmOutput *outputPort)
Specify the stencil to use.
Definition: vtkImageStencil.h:51
vtkAlgorithm::SetInputConnection
virtual void SetInputConnection(int port, vtkAlgorithmOutput *input)
Set the connection for the given input port index.
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:80
vtkAlgorithm::New
static vtkAlgorithm * New()
vtkImageStencil
combine images via a cookie-cutter operation
Definition: vtkImageStencil.h:31
vtkAlgorithmOutput
Proxy object to connect input/output ports.
Definition: vtkAlgorithmOutput.h:36
vtkImageStencilData
efficient description of an image stencil
Definition: vtkImageStencilData.h:34
vtkX3D::extent
Definition: vtkX3D.h:345
vtkImageStencil::SetBackgroundValue
void SetBackgroundValue(double val)
Set the default output value to use when the second input is not set.
Definition: vtkImageStencil.h:79
vtkImageAlgorithm::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69