summaryrefslogtreecommitdiff
path: root/src/cgal.h
diff options
context:
space:
mode:
authorkintel <kintel@b57f626f-c46c-0410-a088-ec61d464b74c>2010-01-30 04:26:05 (GMT)
committerkintel <kintel@b57f626f-c46c-0410-a088-ec61d464b74c>2010-01-30 04:26:05 (GMT)
commit191dc4857c852f1867e80cd9d03a6d1c0921dcb1 (patch)
tree4a6421d50eb6cf70924fc0ba06afccf10df00650 /src/cgal.h
parent6940d171812565209efe679a5d923417c3f47d4a (diff)
header file reorg
git-svn-id: http://svn.clifford.at/openscad/trunk@365 b57f626f-c46c-0410-a088-ec61d464b74c
Diffstat (limited to 'src/cgal.h')
-rw-r--r--src/cgal.h59
1 files changed, 59 insertions, 0 deletions
diff --git a/src/cgal.h b/src/cgal.h
new file mode 100644
index 0000000..de942e7
--- /dev/null
+++ b/src/cgal.h
@@ -0,0 +1,59 @@
+#ifndef CGAL_H_
+#define CGAL_H_
+
+#ifdef ENABLE_CGAL
+
+#include <CGAL/Gmpq.h>
+#include <CGAL/Extended_cartesian.h>
+#include <CGAL/Nef_polyhedron_2.h>
+#include <CGAL/Cartesian.h>
+#include <CGAL/Polyhedron_3.h>
+#include <CGAL/Nef_polyhedron_3.h>
+#include <CGAL/IO/Polyhedron_iostream.h>
+
+typedef CGAL::Extended_cartesian<CGAL::Gmpq> CGAL_Kernel2;
+typedef CGAL::Nef_polyhedron_2<CGAL_Kernel2> CGAL_Nef_polyhedron2;
+typedef CGAL_Kernel2::Aff_transformation_2 CGAL_Aff_transformation2;
+
+typedef CGAL::Cartesian<CGAL::Gmpq> CGAL_Kernel3;
+typedef CGAL::Polyhedron_3<CGAL_Kernel3> CGAL_Polyhedron;
+typedef CGAL_Polyhedron::HalfedgeDS CGAL_HDS;
+typedef CGAL::Polyhedron_incremental_builder_3<CGAL_HDS> CGAL_Polybuilder;
+typedef CGAL::Nef_polyhedron_3<CGAL_Kernel3> CGAL_Nef_polyhedron3;
+typedef CGAL_Nef_polyhedron3::Aff_transformation_3 CGAL_Aff_transformation;
+typedef CGAL_Nef_polyhedron3::Vector_3 CGAL_Vector;
+typedef CGAL_Nef_polyhedron3::Plane_3 CGAL_Plane;
+typedef CGAL_Nef_polyhedron3::Point_3 CGAL_Point;
+
+struct CGAL_Nef_polyhedron
+{
+ int dim;
+ CGAL_Nef_polyhedron2 p2;
+ CGAL_Nef_polyhedron3 p3;
+
+ CGAL_Nef_polyhedron() {
+ dim = 0;
+ }
+
+ CGAL_Nef_polyhedron(const CGAL_Nef_polyhedron2 &p) {
+ dim = 2;
+ p2 = p;
+ }
+
+ CGAL_Nef_polyhedron(const CGAL_Nef_polyhedron3 &p) {
+ dim = 3;
+ p3 = p;
+ }
+
+ int weight() {
+ if (dim == 2)
+ return p2.explorer().number_of_vertices();
+ if (dim == 3)
+ return p3.number_of_vertices();
+ return 0;
+ }
+};
+
+#endif /* ENABLE_CGAL */
+
+#endif
contact: Jan Huwald // Impressum