-
Notifications
You must be signed in to change notification settings - Fork 0
/
CGALSkeleton.h
87 lines (67 loc) · 2.4 KB
/
CGALSkeleton.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#ifndef SKELETONPOLYHEDRON_H
#define SKELETONPOLYHEDRON_H
#include "SimoxCGAL.h"
#include <VirtualRobot/VirtualRobot.h>
#include <VirtualRobot/Visualization/TriMeshModel.h>
#include <VirtualRobot/Visualization/VisualizationFactory.h>
#include "VirtualRobot/Visualization/CoinVisualization/CoinVisualizationFactory.h"
#include <Inventor/sensors/SoTimerSensor.h>
#include <Inventor/nodes/SoEventCallback.h>
#include <Inventor/Qt/viewers/SoQtExaminerViewer.h>
#include <Inventor/Qt/SoQt.h>
#include <Inventor/nodes/SoSeparator.h>
#include <Inventor/nodes/SoMaterial.h>
#include <Inventor/nodes/SoUnits.h>
#include <Inventor/nodes/SoCoordinate3.h>
#include <Inventor/nodes/SoFaceSet.h>
#include <Inventor/nodes/SoLineSet.h>
#include <Inventor/nodes/SoPointSet.h>
#include <Inventor/nodes/SoIndexedLineSet.h>
#include <fstream>
#include <cstdlib>
#include <stdlib.h>
#include <stdbool.h>
#include <iostream>
#include <algorithm>
#include "Inventor/nodes/SoSeparator.h"
#define CGAL_MCFSKEL_INFO
namespace SimoxCGAL {
/*!
* \brief The CGALSkeleton class wrappes the CGAL skeleton structure. It provides interfaces for parameter sttings and allows to calculate the CGAl skeleton structure.
*/
class CGALSkeleton
{
public:
CGALSkeleton(const std::string &name, SurfaceMeshPtr mesh);
CGALSkeleton(const std::string &name, SurfaceMeshPtr mesh, SkeletonPtr skeleton);
~CGALSkeleton();
void initParameters(int a1 = 110,
double a2 = 0.1,
double a3 = 0.2,
double a4 = 0.0001,
int a5 = 500,
bool a6 = true,
double a7 = 0.0 /*currently not supported*/
);
void calculateSkeleton();
void clear();
std::string toXML();
SkeletonPtr getSkeleton();
int getTime();
private:
std::string name;
SurfaceMeshPtr mesh;
SkeletonPtr skeleton;
//parameters
double max_triangle_angle;
double quality_speed_tradeoff;
double medially_centered_speed_tradeoff;
double area_variation_factor;
int max_iterations;
bool is_medially_centered;
double min_edge_length;
int skeletonTimeMS;
};
typedef boost::shared_ptr<CGALSkeleton> CGALSkeletonPtr;
}
#endif // SKELETTPOLYHEDRON_H