diff --git a/BGL/test/BGL/graph_concept_Linear_cell_complex.cpp b/BGL/test/BGL/graph_concept_Linear_cell_complex.cpp index c2a002739c6..165e099dd7f 100644 --- a/BGL/test/BGL/graph_concept_Linear_cell_complex.cpp +++ b/BGL/test/BGL/graph_concept_Linear_cell_complex.cpp @@ -8,20 +8,7 @@ typedef CGAL::Simple_cartesian Kernel; typedef CGAL::Linear_cell_complex_traits<3, Kernel> MyTraits; - -struct Myitem -{ - template - struct Dart_wrapper - { - typedef CGAL::Tag_true Darts_with_id; - typedef CGAL::Cell_attribute_with_point_and_id< Refs > Vertex_attribute; - typedef CGAL::Cell_attribute_with_id< Refs > Face_attribute; - typedef CGAL::cpp11::tuple Attributes; - }; -}; - -typedef CGAL::Linear_cell_complex_for_combinatorial_map<2, 3, MyTraits, Myitem> LCC; +typedef CGAL::Linear_cell_complex_for_bgl_combinatorial_map<2, 3, MyTraits> LCC; typedef boost::graph_traits< LCC > Traits; typedef Traits::edge_descriptor edge_descriptor; diff --git a/BGL/test/BGL/test_Prefix.h b/BGL/test/BGL/test_Prefix.h index c16a3ecbca9..7599c7080fc 100644 --- a/BGL/test/BGL/test_Prefix.h +++ b/BGL/test/BGL/test_Prefix.h @@ -15,9 +15,7 @@ #include -#include -#include -#include +#include #include #include @@ -40,20 +38,7 @@ typedef Kernel::Triangle_3 Triangle_3; typedef Kernel::Iso_cuboid_3 Iso_cuboid_3; typedef CGAL::Linear_cell_complex_traits<3, Kernel> MyTraits; - -struct Myitem -{ - template - struct Dart_wrapper - { - typedef CGAL::Tag_true Darts_with_id; - typedef CGAL::Cell_attribute_with_point_and_id< Refs > Vertex_attribute; - typedef CGAL::Cell_attribute_with_id< Refs > Face_attribute; - typedef CGAL::cpp11::tuple Attributes; - }; -}; - -typedef CGAL::Linear_cell_complex_for_combinatorial_map<2, 3, MyTraits, Myitem> LCC; +typedef CGAL::Linear_cell_complex_for_bgl_combinatorial_map<2, 3, MyTraits> LCC; #ifdef CGAL_USE_SURFACE_MESH @@ -147,7 +132,7 @@ bool read_a_mesh(LCC& lcc, const std::string& str) { bool success = in.good(); if(success) { - CGAL::load_off_v2(lcc, in); + CGAL::load_off_for_bgl(lcc, in); assert(lcc.is_valid()); } return success; diff --git a/Combinatorial_map/include/CGAL/Dart.h b/Combinatorial_map/include/CGAL/Dart.h index 4098cca4c16..557cd2c7c83 100644 --- a/Combinatorial_map/include/CGAL/Dart.h +++ b/Combinatorial_map/include/CGAL/Dart.h @@ -23,6 +23,7 @@ #include #include #include +#include namespace CGAL { diff --git a/Convex_hull_3/examples/Convex_hull_3/dynamic_hull_LCC_3.cpp b/Convex_hull_3/examples/Convex_hull_3/dynamic_hull_LCC_3.cpp index c5dfe5aceba..885f78830c3 100644 --- a/Convex_hull_3/examples/Convex_hull_3/dynamic_hull_LCC_3.cpp +++ b/Convex_hull_3/examples/Convex_hull_3/dynamic_hull_LCC_3.cpp @@ -3,28 +3,16 @@ #include #include #include -#include #include +#include #include typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef K::Point_3 Point_3; typedef CGAL::Delaunay_triangulation_3 Delaunay; typedef Delaunay::Vertex_handle Vertex_handle; - -typedef CGAL::Linear_cell_complex_traits<3, K> MyTraits; -struct Myitem -{ - template - struct Dart_wrapper - { - typedef CGAL::Tag_true Darts_with_id; - typedef CGAL::Cell_attribute_with_point_and_id< Refs > Vertex_attribute; - typedef CGAL::Cell_attribute_with_id< Refs > Face_attribute; - typedef CGAL::cpp11::tuple Attributes; - }; -}; -typedef CGAL::Linear_cell_complex_for_combinatorial_map<2, 3, MyTraits, Myitem> LCC; +typedef CGAL::Linear_cell_complex_traits<3, K> MyTraits; +typedef CGAL::Linear_cell_complex_for_bgl_combinatorial_map<2, 3, MyTraits> LCC; int main() { diff --git a/Linear_cell_complex/include/CGAL/Linear_cell_complex_for_bgl_combinatorial_map.h b/Linear_cell_complex/include/CGAL/Linear_cell_complex_for_bgl_combinatorial_map.h new file mode 100644 index 00000000000..78dd0f712c0 --- /dev/null +++ b/Linear_cell_complex/include/CGAL/Linear_cell_complex_for_bgl_combinatorial_map.h @@ -0,0 +1,162 @@ +// Copyright (c) 2017 CNRS and LIRIS' Establishments (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) : Guillaume Damiand +// +#ifndef CGAL_LINEAR_CELL_COMPLEX_FOR_BGL_COMBINATORIAL_MAP_H +#define CGAL_LINEAR_CELL_COMPLEX_FOR_BGL_COMBINATORIAL_MAP_H 1 + +#include +#include +#include +#include + +namespace CGAL { + + /** @file Linear_cell_complex_for_bgl_combinatorial_map.h + * Definition of a linear cell complex based on combinatorial map, to use with BGL. + * This cmap has points associated to all vertices and faces enables. Moreover + * these cells have id. + */ + + struct Linear_cell_complex_bgl_min_items + { + /// Dart_wrapper defines the type of darts used. + template + struct Dart_wrapper + { + typedef CGAL::Tag_true Darts_with_id; + typedef CGAL::Cell_attribute_with_point_and_id Vertex_attribute; + typedef CGAL::Cell_attribute_with_id Face_attribute; + typedef CGAL::cpp11::tuple Attributes; + }; + }; + + // Linear_cell_complex_for_bgl_combinatorial_map class. + template < unsigned int d_, unsigned int ambient_dim = d_, + class Traits_ = Linear_cell_complex_traits, + class Items_ = Linear_cell_complex_bgl_min_items, + class Alloc_ = CGAL_ALLOCATOR(int), + template + class CMap = Combinatorial_map_base, + class Storage_ = CMap_linear_cell_complex_storage_1 > + class Linear_cell_complex_for_bgl_combinatorial_map: + public Linear_cell_complex_for_combinatorial_map + + { + public: + typedef Linear_cell_complex_for_bgl_combinatorial_map Self; + + typedef Linear_cell_complex_for_combinatorial_map Base; + + typedef Traits_ Traits; + typedef Items_ Items; + typedef Alloc_ Alloc; + + static const unsigned int ambient_dimension = Base::ambient_dimension; + static const unsigned int dimension = Base::dimension; + + typedef typename Base::Dart_handle Dart_handle; + typedef typename Base::Dart_const_handle Dart_const_handle; + typedef typename Base::Helper Helper; + + typedef typename Base::Point Point; + typedef typename Base::Vector Vector; + typedef typename Base::FT FT; + + typedef typename Base::Dart_range Dart_range; + + typedef typename Base::template Attribute_type<0>::type Vertex_attribute; + typedef typename Base::template Attribute_handle<0>::type + Vertex_attribute_handle; + typedef typename Base::template Attribute_const_handle<0>::type + Vertex_attribute_const_handle; + + typedef typename Base::template Attribute_range<0>::type + Vertex_attribute_range; + typedef typename Base::template Attribute_const_range<0>::type + Vertex_attribute_const_range; + + typedef typename Base::template Attribute_type<2>::type Face_attribute; + typedef typename Base::template Attribute_handle<2>::type + Face_attribute_handle; + typedef typename Base::template Attribute_const_handle<2>::type + Face_attribute_const_handle; + + typedef typename Base::template Attribute_range<2>::type + Face_attribute_range; + typedef typename Base::template Attribute_const_range<2>::type + Face_attribute_const_range; + + typedef typename Base::size_type size_type; + + typedef typename Base::Use_index Use_index; + typedef typename Base::Storage Storage; + typedef typename Base::Exception_no_more_available_mark + Exception_no_more_available_mark; + + Linear_cell_complex_for_bgl_combinatorial_map() : Base() + {} + + /** Copy the given linear cell complex into *this. + * Note that both LCC can have different dimensions and/or non void attributes. + * @param alcc the linear cell complex to copy. + * @post *this is valid. + */ + Linear_cell_complex_for_bgl_combinatorial_map(const Self& alcc) : Base(alcc) + {} + + template < class LCC2 > + Linear_cell_complex_for_bgl_combinatorial_map(const LCC2& alcc) : Base(alcc) + {} + + template < class LCC2, typename Converters > + Linear_cell_complex_for_bgl_combinatorial_map(const LCC2& alcc, + Converters& converters) : + Base(alcc, converters) + {} + + template < class LCC2, typename Converters, typename DartInfoConverter > + Linear_cell_complex_for_bgl_combinatorial_map(const LCC2& alcc, + Converters& converters, + const DartInfoConverter& + dartinfoconverter) : + Base(alcc, converters, dartinfoconverter) + {} + + template < class LCC2, typename Converters, typename DartInfoConverter, + typename PointConverter > + Linear_cell_complex_for_bgl_combinatorial_map(const LCC2& alcc, + Converters& converters, + const DartInfoConverter& + dartinfoconverter, + const PointConverter& + pointconverter) : + Base(alcc, converters, dartinfoconverter, pointconverter) + {} + + }; + +} // namespace CGAL + +#endif // CGAL_LINEAR_CELL_COMPLEX_FOR_BGL_COMBINATORIAL_MAP_H // +// EOF // diff --git a/Linear_cell_complex/include/CGAL/Linear_cell_complex_incremental_builder_v2.h b/Linear_cell_complex/include/CGAL/Linear_cell_complex_incremental_builder_for_bgl.h similarity index 89% rename from Linear_cell_complex/include/CGAL/Linear_cell_complex_incremental_builder_v2.h rename to Linear_cell_complex/include/CGAL/Linear_cell_complex_incremental_builder_for_bgl.h index b74523a476b..eeabd190e7f 100644 --- a/Linear_cell_complex/include/CGAL/Linear_cell_complex_incremental_builder_v2.h +++ b/Linear_cell_complex/include/CGAL/Linear_cell_complex_incremental_builder_for_bgl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 CNRS and LIRIS' Establishments (France). +// Copyright (c) 2017 CNRS and LIRIS' Establishments (France). // All rights reserved. // // This file is part of CGAL (www.cgal.org); you can redistribute it and/or @@ -17,10 +17,10 @@ // // Author(s) : Guillaume Damiand // -#ifndef CGAL_LINEAR_CELL_COMPLEX_INCREMENTAL_BUILDER_V2_H -#define CGAL_LINEAR_CELL_COMPLEX_INCREMENTAL_BUILDER_V2_H 1 +#ifndef CGAL_LINEAR_CELL_COMPLEX_INCREMENTAL_BUILDER_FOR_BGL_H +#define CGAL_LINEAR_CELL_COMPLEX_INCREMENTAL_BUILDER_FOR_BGL_H 1 -#include +#include #include #include #include @@ -35,7 +35,7 @@ namespace CGAL { * associated with faces, non existing dart having no 2-attribute associated. */ template < class LCC_ > - class Linear_cell_complex_incremental_builder_3_v2 + class Linear_cell_complex_incremental_builder_for_bgl { public: typedef LCC_ LCC; @@ -44,11 +44,11 @@ namespace CGAL { typedef typename LCC::Point Point_3; typedef typename LCC::size_type size_type; - Linear_cell_complex_incremental_builder_3_v2(LCC & alcc) : + Linear_cell_complex_incremental_builder_for_bgl(LCC & alcc) : lcc(alcc) {} - Vertex_attribute_handle add_vertex (const Point_3& p) + Vertex_attribute_handle add_vertex(const Point_3& p) { Vertex_attribute_handle res = lcc.create_vertex_attribute(p); vertex_map.push_back(res); @@ -162,8 +162,6 @@ namespace CGAL { assert(lcc.template is_free<0>(lcc.template beta<2>(other))); lcc.basic_link_beta_1(it, lcc.template beta<2>(other)); - // For BGL halfedge graph, darts of border vertices must be border darts. -// NOT NEEDED ?? lcc.template set_dart_of_attribute<0>(lcc.vertex_attribute(it), it); ++nb; } } @@ -218,15 +216,15 @@ namespace CGAL { typename LCC::template Attribute_handle<2>::type face_attrib; }; - template < class LCC > - void load_off_v2(LCC& alcc, std::istream& in) + template + void load_off_for_bgl(LCC& alcc, std::istream& in) { File_header_OFF m_file_header; File_scanner_OFF scanner( in, m_file_header.verbose()); if ( ! in) return; m_file_header = scanner; // Remember file header after return. - Linear_cell_complex_incremental_builder_3_v2 B( alcc); + Linear_cell_complex_incremental_builder_for_bgl B( alcc); B.begin_surface( scanner.size_of_vertices(), scanner.size_of_facets(), scanner.size_of_halfedges()); @@ -299,14 +297,29 @@ namespace CGAL { } template - void load_off_v2(LCC& alcc, const char* filename) + void load_off_for_bgl(LCC& alcc, const char* filename) { std::ifstream input(filename); if (input.is_open()) - load_off_v2(alcc, input); + load_off_for_bgl(alcc, input); } + + template < class LCC > + void write_off_for_bgl(LCC& alcc, std::ostream& out) + { + // TODO (pehraps add a selector in the generic write_off function ? + write_off(alcc, out); + } + + template < class LCC > + void write_off_for_bgl(LCC& alcc, const char* filename) + { + // TODO (pehraps add a selector in the generic write_off function ? + write_off(alcc, filename); + } + } //namespace CGAL -#endif // CGAL_LINEAR_CELL_COMPLEX_INCREMENTAL_BUILDER_V2_H // +#endif // CGAL_LINEAR_CELL_COMPLEX_INCREMENTAL_BUILDER_FOR_BGL_H // // EOF // diff --git a/Linear_cell_complex/include/CGAL/boost/graph/graph_traits_Linear_cell_complex.h b/Linear_cell_complex/include/CGAL/boost/graph/graph_traits_Linear_cell_complex.h index 36106f0d5f9..246da592f8a 100644 --- a/Linear_cell_complex/include/CGAL/boost/graph/graph_traits_Linear_cell_complex.h +++ b/Linear_cell_complex/include/CGAL/boost/graph/graph_traits_Linear_cell_complex.h @@ -31,28 +31,30 @@ #include #include -#include +#include +#include #include + #include #include -#define CGAL_LCC_TEMPLATE_ARGS template < unsigned int d_, unsigned int ambient_dim, \ - class Traits_, \ - class Items_, \ - class Alloc_, \ - template \ - class LCC, \ - class Storage_> -#define CGAL_LCC_TEMPLATE_ARGS_NOTEND template < unsigned int d_, unsigned int ambient_dim, \ - class Traits_, \ - class Items_, \ - class Alloc_, \ - template \ - class LCC, \ - class Storage_, +#define CGAL_LCC_TEMPLATE_ARGS template \ + class CMap, \ + class Storage_> +#define CGAL_LCC_TEMPLATE_ARGS_NOTEND template \ + class CMap, \ + class Storage_, -#define CGAL_LCC_TYPE CGAL::Linear_cell_complex_for_combinatorial_map \ - +#define CGAL_LCC_TYPE CGAL::Linear_cell_complex_for_bgl_combinatorial_map \ + namespace CGAL { diff --git a/Linear_cell_complex/include/CGAL/boost/graph/properties_Linear_cell_complex.h b/Linear_cell_complex/include/CGAL/boost/graph/properties_Linear_cell_complex.h index 6d36b6d6c52..61d85c770d1 100644 --- a/Linear_cell_complex/include/CGAL/boost/graph/properties_Linear_cell_complex.h +++ b/Linear_cell_complex/include/CGAL/boost/graph/properties_Linear_cell_complex.h @@ -21,7 +21,7 @@ #define CGAL_BOOST_GRAPH_PROPERTIES_LINEAR_CELL_COMPLEX_H #include -#include +#include #include #include @@ -29,7 +29,7 @@ class Traits_, \ class Items_, \ class Alloc_, \ - template \ + template \ class CMap, \ class Storage_ @@ -40,7 +40,7 @@ CMap, \ Storage_ -#define CGAL_LCC_TYPE CGAL::Linear_cell_complex_for_combinatorial_map\ +#define CGAL_LCC_TYPE CGAL::Linear_cell_complex_for_bgl_combinatorial_map\ namespace CGAL { diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_LCC.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_LCC.cpp index e34b4e0ad71..447ae597dff 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_LCC.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_LCC.cpp @@ -1,8 +1,5 @@ #include -#include #include -#include -#include #include @@ -10,20 +7,8 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; typedef Kernel::Point_3 Point; - typedef CGAL::Linear_cell_complex_traits<3, Kernel> MyTraits; -struct Myitem -{ - template - struct Dart_wrapper - { - typedef CGAL::Tag_true Darts_with_id; - typedef CGAL::Cell_attribute_with_point_and_id< Refs > Vertex_attribute; - typedef CGAL::Cell_attribute_with_id< Refs > Face_attribute; - typedef CGAL::cpp11::tuple Attributes; - }; -}; -typedef CGAL::Linear_cell_complex_for_combinatorial_map<2, 3, MyTraits, Myitem> LCC; +typedef CGAL::Linear_cell_complex_for_bgl_combinatorial_map<2, 3, MyTraits> LCC; namespace PMP = CGAL::Polygon_mesh_processing; @@ -34,8 +19,8 @@ int main(int argc, char* argv[]) std::ifstream input(filename1); LCC mesh1, mesh2; - CGAL::load_off_v2(mesh1, filename1); - CGAL::load_off_v2(mesh2, filename2); + CGAL::load_off_for_bgl(mesh1, filename1); + CGAL::load_off_for_bgl(mesh2, filename2); std::cout << "Number of vertices before corefinement " << num_vertices(mesh1) << " and " @@ -48,10 +33,10 @@ int main(int argc, char* argv[]) << num_vertices(mesh2) << "\n"; std::ofstream output("mesh1_refined.off"); - CGAL::write_off(mesh1, output); + CGAL::write_off_for_bgl(mesh1, output); output.close(); output.open("mesh2_refined.off"); - CGAL::write_off(mesh2, output); + CGAL::write_off_for_bgl(mesh2, output); output.close(); return 0; diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/hole_filling_example_LCC.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/hole_filling_example_LCC.cpp index 4f9a2a3f1a0..a0d2a5d880c 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/hole_filling_example_LCC.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/hole_filling_example_LCC.cpp @@ -1,7 +1,5 @@ #include -#include #include -#include #include #include @@ -13,20 +11,8 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; typedef Kernel::Point_3 Point; - typedef CGAL::Linear_cell_complex_traits<3, Kernel> MyTraits; -struct Myitem -{ - template - struct Dart_wrapper - { - typedef CGAL::Tag_true Darts_with_id; - typedef CGAL::Cell_attribute_with_point_and_id< Refs > Vertex_attribute; - typedef CGAL::Cell_attribute_with_id< Refs > Face_attribute; - typedef CGAL::cpp11::tuple Attributes; - }; -}; -typedef CGAL::Linear_cell_complex_for_combinatorial_map<2, 3, MyTraits, Myitem> LCC; +typedef CGAL::Linear_cell_complex_for_bgl_combinatorial_map<2, 3, MyTraits> LCC; typedef boost::graph_traits::halfedge_descriptor halfedge_descriptor; typedef boost::graph_traits::face_descriptor face_descriptor; @@ -37,7 +23,7 @@ int main(int argc, char* argv[]) { const char* filename = (argc > 1) ? argv[1] : "data/mech-holes-shark.off"; LCC mesh; - CGAL::load_off_v2(mesh, filename); + CGAL::load_off_for_bgl(mesh, filename); // Incrementally fill the holes unsigned int nb_holes = 0; @@ -70,7 +56,7 @@ int main(int argc, char* argv[]) std::ofstream out("filled_LCC.off"); out.precision(17); - CGAL::write_off(mesh, out); + CGAL::write_off_for_bgl(mesh, out); return 0; } diff --git a/Ridges_3/examples/Ridges_3/Ridges_Umbilics_LCC.cpp b/Ridges_3/examples/Ridges_3/Ridges_Umbilics_LCC.cpp index 707d379e580..f3e726b2d14 100644 --- a/Ridges_3/examples/Ridges_3/Ridges_Umbilics_LCC.cpp +++ b/Ridges_3/examples/Ridges_3/Ridges_Umbilics_LCC.cpp @@ -1,8 +1,6 @@ #include #include #include -#include -#include #include "PolyhedralSurf_rings.h" #include "compute_normals.h" @@ -22,20 +20,8 @@ typedef CGAL::Simple_cartesian Kernel; typedef Kernel::FT FT; typedef Kernel::Point_3 Point_3; typedef Kernel::Vector_3 Vector_3; - typedef CGAL::Linear_cell_complex_traits<3, Kernel> MyTraits; -struct Myitem -{ - template - struct Dart_wrapper - { - typedef CGAL::Tag_true Darts_with_id; - typedef CGAL::Cell_attribute_with_point_and_id< Refs > Vertex_attribute; - typedef CGAL::Cell_attribute_with_id< Refs > Face_attribute; - typedef CGAL::cpp11::tuple Attributes; - }; -}; -typedef CGAL::Linear_cell_complex_for_combinatorial_map<2, 3, MyTraits, Myitem> LCC; +typedef CGAL::Linear_cell_complex_for_bgl_combinatorial_map<2, 3, MyTraits> LCC; typedef LCC PolyhedralSurf; @@ -299,7 +285,7 @@ int main() //load the model from PolyhedralSurf P; - CGAL::load_off_v2(P, if_name.c_str()); + CGAL::load_off_for_bgl(P, if_name.c_str()); fprintf(stderr, "loadMesh %d Ves %d Facets\n", (int)num_vertices(P), (int)num_faces(P)); if(verbose) diff --git a/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/segmentation_from_sdf_values_LCC_example.cpp b/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/segmentation_from_sdf_values_LCC_example.cpp index dc74b39d2d3..2ceee58985f 100644 --- a/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/segmentation_from_sdf_values_LCC_example.cpp +++ b/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/segmentation_from_sdf_values_LCC_example.cpp @@ -1,6 +1,5 @@ #include #include -#include #include #include @@ -12,27 +11,14 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; typedef CGAL::Linear_cell_complex_traits<3, Kernel> MyTraits; - -struct Myitem -{ - template - struct Dart_wrapper - { - typedef CGAL::Tag_true Darts_with_id; - typedef CGAL::Cell_attribute_with_point_and_id< Refs > Vertex_attribute; - typedef CGAL::Cell_attribute_with_id< Refs > Face_attribute; - typedef CGAL::cpp11::tuple Attributes; - }; -}; - -typedef CGAL::Linear_cell_complex_for_combinatorial_map<2, 3, MyTraits, Myitem> LCC; +typedef CGAL::Linear_cell_complex_for_bgl_combinatorial_map<2, 3, MyTraits> LCC; typedef typename LCC::Attribute_const_handle<2>::type Facet_const_handle; int main() { // create and read LCC LCC mesh; - CGAL::load_off_v2(mesh, "data/cactus.off"); + CGAL::load_off_for_bgl(mesh, "data/cactus.off"); // create a property-map for SDF values typedef CGAL::Unique_hash_map Facet_double_map; diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_linear_cell_complex.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_linear_cell_complex.cpp index 91cc3d076c9..9f9398d8d8c 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_linear_cell_complex.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_linear_cell_complex.cpp @@ -1,8 +1,5 @@ #include #include -#include -#include -#include #include // Simplification function #include @@ -13,20 +10,7 @@ typedef CGAL::Simple_cartesian Kernel; typedef CGAL::Linear_cell_complex_traits<3, Kernel> MyTraits; - -struct Myitem -{ - template - struct Dart_wrapper - { - typedef CGAL::Tag_true Darts_with_id; - typedef CGAL::Cell_attribute_with_point_and_id< Refs > Vertex_attribute; - typedef CGAL::Cell_attribute_with_id< Refs > Face_attribute; - typedef CGAL::cpp11::tuple Attributes; - }; -}; - -typedef CGAL::Linear_cell_complex_for_combinatorial_map<2, 3, MyTraits, Myitem> LCC; +typedef CGAL::Linear_cell_complex_for_bgl_combinatorial_map<2, 3, MyTraits> LCC; namespace SMS = CGAL::Surface_mesh_simplification ; int main( int argc, char** argv ) @@ -39,7 +23,7 @@ int main( int argc, char** argv ) LCC lcc; std::ifstream is(argv[1]); - CGAL::load_off_v2(lcc, is); + CGAL::load_off_for_bgl(lcc, is); lcc.display_characteristics(std::cout)<<", is_valid="< 2 ? argv[2] : "out.off")); return EXIT_SUCCESS; } // EOF // diff --git a/Surface_mesh_skeletonization/examples/Surface_mesh_skeletonization/MCF_Skeleton_LCC_example.cpp b/Surface_mesh_skeletonization/examples/Surface_mesh_skeletonization/MCF_Skeleton_LCC_example.cpp index 070d52102e6..f5de6ab41ea 100644 --- a/Surface_mesh_skeletonization/examples/Surface_mesh_skeletonization/MCF_Skeleton_LCC_example.cpp +++ b/Surface_mesh_skeletonization/examples/Surface_mesh_skeletonization/MCF_Skeleton_LCC_example.cpp @@ -1,5 +1,4 @@ #include -#include #include #include #include @@ -8,22 +7,8 @@ typedef CGAL::Simple_cartesian Kernel; typedef Kernel::Point_3 Point; - -typedef CGAL::Linear_cell_complex_traits<3, Kernel> MyTraits; - -struct Myitem -{ - template - struct Dart_wrapper - { - typedef CGAL::Tag_true Darts_with_id; - typedef CGAL::Cell_attribute_with_point_and_id< Refs > Vertex_attribute; - typedef CGAL::Cell_attribute_with_id< Refs > Face_attribute; - typedef CGAL::cpp11::tuple Attributes; - }; -}; - -typedef CGAL::Linear_cell_complex_for_combinatorial_map<2, 3, MyTraits, Myitem> LCC; +typedef CGAL::Linear_cell_complex_traits<3, Kernel> MyTraits; +typedef CGAL::Linear_cell_complex_for_bgl_combinatorial_map<2, 3, MyTraits> LCC; typedef boost::graph_traits::vertex_descriptor vertex_descriptor; typedef CGAL::Mean_curvature_flow_skeletonization Skeletonization; @@ -36,7 +21,7 @@ typedef Skeleton::edge_descriptor Skeleton_edge; int main(int argc, char* argv[]) { LCC lcc; - CGAL::load_off_v2(lcc, "data/elephant.off"); + CGAL::load_off_for_bgl(lcc, "data/elephant.off"); Skeleton skeleton; Skeletonization mcs(lcc); diff --git a/Surface_mesh_skeletonization/examples/Surface_mesh_skeletonization/simple_mcfskel_LCC_example.cpp b/Surface_mesh_skeletonization/examples/Surface_mesh_skeletonization/simple_mcfskel_LCC_example.cpp index fd5be7360d6..099991e4f79 100644 --- a/Surface_mesh_skeletonization/examples/Surface_mesh_skeletonization/simple_mcfskel_LCC_example.cpp +++ b/Surface_mesh_skeletonization/examples/Surface_mesh_skeletonization/simple_mcfskel_LCC_example.cpp @@ -1,6 +1,4 @@ #include -#include -#include #include #include #include @@ -11,21 +9,8 @@ typedef CGAL::Simple_cartesian Kernel; typedef Kernel::Point_3 Point; -typedef CGAL::Linear_cell_complex_traits<3, Kernel> MyTraits; - -struct Myitem -{ - template - struct Dart_wrapper - { - typedef CGAL::Tag_true Darts_with_id; - typedef CGAL::Cell_attribute_with_point_and_id< Refs > Vertex_attribute; - typedef CGAL::Cell_attribute_with_id< Refs > Face_attribute; - typedef CGAL::cpp11::tuple Attributes; - }; -}; - -typedef CGAL::Linear_cell_complex_for_combinatorial_map<2, 3, MyTraits, Myitem> LCC; +typedef CGAL::Linear_cell_complex_traits<3, Kernel> MyTraits; +typedef CGAL::Linear_cell_complex_for_bgl_combinatorial_map<2, 3, MyTraits> LCC; typedef boost::graph_traits::vertex_descriptor vertex_descriptor; @@ -65,7 +50,7 @@ struct Display_polylines{ int main(int argc, char* argv[]) { LCC lcc; - CGAL::load_off_v2(lcc, "data/elephant.off"); + CGAL::load_off_for_bgl(lcc, "data/elephant.off"); Skeleton skeleton;