VTK
vtkPolyDataToImageStencil.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPolyDataToImageStencil.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 =========================================================================*/
15 /*=========================================================================
16 
17 Copyright (c) 2008 Atamai, Inc.
18 
19 Use, modification and redistribution of the software, in source or
20 binary forms, are permitted provided that the following terms and
21 conditions are met:
22 
23 1) Redistribution of the source code, in verbatim or modified
24  form, must retain the above copyright notice, this license,
25  the following disclaimer, and any notices that refer to this
26  license and/or the following disclaimer.
27 
28 2) Redistribution in binary form must include the above copyright
29  notice, a copy of this license and the following disclaimer
30  in the documentation or with other materials provided with the
31  distribution.
32 
33 3) Modified copies of the source code must be clearly marked as such,
34  and must not be misrepresented as verbatim copies of the source code.
35 
36 THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS"
37 WITHOUT EXPRESSED OR IMPLIED WARRANTY INCLUDING, BUT NOT LIMITED TO,
38 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
39 PURPOSE. IN NO EVENT SHALL ANY COPYRIGHT HOLDER OR OTHER PARTY WHO MAY
40 MODIFY AND/OR REDISTRIBUTE THE SOFTWARE UNDER THE TERMS OF THIS LICENSE
41 BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES
42 (INCLUDING, BUT NOT LIMITED TO, LOSS OF DATA OR DATA BECOMING INACCURATE
43 OR LOSS OF PROFIT OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF
44 THE USE OR INABILITY TO USE THE SOFTWARE, EVEN IF ADVISED OF THE
45 POSSIBILITY OF SUCH DAMAGES.
46 
47 =========================================================================*/
62 #ifndef vtkPolyDataToImageStencil_h
63 #define vtkPolyDataToImageStencil_h
64 
65 #include "vtkImagingStencilModule.h" // For export macro
66 #include "vtkImageStencilSource.h"
67 
68 class vtkMergePoints;
69 class vtkDataSet;
70 class vtkPolyData;
71 
72 class VTKIMAGINGSTENCIL_EXPORT vtkPolyDataToImageStencil :
74 {
75 public:
78  void PrintSelf(ostream& os, vtkIndent indent) override;
79 
81 
84  virtual void SetInputData(vtkPolyData*);
85  vtkPolyData *GetInput();
87 
89 
96  vtkSetClampMacro(Tolerance, double, 0.0, 1.0);
97  vtkGetMacro(Tolerance, double);
99 
100 protected:
102  ~vtkPolyDataToImageStencil() override;
103 
104  void ThreadedExecute(vtkImageStencilData *output,
105  int extent[6], int threadId);
106 
107  static void PolyDataCutter(vtkPolyData *input, vtkPolyData *output,
108  double z);
109 
110  static void PolyDataSelector(vtkPolyData *input, vtkPolyData *output,
111  double z, double thickness);
112 
114  vtkInformationVector *) override;
115 
116  int FillInputPortInformation(int, vtkInformation*) override;
117 
121  double Tolerance;
122 
123 private:
125  void operator=(const vtkPolyDataToImageStencil&) = delete;
126 };
127 
128 #endif
vtkImageStencilSource::New
static vtkImageStencilSource * New()
vtkAlgorithm::FillInputPortInformation
virtual int FillInputPortInformation(int port, vtkInformation *info)
Fill the input port information objects for this algorithm.
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
vtkPolyDataToImageStencil::Tolerance
double Tolerance
The tolerance distance for favoring the inside of the stencil.
Definition: vtkPolyDataToImageStencil.h:121
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkImageStencilSource.h
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:56
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:80
vtkImageStencilSource
generate an image stencil
Definition: vtkImageStencilSource.h:42
vtkImageStencilSource::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
vtkImageStencilData
efficient description of an image stencil
Definition: vtkImageStencilData.h:34
vtkPolyDataToImageStencil
use polydata to mask an image
Definition: vtkPolyDataToImageStencil.h:72
vtkX3D::extent
Definition: vtkX3D.h:345
vtkImageStencilAlgorithm::RequestData
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkMergePoints
merge exactly coincident points
Definition: vtkMergePoints.h:33