VTK  9.6.1
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#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
81
82#include <unordered_set>
83
84VTK_ABI_NAMESPACE_BEGIN
86
87class VTKFILTERSCORE_EXPORT VTK_MARSHALAUTO vtkCleanPolyData : public vtkPolyDataAlgorithm
88{
89public:
91 void PrintSelf(ostream& os, vtkIndent indent) override;
93
95
104
106
110 vtkSetClampMacro(Tolerance, double, 0.0, 1.0);
111 vtkGetMacro(Tolerance, double);
113
115
118 vtkSetClampMacro(AbsoluteTolerance, double, 0.0, VTK_DOUBLE_MAX);
119 vtkGetMacro(AbsoluteTolerance, double);
121
123
130
132
139
141
148
150
158 vtkBooleanMacro(PointMerging, vtkTypeBool);
160
162
169
173 void CreateDefaultLocator(vtkPolyData* input = nullptr);
174
178 void ReleaseLocator() { this->SetLocator(nullptr); }
179
184
188 virtual void OperateOnPoint(double in[3], double out[3]);
189
193 virtual void OperateOnBounds(double in[6], double out[6]);
194
195 // This filter is difficult to stream.
196 // To get invariant results, the whole input must be processed at once.
197 // This flag allows the user to select whether strict piece invariance
198 // is required. By default it is on. When off, the filter can stream,
199 // but results may change.
202 vtkBooleanMacro(PieceInvariant, vtkTypeBool);
203
205
210 vtkSetMacro(OutputPointsPrecision, int);
211 vtkGetMacro(OutputPointsPrecision, int);
213
214protected:
217
218 // Usual data generation method
221
223 double Tolerance;
230
233
234private:
235 vtkCleanPolyData(const vtkCleanPolyData&) = delete;
236 void operator=(const vtkCleanPolyData&) = delete;
237
238 // Check whether a point is a primary point (as opposed to duplicated ghost point).
239 bool IsPrimaryPoint(vtkPolyData* input, vtkIdType ptIndex);
240 // Check whether a point's data has already been copied to the output.
241 bool IsPointDataAlreadyCopied(vtkIdType ptIndex);
242 // Insert point into newPts. If already present, only get its id.
243 void InsertUniquePoint(vtkIdTypeArray* globalIdsArray, vtkIdType ptIndex, vtkPoints* newPts,
244 std::unordered_map<vtkIdType, vtkIdType>& addedGlobalIdsMap, double* point, vtkIdType& ptId);
245
246 std::unordered_set<vtkIdType> CopiedPoints;
247};
248
249VTK_ABI_NAMESPACE_END
250#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:368
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:323
#define VTK_DOUBLE_MAX
Definition vtkType.h:207
#define VTK_MARSHALAUTO