blob: e2877cc5d3bc55f3b170431326085fa8d28e90bf (
plain)
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
|
#ifndef CSPRIMPOLYHEDRON_P_H
#define CSPRIMPOLYHEDRON_P_H
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Polyhedron_incremental_builder_3.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/AABB_tree.h>
#include <CGAL/AABB_traits.h>
#if CGAL_VERSION_NR >= CGAL_VERSION_NUMBER(4,6,0)
#include <CGAL/AABB_face_graph_triangle_primitive.h>
#else
#include <CGAL/AABB_polyhedron_triangle_primitive.h>
#include <CGAL/AABB_polyhedron_segment_primitive.h>
#endif
typedef CGAL::Simple_cartesian<double> Kernel;
typedef CGAL::Polyhedron_3<Kernel> Polyhedron;
typedef Polyhedron::HalfedgeDS HalfedgeDS;
class Polyhedron_Builder : public CGAL::Modifier_base<HalfedgeDS>
{
public:
Polyhedron_Builder(CSPrimPolyhedron* polyhedron) {m_polyhedron=polyhedron;}
void operator()(HalfedgeDS &hds);
protected:
CSPrimPolyhedron* m_polyhedron;
};
typedef Kernel::Point_3 Point;
#if CGAL_VERSION_NR >= CGAL_VERSION_NUMBER(4,6,0)
typedef CGAL::AABB_face_graph_triangle_primitive<Polyhedron> Primitive;
#else
typedef CGAL::AABB_polyhedron_triangle_primitive<Kernel,Polyhedron> Primitive;
#endif
typedef CGAL::AABB_traits<Kernel, Primitive> Traits;
typedef CGAL::Simple_cartesian<double>::Ray_3 Ray;
typedef Kernel::Segment_3 Segment;
struct CSPrimPolyhedronPrivate
{
Polyhedron m_Polyhedron;
Point m_RandPt;
CGAL::AABB_tree<Traits> *m_PolyhedronTree;
};
#endif // CSPRIMPOLYHEDRON_P_H
|