VTK  9.4.20241217
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
184#ifndef vtkCleanPolyData_h
185#define vtkCleanPolyData_h
186
187#include "vtkFiltersCoreModule.h" // For export macro
188#include "vtkPolyDataAlgorithm.h"
189
190VTK_ABI_NAMESPACE_BEGIN
192
193class VTKFILTERSCORE_EXPORT vtkCleanPolyData : public vtkPolyDataAlgorithm
194{
195public:
197 void PrintSelf(ostream& os, vtkIndent indent) override;
199
201
206 vtkSetMacro(ToleranceIsAbsolute, vtkTypeBool);
207 vtkBooleanMacro(ToleranceIsAbsolute, vtkTypeBool);
208 vtkGetMacro(ToleranceIsAbsolute, vtkTypeBool);
210
212
216 vtkSetClampMacro(Tolerance, double, 0.0, 1.0);
217 vtkGetMacro(Tolerance, double);
219
221
224 vtkSetClampMacro(AbsoluteTolerance, double, 0.0, VTK_DOUBLE_MAX);
225 vtkGetMacro(AbsoluteTolerance, double);
227
229
232 vtkSetMacro(ConvertLinesToPoints, vtkTypeBool);
233 vtkBooleanMacro(ConvertLinesToPoints, vtkTypeBool);
234 vtkGetMacro(ConvertLinesToPoints, vtkTypeBool);
236
238
241 vtkSetMacro(ConvertPolysToLines, vtkTypeBool);
242 vtkBooleanMacro(ConvertPolysToLines, vtkTypeBool);
243 vtkGetMacro(ConvertPolysToLines, vtkTypeBool);
245
247
250 vtkSetMacro(ConvertStripsToPolys, vtkTypeBool);
251 vtkBooleanMacro(ConvertStripsToPolys, vtkTypeBool);
252 vtkGetMacro(ConvertStripsToPolys, vtkTypeBool);
254
256
262 vtkSetMacro(PointMerging, vtkTypeBool);
263 vtkGetMacro(PointMerging, vtkTypeBool);
264 vtkBooleanMacro(PointMerging, vtkTypeBool);
266
268
273 vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
275
279 void CreateDefaultLocator(vtkPolyData* input = nullptr);
280
284 void ReleaseLocator() { this->SetLocator(nullptr); }
285
290
294 virtual void OperateOnPoint(double in[3], double out[3]);
295
299 virtual void OperateOnBounds(double in[6], double out[6]);
300
301 // This filter is difficult to stream.
302 // To get invariant results, the whole input must be processed at once.
303 // This flag allows the user to select whether strict piece invariance
304 // is required. By default it is on. When off, the filter can stream,
305 // but results may change.
306 vtkSetMacro(PieceInvariant, vtkTypeBool);
307 vtkGetMacro(PieceInvariant, vtkTypeBool);
308 vtkBooleanMacro(PieceInvariant, vtkTypeBool);
309
311
316 vtkSetMacro(OutputPointsPrecision, int);
317 vtkGetMacro(OutputPointsPrecision, int);
319
320protected:
323
324 // Usual data generation method
327
329 double Tolerance;
336
339
340private:
341 vtkCleanPolyData(const vtkCleanPolyData&) = delete;
342 void operator=(const vtkCleanPolyData&) = delete;
343
344 // Check whether a point is a primary point (as opposed to duplicated ghost point)
345 bool IsPrimaryPoint(vtkPolyData* input, vtkIdType ptIndex);
346 // Insert point into newPts. If already present, only get its id.
347 void InsertUniquePoint(vtkIdTypeArray* globalIdsArray, vtkIdType ptIndex, vtkPoints* newPts,
348 std::unordered_map<vtkIdType, vtkIdType>& addedGlobalIdsMap, double* point, vtkIdType& ptId);
349};
350
351VTK_ABI_NAMESPACE_END
352#endif
merge duplicate points, and/or remove unused points and/or remove degenerate cells
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:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
represent and manipulate 3D points
Definition vtkPoints.h:139
Superclass for algorithms that produce only polydata as output.
concrete dataset represents vertices, lines, polygons, and triangle strips
int vtkTypeBool
Definition vtkABI.h:64
int vtkIdType
Definition vtkType.h:315
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:270
#define VTK_DOUBLE_MAX
Definition vtkType.h:154