diff --git a/BGL/include/CGAL/boost/graph/properties_Surface_mesh.h b/BGL/include/CGAL/boost/graph/properties_Surface_mesh.h index 729ddb1f0e8..08306f745ef 100644 --- a/BGL/include/CGAL/boost/graph/properties_Surface_mesh.h +++ b/BGL/include/CGAL/boost/graph/properties_Surface_mesh.h @@ -22,7 +22,7 @@ #define CGAL_PROPERTIES_SURFACE_MESH_H #include -#include +#include #include #include diff --git a/BGL/test/BGL/test_Euler_operations.cpp b/BGL/test/BGL/test_Euler_operations.cpp index 1131fa70bbb..0a6abcc2fe1 100644 --- a/BGL/test/BGL/test_Euler_operations.cpp +++ b/BGL/test/BGL/test_Euler_operations.cpp @@ -1,8 +1,8 @@ #include "test_Prefix.h" +#include #include - template void join_face_test() diff --git a/BGL/test/BGL/test_Prefix.h b/BGL/test/BGL/test_Prefix.h index 6ed5195d35b..c9533a6618b 100644 --- a/BGL/test/BGL/test_Prefix.h +++ b/BGL/test/BGL/test_Prefix.h @@ -7,8 +7,6 @@ #include #include -#include -#include #include diff --git a/Surface_mesh/include/CGAL/Surface_mesh.h b/Surface_mesh/include/CGAL/Surface_mesh.h index ffd91be52d8..47f89324877 100644 --- a/Surface_mesh/include/CGAL/Surface_mesh.h +++ b/Surface_mesh/include/CGAL/Surface_mesh.h @@ -19,8 +19,8 @@ #ifndef CGAL_TOP_LEVEL_SURFACE_MESH_H #define CGAL_TOP_LEVEL_SURFACE_MESH_H -#include "CGAL/Surface_mesh/Surface_mesh_fwd.h" -#include "CGAL/Surface_mesh/Surface_mesh.h" +#include +#include #ifdef DOXYGEN_RUNNING namespace CGAL { diff --git a/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h b/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h index e93eaa96bd8..e60a3f53ba5 100644 --- a/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h +++ b/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h @@ -32,10 +32,6 @@ #include #include #include -#include -#include -#include -#include #include #include @@ -2249,16 +2245,40 @@ public: private: //--------------------------------------------------- property handling - /// @cond BROKEN_DOC - typedef boost::fusion::map< - boost::fusion::pair< typename Surface_mesh::Vertex_index, Property_container (Surface_mesh::*)>, - boost::fusion::pair< typename Surface_mesh::Halfedge_index, Property_container (Surface_mesh::*)>, - boost::fusion::pair< typename Surface_mesh::Edge_index, Property_container (Surface_mesh::*)>, - boost::fusion::pair< typename Surface_mesh::Face_index, Property_container (Surface_mesh::*)> > - map_type; + // Property_selector maps an index type to a property_container, the + // dummy is necessary to make it a partial specialization (full + // specializations are only allowed at namespace scope). + template + struct Property_selector {}; - map_type pmap_; - /// @endcond + template + struct Property_selector::Vertex_index, dummy> { + CGAL::Surface_mesh

* m_; + Property_selector(CGAL::Surface_mesh

* m) : m_(m) {} + Property_container::Vertex_index>& + operator()() { return m_->vprops_; } + }; + template + struct Property_selector::Halfedge_index, dummy> { + CGAL::Surface_mesh

* m_; + Property_selector(CGAL::Surface_mesh

* m) : m_(m) {} + Property_container::Halfedge_index>& + operator()() { return m_->hprops_; } + }; + template + struct Property_selector::Edge_index, dummy> { + CGAL::Surface_mesh

* m_; + Property_selector(CGAL::Surface_mesh

* m) : m_(m) {} + Property_container::Edge_index>& + operator()() { return m_->eprops_; } + }; + template + struct Property_selector::Face_index, dummy> { + CGAL::Surface_mesh

* m_; + Property_selector(CGAL::Surface_mesh

* m) : m_(m) {} + Property_container::Face_index>& + operator()() { return m_->fprops_; } + }; public: @@ -2290,9 +2310,9 @@ private: //--------------------------------------------------- property handling template - std::pair, bool> + std::pair, bool> add_property_map(const std::string& name, const T t=T()) { - return (this->*boost::fusion::at_key(pmap_)).template add(name, t); + return Property_selector(this)().template add(name, t); } @@ -2303,7 +2323,7 @@ private: //--------------------------------------------------- property handling template std::pair,bool> property_map(const std::string& name) const { - return (this->*boost::fusion::at_key(pmap_)).template get(name); + return Property_selector(const_cast(this))().template get(name); } @@ -2312,7 +2332,7 @@ private: //--------------------------------------------------- property handling template void remove_property_map(Property_map& p) { - (this->*boost::fusion::at_key(pmap_)).remove(p); + (Property_selector(this)()).remove(p); } /// @cond CGAL_DOCUMENT_INTERNALS @@ -2325,16 +2345,16 @@ private: //--------------------------------------------------- property handling template const std::type_info& property_type(const std::string& name) { - return (this->*boost::fusion::at_key(pmap_)).get_type(name); + return Property_selector(this)().get_type(name); } - /// @endcond + /// @endcond /// returns a vector with all strings that describe properties with the key type `I`. /// @tparam I The key type of the properties. template std::vector properties() const { - return (this->*boost::fusion::at_key(pmap_)).properties(); + return Property_selector(this)().properties(); } /// returns the property for the string "v:point". @@ -2526,10 +2546,6 @@ private: //------------------------------------------------------- private data template Surface_mesh

:: Surface_mesh() - : pmap_(boost::fusion::make_pair< typename Surface_mesh::Vertex_index >(&Surface_mesh::vprops_) - , boost::fusion::make_pair< typename Surface_mesh::Halfedge_index >(&Surface_mesh::hprops_) - , boost::fusion::make_pair< typename Surface_mesh::Edge_index >(&Surface_mesh::eprops_) - , boost::fusion::make_pair< typename Surface_mesh::Face_index >(&Surface_mesh::fprops_)) { // allocate standard properties // same list is used in operator=() and assign() @@ -2555,8 +2571,6 @@ operator=(const Surface_mesh

& rhs) { if (this != &rhs) { - pmap_ = rhs.pmap_; - // deep copy of property containers vprops_ = rhs.vprops_; hprops_ = rhs.hprops_; diff --git a/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh_fwd.h b/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh_fwd.h index 19707b71e89..6bce7b0024b 100644 --- a/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh_fwd.h +++ b/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh_fwd.h @@ -18,8 +18,6 @@ #ifndef CGAL_SURFACE_MESH_FWD_H #define CGAL_SURFACE_MESH_FWD_H -#include - /// \file Surface_mesh_fwd.h /// Forward declarations of the Surface_mesh package.