From 95960c3b58f6d66c141eea131b3a02fb038bb589 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Fri, 12 May 2017 09:07:17 +0200 Subject: [PATCH] Fix after rebase --- .../Detect_features_in_polyhedra.h | 3 +- .../Mesh_3/Mesh_3_plugin_cgal_code.cpp | 6 +- .../Scene_facegraph_item_k_ring_selection.h | 6 +- .../Polyhedron_demo_detect_sharp_edges.h | 6 +- Polyhedron/demo/Polyhedron/Polyhedron_type.h | 29 ++++++++ Polyhedron/demo/Polyhedron/SMesh_type.h | 65 ++++++++++++++++++ .../Scene_polyhedron_item_k_ring_selection.h | 6 +- .../Scene_polyhedron_selection_item.h | 1 + .../boost/graph/PMP_properties_Polyhedron_3.h | 67 ------------------- 9 files changed, 109 insertions(+), 80 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/Detect_features_in_polyhedra.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/Detect_features_in_polyhedra.h index 705911c44c9..065671c7142 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/Detect_features_in_polyhedra.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/Detect_features_in_polyhedra.h @@ -29,6 +29,7 @@ #include #include #include +#include #include namespace CGAL { @@ -37,7 +38,7 @@ namespace Polygon_mesh_processing { template void detect_features(Polyhedron& p, FT angle_in_deg, - typename boost::property_map >::type pid_map) + typename boost::property_map >::type pid_map) { Detect_features_in_polyhedra go; // AF todo: Add overload for the next three functions so that we use the pid_map diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin_cgal_code.cpp b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin_cgal_code.cpp index a01f2a4bf1c..1d17b252165 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin_cgal_code.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin_cgal_code.cpp @@ -39,7 +39,7 @@ struct Polyhedral_mesh_domain_selector {} }; template -Meshing_thread* cgal_code_mesh_3(const Mesh* pMesh, +Meshing_thread* cgal_code_mesh_3_templated(const Mesh* pMesh, const Polylines_container& polylines, QString filename, const double facet_angle, @@ -150,7 +150,7 @@ Meshing_thread* cgal_code_mesh_3(const Polyhedron* pMesh, const bool surface_only, CGAL::Three::Scene_interface* scene) { - return cgal_code_mesh_3(pMesh, + return cgal_code_mesh_3_templated(pMesh, polylines, filename, facet_angle, @@ -181,7 +181,7 @@ Meshing_thread* cgal_code_mesh_3(const SMwgd* pMesh, const bool surface_only, CGAL::Three::Scene_interface* scene) { - return cgal_code_mesh_3(pMesh, + return cgal_code_mesh_3_templated(pMesh, polylines, filename, facet_angle, diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Scene_facegraph_item_k_ring_selection.h b/Polyhedron/demo/Polyhedron/Plugins/PMP/Scene_facegraph_item_k_ring_selection.h index 86168d363e0..0b80817c843 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Scene_facegraph_item_k_ring_selection.h +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Scene_facegraph_item_k_ring_selection.h @@ -155,7 +155,7 @@ public Q_SLOTS: { #ifdef USE_SURFACE_MESH typedef boost::graph_traits::vertices_size_type size_type; - size_type h = reinterpret_cast(void_ptr); + size_type h = static_cast(reinterpret_cast(void_ptr)); process_selection( static_cast(h) ); #else process_selection( static_cast(void_ptr)->halfedge()->vertex() ); @@ -171,7 +171,7 @@ public Q_SLOTS: { #ifdef USE_SURFACE_MESH typedef boost::graph_traits::faces_size_type size_type; - size_type h = reinterpret_cast(void_ptr); + size_type h = static_cast(reinterpret_cast(void_ptr)); process_selection( static_cast(h) ); #else process_selection( static_cast(void_ptr)->halfedge()->facet() ); @@ -186,7 +186,7 @@ public Q_SLOTS: { #ifdef USE_SURFACE_MESH typedef boost::graph_traits::edges_size_type size_type; - size_type h = reinterpret_cast(void_ptr); + size_type h = static_cast(reinterpret_cast(void_ptr)); process_selection( static_cast(h) ); #else process_selection( edge(static_cast(void_ptr)->opposite()->opposite(), *poly_item->polyhedron()) ); diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_demo_detect_sharp_edges.h b/Polyhedron/demo/Polyhedron/Polyhedron_demo_detect_sharp_edges.h index 535abd5d41f..21ed6dd73de 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_demo_detect_sharp_edges.h +++ b/Polyhedron/demo/Polyhedron/Polyhedron_demo_detect_sharp_edges.h @@ -25,9 +25,9 @@ namespace CGAL // Detect edges in current polyhedron typedef typename boost::property_map >::type PatchID; - CGAL::Polygon_mesh_processing::Detect_features_in_polyhedra - detect_features(get(CGAL::face_patch_id_t(), *pMesh)); - detect_features.detect_sharp_edges(*pMesh, angle); + + CGAL::Polygon_mesh_processing::Detect_features_in_polyhedra features_detector; + features_detector.detect_sharp_edges(*pMesh, angle); } }//end namespace CGAL diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_type.h b/Polyhedron/demo/Polyhedron/Polyhedron_type.h index a0fda46aafa..b98d1f3541e 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_type.h +++ b/Polyhedron/demo/Polyhedron/Polyhedron_type.h @@ -195,6 +195,35 @@ public: }; #include "Polyhedron_type_fwd.h" +#include +inline +boost::property_map::type +get(CGAL::vertex_selection_t, const Polyhedron& p) +{ + return get(boost::vertex_index,p); +} +inline +boost::property_map::type +get(CGAL::face_selection_t, const Polyhedron& p) +{ + return get(boost::face_index,p); +} + +namespace boost +{ +template <> +struct property_map +{ + typedef boost::property_map::type type; + typedef boost::property_map::const_type const_type; +}; +template <> +struct property_map +{ + typedef boost::property_map::type type; + typedef boost::property_map::const_type const_type; +}; +}//boost // surface mesh typedef Polyhedron_demo_items Polyhedron_items; diff --git a/Polyhedron/demo/Polyhedron/SMesh_type.h b/Polyhedron/demo/Polyhedron/SMesh_type.h index c9c448de847..706bc20776c 100644 --- a/Polyhedron/demo/Polyhedron/SMesh_type.h +++ b/Polyhedron/demo/Polyhedron/SMesh_type.h @@ -80,6 +80,33 @@ inline get(CGAL::vertex_selection_t, SMesh& smesh) typedef boost::graph_traits::vertex_descriptor vertex_descriptor; return smesh.add_property_map >("v:ip").first; } + + + SMesh::Property_map< boost::graph_traits::vertex_descriptor,std::size_t> + inline get(CGAL::vertex_time_stamp_t, SMesh & smesh) + { + typedef boost::graph_traits::vertex_descriptor vertex_descriptor; + return smesh.add_property_map("v:time_stamp").first; + } + + + + SMesh::Property_map< boost::graph_traits::halfedge_descriptor,std::size_t> + inline get(CGAL::halfedge_time_stamp_t, SMesh& smesh) + { + typedef boost::graph_traits::halfedge_descriptor halfedge_descriptor; + return smesh.add_property_map("h:time_stamp").first; + } + + + + SMesh::Property_map< boost::graph_traits::face_descriptor,std::size_t> + inline get(CGAL::face_time_stamp_t, SMesh& smesh) + { + typedef boost::graph_traits::face_descriptor face_descriptor; + return smesh.add_property_map("v:time_stamp").first; + } + } namespace boost { @@ -89,6 +116,7 @@ struct property_map typedef boost::graph_traits::halfedge_descriptor halfedge_descriptor; typedef SMesh::Property_map type; + typedef type const_type; }; template @@ -97,6 +125,7 @@ struct property_map > typedef boost::graph_traits::face_descriptor face_descriptor; typedef SMesh::Property_map type; + typedef type const_type; }; template <> @@ -117,6 +146,7 @@ struct property_map typedef boost::graph_traits::vertex_descriptor vertex_descriptor; typedef SMesh::Property_map type; + typedef type const_type; }; template<> @@ -126,6 +156,7 @@ struct property_map typedef boost::graph_traits::face_descriptor face_descriptor; typedef SMesh::Property_map type; + typedef type const_type; }; template<> @@ -145,6 +176,40 @@ struct property_map> typedef boost::graph_traits::vertex_descriptor vertex_descriptor; typedef SMesh::Property_map> type; + typedef type const_type; +}; + + + +template<> +struct property_map +{ + + typedef boost::graph_traits::vertex_descriptor vertex_descriptor; + + typedef SMesh::Property_map type; + typedef type const_type; +}; + +template<> +struct property_map +{ + + typedef boost::graph_traits::halfedge_descriptor halfedge_descriptor; + + typedef SMesh::Property_map type; + typedef type const_type; +}; + + +template<> +struct property_map +{ + + typedef boost::graph_traits::face_descriptor face_descriptor; + + typedef SMesh::Property_map type; + typedef type const_type; }; } //boost diff --git a/Polyhedron/demo/Polyhedron/Scene_polyhedron_item_k_ring_selection.h b/Polyhedron/demo/Polyhedron/Scene_polyhedron_item_k_ring_selection.h index d3f729ede83..98d98c2522d 100644 --- a/Polyhedron/demo/Polyhedron/Scene_polyhedron_item_k_ring_selection.h +++ b/Polyhedron/demo/Polyhedron/Scene_polyhedron_item_k_ring_selection.h @@ -192,7 +192,7 @@ public Q_SLOTS: void sm_vertex_has_been_selected(void* v) { typedef boost::graph_traits::vertices_size_type size_type; - size_type h = reinterpret_cast(v); + size_type h = static_cast(reinterpret_cast(v)); is_active=true; if(active_handle_type == Active_handle::VERTEX || active_handle_type == Active_handle::PATH) process_selection( sm_vertex_descriptor(h) ); @@ -201,7 +201,7 @@ public Q_SLOTS: void sm_facet_has_been_selected(void* v) { typedef boost::graph_traits::vertices_size_type size_type; - size_type h = reinterpret_cast(v); + size_type h = static_cast(reinterpret_cast(v)); is_active=true; if (active_handle_type == Active_handle::FACET || active_handle_type == Active_handle::CONNECTED_COMPONENT) @@ -211,7 +211,7 @@ public Q_SLOTS: void sm_edge_has_been_selected(void* v) { typedef boost::graph_traits::edges_size_type size_type; - size_type h = reinterpret_cast(v); + size_type h = static_cast(reinterpret_cast(v)); is_active=true; if(active_handle_type == Active_handle::EDGE) process_selection(sm_edge_descriptor(h) ); diff --git a/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.h b/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.h index a506b5a2a9e..e6a809bc0b7 100644 --- a/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.h +++ b/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.h @@ -9,6 +9,7 @@ #include "Scene_surface_mesh_item.h" #else #include "Polyhedron_type.h" +#include #endif #include "Scene_polyhedron_item_decorator.h" #include diff --git a/Polyhedron/include/CGAL/boost/graph/PMP_properties_Polyhedron_3.h b/Polyhedron/include/CGAL/boost/graph/PMP_properties_Polyhedron_3.h index 440a771ca55..c1e7558d813 100644 --- a/Polyhedron/include/CGAL/boost/graph/PMP_properties_Polyhedron_3.h +++ b/Polyhedron/include/CGAL/boost/graph/PMP_properties_Polyhedron_3.h @@ -203,13 +203,6 @@ struct Polyhedron_property_map }; }; -// template -// inline Is_feature_pmap -// get(halfedge_is_feature_t, -// const Polyhedron_3 >&) -// { -// return Is_feature_pmap (); -// } template @@ -246,69 +239,9 @@ struct Polyhedron_property_map > }; }; -// template -// inline vertex_incident_patches_pmap -// get(CGAL::vertex_incident_patches_t, -// const Polyhedron_3 >&) -// { -// return vertex_incident_patches_pmap(); -// } } // end namespace CGAL -namespace boost { - - // template - // struct property_map, - // CGAL::vertex_time_stamp_t> - // { - // typedef CGAL::Polyhedron_face_time_stamp_pmap type; - // }; - - // template - // struct property_map, - // CGAL::halfedge_time_stamp_t> - // { - // typedef CGAL::Polyhedron_face_time_stamp_pmap type; - // }; - - // template - // struct property_map, - // CGAL::face_time_stamp_t> - // { - // typedef CGAL::Polyhedron_face_time_stamp_pmap type; - // }; - - // template - // struct property_map, - // CGAL::face_patch_id_t > - // { - // typedef CGAL::Polyhedron_face_patch_id_pmap type; - // }; - - // template - // struct property_map, - // CGAL::vertex_num_feature_edges_t> - // { - // typedef CGAL::Polyhedron_num_feature_edges_pmap type; - // }; - - // template - // struct property_map, - // CGAL::halfedge_is_feature_t> - // { - // typedef CGAL::Polyhedron_is_feature_edge_pmap type; - // }; - - // template - // struct property_map, - // CGAL::vertex_incident_patches_t > - // { - // typedef CGAL::Polyhedron_incident_patches_pmap type; - // }; - -} // namespace boost - #undef CGAL_HDS_PARAM_ #endif // CGAL_PMP_PROPERTIES_POLYHEDRON_3_H