diff --git a/BGL/include/CGAL/boost/graph/Graph_with_descriptor_with_graph.h b/BGL/include/CGAL/boost/graph/Graph_with_descriptor_with_graph.h index c814c8fe7fb..89f3681964d 100644 --- a/BGL/include/CGAL/boost/graph/Graph_with_descriptor_with_graph.h +++ b/BGL/include/CGAL/boost/graph/Graph_with_descriptor_with_graph.h @@ -146,11 +146,6 @@ struct Graph_with_descriptor_with_graph Graph_with_descriptor_with_graph(Graph& graph) : graph(&graph) {} - - // private: - // disable copy-constructor to avoid non-wanted copies - // AF: Why was this private?? - Graph_with_descriptor_with_graph(const Graph_with_descriptor_with_graph&){} }; 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 1d17b252165..d1a0208bd20 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 @@ -7,6 +7,7 @@ #include #include "CGAL/boost/graph/Graph_with_descriptor_with_graph.h" #include +#include #include diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin_cgal_code.h b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin_cgal_code.h index e0098a324e3..cabc6e8bdc2 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin_cgal_code.h +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin_cgal_code.h @@ -8,6 +8,7 @@ #include "Kernel_type.h" #include "Meshing_thread.h" #include "Scene_surface_mesh_item.h" + namespace CGAL { template diff --git a/Polyhedron/demo/Polyhedron/SMesh_type.h b/Polyhedron/demo/Polyhedron/SMesh_type.h index 706bc20776c..6f6d4e6c868 100644 --- a/Polyhedron/demo/Polyhedron/SMesh_type.h +++ b/Polyhedron/demo/Polyhedron/SMesh_type.h @@ -18,200 +18,4 @@ typedef boost::graph_traits::face_descriptor face_descriptor; typedef boost::graph_traits::vertex_descriptor vertex_descriptor; typedef boost::graph_traits::halfedge_descriptor halfedge_descriptor; - - -namespace CGAL{ -SMesh::Property_map::halfedge_descriptor,bool> -inline get(CGAL::halfedge_is_feature_t, SMesh& smesh) -{ - typedef boost::graph_traits::halfedge_descriptor halfedge_descriptor; - return smesh.add_property_map("h:is_feature").first; -} - - - - -template < typename I> -SMesh::Property_map< boost::graph_traits::face_descriptor,I> -inline get(CGAL::face_patch_id_t, SMesh& smesh) -{ - typedef boost::graph_traits::face_descriptor face_descriptor; - return smesh.add_property_map("f:patch_id").first; -} - - - CGAL::static_property_map ::face_descriptor,std::pair > - inline get(CGAL::face_patch_id_t, SMesh & smesh) - { - typedef CGAL::static_property_map::face_descriptor, - std::pair > Pmap; - - return Pmap(std::make_pair(0,1)); - } - - SMesh::Property_map< boost::graph_traits::face_descriptor,int> - inline get(CGAL::face_selection_t, SMesh& smesh) -{ - typedef boost::graph_traits::face_descriptor face_descriptor; - return smesh.add_property_map("f:selection").first; -} - - - - SMesh::Property_map< boost::graph_traits::vertex_descriptor,int> -inline get(CGAL::vertex_selection_t, SMesh& smesh) -{ - typedef boost::graph_traits::vertex_descriptor vertex_descriptor; - return smesh.add_property_map("v:selection").first; -} - - SMesh::Property_map< boost::graph_traits::vertex_descriptor,int> - inline get(CGAL::vertex_num_feature_edges_t, SMesh& smesh) -{ - typedef boost::graph_traits::vertex_descriptor vertex_descriptor; - return smesh.add_property_map("v:nfe").first; -} - - - template < typename Patch_ID> - SMesh::Property_map< boost::graph_traits::vertex_descriptor,std::set > - inline get(CGAL::vertex_incident_patches_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 -{ -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; -}; - -template <> - struct property_map > - { - - typedef typename boost::graph_traits::face_descriptor face_descriptor; - - typedef CGAL::static_property_map< boost::graph_traits::face_descriptor,std::pair > 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::face_descriptor face_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::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 - - #endif // SMESH_TYPE_H diff --git a/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.h b/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.h index e6a809bc0b7..8938f860278 100644 --- a/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.h +++ b/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.h @@ -7,6 +7,7 @@ #ifdef USE_SURFACE_MESH #include "Scene_surface_mesh_item.h" +#include #else #include "Polyhedron_type.h" #include diff --git a/Surface_mesh/include/CGAL/boost/graph/PMP_properties_Surface_mesh.h b/Surface_mesh/include/CGAL/boost/graph/PMP_properties_Surface_mesh.h new file mode 100644 index 00000000000..4e4a82670f0 --- /dev/null +++ b/Surface_mesh/include/CGAL/boost/graph/PMP_properties_Surface_mesh.h @@ -0,0 +1,251 @@ +// Copyright (c) 2017 GeometryFactory (France). All rights reserved. +// +// This file is part of CGAL (www.cgal.org); you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +// +// $URL$ +// $Id$ +// +// +// Author(s) : Andreas Fabri + +#ifndef CGAL_PMP_PROPERTIES_SURFACE_MESH_H +#define CGAL_PMP_PROPERTIES_SURFACE_MESH_H + +#include +#include +#include + +namespace boost { + +template +struct property_map, CGAL::face_patch_id_t > +{ + + typedef typename boost::graph_traits >::face_descriptor face_descriptor; + + typedef typename CGAL::Surface_mesh

