WTFIT
vtkOneSkeleton.h
Go to the documentation of this file.
1 
11 #ifndef _VTK_ONE_SKELETON_H
12 #define _VTK_ONE_SKELETON_H
13 
14 // c++ includes
15 #include <algorithm>
16 
17 // base code includes
18 #include <Debug.h>
19 #include <OneSkeleton.h>
20 
21 // VTK includes
22 #include <vtkCellArray.h>
23 #include <vtkDataSet.h>
24 #include <vtkGenericCell.h>
25 #include <vtkIdList.h>
26 #include <vtkPolyData.h>
27 #include <vtkSmartPointer.h>
28 #include <vtkUnstructuredGrid.h>
29 
30 // TODO:
31 // make a VTK filter if needed
32 
33 class vtkOneSkeleton : public Wrapper{
34 
35  public:
36 
38 
47  int buildEdgeList(vtkDataSet *input,
48  vector<pair<int, int> > &edgeList,
49  const bool &isTriangulation = false) const;
50 
57  int buildEdgeLists(const vector<vector<long long int> > &cellArays,
58  vector<vector<pair<int, int> > > &edgeLists) const{
59 
60  OneSkeleton oneSkeleton;
61  oneSkeleton.setWrapper(this);
62  return oneSkeleton.buildEdgeLists(cellArays, edgeLists);
63  }
64 
92  int buildEdgeStars(vtkDataSet *input,
93  vector<vector<int> > &starList,
94  vector<pair<int, int> > *edgeList = NULL,
95  vector<vector<int> > *vertexStars = NULL,
96  const bool &isTriangulation = false) const;
97 
105  int buildTriangulationEdgeList(vtkPolyData *input,
106  vector<pair<int, int> > &edgeList) const{
107 
108  OneSkeleton oneSkeleton;
109  oneSkeleton.setWrapper(this);
110  return oneSkeleton.buildEdgeList(input->GetNumberOfPoints(),
111  input->GetNumberOfCells(), input->GetPolys()->GetPointer(),
112  edgeList);
113 
114  return 0;
115  }
116 
124  int buildTriangulationEdgeList(vtkUnstructuredGrid *input,
125  vector<pair<int, int> > &edgeList) const{
126 
127  OneSkeleton oneSkeleton;
128  oneSkeleton.setWrapper(this);
129  return oneSkeleton.buildEdgeList(input->GetNumberOfPoints(),
130  input->GetNumberOfCells(), input->GetCells()->GetPointer(),
131  edgeList);
132 
133  return 0;
134  }
135 
161  int buildTriangulationEdgeStars(vtkPolyData *input,
162  vector<vector<int> > &starList,
163  vector<pair<int, int> > *edgeList = NULL,
164  vector<vector<int> > *vertexStars = NULL) const{
165 
166  OneSkeleton oneSkeleton;
167  oneSkeleton.setWrapper(this);
168  return oneSkeleton.buildEdgeStars(input->GetNumberOfPoints(),
169  input->GetNumberOfCells(), input->GetPolys()->GetPointer(),
170  starList, edgeList, vertexStars);
171  }
172 
198  int buildTriangulationEdgeStars(vtkUnstructuredGrid *input,
199  vector<vector<int> > &starList,
200  vector<pair<int, int> > *edgeList = NULL,
201  vector<vector<int> > *vertexStars = NULL) const{
202 
203  OneSkeleton oneSkeleton;
204  oneSkeleton.setWrapper(this);
205  return oneSkeleton.buildEdgeStars(input->GetNumberOfPoints(),
206  input->GetNumberOfCells(), input->GetCells()->GetPointer(),
207  starList, edgeList, vertexStars);
208  }
209 
210 
211  protected:
212 
213 
214  private:
215 
216  // empty wrapping to VTK for now
217  bool needsToAbort(){ return false;};
218 
219  int updateProgress(const float &progress) {return 0;};
220 };
221 
222 #endif // _VTK_ONE_SKELETON_H
OneSkeleton processing package.
Definition: OneSkeleton.h:25
int buildTriangulationEdgeStars(vtkPolyData *input, vector< vector< int > > &starList, vector< pair< int, int > > *edgeList=NULL, vector< vector< int > > *vertexStars=NULL) const
Definition: vtkOneSkeleton.h:161
vtkOneSkeleton()
Definition: vtkOneSkeleton.cpp:3
VTK helper that processes the 1-skeleton (edges) of a data-set.
Definition: vtkOneSkeleton.h:33
int buildTriangulationEdgeList(vtkUnstructuredGrid *input, vector< pair< int, int > > &edgeList) const
Definition: vtkOneSkeleton.h:124
Wrapper class to wrap wtfit code.
Definition: Wrapper.h:15
int setWrapper(const Wrapper *wrapper)
Definition: Debug.cpp:76
int buildEdgeList(const int &vertexNumber, const int &cellNumber, const long long int *cellArray, vector< pair< int, int > > &edgeList) const
Definition: OneSkeleton.cpp:13
int buildTriangulationEdgeList(vtkPolyData *input, vector< pair< int, int > > &edgeList) const
Definition: vtkOneSkeleton.h:105
int buildEdgeStars(vtkDataSet *input, vector< vector< int > > &starList, vector< pair< int, int > > *edgeList=NULL, vector< vector< int > > *vertexStars=NULL, const bool &isTriangulation=false) const
Definition: vtkOneSkeleton.cpp:183
int buildEdgeStars(const int &vertexNumber, const int &cellNumber, const long long int *cellArray, vector< vector< int > > &starList, vector< pair< int, int > > *edgeList=NULL, vector< vector< int > > *vertexStars=NULL) const
Definition: OneSkeleton.cpp:203
int buildEdgeLists(const vector< vector< long long int > > &cellArrays, vector< vector< pair< int, int > > > &edgeLists) const
Definition: OneSkeleton.cpp:159
int buildTriangulationEdgeStars(vtkUnstructuredGrid *input, vector< vector< int > > &starList, vector< pair< int, int > > *edgeList=NULL, vector< vector< int > > *vertexStars=NULL) const
Definition: vtkOneSkeleton.h:198
int buildEdgeLists(const vector< vector< long long int > > &cellArays, vector< vector< pair< int, int > > > &edgeLists) const
Definition: vtkOneSkeleton.h:57
int buildEdgeList(vtkDataSet *input, vector< pair< int, int > > &edgeList, const bool &isTriangulation=false) const
Definition: vtkOneSkeleton.cpp:8