VMTK
vtkvmtkSimplifyVoronoiDiagram.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3 Program: VMTK
4 Module: $RCSfile: vtkvmtkSimplifyVoronoiDiagram.h,v $
5 Language: C++
6 
7  Copyright (c) Luca Antiga, David Steinman. All rights reserved.
8  See LICENSE file for details.
9 
10  Portions of this code are covered under the VTK copyright.
11  See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm
12  for details.
13 
14  This software is distributed WITHOUT ANY WARRANTY; without even
15  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
16  PURPOSE. See the above copyright notices for more information.
17 
18 =========================================================================*/
30 #ifndef __vtkvmtkSimplifyVoronoiDiagram_h
31 #define __vtkvmtkSimplifyVoronoiDiagram_h
32 
33 #include "vtkPolyDataAlgorithm.h"
34 #include "vtkIdList.h"
35 //#include "vtkvmtkComputationalGeometryWin32Header.h"
36 #include "vtkvmtkWin32Header.h"
37 
38 #define VTK_VMTK_REMOVE_BOUNDARY_POINTS 0
39 #define VTK_VMTK_REMOVE_BOUNDARY_CELLS 1
40 
41 class vtkCellArray;
42 class vtkCellTypes;
43 class vtkCellLinks;
44 
45 class VTK_VMTK_COMPUTATIONAL_GEOMETRY_EXPORT vtkvmtkSimplifyVoronoiDiagram : public vtkPolyDataAlgorithm
46 {
47  public:
48  vtkTypeMacro(vtkvmtkSimplifyVoronoiDiagram,vtkPolyDataAlgorithm);
49  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
50 
51  static vtkvmtkSimplifyVoronoiDiagram *New();
52 
53  // Set/Get id list of Voronoi diagram points to preserve.
54  vtkSetObjectMacro(UnremovablePointIds,vtkIdList);
55  vtkGetObjectMacro(UnremovablePointIds,vtkIdList);
56 
57  // Set/Get id list of Voronoi diagram cells to preserve.
58  vtkSetObjectMacro(UnremovableCellIds,vtkIdList);
59  vtkGetObjectMacro(UnremovableCellIds,vtkIdList);
60 
62 
63  vtkSetMacro(Simplification,int);
64  vtkGetMacro(Simplification,int);
66  this->SetSimplification(VTK_VMTK_REMOVE_BOUNDARY_POINTS);};
68  this->SetSimplification(VTK_VMTK_REMOVE_BOUNDARY_CELLS);};
70 
71  vtkSetMacro(IncludeUnremovable,int);
72  vtkGetMacro(IncludeUnremovable,int);
73  vtkBooleanMacro(IncludeUnremovable,int);
74 
75  vtkSetMacro(OnePassOnly,int);
76  vtkGetMacro(OnePassOnly,int);
77  vtkBooleanMacro(OnePassOnly,int);
78 
79  protected:
82 
83  virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) VTK_OVERRIDE;
84  vtkIdType IsBoundaryEdge(vtkCellLinks* links, vtkIdType* edge);
85 
86  vtkIdList* UnremovablePointIds;
87  vtkIdList* UnremovableCellIds;
88 
92 
93  private:
95  void operator=(const vtkvmtkSimplifyVoronoiDiagram&); // Not implemented.
96 };
97 
98 #endif
#define VTK_VMTK_REMOVE_BOUNDARY_CELLS
Remove non essential Voronoi polygon points (little spikes).
#define VTK_VMTK_REMOVE_BOUNDARY_POINTS