Merge pull request #3092 from maxGimeno/Travis-Check_including_all_headers-GF

Infrastructure : Test compilation of headers
This commit is contained in:
Laurent Rineau 2018-05-28 13:58:19 +02:00
commit 2ad4781a05
25 changed files with 321 additions and 551 deletions

View File

@ -1,10 +1,9 @@
// Copyright (c) 2009 INRIA Sophia-Antipolis (France).
// All rights reserved.
// 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
// General Public License as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
// 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.
@ -14,23 +13,16 @@
//
// $URL$
// $Id$
// SPDX-License-Identifier: GPL-3.0+
// SPDX-License-Identifier: LGPL-3.0+
//
//
// Author(s) : Stephane Tayeb
//
//******************************************************************************
// File Description :
//******************************************************************************
#ifndef CGAL_MESH_3_GLOBAL_PARAMETERS_H
#define CGAL_MESH_3_GLOBAL_PARAMETERS_H
#include <CGAL/license/Mesh_3.h>
// Author(s) : Andreas Fabri
#ifndef CGAL_BOOST_PARAMETER_H
#define CGAL_BOOST_PARAMETER_H
#include <CGAL/config.h>
#include <CGAL/Mesh_3/config.h>
#ifdef BOOST_PARAMETER_MAX_ARITY
# if (BOOST_PARAMETER_MAX_ARITY < 12)
@ -39,13 +31,33 @@
#else
# define BOOST_PARAMETER_MAX_ARITY 12
#endif
#include <boost/parameter.hpp>
#include <boost/parameter/name.hpp>
namespace CGAL {
#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
namespace parameters {
#define CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS \
CGAL_IGNORE_UNUSED_VARIABLES \
CGAL_IGNORE_UNUSED_INTERNAL_DECLARATION
namespace CGAL
{
namespace parameters
{
template <typename T>
struct Base
@ -56,33 +68,39 @@ private:
T t_;
};
#define CGAL_MESH_BOOLEAN_PARAMETER(Class, function_true, function_false) \
#define CGAL_BOOLEAN_PARAMETER(Class, function_true, function_false) \
struct Class : public Base<bool> { Class(bool b) : Base<bool>(b){} }; \
inline Class function_true() { return Class(true); } \
inline Class function_false() { return Class(false); }
#define CGAL_MESH_DOUBLE_PARAMETER(Class, function, precondition) \
#define CGAL_DOUBLE_PARAMETER(Class, function, precondition) \
struct Class : public Base<double> \
{ Class(double d) : Base<double>(d) { precondition(d); } }; \
inline Class function(double d) { return Class(d); }
// see <CGAL/config.h>
CGAL_PRAGMA_DIAG_PUSH
// see <CGAL/Mesh_3/config.h>
CGAL_MESH_3_IGNORE_BOOST_PARAMETER_NAME_WARNINGS
// see <CGAL/boost/parameter.h>
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( (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_)
@ -97,12 +115,8 @@ BOOST_PARAMETER_NAME( (maximal_number_of_vertices, tag ) maximal_number_of_verti
BOOST_PARAMETER_NAME( (pointer_to_error_code, tag ) pointer_to_error_code_)
CGAL_PRAGMA_DIAG_POP
} // end namespace parameters
} // parameters
} // CGAL
} //namespace CGAL
#endif // CGAL_MESH_3_GLOBAL_PARAMETERS_H
#endif // CGAL_BOOST_PARAMETER_H

View File

@ -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 <CGAL/enable_warnings.h>
#undef CGAL_GLOBAL_STATE_VAR
#endif // _CORE_COREDEFS_H_

View File

@ -699,3 +699,5 @@ static int GifError(const char *st) {
return -1;
}
#undef CGAL_GLOBAL_STATE_VAR

View File

@ -1262,6 +1262,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}")
@ -1326,7 +1327,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\

View File

