VTK  9.3.20240419
vtkPolyDataToImageStencil.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright (c) 2008 Atamai, Inc.
3 // SPDX-License-Identifier: BSD-3-Clause
60 #ifndef vtkPolyDataToImageStencil_h
61 #define vtkPolyDataToImageStencil_h
62 
63 #include "vtkImageStencilSource.h"
64 #include "vtkImagingStencilModule.h" // For export macro
65 
66 VTK_ABI_NAMESPACE_BEGIN
67 class vtkIdList;
68 class vtkMergePoints;
69 class vtkDataSet;
70 class vtkPolyData;
71 
72 class VTKIMAGINGSTENCIL_EXPORT vtkPolyDataToImageStencil : public vtkImageStencilSource
73 {
74 public:
77  void PrintSelf(ostream& os, vtkIndent indent) override;
78 
80 
83  virtual void SetInputData(vtkPolyData*);
86 
88 
95  vtkSetClampMacro(Tolerance, double, 0.0, 1.0);
96  vtkGetMacro(Tolerance, double);
98 
100 
103  vtkGetMacro(EnableSMP, bool);
104  vtkSetMacro(EnableSMP, bool);
106 
107 protected:
110 
112  vtkImageStencilData* output, vtkIdList* storage, int extent[6], int threadId);
113 
114  static void PolyDataCutter(vtkPolyData* input, vtkPolyData* output, vtkIdList* storage, double z);
115 
116  static void PolyDataSelector(
117  vtkPolyData* input, vtkPolyData* output, vtkIdList* storage, double z, double thickness);
118 
120 
122 
126  double Tolerance;
127 
128  bool EnableSMP;
129  class ThreadWorker;
130 
131 private:
133  void operator=(const vtkPolyDataToImageStencil&) = delete;
134 };
135 
136 VTK_ABI_NAMESPACE_END
137 #endif
abstract class to specify dataset behavior
Definition: vtkDataSet.h:166
list of point or cell ids
Definition: vtkIdList.h:133
efficient description of an image stencil
generate an image stencil
a simple class to control print indentation
Definition: vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
merge exactly coincident points
use polydata to mask an image
void ThreadedExecute(vtkImageStencilData *output, vtkIdList *storage, int extent[6], int threadId)
static void PolyDataCutter(vtkPolyData *input, vtkPolyData *output, vtkIdList *storage, double z)
int FillInputPortInformation(int, vtkInformation *) override
Fill the input port information objects for this algorithm.
double Tolerance
The tolerance distance for favoring the inside of the stencil.
virtual void SetInputData(vtkPolyData *)
Specify the implicit function to convert into a stencil.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
~vtkPolyDataToImageStencil() override
static vtkPolyDataToImageStencil * New()
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
static void PolyDataSelector(vtkPolyData *input, vtkPolyData *output, vtkIdList *storage, double z, double thickness)
vtkPolyData * GetInput()
Specify the implicit function to convert into a stencil.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:181
@ extent
Definition: vtkX3D.h:345