::template Property_map type; + typedef type const_type; +}; + + +template +struct property_map, CGAL::face_patch_id_t > +{ + + typedef typename boost::graph_traits >::face_descriptor face_descriptor; + + typedef CGAL::static_property_map >::face_descriptor,std::pair > type; + typedef type const_type; +}; + + +template +struct property_map, CGAL::halfedge_is_feature_t> +{ + typedef typename boost::graph_traits >::halfedge_descriptor halfedge_descriptor; + + typedef typename CGAL::Surface_mesh

::template Property_map type; + typedef type const_type; +}; + + +template +struct property_map, CGAL::vertex_selection_t> +{ + + typedef typename boost::graph_traits >::vertex_descriptor vertex_descriptor; + + typedef typename CGAL::Surface_mesh

::template Property_map type; + typedef type const_type; +}; + + +template +struct property_map, CGAL::face_selection_t> +{ + + typedef typename boost::graph_traits >::face_descriptor face_descriptor; + + typedef typename CGAL::Surface_mesh

::template Property_map type; + typedef type const_type; +}; + + +template +struct property_map, CGAL::vertex_num_feature_edges_t> +{ + + typedef typename boost::graph_traits >::vertex_descriptor vertex_descriptor; + + typedef typename CGAL::Surface_mesh

::template Property_map type; + typedef type const_type; +}; + + +template +struct property_map, CGAL::vertex_incident_patches_t > +{ + + typedef typename boost::graph_traits >::vertex_descriptor vertex_descriptor; + + typedef typename CGAL::Surface_mesh

::template Property_map > type; + typedef type const_type; +}; + + +template +struct property_map, CGAL::vertex_time_stamp_t> +{ + + typedef typename boost::graph_traits >::vertex_descriptor vertex_descriptor; + + typedef typename CGAL::Surface_mesh

::template Property_map type; + typedef type const_type; +}; + + +template +struct property_map, CGAL::halfedge_time_stamp_t> +{ + + typedef typename boost::graph_traits >::halfedge_descriptor halfedge_descriptor; + + typedef typename CGAL::Surface_mesh

::template Property_map type; + typedef type const_type; +}; + + +template +struct property_map, CGAL::face_time_stamp_t> +{ + + typedef typename boost::graph_traits >::face_descriptor face_descriptor; + + typedef typename CGAL::Surface_mesh

::template Property_map type; + typedef type const_type; +}; + +} // namespace boost + +namespace CGAL { + +template +struct Get_pmap_of_surface_mesh { + typedef typename boost::property_map, Property_tag >::type type; +}; + +template +typename boost::lazy_disable_if< + boost::is_const

