VTK  9.5.2
vtkCleanPolyData.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
74
75#ifndef vtkCleanPolyData_h
76#define vtkCleanPolyData_h
77
78#include "vtkFiltersCoreModule.h" // For export macro
80
81#include <unordered_set>
82
83VTK_ABI_NAMESPACE_BEGIN
85
86class VTKFILTERSCORE_EXPORT vtkCleanPolyData : public vtkPolyDataAlgorithm
87{
88public:
90 void PrintSelf(ostream& os, vtkIndent indent) override;
92
94
103
105
109 vtkSetClampMacro(Tolerance, double, 0.0, 1.0);
110 vtkGetMacro(Tolerance, double);
112
114
117 vtkSetClampMacro(AbsoluteTolerance, double, 0.0, VTK_DOUBLE_MAX);
118 vtkGetMacro(AbsoluteTolerance, double);
120
122
129
131
138
140
147
149
157 vtkBooleanMacro(PointMerging, vtkTypeBool);
159
161
168
172 void CreateDefaultLocator(vtkPolyData* input = nullptr);
173
177 void ReleaseLocator() { this->SetLocator(nullptr); }
178
183
187 virtual void OperateOnPoint(double in[3], double out[3]);
188
192 virtual void OperateOnBounds(double in[6], double out[6]);
193
194 // This filter is difficult to stream.
195 // To get invariant results, the whole input must be processed at once.
196 // This flag allows the user to select whether strict piece invariance
197 // is required. By default it is on. When off, the filter can stream,
198 // but results may change.
201 vtkBooleanMacro(PieceInvariant, vtkTypeBool);
202
204
209 vtkSetMacro(OutputPointsPrecision, int);
210 vtkGetMacro(OutputPointsPrecision, int);
212
213protected:
216
217 // Usual data generation method
220
222 double Tolerance;
229
232
233private:
234 vtkCleanPolyData(const vtkCleanPolyData&) = delete;
235 void operator=(const vtkCleanPolyData&) = delete;
236
237 // Check whether a point is a primary point (as opposed to duplicated ghost point).
238 bool IsPrimaryPoint(vtkPolyData* input, vtkIdType ptIndex);
239 // Check whether a point's data has already been copied to the output.
240 bool IsPointDataAlreadyCopied(vtkIdType ptIndex);
241 // Insert point into newPts. If already present, only get its id.
242 void InsertUniquePoint(vtkIdTypeArray* globalIdsArray, vtkIdType ptIndex, vtkPoints* newPts,
243 std::unordered_map<vtkIdType, vtkIdType>& addedGlobalIdsMap, double* point, vtkIdType& ptId);
244
245 std::unordered_set<vtkIdType> CopiedPoints;
246};
247
248VTK_ABI_NAMESPACE_END
249#endif
virtual void OperateOnPoint(double in[3], double out[3])
Perform operation on a point.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void ReleaseLocator()
Release locator.
virtual void OperateOnBounds(double in[6], double out[6])
Perform operation on bounds.
vtkTypeBool PointMerging
vtkTypeBool ConvertPolysToLines
vtkMTimeType GetMTime() override
Get the MTime of this object also considering the locator.
vtkTypeBool ConvertLinesToPoints
static vtkCleanPolyData * New()
int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
~vtkCleanPolyData() override
void CreateDefaultLocator(vtkPolyData *input=nullptr)
Create default locator.
virtual void SetLocator(vtkIncrementalPointLocator *locator)
Set/Get a spatial locator for speeding the search process.
vtkIncrementalPointLocator * Locator
vtkTypeBool ConvertStripsToPolys
vtkTypeBool ToleranceIsAbsolute
vtkTypeBool PieceInvariant
dynamic, self-adjusting array of vtkIdType
Abstract class in support of both point location and point insertion.
a simple class to control print indentation
Definition vtkIndent.h:29
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
represent and manipulate 3D points
Definition vtkPoints.h:30
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition vtkPolyData.h:72
int vtkTypeBool
Definition vtkABI.h:64
int vtkIdType
Definition vtkType.h:332
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:287
#define VTK_DOUBLE_MAX
Definition vtkType.h:171