VTK  9.0.1
vtkPolyDataPointSampler.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPolyDataPointSampler.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 =========================================================================*/
53 #ifndef vtkPolyDataPointSampler_h
54 #define vtkPolyDataPointSampler_h
55 
56 #include "vtkEdgeTable.h" // for sampling edges
57 #include "vtkFiltersModelingModule.h" // For export macro
58 #include "vtkNew.h" // for data members
59 #include "vtkPolyDataAlgorithm.h"
60 
61 class VTKFILTERSMODELING_EXPORT vtkPolyDataPointSampler : public vtkPolyDataAlgorithm
62 {
63 public:
68 
70 
74  void PrintSelf(ostream& os, vtkIndent indent) override;
76 
78 
82  vtkSetClampMacro(Distance, double, 0.0, VTK_FLOAT_MAX);
83  vtkGetMacro(Distance, double);
85 
87 
91  vtkGetMacro(GenerateVertexPoints, bool);
92  vtkSetMacro(GenerateVertexPoints, bool);
93  vtkBooleanMacro(GenerateVertexPoints, bool);
95 
97 
101  vtkGetMacro(GenerateEdgePoints, bool);
102  vtkSetMacro(GenerateEdgePoints, bool);
103  vtkBooleanMacro(GenerateEdgePoints, bool);
105 
107 
111  vtkGetMacro(GenerateInteriorPoints, bool);
112  vtkSetMacro(GenerateInteriorPoints, bool);
113  vtkBooleanMacro(GenerateInteriorPoints, bool);
115 
117 
124  vtkGetMacro(GenerateVertices, bool);
125  vtkSetMacro(GenerateVertices, bool);
126  vtkBooleanMacro(GenerateVertices, bool);
128 
130 
138  vtkGetMacro(InterpolatePointData, bool);
139  vtkSetMacro(InterpolatePointData, bool);
140  vtkBooleanMacro(InterpolatePointData, bool);
142 
143 protected:
146 
148 
149  double Distance;
150  double Distance2;
151 
156 
158 
159  // Internal scratch arrays supporting point data interpolation, and
160  // sampling edges.
162  double TriWeights[3];
164  double QuadWeights[4];
166 
167  // Internal methods for sampling edges, triangles, and polygons
169  vtkPoints* pts, vtkIdType p0, vtkIdType p1, vtkPointData* inPD, vtkPointData* outPD);
170  void SampleTriangle(vtkPoints* newPts, vtkPoints* inPts, const vtkIdType* pts, vtkPointData* inPD,
171  vtkPointData* outPD);
172  void SamplePolygon(vtkPoints* newPts, vtkPoints* inPts, vtkIdType npts, const vtkIdType* pts,
173  vtkPointData* inPD, vtkPointData* outPD);
174 
175 private:
177  void operator=(const vtkPolyDataPointSampler&) = delete;
178 };
179 
180 #endif
a simple class to control print indentation
Definition: vtkIndent.h:34
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
represent and manipulate point attribute data
Definition: vtkPointData.h:32
represent and manipulate 3D points
Definition: vtkPoints.h:34
Superclass for algorithms that produce only polydata as output.
generate points from vtkPolyData
void SampleTriangle(vtkPoints *newPts, vtkPoints *inPts, const vtkIdType *pts, vtkPointData *inPD, vtkPointData *outPD)
void SampleEdge(vtkPoints *pts, vtkIdType p0, vtkIdType p1, vtkPointData *inPD, vtkPointData *outPD)
vtkNew< vtkEdgeTable > EdgeTable
void SamplePolygon(vtkPoints *newPts, vtkPoints *inPts, vtkIdType npts, const vtkIdType *pts, vtkPointData *inPD, vtkPointData *outPD)
static vtkPolyDataPointSampler * New()
Instantiate this class.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
int vtkIdType
Definition: vtkType.h:338
#define VTK_FLOAT_MAX
Definition: vtkType.h:163