VMTK
Loading...
Searching...
No Matches
vtkvmtkPolyDataSurfaceRemeshing.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: VMTK
4
5 Copyright (c) Luca Antiga, David Steinman. All rights reserved.
6 See LICENSE file for details.
7
8 Portions of this code are covered under the VTK copyright.
9 See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm
10 for details.
11
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
15
16=========================================================================*/
39
40#ifndef __vtkvmtkPolyDataSurfaceRemeshing_h
41#define __vtkvmtkPolyDataSurfaceRemeshing_h
42
43#include "vtkObject.h"
44#include "vtkPolyDataAlgorithm.h"
45#include "vtkvmtkWin32Header.h"
46#include "vtkIdList.h"
47
48class vtkCellLocator;
49class vtkIntArray;
50
51class VTK_VMTK_DIFFERENTIAL_GEOMETRY_EXPORT vtkvmtkPolyDataSurfaceRemeshing : public vtkPolyDataAlgorithm
52{
53public:
54
56 vtkTypeMacro(vtkvmtkPolyDataSurfaceRemeshing,vtkPolyDataAlgorithm);
57 void PrintSelf(std::ostream& os, vtkIndent indent) override;
58
60
65 vtkSetMacro(AspectRatioThreshold,double);
66 vtkGetMacro(AspectRatioThreshold,double);
68
70
75 vtkSetMacro(InternalAngleTolerance,double);
76 vtkGetMacro(InternalAngleTolerance,double);
78
80
85 vtkSetMacro(NormalAngleTolerance,double);
86 vtkGetMacro(NormalAngleTolerance,double);
88
90
96 vtkSetMacro(CollapseAngleThreshold,double);
97 vtkGetMacro(CollapseAngleThreshold,double);
99
101
106 vtkSetMacro(Relaxation,double);
107 vtkGetMacro(Relaxation,double);
109
111
117 vtkSetMacro(TargetArea,double);
118 vtkGetMacro(TargetArea,double);
120
122
127 vtkSetMacro(TargetAreaFactor,double);
128 vtkGetMacro(TargetAreaFactor,double);
130
132
137 vtkSetMacro(TriangleSplitFactor,double);
138 vtkGetMacro(TriangleSplitFactor,double);
140
142
147 vtkSetMacro(MinAreaFactor,double);
148 vtkGetMacro(MinAreaFactor,double);
150
152
156 vtkSetMacro(MaxArea,double);
157 vtkGetMacro(MaxArea,double);
159
161
165 vtkSetMacro(MinArea,double);
166 vtkGetMacro(MinArea,double);
168
170
174 vtkSetMacro(NumberOfIterations,int);
175 vtkGetMacro(NumberOfIterations,int);
177
179
186
188
193 vtkSetStringMacro(TargetAreaArrayName);
194 vtkGetStringMacro(TargetAreaArrayName);
196
198
205 vtkSetMacro(ElementSizeMode,int);
206 vtkGetMacro(ElementSizeMode,int);
212
214
220 vtkSetMacro(PreserveBoundaryEdges,int);
221 vtkGetMacro(PreserveBoundaryEdges,int);
222 vtkBooleanMacro(PreserveBoundaryEdges,int);
224
226
233 vtkSetStringMacro(CellEntityIdsArrayName);
234 vtkGetStringMacro(CellEntityIdsArrayName);
236
238
243 vtkSetObjectMacro(ExcludedEntityIds,vtkIdList);
244 vtkGetObjectMacro(ExcludedEntityIds,vtkIdList);
246
247 //BTX
248 enum {
258 };
259
260 enum {
263 };
264
265 enum {
268 };
269
270 enum {
273 };
274
275 enum {
279 };
280 //ETX
281
282protected:
285
286 virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override;
287
288 void BuildEntityBoundary(vtkPolyData* input, vtkPolyData* entityBoundary);
289
290 int EdgeFlipConnectivityOptimizationIteration();
291 int EdgeFlipIteration();
292 int EdgeCollapseIteration();
293 int TriangleSplitIteration();
294 int EdgeSplitIteration();
295 int PointRelocationIteration(bool projectToSurface=true);
296
297 int TestFlipEdgeValidity(vtkIdType pt1, vtkIdType pt2, vtkIdType cell1, vtkIdType cell2, vtkIdType pt3, vtkIdType pt4);
298 int TestConnectivityFlipEdge(vtkIdType pt1, vtkIdType pt2);
299 int TestDelaunayFlipEdge(vtkIdType pt1, vtkIdType pt2);
300 int TestAspectRatioCollapseEdge(vtkIdType cellId, vtkIdType& pt1, vtkIdType& pt2);
301 int TestTriangleSplit(vtkIdType cellId);
302 int TestAreaSplitEdge(vtkIdType cellId, vtkIdType& pt1, vtkIdType& pt2);
303
304 int IsElementExcluded(vtkIdType cellId);
305 int GetEdgeCellsAndOppositeEdge(vtkIdType pt1, vtkIdType pt2, vtkIdType& cell1, vtkIdType& cell2, vtkIdType& pt3, vtkIdType& pt4);
306
307 int SplitEdge(vtkIdType pt1, vtkIdType pt2);
308 int CollapseEdge(vtkIdType pt1, vtkIdType pt2);
309 int FlipEdge(vtkIdType pt1, vtkIdType pt2);
310
311 int SplitTriangle(vtkIdType cellId);
312 int CollapseTriangle(vtkIdType cellId);
313
314 int RelocatePoint(vtkIdType pointId, bool projectToSurface);
315
316 int IsPointOnBoundary(vtkIdType pointId);
317 int IsPointOnEntityBoundary(vtkIdType pointId);
318
319 int GetNumberOfBoundaryEdges(vtkIdType cellId);
320
321 double ComputeTriangleTargetArea(vtkIdType cellId);
322
323 int FindOneRingNeighbors(vtkIdType pointId, vtkIdList* neighborIds);
324
325 vtkPolyData* Mesh;
326 vtkPolyData* InputBoundary;
328 vtkCellLocator* Locator;
329 vtkCellLocator* BoundaryLocator;
330 vtkCellLocator* EntityBoundaryLocator;
331 vtkIntArray* CellEntityIdsArray;
332 vtkDataArray* TargetAreaArray;
334
342
344
348 double MaxArea;
349 double MinArea;
353
355
356private:
358 void operator=(const vtkvmtkPolyDataSurfaceRemeshing&); // Not implemented.
359};
360
361#endif
362
Remesh a triangulated surface into a mesh of more uniform, better-shaped ("quality") triangles.
void PrintSelf(std::ostream &os, vtkIndent indent) override
virtual void SetElementSizeMode(int)
static vtkvmtkPolyDataSurfaceRemeshing * New()