VMTK
vtkvmtkPolyDataCenterlines.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3 Program: VMTK
4 Module: $RCSfile: vtkvmtkPolyDataCenterlines.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 =========================================================================*/
28 #ifndef __vtkvmtkPolyDataCenterlines_h
29 #define __vtkvmtkPolyDataCenterlines_h
30 
31 #include "vtkPolyDataAlgorithm.h"
32 //#include "vtkvmtkComputationalGeometryWin32Header.h"
33 #include "vtkvmtkWin32Header.h"
34 
35 #include "vtkUnstructuredGrid.h"
36 
37 class vtkPolyData;
38 class vtkPoints;
39 class vtkIdList;
40 class vtkDataArray;
41 
42 class VTK_VMTK_COMPUTATIONAL_GEOMETRY_EXPORT vtkvmtkPolyDataCenterlines : public vtkPolyDataAlgorithm
43 {
44  public:
45  vtkTypeMacro(vtkvmtkPolyDataCenterlines,vtkPolyDataAlgorithm);
46  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
47 
48  static vtkvmtkPolyDataCenterlines *New();
49 
50  virtual void SetSourceSeedIds(vtkIdList*);
51  vtkGetObjectMacro(SourceSeedIds,vtkIdList);
52 
53  virtual void SetTargetSeedIds(vtkIdList*);
54  vtkGetObjectMacro(TargetSeedIds,vtkIdList);
55 
56  virtual void SetCapCenterIds(vtkIdList*);
57  vtkGetObjectMacro(CapCenterIds,vtkIdList);
58 
59  vtkSetObjectMacro(DelaunayTessellation,vtkUnstructuredGrid);
60  vtkGetObjectMacro(DelaunayTessellation,vtkUnstructuredGrid);
61 
62  vtkGetObjectMacro(VoronoiDiagram,vtkPolyData);
63 
64  vtkGetObjectMacro(PoleIds,vtkIdList);
65 
66  vtkSetStringMacro(RadiusArrayName);
67  vtkGetStringMacro(RadiusArrayName);
68 
69  vtkSetStringMacro(CostFunction);
70  vtkGetStringMacro(CostFunction);
71 
72  vtkSetStringMacro(EikonalSolutionArrayName);
73  vtkGetStringMacro(EikonalSolutionArrayName);
74 
75  vtkSetStringMacro(EdgeArrayName);
76  vtkGetStringMacro(EdgeArrayName);
77 
78  vtkSetStringMacro(EdgePCoordArrayName);
79  vtkGetStringMacro(EdgePCoordArrayName);
80 
81  vtkSetStringMacro(CostFunctionArrayName);
82  vtkGetStringMacro(CostFunctionArrayName);
83 
84  vtkSetMacro(FlipNormals,int);
85  vtkGetMacro(FlipNormals,int);
86  vtkBooleanMacro(FlipNormals,int);
87 
88  vtkSetMacro(SimplifyVoronoi,int);
89  vtkGetMacro(SimplifyVoronoi,int);
90  vtkBooleanMacro(SimplifyVoronoi,int);
91 
92  vtkSetMacro(CenterlineResampling,int);
93  vtkGetMacro(CenterlineResampling,int);
94  vtkBooleanMacro(CenterlineResampling,int);
95 
96  vtkSetMacro(ResamplingStepLength,double);
97  vtkGetMacro(ResamplingStepLength,double);
98 
99  vtkSetMacro(AppendEndPointsToCenterlines,int);
100  vtkGetMacro(AppendEndPointsToCenterlines,int);
101  vtkBooleanMacro(AppendEndPointsToCenterlines,int);
102 
103  vtkSetMacro(GenerateDelaunayTessellation,int);
104  vtkGetMacro(GenerateDelaunayTessellation,int);
105  vtkBooleanMacro(GenerateDelaunayTessellation,int);
106 
107  vtkSetMacro(DelaunayTolerance,double);
108  vtkGetMacro(DelaunayTolerance,double);
109 
110 
111  protected:
114 
115  virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) VTK_OVERRIDE;
116 
117  void FindVoronoiSeeds(vtkUnstructuredGrid *delaunay, vtkIdList *boundaryBaricenterIds, vtkDataArray *normals, vtkIdList *seedIds);
118  void AppendEndPoints(vtkPoints* endPointPairs);
119  void ResampleCenterlines();
120  void ReverseCenterlines();
121 
122  vtkIdList* SourceSeedIds;
123  vtkIdList* TargetSeedIds;
124 
125  vtkIdList* CapCenterIds;
126 
127  vtkUnstructuredGrid* DelaunayTessellation;
128 
129  vtkPolyData* VoronoiDiagram;
130 
131  vtkIdList* PoleIds;
132 
139 
144 
146 
149 
150  private:
151  vtkvmtkPolyDataCenterlines(const vtkvmtkPolyDataCenterlines&); // Not implemented.
152  void operator=(const vtkvmtkPolyDataCenterlines&); // Not implemented.
153 };
154 
155 #endif
Compute centerlines from surface.
vtkUnstructuredGrid * DelaunayTessellation