diff --git a/Surface_reconstruction_points_3/include/CGAL/Mesh_3/Refine_tets.h b/Surface_reconstruction_points_3/include/CGAL/Mesh_3/Poisson_refine_cells_3.h similarity index 83% rename from Surface_reconstruction_points_3/include/CGAL/Mesh_3/Refine_tets.h rename to Surface_reconstruction_points_3/include/CGAL/Mesh_3/Poisson_refine_cells_3.h index 698e13c47a5..e3a48fc7d85 100644 --- a/Surface_reconstruction_points_3/include/CGAL/Mesh_3/Refine_tets.h +++ b/Surface_reconstruction_points_3/include/CGAL/Mesh_3/Poisson_refine_cells_3.h @@ -17,8 +17,8 @@ // // Author(s) : Laurent RINEAU -#ifndef CGAL_MESH_3_REFINE_TETS_H -#define CGAL_MESH_3_REFINE_TETS_H +#ifndef CGAL_MESH_3_POISSON_REFINE_CELLS_3_H +#define CGAL_MESH_3_POISSON_REFINE_CELLS_3_H #include #include @@ -40,9 +40,9 @@ template + typename Criteria::Cell_quality> > -class Refine_tets_base : +class Poisson_refine_tets_base : public Container, public Triangulation_mesher_level_traits_3, public No_test_point_conflict @@ -63,14 +63,14 @@ protected: typedef typename Tr::Facet Facet; public: - typedef typename Criteria::Quality Quality; + typedef typename Criteria::Cell_quality Cell_quality; using Triangulation_mesher_level_traits_3::triangulation_ref_impl; public: /** \name CONSTRUCTORS */ - Refine_tets_base(Tr& t, Criteria crit) + Poisson_refine_tets_base(Tr& t, Criteria crit) : Triangulation_mesher_level_traits_3(t), criteria(crit) {} protected: @@ -81,20 +81,20 @@ protected: protected: /* --- protected functions --- */ - bool should_be_refined(const Cell_handle c, Quality& qual) const + bool should_be_refined(const Cell_handle c, Cell_quality& qual) const { return criteria.is_bad_object()(c,qual); } bool should_be_refined(const Cell_handle c) const { - Quality q; + Cell_quality q; return should_be_refined(c, q); } bool test_if_cell_is_bad(const Cell_handle c) { - Quality q; + Cell_quality q; if( c->is_in_domain() && should_be_refined(c, q) ) { this->add_bad_element(c, q); @@ -137,7 +137,7 @@ public: #if CGAL_MESH_3_DEBUG_BEFORE_CONFLICTS void before_conflicts_impl(const Cell_handle&, const Point& p) { - std::cerr << "Refine_tets: before conflicts of " << p; + std::cerr << "Poisson_refine_tets: before conflicts of " << p; } #else void before_conflicts_impl(const Cell_handle&, const Point&) @@ -152,7 +152,7 @@ public: std::cerr << " REJECTED!" << std::endl; #endif } -}; // end Refine_tets_base +}; // end Poisson_refine_tets_base template + typename Criteria::Cell_quality> > -class Refine_tets_with_oracle_base - : public Refine_tets_base { public: - typedef Refine_tets_base Base; - typedef Refine_tets_with_oracle_base Base; + typedef Poisson_refine_tets_with_oracle_base, + Poisson_refine_tets_with_oracle_base, typename Facets_level = Refine_facets > -class Refine_tets : +class Poisson_refine_tets : public BaseP, public Mesher_level < Tr, - Refine_tets, + Poisson_refine_tets, typename Tr::Cell_handle, Facets_level, Triangulation_mesher_level_traits_3 @@ -287,16 +287,16 @@ class Refine_tets : Facets_level& facets_level; public: - typedef Refine_tets Self; + typedef Poisson_refine_tets Self; typedef Mesher_level < Tr, - Refine_tets, + Poisson_refine_tets, typename Tr::Cell_handle, Facets_level, Triangulation_mesher_level_traits_3 > Mesher; - Refine_tets(Tr& t, Criteria crit, Surface& surface, Oracle& oracle, Facets_level& facets_level) + Poisson_refine_tets(Tr& t, Criteria crit, Surface& surface, Oracle& oracle, Facets_level& facets_level) : Base(t, crit, surface, oracle), Mesher(facets_level), facets_level(facets_level) {} // here VC7 complain about default constructor of Base, if the // workaround is not used. @@ -315,9 +315,9 @@ public: return s.str(); } -}; // end class Refine_tets +}; // end class Poisson_refine_tets }; // end namespace Mesh_3 }; // end namespace CGAL -#endif // CGAL_MESH_3_REFINE_TETS_H +#endif // CGAL_MESH_3_POISSON_REFINE_CELLS_3_H diff --git a/Surface_reconstruction_points_3/include/CGAL/Mesh_criteria_3.h b/Surface_reconstruction_points_3/include/CGAL/Poisson_mesh_cell_criteria_3.h similarity index 85% rename from Surface_reconstruction_points_3/include/CGAL/Mesh_criteria_3.h rename to Surface_reconstruction_points_3/include/CGAL/Poisson_mesh_cell_criteria_3.h index dd583fae500..9e9f2d0be2d 100644 --- a/Surface_reconstruction_points_3/include/CGAL/Mesh_criteria_3.h +++ b/Surface_reconstruction_points_3/include/CGAL/Poisson_mesh_cell_criteria_3.h @@ -17,41 +17,32 @@ // // Author(s) : Laurent RINEAU -#ifndef CGAL_MESH_CRITERIA_3_H -#define CGAL_MESH_CRITERIA_3_H +#ifndef CGAL_POISSON_MESH_CRITERIA_3_H +#define CGAL_POISSON_MESH_CRITERIA_3_H #include namespace CGAL { -template -class Mesh_criteria_3 +template +class Poisson_mesh_cell_criteria_3 { double squared_radius_bound_; double radius_edge_bound_; public: - typedef typename Tr::Cell_handle Cell_handle; - - Mesh_criteria_3(const double radius_edge_bound = 2, //< radius edge ratio bound (ignored if zero) - const double radius_bound = 0) //< cell radius bound (ignored if zero) - : squared_radius_bound_(radius_bound*radius_bound), - radius_edge_bound_(radius_edge_bound) - { - }; - - struct Quality : public std::pair + struct Cell_quality : public std::pair { typedef std::pair Base; - Quality() : Base() {}; - Quality(double _aspect, double _sq_size) : Base(_aspect, _sq_size) {}; + Cell_quality() : Base() {}; + Cell_quality(double _aspect, double _sq_size) : Base(_aspect, _sq_size) {}; const double& sq_size() const { return second; } const double& aspect() const { return first; } // q1 1 ) if( q.sq_size() > 1 ) @@ -71,6 +62,15 @@ public: return squared_radius_bound_; }; + typedef typename Tr::Cell_handle Cell_handle; + + Poisson_mesh_cell_criteria_3(const double radius_edge_bound = 2, //< radius edge ratio bound (ignored if zero) + const double radius_bound = 0) //< cell radius bound (ignored if zero) + : squared_radius_bound_(radius_bound*radius_bound), + radius_edge_bound_(radius_edge_bound) + { + }; + inline void set_squared_radius_bound(const double squared_radius_bound) { @@ -103,7 +103,7 @@ public: squared_radius_bound_(squared_radius_bound) {}; bool operator()(const Cell_handle& c, - Quality& qual) const + Cell_quality& qual) const { const Point_3& p = c->vertex(0)->point(); const Point_3& q = c->vertex(1)->point(); @@ -133,7 +133,7 @@ public: } if( radius_edge_bound_ == 0 ) { - qual = Quality(0,1); + qual = Cell_quality(0,1); return false; } @@ -155,15 +155,15 @@ public: Is_bad is_bad_object() const { return Is_bad(radius_edge_bound_, squared_radius_bound_); } -}; // end Mesh_criteria_3 +}; // end Poisson_mesh_cell_criteria_3 template std::ostream& operator<<(std::ostream& os, - const typename Mesh_criteria_3::Quality& q) + const typename Poisson_mesh_cell_criteria_3::Cell_quality& q) { return os << q.sq_size() << ", " << q.aspect(); } } // end namespace CGAL -#endif // CGAL_MESH_CRITERIA_3_H +#endif // CGAL_POISSON_MESH_CRITERIA_3_H diff --git a/Surface_reconstruction_points_3/include/CGAL/Poisson_reconstruction_function.h b/Surface_reconstruction_points_3/include/CGAL/Poisson_reconstruction_function.h index 3fa33bb1202..7ab894384cc 100644 --- a/Surface_reconstruction_points_3/include/CGAL/Poisson_reconstruction_function.h +++ b/Surface_reconstruction_points_3/include/CGAL/Poisson_reconstruction_function.h @@ -282,8 +282,8 @@ private: CGAL_TRACE("Calls delaunay_refinement(radius_edge_ratio_bound=%lf, cell_radius_bound=%lf, max_vertices=%u, enlarge_ratio=%lf)\n", radius_edge_ratio_bound, cell_radius_bound, max_vertices, enlarge_ratio); - Sphere enlarged_bbox = enlarged_bounding_sphere(enlarge_ratio); - unsigned int nb_vertices_added = poisson_refine_triangulation(*m_tr,radius_edge_ratio_bound,cell_radius_bound,max_vertices,enlarged_bbox); + Sphere elarged_bsphere = enlarged_bounding_sphere(enlarge_ratio); + unsigned int nb_vertices_added = poisson_refine_triangulation(*m_tr,radius_edge_ratio_bound,cell_radius_bound,max_vertices,elarged_bsphere); CGAL_TRACE("End of delaunay_refinement()\n"); diff --git a/Surface_reconstruction_points_3/include/CGAL/poisson_refine_triangulation.h b/Surface_reconstruction_points_3/include/CGAL/poisson_refine_triangulation.h index 6c7846a2bb0..08b76cc0b71 100644 --- a/Surface_reconstruction_points_3/include/CGAL/poisson_refine_triangulation.h +++ b/Surface_reconstruction_points_3/include/CGAL/poisson_refine_triangulation.h @@ -21,8 +21,8 @@ // CGAL #include -#include -#include +#include +#include #include CGAL_BEGIN_NAMESPACE @@ -39,12 +39,12 @@ template + typename Criteria::Cell_quality> > class Poisson_mesher_level_impl_base : - public Mesh_3::Refine_tets_with_oracle_base + public Mesh_3::Poisson_refine_tets_with_oracle_base { - typedef Mesh_3::Refine_tets_with_oracle_base Base; + typedef Mesh_3::Poisson_refine_tets_with_oracle_base Base; public: // Inherited methods and fields used below @@ -56,7 +56,7 @@ public: typedef typename Tr::Vertex_handle Vertex_handle; typedef typename Tr::Cell_handle Cell_handle; typedef typename Tr::Point Point; - typedef typename Base::Quality Quality; + typedef typename Base::Cell_quality Cell_quality; public: /** \name CONSTRUCTORS */ @@ -73,7 +73,7 @@ protected: bool test_if_cell_is_bad(const Cell_handle c) { - Quality q; + Cell_quality q; if( is_in_domain(c) && should_be_refined(c, q) ) { this->add_bad_element(c, q); @@ -218,7 +218,7 @@ unsigned int poisson_refine_triangulation( typedef typename Gt::Point_3 Point; // Mesher_level types - typedef Mesh_criteria_3 Tets_criteria; + typedef Poisson_mesh_cell_criteria_3 Tets_criteria; typedef typename CGAL::Surface_mesh_traits_generator_3::type Oracle; typedef Poisson_mesher_level Refiner;