@ -31,47 +31,18 @@
#include <CGAL/Mesh_2/Mesh_sizing_field.h>
#include <CGAL/Mesh_optimization_return_code.h>
#include <CGAL/iterator.h>
#include <CGAL/boost/parameter.h>
#include <fstream>
#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
#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 <boost/parameter.hpp>
#include <boost/parameter/name.hpp>
namespace CGAL
{
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_)
}//end namespace parameters
}//end namespace CGAL
// see <CGAL/config.h>
CGAL_PRAGMA_DIAG_PUSH
// see <CGAL/boost/parameter.h>
CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS
namespace CGAL
{
using namespace parameters;
#if defined(BOOST_MSVC)
# pragma warning(push)
@ -81,7 +52,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 )
@ -179,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 <CGAL/enable_warnings.h>

View File

@ -1,4 +1,5 @@
Algebraic_foundations
BGL
Circulator
Distance_2
Hash_map

View File

@ -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

View File

@ -33,7 +33,7 @@
#include <CGAL/disable_warnings.h>
#include <CGAL/Mesh_3/config.h>
#include <CGAL/Mesh_3/global_parameters.h>
#include <CGAL/boost/parameter.h>
#include <CGAL/Mesh_edge_criteria_3.h>
#include <CGAL/Mesh_facet_criteria_3.h>
#include <CGAL/Mesh_cell_criteria_3.h>
@ -45,8 +45,8 @@ namespace parameters {
// see <CGAL/config.h>
CGAL_PRAGMA_DIAG_PUSH
// see <CGAL/Mesh_3/config.h>
CGAL_MESH_3_IGNORE_BOOST_PARAMETER_NAME_WARNINGS
// see <CGAL/boost/parameter.h>
CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS
BOOST_PARAMETER_NAME( (edge_size, tag) edge_size_ )
BOOST_PARAMETER_NAME( (edge_sizing_field, tag) edge_sizing_field_ )

View File

@ -47,7 +47,7 @@
#include <boost/graph/adjacency_list.hpp>
#include <boost/dynamic_bitset.hpp>
#include <CGAL/boost/graph/split_graph_into_polylines.h>
#include <CGAL/internal/Mesh_3/helpers.h>
#include <CGAL/boost/iterator/transform_iterator.hpp>
#include <boost/foreach.hpp>
@ -57,156 +57,6 @@
namespace CGAL {
/// @cond DEVELOPERS
namespace internal {
namespace Mesh_3 {
template <typename Graph>
void dump_graph_edges(std::ostream& out, const Graph& g)
{
typedef typename boost::graph_traits<Graph>::vertex_descriptor vertex_descriptor;
typedef typename boost::graph_traits<Graph>::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 <typename Graph>
void dump_graph_edges(const char* filename, const Graph& g)
{
std::ofstream out(filename);
dump_graph_edges(out, g);
}
template <typename Kernel>
struct Angle_tester
{
template <typename vertex_descriptor, typename Graph>
bool operator()(vertex_descriptor& v, const Graph& g) const
{
typedef typename boost::graph_traits<Graph>::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 <typename Polyhedron>
struct Is_featured_edge {
const Polyhedron* polyhedron;
typename boost::property_map<Polyhedron, edge_is_feature_t>::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<Polyhedron>::edge_descriptor e) const {
return get(eifm, e);
}
}; // end Is_featured_edge<Polyhedron>
template <typename Polyhedron>
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<Polyhedron>::edge_descriptor e) const {
return is_border(halfedge(e, *polyhedron), *polyhedron) ||
is_border(opposite(halfedge(e, *polyhedron), *polyhedron), *polyhedron);
}
}; // end Is_featured_edge<Polyhedron>
template<typename Polyhedral_mesh_domain,
typename Polyline_with_context,
typename Graph>
struct Extract_polyline_with_context_visitor
{
typedef typename Polyhedral_mesh_domain::Polyhedron_type Polyhedron;
std::vector<Polyline_with_context>& polylines;
const Graph& graph;
Extract_polyline_with_context_visitor
(const Graph& graph,
typename std::vector<Polyline_with_context>& polylines)
: polylines(polylines), graph(graph)
{}
void start_new_polyline()
{
polylines.push_back(Polyline_with_context());
}
void add_node(typename boost::graph_traits<Graph>::vertex_descriptor vd)
{
if(polylines.back().polyline_content.empty()) {
polylines.back().polyline_content.push_back(graph[vd]);
}
}
void add_edge(typename boost::graph_traits<Graph>::edge_descriptor ed)
{
typename boost::graph_traits<Graph>::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<Graph>::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

View File

@ -32,7 +32,7 @@
#include <CGAL/disable_warnings.h>
#include <CGAL/Mesh_3/global_parameters.h>
#include <CGAL/boost/parameter.h>
#include <CGAL/Mesh_3/Robust_intersection_traits_3.h>
#include <CGAL/Side_of_triangle_mesh.h>

View File

@ -51,6 +51,7 @@
#include <boost/graph/adjacency_list.hpp>
#include <CGAL/boost/graph/split_graph_into_polylines.h>
#include <CGAL/Default.h>
#include <CGAL/internal/Mesh_3/helpers.h>
#include <CGAL/boost/iterator/transform_iterator.hpp>
#include <boost/foreach.hpp>
@ -62,132 +63,6 @@
namespace CGAL {
namespace internal {
namespace Mesh_3 {
template <typename Kernel>
struct Angle_tester
{
template <typename vertex_descriptor, typename Graph>
bool operator()(vertex_descriptor& v, const Graph& g) const
{
typedef typename boost::graph_traits<Graph>::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 <typename Polyhedron>
struct Is_featured_edge {
const Polyhedron* polyhedron;
typename boost::property_map<Polyhedron, edge_is_feature_t>::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<Polyhedron>::edge_descriptor e) const {
return get(eifm, e);
}
}; // end Is_featured_edge<Polyhedron>
template <typename Polyhedron>
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<Polyhedron>::edge_descriptor e) const {
return is_border(halfedge(e, *polyhedron), *polyhedron) ||
is_border(opposite(halfedge(e, *polyhedron), *polyhedron), *polyhedron);
}
}; // end Is_featured_edge<Polyhedron>
template<typename Polyhedral_mesh_domain,
typename Polyline_with_context,
typename Graph>
struct Extract_polyline_with_context_visitor
{
typedef typename Polyhedral_mesh_domain::Polyhedron Polyhedron;
std::vector<Polyline_with_context>& polylines;
const Graph& graph;
Extract_polyline_with_context_visitor
(const Graph& graph,
typename std::vector<Polyline_with_context>& polylines)
: polylines(polylines), graph(graph)
{}
void start_new_polyline()
{
polylines.push_back(Polyline_with_context());
}
void add_node(typename boost::graph_traits<Graph>::vertex_descriptor vd)
{
if(polylines.back().polyline_content.empty()) {
polylines.back().polyline_content.push_back(graph[vd]);
}
}
void add_edge(typename boost::graph_traits<Graph>::edge_descriptor ed)
{
typename boost::graph_traits<Graph>::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<Graph>::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<typename Base::Surface_patch_index> > Featured_edges_copy_graph;
public:
typedef Polyhedron_ Polyhedron;
typedef Polyhedron Polyhedron_type;
// Index types
typedef typename Base::Index Index;

View File

@ -34,8 +34,7 @@
#include <CGAL/Mesh_3/Slivers_exuder.h>
#include <CGAL/Mesh_optimization_return_code.h>
#include <CGAL/Mesh_3/parameters_defaults.h>
#include <CGAL/Mesh_3/global_parameters.h>
#include <boost/parameter.hpp>
#include <CGAL/boost/parameter.h>
namespace CGAL {
@ -46,8 +45,8 @@ namespace CGAL {
// see <CGAL/config.h>
CGAL_PRAGMA_DIAG_PUSH
// see <CGAL/Mesh_3/config.h>
CGAL_MESH_3_IGNORE_BOOST_PARAMETER_NAME_WARNINGS
// see <CGAL/boost/parameter.h>
CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS
BOOST_PARAMETER_FUNCTION(
(Mesh_optimization_return_code),

View File

@ -0,0 +1,195 @@
// 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 <CGAL/license/Mesh_3.h>
#include <iostream>
#include <fstream>
#include <boost/foreach.hpp>
#include <CGAL/disable_warnings.h>
namespace CGAL {
/// @cond DEVELOPERS
namespace internal {
namespace Mesh_3 {
template <typename Graph>
void dump_graph_edges(std::ostream& out, const Graph& g)
{
typedef typename boost::graph_traits<Graph>::vertex_descriptor vertex_descriptor;
typedef typename boost::graph_traits<Graph>::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 <typename Graph>
void dump_graph_edges(const char* filename, const Graph& g)
{
std::ofstream out(filename);
dump_graph_edges(out, g);
}
template <typename Kernel>
struct Angle_tester
{
template <typename vertex_descriptor, typename Graph>
bool operator()(vertex_descriptor& v, const Graph& g) const
{
typedef typename boost::graph_traits<Graph>::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 <typename Polyhedron>
struct Is_featured_edge {
const Polyhedron* polyhedron;
typename boost::property_map<Polyhedron, edge_is_feature_t>::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<Polyhedron>::edge_descriptor e) const {
return get(eifm, e);
}
}; // end Is_featured_edge<Polyhedron>
template <typename Polyhedron>
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<Polyhedron>::edge_descriptor e) const {
return is_border(halfedge(e, *polyhedron), *polyhedron) ||
is_border(opposite(halfedge(e, *polyhedron), *polyhedron), *polyhedron);
}
}; // end Is_featured_edge<Polyhedron>
template<typename Polyhedral_mesh_domain,
typename Polyline_with_context,
typename Graph>
struct Extract_polyline_with_context_visitor
{
typedef typename Polyhedral_mesh_domain::Polyhedron_type Polyhedron;
std::vector<Polyline_with_context>& polylines;
const Graph& graph;
Extract_polyline_with_context_visitor
(const Graph& graph,
typename std::vector<Polyline_with_context>& polylines)
: polylines(polylines), graph(graph)
{}
void start_new_polyline()
{
polylines.push_back(Polyline_with_context());
}
void add_node(typename boost::graph_traits<Graph>::vertex_descriptor vd)
{
if(polylines.back().polyline_content.empty()) {
polylines.back().polyline_content.push_back(graph[vd]);
}
}
void add_edge(typename boost::graph_traits<Graph>::edge_descriptor ed)
{
typename boost::graph_traits<Graph>::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<Graph>::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 <CGAL/enable_warnings.h>
#endif // CGAL_MESH_3_INTERNAL_MESH_3_HELPERS_H

View File

@ -30,7 +30,7 @@
#include <CGAL/disable_warnings.h>
#include <CGAL/Mesh_3/global_parameters.h>
#include <CGAL/boost/parameter.h>
#include <CGAL/Mesh_3/Mesh_global_optimizer.h>
#include <CGAL/Mesh_3/Lloyd_move.h>
#include <CGAL/Mesh_3/Mesh_sizing_field.h>
@ -47,8 +47,8 @@ namespace CGAL {
// see <CGAL/config.h>
CGAL_PRAGMA_DIAG_PUSH
// see <CGAL/Mesh_3/config.h>
CGAL_MESH_3_IGNORE_BOOST_PARAMETER_NAME_WARNINGS
// see <CGAL/boost/parameter.h>
CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS
BOOST_PARAMETER_FUNCTION(
(Mesh_optimization_return_code),

View File

@ -31,7 +31,7 @@
#include <CGAL/disable_warnings.h>
#include <CGAL/Mesh_3/config.h>
#include <CGAL/Mesh_3/global_parameters.h>
#include <CGAL/boost/parameter.h>
#include <CGAL/refine_mesh_3.h>
#include <CGAL/tags.h>
#include <CGAL/Mesh_3/Protect_edges_sizing_field.h>
@ -123,8 +123,8 @@ namespace parameters {
// see <CGAL/config.h>
CGAL_PRAGMA_DIAG_PUSH
// see <CGAL/Mesh_3/config.h>
CGAL_MESH_3_IGNORE_BOOST_PARAMETER_NAME_WARNINGS
// see <CGAL/boost/parameter.h>
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/config.h>
CGAL_PRAGMA_DIAG_PUSH
// see <CGAL/Mesh_3/config.h>
CGAL_MESH_3_IGNORE_BOOST_PARAMETER_NAME_WARNINGS
// see <CGAL/boost/parameter.h>
CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS
BOOST_PARAMETER_FUNCTION(
(void),

View File

@ -30,7 +30,7 @@
#include <CGAL/disable_warnings.h>
#include <CGAL/Mesh_3/global_parameters.h>
#include <CGAL/boost/parameter.h>
#include <CGAL/Mesh_3/Mesh_global_optimizer.h>
#include <CGAL/Mesh_3/Odt_move.h>
#include <CGAL/Mesh_3/Mesh_sizing_field.h>
@ -47,8 +47,8 @@ namespace CGAL {
// see <CGAL/config.h>
CGAL_PRAGMA_DIAG_PUSH
// see <CGAL/Mesh_3/config.h>
CGAL_MESH_3_IGNORE_BOOST_PARAMETER_NAME_WARNINGS
// see <CGAL/boost/parameter.h>
CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS
BOOST_PARAMETER_FUNCTION(
(Mesh_optimization_return_code),

View File

@ -30,7 +30,7 @@
#include <CGAL/disable_warnings.h>
#include <CGAL/Mesh_3/global_parameters.h>
#include <CGAL/boost/parameter.h>
#include <CGAL/Mesh_3/sliver_criteria.h>
#include <CGAL/Mesh_3/Sliver_perturber.h>
#include <CGAL/Mesh_optimization_return_code.h>
@ -48,8 +48,8 @@ namespace CGAL {
// see <CGAL/config.h>
CGAL_PRAGMA_DIAG_PUSH
// see <CGAL/Mesh_3/config.h>
CGAL_MESH_3_IGNORE_BOOST_PARAMETER_NAME_WARNINGS
// see <CGAL/boost/parameter.h>
CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS
BOOST_PARAMETER_FUNCTION(
(Mesh_optimization_return_code),

View File

@ -31,9 +31,9 @@
#include <CGAL/disable_warnings.h>
#include <CGAL/config.h>
#include <CGAL/boost/parameter.h>
#include <CGAL/Mesh_3/config.h>
#include <CGAL/Mesh_3/Dump_c3t3.h>
#include <CGAL/Mesh_3/global_parameters.h>
#include <CGAL/Mesh_3/Mesher_3.h>
#include <CGAL/Mesh_error_code.h>
#include <CGAL/optimize_mesh_3.h>
@ -236,8 +236,8 @@ namespace parameters {
// see <CGAL/config.h>
CGAL_PRAGMA_DIAG_PUSH
// see <CGAL/Mesh_3/config.h>
CGAL_MESH_3_IGNORE_BOOST_PARAMETER_NAME_WARNINGS
// see <CGAL/boost/parameter.h>
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/Mesh_3/global_parameters.h>
CGAL_BOOLEAN_PARAMETER(Reset,reset_c3t3,no_reset_c3t3)
// CGAL_BOOLEAN_PARAMETER defined in <CGAL/boost/parameter.h>
// see <CGAL/config.h>
CGAL_PRAGMA_DIAG_PUSH
// see <CGAL/Mesh_3/config.h>
CGAL_MESH_3_IGNORE_BOOST_PARAMETER_NAME_WARNINGS
// see <CGAL/boost/parameter.h>
CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS
// -----------------------------------
// Parameters
@ -445,8 +445,8 @@ CGAL_PRAGMA_DIAG_POP
// see <CGAL/config.h>
CGAL_PRAGMA_DIAG_PUSH
// see <CGAL/Mesh_3/config.h>
CGAL_MESH_3_IGNORE_BOOST_PARAMETER_NAME_WARNINGS
// see <CGAL/boost/parameter.h>
CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS
BOOST_PARAMETER_FUNCTION(
(void),

View File

@ -281,7 +281,7 @@ template <typename Tr,
>
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<Tr, Criteria, Surface, Oracle, BaseP, Facets_level>,
typename Tr::Cell_handle,
@ -294,7 +294,7 @@ class Poisson_refine_tets :
Facets_level& facets_level;
public:
typedef Poisson_refine_tets<Tr, Criteria, Surface, Oracle, Base, Facets_level> Self;
typedef Mesher_level <
typedef CGAL::Mesher_level <
Tr,
Poisson_refine_tets<Tr, Criteria, Surface, Oracle, Base, Facets_level>,
typename Tr::Cell_handle,

View File

@ -29,6 +29,7 @@
#include <CGAL/Surface_mesher/Null_oracle_visitor.h>
#include <CGAL/point_generators_3.h>
#include <CGAL/Surface_mesher/Sphere_oracle_3.h>
#include <CGAL/Surface_mesher/Implicit_surface_oracle_3.h>
#include <CGAL/Real_embeddable_traits.h>
#include <CGAL/squared_distance_3.h>
@ -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,18 +95,6 @@ namespace CGAL {
)
*/
namespace {
template <typename T>
struct Return_min : CGAL::binary_function<T, T, T>
{
T operator()(const T& a, const T& b) const
{
return (std::min)(a, b);
}
};
} // end anonymous namespace
template <
class GT,

View File

@ -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 <CGAL/Mesh_3/global_parameters.h>
#include <CGAL/boost/parameter.h>
#include <CGAL/Default.h>
#include "Polyhedron_type.h"

View File

@ -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 <stdexcept>

View File

@ -95,7 +95,7 @@
#define VISITED_CHECK 0
#define IMPASSABLE_CHECK 0
#include<stream.h>
#include<iostream>
#define DEBUGENDL(doit,msg,var)\
if(doit!=0) std::cout << msg << " " << var << endl;

View File

@ -496,11 +496,6 @@ namespace CGAL {
}; // end Implicit_surface_oracle_3
template <typename FT>
FT approximate_sqrt(const FT x) {
return FT (CGAL_NTS sqrt(CGAL_NTS to_double(x)));
}
} // namespace Surface_mesher
} // namespace CGAL

View File

@ -25,7 +25,7 @@
// include this to avoid a VC15 warning
#include <CGAL/boost/graph/named_function_params.h>
#include <CGAL/boost/graph/graph_traits_Triangulation_data_structure_2.h>
#include <boost/config.hpp>
#include <boost/iterator_adaptors.hpp>
#include <boost/graph/graph_traits.hpp>
@ -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.first<e.first->neighbor(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 Circ, class E>
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<const Circ*>(this)->operator*();
e = E(ed.first->neighbor(ed.second), ed.first->neighbor(ed.second)->index(ed.first));
return e;
}
};
template <class Circ, class E>
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<const Circ*>(this)->operator*();
e = E(ed);
return e;
}
};
template <typename Tr>
struct T2_halfedge_descriptor
{
@ -784,14 +676,6 @@ namespace std {
#ifndef CGAL_CFG_NO_STD_HASH
template < class T, class EdgeBase>
struct hash<CGAL::detail::Edge<T,EdgeBase> > {
std::size_t operator()(const CGAL::detail::Edge<T,EdgeBase>& e) const
{
return hash_value(e);
}
};
template < class Tr>
struct hash<CGAL::detail::T2_halfedge_descriptor<Tr> > {
std::size_t operator()(const CGAL::detail::T2_halfedge_descriptor<Tr>& e) const