diff options
Diffstat (limited to 'src/cgal.h')
-rw-r--r-- | src/cgal.h | 83 |
1 files changed, 8 insertions, 75 deletions
@@ -14,89 +14,22 @@ #include <CGAL/Polygon_2.h> #include <CGAL/Polygon_with_holes_2.h> -typedef CGAL::Extended_cartesian<CGAL::Gmpq> CGAL_Kernel2; +typedef CGAL::Gmpq NT; +typedef CGAL::Extended_cartesian<NT> 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; typedef CGAL::Exact_predicates_exact_constructions_kernel CGAL_ExactKernel2; typedef CGAL::Polygon_2<CGAL_ExactKernel2> CGAL_Poly2; typedef CGAL::Polygon_with_holes_2<CGAL_ExactKernel2> CGAL_Poly2h; -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; - } - - CGAL_Nef_polyhedron& operator+=(const CGAL_Nef_polyhedron &other) { - if (other.dim == 2) { - this->p2 += other.p2; - this->dim = 2; - } - if (other.dim == 3) { - this->p3 += other.p3; - this->dim = 3; - } - return *this; - } - - CGAL_Nef_polyhedron& operator*=(const CGAL_Nef_polyhedron &other) { - if (other.dim == 2) { - this->p2 *= other.p2; - this->dim = 2; - } - if (other.dim == 3) { - this->p3 *= other.p3; - this->dim = 3; - } - return *this; - } - - CGAL_Nef_polyhedron& operator-=(const CGAL_Nef_polyhedron &other) { - if (other.dim == 2) { - this->p2 -= other.p2; - this->dim = 2; - } - if (other.dim == 3) { - this->p3 -= other.p3; - this->dim = 3; - } - return *this; - } - - int weight() { - if (dim == 2) - return p2.explorer().number_of_vertices(); - if (dim == 3) - return p3.number_of_vertices(); - return 0; - } +typedef CGAL::Cartesian<NT> CGAL_Kernel3; +typedef CGAL::Nef_polyhedron_3<CGAL_Kernel3> CGAL_Nef_polyhedron3; +typedef CGAL_Nef_polyhedron3::Aff_transformation_3 CGAL_Aff_transformation; - class PolySet *convertToPolyset(); -}; +typedef CGAL::Polyhedron_3<CGAL_Kernel3> CGAL_Polyhedron; +typedef CGAL_Polyhedron::HalfedgeDS CGAL_HDS; +typedef CGAL::Polyhedron_incremental_builder_3<CGAL_HDS> CGAL_Polybuilder; #endif /* ENABLE_CGAL */ |