diff --git a/.github/workflows/build_doc.yml b/.github/workflows/build_doc.yml
index 4956425db38..c02f87dcbe2 100644
--- a/.github/workflows/build_doc.yml
+++ b/.github/workflows/build_doc.yml
@@ -50,7 +50,7 @@ jobs:
run: |
set -x
sudo apt-get update && sudo apt-get install -y graphviz ssh bibtex2html
- sudo pip install lxml
+ sudo pip install lxml
sudo pip install 'pyquery==1.4.1' # it seems to be the last py2 compatible version
wget --no-verbose -O doxygen_exe https://cgal.geometryfactory.com/~mgimeno/doxygen/build_1_8_13/bin/doxygen
sudo mv doxygen_exe /usr/bin/doxygen
@@ -92,7 +92,7 @@ jobs:
egrep -v " ${PR_NUMBER}\." index.html > tmp.html || true
echo "
Manual for PR ${PR_NUMBER} ($ROUND)." >> ./tmp.html
mv tmp.html index.html
- git add ${PR_NUMBER}/$ROUND && git commit -q --amend -m "base commit" && git push -q -f -u origin master
+ git add ${PR_NUMBER}/$ROUND index.html && git commit -q --amend -m "base commit" && git push -q -f -u origin master
else
exit 1
fi
diff --git a/AABB_tree/demo/AABB_tree/AABB_demo.cpp b/AABB_tree/demo/AABB_tree/AABB_demo.cpp
index c69f7aa1281..018e0f69c14 100644
--- a/AABB_tree/demo/AABB_tree/AABB_demo.cpp
+++ b/AABB_tree/demo/AABB_tree/AABB_demo.cpp
@@ -19,18 +19,16 @@
#include
#include
#include
-
+#include
int main(int argc, char **argv)
{
+
+ CGAL::Qt::init_ogl_context(4,3);
QApplication app(argc, argv);
app.setOrganizationDomain("inria.fr");
app.setOrganizationName("INRIA");
app.setApplicationName("AABB tree demo");
- //for windows
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 3, 0))
- app.setAttribute(Qt::AA_UseDesktopOpenGL);
-#endif
// Import resources from libCGALQt (Qt5).
CGAL_QT_INIT_RESOURCES;
diff --git a/AABB_tree/demo/AABB_tree/CMakeLists.txt b/AABB_tree/demo/AABB_tree/CMakeLists.txt
index 7c006dec292..4ee33e3e45f 100644
--- a/AABB_tree/demo/AABB_tree/CMakeLists.txt
+++ b/AABB_tree/demo/AABB_tree/CMakeLists.txt
@@ -23,7 +23,7 @@ include_directories(BEFORE ./ ./include)
find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5)
# Find Qt5 itself
-find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Gui Svg)
+find_package(Qt5 QUIET COMPONENTS Script OpenGL Gui Svg)
if(CGAL_Qt5_FOUND AND Qt5_FOUND)
@@ -54,7 +54,7 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND)
#${CGAL_Qt5_MOC_FILES}
)
# Link with Qt libraries
- target_link_libraries(AABB_demo PRIVATE Qt5::OpenGL Qt5::Gui Qt5::Xml
+ target_link_libraries(AABB_demo PRIVATE Qt5::OpenGL Qt5::Gui
CGAL::CGAL CGAL::CGAL_Qt5)
add_to_cached_list(CGAL_EXECUTABLE_TARGETS AABB_demo)
diff --git a/AABB_tree/demo/AABB_tree/MainWindow.cpp b/AABB_tree/demo/AABB_tree/MainWindow.cpp
index c5d00c638bb..bde07b1b29f 100644
--- a/AABB_tree/demo/AABB_tree/MainWindow.cpp
+++ b/AABB_tree/demo/AABB_tree/MainWindow.cpp
@@ -22,8 +22,6 @@ MainWindow::MainWindow(QWidget* parent)
// saves some pointers from ui, for latter use.
m_pViewer = ui->viewer;
- // does not save the state of the viewer
- m_pViewer->setStateFileName(QString());
// accepts drop events
setAcceptDrops(true);
@@ -45,6 +43,7 @@ MainWindow::MainWindow(QWidget* parent)
MainWindow::~MainWindow()
{
+ m_pViewer->makeCurrent();
delete ui;
}
diff --git a/AABB_tree/demo/AABB_tree/Scene.cpp b/AABB_tree/demo/AABB_tree/Scene.cpp
index 69ba683a21b..b86be7ca292 100644
--- a/AABB_tree/demo/AABB_tree/Scene.cpp
+++ b/AABB_tree/demo/AABB_tree/Scene.cpp
@@ -91,8 +91,8 @@ void Scene::compile_shaders()
//Vertex source code
const char vertex_source[] =
{
- "#version 120 \n"
- "attribute highp vec4 vertex;\n"
+ "#version 150 \n"
+ "in highp vec4 vertex;\n"
"uniform highp mat4 mvp_matrix;\n"
"uniform highp mat4 f_matrix;\n"
"void main(void)\n"
@@ -103,10 +103,11 @@ void Scene::compile_shaders()
//Vertex source code
const char fragment_source[] =
{
- "#version 120 \n"
+ "#version 150 \n"
"uniform highp vec4 color; \n"
+ "out highp vec4 out_color; \n"
"void main(void) { \n"
- "gl_FragColor = color; \n"
+ "out_color = color; \n"
"} \n"
"\n"
};
@@ -139,26 +140,27 @@ void Scene::compile_shaders()
//Vertex source code
const char tex_vertex_source[] =
{
- "#version 120 \n"
- "attribute highp vec4 vertex;\n"
- "attribute highp vec2 tex_coord; \n"
+ "#version 150 \n"
+ "in highp vec4 vertex;\n"
+ "in highp vec2 tex_coord; \n"
"uniform highp mat4 mvp_matrix;\n"
"uniform highp mat4 f_matrix;\n"
- "varying highp vec2 texc;\n"
+ "out highp vec2 texc;\n"
"void main(void)\n"
"{\n"
" gl_Position = mvp_matrix * f_matrix * vertex;\n"
- " texc = tex_coord;\n"
+ " texc = tex_coord;\n"
"}"
};
//Vertex source code
const char tex_fragment_source[] =
{
- "#version 120 \n"
- "uniform sampler2D texture;\n"
- "varying highp vec2 texc;\n"
+ "#version 150 \n"
+ "uniform sampler2D s_texture;\n"
+ "in highp vec2 texc;\n"
+ "out highp vec4 out_color; \n"
"void main(void) { \n"
- "gl_FragColor = texture2D(texture, texc.st);\n"
+ "out_color = vec4(texture(s_texture, texc));\n"
"} \n"
"\n"
};
@@ -1319,12 +1321,8 @@ void Scene::deactivate_cutting_plane()
}
void Scene::initGL()
{
- gl = new QOpenGLFunctions_2_1();
- if(!gl->initializeOpenGLFunctions())
- {
- qFatal("ERROR : OpenGL Functions not initialized. Check your OpenGL Verison (should be >=3.3)");
- exit(1);
- }
+ gl = new QOpenGLFunctions();
+ gl->initializeOpenGLFunctions();
gl->glGenTextures(1, &textureId);
compile_shaders();
diff --git a/AABB_tree/demo/AABB_tree/Scene.h b/AABB_tree/demo/AABB_tree/Scene.h
index 95ea74cdc33..44d7b8239ce 100644
--- a/AABB_tree/demo/AABB_tree/Scene.h
+++ b/AABB_tree/demo/AABB_tree/Scene.h
@@ -86,7 +86,7 @@ public:
private:
// member data
- QOpenGLFunctions_2_1 *gl;
+ QOpenGLFunctions *gl;
Bbox m_bbox;
Polyhedron *m_pPolyhedron;
std::list m_points;
diff --git a/AABB_tree/include/CGAL/AABB_traits.h b/AABB_tree/include/CGAL/AABB_traits.h
index 470420162a7..613d08c174b 100644
--- a/AABB_tree/include/CGAL/AABB_traits.h
+++ b/AABB_tree/include/CGAL/AABB_traits.h
@@ -26,7 +26,6 @@
#include
#include
-#include
/// \file AABB_traits.h
@@ -274,13 +273,13 @@ public:
switch(Traits::longest_axis(bbox))
{
case AT::CGAL_AXIS_X: // sort along x
- std::nth_element(first, middle, beyond, boost::bind(Traits::less_x,_1,_2,m_traits));
+ std::nth_element(first, middle, beyond, [this](const Primitive& p1, const Primitive& p2){ return Traits::less_x(p1, p2, this->m_traits); });
break;
case AT::CGAL_AXIS_Y: // sort along y
- std::nth_element(first, middle, beyond, boost::bind(Traits::less_y,_1,_2,m_traits));
+ std::nth_element(first, middle, beyond, [this](const Primitive& p1, const Primitive& p2){ return Traits::less_y(p1, p2, this->m_traits); });
break;
case AT::CGAL_AXIS_Z: // sort along z
- std::nth_element(first, middle, beyond, boost::bind(Traits::less_z,_1,_2,m_traits));
+ std::nth_element(first, middle, beyond, [this](const Primitive& p1, const Primitive& p2){ return Traits::less_z(p1, p2, this->m_traits); });
break;
default:
CGAL_error();
diff --git a/Algebraic_foundations/include/CGAL/number_utils.h b/Algebraic_foundations/include/CGAL/number_utils.h
index abb7894ccf4..d29434ad603 100644
--- a/Algebraic_foundations/include/CGAL/number_utils.h
+++ b/Algebraic_foundations/include/CGAL/number_utils.h
@@ -302,13 +302,13 @@ to_interval( const Real_embeddable& x) {
}
template
-NT approximate_sqrt(const NT& nt, CGAL::Field_tag)
+NT approximate_sqrt(const NT& nt, CGAL::Null_functor)
{
return NT(sqrt(CGAL::to_double(nt)));
}
-template
-NT approximate_sqrt(const NT& nt, CGAL::Field_with_sqrt_tag)
+template
+NT approximate_sqrt(const NT& nt, Sqrt sqrt)
{
return sqrt(nt);
}
@@ -316,9 +316,12 @@ NT approximate_sqrt(const NT& nt, CGAL::Field_with_sqrt_tag)
template
NT approximate_sqrt(const NT& nt)
{
+ // the initial version of this function was using Algebraic_category
+ // for the dispatch but some ring type (like Gmpz) provides a Sqrt
+ // functor even if not being Field_with_sqrt.
typedef CGAL::Algebraic_structure_traits AST;
- typedef typename AST::Algebraic_category Algebraic_category;
- return approximate_sqrt(nt, Algebraic_category());
+ typedef typename AST::Sqrt Sqrt;
+ return approximate_sqrt(nt, Sqrt());
}
CGAL_NTS_END_NAMESPACE
diff --git a/Alpha_shapes_3/demo/Alpha_shapes_3/Alpha_shape_3.cpp b/Alpha_shapes_3/demo/Alpha_shapes_3/Alpha_shape_3.cpp
index dbe053e9824..784ee1af57f 100644
--- a/Alpha_shapes_3/demo/Alpha_shapes_3/Alpha_shape_3.cpp
+++ b/Alpha_shapes_3/demo/Alpha_shapes_3/Alpha_shape_3.cpp
@@ -5,18 +5,16 @@
#include
+#include
int main(int argc, char** argv)
{
- QApplication application(argc,argv);
+ CGAL::Qt::init_ogl_context(4,3);
+ QApplication application(argc,argv);
application.setOrganizationDomain("geometryfactory.com");
application.setOrganizationName("GeometryFactory");
application.setApplicationName("Alpha Shape Reconstruction");
- //for Windows
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 3, 0))
- application.setAttribute(Qt::AA_UseDesktopOpenGL);
-#endif
// Import resources from libCGALQt (Qt5).
// See https://doc.qt.io/qt-5/qdir.html#Q_INIT_RESOURCE
diff --git a/Alpha_shapes_3/demo/Alpha_shapes_3/CMakeLists.txt b/Alpha_shapes_3/demo/Alpha_shapes_3/CMakeLists.txt
index ede9b5e1367..4c7ecd50b4e 100644
--- a/Alpha_shapes_3/demo/Alpha_shapes_3/CMakeLists.txt
+++ b/Alpha_shapes_3/demo/Alpha_shapes_3/CMakeLists.txt
@@ -18,7 +18,7 @@ endif()
find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5)
-find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg)
+find_package(Qt5 QUIET COMPONENTS Script OpenGL Svg)
if(CGAL_Qt5_FOUND AND Qt5_FOUND)
diff --git a/Alpha_shapes_3/demo/Alpha_shapes_3/Viewer.cpp b/Alpha_shapes_3/demo/Alpha_shapes_3/Viewer.cpp
index a30e7a9a133..ad0e388412c 100644
--- a/Alpha_shapes_3/demo/Alpha_shapes_3/Viewer.cpp
+++ b/Alpha_shapes_3/demo/Alpha_shapes_3/Viewer.cpp
@@ -29,14 +29,14 @@ void Viewer::compile_shaders()
//Vertex source code
const char vertex_source[] =
{
- "#version 120 \n"
- "attribute highp vec4 vertex;\n"
- "attribute highp vec3 normal;\n"
+ "#version 150 \n"
+ "in highp vec4 vertex;\n"
+ "in highp vec3 normal;\n"
"uniform highp mat4 mvp_matrix;\n"
"uniform highp mat4 mv_matrix; \n"
- "varying highp vec4 fP; \n"
- "varying highp vec3 fN; \n"
+ "out highp vec4 fP; \n"
+ "out highp vec3 fN; \n"
"void main(void)\n"
"{\n"
" fP = mv_matrix * vertex; \n"
@@ -47,15 +47,16 @@ void Viewer::compile_shaders()
//Fragment source code
const char fragment_source[] =
{
- "#version 120 \n"
- "varying highp vec4 fP; \n"
- "varying highp vec3 fN; \n"
+ "#version 150 \n"
+ "in highp vec4 fP; \n"
+ "in highp vec3 fN; \n"
"uniform highp vec4 color; \n"
"uniform highp vec4 light_pos; \n"
"uniform highp vec4 light_diff; \n"
"uniform highp vec4 light_spec; \n"
"uniform highp vec4 light_amb; \n"
"uniform float spec_power ; \n"
+ "out highp vec4 out_color; \n"
"void main(void) { \n"
@@ -70,7 +71,7 @@ void Viewer::compile_shaders()
" highp vec4 diffuse = abs(dot(N,L)) * light_diff * color; \n"
" highp vec4 specular = pow(max(dot(R,V), 0.0), spec_power) * light_spec; \n"
- "gl_FragColor = light_amb*color + diffuse + specular ; \n"
+ "out_color = light_amb*color + diffuse + specular ; \n"
"} \n"
"\n"
};
@@ -105,8 +106,8 @@ rendering_program.bind();
//Vertex source code
const char vertex_source_points[] =
{
- "#version 120 \n"
- "attribute highp vec4 vertex;\n"
+ "#version 150 \n"
+ "in highp vec4 vertex;\n"
"uniform highp mat4 mvp_matrix;\n"
"uniform highp float point_size;\n"
@@ -119,11 +120,12 @@ const char vertex_source_points[] =
//Vertex source code
const char fragment_source_points[] =
{
- "#version 120 \n"
+ "#version 150 \n"
"uniform highp vec4 color; \n"
+ "out highp vec4 out_color; \n"
"void main(void) { \n"
- "gl_FragColor = color; \n"
+ "out_color = color; \n"
"} \n"
"\n"
};
diff --git a/Alpha_shapes_3/demo/Alpha_shapes_3/Viewer.h b/Alpha_shapes_3/demo/Alpha_shapes_3/Viewer.h
index ff19159d837..289ae385c1e 100644
--- a/Alpha_shapes_3/demo/Alpha_shapes_3/Viewer.h
+++ b/Alpha_shapes_3/demo/Alpha_shapes_3/Viewer.h
@@ -21,6 +21,7 @@ public:
Viewer(QWidget* parent);
~Viewer()
{
+ makeCurrent();
buffers[0].destroy();
buffers[1].destroy();
buffers[2].destroy();
diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/CMakeLists.txt b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/CMakeLists.txt
index 9d17f95361a..91b9ed0b08b 100644
--- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/CMakeLists.txt
+++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/CMakeLists.txt
@@ -3,9 +3,6 @@
cmake_minimum_required(VERSION 3.1...3.15)
project(Arrangement_on_surface_2_Demo)
-set(CMAKE_CXX_STANDARD 14)
-set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
-
if(NOT POLICY CMP0070 AND POLICY CMP0053)
# Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning.
cmake_policy(SET CMP0053 OLD)
diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_circular_line_arc_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_circular_line_arc_traits_2.h
index db91adb57cf..e913bc9f7db 100644
--- a/Arrangement_on_surface_2/include/CGAL/Arr_circular_line_arc_traits_2.h
+++ b/Arrangement_on_surface_2/include/CGAL/Arr_circular_line_arc_traits_2.h
@@ -159,11 +159,11 @@ namespace CGAL {
{ return CK_Equal_2()(a0, a1); }
result_type
- operator() ( const Line_arc_2 &a0, const Circular_arc_2 &a1) const
+ operator() ( const Line_arc_2 &/*a0*/, const Circular_arc_2 &/*a1*/) const
{ return false; }
result_type
- operator() ( const Circular_arc_2 &a0, const Line_arc_2 &a1) const
+ operator() ( const Circular_arc_2 &/*a0*/, const Line_arc_2 &/*a1*/) const
{ return false; }
result_type
diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_internals.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_internals.h
index 984ea6170a6..47afb1f2f68 100644
--- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_internals.h
+++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_internals.h
@@ -295,13 +295,6 @@ public:
return y;
}
- //! \brief the same as \c evaluate but arguments are passed by value
- //! (needed to substitute variables in bivariate polynomial)
- inline static NT binded_eval(Poly_1 poly, NT x)
- {
- return evaluate(poly, x);
- }
-
//! \brief evalutates a polynomial at certain x-coordinate
static NT evaluate(const Poly_1& poly, const NT& x,
bool *error_bounds_ = nullptr)
@@ -913,10 +906,9 @@ void get_precached_poly(int var, const NT& key, int /* level */, Poly_1& poly)
// }
if(not_cached||not_found) {
- poly = Poly_1(::boost::make_transform_iterator(coeffs->begin(),
- boost::bind2nd(std::ptr_fun(binded_eval), key1)),
- ::boost::make_transform_iterator(coeffs->end(),
- boost::bind2nd(std::ptr_fun(binded_eval), key1)));
+ auto fn = [&key1](const Poly_1& poly){ return evaluate(poly, key1); };
+ poly = Poly_1(::boost::make_transform_iterator(coeffs->begin(), fn),
+ ::boost::make_transform_iterator(coeffs->end(), fn));
if(not_cached)
return;
// all available space consumed: drop the least recently used entry
diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_traits.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_traits.h
index 752389a0f35..56595cd3835 100644
--- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_traits.h
+++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_traits.h
@@ -16,7 +16,6 @@
#include
#include
-#include
/*! \file CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_traits.h
* \brief
@@ -107,11 +106,13 @@ struct Transform {
template
OutputPoly_2 operator()(const CGAL::Polynomial& p, Op op = Op()) const {
-
- Transform tr;
+ typedef typename InputPoly_2::NT NT_in;
+ typedef typename OutputPoly_2::NT NT_out;
+ Transform tr;
+ auto fn = [&op, &tr](const NT_in& v){ return tr(v, op); };
return OutputPoly_2(
- ::boost::make_transform_iterator(p.begin(), boost::bind2nd(tr, op)),
- ::boost::make_transform_iterator(p.end(), boost::bind2nd(tr, op)));
+ ::boost::make_transform_iterator(p.begin(), fn),
+ ::boost::make_transform_iterator(p.end(), fn));
}
OutputPoly_2 operator()(
diff --git a/BGL/include/CGAL/boost/graph/IO/GOCAD.h b/BGL/include/CGAL/boost/graph/IO/GOCAD.h
index 25cdf0ce780..966e4f4219d 100644
--- a/BGL/include/CGAL/boost/graph/IO/GOCAD.h
+++ b/BGL/include/CGAL/boost/graph/IO/GOCAD.h
@@ -18,7 +18,7 @@
#include
#include
#include
-
+#include
#include
#include
@@ -271,7 +271,7 @@ bool read_GOCAD(const std::string& fname, Graph& g,
/// \cgalParamNBegin{stream_precision}
/// \cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
/// \cgalParamType{int}
-/// \cgalParamDefault{`6`}
+/// \cgalParamDefault{`the precision of the stream `os``}
/// \cgalParamNEnd
/// \cgalNamedParamsEnd
///
@@ -303,8 +303,7 @@ bool write_GOCAD(std::ostream& os,
if(!os.good())
return false;
- const int precision = choose_parameter(get_parameter(np, internal_np::stream_precision), 6);
- os.precision(precision);
+ set_stream_precision_from_NP(os, np);
os << "GOCAD TSurf 1\n"
"HEADER {\n"
@@ -380,7 +379,7 @@ bool write_GOCAD(std::ostream& os, const char* name, const Graph& g,
/// \cgalParamNBegin{stream_precision}
/// \cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
/// \cgalParamType{int}
-/// \cgalParamDefault{`6`}
+/// \cgalParamDefault{`the precision of the stream `os``}
/// \cgalParamNEnd
/// \cgalNamedParamsEnd
///
@@ -454,6 +453,7 @@ bool write_GOCAD(const std::string& fname,
{
std::ofstream os(fname);
CGAL::set_mode(os, CGAL::IO::ASCII);
+
return write_GOCAD(os, fname.c_str(), g, np);
}
diff --git a/BGL/include/CGAL/boost/graph/IO/Generic_facegraph_printer.h b/BGL/include/CGAL/boost/graph/IO/Generic_facegraph_printer.h
index 4ab13c13192..5fb75be5363 100644
--- a/BGL/include/CGAL/boost/graph/IO/Generic_facegraph_printer.h
+++ b/BGL/include/CGAL/boost/graph/IO/Generic_facegraph_printer.h
@@ -117,8 +117,7 @@ public:
if(!m_os.good())
return false;
- const int precision = choose_parameter(get_parameter(np, internal_np::stream_precision), 6);
- m_os.precision(precision);
+ set_stream_precision_from_NP(m_os, np);
VPM vpm = choose_parameter(get_parameter(np, internal_np::vertex_point),
get_const_property_map(CGAL::vertex_point, g));
diff --git a/BGL/include/CGAL/boost/graph/IO/OBJ.h b/BGL/include/CGAL/boost/graph/IO/OBJ.h
index 8e1c9b5ea89..7d733c9f8b4 100644
--- a/BGL/include/CGAL/boost/graph/IO/OBJ.h
+++ b/BGL/include/CGAL/boost/graph/IO/OBJ.h
@@ -231,7 +231,7 @@ bool read_OBJ(const std::string& fname, Graph& g,
\cgalParamNBegin{stream_precision}
\cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
\cgalParamType{int}
- \cgalParamDefault{`6`}
+ \cgalParamDefault{`the precision of the stream `os``}
\cgalParamNEnd
\cgalNamedParamsEnd
@@ -285,6 +285,11 @@ bool write_OBJ(std::ostream& os, const Graph& g,
\cgalParamExtra{If this parameter is omitted, an internal property map for `CGAL::vertex_point_t`
must be available in `Graph`.}
\cgalParamNEnd
+ \cgalParamNBegin{stream_precision}
+ \cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
+ \cgalParamType{int}
+ \cgalParamDefault{`6`}
+ \cgalParamNEnd
\cgalNamedParamsEnd
\returns `true` if writing was successful, `false` otherwise.
diff --git a/BGL/include/CGAL/boost/graph/IO/OFF.h b/BGL/include/CGAL/boost/graph/IO/OFF.h
index 0c95c7ea570..57685046e79 100644
--- a/BGL/include/CGAL/boost/graph/IO/OFF.h
+++ b/BGL/include/CGAL/boost/graph/IO/OFF.h
@@ -284,9 +284,9 @@ bool read_OFF(const std::string& fname, Graph& g,
\deprecated This function is deprecated since \cgal 5.2, `CGAL::read_OFF()` should be used instead.
*/
template
-CGAL_DEPRECATED bool read_off(std::ostream& os, Graph& g, const CGAL_BGL_NP_CLASS& np)
+CGAL_DEPRECATED bool read_off(std::istream& is, Graph& g, const CGAL_BGL_NP_CLASS& np)
{
- return read_OFF(os, g, np);
+ return read_OFF(is, g, np);
}
/*!
@@ -300,6 +300,18 @@ CGAL_DEPRECATED bool read_off(const char* fname, Graph& g, const CGAL_BGL_NP_CLA
return read_OFF(fname, g, np);
}
+template
+CGAL_DEPRECATED bool read_off(std::istream& is, Graph& g)
+{
+ return read_off(is, g, parameters::all_default());
+}
+
+template
+CGAL_DEPRECATED bool read_off(const char* fname, Graph& g)
+{
+ return read_off(fname, g, parameters::all_default());
+}
+
#endif // CGAL_NO_DEPRECATED_CODE
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -374,7 +386,7 @@ bool write_OFF_BGL(std::ostream& os,
\cgalParamNBegin{stream_precision}
\cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
\cgalParamType{int}
- \cgalParamDefault{`6`}
+ \cgalParamDefault{`the precision of the stream `os``}
\cgalParamNEnd
\cgalNamedParamsEnd
@@ -483,6 +495,7 @@ bool write_OFF(const std::string& fname,
std::cerr<<"Could not create file.";
return false;
}
+
return write_OFF(os, g, np);
}
@@ -510,6 +523,11 @@ CGAL_DEPRECATED bool write_off(std::ostream& os, const Graph& g, const CGAL_BGL_
return write_OFF(os, g, np);
}
+template
+CGAL_DEPRECATED bool write_off(std::ostream& os, const Graph& g)
+{
+ return write_off(os, g, CGAL::parameters::all_default());
+}
/*!
\ingroup PkgBGLIOFctDeprecated
@@ -521,6 +539,11 @@ CGAL_DEPRECATED bool write_off(const char* fname, const Graph& g, const CGAL_BGL
return write_OFF(fname, g, np);
}
+template
+CGAL_DEPRECATED bool write_off(const char* fname, const Graph& g)
+{
+ return write_off(fname, g, parameters::all_default());
+}
#endif // CGAL_NO_DEPRECATED_CODE
} // namespace CGAL
diff --git a/BGL/include/CGAL/boost/graph/IO/PLY.h b/BGL/include/CGAL/boost/graph/IO/PLY.h
index ff65a977f7b..c571c07d629 100644
--- a/BGL/include/CGAL/boost/graph/IO/PLY.h
+++ b/BGL/include/CGAL/boost/graph/IO/PLY.h
@@ -311,7 +311,7 @@ bool read_PLY(const std::string& fname, Graph& g,
\cgalParamNBegin{stream_precision}
\cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
\cgalParamType{int}
- \cgalParamDefault{`6`}
+ \cgalParamDefault{`the precision of the stream `os``}
\cgalParamExtra{This parameter is only meaningful while using ASCII encoding.}
\cgalParamNEnd
\cgalNamedParamsEnd
@@ -361,8 +361,7 @@ bool write_PLY(std::ostream& os,
if(!os.good())
return false;
- const int precision = choose_parameter(get_parameter(np, internal_np::stream_precision), 6);
- os.precision(precision);
+ set_stream_precision_from_NP(os, np);
// Write header
os << "ply" << std::endl
@@ -550,6 +549,7 @@ bool write_PLY(const std::string& fname,
{
std::ofstream os(fname);
CGAL::set_mode(os, CGAL::IO::ASCII);
+
return write_PLY(os, g, comments, np);
}
}
diff --git a/BGL/include/CGAL/boost/graph/IO/STL.h b/BGL/include/CGAL/boost/graph/IO/STL.h
index de10a9a95a5..78bd1fcb588 100644
--- a/BGL/include/CGAL/boost/graph/IO/STL.h
+++ b/BGL/include/CGAL/boost/graph/IO/STL.h
@@ -231,7 +231,7 @@ bool read_STL(const std::string& fname, Graph& g) { return read_STL(fname, g, pa
\cgalParamNBegin{stream_precision}
\cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
\cgalParamType{int}
- \cgalParamDefault{`6`}
+ \cgalParamDefault{`the precision of the stream `os``}
\cgalParamExtra{This parameter is only meaningful while using ASCII encoding.}
\cgalParamNEnd
\cgalNamedParamsEnd
@@ -262,8 +262,7 @@ bool write_STL(std::ostream& os,
if(!os.good())
return false;
- const int precision = choose_parameter(get_parameter(np, internal_np::stream_precision), 6);
- os.precision(precision);
+ set_stream_precision_from_NP(os, np);
if(get_mode(os) == IO::BINARY)
{
@@ -372,6 +371,7 @@ bool write_STL(const std::string& fname, const Graph& g, const CGAL_BGL_NP_CLASS
{
std::ofstream os(fname);
CGAL::set_mode(os, CGAL::IO::ASCII);
+
return write_STL(os, g, np);
}
}
diff --git a/BGL/include/CGAL/boost/graph/IO/VTK.h b/BGL/include/CGAL/boost/graph/IO/VTK.h
index 1ba37f19d6c..894b3598b09 100644
--- a/BGL/include/CGAL/boost/graph/IO/VTK.h
+++ b/BGL/include/CGAL/boost/graph/IO/VTK.h
@@ -420,7 +420,7 @@ void write_polys_points(std::ostream& os,
* \cgalParamNBegin{stream_precision}
* \cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
* \cgalParamType{int}
- * \cgalParamDefault{`6`}
+ * \cgalParamDefault{`the precision of the stream `os``}
* \cgalParamNEnd
* \cgalNamedParamsEnd
*
@@ -439,8 +439,7 @@ bool write_VTP(std::ostream& os,
if(!os.good())
return false;
- const int precision = choose_parameter(get_parameter(np, internal_np::stream_precision), 6);
- os.precision(precision);
+ set_stream_precision_from_NP(os, np);
os << "\n"
<< "
+CGAL_DEPRECATED bool write_vtp(std::ostream& os, const Graph& g)
+{
+ return write_vtp(os, g, parameters::all_default());
+}
+
#endif // CGAL_NO_DEPRECATED_CODE
} // namespace CGAL
diff --git a/BGL/include/CGAL/boost/graph/IO/WRL.h b/BGL/include/CGAL/boost/graph/IO/WRL.h
index c9d2f69b6b5..dc8186862c7 100644
--- a/BGL/include/CGAL/boost/graph/IO/WRL.h
+++ b/BGL/include/CGAL/boost/graph/IO/WRL.h
@@ -59,7 +59,7 @@ namespace CGAL {
\cgalParamNBegin{stream_precision}
\cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
\cgalParamType{int}
- \cgalParamDefault{`6`}
+ \cgalParamDefault{`the precision of the stream `os``}
\cgalParamNEnd
\cgalNamedParamsEnd
@@ -70,7 +70,8 @@ bool write_WRL(std::ostream& os,
const Graph& g,
const CGAL_BGL_NP_CLASS& np)
{
- IO::internal::Generic_facegraph_printer printer(os);
+ CGAL::VRML_2_ostream vos(os);
+ IO::internal::Generic_facegraph_printer printer(vos);
return printer(g, np);
}
@@ -108,8 +109,8 @@ bool write_WRL(std::ostream& os,
template
bool write_WRL(const std::string& fname, const Graph& g, const CGAL_BGL_NP_CLASS& np)
{
- std::ifstream is(fname);
- return write_WRL(is, g, np);
+ std::ofstream os(fname);
+ return write_WRL(os, g, np);
}
template
@@ -130,6 +131,12 @@ CGAL_DEPRECATED bool write_wrl(std::ostream& os, const Graph& g, const CGAL_BGL_
return write_WRL(os, g, np);
}
+template
+CGAL_DEPRECATED bool write_wrl(std::ostream& os, const Graph& g)
+{
+ return write_wrl(os, g, parameters::all_default());
+}
+
#endif // CGAL_NO_DEPRECATED_CODE
} // namespace CGAL
diff --git a/BGL/include/CGAL/boost/graph/copy_face_graph.h b/BGL/include/CGAL/boost/graph/copy_face_graph.h
index c396484f4ed..19755ac8e46 100644
--- a/BGL/include/CGAL/boost/graph/copy_face_graph.h
+++ b/BGL/include/CGAL/boost/graph/copy_face_graph.h
@@ -167,6 +167,8 @@ void copy_face_graph_impl(const SourceMesh& sm, TargetMesh& tm,
for(tm_vertex_descriptor v : vertices(tm))
{
tm_halfedge_descriptor h = halfedge(v, tm);
+ if (h==boost::graph_traits::null_halfedge())
+ continue;
tm_halfedge_descriptor next_around_vertex=h;
do{
next_around_vertex=opposite(next(next_around_vertex, tm), tm);
diff --git a/BGL/include/CGAL/boost/graph/named_params_helper.h b/BGL/include/CGAL/boost/graph/named_params_helper.h
index 0993fb05d69..b3a32e15dc4 100644
--- a/BGL/include/CGAL/boost/graph/named_params_helper.h
+++ b/BGL/include/CGAL/boost/graph/named_params_helper.h
@@ -27,6 +27,20 @@
namespace CGAL {
+ namespace parameters
+ {
+ template
+ struct Is_default
+ {
+ typedef typename internal_np::Lookup_named_param_def <
+ Parameter,
+ NamedParameters,
+ internal_np::Param_not_found > ::type NP_type;
+ static const bool value = boost::is_same::value;
+ typedef CGAL::Boolean_tag type;
+ };
+ } // end of parameters namespace
+
// forward declarations to avoid dependency to Solver_interface
template
class Default_diagonalize_traits;
@@ -560,6 +574,21 @@ CGAL_DEF_GET_INITIALIZED_INDEX_MAP(face, typename boost::graph_traits::fa
Alpha_expansion_boost_adjacency_list_tag
>::type type;
};
+
+ template
+ void set_stream_precision_from_NP(std::ostream& os, const NP& np)
+ {
+ using parameters::get_parameter;
+ using parameters::choose_parameter;
+ using parameters::is_default_parameter;
+
+ if(!is_default_parameter(get_parameter(np, internal_np::stream_precision)))
+ {
+ const int precision = choose_parameter(get_parameter(np,
+ internal_np::stream_precision));
+ os.precision(precision);
+ }
+ }
} //namespace CGAL
diff --git a/BGL/include/CGAL/boost/graph/parameters_interface.h b/BGL/include/CGAL/boost/graph/parameters_interface.h
index 5a9f467dbb2..eebd236eaca 100644
--- a/BGL/include/CGAL/boost/graph/parameters_interface.h
+++ b/BGL/include/CGAL/boost/graph/parameters_interface.h
@@ -61,6 +61,7 @@ CGAL_add_named_parameter(geom_traits_t, geom_traits, geom_traits)
CGAL_add_named_parameter(vertex_incident_patches_t, vertex_incident_patches, vertex_incident_patches_map)
CGAL_add_named_parameter(density_control_factor_t, density_control_factor, density_control_factor)
CGAL_add_named_parameter(use_delaunay_triangulation_t, use_delaunay_triangulation, use_delaunay_triangulation)
+CGAL_add_named_parameter(use_2d_constrained_delaunay_triangulation_t, use_2d_constrained_delaunay_triangulation, use_2d_constrained_delaunay_triangulation)
CGAL_add_named_parameter(fairing_continuity_t, fairing_continuity, fairing_continuity)
CGAL_add_named_parameter(sparse_linear_solver_t, sparse_linear_solver, sparse_linear_solver)
CGAL_add_named_parameter(number_of_relaxation_steps_t, number_of_relaxation_steps, number_of_relaxation_steps)
@@ -117,6 +118,7 @@ CGAL_add_named_parameter(volume_threshold_t, volume_threshold, volume_threshold)
CGAL_add_named_parameter(dry_run_t, dry_run, dry_run)
CGAL_add_named_parameter(do_not_modify_t, do_not_modify, do_not_modify)
CGAL_add_named_parameter(allow_self_intersections_t, allow_self_intersections, allow_self_intersections)
+CGAL_add_named_parameter(non_manifold_feature_map_t, non_manifold_feature_map, non_manifold_feature_map)
CGAL_add_named_parameter(polyhedral_envelope_epsilon_t, polyhedral_envelope_epsilon, polyhedral_envelope_epsilon)
// List of named parameters that we use in the package 'Surface Mesh Simplification'
diff --git a/BGL/test/BGL/CMakeLists.txt b/BGL/test/BGL/CMakeLists.txt
index d6ec47e9cae..3009a3ae873 100644
--- a/BGL/test/BGL/CMakeLists.txt
+++ b/BGL/test/BGL/CMakeLists.txt
@@ -98,6 +98,8 @@ create_single_source_cgal_program(
create_single_source_cgal_program( "graph_traits_inheritance.cpp" )
+create_single_source_cgal_program("test_deprecated_io.cpp")
+
if(OpenMesh_FOUND)
target_link_libraries(test_clear PRIVATE ${OPENMESH_LIBRARIES})
target_compile_definitions(test_clear PRIVATE -DCGAL_USE_OPENMESH)
@@ -129,6 +131,8 @@ if (VTK_FOUND)
if(VTK_LIBRARIES)
target_link_libraries(test_bgl_read_write PRIVATE ${VTK_LIBRARIES})
target_compile_definitions(test_bgl_read_write PRIVATE -DCGAL_USE_VTK)
+ target_link_libraries(test_deprecated_io PRIVATE ${VTK_LIBRARIES})
+ target_compile_definitions(test_deprecated_io PRIVATE -DCGAL_USE_VTK)
else()
message(STATUS "Tests that use VTK will not be compiled.")
endif()
diff --git a/BGL/test/BGL/test_Euler_operations.cpp b/BGL/test/BGL/test_Euler_operations.cpp
index ed9e43126b0..21b8809897d 100644
--- a/BGL/test/BGL/test_Euler_operations.cpp
+++ b/BGL/test/BGL/test_Euler_operations.cpp
@@ -35,6 +35,57 @@ test_copy_face_graph_nm_umbrella()
}
}
+template
+void
+test_copy_face_graph_isolated_vertices()
+{
+ typedef Kernel::Point_3 Point_3;
+
+ {
+ T s, t;
+ add_vertex(s);
+ CGAL::copy_face_graph(s, t);
+ }
+
+ {
+ T s, t;
+ add_vertex(t);
+ CGAL::copy_face_graph(s, t);
+ }
+
+ {
+ T s, t;
+ CGAL::make_triangle(Point_3(), Point_3(), Point_3(), s);
+ add_vertex(s);
+ t=s;
+ CGAL::copy_face_graph(s, t);
+ }
+
+ {
+ T s, t;
+ CGAL::make_triangle(Point_3(), Point_3(), Point_3(), s);
+ add_vertex(s);
+ add_vertex(t);
+ CGAL::copy_face_graph(s, t);
+ }
+
+ {
+ T s, t;
+ CGAL::make_tetrahedron(Point_3(), Point_3(), Point_3(), Point_3(), s);
+ add_vertex(s);
+ t=s;
+ CGAL::copy_face_graph(s, t);
+ }
+
+ {
+ T s, t;
+ CGAL::make_tetrahedron(Point_3(), Point_3(), Point_3(), Point_3(), s);
+ add_vertex(s);
+ add_vertex(t);
+ CGAL::copy_face_graph(s, t);
+ }
+}
+
template
void
join_face_test()
@@ -619,6 +670,7 @@ void
test_Euler_operations()
{
test_copy_face_graph_nm_umbrella();
+ test_copy_face_graph_isolated_vertices();
join_face_test();
add_vertex_and_face_to_border_test();
add_face_to_border_test();
diff --git a/BGL/test/BGL/test_bgl_read_write.cpp b/BGL/test/BGL/test_bgl_read_write.cpp
index de6fd4918bb..5be2d9e33e9 100644
--- a/BGL/test/BGL/test_bgl_read_write.cpp
+++ b/BGL/test/BGL/test_bgl_read_write.cpp
@@ -171,10 +171,10 @@ void test_bgl_OFF(const char* filename)
assert(ok);
assert(num_vertices(fg) == 8 && num_faces(fg) == 4);
- for(const auto v : vertices(fg))
+ for(auto v : vertices(fg))
assert(get(vcm, v) != CGAL::Color());
- for(const auto f : faces(fg))
+ for(auto f : faces(fg))
assert(get(fcm, f) != CGAL::Color());
// write with OFF
@@ -192,10 +192,10 @@ void test_bgl_OFF(const char* filename)
assert(ok);
assert(are_equal_meshes(fg, fg2));
- for(const auto v : vertices(fg2))
+ for(auto v : vertices(fg2))
assert(get(vcm2, v) != CGAL::Color());
- for(const auto f : faces(fg2))
+ for(auto f : faces(fg2))
assert(get(fcm2, f) != CGAL::Color());
}
@@ -211,7 +211,7 @@ void test_bgl_OFF(const char* filename)
assert(ok);
assert(are_equal_meshes(fg, fg2));
- for(const auto v : vertices(fg2))
+ for(auto v : vertices(fg2))
assert(get(vcm2, v) != CGAL::Color());
}
}
@@ -224,7 +224,7 @@ void test_bgl_OFF(const char* filename)
ok = CGAL::read_OFF("data/mesh_with_normals.off", fg, CGAL::parameters::vertex_normal_map(vnm));
assert(ok);
- for(const auto v : vertices(fg))
+ for(auto v : vertices(fg))
assert(get(vnm, v) != CGAL::NULL_VECTOR);
// write with OFF
@@ -240,7 +240,7 @@ void test_bgl_OFF(const char* filename)
assert(ok);
assert(are_equal_meshes(fg, fg2));
- for(const auto v : vertices(fg2))
+ for(auto v : vertices(fg2))
assert(get(vnm2, v) != CGAL::NULL_VECTOR);
}
@@ -256,7 +256,7 @@ void test_bgl_OFF(const char* filename)
assert(ok);
assert(are_equal_meshes(fg, fg2));
- for(const auto v : vertices(fg2))
+ for(auto v : vertices(fg2))
assert(get(vnm2, v) != CGAL::NULL_VECTOR);
}
}
@@ -278,13 +278,13 @@ void test_bgl_OFF(const char* filename)
assert(ok);
assert(num_vertices(fg) != 0 && num_faces(fg) != 0);
- for(const auto v : vertices(fg))
+ for(auto v : vertices(fg))
{
assert(get(vnm2, v) != CGAL::NULL_VECTOR);
assert(get(vcm2, v) != CGAL::Color());
}
- for(const auto f : faces(fg))
+ for(auto f : faces(fg))
assert(get(fcm2, f) != CGAL::Color());
fg.clear();
is.close();
@@ -301,7 +301,7 @@ void test_bgl_OFF(const char* filename)
assert(ok);
assert(num_vertices(fg) != 0 && num_faces(fg) != 0);
- for(const auto v : vertices(fg))
+ for(auto v : vertices(fg))
{
assert(get(vnm, v) != CGAL::NULL_VECTOR);
assert(get(vcm, v) != CGAL::Color());
@@ -328,13 +328,13 @@ void test_bgl_OFF(const char* filename)
assert(ok);
assert(are_equal_meshes(fg, fg2));
- for(const auto v : vertices(fg2))
+ for(auto v : vertices(fg2))
{
assert(get(vnm2, v) != CGAL::NULL_VECTOR);
assert(get(vcm2, v) != CGAL::Color());
}
- for(const auto f : faces(fg2))
+ for(auto f : faces(fg2))
assert(get(fcm2, f) != CGAL::Color());
}
@@ -359,13 +359,13 @@ void test_bgl_OFF(const char* filename)
assert(ok);
assert(are_equal_meshes(fg, fg2));
- for(const auto v : vertices(fg2))
+ for(auto v : vertices(fg2))
{
assert(get(vnm2, v) != CGAL::NULL_VECTOR);
assert(get(vcm2, v) != CGAL::Color());
}
- for(const auto f : faces(fg2))
+ for(auto f : faces(fg2))
assert(get(fcm2, f) != CGAL::Color());
}
}
@@ -526,12 +526,12 @@ void test_bgl_PLY(const std::string filename,
assert(ok);
assert(num_vertices(fg) == 4 && num_faces(fg) == 4);
- for(const auto v : vertices(fg))
+ for(auto v : vertices(fg))
{
assert(get(vcm, v) != CGAL::Color());
}
- for(const auto f : faces(fg))
+ for(auto f : faces(fg))
assert(get(fcm, f) != CGAL::Color());
// write with PLY
@@ -561,10 +561,10 @@ void test_bgl_PLY(const std::string filename,
assert(are_equal_meshes(fg, fg2));
// @tmp
-// for(const auto v : vertices(fg2))
+// for(auto v : vertices(fg2))
// assert(get(vcm2, v) != CGAL::Color());
-// for(const auto f : faces(fg2))
+// for(auto f : faces(fg2))
// assert(get(fcm2, f) != CGAL::Color());
}
@@ -586,10 +586,10 @@ void test_bgl_PLY(const std::string filename,
assert(are_equal_meshes(fg, fg2));
// @tmp
-// for(const auto v : vertices(fg2))
+// for(auto v : vertices(fg2))
// assert(get(vcm2, v) != CGAL::Color());
-// for(const auto f : faces(fg2))
+// for(auto f : faces(fg2))
// assert(get(fcm2, f) != CGAL::Color());
}
diff --git a/BGL/test/BGL/test_cgal_bgl_named_params.cpp b/BGL/test/BGL/test_cgal_bgl_named_params.cpp
index 14ec4f0a0cd..277e4a1153d 100644
--- a/BGL/test/BGL/test_cgal_bgl_named_params.cpp
+++ b/BGL/test/BGL/test_cgal_bgl_named_params.cpp
@@ -63,6 +63,7 @@ void test(const NamedParameters& np)
assert(get_parameter(np, CGAL::internal_np::vertex_incident_patches).v == 11);
assert(get_parameter(np, CGAL::internal_np::density_control_factor).v == 12);
assert(get_parameter(np, CGAL::internal_np::use_delaunay_triangulation).v == 13);
+ assert(get_parameter(np, CGAL::internal_np::use_2d_constrained_delaunay_triangulation).v == 4573);
assert(get_parameter(np, CGAL::internal_np::fairing_continuity).v == 14);
assert(get_parameter(np, CGAL::internal_np::sparse_linear_solver).v == 15);
assert(get_parameter(np, CGAL::internal_np::number_of_relaxation_steps).v == 16);
@@ -106,6 +107,8 @@ void test(const NamedParameters& np)
assert(get_parameter(np, CGAL::internal_np::allow_self_intersections).v == 66);
assert(get_parameter(np, CGAL::internal_np::polyhedral_envelope_epsilon).v == 67);
assert(get_parameter(np, CGAL::internal_np::maximum_number_of_faces).v == 78910);
+ assert(get_parameter(np, CGAL::internal_np::non_manifold_feature_map).v == 60);
+ assert(get_parameter(np, CGAL::internal_np::filter).v == 61);
// Named parameters that we use in the package 'Surface Mesh Simplification'
assert(get_parameter(np, CGAL::internal_np::get_cost_policy).v == 34);
@@ -163,6 +166,7 @@ void test(const NamedParameters& np)
check_same_type<11>(get_parameter(np, CGAL::internal_np::vertex_incident_patches));
check_same_type<12>(get_parameter(np, CGAL::internal_np::density_control_factor));
check_same_type<13>(get_parameter(np, CGAL::internal_np::use_delaunay_triangulation));
+ check_same_type<4573>(get_parameter(np, CGAL::internal_np::use_2d_constrained_delaunay_triangulation));
check_same_type<14>(get_parameter(np, CGAL::internal_np::fairing_continuity));
check_same_type<15>(get_parameter(np, CGAL::internal_np::sparse_linear_solver));
check_same_type<16>(get_parameter(np, CGAL::internal_np::number_of_relaxation_steps));
@@ -219,6 +223,8 @@ void test(const NamedParameters& np)
check_same_type<62>(get_parameter(np, CGAL::internal_np::halfedges_keeper));
check_same_type<64>(get_parameter(np, CGAL::internal_np::do_simplify_border));
check_same_type<78910>(get_parameter(np, CGAL::internal_np::maximum_number_of_faces));
+ check_same_type<60>(get_parameter(np, CGAL::internal_np::non_manifold_feature_map));
+ check_same_type<61>(get_parameter(np, CGAL::internal_np::filter));
// Named parameters that we use in the package 'Surface Mesh Simplification'
check_same_type<34>(get_parameter(np, CGAL::internal_np::get_cost_policy));
@@ -310,6 +316,7 @@ int main()
.vertex_incident_patches_map(A<11>(11))
.density_control_factor(A<12>(12))
.use_delaunay_triangulation(A<13>(13))
+ .use_2d_constrained_delaunay_triangulation(A<4573>(4573))
.fairing_continuity(A<14>(14))
.sparse_linear_solver(A<15>(15))
.number_of_relaxation_steps(A<16>(16))
@@ -344,6 +351,8 @@ int main()
.throw_on_self_intersection(A<43>(43))
.clip_volume(A<44>(44))
.use_compact_clipper(A<45>(45))
+ .non_manifold_feature_map(A<60>(60))
+ .filter(A<61>(61))
.apply_per_connected_component(A<46>(46))
.output_iterator(A<47>(47))
.erase_all_duplicates(A<48>(48))
diff --git a/BGL/test/BGL/test_deprecated_io.cpp b/BGL/test/BGL/test_deprecated_io.cpp
new file mode 100644
index 00000000000..5bd037191cc
--- /dev/null
+++ b/BGL/test/BGL/test_deprecated_io.cpp
@@ -0,0 +1,58 @@
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+
+
+typedef CGAL::Simple_cartesian Kernel;
+typedef Kernel::Point_3 Point_3;
+typedef CGAL::Surface_mesh SM;
+
+int main()
+{
+ // OFF
+ SM sm_in, sm_out;
+ Point_3 p0(0,0,0), p1(1,0,0), p2(0,1,0);
+ CGAL::make_triangle(p0, p1, p2, sm_out);
+ bool ok = CGAL::write_off("tmp.off", sm_out);
+ assert(ok);
+ ok = CGAL::read_off("tmp.off", sm_in);
+ assert(ok);
+ assert(num_vertices(sm_in) == 3 && num_faces(sm_in) == 1);
+ sm_in.clear();
+
+ std::ofstream os("tmp.off");
+ ok = CGAL::write_off(os, sm_out);
+ assert(ok);
+ os.close();
+ std::ifstream is("tmp.off");
+ ok = CGAL::read_off(is, sm_in);
+ assert(ok);
+ assert(num_vertices(sm_in) == 3 && num_faces(sm_in) == 1);
+ is.close();
+ sm_in.clear();
+#ifdef CGAL_USE_VTK
+ //vtk
+ os.open("tmp.vtp");
+ ok = CGAL::write_vtp(os, sm_out);
+ assert(ok);
+ os.close();
+
+ ok = CGAL::read_VTP("tmp.vtp", sm_in);
+ assert(ok);
+ assert(num_vertices(sm_in) == 3 && num_faces(sm_in) == 1);
+ sm_in.clear();
+#endif
+ //wrl
+ os.open("tmp.wrl");
+ ok = CGAL::write_wrl(os, sm_out);
+ assert(ok);
+ os.close();
+ return EXIT_SUCCESS;
+}
diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2.h
index 4f1ed78e348..31eb450f116 100644
--- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2.h
+++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2.h
@@ -1,460 +1,1018 @@
namespace CGAL {
-/*!
-\addtogroup boolean_complement Complement Functions
-\ingroup PkgBooleanSetOperations2Ref
-\anchor ref_bso_complement
+/*! \addtogroup boolean_complement Complement Functions
+ * \ingroup PkgBooleanSetOperations2Ref
+ * \anchor ref_bso_complement
+ *
+ * There are several overloaded function templates called `complement()` that
+ * compute the \e complement of a given polygon `pgn`. Depending on the type of
+ * the polygon `pgn` the complement is either a single (general) polygon with
+ * holes, or several (general) poylgons with holes. In the latter case the
+ * `complement()` function template inserts the resulting poylgons with holes
+ * into a container via an output iterator.
+ *
+ * A function template in this group has one of the two following signatures:
+ * - `void complement(const Type1& pgn, Type2& res);`
+ * - `void complement(const Type1& pgn, Type2& res, const GpsTraits& traits);`
+ *
+ * \cgalHeading{Parameters}
+ *
+ * The types `Type` and `Type2` of the parameters must be convertible to the
+ * types specified in a row in the table below, respectively.
+ *
+ *
+ *
+ * | `Type1` | `Type2` |
+ * | `Polygon_2` | `Polygon_with_holes_2` |
+ * | `Polygon_with_holes_2` | `Polygon_with_holes_2` |
+ * | `General_polygon_2` | `General_polygon_with_holes_2` |
+ * | `General_polygon_with_holes_2` | `General_polygon_with_holes_2` |
+ *
+ *
+ *
+ * \sa \link boolean_do_intersect `CGAL::do_intersect()` \endlink
+ * \sa \link boolean_intersection `CGAL::intersection()` \endlink
+ * \sa \link boolean_join `CGAL::join()` \endlink
+ * \sa \link boolean_difference `CGAL::difference()` \endlink
+ * \sa \link boolean_symmetric_difference `CGAL::symmetric_difference()` \endlink
+ */
-The `complement` function is overloaded. Depending on the
-type of polygon `pgn` the complement is either a single (general) polygon with
-holes, or several (general) poylgons with holes. In the latter case
-the `complement function` writes them into an output iterator
-`oi`.
-
-\param pgn The input polygon for the `complement` function. It may be of the type
-`Polygon_2`, `General_polygon_2`, `Polygon_with_holes_2`, or
-`General_polygon_with_holes_2`.
-
-
-
-\sa \link boolean_do_intersect `CGAL::do_intersect()` \endlink
-\sa \link boolean_intersection `CGAL::intersection()` \endlink
-\sa \link boolean_join `CGAL::join()` \endlink
-\sa \link boolean_difference `CGAL::difference()` \endlink
-\sa \link boolean_symmetric_difference `CGAL::symmetric_difference()` \endlink
-*/
/// @{
-/*!
- writes the complement of the polygon `pgn` into the polygon with holes `res`.
- */
-template
-void complement(const Polygon_2 & pgn, Polygon_with_holes_2 & res);
+//////// Traits-less
-/*!
- writes the complement of the general polygon `pgn` into the general polygon with holes `res`.
+/*! computes the complement of a polygon.
+ * \param pgn the input polygon.
+ * \param res the resulting complement of \p pgn.
*/
-template
-void complement(const General_polygon_2 & pgn, General_polygon_with_holes_2 & res);
+template
+void complement(const Polygon_2& pgn,
+ Polygon_with_holes_2& res);
-/*!
- writes the complement of the polygon with holes `pgn` into the output iterator `oi`.
- The value type of `oi` is `Polygon_with_holes_2`.
+/*! computes the complement of a general polygon.
+ * \param pgn the input polygon.
+ * \param res the complement of \p pgn.
+ * \pre `%ArrTraits` must be a model of the concept
+ * `ArrangementDirectionalXMonotoneTraits_2`.
*/
-template
-OutputIterator complement(const Polygon_with_holes_2 & pgn, OutputIterator oi);
+template
+void
+complement(const General_polygon_2& pgn,
+ General_polygon_with_holes_2 >& res);
-/*!
- writes the complement of the general polygon with holes `pgn` into the output iterator `oi`.
- The value type of `oi` is `General_polygon_with_holes_2`.
+/*! computes the complement of a polygon with holes.
+ * \param pgn the input polygon.
+ * \param oi the output iterator for the result.
+ * Its dereference type must be convertible to
+ * `Polygon_with_holes_2`.
+ * \return the past-the-end iterator of the output container.
*/
-template
-OutputIterator complement(const General_polygon_with_holes_2 > & pgn, OutputIterator oi);
+template
+OutputIterator complement(const Polygon_with_holes_2& pgn,
+ OutputIterator oi);
+
+/*! computes the complement of a general polygon with holes.
+ * \param pgn the input polygon.
+ * \param oi the output iterator for the result.
+ * Its dereference type must be convertible to
+ * `General_polygon_with_holes_2< >`.
+ * \return the past-the-end iterator of the output container.
+ * \pre `%ArrTraits` must be a model of the concept
+ * `ArrangementDirectionalXMonotoneTraits_2`.
+ */
+template
+OutputIterator
+complement(const General_polygon_with_holes_2 >& pgn,
+ OutputIterator oi);
+
+//////// With Traits
+
+/*! computes the complement of a polygon.
+ * \param pgn the input polygon.
+ * \param res the resulting complement of \p pgn
+ * \param traits a traits object.
+ * \pre `GpsTraits` must be a model of the concept `GeneralPolygonSetTraits_2`.
+ */
+template
+void complement(const Polygon_2& pgn,
+ Polygon_with_holes_2& res,
+ const GpsTraits& traits);
+
+/*! computes the complement of a general polygon.
+ * \param pgn the input polygon.
+ * \param res the resulting complement of \p pgn
+ * \param traits a traits object.
+ * \pre `%ArrTraits` must be a model of the concept
+ * `ArrangementDirectionalXMonotoneTraits_2`.
+ * \pre `GpsTraits` must be a model of the concept `GeneralPolygonSetTraits_2`.
+ */
+template
+void
+complement(const General_polygon_2& pgn,
+ General_polygon_with_holes_2 >& res,
+ const GpsTraits& traits);
+
+/*! computes the complement of a polygon with holes.
+ * \param pgn the input polygon.
+ * \param oi the output iterator for the result.
+ * Its dereference type must be convertible to
+ * `Polygon_with_holes_2`.
+ * \param traits a traits object.
+ * \return the past-the-end iterator of the output container.
+ * \pre `GpsTraits` must be a model of the concept `GeneralPolygonSetTraits_2`.
+ */
+template
+OutputIterator complement(const Polygon_with_holes_2& pgn,
+ OutputIterator oi,
+ const GpsTraits& traits);
+
+/*! computes the complement of the general polygon with holes.
+ * \param pgn the input polygon.
+ * \param oi the output iterator for the result.
+ * Its dereference type must be convertible to
+ * `General_polygon_with_holes_2< >`.
+ * \param traits a traits object.
+ * \return the past-the-end iterator of the output container.
+ * \pre `%ArrTraits` must be a model of the concept
+ * `ArrangementDirectionalXMonotoneTraits_2`.
+ * \pre `GpsTraits` must be a model of the concept `GeneralPolygonSetTraits_2`.
+ */
+template
+OutputIterator complement(const General_polygon_with_holes_2& pgn,
+ OutputIterator oi,
+ const GpsTraits& traits);
+
/// @}
} /* namespace CGAL */
namespace CGAL {
-/*!
-\addtogroup boolean_difference Difference Functions
-\ingroup PkgBooleanSetOperations2Ref
-\anchor ref_bso_difference
-
-Each one of these functions computes the difference between two given
-polygons `p1` and `p2`, and inserts the resulting polygons
-with holes into an output container through the output iterator `oi`.
-The value type of the `OutputIterator` is either
-`Polygon_with_holes_2` or
-`General_polygon_with_holes_2`.
-
-The signature of the function is:
- - `%OutputIterator %difference(const Type1 & p1, const Type2 & p2, %OutputIterator oi);`
-
-
-\cgalHeading{Parameters}
-
-The types of the parameters of the `difference()` function are any of the following combinations.
-
-
-
-| Type1 | Type2 |
-| Polygon_2 | Polygon_2 |
-| Polygon_2 | Polygon_with_holes_2 |
-| Polygon_with_holes_2 | Polygon_2 |
-| Polygon_with_holes_2 | Polygon_with_holes_2 |
-| General_polygon_2 | General_polygon_2 |
-| General_polygon_2 | General_polygon_with_holes_2 |
-| General_polygon_with_holes_2 | General_polygon_2 |
-| General_polygon_with_holes_2 | General_polygon_with_holes_2 |
-
-
-
-\sa \link boolean_do_intersect `CGAL::do_intersect()` \endlink
-\sa \link boolean_intersection `CGAL::intersection()` \endlink
-\sa \link boolean_join `CGAL::join()` \endlink
-\sa \link boolean_symmetric_difference `CGAL::symmetric_difference()` \endlink
-
-*/
-
+/*! \addtogroup boolean_difference Difference Functions
+ * \ingroup PkgBooleanSetOperations2Ref
+ * \anchor ref_bso_difference
+ *
+ * There are several overloaded function templates called `difference()` that
+ * compute the \e difference between two polygons and insert the resulting
+ * polygons with holes into a container via an output iterator.
+ *
+ * A function template in this group has one of the two following signatures:
+ * - `OutputIterator difference(const Type1& pgn1, const Type2& pgn2,
+ * OutputIterator oi);`
+ * - `OutputIterator difference(const Type1& pgn1, const Type2& pgn2,
+ * OutputIterator oi, const GpsTraits& traits);`
+ *
+ * \param oi the output iterator for the result.
+ *
+ * The types `Type1` and `Type2` of the parameters must be convertible to the
+ * types specified in a row in the table below, respectively. The 3rd column
+ * specifies the corresponding dereference type of the output iterator.
+ *
+ *
+ *
+ * | `Type1` | `Type2` | %Dereference Type of `oi` |
+ * | `Polygon_2` | `Polygon_2` | `Polygon_with_holes_2` |
+ * | `Polygon_2` | `Polygon_with_holes_2` | `Polygon_with_holes_2` |
+ * | `Polygon_with_holes_2` | `Polygon_2` | `Polygon_with_holes_2` |
+ * | `Polygon_with_holes_2` | `Polygon_with_holes_2` | `Polygon_with_holes_2` |
+ * | `General_polygon_2` | `General_polygon_2` | `General_polygon_with_holes_2` |
+ * | `General_polygon_2` | `General_polygon_with_holes_2` | `General_polygon_with_holes_2` |
+ * | `General_polygon_with_holes_2` | `General_polygon_2` | `General_polygon_with_holes_2` |
+ * | `General_polygon_with_holes_2` | `General_polygon_with_holes_2` | `General_polygon_with_holes_2` |
+ *
+ *
+ *
+ * \sa \link boolean_complement `CGAL::complement()` \endlink
+ * \sa \link boolean_do_intersect `CGAL::do_intersect()` \endlink
+ * \sa \link boolean_intersection `CGAL::intersection()` \endlink
+ * \sa \link boolean_join `CGAL::join()` \endlink
+ * \sa \link boolean_symmetric_difference `CGAL::symmetric_difference()` \endlink
+ */
/// @{
-/*!
- writes the difference of the polygons `p1` and `p2` into the output iterator `oi`.
- The value type of `oi` is `Polygon_with_holes_2`.
+
+//////// Traits-less
+
+/*! computes the difference of two polygons and inserts the resulting polygons
+ * with holes into a container via an output iterator.
+ * \param pgn1 the 1st input polygon.
+ * \param pgn2 the 2nd input polygon.
+ * \param oi the output iterator for the result.
+ * Its dereference type must be convertibe to
+ * `Polygon_with_holes_2`.
+ * \return the past-the-end iterator of the output container.
*/
-template
-OutputIterator difference(const Polygon_2 & p1,
- const Polygon_2 & p2,
+template
+OutputIterator difference(const Polygon_2& pgn1,
+ const Polygon_2& pgn2,
OutputIterator oi);
-/*!
- writes the difference of the polygons `p1` and `p2` into the output iterator `oi`.
- The value type of `oi` is `Polygon_with_holes_2`.
+/*! computes the difference of two polygons and inserts the resulting polygons
+ * with holes into a container via an output iterator.
+ * \param pgn1 the 1st input polygon.
+ * \param pgn2 the 2nd input polygon.
+ * \param oi the output iterator for the result.
+ * Its dereference type must be convertibe to
+ * `Polygon_with_holes_2`.
+ * \return the past-the-end iterator of the output container.
*/
-template
-OutputIterator difference(const Polygon_2 & p1,
- const Polygon_with_holes_2 & p2,
+template
+OutputIterator difference(const Polygon_2& pgn1,
+ const Polygon_with_holes_2& pgn2,
OutputIterator oi);
-/*!
- writes the difference of the polygons `p1` and `p2` into the output iterator `oi`.
- The value type of `oi` is `Polygon_with_holes_2`.
+/*! computes the difference of two polygons and inserts the resulting polygons
+ * with holes into a container via an output iterator.
+ * \param pgn1 the 1st input polygon.
+ * \param pgn2 the 2nd input polygon.
+ * \param oi the output iterator for the result.
+ * Its dereference type must be convertibe to
+ * `Polygon_with_holes_2`.
+ * \return the past-the-end iterator of the output container.
*/
-template
-OutputIterator difference(const Polygon_with_holes_2 & p1,
- const Polygon_2 & p2,
+template
+OutputIterator difference(const Polygon_with_holes_2& pgn1,
+ const Polygon_2& pgn2,
OutputIterator oi);
-/*!
- writes the difference of the polygons `p1` and `p2` into the output iterator `oi`.
- The value type of `oi` is `Polygon_with_holes_2`.
+/*! computes the difference of two polygons and inserts the resulting polygons
+ * with holes into a container via an output iterator.
+ * \param pgn1 the 1st input polygon.
+ * \param pgn2 the 2nd input polygon.
+ * \param oi the output iterator for the result.
+ * Its dereference type must be convertibe to
+ * `Polygon_with_holes_2`.
+ * \return the past-the-end iterator of the output container.
*/
-template
-OutputIterator difference(const Polygon_with_holes_2 & p1,
- const Polygon_with_holes_2 & p2,
+template
+OutputIterator difference(const Polygon_with_holes_2& pgn1,
+ const Polygon_with_holes_2& pgn2,
OutputIterator oi);
-/*!
- writes the difference of the general polygons `p1` and `p2` into the output iterator `oi`.
- The value type of `oi` is `General_polygon_with_holes_2`.
+/*! computes the difference of two general polygons and inserts the resulting
+ * general polygons with holes into a container via an output iterator.
+ * \param pgn1 the 1st input polygon.
+ * \param pgn2 the 2nd input polygon.
+ * \param oi the output iterator for the result.
+ * Its dereference type must be convertibe to
+ * `General_polygon_with_holes_2 >`.
+ * \return the past-the-end iterator of the output container.
+ * \pre `%ArrTraits` must be a model of the concept `ArrangementDirectionalXMonotoneTraits_2`.
*/
-template
-OutputIterator difference(const General_polygon_2 & p1,
- const General_polygon_2 & p2,
+template
+OutputIterator difference(const General_polygon_2& pgn1,
+ const General_polygon_2& pgn2,
OutputIterator oi);
-/*!
- writes the difference of the general polygons `p1` and `p2` into the output iterator `oi`.
- The value type of `oi` is `General_polygon_with_holes_2`.
+/*! computes the difference of two general polygons and inserts the resulting
+ * general polygons with holes into a container via an output iterator.
+ * \param pgn1 the 1st input polygon.
+ * \param pgn2 the 2nd input polygon.
+ * \param oi the output iterator for the result.
+ * Its dereference type must be convertibe to
+ * `General_polygon_with_holes_2 >`.
+ * \return the past-the-end iterator of the output container.
+ * \pre `%ArrTraits` must be a model of the concept
+ * `ArrangementDirectionalXMonotoneTraits_2`.
*/
-template
-OutputIterator difference(const General_polygon_with_holes_2 > & p1,
- const General_polygon_2 & p2,
+template
+OutputIterator
+difference(const General_polygon_with_holes_2 >& pgn1,
+ const General_polygon_2& pgn2,
+ OutputIterator oi);
+
+/*! computes the difference of two polygons and inserts the resulting
+ * general polygons with holes into a container via an output iterator.
+ * \param pgn1 the 1st input polygon.
+ * \param pgn2 the 2nd input polygon.
+ * \param oi the output iterator for the result.
+ * Its dereference type must be convertibe to
+ * `General_polygon_with_holes_2 >`.
+ * \return the past-the-end iterator of the output container.
+ * \pre `%ArrTraits` must be a model of the concept
+ * `ArrangementDirectionalXMonotoneTraits_2`.
+ */
+template
+OutputIterator
+difference(const General_polygon_2& pgn1,
+ const General_polygon_with_holes_2 >& pgn2,
+ OutputIterator oi);
+
+/*! computes the difference of two general polygons with holes and inserts the
+ * resulting general polygons with holes into a container via an output
+ * iterator.
+ * \param pgn1 the 1st input polygon.
+ * \param pgn2 the 2nd input polygon.
+ * \param oi the output iterator for the result.
+ * Its dereference type must be convertibe to
+ * `General_polygon_with_holes_2`.
+ * \return the past-the-end iterator of the output container.
+ */
+template
+OutputIterator difference(const General_polygon_with_holes_2& pgn1,
+ const General_polygon_with_holes_2& pgn2,
OutputIterator oi);
+//////// With Traits
-/*!
- writes the difference of the general polygons `p1` and `p2` into the output iterator `oi`.
- The value type of `oi` is `General_polygon_with_holes_2`.
+/*! computes the difference of two polygons and inserts the resulting polygons
+ * with holes into a container via an output iterator.
+ * \param pgn1 the 1st input polygon.
+ * \param pgn2 the 2nd input polygon.
+ * \param oi the output iterator for the result.
+ * Its dereference type must be convertibe to
+ * `Polygon_with_holes_2`.
+ * \param traits a traits object.
+ * \return the past-the-end iterator of the output container.
+ * \pre GpsTraits must be a model of `GeneralPolygonSetTraits_2`.
*/
-template
-OutputIterator difference(const General_polygon_2 & p1,
- const General_polygon_with_holes_2 > & p2,
- OutputIterator oi);
+template
+OutputIterator difference(const Polygon_2& pgn1,
+ const Polygon_2& pgn2,
+ OutputIterator oi,
+ const GpsTraits& traits);
-
-/*!
- writes the difference of the general polygons `p1` and `p2` into the output iterator `oi`.
- The value type of `oi` is `General_polygon_with_holes_2`.
+/*! computes the difference of two polygons and inserts the resulting polygons
+ * with holes into a container via an output iterator.
+ * \param pgn1 the 1st input polygon.
+ * \param pgn2 the 2nd input polygon.
+ * \param oi the output iterator for the result.
+ * Its dereference type must be convertibe to
+ * `Polygon_with_holes_2`.
+ * \param traits a traits object.
+ * \return the past-the-end iterator of the output container.
+ * \pre GpsTraits must be a model of `GeneralPolygonSetTraits_2`.
*/
-template
-OutputIterator difference(const General_polygon_with_holes_2 & p1,
- const General_polygon_with_holes_2 & p2,
- OutputIterator oi);
+template
+OutputIterator difference(const Polygon_2& pgn1,
+ const Polygon_with_holes_2& pgn2,
+ OutputIterator oi,
+ const GpsTraits& traits);
+
+/*! computes the difference of two polygons and inserts the resulting polygons
+ * with holes into a container via an output iterator.
+ * \param pgn1 the 1st input polygon.
+ * \param pgn2 the 2nd input polygon.
+ * \param oi the output iterator for the result.
+ * Its dereference type must be convertibe to
+ * `Polygon_with_holes_2`.
+ * \param traits a traits object.
+ * \return the past-the-end iterator of the output container.
+ * \pre GpsTraits must be a model of `GeneralPolygonSetTraits_2`.
+ */
+template
+OutputIterator difference(const Polygon_with_holes_2& pgn1,
+ const Polygon_2& pgn2,
+ OutputIterator oi,
+ const GpsTraits& traits);
+
+/*! computes the difference of two polygons with holes and inserts the resulting
+ * polygons with holes into a container via an output iterator.
+ * \param pgn1 the 1st input polygon.
+ * \param pgn2 the 2nd input polygon.
+ * \param oi the output iterator for the result.
+ * Its dereference type must be convertibe to
+ * `Polygon_with_holes_2`.
+ * \param traits a traits object.
+ * \return the past-the-end iterator of the output container.
+ * \pre GpsTraits must be a model of `GeneralPolygonSetTraits_2`.
+ */
+template
+OutputIterator difference(const Polygon_with_holes_2& pgn1,
+ const Polygon_with_holes_2& pgn2,
+ OutputIterator oi,
+ const GpsTraits& traits);
+
+/*! computes the difference of two general polygons and inserts the resulting
+ * general polygons with holes into a container via an output iterator.
+ * \param pgn1 the 1st input polygon.
+ * \param pgn2 the 2nd input polygon.
+ * \param oi the output iterator for the result.
+ * Its dereference type must be convertibe to
+ * `General_polygon_with_holes_2 >`.
+ * \param traits a traits object.
+ * \return the past-the-end iterator of the output container.
+ * \pre `%ArrTraits` must be a model of the concept
+ * `ArrangementDirectionalXMonotoneTraits_2`.
+ * \pre GpsTraits must be a model of `GeneralPolygonSetTraits_2`.
+ */
+template
+OutputIterator difference(const General_polygon_2& pgn1,
+ const General_polygon_2& pgn2,
+ OutputIterator oi,
+ const GpsTraits& traits);
+
+/*! computes the difference of two general polygons and inserts the resulting
+ * general polygons with holes into a container via an output iterator.
+ * \param pgn1 the 1st input polygon.
+ * \param pgn2 the 2nd input polygon.
+ * \param oi the output iterator for the result.
+ * Its dereference type must be convertibe to
+ * `General_polygon_with_holes_2 >`.
+ * \param traits a traits object.
+ * \return the past-the-end iterator of the output container.
+ * \pre `%ArrTraits` must be a model of the concept
+ * `ArrangementDirectionalXMonotoneTraits_2`.
+ * \pre GpsTraits must be a model of `GeneralPolygonSetTraits_2`.
+ */
+template
+OutputIterator
+difference(const General_polygon_with_holes_2 >& pgn1,
+ const General_polygon_2& pgn2,
+ OutputIterator oi,
+ const GpsTraits& traits);
+
+/*! computes the difference of two general polygons and inserts the resulting
+ * general polygons with holes into a container via an output iterator.
+ * \param pgn1 the 1st input polygon.
+ * \param pgn2 the 2nd input polygon.
+ * \param oi the output iterator for the result.
+ * Its dereference type must be convertibe to
+ * `General_polygon_with_holes_2 >`.
+ * \param traits a traits object.
+ * \return the past-the-end iterator of the output container.
+ * \pre `%ArrTraits` must be a model of the concept
+ * `ArrangementDirectionalXMonotoneTraits_2`.
+ * \pre GpsTraits must be a model of `GeneralPolygonSetTraits_2`.
+ */
+template
+OutputIterator
+difference(const General_polygon_2& pgn1,
+ const General_polygon_with_holes_2 >& pgn2,
+ OutputIterator oi,
+ const GpsTraits& traits);
+
+/*! computes the difference of two general polygons and inserts the resulting
+ * general polygons with holes into a container via an output iterator.
+ * \param pgn1 the 1st input polygon.
+ * \param pgn2 the 2nd input polygon.
+ * \param oi the output iterator for the result.
+ * Its dereference type must be convertibe to
+ * `General_polygon_with_holes_2`.
+ * \param traits a traits object.
+ * \return the past-the-end iterator of the output container.
+ * \pre GpsTraits must be a model of `GeneralPolygonSetTraits_2`.
+ */
+template
+OutputIterator difference(const General_polygon_with_holes_2& pgn1,
+ const General_polygon_with_holes_2& pgn2,
+ OutputIterator oi,
+ const GpsTraits& traits);
/// @}
} /* namespace CGAL */
namespace CGAL {
-/*!
-\addtogroup boolean_do_intersect Intersection Testing Functions
-\ingroup PkgBooleanSetOperations2Ref
-\anchor ref_bso_do_intersect
-
-Each one of these functions computes if the interior of two given
-polygons `p1` and `p2` intersect.
-
-The signature of the function is:
- - `bool do_intersect(const Type1 & p1, const Type2 & p2);`
-
-
-\cgalHeading{Parameters}
-
-The types of the parameters of the \link ref_bso_do_intersect `do_intersect()` \endlink function are any of the following combinations.
-
-
-
-| Type1 | Type2 |
-| Polygon_2 | Polygon_2 |
-| Polygon_2 | Polygon_with_holes_2 |
-| Polygon_with_holes_2 | Polygon_2 |
-| Polygon_with_holes_2 | Polygon_with_holes_2 |
-| General_polygon_2 | General_polygon_2 |
-| General_polygon_2 | General_polygon_with_holes_2 |
-| General_polygon_with_holes_2 | General_polygon_2 |
-| General_polygon_with_holes_2 | General_polygon_with_holes_2 |
-
-
-
-
-\sa \link boolean_intersection `CGAL::intersection()` \endlink
-\sa \link boolean_join `CGAL::join()` \endlink
-\sa \link boolean_difference `CGAL::difference()` \endlink
-\sa \link boolean_symmetric_difference `CGAL::symmetric_difference()` \endlink
-
-*/
+/*! \addtogroup boolean_do_intersect Intersection Testing Functions
+ * \ingroup PkgBooleanSetOperations2Ref
+ * \anchor ref_bso_do_intersect
+ *
+ * There are several overloaded function templates called `do_intersect()`
+ * that determine whether the interior of two or more polygons intersect.
+ *
+ * A function template in this group that accepts two input polygons has one of
+ * the two following signatures:
+ * - `bool do_intersect(const Type1& pgn1, const Type2& pgn2);`
+ * - `bool do_intersect(const Type1& pgn1, const Type2& pgn2,
+ const GpsTraits& traits);`
+ *
+ * \cgalHeading{Parameters}
+ *
+ * The types `Type1` and `Type2` of the parameters must be convertible to the
+ * types specified in a row in the table below, respectively.
+ *
+ *
+ *
+ * | `Type1` | `Type2` |
+ * | `Polygon_2` | `Polygon_2` |
+ * | `Polygon_2` | `Polygon_with_holes_2` |
+ * | `Polygon_with_holes_2` | `Polygon_2` |
+ * | `Polygon_with_holes_2` | `Polygon_with_holes_2` |
+ * | `General_polygon_2` | `General_polygon_2` |
+ * | `General_polygon_2` | `General_polygon_with_holes_2` |
+ * | `General_polygon_with_holes_2` | `General_polygon_2` |
+ * | `General_polygon_with_holes_2` | `General_polygon_with_holes_2` |
+ *
+ *
+ *
+ * \sa \link boolean_complement `CGAL::complement()` \endlink
+ * \sa \link boolean_intersection `CGAL::intersection()` \endlink
+ * \sa \link boolean_join `CGAL::join()` \endlink
+ * \sa \link boolean_difference `CGAL::difference()` \endlink
+ * \sa \link boolean_symmetric_difference `CGAL::symmetric_difference()` \endlink
+ */
/// @{
-/*!
- returns `true` if the polygons `p1` and `p2` intersect in their interior.
+//////// Traits-less
+
+/*! determines whether two polygons intersect in their interior.
+ * \param pgn1 the 1st input polygon.
+ * \param pgn2 the 2nd input polygon.
+ * \return `true` if `pgn1` and `pgn2` intersect in their interiro and `false`
+ * otherwise.
*/
-template
-bool do_intersect(const Polygon_2 & p1,
- const Polygon_2 & p2);
+template
+bool do_intersect(const Polygon_2& pgn1,
+ const Polygon_2& pgn2);
-/*!
- returns `true` if the polygons `p1` and `p2` intersect in their interior.
+/*! determines whether two polygons intersect in their interior.
+ * \param pgn1 the 1st input polygon.
+ * \param pgn2 the 2nd input polygon.
+ * \return `true` if `pgn1` and `pgn2` intersect in their interiro and `false`
+ * otherwise.
*/
-template
-bool do_intersect(const Polygon_2 & p1,
- const Polygon_with_holes_2 & p2);
+template
+bool do_intersect(const Polygon_2& pgn1,
+ const Polygon_with_holes_2& pgn2);
-/*!
- returns `true` if the polygons `p1` and `p2` intersect in their interior.
- returns `true` if the interior of polygons `p1` and `p2` intersect.
+/*! determines whether two polygons intersect in their interior.
+ * \param pgn1 the 1st input polygon.
+ * \param pgn2 the 2nd input polygon.
+ * \return `true` if `pgn1` and `pgn2` intersect in their interiro and `false`
+ * otherwise.
*/
-template
-bool do_intersect(const Polygon_with_holes_2 & p1,
- const Polygon_2 & p2);
-
-/*!
- returns `true` if the polygons `p1` and `p2` intersect in their interior.
+template
+bool do_intersect(const Polygon_with_holes_2& pgn1,
+ const Polygon_2& pgn2);
+/*! determines whether two polygons with holes intersect in their interior.
+ * \param pgn1 the 1st input polygon.
+ * \param pgn2 the 2nd input polygon.
+ * \return `true` if `pgn1` and `pgn2` intersect in their interiro and `false`
+ * otherwise.
*/
-template
-bool do_intersect(const Polygon_with_holes_2 & p1,
- const Polygon_with_holes_2 & p2);
+template
+bool do_intersect(const Polygon_with_holes_2& pgn1,
+ const Polygon_with_holes_2& pgn2);
-/*!
- returns `true` if the general polygons `p1` and `p2` intersect in their interior.
+/*! determines whether two general polygons intersect in their interior.
+ * \param pgn1 the 1st input polygon.
+ * \param pgn2 the 2nd input polygon.
+ * \return `true` if `pgn1` and `pgn2` intersect in their interiro and `false`
+ * otherwise.
+ * \pre `%ArrTraits` must be a model of the concept
+ * `ArrangementDirectionalXMonotoneTraits_2`.
*/
-template
-bool do_intersect(const General_polygon_2 & p1,
- const General_polygon_2 & p2);
+template
+bool do_intersect(const General_polygon_2& pgn1,
+ const General_polygon_2& pgn2);
-/*!
- returns `true` if the general polygons `p1` and `p2` intersect in their interior.
+/*! determines whether two general polygons intersect in their interior.
+ * \param pgn1 the 1st input polygon.
+ * \param pgn2 the 2nd input polygon.
+ * \return `true` if `pgn1` and `pgn2` intersect in their interiro and `false`
+ * otherwise.
+ * \pre `%ArrTraits` must be a model of the concept
+ * `ArrangementDirectionalXMonotoneTraits_2`.
*/
-template
-bool do_intersect(const General_polygon_2 & p1,
- const General_polygon_with_holes_2 > & p2);
+template
+bool
+do_intersect(const General_polygon_2& pgn1,
+ const General_polygon_with_holes_2 >& pgn2);
-/*!
- returns `true` if the general polygons `p1` and `p2` intersect in their interior.
+/*! determines whether two general polygons intersect in their interior.
+ * \param pgn1 the 1st input polygon.
+ * \param pgn2 the 2nd input polygon.
+ * \return `true` if `pgn1` and `pgn2` intersect in their interiro and `false`
+ * otherwise.
+ * \pre `%ArrTraits` must be a model of the concept
+ * `ArrangementDirectionalXMonotoneTraits_2`.
*/
-template
-bool do_intersect(const General_polygon_with_holes_2 > & p1,
- const General_polygon_2 & p2);
+template
+bool do_intersect(const General_polygon_with_holes_2 >& pgn1,
+ const General_polygon_2& pgn2);
-
-/*!
- returns `true` if the general polygons `p1` and `p2` intersect in their interior.
+/*! determines whether two general polygons with holes intersect in their
+ * interior.
+ * \param pgn1 the 1st input polygon.
+ * \param pgn2 the 2nd input polygon.
+ * \return `true` if `pgn1` and `pgn2` intersect in their interiro and `false`
+ * otherwise.
*/
-template
-bool do_intersect(const General_polygon_with_holes_2 & p1,
- const General_polygon_with_holes_2 & p2);
+template
+bool do_intersect(const General_polygon_with_holes_2& pgn1,
+ const General_polygon_with_holes_2& pgn2);
- /*!
- returns `true`, if the set of general polygons (or general
- polygons with holes) in the given range intersect in their interior,
- and `false` otherwise. (The value type of the input iterator is
- used to distinguish between the two).
- */
-template
+/*! Given a range of polygons or a range of polygons with holes (resp. a range
+ * of general polygons or a range of general polygons with holes) determines
+ * whether the open polygons (resp. general polygons) in the range have a common
+ * point.
+ * \param begin the first iterator of the input range. Its value type is
+ * either `Polygon_2` (resp. `General_polygon_2`) or `Polygon_with_holes_2`
+ * (resp. `General_polygon_with_holes_2`).
+ * \param end the past-the-end iterator of the input range. Its value type is
+ * either `Polygon_2` (resp. `General_polygon_2`) or `Polygon_with_holes_2`
+ * (resp. `General_polygon_with_holes_2`).
+ * \return `true` if the pairwise intersections of all open polygons or polygons
+ * with holes (resp. general polygons or general polygons with holes) in
+ * the range [*begin,*end) overlap, and `false` otherwise.
+ */
+template
bool do_intersect(InputIterator begin, InputIterator end);
- /*!
- returns `true`, if the set of general polygons and general
- polygons with holes in the given two ranges respectively intersect in
- their interior, and `false` otherwise.
- */
-template
-bool do_intersect(InputIterator1 pgn_begin1,
- InputIterator1 pgn_end1,
- InputIterator2 pgn_begin2,
- InputIterator2 pgn_end2);
+/*! Given a range of polygons (resp. general polygons) and a range of polygons
+ * with holes (resp. general polygons with holes) determines whether the open
+ * polygons (resp. general polygons) in the two ranges have a common point.
+ * \param begin1 the first iterator of the 1st input range. Its value type is
+ * `Polygon_2` (resp. `General_polygon_2`).
+ * \param end1 the past-the-end iterator of the 1st input range. Its value
+ * type is `Polygon_2` (resp. `General_polygon_2`).
+ * \param begin2 the first iterator of the 2nd input range. Its value type
+ * is `Polygon_with_holes_2` (resp. `General_polygon_with_holes_2`).
+ * \param end2 the past-the-end iterator of the 2nd input range. Its value
+ * type is `Polygon_with_holes_2` (resp. `General_polygon_with_holes_2`).
+ * \return `true` if the pairwise intersections of all open polygons (resp.
+ * general polygons) and polygons with holes (resp. general polygons with
+ * holes) in the ranges [*begin1,*end1) and [*begin2,*end2),
+ * respectively, overlap, and `false` otherwise.
+ */
+template
+bool do_intersect(InputIterator1 begin1,
+ InputIterator1 end1,
+ InputIterator2 begin2,
+ InputIterator2 end2);
+
+//////// With Traits
+
+/*! determines whether two polygons intersect in their interior.
+ * \param pgn1 the 1st input polygon.
+ * \param pgn2 the 2nd input polygon.
+ * \param traits a traits object.
+ * \return `true` if `pgn1` and `pgn2` intersect in their interiro and `false`
+ * otherwise.
+ * \pre `GpsTraits` must be a model of the concept `GeneralPolygonSetTraits_2`.
+ */
+template
+bool do_intersect(const Polygon_2& pgn1,
+ const Polygon_2& pgn2,
+ const GpsTraits& traits);
+
+/*! determines whether two polygons intersect in their interior.
+ * \param pgn1 the 1st input polygon.
+ * \param pgn2 the 2nd input polygon.
+ * \param traits a traits object.
+ * \return `true` if `pgn1` and `pgn2` intersect in their interiro and `false`
+ * otherwise.
+ * \pre `GpsTraits` must be a model of the concept `GeneralPolygonSetTraits_2`.
+ */
+template
+bool do_intersect(const Polygon_2& pgn1,
+ const Polygon_with_holes_2& pgn2,
+ const GpsTraits& traits,
+ const GpsTraits& traits);
+
+/*! determines whether two polygons intersect in their interior.
+ * \param pgn1 the 1st input polygon.
+ * \param pgn2 the 2nd input polygon.
+ * \param traits a traits object.
+ * \return `true` if `pgn1` and `pgn2` intersect in their interiro and `false`
+ * otherwise.
+ * \pre `GpsTraits` must be a model of the concept `GeneralPolygonSetTraits_2`.
+ */
+template
+bool do_intersect(const Polygon_with_holes_2& pgn1,
+ const Polygon_2& pgn2,
+ const GpsTraits& traits);
+
+/*! determines whether two polygons with holes intersect in their interior.
+ * \param pgn1 the 1st input polygon.
+ * \param pgn2 the 2nd input polygon.
+ * \param traits a traits object.
+ * \return `true` if `pgn1` and `pgn2` intersect in their interiro and `false`
+ * otherwise.
+ * \pre `GpsTraits` must be a model of the concept `GeneralPolygonSetTraits_2`.
+ */
+template
+bool do_intersect(const Polygon_with_holes_2& pgn1,
+ const Polygon_with_holes_2& pgn2,
+ const GpsTraits& traits);
+
+/*! determines whether two general polygons intersect in their interior.
+ * \param pgn1 the 1st input polygon.
+ * \param pgn2 the 2nd input polygon.
+ * \param traits a traits object.
+ * \return `true` if `pgn1` and `pgn2` intersect in their interiro and `false`
+ * otherwise.
+ * \pre `GpsTraits` must be a model of the concept `GeneralPolygonSetTraits_2`.
+ * \pre `%ArrTraits` must be a model of the concept
+ * `ArrangementDirectionalXMonotoneTraits_2`.
+ */
+template
+bool do_intersect(const General_polygon_2& pgn1,
+ const General_polygon_2