vtkCleanUnstructuredGrid.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkCleanUnstructuredGrid.h
5 
6  Copyright (c) Kitware, Inc.
7  All rights reserved.
8  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html 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 =========================================================================*/
15 
30 #ifndef vtkCleanUnstructuredGrid_h
31 #define vtkCleanUnstructuredGrid_h
32 
33 #include "vtkPVVTKExtensionsFiltersGeneralModule.h" //needed for exports
35 
37 class vtkDataSet;
38 
41 {
42 public:
43  static vtkCleanUnstructuredGrid* New();
44 
46 
47  // By default ToleranceIsAbsolute is false and Tolerance is
48  // a fraction of Bounding box diagonal, if true, AbsoluteTolerance is
49  // used when adding points to locator (merging)
50  vtkSetMacro(ToleranceIsAbsolute, bool);
51  vtkBooleanMacro(ToleranceIsAbsolute, bool);
52  vtkGetMacro(ToleranceIsAbsolute, bool);
53 
54  // Specify tolerance in terms of fraction of bounding box length.
55  // Default is 0.0.
56  vtkSetClampMacro(Tolerance, double, 0.0, 1.0);
57  vtkGetMacro(Tolerance, double);
58 
59  // Specify tolerance in absolute terms. Default is 1.0.
60  vtkSetClampMacro(AbsoluteTolerance, double, 0.0, VTK_DOUBLE_MAX);
61  vtkGetMacro(AbsoluteTolerance, double);
62 
64 
68  virtual void SetLocator(vtkIncrementalPointLocator* locator);
69  vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
71 
72  // Create default locator. Used to create one when none is specified.
73  void CreateDefaultLocator(vtkDataSet* input = nullptr);
74 
75  // Release locator
76  void ReleaseLocator() { this->SetLocator(nullptr); }
77 
79 
84  vtkSetMacro(OutputPointsPrecision, int);
85  vtkGetMacro(OutputPointsPrecision, int);
87 
88  void PrintSelf(ostream& os, vtkIndent indent) override;
89 
90 protected:
91  vtkCleanUnstructuredGrid() = default;
92  ~vtkCleanUnstructuredGrid() override;
93 
94  // options for managing point merging tolerance
95  bool ToleranceIsAbsolute = false;
96  double Tolerance = 0.0;
97  double AbsoluteTolerance = 1.0;
98  vtkIncrementalPointLocator* Locator = nullptr;
99  int OutputPointsPrecision = vtkAlgorithm::DEFAULT_PRECISION;
100 
102  int FillInputPortInformation(int port, vtkInformation* info) override;
103 
104 private:
106  void operator=(const vtkCleanUnstructuredGrid&) = delete;
107 };
108 #endif
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
static vtkUnstructuredGridAlgorithm * New()
virtual int FillInputPortInformation(int port, vtkInformation *info)
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
#define VTKPVVTKEXTENSIONSFILTERSGENERAL_EXPORT
void operator=(const vtkObjectBase &)