, + Get_pmap_of_surface_mesh > + >::type +inline get(CGAL::face_patch_id_t, Surface_mesh

& smesh) +{ + typedef typename boost::graph_traits >::face_descriptor face_descriptor; + return smesh. template add_property_map("f:patch_id").first; +} + + +#define CGAL_PMP_PROPERTY_SURFACE_MESH_RETURN_TYPE(Tag) \ + typename boost::lazy_disable_if< \ + boost::is_const

, \ + Get_pmap_of_surface_mesh \ + >::type + +template +CGAL_PMP_PROPERTY_SURFACE_MESH_RETURN_TYPE(CGAL::face_patch_id_t) +inline get(CGAL::face_patch_id_t, Surface_mesh

& smesh) +{ + typedef CGAL::static_property_map >::face_descriptor,std::pair > Pmap; + + return Pmap(std::make_pair(0,1)); +} + + +template +CGAL_PMP_PROPERTY_SURFACE_MESH_RETURN_TYPE(CGAL::halfedge_is_feature_t) +inline get(CGAL::halfedge_is_feature_t, Surface_mesh

& smesh) +{ + typedef typename boost::graph_traits >::halfedge_descriptor halfedge_descriptor; + return smesh. template add_property_map("h:is_feature").first; +} + + template +CGAL_PMP_PROPERTY_SURFACE_MESH_RETURN_TYPE(CGAL::face_selection_t) + inline get(CGAL::face_selection_t, Surface_mesh

& smesh) +{ + typedef typename boost::graph_traits >::face_descriptor face_descriptor; + return smesh. template add_property_map("f:selection").first; +} + + + + template +CGAL_PMP_PROPERTY_SURFACE_MESH_RETURN_TYPE(CGAL::vertex_selection_t) +inline get(CGAL::vertex_selection_t, Surface_mesh

& smesh) +{ + typedef typename boost::graph_traits >::vertex_descriptor vertex_descriptor; + return smesh. template add_property_map("v:selection").first; +} + + + template +CGAL_PMP_PROPERTY_SURFACE_MESH_RETURN_TYPE(CGAL::vertex_num_feature_edges_t) + inline get(CGAL::vertex_num_feature_edges_t, Surface_mesh

& smesh) +{ + typedef typename boost::graph_traits >::vertex_descriptor vertex_descriptor; + return smesh. template add_property_map("v:nfe").first; +} + + template +typename boost::lazy_disable_if< + boost::is_const

, + Get_pmap_of_surface_mesh > + >::type + inline get(CGAL::vertex_incident_patches_t, Surface_mesh

& smesh) +{ + typedef typename boost::graph_traits >::vertex_descriptor vertex_descriptor; + return smesh. template add_property_map >("v:ip").first; +} + + + template + CGAL_PMP_PROPERTY_SURFACE_MESH_RETURN_TYPE(CGAL::vertex_time_stamp_t) +inline get(CGAL::vertex_time_stamp_t, Surface_mesh

& smesh) +{ + typedef typename boost::graph_traits >::vertex_descriptor vertex_descriptor; + return smesh. template add_property_map("v:time_stamp").first; +} + + + template + CGAL_PMP_PROPERTY_SURFACE_MESH_RETURN_TYPE(CGAL::halfedge_time_stamp_t) +inline get(CGAL::halfedge_time_stamp_t, Surface_mesh

& smesh) +{ + typedef typename boost::graph_traits >::halfedge_descriptor halfedge_descriptor; + return smesh. template add_property_map("h:time_stamp").first; +} + + + template + CGAL_PMP_PROPERTY_SURFACE_MESH_RETURN_TYPE(CGAL::face_time_stamp_t) +inline get(CGAL::face_time_stamp_t, Surface_mesh

& smesh) +{ + typedef typename boost::graph_traits >::face_descriptor face_descriptor; + return smesh. template add_property_map("v:time_stamp").first; +} + +} // namespace CGAL + +#undef CGAL_PMP_PROPERTY_SURFACE_MESH_RETURN_TYPE + +#endif //CGAL_PMP_PROPERTIES_SURFACE_MESH_H