diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/Adaptive_sizing_field.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/Adaptive_sizing_field.h index 91524857764..450bb4c1ea4 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/Adaptive_sizing_field.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/Adaptive_sizing_field.h @@ -35,10 +35,9 @@ public: typedef typename Base::K K; typedef typename Base::FT FT; typedef typename Base::Point_3 Point_3; + typedef typename Base::face_descriptor face_descriptor; typedef typename Base::halfedge_descriptor halfedge_descriptor; typedef typename Base::vertex_descriptor vertex_descriptor; - //todo ip: send this over to Sizing_field to be consistent - typedef typename boost::graph_traits::face_descriptor face_descriptor; typedef typename CGAL::dynamic_vertex_property_t Vertex_property_tag; typedef typename boost::property_map - void calc_sizing_map(const FaceRange& faces_) + void calc_sizing_map(const FaceRange& face_range) { #ifdef CGAL_PMP_REMESHING_VERBOSE int oversize = 0; @@ -90,22 +89,16 @@ public: std::cout << "Calculating sizing field..." << std::endl; #endif - ///// FaceRange->expand->Face_filtered_graph->use ffg onwards - std::vector selection(faces_.begin(), faces_.end()); - auto is_selected = get(CGAL::dynamic_face_property_t(), m_pmesh); - for (face_descriptor f : faces(m_pmesh)) - put(is_selected, f, false); - CGAL::expand_face_selection(selection, m_pmesh, 1, is_selected, std::back_inserter(selection)); - + // expand face selection for curvature calculation + std::set selection(face_range.begin(), face_range.end()); + CGAL::expand_face_selection(selection, m_pmesh, 1 + , make_boolean_property_map(selection), Emptyset_iterator()); CGAL::Face_filtered_graph ffg(m_pmesh, selection); - /////// - - Vertex_curvature_map vertex_curvature_map; - vertex_curvature_map = get(Vertex_curvature_tag(), ffg); + // calculate curvature + Vertex_curvature_map vertex_curvature_map = get(Vertex_curvature_tag(), ffg); interpolated_corrected_principal_curvatures_and_directions(ffg , vertex_curvature_map); - // calculate vertex sizing field L(x_i) from curvature field for(vertex_descriptor v : vertices(ffg)) { diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/Sizing_field.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/Sizing_field.h index 359a9fc6b56..3640e14c092 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/Sizing_field.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/Sizing_field.h @@ -33,6 +33,7 @@ private: public: typedef typename CGAL::Kernel_traits::Kernel K; + typedef typename boost::graph_traits::face_descriptor face_descriptor; typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; typedef Point Point_3;