diff --git a/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h b/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h index da5c6846a5a..57436a47d97 100644 --- a/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h +++ b/Mesh_3/doc/Mesh_3/Concepts/InitialPointsGenerator.h @@ -25,11 +25,14 @@ public: /*! Output a set of (`n`) surface points to the -output iterator `pts`, as objects of type `std::pair`. +output iterator `pts`, as objects of type +`std::tuple` where +`Point_3` is the point's position, +`int` is the point's dimension and +`Index` is the point's index. @tparam OutputIterator an `OutputIterator` of points of type -`std::pair` +`std::tuple` @tparam MeshDomain a model of `MeshDomain_3` @tparam C3t3 a model of `MeshComplex_3InTriangulation_3` @@ -39,12 +42,16 @@ OutputIterator operator()(OutputIterator pts, const MeshDomain& domain, const C3 /*! Output a set of surface points to the -output iterator `pts`, as objects of type `std::pair`. As `n` is not given, the functor must provide enough +output iterator `pts`, as objects of type +`std::tuple` where +`Point_3` is the point's position, +`int` is the point's dimension and +`Index` is the point's index. +As `n` is not given, the functor must provide enough points to initialize the mesh generation process. @tparam OutputIterator an `OutputIterator` of points of type -`std::pair` +`std::tuple` @tparam MeshDomain a model of `MeshDomain_3` @tparam C3t3 a model of `MeshComplex_3InTriangulation_3` diff --git a/Mesh_3/doc/Mesh_3/Mesh_3.txt b/Mesh_3/doc/Mesh_3/Mesh_3.txt index 7a0eae088a7..c401a91d2a1 100644 --- a/Mesh_3/doc/Mesh_3/Mesh_3.txt +++ b/Mesh_3/doc/Mesh_3/Mesh_3.txt @@ -819,7 +819,7 @@ points in the `%c3t3` object, with the calls to `MeshVertexBase_3::set_dimension()` and `MeshVertexBase_3::set_index()`. -\snippet CGAL/Mesh_3/mesh_3D_image_with_custom_initialization.cpp insert initial points +\snippet Mesh_3/mesh_3D_image_with_custom_initialization.cpp insert initial points The value of `index` must be consistent with the possible values of `Mesh_domain::Index`. diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_gray_image_with_custom_initialization.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_gray_image_with_custom_initialization.cpp index 1a450497c97..b734240f4cc 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_gray_image_with_custom_initialization.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_gray_image_with_custom_initialization.cpp @@ -47,7 +47,7 @@ void initialize_triangulation_from_gray_image(C3T3& c3t3, typedef typename MeshDomain::Point_3 Point_3; typedef typename MeshDomain::Index Index; - typedef typename std::pair ConstructedPoint; + typedef typename std::tuple ConstructedPoint; Tr& tr = c3t3.triangulation(); @@ -63,8 +63,9 @@ void initialize_triangulation_from_gray_image(C3T3& c3t3, for (const ConstructedPoint & constructedPoint : constructedPoints) { - const Point_3& point = constructedPoint.first; - const Index& index = constructedPoint.second; + const Point_3& point = std::get<0>(constructedPoint); + const int& dimension = std::get<1>(constructedPoint); + const Index& index = std::get<2>(constructedPoint); Weighted_point pi = cwp(point); @@ -73,7 +74,7 @@ void initialize_triangulation_from_gray_image(C3T3& c3t3, Vertex_handle v = tr.insert(pi); // `v` could be null if `pi` is hidden by other vertices of `tr`. CGAL_assertion(v != Vertex_handle()); - c3t3.set_dimension(v, 2); // by construction, points are on surface + c3t3.set_dimension(v, dimension); c3t3.set_index(v, index); /// [insert initial points] } diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp index 9a0675d80f6..feff42b26b3 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_image_with_custom_initialization.cpp @@ -45,7 +45,7 @@ void initialize_triangulation_from_labeled_image(C3T3& c3t3, typedef typename MeshDomain::Point_3 Point_3; typedef typename MeshDomain::Index Index; - typedef typename std::pair ConstructedPoint; + typedef typename std::tuple ConstructedPoint; Tr& tr = c3t3.triangulation(); @@ -61,8 +61,9 @@ void initialize_triangulation_from_labeled_image(C3T3& c3t3, for (const ConstructedPoint & constructedPoint : constructedPoints) { - const Point_3& point = constructedPoint.first; - const Index& index = constructedPoint.second; + const Point_3& point = std::get<0>(constructedPoint); + const int& dimension = std::get<1>(constructedPoint); + const Index& index = std::get<2>(constructedPoint); Weighted_point pi = cwp(point); @@ -71,7 +72,7 @@ void initialize_triangulation_from_labeled_image(C3T3& c3t3, Vertex_handle v = tr.insert(pi); // `v` could be null if `pi` is hidden by other vertices of `tr`. CGAL_assertion(v != Vertex_handle()); - c3t3.set_dimension(v, 2); // by construction, points are on surface + c3t3.set_dimension(v, dimension); c3t3.set_index(v, index); /// [insert initial points] } diff --git a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h index 5eb0f51797d..2095596d0a0 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_gray_image.h @@ -1,4 +1,4 @@ -// Copyright (c) 20XX,20XX GeometryFactory +// Copyright (c) 2015,2016 GeometryFactory // All rights reserved. // // This file is part of CGAL (www.cgal.org). @@ -8,7 +8,7 @@ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // -// Author(s) : Laurent Rineau and Ange Clement +// Author(s) : Laurent Rineau, Jane Tournois and Ange Clement #ifndef CGAL_MESH_3_CONSTRUCT_INITIAL_POINTS_GRAY_IMAGE_H #define CGAL_MESH_3_CONSTRUCT_INITIAL_POINTS_GRAY_IMAGE_H @@ -54,7 +54,7 @@ struct Construct_initial_points_gray_image * \brief Constructs the initial points using the gray image. * * @tparam OutputIterator an `OutputIterator` of points of type - * `std::pair` + * `std::tuple` * @tparam MeshDomain a model of `MeshDomain_3` * @tparam C3t3 a model of `MeshComplex_3InTriangulation_3` */ diff --git a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h index 50008701379..1c277dc9f83 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h +++ b/Mesh_3/include/CGAL/Mesh_3/Construct_initial_points_labeled_image.h @@ -1,4 +1,4 @@ -// Copyright (c) 20XX,20XX GeometryFactory +// Copyright (c) 2015,2016 GeometryFactory // All rights reserved. // // This file is part of CGAL (www.cgal.org). @@ -102,7 +102,7 @@ struct Construct_initial_points_labeled_image * \snippet this get construct intersection * * @tparam OutputIterator an `OutputIterator` of points of type - * `std::pair` + * `std::tuple` * @tparam MeshDomain a model of `MeshDomain_3` * @tparam C3t3 a model of `MeshComplex_3InTriangulation_3` */ @@ -117,7 +117,7 @@ struct Construct_initial_points_labeled_image * \brief Same as above, but a `TransformOperator` is used * * @tparam OutputIterator an `OutputIterator` of points of type - * `std::pair` + * `std::tuple` * @tparam MeshDomain a model of `MeshDomain_3` * @tparam TransformOperator a functor to transform values of the image. * It must provides the following type:
@@ -293,7 +293,7 @@ struct Construct_initial_points_labeled_image if (pi_inside_protecting_sphere) continue; - *pts++ = std::make_pair(intersect_point, intersect_index); + *pts++ = std::make_tuple(intersect_point, 2, intersect_index); // dimension 2 by construction, points are on surface } } } diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index 46e6f4332c3..870cac12820 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -46,7 +46,7 @@ init_c3t3(C3T3& c3t3, const MeshDomain& domain, const MeshCriteria&, { typedef typename MeshDomain::Point_3 Point_3; typedef typename MeshDomain::Index Index; - typedef std::vector > Initial_points_vector; + typedef std::vector > Initial_points_vector; typedef typename Initial_points_vector::iterator Ipv_iterator; typedef typename C3T3::Vertex_handle Vertex_handle; @@ -66,13 +66,13 @@ init_c3t3(C3T3& c3t3, const MeshDomain& domain, const MeshCriteria&, it != initial_points.end() ; ++it ) { - Vertex_handle v = c3t3.triangulation().insert(cwp(it->first)); + Vertex_handle v = c3t3.triangulation().insert(cwp(std::get<0>(*it))); // v could be null if point is hidden if ( v != Vertex_handle() ) { - c3t3.set_dimension(v,2); // by construction, points are on surface - c3t3.set_index(v,it->second); + c3t3.set_dimension(v,std::get<1>(*it)); + c3t3.set_index(v,std::get<2>(*it)); } } } @@ -523,7 +523,7 @@ void make_mesh_3_impl(C3T3& c3t3, C3T3, MeshDomain, MeshCriteria, - ::CGAL::internal::has_Has_features::value >() (c3t3, + ::CGAL::internal::has_Has_features::value > () (c3t3, domain, criteria, with_features, diff --git a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h index b6f54fe35d4..7433f419ff9 100644 --- a/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h +++ b/STL_Extension/include/CGAL/STL_Extension/internal/mesh_option_classes.h @@ -193,7 +193,7 @@ struct Initial_points_generator_options_holder template struct Initial_points_generator_options { - typedef typename std::back_insert_iterator>> OutputIterator; + typedef typename std::back_insert_iterator>> OutputIterator; template Initial_points_generator_options(const Initial_points_generator& generator) @@ -263,7 +263,7 @@ struct Domain_features_generator< MeshDomain, true > template struct Initial_points_generator_generator { - typedef typename std::back_insert_iterator>> OutputIterator; + typedef typename std::back_insert_iterator>> OutputIterator; typedef typename CGAL::parameters::internal::Initial_points_generator_options Initial_points_generator_options;