From 004252a398a24e88f026e97726cbd47c24ddefd2 Mon Sep 17 00:00:00 2001 From: Lingjie Zhu Date: Fri, 14 Jul 2017 16:44:49 +0800 Subject: [PATCH] remove halfedge status map --- .../internal/Surface_mesh_approximation/VSA.h | 45 +++---------------- 1 file changed, 6 insertions(+), 39 deletions(-) diff --git a/Surface_mesh_approximation/include/CGAL/internal/Surface_mesh_approximation/VSA.h b/Surface_mesh_approximation/include/CGAL/internal/Surface_mesh_approximation/VSA.h index 57a8132ccf0..e9c311148b7 100644 --- a/Surface_mesh_approximation/include/CGAL/internal/Surface_mesh_approximation/VSA.h +++ b/Surface_mesh_approximation/include/CGAL/internal/Surface_mesh_approximation/VSA.h @@ -263,13 +263,6 @@ private: typedef std::vector ChordVector; typedef typename ChordVector::iterator ChordVectorIterator; - // Halfedge status. - enum Halfedge_status { - OFF_BORDER, // In the inside of a region. - CANDIDATE, // On the region border, waiting to be visited. - ON_BORDER // On proxy border, already visited. - }; - public: enum Initialization { RandomInit, @@ -310,15 +303,12 @@ private: std::vector proxies_center; // The proxy center. std::vector proxies_area; // The proxy area. - // Mesh facet area map, for anchor position average. - const FacetAreaMap area_pmap; - - // Mesh vertex anchor map and halfedge status map. // The attached anchor index of a vertex. std::map vertex_status_map; VertexStatusPMap vertex_status_pmap; - std::map halfedge_status_map; - HalfedgeStatusPMap halfedge_status_pmap; + + // Mesh facet area map, for anchor position average. + const FacetAreaMap area_pmap; // All anchors. std::vector anchors; @@ -349,7 +339,6 @@ public: vertex_point_pmap(_vertex_point_map), area_pmap(_facet_area_map), vertex_status_pmap(vertex_status_map), - halfedge_status_pmap(halfedge_status_map), fit_error(_appx_trait.construct_fit_error_functor()), proxy_fitting(_appx_trait.construct_proxy_fitting_functor()) { @@ -363,10 +352,6 @@ public: enum Vertex_status { NO_ANCHOR = -1 }; BOOST_FOREACH(vertex_descriptor v, vertices(mesh)) vertex_status_map.insert(std::pair(v, static_cast(NO_ANCHOR))); - - // tag all halfedge off proxy border - BOOST_FOREACH(halfedge_descriptor h, halfedges(mesh)) - halfedge_status_map.insert(std::pair(h, static_cast(OFF_BORDER))); } /** @@ -791,13 +776,12 @@ private: */ template void find_edges(const FacetSegmentMap &seg_pmap) { - // tag all proxy border halfedges as candidate - tag_halfedges_status(seg_pmap); - // collect candidate halfedges in a set std::set he_candidates; BOOST_FOREACH(halfedge_descriptor h, halfedges(mesh)) { - if (halfedge_status_pmap[h] == static_cast(CANDIDATE)) + if (!CGAL::is_border(h, mesh) + && (CGAL::is_border(opposite(h, mesh), mesh) + || seg_pmap[face(h, mesh)] != seg_pmap[face(opposite(h, mesh), mesh)])) he_candidates.insert(h); } @@ -1119,23 +1103,6 @@ private: proxies_area.swap(areas); } - /** - * Tags all the region border halfedges of a given partition @a seg_pmap to CANDIDATE states. - * @tparam FacetSegmentMap `WritablePropertyMap` with `boost::graph_traits::face_handle` as key and `std::size_t` as value type - * @param seg_map facet partition index - */ - template - void tag_halfedges_status(const FacetSegmentMap &seg_pmap) { - BOOST_FOREACH(halfedge_descriptor h, halfedges(mesh)) { - halfedge_status_pmap[h] = static_cast(OFF_BORDER); - if (!CGAL::is_border(h, mesh) - && (CGAL::is_border(opposite(h, mesh), mesh) - || seg_pmap[face(h, mesh)] != seg_pmap[face(opposite(h, mesh), mesh)])) { - halfedge_status_pmap[h] = static_cast(CANDIDATE); - } - } - } - /** * Walks along the region border to the first halfedge pointing to a vertex associated with an anchor of a given partition @a seg_pmap. * @tparam FacetSegmentMap `WritablePropertyMap` with `boost::graph_traits::face_handle` as key and `std::size_t` as value type