-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathLegacyMeshGenerator.h
73 lines (55 loc) · 1.87 KB
/
LegacyMeshGenerator.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*
* Shapeworks license
*/
/**
* @file LegacyMeshGenerator.h
* @brief Mesh generation
*
* The LegacyMeshGenerator performs the actual work of reconstructing
* a mesh from a shape (list of points).
*/
#pragma once
#include "vnl/vnl_vector.h"
#include <vtkSmartPointer.h>
#include <QSharedPointer>
#include <Eigen/Eigen>
//#include <SurfaceReconstructor.h>
//#define SW_USE_POWERCRUST
class CustomSurfaceReconstructionFilter;
class vtkPowerCrustSurfaceReconstruction;
class vtkContourFilter;
class vtkReverseSense;
class vtkSmoothPolyDataFilter;
class vtkPolyDataNormals;
class vtkPoints;
class vtkPolyData;
class vtkTriangleFilter;
class vtkWindowedSincPolyDataFilter;
class vtkPolyDataToImageData;
class LegacyMeshGenerator
{
public:
LegacyMeshGenerator();
~LegacyMeshGenerator();
void setNeighborhoodSize( int size );
void setSampleSpacing( double spacing );
void setUsePowerCrust( bool enabled );
void setSmoothingAmount( float amount ); // 0-100
vtkSmartPointer<vtkPolyData> buildMesh( const Eigen::VectorXd& shape );
//void set_surface_reconstructor(QSharedPointer<SurfaceReconstructor> reconstructor);
private:
void updatePipeline();
vtkSmartPointer<CustomSurfaceReconstructionFilter> surfaceReconstruction;
vtkSmartPointer<vtkPowerCrustSurfaceReconstruction> powercrust;
vtkSmartPointer<vtkPoints> points;
vtkSmartPointer<vtkPolyData> pointSet;
vtkSmartPointer<vtkContourFilter> contourFilter;
vtkSmartPointer<vtkReverseSense> reverseSense;
vtkSmartPointer<vtkPolyDataNormals> polydataNormals;
vtkSmartPointer<vtkTriangleFilter> triangleFilter;
vtkSmartPointer<vtkWindowedSincPolyDataFilter> windowSincFilter;
vtkSmartPointer<vtkPolyDataToImageData> polydataToImageData;
bool usePowerCrust;
bool smoothingEnabled;
//QSharedPointer<SurfaceReconstructor> surface_reconstructor_;
};