diff --git a/Polyhedron/demo/Polyhedron/MainWindow_remeshing.cpp b/Polyhedron/demo/Polyhedron/MainWindow_remeshing.cpp index 47e00c683cc..636a44d367d 100644 --- a/Polyhedron/demo/Polyhedron/MainWindow_remeshing.cpp +++ b/Polyhedron/demo/Polyhedron/MainWindow_remeshing.cpp @@ -82,14 +82,14 @@ void MainWindow::on_actionRemeshing_triggered() QTime time; time.start(); std::cout << "Build AABB tree..."; - typedef CGAL::Simple_cartesian Simple_cartesian_kernel; + typedef CGAL::Cartesian Cartesian_kernel; typedef CGAL::AABB_tree Tree; Tree tree; tree.build_faces(*pMesh); std::cout << "done (" << time.elapsed() << " ms)" << std::endl; // input surface - typedef CGAL::AABB_polyhedral_oracle Input_surface; + typedef CGAL::AABB_polyhedral_oracle Input_surface; Input_surface input(&tree); // initial point set @@ -97,11 +97,13 @@ void MainWindow::on_actionRemeshing_triggered() std::cout << "Insert initial point set..."; unsigned int nb_initial_points = 10; Polyhedron::Point_iterator it; + typedef CGAL::Cartesian_converter Converter; + Converter convert; unsigned int i = 0; for(it = pMesh->points_begin(); it != pMesh->points_end(), i < nb_initial_points; it++, i++) - tr.insert(*it); + tr.insert(convert(*it)); std::cout << "done (" << time.elapsed() << " ms)" << std::endl; // remesh diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_type.h b/Polyhedron/demo/Polyhedron/Polyhedron_type.h index 0bec542bbd9..b018a4033f1 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_type.h +++ b/Polyhedron/demo/Polyhedron/Polyhedron_type.h @@ -11,7 +11,6 @@ #include "Polyhedron_type_fwd.h" -//typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; typedef Kernel::FT FT; typedef Kernel::Line_3 Line; typedef Kernel::Point_3 Point; @@ -21,7 +20,6 @@ typedef Kernel::Vector_3 Vector; typedef Kernel::Triangle_3 Triangle; typedef Kernel::Iso_cuboid_3 Iso_cuboid; -// struct Polyhedron : public CGAL::Polyhedron_3 {}; typedef CGAL::Polyhedron_3 Polyhedron; #endif // POLYHEDRON_TYPE_H diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_type_fwd.h b/Polyhedron/demo/Polyhedron/Polyhedron_type_fwd.h index b0e39a48068..17e47db0717 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_type_fwd.h +++ b/Polyhedron/demo/Polyhedron/Polyhedron_type_fwd.h @@ -3,10 +3,12 @@ #include +#include #include - typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; +// typedef CGAL::Cartesian Kernel; + //struct Kernel; namespace CGAL { class Polyhedron_items_3; diff --git a/Polyhedron/demo/Polyhedron/include/CGAL/Collisions/AABB_node.h b/Polyhedron/demo/Polyhedron/include/CGAL/Collisions/AABB_node.h index 68a97c3406a..3f4c6ebcd0f 100644 --- a/Polyhedron/demo/Polyhedron/include/CGAL/Collisions/AABB_node.h +++ b/Polyhedron/demo/Polyhedron/include/CGAL/Collisions/AABB_node.h @@ -39,8 +39,10 @@ public: typedef std::pair Point_with_input; typedef typename PSC::Traits PSC_kernel; - typedef typename PSC_kernel::Point_3 PSC_Point; - //typedef CGAL::Cartesian_converter Converter; + typedef typename PSC_kernel::Point_3 PSC_point; + typedef typename PSC_kernel::Vector_3 PSC_vector; + typedef typename PSC_kernel::Triangle_3 PSC_triangle; + typedef CGAL::Cartesian_converter Converter; private: @@ -88,10 +90,9 @@ private: Bbox compute_bbox(Input f) { - // Converter convert; - const Point a = f->halfedge()->vertex()->point(); - const Point b = f->halfedge()->next()->vertex()->point(); - const Point c = f->halfedge()->next()->next()->vertex()->point(); + const PSC_point a = f->halfedge()->vertex()->point(); + const PSC_point b = f->halfedge()->next()->vertex()->point(); + const PSC_point c = f->halfedge()->next()->next()->vertex()->point(); return a.bbox() + b.bbox() + c.bbox(); } @@ -138,15 +139,15 @@ private: static Point centroid(Input f) { - //Converter convert; - const Point a = f->halfedge()->vertex()->point(); - const Point b = f->halfedge()->next()->vertex()->point(); - const Point c = f->halfedge()->next()->next()->vertex()->point(); + const PSC_point a = f->halfedge()->vertex()->point(); + const PSC_point b = f->halfedge()->next()->vertex()->point(); + const PSC_point c = f->halfedge()->next()->next()->vertex()->point(); // somehow CGAL::centroid does not compile - Vector u = a - CGAL::ORIGIN; - Vector v = b - CGAL::ORIGIN; - Vector w = c - CGAL::ORIGIN; - return CGAL::ORIGIN + (u + v + w) / 3.0; + PSC_vector u = a - CGAL::ORIGIN; + PSC_vector v = b - CGAL::ORIGIN; + PSC_vector w = c - CGAL::ORIGIN; + Converter convert; + return convert(CGAL::ORIGIN + (u + v + w) / 3.0); } template @@ -330,11 +331,11 @@ public: static Triangle triangle(Input f) { - // Converter convert; - const Point a = f->halfedge()->vertex()->point(); - const Point b = f->halfedge()->next()->vertex()->point(); - const Point c = f->halfedge()->next()->next()->vertex()->point(); - return Triangle(a,b,c); + Converter convert; + const PSC_point a = f->halfedge()->vertex()->point(); + const PSC_point b = f->halfedge()->next()->vertex()->point(); + const PSC_point c = f->halfedge()->next()->next()->vertex()->point(); + return convert(PSC_triangle(a,b,c)); } static bool do_intersect(const Segment& segment, Input f) diff --git a/Polyhedron/demo/Polyhedron/include/CGAL/Collisions/AABB_polyhedral_oracle.h b/Polyhedron/demo/Polyhedron/include/CGAL/Collisions/AABB_polyhedral_oracle.h index a4a5ce90291..41196c05dac 100644 --- a/Polyhedron/demo/Polyhedron/include/CGAL/Collisions/AABB_polyhedral_oracle.h +++ b/Polyhedron/demo/Polyhedron/include/CGAL/Collisions/AABB_polyhedral_oracle.h @@ -9,7 +9,7 @@ namespace CGAL { -template +template class AABB_polyhedral_oracle : public Polyhedron { public: @@ -19,15 +19,15 @@ public: typedef typename Kernel::Point_3 Point_3; typedef typename Kernel::Segment_3 Segment_3; - typedef AABB_polyhedral_oracle Self; + typedef AABB_polyhedral_oracle Self; typedef Self Surface_mesher_traits_3; typedef Point_3 Intersection_point; typedef Self Surface_3; // AABB tree - typedef AABB_tree Tree; + typedef AABB_tree Tree; typedef typename Tree::Point_with_input Point_with_facet_handle; - // typedef CGAL::Cartesian_converter Converter; + typedef CGAL::Cartesian_converter Converter; Tree *m_pTree; public: @@ -60,9 +60,9 @@ public: Object operator()(const Surface_3& surface, const Segment_3& segment) const { - //Converter convert; + Converter convert; Point_with_facet_handle pwh; - if(surface.tree()->first_intersection(segment,pwh)) + if(surface.tree()->first_intersection(convert(segment),pwh)) return make_object(pwh.first); else return Object(); @@ -70,9 +70,9 @@ public: Object operator()(const Surface_3& surface, const Ray_3& ray) const { - //Converter convert; + Converter convert; Point_with_facet_handle pwh; - if(surface.tree()->first_intersection(ray,pwh)) + if(surface.tree()->first_intersection(convert(ray),pwh)) return make_object(pwh.first); else return Object(); @@ -80,9 +80,9 @@ public: Object operator()(const Surface_3& surface, const Line_3& line) const { - //Converter convert; + Converter convert; Point_with_facet_handle pwh; - if(surface.tree()->first_intersection(line,pwh)) + if(surface.tree()->first_intersection(convert(line),pwh)) return make_object(pwh.first); else return Object();