From 853bd3ceedf5a28d6aedee444f601e91989ff2ff Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Wed, 16 May 2018 13:34:59 +0200 Subject: [PATCH 01/18] Add a step to check_headers that tries to build a dummy cpp with all the checked headers. --- Installation/CMakeLists.txt | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index d5173fdf76b..2a88f9b2d15 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -1270,6 +1270,7 @@ LEDA_FOUND is false.") endif() endif() if(NOT skip_hdr) + LIST( APPEND list_of_headers_to_test ${header}) string(REPLACE "/" "__" header2 "${header}") string(REPLACE "." "_" header2 "${header2}") string(REPLACE ";" " " include_options_str "${include_options}") @@ -1324,7 +1325,26 @@ ${CMAKE_CURRENT_SOURCE_DIR}/../${package}/include/${header}" list(REMOVE_DUPLICATES packages_deps) endif() endforeach() # loop on packages - add_custom_target(check_headers DEPENDS ${check_pkg_target_list}) + + #Now check that a cpp file including all documented headers compiles + file(WRITE ${CGAL_BINARY_DIR}/test_headers.cpp "#define BOOST_PARAMETER_MAX_ARITY 12 \n") + foreach(header ${list_of_headers_to_test}) + file(APPEND ${CGAL_BINARY_DIR}/test_headers.cpp "#include <${header}>\n") + endforeach() #loop on headers to include in test file + file(APPEND ${CGAL_BINARY_DIR}/test_headers.cpp "int main(){}\n") + + add_custom_target(check_headers + DEPENDS ${check_pkg_target_list}) + + string(REPLACE " " ";" compile_options ${compile_options}) + string(REPLACE " " ";" include_options ${include_options_str}) + add_custom_command(TARGET check_headers + POST_BUILD + COMMAND ${CMAKE_CXX_COMPILER} + ${compile_options} ${include_options} + -x c++ -fsyntax-only ${CGAL_BINARY_DIR}/test_headers.cpp + ) + add_custom_target(packages_dependencies DEPENDS ${packages_deps}) message( " \n\ You can now check the headers with the target `check_headers`\n\ From c15306df4c753caa1cd2ee5cc73851eaef3f3866 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 16 May 2018 15:09:16 +0100 Subject: [PATCH 02/18] Put duplicated functors in an extra file --- .../CGAL/Polyhedral_complex_mesh_domain_3.h | 152 +------------- .../Polyhedral_mesh_domain_with_features_3.h | 128 +----------- Mesh_3/include/CGAL/internal/Mesh_3/helpers.h | 193 ++++++++++++++++++ 3 files changed, 196 insertions(+), 277 deletions(-) create mode 100644 Mesh_3/include/CGAL/internal/Mesh_3/helpers.h diff --git a/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h b/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h index 13464bb3317..52e5996cde2 100644 --- a/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h @@ -47,7 +47,7 @@ #include #include #include - +#include #include #include @@ -57,156 +57,6 @@ namespace CGAL { -/// @cond DEVELOPERS -namespace internal { -namespace Mesh_3 { - -template -void dump_graph_edges(std::ostream& out, const Graph& g) -{ - typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; - typedef typename boost::graph_traits::edge_descriptor edge_descriptor; - - out.precision(17); - BOOST_FOREACH(edge_descriptor e, edges(g)) - { - vertex_descriptor s = source(e, g); - vertex_descriptor t = target(e, g); - out << "2 " << g[s] << " " << g[t] << "\n"; - } -} - -template -void dump_graph_edges(const char* filename, const Graph& g) -{ - std::ofstream out(filename); - dump_graph_edges(out, g); -} - -template -struct Angle_tester -{ - template - bool operator()(vertex_descriptor& v, const Graph& g) const - { - typedef typename boost::graph_traits::out_edge_iterator out_edge_iterator; - if (out_degree(v, g) != 2) - return true; - else - { - out_edge_iterator out_edge_it, out_edges_end; - boost::tie(out_edge_it, out_edges_end) = out_edges(v, g); - - vertex_descriptor v1 = target(*out_edge_it++, g); - vertex_descriptor v2 = target(*out_edge_it++, g); - CGAL_assertion(out_edge_it == out_edges_end); - - const typename Kernel::Point_3& p = g[v]; - const typename Kernel::Point_3& p1 = g[v1]; - const typename Kernel::Point_3& p2 = g[v2]; - - return (CGAL::angle(p1, p, p2) == CGAL::ACUTE); - } - } -}; - -template -struct Is_featured_edge { - const Polyhedron* polyhedron; - typename boost::property_map::type eifm; - Is_featured_edge() - : polyhedron(0) - {} // required by boost::filtered_graph - - Is_featured_edge(const Polyhedron& polyhedron) - : polyhedron(&polyhedron), eifm(get(edge_is_feature,polyhedron)) - {} - - bool operator()(typename boost::graph_traits::edge_descriptor e) const { - return get(eifm, e); - } -}; // end Is_featured_edge - -template -struct Is_border_edge { - const Polyhedron* polyhedron; - Is_border_edge() : polyhedron(0) {} // required by boost::filtered_graph - Is_border_edge(const Polyhedron& polyhedron) : polyhedron(&polyhedron) {} - - bool operator()(typename boost::graph_traits::edge_descriptor e) const { - return is_border(halfedge(e, *polyhedron), *polyhedron) || - is_border(opposite(halfedge(e, *polyhedron), *polyhedron), *polyhedron); - } -}; // end Is_featured_edge - -template -struct Extract_polyline_with_context_visitor -{ - typedef typename Polyhedral_mesh_domain::Polyhedron_type Polyhedron; - std::vector& polylines; - const Graph& graph; - - Extract_polyline_with_context_visitor - (const Graph& graph, - typename std::vector& polylines) - : polylines(polylines), graph(graph) - {} - - void start_new_polyline() - { - polylines.push_back(Polyline_with_context()); - } - - void add_node(typename boost::graph_traits::vertex_descriptor vd) - { - if(polylines.back().polyline_content.empty()) { - polylines.back().polyline_content.push_back(graph[vd]); - } - } - - void add_edge(typename boost::graph_traits::edge_descriptor ed) - { - typename boost::graph_traits::vertex_descriptor - s = source(ed, graph), - t = target(ed, graph); - Polyline_with_context& polyline = polylines.back(); - CGAL_assertion(!polyline.polyline_content.empty()); - if(polyline.polyline_content.back() != graph[s]) { - polyline.polyline_content.push_back(graph[s]); - } else if(polyline.polyline_content.back() != graph[t]) { - // if the edge is zero-length, it is ignored - polyline.polyline_content.push_back(graph[t]); - } - const typename boost::edge_bundle_type::type & - set_of_indices = graph[ed]; - polyline.context.adjacent_patches_ids.insert(set_of_indices.begin(), - set_of_indices.end()); - } - - void end_polyline() - { - // ignore degenerated polylines - if(polylines.back().polyline_content.size() < 2) - polylines.resize(polylines.size() - 1); - // else { - // std::cerr << "Polyline with " << polylines.back().polyline_content.size() - // << " vertices, incident to " - // << polylines.back().context.adjacent_patches_ids.size() - // << " patches:\n "; - // for(auto p: polylines.back().polyline_content) - // std::cerr << " " << p; - // std::cerr << "\n"; - // } - } -}; - - -} // end CGAL::internal::Mesh_3 -} // end CGAL::internal - -/// @endcond /*! \ingroup PkgMesh_3Domains diff --git a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h index ea04c0eb7e4..2240b0f1080 100644 --- a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h @@ -51,6 +51,7 @@ #include #include #include +#include #include #include @@ -62,132 +63,6 @@ namespace CGAL { -namespace internal { -namespace Mesh_3 { - -template -struct Angle_tester -{ - template - bool operator()(vertex_descriptor& v, const Graph& g) const - { - typedef typename boost::graph_traits::out_edge_iterator out_edge_iterator; - if (out_degree(v, g) != 2) - return true; - else - { - out_edge_iterator out_edge_it, out_edges_end; - boost::tie(out_edge_it, out_edges_end) = out_edges(v, g); - - vertex_descriptor v1 = target(*out_edge_it++, g); - vertex_descriptor v2 = target(*out_edge_it++, g); - CGAL_assertion(out_edge_it == out_edges_end); - - const typename Kernel::Point_3& p = g[v]; - const typename Kernel::Point_3& p1 = g[v1]; - const typename Kernel::Point_3& p2 = g[v2]; - - return (CGAL::angle(p1, p, p2) == CGAL::ACUTE); - } - } -}; - -template -struct Is_featured_edge { - const Polyhedron* polyhedron; - typename boost::property_map::type eifm; - Is_featured_edge() - : polyhedron(0) - {} // required by boost::filtered_graph - - Is_featured_edge(const Polyhedron& polyhedron) - : polyhedron(&polyhedron), eifm(get(edge_is_feature,polyhedron)) - {} - - bool operator()(typename boost::graph_traits::edge_descriptor e) const { - return get(eifm, e); - } -}; // end Is_featured_edge - -template -struct Is_border_edge { - const Polyhedron* polyhedron; - Is_border_edge() : polyhedron(0) {} // required by boost::filtered_graph - Is_border_edge(const Polyhedron& polyhedron) : polyhedron(&polyhedron) {} - - bool operator()(typename boost::graph_traits::edge_descriptor e) const { - return is_border(halfedge(e, *polyhedron), *polyhedron) || - is_border(opposite(halfedge(e, *polyhedron), *polyhedron), *polyhedron); - } -}; // end Is_featured_edge - -template -struct Extract_polyline_with_context_visitor -{ - typedef typename Polyhedral_mesh_domain::Polyhedron Polyhedron; - std::vector& polylines; - const Graph& graph; - - Extract_polyline_with_context_visitor - (const Graph& graph, - typename std::vector& polylines) - : polylines(polylines), graph(graph) - {} - - void start_new_polyline() - { - polylines.push_back(Polyline_with_context()); - } - - void add_node(typename boost::graph_traits::vertex_descriptor vd) - { - if(polylines.back().polyline_content.empty()) { - polylines.back().polyline_content.push_back(graph[vd]); - } - } - - void add_edge(typename boost::graph_traits::edge_descriptor ed) - { - typename boost::graph_traits::vertex_descriptor - s = source(ed, graph), - t = target(ed, graph); - Polyline_with_context& polyline = polylines.back(); - CGAL_assertion(!polyline.polyline_content.empty()); - if(polyline.polyline_content.back() != graph[s]) { - polyline.polyline_content.push_back(graph[s]); - } else if(polyline.polyline_content.back() != graph[t]) { - // if the edge is zero-length, it is ignored - polyline.polyline_content.push_back(graph[t]); - } - const typename boost::edge_bundle_type::type & - set_of_indices = graph[ed]; - polyline.context.adjacent_patches_ids.insert(set_of_indices.begin(), - set_of_indices.end()); - } - - void end_polyline() - { - // ignore degenerated polylines - if(polylines.back().polyline_content.size() < 2) - polylines.resize(polylines.size() - 1); - // else { - // std::cerr << "Polyline with " << polylines.back().polyline_content.size() - // << " vertices, incident to " - // << polylines.back().context.adjacent_patches_ids.size() - // << " patches:\n "; - // for(auto p: polylines.back().polyline_content) - // std::cerr << " " << p; - // std::cerr << "\n"; - // } - } -}; - - -} // end CGAL::internal::Mesh_3 -} // end CGAL::internal - /** * @class Polyhedral_mesh_domain_with_features_3 * @@ -219,6 +94,7 @@ class Polyhedral_mesh_domain_with_features_3 std::set > Featured_edges_copy_graph; public: typedef Polyhedron_ Polyhedron; + typedef Polyhedron Polyhedron_type; // Index types typedef typename Base::Index Index; diff --git a/Mesh_3/include/CGAL/internal/Mesh_3/helpers.h b/Mesh_3/include/CGAL/internal/Mesh_3/helpers.h new file mode 100644 index 00000000000..7167b54e406 --- /dev/null +++ b/Mesh_3/include/CGAL/internal/Mesh_3/helpers.h @@ -0,0 +1,193 @@ +// Copyright (c) 2009-2010 INRIA Sophia-Antipolis (France). +// Copyright (c) 2014-2017 GeometryFactory Sarl (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 +// 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$ +// SPDX-License-Identifier: GPL-3.0+ +// +// +// Author(s) : Laurent Rineau, Stéphane Tayeb +// +//****************************************************************************** +// File Description : +// +//****************************************************************************** + +#ifndef CGAL_MESH_3_INTERNAL_MESH_3_HELPERS_H +#define CGAL_MESH_3_INTERNAL_MESH_3_HELPERS_H + +#include + +#include +#include + +namespace CGAL { + +/// @cond DEVELOPERS +namespace internal { +namespace Mesh_3 { + +template +void dump_graph_edges(std::ostream& out, const Graph& g) +{ + typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; + typedef typename boost::graph_traits::edge_descriptor edge_descriptor; + + out.precision(17); + BOOST_FOREACH(edge_descriptor e, edges(g)) + { + vertex_descriptor s = source(e, g); + vertex_descriptor t = target(e, g); + out << "2 " << g[s] << " " << g[t] << "\n"; + } +} + +template +void dump_graph_edges(const char* filename, const Graph& g) +{ + std::ofstream out(filename); + dump_graph_edges(out, g); +} + +template +struct Angle_tester +{ + template + bool operator()(vertex_descriptor& v, const Graph& g) const + { + typedef typename boost::graph_traits::out_edge_iterator out_edge_iterator; + if (out_degree(v, g) != 2) + return true; + else + { + out_edge_iterator out_edge_it, out_edges_end; + boost::tie(out_edge_it, out_edges_end) = out_edges(v, g); + + vertex_descriptor v1 = target(*out_edge_it++, g); + vertex_descriptor v2 = target(*out_edge_it++, g); + CGAL_assertion(out_edge_it == out_edges_end); + + const typename Kernel::Point_3& p = g[v]; + const typename Kernel::Point_3& p1 = g[v1]; + const typename Kernel::Point_3& p2 = g[v2]; + + return (CGAL::angle(p1, p, p2) == CGAL::ACUTE); + } + } +}; + +template +struct Is_featured_edge { + const Polyhedron* polyhedron; + typename boost::property_map::type eifm; + Is_featured_edge() + : polyhedron(0) + {} // required by boost::filtered_graph + + Is_featured_edge(const Polyhedron& polyhedron) + : polyhedron(&polyhedron), eifm(get(edge_is_feature,polyhedron)) + {} + + bool operator()(typename boost::graph_traits::edge_descriptor e) const { + return get(eifm, e); + } +}; // end Is_featured_edge + +template +struct Is_border_edge { + const Polyhedron* polyhedron; + Is_border_edge() : polyhedron(0) {} // required by boost::filtered_graph + Is_border_edge(const Polyhedron& polyhedron) : polyhedron(&polyhedron) {} + + bool operator()(typename boost::graph_traits::edge_descriptor e) const { + return is_border(halfedge(e, *polyhedron), *polyhedron) || + is_border(opposite(halfedge(e, *polyhedron), *polyhedron), *polyhedron); + } +}; // end Is_featured_edge + +template +struct Extract_polyline_with_context_visitor +{ + typedef typename Polyhedral_mesh_domain::Polyhedron_type Polyhedron; + std::vector& polylines; + const Graph& graph; + + Extract_polyline_with_context_visitor + (const Graph& graph, + typename std::vector& polylines) + : polylines(polylines), graph(graph) + {} + + void start_new_polyline() + { + polylines.push_back(Polyline_with_context()); + } + + void add_node(typename boost::graph_traits::vertex_descriptor vd) + { + if(polylines.back().polyline_content.empty()) { + polylines.back().polyline_content.push_back(graph[vd]); + } + } + + void add_edge(typename boost::graph_traits::edge_descriptor ed) + { + typename boost::graph_traits::vertex_descriptor + s = source(ed, graph), + t = target(ed, graph); + Polyline_with_context& polyline = polylines.back(); + CGAL_assertion(!polyline.polyline_content.empty()); + if(polyline.polyline_content.back() != graph[s]) { + polyline.polyline_content.push_back(graph[s]); + } else if(polyline.polyline_content.back() != graph[t]) { + // if the edge is zero-length, it is ignored + polyline.polyline_content.push_back(graph[t]); + } + const typename boost::edge_bundle_type::type & + set_of_indices = graph[ed]; + polyline.context.adjacent_patches_ids.insert(set_of_indices.begin(), + set_of_indices.end()); + } + + void end_polyline() + { + // ignore degenerated polylines + if(polylines.back().polyline_content.size() < 2) + polylines.resize(polylines.size() - 1); + // else { + // std::cerr << "Polyline with " << polylines.back().polyline_content.size() + // << " vertices, incident to " + // << polylines.back().context.adjacent_patches_ids.size() + // << " patches:\n "; + // for(auto p: polylines.back().polyline_content) + // std::cerr << " " << p; + // std::cerr << "\n"; + // } + } +}; + + +} // end CGAL::internal::Mesh_3 +} // end CGAL::internal + +/// @endcond + +} // end CGAL + +#include + +#endif // CGAL_MESH_3_INTERNAL_MESH_3_HELPERS_H From 2f59ef6b9af534283edebbe58ff72ea4971a532d Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 16 May 2018 15:24:16 +0100 Subject: [PATCH 03/18] Function exists already in Algebraic_foundations --- .../include/CGAL/Surface_mesher/Implicit_surface_oracle_3.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Surface_mesher/include/CGAL/Surface_mesher/Implicit_surface_oracle_3.h b/Surface_mesher/include/CGAL/Surface_mesher/Implicit_surface_oracle_3.h index 2ed6a32971e..f57c6df8943 100644 --- a/Surface_mesher/include/CGAL/Surface_mesher/Implicit_surface_oracle_3.h +++ b/Surface_mesher/include/CGAL/Surface_mesher/Implicit_surface_oracle_3.h @@ -496,11 +496,6 @@ namespace CGAL { }; // end Implicit_surface_oracle_3 -template -FT approximate_sqrt(const FT x) { - return FT (CGAL_NTS sqrt(CGAL_NTS to_double(x))); -} - } // namespace Surface_mesher } // namespace CGAL From 718db41ca561e48b8def06d70875ef02b55380d9 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 16 May 2018 15:29:46 +0100 Subject: [PATCH 04/18] Duplicates in TDS_2 and T_2 --- .../graph/graph_traits_Triangulation_2.h | 118 +----------------- 1 file changed, 1 insertion(+), 117 deletions(-) diff --git a/Triangulation_2/include/CGAL/boost/graph/graph_traits_Triangulation_2.h b/Triangulation_2/include/CGAL/boost/graph/graph_traits_Triangulation_2.h index 668dca027a3..0a901850a6d 100644 --- a/Triangulation_2/include/CGAL/boost/graph/graph_traits_Triangulation_2.h +++ b/Triangulation_2/include/CGAL/boost/graph/graph_traits_Triangulation_2.h @@ -25,7 +25,7 @@ // include this to avoid a VC15 warning #include - +#include #include #include #include @@ -45,114 +45,6 @@ namespace CGAL { namespace detail { -template < class T, class EdgeBase > -class Edge : public EdgeBase { - -public: - typedef typename T::Face_handle Face_handle ; - - Edge() - {} - - Edge(Face_handle fh, int i) - : EdgeBase(fh,i) - {} - - Edge(const EdgeBase& e) - : EdgeBase(e) - {} - - Edge(const Edge& e) - : EdgeBase(e) - {} - - Edge& - operator=(const Edge& e) - { - this->first = e.first; - this->second = e.second; - return *this; - } - - friend std::size_t hash_value(const Edge& e) - { - if (e.first==Face_handle()) return 0; - return hash_value(e.firstneighbor(e.second)? - e.first:e.first->neighbor(e.second)); - } - - bool operator==(const Edge& other) const - { - if((this->first == other.first)&&(this->second == other.second)) return true; - Face_handle fh = this->first->neighbor(this->second); - if(other.first != fh) return false; - int i = fh->index(this->first); - return (other.second == i); - } - - bool operator!=(Edge& other) const - { - return ! (*this == other); - } -}; - -template -class Out_edge_circulator : public Circ -{ -private: - mutable E e; - -public: - - typedef E value_type; - typedef E* pointer; - typedef E& reference; - - Out_edge_circulator() - : Circ() - {} - - Out_edge_circulator(Circ c) - : Circ(c) - {} - - const E& operator*() const - { - E ed = static_cast(this)->operator*(); - e = E(ed.first->neighbor(ed.second), ed.first->neighbor(ed.second)->index(ed.first)); - return e; - } -}; - -template -class In_edge_circulator : public Circ -{ -private: - mutable E e; - -public: - - typedef E value_type; - typedef E* pointer; - typedef E& reference; - - In_edge_circulator() - : Circ() - {} - - In_edge_circulator(Circ c) - : Circ(c) - {} - - const E& operator*() const -{ - typename Circ::value_type ed = static_cast(this)->operator*(); - e = E(ed); - return e; - } -}; - - template struct T2_halfedge_descriptor { @@ -784,14 +676,6 @@ namespace std { #ifndef CGAL_CFG_NO_STD_HASH - template < class T, class EdgeBase> - struct hash > { - std::size_t operator()(const CGAL::detail::Edge& e) const - { - return hash_value(e); - } - }; - template < class Tr> struct hash > { std::size_t operator()(const CGAL::detail::T2_halfedge_descriptor& e) const From 777d3057d9e39c70c081cd20038aae0fccee41fd Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 16 May 2018 15:46:38 +0100 Subject: [PATCH 05/18] Undef the macros at the end, as they are not identical (one has an EXPORT) --- CGAL_Core/include/CGAL/CORE/CoreDefs.h | 4 +++- CGAL_ImageIO/include/CGAL/ImageIO/gif_impl.h | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CGAL_Core/include/CGAL/CORE/CoreDefs.h b/CGAL_Core/include/CGAL/CORE/CoreDefs.h index 499d7b1dbf3..0d53c442bcc 100644 --- a/CGAL_Core/include/CGAL/CORE/CoreDefs.h +++ b/CGAL_Core/include/CGAL/CORE/CoreDefs.h @@ -55,7 +55,7 @@ #else // CGAL_HEADER_ONLY #define CGAL_GLOBAL_STATE_VAR(TYPE, NAME, VALUE) \ - CGAL_CORE_EXPORT extern TYPE NAME; \ + CGAL_EXPORT extern TYPE NAME; \ inline TYPE& get_static_##NAME() \ { \ return NAME; \ @@ -343,4 +343,6 @@ inline void setPositionalFormat(std::ostream& o = std::cout) { #include +#undef CGAL_GLOBAL_STATE_VAR + #endif // _CORE_COREDEFS_H_ diff --git a/CGAL_ImageIO/include/CGAL/ImageIO/gif_impl.h b/CGAL_ImageIO/include/CGAL/ImageIO/gif_impl.h index 64e8b484e83..7e9e81c3dfe 100644 --- a/CGAL_ImageIO/include/CGAL/ImageIO/gif_impl.h +++ b/CGAL_ImageIO/include/CGAL/ImageIO/gif_impl.h @@ -699,3 +699,5 @@ static int GifError(const char *st) { return -1; } +#undef CGAL_GLOBAL_STATE_VAR + From eb2347ba010077cb8fd579382bdbcfddd097f490 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 16 May 2018 16:04:18 +0100 Subject: [PATCH 06/18] Rename tiny duplicate function as the Surface_mesher package will become obsolete soon anyways --- .../include/CGAL/Surface_mesher/Implicit_surface_oracle_3.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Surface_mesher/include/CGAL/Surface_mesher/Implicit_surface_oracle_3.h b/Surface_mesher/include/CGAL/Surface_mesher/Implicit_surface_oracle_3.h index f57c6df8943..a061fbfd7d6 100644 --- a/Surface_mesher/include/CGAL/Surface_mesher/Implicit_surface_oracle_3.h +++ b/Surface_mesher/include/CGAL/Surface_mesher/Implicit_surface_oracle_3.h @@ -106,7 +106,7 @@ namespace CGAL { namespace { template - struct Return_min : CGAL::binary_function + struct Return_min2 : CGAL::binary_function { T operator()(const T& a, const T& b) const { @@ -122,7 +122,7 @@ namespace CGAL { class Transform_functor_ = typename Real_embeddable_traits::Sgn, class Surface_identifiers_generator_ = - Return_min, + Return_min2, class Point_creator = Creator_uniform_3, class Visitor = Null_oracle_visitor From 60423a61de6973b78db757becbe460485a4197e7 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 16 May 2018 16:20:36 +0100 Subject: [PATCH 07/18] fix include file --- Polytope_distance_d/include/CGAL/width_assertions.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polytope_distance_d/include/CGAL/width_assertions.h b/Polytope_distance_d/include/CGAL/width_assertions.h index 011de69d956..5df80c2ce3e 100644 --- a/Polytope_distance_d/include/CGAL/width_assertions.h +++ b/Polytope_distance_d/include/CGAL/width_assertions.h @@ -95,7 +95,7 @@ #define VISITED_CHECK 0 #define IMPASSABLE_CHECK 0 - #include + #include #define DEBUGENDL(doit,msg,var)\ if(doit!=0) std::cout << msg << " " << var << endl; From 07fb49ee699d1b16ef8d84a2a12c8eab2e694165 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 16 May 2018 16:21:25 +0100 Subject: [PATCH 08/18] Qualify with CGAL:: as there exists also CGAL::Mesh_3::Mesher_level --- .../include/CGAL/Mesh_3/Poisson_refine_cells_3.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Poisson_surface_reconstruction_3/include/CGAL/Mesh_3/Poisson_refine_cells_3.h b/Poisson_surface_reconstruction_3/include/CGAL/Mesh_3/Poisson_refine_cells_3.h index 6b5305564ed..936563a780e 100644 --- a/Poisson_surface_reconstruction_3/include/CGAL/Mesh_3/Poisson_refine_cells_3.h +++ b/Poisson_surface_reconstruction_3/include/CGAL/Mesh_3/Poisson_refine_cells_3.h @@ -281,7 +281,7 @@ template class Poisson_refine_tets : public BaseP, - public Mesher_level < + public CGAL::Mesher_level < // qualified with CGAL:: as CGAL::Mesh_3::Mesher_level also exists Tr, Poisson_refine_tets, typename Tr::Cell_handle, @@ -294,7 +294,7 @@ class Poisson_refine_tets : Facets_level& facets_level; public: typedef Poisson_refine_tets Self; - typedef Mesher_level < + typedef CGAL::Mesher_level < Tr, Poisson_refine_tets, typename Tr::Cell_handle, From 4c1347852821450c859cd27f44c5502c698d16b4 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 16 May 2018 16:27:41 +0100 Subject: [PATCH 09/18] Include header to avoid duplication --- .../Poisson_implicit_surface_oracle_3.h | 21 ++----------------- .../Implicit_surface_oracle_3.h | 4 ++-- 2 files changed, 4 insertions(+), 21 deletions(-) diff --git a/Poisson_surface_reconstruction_3/include/CGAL/Surface_mesher/Poisson_implicit_surface_oracle_3.h b/Poisson_surface_reconstruction_3/include/CGAL/Surface_mesher/Poisson_implicit_surface_oracle_3.h index 36c229aad36..d212d17c4fe 100644 --- a/Poisson_surface_reconstruction_3/include/CGAL/Surface_mesher/Poisson_implicit_surface_oracle_3.h +++ b/Poisson_surface_reconstruction_3/include/CGAL/Surface_mesher/Poisson_implicit_surface_oracle_3.h @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -52,12 +53,6 @@ // compute the value of the potential in any point of space namespace CGAL { -#ifdef BOOST_MPL_CFG_NO_HAS_XXX -# error "BOOST_MPL_HAS_XXX_TRAIT_DEF is needed!" -#else - BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(has_set_on_surface, Set_on_surface_tag, true) -#endif - namespace Surface_mesher { /** @@ -100,19 +95,7 @@ namespace CGAL { ) */ - namespace { - - template - struct Return_min : CGAL::binary_function - { - T operator()(const T& a, const T& b) const - { - return (std::min)(a, b); - } - }; - - } // end anonymous namespace - + template < class GT, class Surface, diff --git a/Surface_mesher/include/CGAL/Surface_mesher/Implicit_surface_oracle_3.h b/Surface_mesher/include/CGAL/Surface_mesher/Implicit_surface_oracle_3.h index a061fbfd7d6..f57c6df8943 100644 --- a/Surface_mesher/include/CGAL/Surface_mesher/Implicit_surface_oracle_3.h +++ b/Surface_mesher/include/CGAL/Surface_mesher/Implicit_surface_oracle_3.h @@ -106,7 +106,7 @@ namespace CGAL { namespace { template - struct Return_min2 : CGAL::binary_function + struct Return_min : CGAL::binary_function { T operator()(const T& a, const T& b) const { @@ -122,7 +122,7 @@ namespace CGAL { class Transform_functor_ = typename Real_embeddable_traits::Sgn, class Surface_identifiers_generator_ = - Return_min2, + Return_min, class Point_creator = Creator_uniform_3, class Visitor = Null_oracle_visitor From f76575b5877b2efc67ae8dc86efb5dd5c7ee9c35 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 16 May 2018 16:41:18 +0100 Subject: [PATCH 10/18] To import the internal namespace parameters is a mistake --- Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h | 1 - 1 file changed, 1 deletion(-) diff --git a/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h b/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h index 48b1457c19f..f56e73fe100 100644 --- a/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h +++ b/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h @@ -71,7 +71,6 @@ BOOST_PARAMETER_NAME( (mark, tag) mark_) namespace CGAL { - using namespace parameters; #if defined(BOOST_MSVC) # pragma warning(push) From f6cd1e0bcfc936ddb636d4fe775672699d9dbd5a Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 16 May 2018 17:15:34 +0100 Subject: [PATCH 11/18] Factorize boost parameters in the file CGAL/boost/parameter.h --- BGL/include/CGAL/boost/parameter.h | 45 +++++++++++++++++++ Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h | 17 +------ .../include/CGAL/Mesh_3/global_parameters.h | 16 +------ 3 files changed, 49 insertions(+), 29 deletions(-) create mode 100644 BGL/include/CGAL/boost/parameter.h diff --git a/BGL/include/CGAL/boost/parameter.h b/BGL/include/CGAL/boost/parameter.h new file mode 100644 index 00000000000..63265bc8dc4 --- /dev/null +++ b/BGL/include/CGAL/boost/parameter.h @@ -0,0 +1,45 @@ +// Copyright (c) 2014 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$ +// SPDX-License-Identifier: LGPL-3.0+ +// +// +// Author(s) : Andreas Fabri + +#ifndef CGAL_BOOST_PARAMETER_H +#define CGAL_BOOST_PARAMETER_H + +#ifdef BOOST_PARAMETER_MAX_ARITY +# if (BOOST_PARAMETER_MAX_ARITY < 12) +# error "BOOST_PARAMETER_MAX_ARITY must be at least 12 for CGAL::Mesh_3" +# endif +#else +# define BOOST_PARAMETER_MAX_ARITY 12 +#endif +#include +#include + +namespace CGAL +{ +namespace parameters +{ + BOOST_PARAMETER_NAME( (time_limit, tag) time_limit_ ) + BOOST_PARAMETER_NAME( (convergence, tag) convergence_) + BOOST_PARAMETER_NAME( (max_iteration_number, tag) max_iteration_number_ ) + BOOST_PARAMETER_NAME( (freeze_bound, tag) freeze_bound_) +} // parameters +} // CGAL + +#endif // CGAL_BOOST_PARAMETER_H diff --git a/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h b/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h index f56e73fe100..0017e4c95e3 100644 --- a/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h +++ b/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h @@ -31,6 +31,7 @@ #include #include #include +#include #include @@ -40,16 +41,6 @@ #pragma GCC diagnostic ignored "-Wunused-parameter" #endif -#ifdef BOOST_PARAMETER_MAX_ARITY -# if (BOOST_PARAMETER_MAX_ARITY < 8) -# error "BOOST_PARAMETER_MAX_ARITY must be at least 8 for CGAL::lloyd_optimize_mesh_2()" -# endif -#else -# define BOOST_PARAMETER_MAX_ARITY 8 -#endif -#include -#include - namespace CGAL { namespace parameters @@ -57,10 +48,6 @@ namespace parameters BOOST_PARAMETER_NAME( cdt ) -BOOST_PARAMETER_NAME( (max_iteration_number, tag) max_iteration_number_ ) -BOOST_PARAMETER_NAME( (convergence, tag) convergence_) -BOOST_PARAMETER_NAME( (time_limit, tag) time_limit_ ) -BOOST_PARAMETER_NAME( (freeze_bound, tag) freeze_bound_) BOOST_PARAMETER_NAME( (seeds_begin, tag) seeds_begin_) BOOST_PARAMETER_NAME( (seeds_end, tag) seeds_end_) BOOST_PARAMETER_NAME( (mark, tag) mark_) @@ -80,7 +67,7 @@ namespace CGAL BOOST_PARAMETER_FUNCTION( (Mesh_optimization_return_code), lloyd_optimize_mesh_2, - tag, + parameters::tag, (required (in_out(cdt),*)) (optional (max_iteration_number_, *, 0 ) diff --git a/Mesh_3/include/CGAL/Mesh_3/global_parameters.h b/Mesh_3/include/CGAL/Mesh_3/global_parameters.h index bde73012406..08b09bce48d 100644 --- a/Mesh_3/include/CGAL/Mesh_3/global_parameters.h +++ b/Mesh_3/include/CGAL/Mesh_3/global_parameters.h @@ -31,16 +31,7 @@ #include #include - -#ifdef BOOST_PARAMETER_MAX_ARITY -# if (BOOST_PARAMETER_MAX_ARITY < 12) -# error "BOOST_PARAMETER_MAX_ARITY must be at least 12 for CGAL::Mesh_3" -# endif -#else -# define BOOST_PARAMETER_MAX_ARITY 12 -#endif - -#include +#include namespace CGAL { @@ -75,14 +66,11 @@ BOOST_PARAMETER_NAME( c3t3 ) BOOST_PARAMETER_NAME( domain ) BOOST_PARAMETER_NAME( criteria ) -BOOST_PARAMETER_NAME( (time_limit, tag) time_limit_ ) + BOOST_PARAMETER_NAME( (sliver_bound, tag) sliver_bound_) BOOST_PARAMETER_NAME( (sliver_criterion, tag) sliver_criterion_) BOOST_PARAMETER_NAME( (perturbation_vector, tag) perturbation_vector_) -BOOST_PARAMETER_NAME( (freeze_bound, tag) freeze_bound_) BOOST_PARAMETER_NAME( (do_freeze, tag) do_freeze_) -BOOST_PARAMETER_NAME( (max_iteration_number, tag) max_iteration_number_ ) -BOOST_PARAMETER_NAME( (convergence, tag) convergence_) BOOST_PARAMETER_NAME( (mesh_topology, tag) mesh_topology_) From 6e828da0e90f6f5c6ce0a47684572313f703de37 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 17 May 2018 10:10:21 +0100 Subject: [PATCH 12/18] Move stuff to CGAL/boost/parameter --- BGL/include/CGAL/boost/parameter.h | 84 +++++++++++++++- Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h | 29 +----- Mesh_3/include/CGAL/Mesh_3/config.h | 18 ---- .../include/CGAL/Mesh_3/global_parameters.h | 96 ------------------- Mesh_3/include/CGAL/Mesh_criteria_3.h | 6 +- .../include/CGAL/Polyhedral_mesh_domain_3.h | 2 +- Mesh_3/include/CGAL/exude_mesh_3.h | 7 +- Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h | 6 +- Mesh_3/include/CGAL/make_mesh_3.h | 10 +- Mesh_3/include/CGAL/odt_optimize_mesh_3.h | 6 +- Mesh_3/include/CGAL/perturb_mesh_3.h | 6 +- Mesh_3/include/CGAL/refine_mesh_3.h | 18 ++-- 12 files changed, 115 insertions(+), 173 deletions(-) delete mode 100644 Mesh_3/include/CGAL/Mesh_3/global_parameters.h diff --git a/BGL/include/CGAL/boost/parameter.h b/BGL/include/CGAL/boost/parameter.h index 63265bc8dc4..36235278e8e 100644 --- a/BGL/include/CGAL/boost/parameter.h +++ b/BGL/include/CGAL/boost/parameter.h @@ -21,6 +21,8 @@ #ifndef CGAL_BOOST_PARAMETER_H #define CGAL_BOOST_PARAMETER_H +#include + #ifdef BOOST_PARAMETER_MAX_ARITY # if (BOOST_PARAMETER_MAX_ARITY < 12) # error "BOOST_PARAMETER_MAX_ARITY must be at least 12 for CGAL::Mesh_3" @@ -31,15 +33,89 @@ #include #include + +#if defined(__clang__) || (BOOST_GCC >= 40600) +# define CGAL_IGNORE_UNUSED_VARIABLES \ + _Pragma("GCC diagnostic ignored \"-Wunused-variable\"") \ + _Pragma("GCC diagnostic ignored \"-Wunused-parameter\"") +#else +# define CGAL_IGNORE_UNUSED_VARIABLES +#endif +#if __has_warning("-Wunneeded-internal-declaration") +# define CGAL_IGNORE_UNUSED_INTERNAL_DECLARATION \ + _Pragma("clang diagnostic ignored \"-Wunneeded-internal-declaration\"") +#else +# define CGAL_IGNORE_UNUSED_INTERNAL_DECLARATION +#endif + +#define CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS \ + CGAL_IGNORE_UNUSED_VARIABLES \ + CGAL_IGNORE_UNUSED_INTERNAL_DECLARATION + + namespace CGAL { namespace parameters { - BOOST_PARAMETER_NAME( (time_limit, tag) time_limit_ ) - BOOST_PARAMETER_NAME( (convergence, tag) convergence_) - BOOST_PARAMETER_NAME( (max_iteration_number, tag) max_iteration_number_ ) - BOOST_PARAMETER_NAME( (freeze_bound, tag) freeze_bound_) + +template +struct Base +{ + Base(T t) : t_(t) {} + T operator()() const { return t_; } +private: + T t_; +}; + +#define CGAL_BOOLEAN_PARAMETER(Class, function_true, function_false) \ + struct Class : public Base { Class(bool b) : Base(b){} }; \ + inline Class function_true() { return Class(true); } \ + inline Class function_false() { return Class(false); } + +#define CGAL_DOUBLE_PARAMETER(Class, function, precondition) \ + struct Class : public Base \ + { Class(double d) : Base(d) { precondition(d); } }; \ + inline Class function(double d) { return Class(d); } + +// see +CGAL_PRAGMA_DIAG_PUSH +// see +CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS + +BOOST_PARAMETER_NAME( c3t3 ) +BOOST_PARAMETER_NAME( domain ) +BOOST_PARAMETER_NAME( criteria ) +BOOST_PARAMETER_NAME( cdt ) + +BOOST_PARAMETER_NAME( (seeds_begin, tag) seeds_begin_) +BOOST_PARAMETER_NAME( (seeds_end, tag) seeds_end_) +BOOST_PARAMETER_NAME( (mark, tag) mark_) + +BOOST_PARAMETER_NAME( (time_limit, tag) time_limit_ ) +BOOST_PARAMETER_NAME( (convergence, tag) convergence_) +BOOST_PARAMETER_NAME( (max_iteration_number, tag) max_iteration_number_ ) +BOOST_PARAMETER_NAME( (freeze_bound, tag) freeze_bound_) + +BOOST_PARAMETER_NAME( (sliver_bound, tag) sliver_bound_) +BOOST_PARAMETER_NAME( (sliver_criterion, tag) sliver_criterion_) +BOOST_PARAMETER_NAME( (perturbation_vector, tag) perturbation_vector_) +BOOST_PARAMETER_NAME( (do_freeze, tag) do_freeze_) + +BOOST_PARAMETER_NAME( (mesh_topology, tag) mesh_topology_) + +BOOST_PARAMETER_NAME( (dump_after_init_prefix, tag ) dump_after_init_prefix_) +BOOST_PARAMETER_NAME( (dump_after_refine_surface_prefix, tag ) dump_after_refine_surface_prefix_) +BOOST_PARAMETER_NAME( (dump_after_refine_prefix, tag ) dump_after_refine_prefix_) +BOOST_PARAMETER_NAME( (dump_after_glob_opt_prefix, tag ) dump_after_glob_opt_prefix_) +BOOST_PARAMETER_NAME( (dump_after_perturb_prefix, tag ) dump_after_perturb_prefix_) +BOOST_PARAMETER_NAME( (dump_after_exude_prefix, tag ) dump_after_exude_prefix_) +BOOST_PARAMETER_NAME( (number_of_initial_points, tag) number_of_initial_points_) +BOOST_PARAMETER_NAME( (maximal_number_of_vertices, tag ) maximal_number_of_vertices_) +BOOST_PARAMETER_NAME( (pointer_to_error_code, tag ) pointer_to_error_code_) + +CGAL_PRAGMA_DIAG_POP } // parameters } // CGAL + #endif // CGAL_BOOST_PARAMETER_H diff --git a/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h b/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h index 0017e4c95e3..ee2f6e42d48 100644 --- a/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h +++ b/Mesh_2/include/CGAL/lloyd_optimize_mesh_2.h @@ -35,25 +35,10 @@ #include -#if ( defined( __clang__ ) || (BOOST_GCC >= 40600 ) ) && (BOOST_VERSION < 106000) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-variable" -#pragma GCC diagnostic ignored "-Wunused-parameter" -#endif - -namespace CGAL -{ -namespace parameters -{ - - -BOOST_PARAMETER_NAME( cdt ) -BOOST_PARAMETER_NAME( (seeds_begin, tag) seeds_begin_) -BOOST_PARAMETER_NAME( (seeds_end, tag) seeds_end_) -BOOST_PARAMETER_NAME( (mark, tag) mark_) - -}//end namespace parameters -}//end namespace CGAL +// see +CGAL_PRAGMA_DIAG_PUSH +// see +CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS namespace CGAL @@ -165,11 +150,7 @@ namespace CGAL } //end namespace CGAL -//CGAL_PRAGMA_DIAG_POP -#if ( defined( __clang__ ) || (BOOST_GCC >= 40600 ) ) && (BOOST_VERSION < 106000) -#pragma GCC diagnostic pop -#endif - +CGAL_PRAGMA_DIAG_POP #include diff --git a/Mesh_3/include/CGAL/Mesh_3/config.h b/Mesh_3/include/CGAL/Mesh_3/config.h index f952e80cd7f..53b408812e3 100644 --- a/Mesh_3/include/CGAL/Mesh_3/config.h +++ b/Mesh_3/include/CGAL/Mesh_3/config.h @@ -67,22 +67,4 @@ # endif #endif -#if defined(__clang__) || (BOOST_GCC >= 40600) -# define CGAL_MESH_3_IGNORE_UNUSED_VARIABLES \ - _Pragma("GCC diagnostic ignored \"-Wunused-variable\"") \ - _Pragma("GCC diagnostic ignored \"-Wunused-parameter\"") -#else -# define CGAL_MESH_3_IGNORE_UNUSED_VARIABLES -#endif -#if __has_warning("-Wunneeded-internal-declaration") -# define CGAL_MESH_3_IGNORE_UNUSED_INTERNAL_DECLARATION \ - _Pragma("clang diagnostic ignored \"-Wunneeded-internal-declaration\"") -#else -# define CGAL_MESH_3_IGNORE_UNUSED_INTERNAL_DECLARATION -#endif - -#define CGAL_MESH_3_IGNORE_BOOST_PARAMETER_NAME_WARNINGS \ - CGAL_MESH_3_IGNORE_UNUSED_VARIABLES \ - CGAL_MESH_3_IGNORE_UNUSED_INTERNAL_DECLARATION - #endif // CGAL_MESH_3_CONFIG_H diff --git a/Mesh_3/include/CGAL/Mesh_3/global_parameters.h b/Mesh_3/include/CGAL/Mesh_3/global_parameters.h deleted file mode 100644 index 08b09bce48d..00000000000 --- a/Mesh_3/include/CGAL/Mesh_3/global_parameters.h +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) 2009 INRIA Sophia-Antipolis (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 -// 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$ -// SPDX-License-Identifier: GPL-3.0+ -// -// -// Author(s) : Stephane Tayeb -// -//****************************************************************************** -// File Description : -//****************************************************************************** - -#ifndef CGAL_MESH_3_GLOBAL_PARAMETERS_H -#define CGAL_MESH_3_GLOBAL_PARAMETERS_H - -#include - - -#include -#include -#include - - -namespace CGAL { - -namespace parameters { - -template -struct Base -{ - Base(T t) : t_(t) {} - T operator()() const { return t_; } -private: - T t_; -}; - -#define CGAL_MESH_BOOLEAN_PARAMETER(Class, function_true, function_false) \ - struct Class : public Base { Class(bool b) : Base(b){} }; \ - inline Class function_true() { return Class(true); } \ - inline Class function_false() { return Class(false); } - -#define CGAL_MESH_DOUBLE_PARAMETER(Class, function, precondition) \ - struct Class : public Base \ - { Class(double d) : Base(d) { precondition(d); } }; \ - inline Class function(double d) { return Class(d); } - -// see -CGAL_PRAGMA_DIAG_PUSH -// see -CGAL_MESH_3_IGNORE_BOOST_PARAMETER_NAME_WARNINGS - -BOOST_PARAMETER_NAME( c3t3 ) -BOOST_PARAMETER_NAME( domain ) -BOOST_PARAMETER_NAME( criteria ) - - -BOOST_PARAMETER_NAME( (sliver_bound, tag) sliver_bound_) -BOOST_PARAMETER_NAME( (sliver_criterion, tag) sliver_criterion_) -BOOST_PARAMETER_NAME( (perturbation_vector, tag) perturbation_vector_) -BOOST_PARAMETER_NAME( (do_freeze, tag) do_freeze_) - -BOOST_PARAMETER_NAME( (mesh_topology, tag) mesh_topology_) - -BOOST_PARAMETER_NAME( (dump_after_init_prefix, tag ) dump_after_init_prefix_) -BOOST_PARAMETER_NAME( (dump_after_refine_surface_prefix, tag ) dump_after_refine_surface_prefix_) -BOOST_PARAMETER_NAME( (dump_after_refine_prefix, tag ) dump_after_refine_prefix_) -BOOST_PARAMETER_NAME( (dump_after_glob_opt_prefix, tag ) dump_after_glob_opt_prefix_) -BOOST_PARAMETER_NAME( (dump_after_perturb_prefix, tag ) dump_after_perturb_prefix_) -BOOST_PARAMETER_NAME( (dump_after_exude_prefix, tag ) dump_after_exude_prefix_) -BOOST_PARAMETER_NAME( (number_of_initial_points, tag) number_of_initial_points_) -BOOST_PARAMETER_NAME( (maximal_number_of_vertices, tag ) maximal_number_of_vertices_) -BOOST_PARAMETER_NAME( (pointer_to_error_code, tag ) pointer_to_error_code_) - -CGAL_PRAGMA_DIAG_POP -} // end namespace parameters - - - - - -} //namespace CGAL - -#endif // CGAL_MESH_3_GLOBAL_PARAMETERS_H diff --git a/Mesh_3/include/CGAL/Mesh_criteria_3.h b/Mesh_3/include/CGAL/Mesh_criteria_3.h index 2360fb78a3c..ecb5ead9ffb 100644 --- a/Mesh_3/include/CGAL/Mesh_criteria_3.h +++ b/Mesh_3/include/CGAL/Mesh_criteria_3.h @@ -33,7 +33,7 @@ #include #include -#include +#include #include #include #include @@ -45,8 +45,8 @@ namespace parameters { // see CGAL_PRAGMA_DIAG_PUSH -// see -CGAL_MESH_3_IGNORE_BOOST_PARAMETER_NAME_WARNINGS +// see +CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS BOOST_PARAMETER_NAME( (edge_size, tag) edge_size_ ) BOOST_PARAMETER_NAME( (edge_sizing_field, tag) edge_sizing_field_ ) diff --git a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h index 0650b628eef..755835811a3 100644 --- a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h @@ -32,7 +32,7 @@ #include -#include +#include #include #include diff --git a/Mesh_3/include/CGAL/exude_mesh_3.h b/Mesh_3/include/CGAL/exude_mesh_3.h index ba74aa72111..04dad363b92 100644 --- a/Mesh_3/include/CGAL/exude_mesh_3.h +++ b/Mesh_3/include/CGAL/exude_mesh_3.h @@ -34,8 +34,7 @@ #include #include #include -#include -#include +#include namespace CGAL { @@ -46,8 +45,8 @@ namespace CGAL { // see CGAL_PRAGMA_DIAG_PUSH -// see -CGAL_MESH_3_IGNORE_BOOST_PARAMETER_NAME_WARNINGS +// see +CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS BOOST_PARAMETER_FUNCTION( (Mesh_optimization_return_code), diff --git a/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h b/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h index 63ed1d0a73e..3f2a3c051d8 100644 --- a/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h +++ b/Mesh_3/include/CGAL/lloyd_optimize_mesh_3.h @@ -30,7 +30,7 @@ #include -#include +#include #include #include #include @@ -47,8 +47,8 @@ namespace CGAL { // see CGAL_PRAGMA_DIAG_PUSH -// see -CGAL_MESH_3_IGNORE_BOOST_PARAMETER_NAME_WARNINGS +// see +CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS BOOST_PARAMETER_FUNCTION( (Mesh_optimization_return_code), diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index 7c54c459f00..8d31b78da54 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -31,7 +31,7 @@ #include #include -#include +#include #include #include #include @@ -123,8 +123,8 @@ namespace parameters { // see CGAL_PRAGMA_DIAG_PUSH -// see -CGAL_MESH_3_IGNORE_BOOST_PARAMETER_NAME_WARNINGS +// see +CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS BOOST_PARAMETER_NAME( features_param ) @@ -404,8 +404,8 @@ C3T3 make_mesh_3(const MD& md, const MC& mc, const Arg1& a1, const Arg2& a2, // see CGAL_PRAGMA_DIAG_PUSH -// see -CGAL_MESH_3_IGNORE_BOOST_PARAMETER_NAME_WARNINGS +// see +CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS BOOST_PARAMETER_FUNCTION( (void), diff --git a/Mesh_3/include/CGAL/odt_optimize_mesh_3.h b/Mesh_3/include/CGAL/odt_optimize_mesh_3.h index 57b7181c850..7627ab07510 100644 --- a/Mesh_3/include/CGAL/odt_optimize_mesh_3.h +++ b/Mesh_3/include/CGAL/odt_optimize_mesh_3.h @@ -30,7 +30,7 @@ #include -#include +#include #include #include #include @@ -47,8 +47,8 @@ namespace CGAL { // see CGAL_PRAGMA_DIAG_PUSH -// see -CGAL_MESH_3_IGNORE_BOOST_PARAMETER_NAME_WARNINGS +// see +CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS BOOST_PARAMETER_FUNCTION( (Mesh_optimization_return_code), diff --git a/Mesh_3/include/CGAL/perturb_mesh_3.h b/Mesh_3/include/CGAL/perturb_mesh_3.h index 59291afe48e..74c68e397c5 100644 --- a/Mesh_3/include/CGAL/perturb_mesh_3.h +++ b/Mesh_3/include/CGAL/perturb_mesh_3.h @@ -30,7 +30,7 @@ #include -#include +#include #include #include #include @@ -48,8 +48,8 @@ namespace CGAL { // see CGAL_PRAGMA_DIAG_PUSH -// see -CGAL_MESH_3_IGNORE_BOOST_PARAMETER_NAME_WARNINGS +// see +CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS BOOST_PARAMETER_FUNCTION( (Mesh_optimization_return_code), diff --git a/Mesh_3/include/CGAL/refine_mesh_3.h b/Mesh_3/include/CGAL/refine_mesh_3.h index fb3e4aee3d4..21547fc6ca6 100644 --- a/Mesh_3/include/CGAL/refine_mesh_3.h +++ b/Mesh_3/include/CGAL/refine_mesh_3.h @@ -31,9 +31,9 @@ #include #include +#include #include #include -#include #include #include #include @@ -236,8 +236,8 @@ namespace parameters { // see CGAL_PRAGMA_DIAG_PUSH -// see -CGAL_MESH_3_IGNORE_BOOST_PARAMETER_NAME_WARNINGS +// see +CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS // ----------------------------------- @@ -412,14 +412,14 @@ CGAL_PRAGMA_DIAG_POP // ----------------------------------- // Reset_c3t3 (undocumented) // ----------------------------------- - CGAL_MESH_BOOLEAN_PARAMETER(Reset,reset_c3t3,no_reset_c3t3) - // CGAL_MESH_BOOLEAN_PARAMETER defined in + CGAL_BOOLEAN_PARAMETER(Reset,reset_c3t3,no_reset_c3t3) + // CGAL_BOOLEAN_PARAMETER defined in // see CGAL_PRAGMA_DIAG_PUSH -// see -CGAL_MESH_3_IGNORE_BOOST_PARAMETER_NAME_WARNINGS +// see +CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS // ----------------------------------- // Parameters @@ -445,8 +445,8 @@ CGAL_PRAGMA_DIAG_POP // see CGAL_PRAGMA_DIAG_PUSH -// see -CGAL_MESH_3_IGNORE_BOOST_PARAMETER_NAME_WARNINGS +// see +CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS BOOST_PARAMETER_FUNCTION( (void), From 333505036a5894595eb9d465ecde384a4fa69b59 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Thu, 17 May 2018 16:05:26 +0200 Subject: [PATCH 13/18] Dummy change to trigger travis --- BGL/include/CGAL/boost/parameter.h | 1 + 1 file changed, 1 insertion(+) diff --git a/BGL/include/CGAL/boost/parameter.h b/BGL/include/CGAL/boost/parameter.h index 36235278e8e..1c5c1b8e979 100644 --- a/BGL/include/CGAL/boost/parameter.h +++ b/BGL/include/CGAL/boost/parameter.h @@ -23,6 +23,7 @@ #include + #ifdef BOOST_PARAMETER_MAX_ARITY # if (BOOST_PARAMETER_MAX_ARITY < 12) # error "BOOST_PARAMETER_MAX_ARITY must be at least 12 for CGAL::Mesh_3" From 4de6c303234fb9aa0a44f0e26e8507b407127a25 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 18 May 2018 07:30:39 +0100 Subject: [PATCH 14/18] Add missing #include --- Mesh_3/include/CGAL/internal/Mesh_3/helpers.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Mesh_3/include/CGAL/internal/Mesh_3/helpers.h b/Mesh_3/include/CGAL/internal/Mesh_3/helpers.h index 7167b54e406..c2fc0390496 100644 --- a/Mesh_3/include/CGAL/internal/Mesh_3/helpers.h +++ b/Mesh_3/include/CGAL/internal/Mesh_3/helpers.h @@ -30,6 +30,7 @@ #include +#include #include #include From 76c260142b975291282131eae10b2c4a807b284b Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 18 May 2018 16:40:24 +0100 Subject: [PATCH 15/18] Add #include --- Mesh_3/include/CGAL/internal/Mesh_3/helpers.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Mesh_3/include/CGAL/internal/Mesh_3/helpers.h b/Mesh_3/include/CGAL/internal/Mesh_3/helpers.h index c2fc0390496..6baa4ed6dd8 100644 --- a/Mesh_3/include/CGAL/internal/Mesh_3/helpers.h +++ b/Mesh_3/include/CGAL/internal/Mesh_3/helpers.h @@ -31,6 +31,7 @@ #include #include +#include #include #include From 71ccb7d57622d241d5c06bfd489adc8a18f253d4 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 22 May 2018 08:24:53 +0100 Subject: [PATCH 16/18] Add BGL as dependency --- Mesh_2/package_info/Mesh_2/dependencies | 1 + 1 file changed, 1 insertion(+) diff --git a/Mesh_2/package_info/Mesh_2/dependencies b/Mesh_2/package_info/Mesh_2/dependencies index 8e839394994..a0eb105c10e 100644 --- a/Mesh_2/package_info/Mesh_2/dependencies +++ b/Mesh_2/package_info/Mesh_2/dependencies @@ -1,4 +1,5 @@ Algebraic_foundations +BGL Circulator Distance_2 Hash_map From 5af63b5893ca5fdfb9e4e705aeda1ff629c52b34 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 25 May 2018 10:27:45 +0100 Subject: [PATCH 17/18] Fix #include --- Polyhedron/demo/Polyhedron/C3t3_type.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polyhedron/demo/Polyhedron/C3t3_type.h b/Polyhedron/demo/Polyhedron/C3t3_type.h index d3e09ef5380..639242b908b 100644 --- a/Polyhedron/demo/Polyhedron/C3t3_type.h +++ b/Polyhedron/demo/Polyhedron/C3t3_type.h @@ -3,7 +3,7 @@ // include this to get #define BOOST_PARAMETER_MAX_ARITY 12 // as otherwise it gets set via inclusion of Polyhedron_3.h -#include +#include #include #include "Polyhedron_type.h" From ee02f3588808eca1fc47c37b0f065eb88b41f271 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Sat, 26 May 2018 08:18:58 +0100 Subject: [PATCH 18/18] Increase BOOST_PARAMETER_MAX_ARITY --- Polyhedron/demo/Polyhedron/Plugins/Mesh_2/Mesh_2_plugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_2/Mesh_2_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Mesh_2/Mesh_2_plugin.cpp index 527ec779993..acbfab9cdd5 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_2/Mesh_2_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_2/Mesh_2_plugin.cpp @@ -2,7 +2,7 @@ // Needed for lloyd_optimize_mesh_2 which does it too late // (and we don't want to spend the time on finding out who // includes the header file that sets it too a value too low -#define BOOST_PARAMETER_MAX_ARITY 8 +#define BOOST_PARAMETER_MAX_ARITY 12 #include