diff --git a/.travis.yml b/.travis.yml index 132de715d82..7f319eec64b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -58,7 +58,9 @@ compiler: - clang - gcc addons: - apt: + apt: + sources: + - sourceline: 'ppa:ppsspp/cmake' packages: - zsh - cmake @@ -85,3 +87,7 @@ addons: # - libglew1.5-dev # - libipe-dev # - libmpfi-dev +notifications: + email: + on_success: change # default: always + on_failure: always # default: always diff --git a/.travis/build_package.sh b/.travis/build_package.sh index f4057a0f784..4db46faba23 100755 --- a/.travis/build_package.sh +++ b/.travis/build_package.sh @@ -1,14 +1,64 @@ #!/bin/bash set -e + +CXX_FLAGS="-DCGAL_NDEBUG" + +function build_examples { + mkdir -p build-travis + cd build-travis + cmake -DCGAL_DIR="$ROOT/build" -DCMAKE_CXX_FLAGS_RELEASE="${CXX_FLAGS}" .. + make -j2 +} + +function build_tests { + build_examples +} + +function build_demo { + mkdir -p build-travis + cd build-travis + if [ $NEED_3D = 1 ]; then + #install libqglviewer + git clone --depth=1 https://github.com/GillesDebunne/libQGLViewer.git ./qglviewer + pushd ./qglviewer/QGLViewer + #use qt5 instead of qt4 + export QT_SELECT=5 + qmake NO_QT_VERSION_SUFFIX=yes + make -j2 + if [ ! -f libQGLViewer.so ]; then + echo "libQGLViewer.so not made" + exit 1 + else + echo "QGLViewer built successfully" + fi + #end install qglviewer + popd + fi + EXTRA_CXX_FLAGS= + if [ "$CC" = "clang" ]; then + EXTRA_CXX_FLAGS="-Werror=inconsistent-missing-override" + fi + if [ $NEED_3D = 1 ]; then + QGLVIEWERROOT=$PWD/qglviewer + export QGLVIEWERROOT + fi + cmake -DCGAL_DIR="$ROOT/build" -DCGAL_DONT_OVERRIDE_CMAKE_FLAGS:BOOL=ON -DCMAKE_CXX_FLAGS_RELEASE="${CXX_FLAGS} ${EXTRA_CXX_FLAGS}" .. + make -j2 +} + IFS=$' ' -ROOT="$PWD/../" +ROOT="$PWD/.." NEED_3D=0 for ARG in $(echo "$@") do if [ "$ARG" = "CHECK" ] then zsh $ROOT/Scripts/developer_scripts/test_merge_of_branch HEAD - + mkdir -p build-travis + pushd build-travis + cmake -DCGAL_ENABLE_CHECK_HEADERS=ON ../.. + make -j2 check_headers + popd #parse current matrix and check that no package has been forgotten old_IFS=$IFS IFS=$'\n' @@ -38,6 +88,9 @@ do exit 1 fi echo "Matrix is up to date." + cd .travis + ./generate_travis.sh -c + cd .. exit 0 fi EXAMPLES="$ARG/examples/$ARG" @@ -53,21 +106,15 @@ do if [ -d "$ROOT/$EXAMPLES" ] then cd $ROOT/$EXAMPLES - mkdir -p build - cd build - cmake -DCGAL_DIR="$ROOT/build" -DCMAKE_CXX_FLAGS_RELEASE="-DCGAL_NDEBUG" .. - make -j2 + build_examples elif [ "$ARG" != Polyhedron_demo ]; then echo "No example found for $ARG" fi if [ -d "$ROOT/$TEST" ] then - cd $ROOT/$TEST - mkdir -p build - cd build - cmake -DCGAL_DIR="$ROOT/build" -DCMAKE_CXX_FLAGS_RELEASE="-DCGAL_NDEBUG" .. - make -j2 + cd $ROOT/$TEST + build_tests elif [ "$ARG" != Polyhedron_demo ]; then echo "No test found for $ARG" fi @@ -81,54 +128,21 @@ do fi if [ "$ARG" != Polyhedron ] && [ -d "$ROOT/$DEMO" ] then - if [ $NEED_3D = 1 ]; then - cd $ROOT/$DEMO - #install libqglviewer - git clone --depth=1 https://github.com/GillesDebunne/libQGLViewer.git ./qglviewer - cd ./qglviewer/QGLViewer - #use qt5 instead of qt4 - export QT_SELECT=5 - qmake NO_QT_VERSION_SUFFIX=yes - make -j2 - if [ ! -f libQGLViewer.so ]; then - echo "libQGLViewer.so not made" - exit 1 - else - echo "QGLViewer built successfully" - fi - #end install qglviewer - fi - cd $ROOT/$DEMO - mkdir -p build - cd build - if [ $NEED_3D = 1 ]; then - cmake -DCGAL_DIR="$ROOT/build" -DQGLVIEWER_INCLUDE_DIR="$ROOT/$DEMO/qglviewer" -DQGLVIEWER_LIBRARIES="$ROOT/$DEMO/qglviewer/QGLViewer/libQGLViewer.so" -DCMAKE_CXX_FLAGS_RELEASE="-DCGAL_NDEBUG" .. - else - cmake -DCGAL_DIR="$ROOT/build" -DCMAKE_CXX_FLAGS_RELEASE="-DCGAL_NDEBUG" .. - fi - make -j2 + cd $ROOT/$DEMO + build_demo elif [ "$ARG" != Polyhedron_demo ]; then echo "No demo found for $ARG" fi done if [ "$ARG" = Polyhedron_demo ]; then - cd "$ROOT/Polyhedron/demo/Polyhedron" - #install libqglviewer - git clone --depth=1 https://github.com/GillesDebunne/libQGLViewer.git ./qglviewer - cd ./qglviewer/QGLViewer - #use qt5 instead of qt4 - export QT_SELECT=5 - qmake NO_QT_VERSION_SUFFIX=yes - make -j2 - if [ ! -f libQGLViewer.so ]; then - echo "libQGLViewer.so not made" - exit 1 - fi - #end install qglviewer - cd "$ROOT/Polyhedron/demo/Polyhedron" - mkdir -p ./build - cd ./build - cmake -DCGAL_DIR="$ROOT/build" -DQGLVIEWER_INCLUDE_DIR="$ROOT/Polyhedron/demo/Polyhedron/qglviewer" -DQGLVIEWER_LIBRARIES="$ROOT/Polyhedron/demo/Polyhedron/qglviewer/QGLViewer/libQGLViewer.so" -DCMAKE_CXX_FLAGS_RELEASE="-DCGAL_NDEBUG" .. - make -j2 + DEMO=Polyhedron/demo/Polyhedron + NEED_3D=1 + cd "$ROOT/$DEMO" + build_demo fi done + +# Local Variables: +# tab-width: 2 +# sh-basic-offset: 2 +# End: diff --git a/.travis/generate_travis.sh b/.travis/generate_travis.sh old mode 100644 new mode 100755 index 13209672e09..6f8d8921fad --- a/.travis/generate_travis.sh +++ b/.travis/generate_travis.sh @@ -1,4 +1,10 @@ #!/bin/bash + +CHECK= +case $1 in + --check) CHECK=y;; +esac + set -e cd ../ @@ -28,8 +34,7 @@ done if [ -f ".travis.yml" ] then #copy the current .travis.yml for later check - cp ./.travis.yml ./.travis.old - rm .travis.yml + mv ./.travis.yml ./.travis.old fi #writes the first part of the file old_IFS=$IFS @@ -67,11 +72,19 @@ do done IFS=$' ' #check if there are differences between the files -read -a DIFF <<<$(diff -q ./.travis.yml ./.travis.old) -if [ "${DIFF[0]}" != "" ] +if ! cmp -s ./.travis.yml ./.travis.old; then - echo ".travis.yml has changed" + echo ".travis.yml has changed" + if [ -n "$CHECK" ]; then + echo "You should modify the file .travis/template.txt" + exit 1 + fi fi #erase old travis rm ./.travis.old IFS=$old_IFS + +# Local Variables: +# tab-width: 2 +# sh-basic-offset: 2 +# End: diff --git a/.travis/template.txt b/.travis/template.txt index 0803ab438e9..4f5fec1d660 100644 --- a/.travis/template.txt +++ b/.travis/template.txt @@ -18,7 +18,9 @@ compiler: - clang - gcc addons: - apt: + apt: + sources: + - sourceline: 'ppa:ppsspp/cmake' packages: - zsh - cmake @@ -45,3 +47,7 @@ addons: # - libglew1.5-dev # - libipe-dev # - libmpfi-dev +notifications: + email: + on_success: change # default: always + on_failure: always # default: always diff --git a/AABB_tree/demo/AABB_tree/CMakeLists.txt b/AABB_tree/demo/AABB_tree/CMakeLists.txt index 22af6851e78..cd1995da538 100644 --- a/AABB_tree/demo/AABB_tree/CMakeLists.txt +++ b/AABB_tree/demo/AABB_tree/CMakeLists.txt @@ -7,6 +7,10 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) # Instruct CMake to run moc automatically when needed. set(CMAKE_AUTOMOC ON) cmake_minimum_required(VERSION 2.8.11) +if(POLICY CMP0053) + cmake_policy(SET CMP0053 OLD) +endif() + if(POLICY CMP0043) cmake_policy(SET CMP0043 OLD) endif() diff --git a/AABB_tree/demo/AABB_tree/Scene.cpp b/AABB_tree/demo/AABB_tree/Scene.cpp index a87cd91e890..19b07ee9b6f 100644 --- a/AABB_tree/demo/AABB_tree/Scene.cpp +++ b/AABB_tree/demo/AABB_tree/Scene.cpp @@ -14,7 +14,7 @@ #include #include -#include +#include #include #include diff --git a/AABB_tree/doc/AABB_tree/aabb_tree.txt b/AABB_tree/doc/AABB_tree/aabb_tree.txt index 60aaf51dced..d0b7d99f421 100644 --- a/AABB_tree/doc/AABB_tree/aabb_tree.txt +++ b/AABB_tree/doc/AABB_tree/aabb_tree.txt @@ -37,7 +37,7 @@ Each primitive gives access to both one input geometric object example primitive wraps a 3D triangle as datum and a face handle of a polyhedral surface as id. Each intersection query can return the intersection objects (e.g., 3D points or segments for ray queries) as -well the as id (here the face handle) of the intersected +well as the id (here the face handle) of the intersected primitives. Similarly, each distance query can return the closest point from the point query as well as the id of the closest primitive. diff --git a/AABB_tree/examples/AABB_tree/AABB_face_graph_triangle_example.cpp b/AABB_tree/examples/AABB_tree/AABB_face_graph_triangle_example.cpp index d338dbde25c..54bb75ade1e 100644 --- a/AABB_tree/examples/AABB_tree/AABB_face_graph_triangle_example.cpp +++ b/AABB_tree/examples/AABB_tree/AABB_face_graph_triangle_example.cpp @@ -6,7 +6,6 @@ #include #include #include -#include #include typedef CGAL::Simple_cartesian K; diff --git a/AABB_tree/examples/AABB_tree/AABB_halfedge_graph_edge_example.cpp b/AABB_tree/examples/AABB_tree/AABB_halfedge_graph_edge_example.cpp index eea3bfbabf2..a98753b7a1c 100644 --- a/AABB_tree/examples/AABB_tree/AABB_halfedge_graph_edge_example.cpp +++ b/AABB_tree/examples/AABB_tree/AABB_halfedge_graph_edge_example.cpp @@ -6,7 +6,6 @@ #include #include #include -#include #include typedef CGAL::Simple_cartesian K; diff --git a/AABB_tree/examples/AABB_tree/AABB_insertion_example.cpp b/AABB_tree/examples/AABB_tree/AABB_insertion_example.cpp index c9f4dd30878..ede70be1005 100644 --- a/AABB_tree/examples/AABB_tree/AABB_insertion_example.cpp +++ b/AABB_tree/examples/AABB_tree/AABB_insertion_example.cpp @@ -4,7 +4,6 @@ #include #include #include -#include #include diff --git a/AABB_tree/examples/AABB_tree/AABB_polyhedron_edge_example.cpp b/AABB_tree/examples/AABB_tree/AABB_polyhedron_edge_example.cpp index bc01f7352e1..da354a36e72 100644 --- a/AABB_tree/examples/AABB_tree/AABB_polyhedron_edge_example.cpp +++ b/AABB_tree/examples/AABB_tree/AABB_polyhedron_edge_example.cpp @@ -6,7 +6,6 @@ #include #include #include -#include #include typedef CGAL::Simple_cartesian K; diff --git a/AABB_tree/examples/AABB_tree/AABB_polyhedron_facet_distance_example.cpp b/AABB_tree/examples/AABB_tree/AABB_polyhedron_facet_distance_example.cpp index d372ebbc040..eb3e3ed806d 100644 --- a/AABB_tree/examples/AABB_tree/AABB_polyhedron_facet_distance_example.cpp +++ b/AABB_tree/examples/AABB_tree/AABB_polyhedron_facet_distance_example.cpp @@ -7,7 +7,6 @@ #include #include #include -#include #include typedef CGAL::Simple_cartesian K; diff --git a/AABB_tree/examples/AABB_tree/AABB_polyhedron_facet_intersection_example.cpp b/AABB_tree/examples/AABB_tree/AABB_polyhedron_facet_intersection_example.cpp index 426df44c913..822d6affee8 100644 --- a/AABB_tree/examples/AABB_tree/AABB_polyhedron_facet_intersection_example.cpp +++ b/AABB_tree/examples/AABB_tree/AABB_polyhedron_facet_intersection_example.cpp @@ -7,7 +7,6 @@ #include #include #include -#include #include typedef CGAL::Simple_cartesian K; diff --git a/AABB_tree/include/CGAL/AABB_tree.h b/AABB_tree/include/CGAL/AABB_tree.h index 41f93215fd8..65a82b6e5b3 100644 --- a/AABB_tree/include/CGAL/AABB_tree.h +++ b/AABB_tree/include/CGAL/AABB_tree.h @@ -1130,7 +1130,7 @@ public: this->traversal(query, traversal_traits); return traversal_traits.is_intersection_found(); } - +#ifndef DOXYGEN_RUNNING //To avoid doxygen to consider definition and declaration as 2 different functions (size_type causes problems) template template typename AABB_tree::size_type @@ -1149,7 +1149,7 @@ public: this->traversal(query, traversal_traits); return counter; } - +#endif template template OutputIterator diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_analysis_2.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_analysis_2.h index 4758d20b215..1e00c5ef176 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_analysis_2.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_analysis_2.h @@ -502,7 +502,6 @@ public: const Polynomial_2& f, CGAL::Degeneracy_strategy strategy = CGAL_ACK_DEFAULT_DEGENERACY_STRATEGY) - throw(internal::Zero_resultant_exception) : Base(Rep(kernel,f,strategy)) { @@ -812,7 +811,7 @@ private: // Creates a status line for the curve's indexth critical point Status_line_1 create_status_line_at_event(size_type index) const - throw(CGAL::internal::Non_generic_position_exception) { + { Event_coordinate_1& event = event_coordinates()[index]; @@ -1446,7 +1445,7 @@ private: //! Returns the Sturm-Habicht sequence of the primitive part of f std::vector& sturm_habicht_of_primitive() const - throw(internal::Zero_resultant_exception) { + { if(! this->ptr()->sturm_habicht_of_primitive) { compute_sturm_habicht_of_primitive(); } @@ -1460,7 +1459,7 @@ public: * of the primitive part of the defining polynomial */ Polynomial_2 sturm_habicht_of_primitive(size_type i) const - throw(internal::Zero_resultant_exception) { + { CGAL_assertion(i>=0 && i < static_cast (sturm_habicht_of_primitive().size())); @@ -1474,7 +1473,7 @@ public: * of the primitive part of the defining polynomial */ Polynomial_1 principal_sturm_habicht_of_primitive(size_type i) const - throw(internal::Zero_resultant_exception) { + { CGAL_assertion(i>=0 && i < static_cast (sturm_habicht_of_primitive().size())); @@ -1496,7 +1495,7 @@ public: * of y^{i-1} of the ith Sturm-Habicht polynomial */ Polynomial_1 coprincipal_sturm_habicht_of_primitive(size_type i) const - throw(internal::Zero_resultant_exception) { + { CGAL_assertion(i>=1 && i < static_cast (sturm_habicht_of_primitive().size())); @@ -1531,7 +1530,7 @@ private: // Internal method to compute the Sturm-Habicht sequence void compute_sturm_habicht_of_primitive() const - throw(internal::Zero_resultant_exception) { + { #if CGAL_ACK_DEBUG_FLAG CGAL_ACK_DEBUG_PRINT << "Compute Sturm-Habicht.." << std::flush; @@ -1591,7 +1590,7 @@ private: //! Returns the resultant of the primitive part of f and its y-derivative Polynomial_1 resultant_of_primitive_and_derivative_y() const - throw(internal::Zero_resultant_exception) { + { if(! this->ptr()->resultant_of_primitive_and_derivative_y) { compute_resultant_of_primitive_and_derivative_y(); } @@ -1602,7 +1601,7 @@ private: //! Returns the resultant of the primitive part of f with its x-derivative Polynomial_1 resultant_of_primitive_and_derivative_x() const - throw(internal::Zero_resultant_exception) { + { if(! this->ptr()->resultant_of_primitive_and_derivative_x) { compute_resultant_of_primitive_and_derivative_x(); } @@ -1612,8 +1611,8 @@ private: private: // Computes res_y(f,f_y), where \c f is the defining polynomial void compute_resultant_of_primitive_and_derivative_y() const - throw(internal::Zero_resultant_exception) { - + { + #if CGAL_ACK_DEBUG_FLAG CGAL_ACK_DEBUG_PRINT << "Compute resultant.." << std::flush; #endif @@ -1664,7 +1663,7 @@ private: // Computes res_y(f,f_x), where \c f is the defining polynomial void compute_resultant_of_primitive_and_derivative_x() const - throw(internal::Zero_resultant_exception) { + { #if CGAL_ACK_DEBUG_FLAG CGAL_ACK_DEBUG_PRINT << "Compute x-resultant.." << std::flush; @@ -1723,7 +1722,7 @@ private: // Returns the critical event coordinates std::vector& event_coordinates() const - throw(internal::Zero_resultant_exception) { + { if(! this->ptr()->event_coordinates) { compute_event_coordinates(); } @@ -1734,8 +1733,7 @@ private: // Returns the intermediate values for intervals between events std::vector >& intermediate_values() const - throw(internal::Zero_resultant_exception) { - + { if(! this->ptr()->intermediate_values) { // This is created during event_coordiantes() event_coordinates(); @@ -1755,7 +1753,7 @@ private: * x-coordinates of the curve. */ void compute_event_coordinates() const - throw(internal::Zero_resultant_exception) { + { #if CGAL_ACK_DEBUG_FLAG CGAL_ACK_DEBUG_PRINT << "compute events..." << std::flush; @@ -1953,7 +1951,6 @@ public: * of the Algebraic_curve_kernel_2 yet. */ Self& shear_primitive_part(Integer s) const - throw(CGAL::internal::Non_generic_position_exception) { CGAL_assertion(s!=0); #if CGAL_ACK_USE_SPECIAL_TREATMENT_FOR_CONIX diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_pair_analysis_2.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_pair_analysis_2.h index 9a3b7d45403..e61841eba8d 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_pair_analysis_2.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_pair_analysis_2.h @@ -480,8 +480,6 @@ public: Curve_analysis_2 c2, CGAL::Degeneracy_strategy strategy = CGAL_ACK_DEFAULT_DEGENERACY_STRATEGY) - throw(CGAL::internal::Zero_resultant_exception, - CGAL::internal::Non_generic_position_exception) : Base(Rep(kernel,c1, c2, strategy)) { @@ -847,13 +845,11 @@ private: private: // Computes a slice_info object at Algebraic_real_1 \c alpha - Slice_info construct_slice_info(Algebraic_real_1 alpha) const - throw(CGAL::internal::Non_generic_position_exception); + Slice_info construct_slice_info(Algebraic_real_1 alpha) const; private: - Status_line_CPA_1 construct_generic_case(size_type i) const - throw(CGAL::internal::Non_generic_position_exception); + Status_line_CPA_1 construct_generic_case(size_type i) const; private: @@ -1170,8 +1166,7 @@ private: Status_line_CPA_1 - create_event_slice_from_current_intersection_info (size_type i) - const throw(CGAL::internal::Non_generic_position_exception); + create_event_slice_from_current_intersection_info (size_type i) const; Bound x_sheared(Bound x, Bound y,Integer sh) const { return x-sh*y; @@ -1992,8 +1987,7 @@ create_slice_from_slice_info(size_type id, template typename Curve_pair_analysis_2::Slice_info Curve_pair_analysis_2:: -construct_slice_info(Algebraic_real_1 alpha) const - throw(CGAL::internal::Non_generic_position_exception) { +construct_slice_info(Algebraic_real_1 alpha) const { /* #if CGAL_ACK_DEBUG_FLAG @@ -2074,8 +2068,7 @@ template typename Curve_pair_analysis_2 ::Status_line_CPA_1 Curve_pair_analysis_2:: -construct_generic_case(size_type i) const - throw(CGAL::internal::Non_generic_position_exception) { +construct_generic_case(size_type i) const { Algebraic_real_1 alpha = event_x(i); @@ -2414,8 +2407,7 @@ template typename Curve_pair_analysis_2 ::Status_line_CPA_1 Curve_pair_analysis_2:: -create_event_slice_from_current_intersection_info (size_type i) - const throw(CGAL::internal::Non_generic_position_exception){ +create_event_slice_from_current_intersection_info (size_type i) const{ #if CGAL_ACK_DEBUG_FLAG CGAL_ACK_DEBUG_PRINT << "Reduce the candidates.." << std::flush; #endif diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Event_line_builder.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Event_line_builder.h index 98cc4d8464b..faf8f6c33fb 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Event_line_builder.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Event_line_builder.h @@ -117,7 +117,6 @@ public: Event_line_builder(Algebraic_kernel_with_analysis_2* kernel, Curve_analysis_2 curve, Polynomial_2 polynomial) - throw(internal::Zero_resultant_exception) : _m_kernel(kernel), curve(curve), polynomial(polynomial) {} @@ -151,7 +150,7 @@ public: Status_line_1 create_event_line(int id,Algebraic_real_1 alpha,int arcs_left,int arcs_right, bool root_of_resultant, bool root_of_content,int mult) - throw(CGAL::internal::Non_generic_position_exception) { + { try { @@ -531,7 +530,7 @@ protected: int mult, int arcs_left, int arcs_right) - throw(CGAL::internal::Non_generic_position_exception) { + { Bitstream_traits traits(Bitstream_coefficient_kernel(kernel(),alpha)); @@ -613,7 +612,7 @@ protected: int k, const Polynomial_2& der_1, const Polynomial_2& der_2) - throw(CGAL::internal::Non_generic_position_exception) { + { //Guess the right expression for y /* diff --git a/Alpha_shapes_2/include/CGAL/Weighted_alpha_shape_euclidean_traits_2.h b/Alpha_shapes_2/include/CGAL/Weighted_alpha_shape_euclidean_traits_2.h index 838aa6783f9..3d86ec4be9b 100644 --- a/Alpha_shapes_2/include/CGAL/Weighted_alpha_shape_euclidean_traits_2.h +++ b/Alpha_shapes_2/include/CGAL/Weighted_alpha_shape_euclidean_traits_2.h @@ -24,17 +24,20 @@ #include +// temporarily silenced +/* +#define CGAL_DEPRECATED_HEADER "" +#define CGAL_REPLACEMENT_HEADER "" +#define CGAL_DEPRECATED_MESSAGE_DETAILS \ + "The class Weighted_alpha_shape_euclidean_traits_2 is deprecated in favor of "\ + "Regular_triangulation_euclidean_traits_2." +#include +*/ #include namespace CGAL { -//------------------ Traits class ------------------------------------- - -#ifdef CGAL_NO_DEPRECATED_CODE -#error The class Weighted_alpha_shape_euclidean_traits_2 is deprecated in favor of Regular_triangulation_euclidean_traits_2. -#endif - template< class R > class Weighted_alpha_shape_euclidean_traits_2 : public Regular_triangulation_euclidean_traits_2 diff --git a/Alpha_shapes_2/include/CGAL/constructions/squared_radius_smallest_orthogonalcircle_ftC2.h b/Alpha_shapes_2/include/CGAL/constructions/squared_radius_smallest_orthogonalcircle_ftC2.h deleted file mode 100644 index 319bd23387c..00000000000 --- a/Alpha_shapes_2/include/CGAL/constructions/squared_radius_smallest_orthogonalcircle_ftC2.h +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) 1997 INRIA Sophia-Antipolis (France). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org). -// You can redistribute it and/or modify it under the terms of the GNU -// General Public License as published by the Free Software Foundation, -// either version 3 of the License, or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// -// -// Author(s) : Tran Kai Frank DA - -#ifndef CGAL_SQUARED_RADIUS_SMALLEST_ORTHOGONALCIRCLE_FTC2_H -#define CGAL_SQUARED_RADIUS_SMALLEST_ORTHOGONALCIRCLE_FTC2_H - -#include - - -#include -#include - -//------------------------------------------------------------------- -namespace CGAL { -//------------------------------------------------------------------- - -template< class FT > -CGAL_MEDIUM_INLINE -FT -squared_radius_orthogonalcircleC2( - const FT &px, const FT &py, const FT &pw, - const FT &qx, const FT &qy, const FT &qw, - const FT &rx, const FT &ry, const FT &rw) - -{ - FT FT4(4); - FT dpx = px-rx; - FT dpy = py-ry; - FT dqx = qx-rx; - FT dqy = qy-ry; - FT dpp = CGAL_NTS square(dpx)+CGAL_NTS square(dpy)-pw+rw; - FT dqq = CGAL_NTS square(dqx)+CGAL_NTS square(dqy)-qw+rw; - - FT det0 = determinant(dpx, dpy, dqx, dqy); - - FT det1 = determinant(dpp, dpy, dqq, dqy); - - FT det2 = determinant(dpx, dpp, dqx, dqq); - - return - (CGAL_NTS square(det1)+CGAL_NTS square(det2))/ - (FT4*CGAL_NTS square(det0)) - rw; -} - -template< class FT > -CGAL_MEDIUM_INLINE -FT -squared_radius_smallest_orthogonalcircleC2( - const FT &px, const FT &py, const FT &pw, - const FT &qx, const FT &qy, const FT &qw) - -{ - FT FT4(4); - FT dpz = CGAL_NTS square(px-qx)+CGAL_NTS square(py-qy); - - return (CGAL_NTS square(dpz-pw+qw)/(FT4*dpz)-qw); -} - -//------------------------------------------------------------------- -} //namespace CGAL -//------------------------------------------------------------------- - -#endif //CGAL_SQUARED_RADIUS_SMALLEST_ORTHOGONALCIRCLE_ftC2_H diff --git a/Alpha_shapes_2/include/CGAL/predicates/in_smallest_orthogonalcircle_ftC2.h b/Alpha_shapes_2/include/CGAL/predicates/in_smallest_orthogonalcircle_ftC2.h deleted file mode 100644 index 95ecd0140cc..00000000000 --- a/Alpha_shapes_2/include/CGAL/predicates/in_smallest_orthogonalcircle_ftC2.h +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) 1997 INRIA Sophia-Antipolis (France). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org). -// You can redistribute it and/or modify it under the terms of the GNU -// General Public License as published by the Free Software Foundation, -// either version 3 of the License, or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// -// -// Author(s) : Tran Kai Frank DA - -#ifndef CGAL_IN_SMALLEST_ORTHOGONALCIRCLE_FTC2_H -#define CGAL_IN_SMALLEST_ORTHOGONALCIRCLE_FTC2_H - -#include - - -#include -#include - -//------------------------------------------------------------------- -namespace CGAL { -//------------------------------------------------------------------- - -template< class FT > -CGAL_MEDIUM_INLINE -Bounded_side -in_smallest_orthogonalcircleC2(const FT &px, const FT &py, const FT &pw, - const FT &qx, const FT &qy, const FT &qw, - const FT &tx, const FT &ty, const FT &tw) -{ - FT dpx = px-qx; - FT dpy = py-qy; - FT dtx = tx-qx; - FT dty = ty-qy; - FT dpz = CGAL_NTS square(dpx)+CGAL_NTS square(dpy); - - return Bounded_side - (CGAL_NTS sign(-(CGAL_NTS square(dtx)+CGAL_NTS square(dty)-tw+qw)*dpz - +(dpz-pw+qw)*(dpx*dtx+dpy*dty))); -} - -//------------------------------------------------------------------- -} //namespace CGAL -//------------------------------------------------------------------- - -#endif //CGAL_IN_SMALLEST_ORTHOGONALCIRCLEC2_H diff --git a/Alpha_shapes_3/demo/Alpha_shapes_3/CMakeLists.txt b/Alpha_shapes_3/demo/Alpha_shapes_3/CMakeLists.txt index 66535c94d8c..08cf7ce7ed0 100644 --- a/Alpha_shapes_3/demo/Alpha_shapes_3/CMakeLists.txt +++ b/Alpha_shapes_3/demo/Alpha_shapes_3/CMakeLists.txt @@ -8,6 +8,9 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) # Instruct CMake to run moc automatically when needed. set(CMAKE_AUTOMOC ON) cmake_minimum_required(VERSION 2.8.11) +if(POLICY CMP0053) + cmake_policy(SET CMP0053 OLD) +endif() if(POLICY CMP0043) cmake_policy(SET CMP0043 OLD) endif() diff --git a/Alpha_shapes_3/demo/Alpha_shapes_3/MainWindow.cpp b/Alpha_shapes_3/demo/Alpha_shapes_3/MainWindow.cpp index a189679344f..9de26cdd7db 100644 --- a/Alpha_shapes_3/demo/Alpha_shapes_3/MainWindow.cpp +++ b/Alpha_shapes_3/demo/Alpha_shapes_3/MainWindow.cpp @@ -51,7 +51,7 @@ MainWindow::open_file() QString fileName = QFileDialog::getOpenFileName(this, tr("Open Points File"), "./data", - tr("pts files (*.pts)")); + tr("pts files (*.pts)")); if(! fileName.isEmpty()){ open(fileName); diff --git a/Alpha_shapes_3/include/CGAL/Weighted_alpha_shape_euclidean_traits_3.h b/Alpha_shapes_3/include/CGAL/Weighted_alpha_shape_euclidean_traits_3.h index 2fa671657d2..7c6dc165cd9 100644 --- a/Alpha_shapes_3/include/CGAL/Weighted_alpha_shape_euclidean_traits_3.h +++ b/Alpha_shapes_3/include/CGAL/Weighted_alpha_shape_euclidean_traits_3.h @@ -23,19 +23,20 @@ #include +// temporarily silenced +/* +#define CGAL_DEPRECATED_HEADER "" +#define CGAL_REPLACEMENT_HEADER "" +#define CGAL_DEPRECATED_MESSAGE_DETAILS \ + "The class Weighted_alpha_shape_euclidean_traits_3 is deprecated in favor of "\ + "Regular_triangulation_euclidean_traits_3." +#include +*/ #include namespace CGAL { - - -//------------------ Traits class ------------------------------------- - -#ifdef CGAL_NO_DEPRECATED_CODE -#error The class Weighted_alpha_shape_euclidean_traits_3 is deprecated in favor of Regular_triangulation_euclidean_traits_3. -#endif - template class Weighted_alpha_shape_euclidean_traits_3 : public Regular_triangulation_euclidean_traits_3 diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2.h index da1b743c63c..5239f742b36 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2.h @@ -43,7 +43,7 @@ #include #include -#include +#include #include #include 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 7997358d767..dfd592b8fc0 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,6 +3,9 @@ project( Arrangement_on_surface_2_Demo ) cmake_minimum_required(VERSION 2.8.11) +if(POLICY CMP0053) + cmake_policy(SET CMP0053 OLD) +endif() if(POLICY CMP0043) cmake_policy(SET CMP0043 OLD) endif() diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_polycurve_traits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_polycurve_traits_2.h index 0d16b19f3ff..5fb8b3fb479 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_polycurve_traits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_polycurve_traits_2.h @@ -8,12 +8,11 @@ /// @} namespace CGAL { - /*! - * \ingroup PkgArrangement2TraitsClasses + /*! \ingroup PkgArrangement2TraitsClasses * - * Note: The `GeometryTraits_2` can comprise of Line_segments, Conic_arcs, - * Circular_arc, Bezier_curves or Linear_curves. A portion or a part - * of any of the above mentioned geometric traits is called a segment. + * Note: The `SubcurveTraits_2` can comprise of Line_segments, Conic_arcs, + * Circular_arc, Bezier_curves, or Linear_curves. A portion or a part + * of any of the above mentioned geometric traits is called a subcurve. * * The traits class `Arr_polycurve_traits_2` handles piecewise curves that are * not necessarily linear, such as conic arcs, circular arcs, Bezier curves, @@ -21,22 +20,22 @@ namespace CGAL { * is a chain of subcurves, where each two neighboring subcurves in the chain * share a common endpoint; that is, the polycurve is continuous. Furthermore, * the target of the \f$i\f$th segement of a polycurve has to coincide with - * the source of the \f$i+1\f$st segment; that is, the polycurve has to be \a - * well-oriented. Note that it is possible to construct general polycurves + * the source of the \f$i+1\f$st segment; that is, the polycurve has to be + * \a well-oriented. Note that it is possible to construct general polycurves * that are neither continuous nor well-oriented, as it is impossible to * enforce this precondition (using the set of predicates required by the * relevant concepts, see below). However, such polycurves cannot be used for * the actual computation of arrangements. The traits class template exploits - * the functionality of the `GeometryTraits_2` template-parameter to handle + * the functionality of the `SubcurveTraits_2` template-parameter to handle * the subcurves that compose the polycurve. * - * The type substituting the template parameter `GeometryTraits_2` when + * The type substituting the template parameter `SubcurveTraits_2` when * the template Arr_polycurve_traits_2 is instantiated must be a model * of the concepts * - `ArrangementTraits_2` and * - `ArrangementDirectionalXMonotoneTraits_2`. * - * If, in addition, the GeometryTraits_2 models the concept + * If, in addition, the SubcurveTraits_2 models the concept * `ArrangementApproximateTraits_2` then `Arr_polycurve_traits_2` models this * concept as well. The same holds for the concept * `ArrangementOpenBoundaryTraits_2`. If no type is provided, then @@ -53,22 +52,22 @@ namespace CGAL { * `Arr_rational_function_traits_2`, * or any other model of the concepts above can be used. * - * The number type used by the injected segment traits should support exact + * The number type used by the injected subcurve traits should support exact * rational arithmetic (that is, the number type should support the arithmetic * operations \f$ +\f$, \f$ -\f$, \f$ \times\f$ and \f$ \div\f$ carried out * without loss of precision), in order to avoid robustness problems, although * other inexact number types could be used at the user's own risk. * - * A polycurve that comprises \f$n > 0\f$ segments has \f$ n+1 \f$ segment + * A polycurve that comprises \f$n > 0\f$ subcurves has \f$ n+1 \f$ subcurve * end-points, and they are represented as objects of type - * `GeometryTraits_2::Point_2`. Since the notion of a \a vertex is reserved to + * `SubcurveTraits_2::Point_2`. Since the notion of a \a vertex is reserved to * 0-dimensional elements of an arrangement, we use, in this context, the * notion of \a points in order to refer to the vertices of a polycurve. For * example, an arrangement induced by a single non-self intersecting polycurve - * has exactly two vertices regardless of the number of segment - * end-points. Finally, the types `Segment_2` and `X_monotone_segment_2` + * has exactly two vertices regardless of the number of subcurve + * end-points. Finally, the types `Subcurve_2` and `X_monotone_subcurve_2` * nested in `Arr_polycurve_traits_2` are nothing but - * `GeometryTraits_2::Curve_2` and `GeometryTraits_2::X_monotone_curve_2`, + * `SubcurveTraits_2::Curve_2` and `SubcurveTraits_2::X_monotone_curve_2`, * respectively. * * \cgalHeading{A note on Backwards compatibility} In \cgal version 4.2 (and @@ -85,10 +84,10 @@ namespace CGAL { * \cgalModels `ArrangementTraits_2` * \cgalModels `ArrangementDirectionalXMonotoneTraits_2` * \cgalModels `ArrangementApproximateTraits_2` (if the type that substitutes - * the template parameter `GeometryTraits_2` models the concept as well) + * the template parameter `SubcurveTraits_2` models the concept as well) * * \sa `Arr_algebraic_segment_traits_2` - * \sa `Arr_Bezier_curve_traits_2` + * \sa `Arr_Bezier_curve_traits_2` * \sa `Arr_circle_segment_traits_2` * \sa `Arr_conic_traits_2` * \sa `Arr_linear_traits_2` @@ -98,7 +97,7 @@ namespace CGAL { * \sa `CGAL_ALWAYS_LEFT_TO_RIGHT` */ - template + template class Arr_polycurve_traits_2 { public: @@ -108,12 +107,12 @@ namespace CGAL { */ // TODO: Have to turn these into links, so whenever I mention Point_2 it // will point here and *not* to Kernel::Point_2 for instance. - typedef GeometryTraits_2::Point_2 Point_2; + typedef SubcurveTraits_2::Point_2 Point_2; /*! */ - typedef GeometryTraits_2::Curve_2 Segment_2; - typedef GeometryTraits_2::X_monotone_curve_2 X_monotone_segment_2; + typedef SubcurveTraits_2::Curve_2 Subcurve_2; + typedef SubcurveTraits_2::X_monotone_curve_2 X_monotone_subcurve_2; /// @} /*! Construction functor of a general (not necessarily \f$x\f$-monotone) @@ -122,7 +121,7 @@ namespace CGAL { * This functor constructs general polycurve. Its `operator()` is * oveloaded to support various input types. * - * Note that the composing segments, depending on the `GeometryTraits_2`, + * Note that the composing subcurves, depending on the `SubcurveTraits_2`, * might not be \f$x\f$-monotone. */ class Construct_curve_2 { @@ -130,15 +129,15 @@ namespace CGAL { /// \name Operations /// @{ - /*! Obtain a polycurve that comprises of one given segment. - * \param seg input segment - * \pre `seg` is not degenerated (not tested) - * \return A polycurve with one segment, namely `seg`. + /*! Obtain a polycurve that comprises of one given subcurve. + * \param subcurve input subcurve. + * \pre `subcurve` is not degenerated (not tested). + * \return A polycurve with one subcurve, namely `subcurve`. */ - Curve_2 operator()(const Segment_2& seg) const; + Curve_2 operator()(const Subcurve_2& subcurve) const; /*! Construct a well-oriented polycurve from a range of either - * `GeometryTraits_2::Point_2` or `GeometryTraits_2::Curve_2`. + * `SubcurveTraits_2::Point_2` or `SubcurveTraits_2::Curve_2`. * * \param begin iterator pointing to the first element in the * range. @@ -146,7 +145,7 @@ namespace CGAL { * element in the range. * \pre The given range form a continuous and well-oriented polycurve * (not tested). - * \pre Contains no degenerated segments (not tested) + * \pre Contains no degenerated subcurves (not tested) * \return A polycurve using the corresponding construction implementation. */ template @@ -167,12 +166,12 @@ namespace CGAL { */ class Construct_x_monotone_curve_2 {}; - /*! Function object which returns the number of segment end-points of a + /*! Function object which returns the number of subcurve end-points of a * polycurve. */ class Number_of_points_2 {}; - /*! Functor to augment a polycurve by either adding a vertex or a segment + /*! Functor to augment a polycurve by either adding a vertex or a subcurve * at the back. */ class Push_back_2 { @@ -180,32 +179,31 @@ namespace CGAL { /// \name Operations /// @{ - /*! - * Append a segment `seg` to an existing polycurve `cv` at the back. - * If `cv` is empty, `seg` will be its first segment. + /*! Append a subcurve `subcurve` to an existing polycurve `cv` at the back. + * If `cv` is empty, `subcurve` will be its first subcurve. * \param cv a polycurve. Note, `cv` is (not necessarily) \f$x\f$-monotone. - * \param seg a segment (not necessarily \f$x\f$-monotone) to be appended - * to `cv` + * \param subcurve a subcurve (not necessarily \f$x\f$-monotone) to be + * appended to `cv` */ - void operator()(Curve_2& cv, const Segment_2& seg) const; + void operator()(Curve_2& cv, const Subcurve_2& subcurve) const; - /*! Append a segment `seg` to an existing \f$x\f$-monotone polycurve `xcv` - * at the back. If `xcv` is empty, `seg` will be its first segment. + /*! Append a subcurve `subcurve` to an existing \f$x\f$-monotone polycurve + * `xcv` at the back. If `xcv` is empty, `subcurve` will be its first + * subcurve. * \param xcv existing \f$x\f$-monotone polycurve - * \param seg the segment to be added - * \pre If `xcv` is not empty then `seg` extends `xcv` to the right if - * `xcv` is oriented right-to-left. Otherwise, `seg` extends `xcv` to - * the left. - * \pre `seg` is not degenerated. - * \pre `xcv` and `seg` should have the same orientation + * \param subcurve the subcurve to be added + * \pre If `xcv` is not empty then `subcurve` extends `xcv` to the right + * if `xcv` is oriented right-to-left. Otherwise, `subcurve` extends + * `xcv` to the left. + * \pre `subcurve` is not degenerated. + * \pre `xcv` and `subcurve` should have the same orientation */ - void operator()(const X_monotone_curve_2& xcv, X_monotone_segment_2& seg) - const; - + void operator()(X_monotone_curve_2& xcv, + const X_monotone_subcurve_2& subcurve) const; /// @} /* end of operations */ }; /* end of Arr_polycurve_traits_2::Push_back_2 */ - /*! Functor to augment a polycurve by either adding a vertex or a segment + /*! Functor to augment a polycurve by either adding a vertex or a subcurve * at the front. */ class Push_front_2 { @@ -213,26 +211,27 @@ namespace CGAL { /// \name Operations /// @{ - /*! Append a segment `seg` to an existing polycurve `cv` at the front. - * If `cv` is empty, `seg` will be its first segment. + /*! Append a subcurve `subcurve` to an existing polycurve `cv` at the + * front. If `cv` is empty, `subcurve` will be its first subcurve. * \param cv a polycurve. Note, `cv` is (not necessarily) \f$x\f$-monotone. - * \param seg a segment (not necessarily \f$x\f$-monotone) to be appended - * to `cv` + * \param subcurve a subcurve (not necessarily \f$x\f$-monotone) to be + * appended to `cv` */ - void operator()(Curve_2& cv, const Segment_2& seg) const; + void operator()(Curve_2& cv, const Subcurve_2& subcurve) const; - /*! Append a segment `seg` to an existing \f$x\f$-monotone polycurve `xcv` - * at the front. If `xcv` is empty, `seg` will be its first segment. + /*! Append a subcurve `subcurve` to an existing \f$x\f$-monotone polycurve + * `xcv` at the front. If `xcv` is empty, `subcurve` will be its first + * subcurve. * \param xcv existing \f$x\f$-monotone polycurve - * \param seg the segment to be added - * \pre If `xcv` is not empty then `seg` extends `xcv` to the left if - * `xcv` is oriented right-to-left. Otherwise, `seg` extends `xcv` to - * the right. - * \pre `seg` is not degenerated. - * \pre `xcv` and `seg` should have the same orientation + * \param subcurve the subcurve to be added + * \pre If `xcv` is not empty then `subcurve` extends `xcv` to the left if + * `xcv` is oriented right-to-left. Otherwise, `subcurve` extends + * `xcv` to the right. + * \pre `subcurve` is not degenerated. + * \pre `xcv` and `subcurve` should have the same orientation */ - void operator()(const X_monotone_curve_2& xcv, X_monotone_segment_2& seg) - const; + void operator()(X_monotone_curve_2& xcv, + const X_monotone_subcurve_2& subcurve) const; /// @} /* end of operations */ }; /* end of Arr_polycurve_traits_2::Push_front_2 */ @@ -249,8 +248,8 @@ namespace CGAL { const Point_2& tgt) const; }; - /*! Subdivide the given segment into x-monotone sub-segments and insert them - * into the given output iterator. Since the segments that + /*! Subdivide the given subcurve into x-monotone subcurves and insert them + * into the given output iterator. Since the subcurves that * constitute a general polycurve are not necessarily * \f$x\f$-monotone, this functor may break them. */ @@ -258,7 +257,7 @@ namespace CGAL { public: /*! * \pre if `cv` is not empty then it must be continuous and well-oriented. - * \param cv The segment. + * \param cv The subcurve. * \param oi The output iterator, whose value-type is Object. The output * object is a wrapper of a X_monotone_curve_2 objects. * \return The past-the-end iterator. @@ -268,25 +267,25 @@ namespace CGAL { }; /*! The `Curve_2` type nested in the `Arr_polycurve_traits_2` represents - * general continuous piecewise-linear segments (a polycurve can be + * general continuous piecewise-linear subcurves (a polycurve can be * self-intersecting) and support their construction from range of - * segments. Construction of polycurves in various ways is supported using + * subcurves. Construction of polycurves in various ways is supported using * the construction functors. It is strongly recommended to avoid * construction of `Curve_2` objects directly and prefer the usage of the * construction functors. The type `Curve_2` has two template - * parameters, namely `Segment_type_T` and `Point_type_T`, which are - * `GeometryTraits_2::Curve_2` and `GeometryTraits_2::Point_2` types. Thus, - * in general, the segments that a `Curve_2` instance comprises could be + * parameters, namely `SubcurveType_2` and `PointType_2`, which are + * `SubcurveTraits_2::Curve_2` and `SubcurveTraits_2::Point_2` types. Thus, + * in general, the subcurves that a `Curve_2` instance comprises could be * either \f$x\f$-monotone or not! * * The copy and default constructor as well as the assignment operator are - * provided for polycurve segments. In addition, an \link - * PkgArrangement2op_left_shift `operator<<` \endlink for the segments is + * provided for polycurve subcurves. In addition, an \link + * PkgArrangement2op_left_shift `operator<<` \endlink for the subcurves is * defined for standard output streams, and an \link - * PkgArrangement2op_right_shift `operator>>` \endlink for the segments is + * PkgArrangement2op_right_shift `operator>>` \endlink for the subcurves is * defined for standard input streams. */ - template + template class Curve_2 { public: @@ -294,36 +293,37 @@ namespace CGAL { /// \name Types /// @{ - /*! The container of the segments that comprises the polycurve. + /*! The container of the subcurves that comprises the polycurve. */ - typedef typename std::vector Segments_container; + typedef typename std::vector Subcurves_container; public: /*! The size of the container that comprises the polycurve. */ - typedef typename Segments_container::size_type Segments_size_type; + typedef typename Subcurves_container::size_type Size; + typedef typename Subcurves_container::size_type size_type; /*! \deprecated * A bidirectional iterator that allows traversing the points - * that comprise a polycurve's segments. + * that comprise a polycurve's subcurves. */ typedef unspecified_type const_iterator; /*! \deprecated * A bidirectional iterator that allows traversing the points - * that comprise a polycurve's segments. + * that comprise a polycurve's subcurves. */ typedef unspecified_type const_reverse_iterator; /*! A bidirectional constant iterator that allows traversing - * the segments that comprise the polycurve. + * the subcurves that comprise the polycurve. */ - typedef unspecified_type Segment_const_iterator; + typedef unspecified_type Subcurve_const_iterator; /*! A bidirectional constant iterator that allows traversing - * the segments that comprise the polycurve. + * the subcurves that comprise the polycurve. */ - typedef unspecified_type Segment_const_reverse_iterator; + typedef unspecified_type Subcurve_const_reverse_iterator; /// @} /* End of Types */ @@ -334,25 +334,25 @@ namespace CGAL { */ Curve_2(); - /*! Construct a polycurve from one segment. + /*! Construct a polycurve from one subcurve. */ - Curve_2(const Segment_2 seg); + Curve_2(const Subcurve_2 subcurve); - /*! Construct a polycurve defined by the given range of segments + /*! Construct a polycurve defined by the given range of subcurves * `[first, last)` (the value-type of `InputIterator` must be - * `GeometryTraits_2::Curve_2`. In general, the segments might not + * `SubcurveTraits_2::Curve_2`. In general, the subcurves might not * be \f$x\f$-monotone, furthermore, they might not form a * continuous polycurve. * - * \pre The segments in the range should form a continuous and + * \pre The subcurves in the range should form a continuous and * well-oriented polycurve. * * \deprecated For backwards compatibility, it is * possible to call this constructor with a range whose - * value-type is `GeometryTraits_2::Point_2`. In this case, the + * value-type is `SubcurveTraits_2::Point_2`. In this case, the * constructed polycurve will concatenate the \f$n\f$th point * with the \f$(n+1)\f$-st point in the range (using a - * `GeometryTraits_2::Segment_2`'s). This functionality is \a deprecated. + * `SubcurveTraits_2::Subcurve_2`'s). This functionality is \a deprecated. * Instead use the `Construct_curve_2` functors. */ template @@ -364,9 +364,9 @@ namespace CGAL { /// @{ /*! \deprecated - * Obtain the number of segment end-points that comprise the polycurve. + * Obtain the number of subcurve end-points that comprise the polycurve. * Note that for a bounded polycurve, if there are \f$ n\f$ points in the - * polycurve, it is comprised of \f$ (n - 1)\f$ segments. + * polycurve, it is comprised of \f$ (n - 1)\f$ subcurves. * Currently, only bounded polycurves are supported. */ unsigned_int points() const; @@ -376,53 +376,53 @@ namespace CGAL { */ const_iterator begin() const; - /*! Obtain an iterator pointing at the first segment of the polycurve. + /*! Obtain an iterator pointing at the first subcurve of the polycurve. */ - Segment_const_iterator begin_segments() const; + Subcurve_const_iterator begin_subcurves() const; /*! \deprecated * Obtain an iterator pointing after the end of the polycurve. */ const_iterator end() const; - /*! Get an iterator pointing at the past-the-end segment of the polycurve. + /*! Get an iterator pointing at the past-the-end subcurve of the polycurve. */ - Segment_const_iterator end_segments() const; + Subcurve_const_iterator end_subcurves() const; /*! \deprecated * Obtain an iterator pointing at the target point of the polycurve. */ const_iterator rbegin() const; - /*! Obtain an iterator pointing at the last segment of the polycurve. + /*! Obtain an iterator pointing at the last subcurve of the polycurve. */ - Segment_const_reverse_iterator rbegin_segments() const; + Subcurve_const_reverse_iterator rbegin_subcurves() const; /*! \deprecated * Obtain an iterator pointing before the beginning of the polycurve. */ const_iterator rend() const; - /*! Obtain an iterator pointing at the past-the-end segment of + /*! Obtain an iterator pointing at the past-the-end subcurve of * the polycurve in reverse order. */ - Segment_const_reverse_iterator rend_segments() const; + Subcurve_const_reverse_iterator rend_subcurves() const; /*! \deprecated - * Obtain the number of segments composing the polycurve - * (equivalent to `pi.points() - 1`). Was replaced by number_of_segments() + * Obtain the number of subcurves composing the polycurve + * (equivalent to `pi.points() - 1`). Was replaced by number_of_subcurves() */ - Segments_size_type size() const; + size_type size() const; - /*! Obtain the number of segments that comprise the polycurve. + /*! Obtain the number of subcurves that comprise the polycurve. */ - Segments_container_size number_of_segments() const; + size_type number_of_subcurves() const; - /*! Obtain the \f$ k\f$th segment of the polycurve. + /*! Obtain the \f$ k\f$th subcurve of the polycurve. * \pre \f$k\f$ is not greater then or equal to \f$n-1\f$, where - * \f$n\f$ is the number of segments. + * \f$n\f$ is the number of subcurves. */ - typename GeometryTraits_2::X_monotone_curve_2 + typename SubcurveTraits_2::X_monotone_curve_2 operator[](size_t k) const; /*! Obtain the bounding box of the polycurve. @@ -434,30 +434,32 @@ namespace CGAL { /// \name Operations /// @{ - /*! Append a segment to the polycurve at the back. + /*! Append a subcurve to the polycurve at the back. * \a Warning: This function does not preform the precondition test * that the `Push_back_2` functor does. Thus, it is * recommended to use the latter. - * \param seg The new segment to be appended to the polycurve. - * \pre If the polycurve is not empty, the source of `seg` must coincide - * with the target point of the last segment in the polycurve. + * \param subcurve The new subcurve to be appended to the polycurve. + * \pre If the polycurve is not empty, the source of `subcurve` must + * coincide with the target point of the last subcurve in the + * polycurve. */ - inline void push_back(const Segment_2& seg); + inline void push_back(const Subcurve_2& subcurve); - /*! Append a segment to the polycurve at the front. + /*! Append a subcurve to the polycurve at the front. * \a Warning: This is a risky function! Don't use it! Prefer the * corresponding functor which is provided in the traits * class. - * \param seg The new segment to be appended to the polycurve. - * \pre If the polycurve is not empty, the target of `seg` must coincide - * with the source point of the first segment in the polycurve. + * \param subcurve The new subcurve to be appended to the polycurve. + * \pre If the polycurve is not empty, the target of `subcurve` must + * coincide with the source point of the first subcurve in the + * polycurve. */ - inline void push_front(const Segment_2& seg); + inline void push_front(const Subcurve_2& subcurve); /*! \deprecated * Add a new point to the polycurvs, which becomes the new target point * of `pi`. - * \pre GeometryTraits_2 is a model of + * \pre SubcurveTraits_2 is a model of * ArrangementConstructXMonotoneCurveTraits_2. */ void push_back(const Point_2 & p); @@ -472,15 +474,15 @@ namespace CGAL { /*! The `X_monotone_curve_2` class nested within the polycurve - * traits is used to represent \f$ x\f$-monotone piecewise linear segments. + * traits is used to represent \f$ x\f$-monotone piecewise linear subcurves. * * It inherits from the `Curve_2` type. `X_monotone_curve_2` can be * constructed just like `Curve_2`. However, there is precondition * (which is not tested) that the input defines an \f$ * x\f$-monotone polycurve. Furthermore, in contrast to the general - * `Curve_2` type, in this case, the segments that an + * `Curve_2` type, in this case, the subcurves that an * `X_monotone_curve_2` comprises have to be instances of the type - * `GeometryTraits_2::X_monotone_curve_2`. Note that the \f$ + * `SubcurveTraits_2::X_monotone_curve_2`. Note that the \f$ * x\f$-monotonicity ensures that an \f$ x\f$-monotone polycurve * is not self-intersecting. (A self-intersecting polycurve is * subdivided into several interior-disjoint \f$x\f$-monotone subcurves). @@ -490,7 +492,7 @@ namespace CGAL { * lexicographical \f$ xy\f$-order) or left-to-right (and in this case the * vertices are stored in a descending lexicographical \f$ xy\f$-order). */ - template + template class X_monotone_curve_2 { }; /* end Arr_polycurve_traits_2::X_monotone_curve_2 */ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_polyline_traits_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_polyline_traits_2.h index e3e30a4ae86..c4d3e697598 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_polyline_traits_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arr_polyline_traits_2.h @@ -84,7 +84,8 @@ namespace CGAL { * \cgalModels `ArrangementApproximateTraits_2` (if the type that substitutes * the template parameter `SegmentTraits_2` models the concept as well) * - * \sa `Arr_Bezier_curve_traits_2` + * \sa `Arr_polycurve_traits_2` + * \sa `Arr_Bezier_curve_traits_2` * \sa `Arr_circle_segment_traits_2` * \sa `Arr_conic_traits_2` * \sa `Arr_linear_traits_2` @@ -94,21 +95,22 @@ namespace CGAL { */ template - class Arr_polyline_traits_2 { + class Arr_polyline_traits_2 : public Arr_polycurve_traits_2{ public: /// \name Types /// @{ /*! */ + typedef SegmentTraits_2 Segment_traits_2; // TODO: Have to turn these into links, so whenever I mention Point_2 it // will point here and *not* to Kernel::Point_2 for instance. - typedef SegmentTraits_2::Point_2 Point_2; + typedef SegmentTraits_2::Point_2 Point_2; /*! */ - typedef SegmentTraits_2::Curve_2 Segment_2; - typedef SegmentTraits_2::X_monotone_curve_2 X_monotone_segment_2; + typedef SegmentTraits_2::Curve_2 Segment_2; + typedef SegmentTraits_2::X_monotone_curve_2 X_monotone_segment_2; /// @} /*! Construction functor of a general (not necessarily \f$x\f$-monotone) @@ -168,12 +170,7 @@ namespace CGAL { */ class Construct_x_monotone_curve_2 {}; - /*! Function object which returns the number of points of a polyline. - */ - class Number_of_points_2 {}; - - /*! - * Functor to augment a polyline by either adding a vertex or a segment + /*! Functor to augment a polyline by either adding a vertex or a segment * at the back. */ class Push_back_2 { @@ -273,260 +270,6 @@ namespace CGAL { /// @} /* end of operations */ }; /* end of Arr_polyline_traits_2::Push_front_2 */ - class Trim_2 { - public: - /*! Obtain a trimmed version of the polycurve with src and tgt as end - * vertices. - * Src and tgt will be swaped if they do not conform to the direction of - * the polycurve. - */ - X_monotone_curve_2 operator()(const X_monotone_curve_2& xcv, - const Point_2& src, - const Point_2& tgt) const; - }; - - /*! Subdivide the given curve into x-monotone sub-curves and insert them - * into the given output iterator. Since the segments that - * constitute a general polyline are not necessarily - * \f$x\f$-monotone, this functor may break them. - */ - class Make_x_monotone_2 { - public: - /*! \pre if `cv` is not empty then it must be continuous and well-oriented. - * \param cv The curve. - * \param oi The output iterator, whose value-type is Object. The output - * object is a wrapper of a X_monotone_curve_2 objects. - * \return The past-the-end iterator. - */ - template - OutputIterator operator()(const Curve_2& cv, OutputIterator oi) const; - }; - - /*! The `Curve_2` type nested in the `Arr_polyline_traits_2` represents - * general continuous piecewise-linear curves (a polyline can be - * self-intersecting) and support their construction from range of - * segments. Construction of polylines in various ways is supported using the - * construction functors. It is strongly recommended to avoid - * construction of `Curve_2` objects directly and prefer the usage of the - * construction functors. The type `Curve_2` has two template - * parameters, namely `Segment_type_T` and `Point_type_T`, which are - * `SegmentTraits_2::Curve_2` and `SegmentTraits_2::Point_2` types. Thus, in - * general, the segments that a `Curve_2` instance comprises could be either - * \f$x\f$-monotone or not! - * - * The copy and default constructor as well as the assignment - * operator are provided for polyline curves. In addition, an \link - * PkgArrangement2op_left_shift `operator<<` \endlink for the - * curves is defined for standard output streams, and an \link - * PkgArrangement2op_right_shift `operator>>` \endlink for the - * curves is defined for standard input streams. - */ - template - class Curve_2 { - public: - - protected: - /// \name Types - /// @{ - - /*! The container of the segments that comprises the polyline. - */ - typedef typename std::vector Segments_container; - - public: - /*! The size of the container that comprises the polylines. - */ - typedef typename Segments_container::size_type Segments_size_type; - - /*! \deprecated - * A bidirectional iterator that allows traversing the points - * that comprise a polyline curve. - */ - typedef unspecified_type const_iterator; - - /*! \deprecated - * A bidirectional iterator that allows traversing the points - * that comprise a polyline curve. - */ - typedef unspecified_type const_reverse_iterator; - - /*! A bidirectional constant iterator that allows traversing - * the segments the comprise the polyline. - */ - typedef unspecified_type Segment_const_iterator; - - /*! A bidirectional constant iterator that allows traversing - * the segments the comprise the polyline. - */ - typedef unspecified_type Segment_const_reverse_iterator; - - /// @} /* End of Types */ - - /// \name Creation - /// @{ - - /*! Default constructor that constructs an empty polyline. - */ - Curve_2(); - - /*! Construct a polyline from one segment. - */ - Curve_2(const Segment_2 seg); - - /*! Construct a polyline defined by the given range of segments - * `[first, last)` (the value-type of `InputIterator` must be - * `SegmentTraits_2::Curve_2`. In general, the segments might not be - * \f$x\f$-monotone, furthermore, they might not form a continuous - * polyline. - * - * \pre The segments in the range should form a continuous and - * well-oriented polyline. - * - * \deprecated For backwards compatibility, it is - * possible to call this constructor with a range whose - * value-type is `SegmentTraits_2::Point_2`. In this case, the - * constructed polyline will concatenate the \f$n\f$th point - * with the \f$(n+1)\f$-st point in the range (using a - * `SegmentTraits_2::Segment_2`'s). This functionality is \a deprecated. - * Instead use the `Construct_curve_2` functors. - */ - template - Curve_2(Iterator first, Iterator last); - - /// @} /* End of Creation */ - - /// \name Access Functions - /// @{ - - /*! \deprecated Obtain the number of points that comprise the polyline. - * Note that for a bounded polyline, if there are \f$ n\f$ points in the - * polyline, it is comprised of \f$ (n - 1)\f$ segments. - * Currently, only bounded polylines are supported. - */ - unsigned_int points() const; - - /*! \deprecated Obtain an iterator pointing at the source point of the - * polyline. - */ - const_iterator begin() const; - - /*! Obtain an iterator pointing at the first segment of the polyline. - */ - Segment_const_iterator begin_segments() const; - - /*! \deprecated Obtain an iterator pointing after the end of the polyline. - */ - const_iterator end() const; - - /*! Obtain an iterator pointing at the past-the-end segment of the - * polyline. - */ - Segment_const_iterator end_segments() const; - - /*! \deprecated Obtain an iterator pointing at the target point of the - * polyline. - */ - const_iterator rbegin() const; - - /*! Obtain an iterator pointing at the last segment of the polyline. - */ - Segment_const_reverse_iterator rbegin_segments() const; - - /*! \deprecated Obtain an iterator pointing before the beginning of the - * polyline. - */ - const_iterator rend() const; - - /*! - * Obtain an iterator pointing at the past-the-end segment of - * the polyline in reverse order. - */ - Segment_const_reverse_iterator rend_segments() const; - - /*! \deprecated Obtain the number of line segments composing the polyline - * (equivalent to `pi.points() - 1`). Was replaced by number_of_segments() - */ - Segments_size_type size() const; - - /*! Obtain the number of segments that comprise the polyline. - */ - Segments_container_size number_of_segments() const; - - /*! Obtain the \f$ k\f$th segment of the polyline. - * \pre \f$k\f$ is not greater then or equal to \f$n-1\f$, where - * \f$n\f$ is the number of segments. - */ - typename SegmentTraits_2::X_monotone_curve_2 operator[](size_t k) const; - - /*! - * the bounding box of the polyline. - */ - Bbox_2 bbox() const; - - /// @} /* End of Access functions */ - - /// \name Operations - /// @{ - - /*! Append a segment to the polyline at the back. - * \a Warning: This function does not preform the precondition test - that the `Push_back_2` functor does. Thus, it is - recommended to use the latter. - * \param seg The new segment to be appended to the polyline. - * \pre If the polyline is not empty, the source of `seg` must coincide - * with the target point of the last segment in the polyline. - */ - inline void push_back(const Segment_2& seg); - - /*! Append a segment to the polyline at the front. - * \a Warning: This is a risky function! Don't use it! Prefer the - * corresponding functor which is provided in the traits - * class. - * \param seg The new segment to be appended to the polyline. - * \pre If the polyline is not empty, the target of `seg` must coincide - * with the source point of the first segment in the polyline. - */ - inline void push_front(const Segment_2& seg); - - /*! \deprecated adds a new point to the polyline, which becomes the new - * target point of `pi`. - */ - void push_back(const Point_2& p); - - /*! Reset the polyline. - */ - void clear(); - - /// @} /* End of Operations */ - - }; /* end Arr_polyline_traits_2::Curve_2 */ - - - /*! The `X_monotone_curve_2` class nested within the polyline - * traits is used to represent \f$ x\f$-monotone piecewise linear - * curves. - * - * It inherits from the `Curve_2` type. `X_monotone_curve_2` can be - * constructed just like `Curve_2`. However, there is precondition - * (which is not tested) that the input defines an \f$ - * x\f$-monotone polyline. Furthermore, in contrast to the general - * `Curve_2` type, in this case, the segments that an - * `X_monotone_curve_2` comprises have to be instances of the type - * `SegmentTraits_2::X_monotone_curve_2`. Note that the \f$ - * x\f$-monotonicity ensures that an \f$ x\f$-monotone polyline - * is not self-intersecting. (A self-intersecting polyline is - * subdivided into several interior-disjoint \f$x\f$-monotone subcurves). - * - * The defined \f$ x\f$-monotone polyline can be directed either from - * right-to-left (and in turn its vertices are stored in an ascending - * lexicographical \f$ xy\f$-order) or left-to-right (and in this case the - * vertices are stored in a descending lexicographical \f$ xy\f$-order). - */ - template - class X_monotone_curve_2 { - - }; /* end Arr_polyline_traits_2::X_monotone_curve_2 */ - /// \name Accessing Functor Objects /// @{ @@ -538,10 +281,6 @@ namespace CGAL { */ Construct_x_monotone_curve_2 construct_x_monotone_curve_2_object() const; - /*! - */ - Number_of_points_2 number_of_points_2_object() const; - /*! */ Push_back_2 push_back_2_object() const; @@ -550,10 +289,6 @@ namespace CGAL { */ Push_front_2 push_front_2_object() const; - /*! - */ - Make_x_monotone_2 make_x_monotone_2_object() const; - /// @} /* End Accessing Functor Objects */ }; /* end Arr_polyline_traits_2 */ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arrangement_2.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arrangement_2.h index 3aaca743d2e..277ddf71eca 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arrangement_2.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/Arrangement_2.h @@ -545,6 +545,10 @@ returning constant iterators instead of mutable ones. */ Vertex_iterator vertices_end(); + /*! + returns a range over handles of the arrangement vertices . + */ + unspecified_type vertex_handles(); /*! returns the number of arrangement vertices that lie at infinity and are not associated with valid points. Such vertices are not considered @@ -578,6 +582,11 @@ returning constant iterators instead of mutable ones. */ Halfedge_iterator halfedges_end(); + /*! + returns a range over handles of the arrangement halfedges . + */ + unspecified_type halfedge_handles(); + /*! returns the number of edges in the arrangement (equivalent to `arr.number_of_halfedges() / 2`). @@ -594,6 +603,10 @@ returning constant iterators instead of mutable ones. */ Edge_iterator edges_end(); + /*! + returns a range over handles of the arrangement edges . + */ + unspecified_type edge_handles(); /// @} @@ -627,6 +640,11 @@ returning constant iterators instead of mutable ones. */ Face_iterator faces_end(); + /*! + returns a range over handles of the arrangement faces . + */ + unspecified_type face_handles(); + /*! returns the number of unbounded faces in the arrangement. Note `arr.number_of_faces()` also counts the unbounded faces diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcel.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcel.h index 8f71879c3c2..e6871287595 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcel.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcel.h @@ -163,6 +163,11 @@ returns a past-the-end iterator of the vertices in `dcel`. */ Vertex_iterator vertices_end(); +/*! +returns a range over handles of the vertices in `dcel`. +*/ +unspecified_type vertex_handles(); + /*! returns a begin-iterator of the vertices in `dcel`. */ @@ -173,6 +178,11 @@ returns a past-the-end iterator of the vertices in `dcel`. */ Vertex_const_iterator vertices_end() const; +/*! +returns a const range (model of `ConstRange`) over handles of the vertices in `dcel`. +*/ +unspecified_type vertex_handles() const; + /*! returns a begin-iterator of the halfedges in `dcel`. */ @@ -183,6 +193,11 @@ returns a past-the-end iterator of the halfedges in `dcel`. */ Halfedge_iterator halfedges_end(); +/*! +returns a range over handles of the halfedges in `dcel`. +*/ +unspecified_type halfedge_handles(); + /*! returns a begin-iterator of the halfedges in `dcel`. */ @@ -193,6 +208,11 @@ returns a past-the-end iterator of the halfedges in `dcel`. */ Halfedge_const_iterator halfedges_end() const; +/*! +returns a const range (model of `ConstRange`) over handles of the halfedges in `dcel`. +*/ +unspecified_type halfedge_handles() const; + /*! returns a begin-iterator of the faces in `dcel`. */ @@ -203,6 +223,11 @@ returns a past-the-end iterator of the faces in `dcel`. */ Face_iterator faces_end(); +/*! +returns a range over handles of the faces in `dcel`. +*/ +unspecified_type face_handles(); + /*! returns a begin-iterator of the faces in `dcel`. */ @@ -213,6 +238,10 @@ returns a past-the-end iterator of the faces in `dcel`. */ Face_const_iterator faces_end() const; +/*! +returns a const range (model of `ConstRange`) over handles of the faces in `dcel`. +*/ +unspecified_type face_handles() const; /// @} diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_dcel_base.h b/Arrangement_on_surface_2/include/CGAL/Arr_dcel_base.h index 6cc5a191bcb..a59938c89bd 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_dcel_base.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_dcel_base.h @@ -1011,24 +1011,64 @@ public: //@{ Vertex_iterator vertices_begin() { return vertices.begin(); } Vertex_iterator vertices_end() { return vertices.end(); } + Iterator_range > + vertex_handles() + { + return make_prevent_deref_range(vertices_begin(), vertices_end()); + } Halfedge_iterator halfedges_begin() { return halfedges.begin();} Halfedge_iterator halfedges_end() { return halfedges.end(); } + Iterator_range > + halfedge_handles() + { + return make_prevent_deref_range(halfedges_begin(), halfedges_end()); + } Face_iterator faces_begin() { return faces.begin(); } Face_iterator faces_end() { return faces.end(); } + Iterator_range > + face_handles() + { + return make_prevent_deref_range(faces_begin(), faces_end()); + } Edge_iterator edges_begin() { return halfedges.begin(); } Edge_iterator edges_end() { return halfedges.end(); } + Iterator_range > + edge_handles() + { + return make_prevent_deref_range(edges_begin(), edges_end()); + } //@} /// \name Obtaining constant iterators. //@{ Vertex_const_iterator vertices_begin() const { return vertices.begin(); } Vertex_const_iterator vertices_end() const { return vertices.end(); } + Iterator_range > + vertex_handles() const + { + return make_prevent_deref_range(vertices_begin(), vertices_end()); + } Halfedge_const_iterator halfedges_begin() const { return halfedges.begin(); } Halfedge_const_iterator halfedges_end() const { return halfedges.end(); } + Iterator_range > + halfedge_handles() const + { + return make_prevent_deref_range(halfedges_begin(), halfedges_end()); + } Face_const_iterator faces_begin() const { return faces.begin(); } Face_const_iterator faces_end() const { return faces.end(); } + Iterator_range > + face_handles() const + { + return make_prevent_deref_range(faces_begin(), faces_end()); + } Edge_const_iterator edges_begin() const { return halfedges.begin(); } Edge_const_iterator edges_end() const { return halfedges.end(); } + Iterator_range > + edge_handles() const + { + return make_prevent_deref_range(edges_begin(), edges_end()); + } //@} // \name Creation of new DCEL features. diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_face_map.h b/Arrangement_on_surface_2/include/CGAL/Arr_face_map.h index 4fba1dbbb0c..812d9918dc2 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_face_map.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_face_map.h @@ -23,17 +23,15 @@ #include - -/*! \file - * Definition of the Arr_face_index_map class. - */ - -#if (defined __GNUC__) - #warning Arr_face_map.h is DEPRECATED, please include Arr_face_index_map.h instead -#elif (defined _MSC_VER) - #pragma message("Arr_face_map.h is DEPRECATED, please include Arr_face_index_map.h instead") -#endif +#define CGAL_DEPRECATED_HEADER "" +#define CGAL_REPLACEMENT_HEADER "" +#include #include +/*! \file + * Definition of the Arr_face_index_map class. + + */ + #endif diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_geodesic_arc_on_sphere_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_geodesic_arc_on_sphere_traits_2.h index 9a750fae761..24b4e3f1491 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_geodesic_arc_on_sphere_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_geodesic_arc_on_sphere_traits_2.h @@ -2936,7 +2936,7 @@ public: CGAL_precondition(!kernel.equal_3_object()(source, target)); CGAL_precondition(!kernel.equal_3_object() (kernel.construct_opposite_direction_3_object()(source), - target)); + static_cast(target))); this->m_normal = this->construct_normal_3(source, target); // Check whether one of the endpoints coincides with a pole: */ diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Circle_segment_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Circle_segment_2.h index 02fe06fc222..eb5e4aa9885 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Circle_segment_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Circle_segment_2.h @@ -401,7 +401,7 @@ public: NT y3 = p3.y(); - // Make sure that the source and the taget are not the same. + // Make sure that the source and the target are not the same. CGAL_precondition (Kernel().compare_xy_2_object() (p1, p3) != EQUAL); // Compute the lines: A1*x + B1*y + C1 = 0, @@ -532,7 +532,7 @@ public: /*! * Get the vertical tangency points the arc contains. - * \param vpts Output: The vertical tagnecy points. + * \param vpts Output: The vertical tangency points. * \pre The curve is circular. * \return The number of points (0, 1, or 2). */ @@ -593,8 +593,8 @@ private: /*! * Get the vertical tangency points the arc contains, assuming it is - * counterclockwise oreinted. - * \param vpts Output: The vertical tagnecy points. + * counterclockwise oriented. + * \param vpts Output: The vertical tangency points. * \return The number of points (0, 1, or 2). */ unsigned int _ccw_vertical_tangency_points (const Point_2& src, diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Polyline_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Polyline_2.h index 5945932d9dd..02209c5573f 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Polyline_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Polyline_2.h @@ -19,6 +19,11 @@ #include +#define CGAL_DEPRECATED_HEADER "" +#define CGAL_REPLACEMENT_HEADER "" +#include + +#include /*! \file * Header file for the polyline classes used by the @@ -26,12 +31,6 @@ * Arr_polyline_traits_2 classes. */ -#if (defined __GNUC__) - #warning Polyline_2.h is DEPRECATED, please include Polycurve_2.h instead -#elif (defined _MSC_VER) - #pragma message("Polyline_2.h is DEPRECATED, please include Polycurve_2.h instead") -#endif - #include namespace CGAL { diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_overlay.h b/Arrangement_on_surface_2/include/CGAL/Arr_overlay.h index b9a873282b1..7310226f176 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_overlay.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_overlay.h @@ -23,17 +23,16 @@ #include +#define CGAL_DEPRECATED_HEADER "" +#define CGAL_REPLACEMENT_HEADER "" +#include + +#include /*! \file * Helping file to include Arr_overlay_2 for backward compatibility. */ -#if (defined __GNUC__) - #warning Arr_overlay.h is DEPRECATED, please include Arr_overlay_2.h instead -#elif (defined _MSC_VER) - #pragma message("Arr_overlay.h is DEPRECATED, please include Arr_overlay_2.h instead") -#endif - #include #endif diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_polyline_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_polyline_traits_2.h index f06b90d0d78..22023a78868 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_polyline_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_polyline_traits_2.h @@ -50,6 +50,10 @@ class Arr_polyline_traits_2 : public Arr_polycurve_traits_2 { public: typedef SegmentTraits_2 Segment_traits_2; + // For completeness + typedef typename Segment_traits_2::Curve_2 Segment_2; + typedef typename Segment_traits_2::X_monotone_curve_2 X_monotone_segment_2; + private: typedef Arr_polyline_traits_2 Self; typedef Arr_polycurve_traits_2 Base; @@ -72,7 +76,7 @@ public: typedef typename Base::Are_all_sides_oblivious_tag Are_all_sides_oblivious_tag; - typedef typename Base::X_monotone_subcurve_2 X_monotone_subcurve_2; + typedef typename Base::X_monotone_subcurve_2 X_monotone_subcurve_2; typedef typename Base::Subcurve_2 Subcurve_2; typedef typename Base::Point_2 Point_2; @@ -133,7 +137,7 @@ public: */ class Push_back_2 : public Base::Push_back_2 { protected: - typedef Arr_polyline_traits_2 Polyline_traits_2; + typedef Arr_polyline_traits_2 Polyline_traits_2; public: /*! Constructor. */ @@ -246,7 +250,7 @@ public: */ class Push_front_2 : public Base::Push_front_2 { protected: - typedef Arr_polyline_traits_2 Polyline_traits_2; + typedef Arr_polyline_traits_2 Polyline_traits_2; public: /*! Constructor. */ @@ -300,7 +304,7 @@ public: /*! Append a point `p` to an existing polyline `xcv` at the front. */ void operator()(const X_monotone_curve_2& xcv, Point_2& p) const { - const SegmentTraits_2* geom_traits = + const Segment_traits_2* geom_traits = this->m_poly_traits.subcurve_traits_2(); CGAL_precondition_code ( diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_polyhedral_sgm.h b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_polyhedral_sgm.h index 5b018c3da6b..df2135cbe41 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_polyhedral_sgm.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_polyhedral_sgm.h @@ -335,7 +335,6 @@ private: virtual void handle_new_edge(typename Base::Halfedge_handle edge) { typedef typename Base::Face_handle Arr_face_handle; - typedef typename Base::Vertex_handle Arr_vertex_handle; Arr_face_handle src_face = edge->twin()->face(); Arr_face_handle trg_face = edge->face(); diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_polyhedral_sgm_polyhedron_3.h b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_polyhedral_sgm_polyhedron_3.h index 64d63bbae04..7854c1e8500 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_polyhedral_sgm_polyhedron_3.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_polyhedral_sgm_polyhedron_3.h @@ -14,7 +14,7 @@ // // $URL$ // $Id$ -// +// // // Author(s) : Efi Fogel @@ -160,7 +160,7 @@ public: /*! Set the vertex */ void set_vertex(Arr_vertex_handle vertex) { m_vertex = vertex; } - + /*! Set the "marked" flag */ void set_marked(bool marked) { m_marked = marked; } @@ -218,4 +218,22 @@ struct Arr_polyhedral_sgm_polyhedron_3 : } //namespace CGAL +//! Make the polyhedron a model of FaceGraph +namespace boost { + +template +struct graph_traits > : + public graph_traits > > +{}; + +template +struct property_map, Tag> : + public property_map >, + Tag> +{}; + +} + #endif diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_vertex_map.h b/Arrangement_on_surface_2/include/CGAL/Arr_vertex_map.h index b5adcfae344..1f568aa10b5 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_vertex_map.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_vertex_map.h @@ -24,17 +24,16 @@ #include +#define CGAL_DEPRECATED_HEADER "" +#define CGAL_REPLACEMENT_HEADER "" +#include + +#include /*! \file * Definition of the Arr_vertex_index_map class. */ -#if (defined __GNUC__) - #warning Arr_vertex_map.h is DEPRECATED, please include Arr_vertex_index_map.h instead -#elif (defined _MSC_VER) - #pragma message("Arr_vertex_map.h is DEPRECATED, please include Arr_vertex_index_map.h instead") -#endif - #include #endif diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_on_surface_2.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_on_surface_2.h index 30c2c63feb0..e031a732225 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_on_surface_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_on_surface_2.h @@ -1024,6 +1024,15 @@ public: _Is_concrete_vertex(&m_topol_traits))); } + /*! + returns a range over handles of the arrangement vertices . + */ + Iterator_range > + vertex_handles() + { + return make_prevent_deref_range(vertices_begin(), vertices_end()); + } + /*! Get a const iterator for the first vertex in the arrangement. */ Vertex_const_iterator vertices_begin() const { @@ -1039,6 +1048,16 @@ public: _dcel().vertices_end(), _Is_concrete_vertex(&m_topol_traits))); } + + /*! + returns a const range (model of `ConstRange`) over handles of the arrangement vertices . + */ + Iterator_range > + vertex_handles() const + { + return make_prevent_deref_range(vertices_begin(), vertices_end()); + } + //@} /// \name Traversal functions for the arrangement halfedges. @@ -1060,6 +1079,15 @@ public: _Is_valid_halfedge(&m_topol_traits))); } + /*! + returns a range over handles of the arrangement halfedges . + */ + Iterator_range > + halfedge_handles() + { + return make_prevent_deref_range(halfedges_begin(), halfedges_end()); + } + /*! Get a const iterator for the first halfedge in the arrangement. */ Halfedge_const_iterator halfedges_begin() const { @@ -1075,6 +1103,14 @@ public: _dcel().halfedges_end(), _Is_valid_halfedge(&m_topol_traits))); } + /*! + returns a const range (model of `ConstRange`) over handles of the arrangement halfedges . + */ + Iterator_range > + halfedge_handles() const + { + return make_prevent_deref_range(halfedges_begin(), halfedges_end()); + } //@} /// \name Traversal functions for the arrangement edges. @@ -1094,6 +1130,15 @@ public: _Is_valid_halfedge(&m_topol_traits))); } + /*! + returns a range over handles of the arrangement edges . + */ + Iterator_range > + edge_handles() + { + return make_prevent_deref_range(edges_begin(), edges_end()); + } + /*! Get a const iterator for the first edge in the arrangement. */ Edge_const_iterator edges_begin() const { @@ -1107,6 +1152,15 @@ public: return (Edge_const_iterator(_dcel().edges_end(), _dcel().edges_end(), _Is_valid_halfedge(&m_topol_traits))); } + + /*! + returns a const range (model of `ConstRange`) over handles of the arrangement edges . + */ + Iterator_range > + edge_handles() const + { + return make_prevent_deref_range(edges_begin(), edges_end()); + } //@} /// \name Traversal functions for the arrangement faces. @@ -1126,6 +1180,14 @@ public: _Is_valid_face(&m_topol_traits))); } + /*! + returns a range over handles of the arrangement faces . + */ + Iterator_range > + face_handles() + { + return make_prevent_deref_range(faces_begin(), faces_end()); + } /*! Get a const iterator for the first face in the arrangement. */ Face_const_iterator faces_begin() const { @@ -1140,6 +1202,14 @@ public: _Is_valid_face(&m_topol_traits))); } + /*! + returns a const range (model of `ConstRange`) over handles of the arrangement faces . + */ + Iterator_range > + face_handles() const + { + return make_prevent_deref_range(faces_begin(), faces_end()); + } //! reference_face (const version). /*! The function returns a reference face of the arrangement. * All reference faces of arrangements of the same type have a common diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test.cmake b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test.cmake index 7bf32e47fa5..9439aa934ce 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test.cmake +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test.cmake @@ -581,8 +581,8 @@ function(test_segment_traits_adaptor) compile_test_with_flags(test_traits_adaptor segments "${flags}") # if [ -n "${SUCCESS}" ] ; then - execute_commands_traits_adaptor( segments segments_traits_adaptor - COMPARE_Y_POSITION COMPARE_CW_AROUND_POINT COMPARE_Y_AT_X_LEFT + execute_commands_traits_adaptor( segments segments_traits_adaptor + COMPARE_Y_POSITION COMPARE_CW_AROUND_POINT COMPARE_Y_AT_X_LEFT ARE_MERGEABLE MERGE IS_IN_X_RANGE IS_BETWEEN_CW) endfunction() @@ -597,8 +597,8 @@ function(test_linear_traits_adaptor) compile_test_with_flags( test_traits_adaptor linear "${flags}") - execute_commands_traits_adaptor( linear linear_traits_adaptor - COMPARE_Y_AT_X_LEFT ARE_MERGEABLE MERGE IS_IN_X_RANGE + execute_commands_traits_adaptor( linear linear_traits_adaptor + COMPARE_Y_AT_X_LEFT ARE_MERGEABLE MERGE IS_IN_X_RANGE COMPARE_Y_POSITION IS_BETWEEN_CW COMPARE_CW_AROUND_POINT) endfunction() @@ -614,8 +614,8 @@ function(test_spherical_arcs_traits_adaptor) compile_test_with_flags( test_traits_adaptor geodesic_arcs_on_sphere "${flags}") - execute_commands_traits_adaptor( spherical_arcs spherical_arcs_traits_adaptor - COMPARE_Y_AT_X_LEFT ARE_MERGEABLE MERGE IS_IN_X_RANGE + execute_commands_traits_adaptor( spherical_arcs spherical_arcs_traits_adaptor + COMPARE_Y_AT_X_LEFT ARE_MERGEABLE MERGE IS_IN_X_RANGE COMPARE_Y_POSITION IS_BETWEEN_CW COMPARE_CW_AROUND_POINT) endfunction() @@ -1365,3 +1365,5 @@ compile_and_run(test_unbounded_removal) compile_and_run(test_spherical_removal) compile_and_run(test_io) + +compile_and_run(test_sgm) diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test_base b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test_base index c330edd7f48..6d659f7bf1c 100755 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test_base +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test_base @@ -1711,6 +1711,8 @@ compile_and_run test_spherical_removal compile_and_run test_io +compile_and_run test_sgm + # if any error occured then append the full error description file to error file if [ -f $FULL_ERROR_DESCRIPTION_FILE ] ; then diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_sgm.cpp b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_sgm.cpp new file mode 100644 index 00000000000..30a2ca6e57d --- /dev/null +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_sgm.cpp @@ -0,0 +1,69 @@ +#define CGAL_IDENTIFICATION_XY 2 + +// Testing the spherical gaussian map +#include +#include +#include +#include +#include +#include +#include + +typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel; +typedef Kernel::Point_3 Point_3; +typedef CGAL::Arr_polyhedral_sgm_traits Gm_traits; +typedef CGAL::Arr_polyhedral_sgm Gm; +typedef CGAL::Arr_polyhedral_sgm_polyhedron_3 Gm_polyhedron; +typedef CGAL::Arr_polyhedral_sgm_initializer Gm_initializer; + +int main() +{ + // Construct the Gaussian map of a tetrahedron + Point_3 points[] = { + Point_3(1.0, 0.0, 0.0), + Point_3(0.0, 1.0, 0.0), + Point_3(0.0, 0.0, 1.0), + Point_3(0.0, 0.0, 0.0) + }; + Gm_polyhedron P1; + CGAL::convex_hull_3(points, &points[4], P1); + Gm gm1; + Gm_initializer gm_initializer1(gm1); + gm_initializer1(P1); + if (! gm1.is_valid()) return -1; + + // Construct the Gaussian map of the reflection of a tetrahedron + Gm_polyhedron P2; + for (Point_3* p = points; p != &points[4]; ++p) { + Kernel::Vector_3 v = CGAL::ORIGIN - *p; + *p = CGAL::ORIGIN + v; + } + CGAL::convex_hull_3(points, &points[4], P2); + Gm gm2; + Gm_initializer gm_initializer2(gm2); + gm_initializer2(P2); + if (! gm2.is_valid()) return -1; + + // Compute the Minowski sum of the Gaussian maps + Gm gm; + gm.minkowski_sum(gm1, gm2); + if (! gm.is_valid()) return -1; + + Kernel::FT sw(16); + Gm::Vertex_const_handle it; + for (it = gm.vertices_begin(); it != gm.vertices_end(); ++it) { + if (it->degree() < 3) continue; + Gm::Halfedge_around_vertex_const_circulator hec3(it->incident_halfedges()); + Gm::Halfedge_around_vertex_const_circulator hec1 = hec3++; + Gm::Halfedge_around_vertex_const_circulator hec2 = hec3++; + Kernel::Plane_3 plane((*hec1).face()->point(), (*hec2).face()->point(), + (*hec3).face()->point()); + Kernel::Vector_3 v(CGAL::ORIGIN, plane.projection(CGAL::ORIGIN)); + Kernel::FT tmp = v.squared_length(); + if (tmp < sw) sw = tmp; + } + // std::cout << sw << std::endl; + CGAL::Gmpq res(1,3); + if (sw.exact() != res) return -1; + return 0; +} diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_spherical_removal.cpp b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_spherical_removal.cpp index f686c747842..8019eff7ae0 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_spherical_removal.cpp +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_spherical_removal.cpp @@ -85,9 +85,8 @@ bool test_one_file(std::ifstream& in_file, bool /* verbose */) std::cout.flush(); CGAL::insert_non_intersecting_curves(arr, xcurves.begin(), xcurves.end()); std::cout << "inserted" << std::endl; - for (Halfedge_iterator hit = arr.halfedges_begin(); hit != arr.halfedges_end(); hit++) { - halfedges.push_back(hit); - } + BOOST_FOREACH(Halfedge_handle hh, arr.halfedge_handles()) + halfedges.push_back(hh); #endif curves.clear(); @@ -102,7 +101,6 @@ bool test_one_file(std::ifstream& in_file, bool /* verbose */) } isolated_points.clear(); points.clear(); - std::cout << "The arrangement size:" << std::endl << " V = " << arr.number_of_vertices() << ", E = " << arr.number_of_edges() @@ -110,16 +108,16 @@ bool test_one_file(std::ifstream& in_file, bool /* verbose */) { std::cout << "Faces:" << std::endl; - Arrangement_2::Face_const_iterator fit; - for (fit = arr.faces_begin(); fit != arr.faces_end(); ++fit) { + BOOST_FOREACH(Arrangement_2::Face_handle fh, arr.face_handles()) + { std::cout << " Face: " - << &(*fit) + << &(fh) << std::endl; std::cout << " Outer CCBs: " - << std::distance(fit->outer_ccbs_begin(), fit->outer_ccbs_end()) + << std::distance(fh->outer_ccbs_begin(), fh->outer_ccbs_end()) << std::endl; std::cout << " Inner CCBs: " - << std::distance(fit->inner_ccbs_begin(), fit->inner_ccbs_end()) + << std::distance(fh->inner_ccbs_begin(), fh->inner_ccbs_end()) << std::endl; std::cout << std::endl; } diff --git a/BGL/doc/BGL/Concepts/EdgeListGraph.h b/BGL/doc/BGL/Concepts/EdgeListGraph.h new file mode 100644 index 00000000000..7ae0a4d082d --- /dev/null +++ b/BGL/doc/BGL/Concepts/EdgeListGraph.h @@ -0,0 +1,48 @@ +/*! +\ingroup PkgBGLConcepts +\cgalConcept + +The concept `EdgeListGraph` refines the concept `Graph` and adds +the requirement for traversal of all edges in a graph. + +\cgalRefines `Graph` +\cgalHasModel `CGAL::Polyhedron_3` +\cgalHasModel `CGAL::Surface_mesh` + +*/ +class EdgeListGraph{}; + + +/*! \relates EdgeListGraph + * returns an iterator range over all edges. + */ +template +std::pair::edge_iterator, + boost::graph_traits::edge_iterator> +edges(const EdgeListGraph& g); + + +/*! \relates EdgeListGraph + returns an upper bound of the number of edges of the graph. + \attention `num_edges()` may return a number larger than `std::distance(edges(g).first, edges(g).second)`. + This is the case for implementations only marking edges deleted in the edge container. + */ +template +boost::graph_traits::ver_size_type +num_edges(const EdgeListGraph& g); + + +/*! \relates EdgeListGraph +returns the source vertex of `h`. + */ +template +boost::graph_traits::vertex_descriptor +source(boost::graph_traits::halfedge_descriptor h, const EdgeListGraph& g); + + +/*! \relates EdgeListGraph +returns the target vertex of `h`. + */ +template +boost::graph_traits::vertex_descriptor +target(boost::graph_traits::halfedge_descriptor h, const EdgeListGraph& g); diff --git a/BGL/doc/BGL/Concepts/FaceGraph.h b/BGL/doc/BGL/Concepts/FaceGraph.h index c4152ec5d83..fde6b911778 100644 --- a/BGL/doc/BGL/Concepts/FaceGraph.h +++ b/BGL/doc/BGL/Concepts/FaceGraph.h @@ -13,32 +13,33 @@ face. \cgalHasModel `CGAL::Surface_mesh` \cgalHasModel `CGAL::Linear_cell_complex_for_combinatorial_map` -\cgalHeading{Notations} - -
-
`G`
A type that is a model of `FaceGraph`.
-
`g`
An object of type `G`.
-
`e`
An edge descriptor.
-
`f`
A face descriptor.
-
`h`
A halfedge descriptor.
-
- -\cgalHeading{Associated Types} - -Type | Description --------------------- | ------------ -`boost::graph_traits::%face_descriptor` | A `face_descriptor` corresponds to a unique face in a graph. Must be `DefaultConstructible`, `Assignable`, `EqualityComparable` and `LessThanComparable`. - - -\cgalHeading{Valid Expressions} - -Expression | Returns | Description --------------------------------------- | ------------------------------------------------------------------------ | ------------------------ -`face(h, g)` | `face_descriptor` | The face incident to halfedge `h`. -`halfedge(f, g)` | `halfedge_descriptor` | A halfedge incident to face `f`. -`degree(f,g)` | `degree_size_type` | The number of halfedges, incident to face `f`. -`boost::graph_traits::%null_face()` | `face_descriptor` | Returns a special face that is not equal to any other face. - - */ class FaceGraph {}; + +/*! \relates FaceGraph +returns the face incident to halfedge `h`. + */ +template +boost::graph_traits::face_descriptor +face(boost::graph_traits::halfedge_descriptor h, const FaceGraph& g); + +/*! \relates FaceGraph +returns the halfedge incident to face `f`. + */ +template +boost::graph_traits::halfedge_descriptor +halfedge(boost::graph_traits::face_descriptor f, const FaceGraph& g); + +/*! \relates FaceGraph +returns the number of halfedges incident to face `f`. + */ +template +boost::graph_traits::degree_size_type +degree(boost::graph_traits::face_descriptor f, const FaceGraph& g); + +/*! \relates FaceGraph +returns a special face that is not equal to any other face. + */ +template +boost::graph_traits::face_descriptor +null_face(const FaceGraph& g); diff --git a/BGL/doc/BGL/Concepts/FaceListGraph.h b/BGL/doc/BGL/Concepts/FaceListGraph.h index 8e7dc904c92..29d2a71f806 100644 --- a/BGL/doc/BGL/Concepts/FaceListGraph.h +++ b/BGL/doc/BGL/Concepts/FaceListGraph.h @@ -10,33 +10,25 @@ the requirement for traversal of all faces in a graph. \cgalHasModel `CGAL::Surface_mesh` \cgalHasModel `CGAL::Linear_cell_complex_for_combinatorial_map` -\cgalHeading{Notations} - -
-
`G`
A type that is a model of `FaceListGraph`.
-
`g`
An object of type `G`.
-
- -\cgalHeading{Associated Types} - -Type | Description ------------------ | ----------- -`boost::graph_traits::%face_iterator` | %Iterator over all faces. -`boost::graph_traits::%faces_size_type` | Unsigned integer type for number of faces. - - -\cgalHeading{Valid Expressions} - -Expression | returns | Description ------------------ | --------------- | ----------------------- -`faces(g)` | `std::pair` | An iterator range over all faces. -`num_faces(g)` | `faces_size_type` | An upper bound of the number of faces of the graph. - -\attention `num_faces()` may return a number larger than `std::distance(faces(g).first, faces(g).second)`. -This is the case for implementations only marking faces deleted in the face container. - - */ class FaceListGraph{}; + + +/*! \relates FaceListGraph + * returns an iterator range over all faces. + */ +template +std::pair::face_iterator, + boost::graph_traits::face_iterator> +faces(const FaceListGraph& g); + + +/*! \relates FaceListGraph + returns an upper bound of the number of faces of the graph. + \attention `num_faces()` may return a number larger than `std::distance(faces(g).first, faces(g).second)`. + This is the case for implementations only marking faces deleted in the face container. + */ +template +boost::graph_traits::face_size_type +num_faces(const FaceListGraph& g); + diff --git a/BGL/doc/BGL/Concepts/HalfedgeGraph.h b/BGL/doc/BGL/Concepts/HalfedgeGraph.h index bc4822bc8a8..b4a598ced4f 100644 --- a/BGL/doc/BGL/Concepts/HalfedgeGraph.h +++ b/BGL/doc/BGL/Concepts/HalfedgeGraph.h @@ -23,43 +23,78 @@ A model of `HalfedgeGraph` must have the interior property `vertex_point` attach \cgalHasModel `CGAL::Polyhedron_3` \cgalHasModel `CGAL::Surface_mesh` - -\cgalHeading{Notations} - -
-
`G`
A type that is a model of `HalfedgeGraph`.
-
`g`
An object of type `G`.
-
`u`, `v`
Vertex descriptors.
-
`e`
An edge descriptor.
-
`h`
A halfedge descriptor.
-
- -\cgalHeading{Associated Types} - -Type | Description ---------------------------------------------------------- | ------------ -`boost::graph_traits::%halfedge_descriptor` | A `halfedge_descriptor` corresponds to a halfedge in a graph. Must be `DefaultConstructible`, `Assignable`, `EqualityComparable` and `LessThanComparable`. - - -\cgalHeading{Valid Expressions} - -Expression | Returns | Description ---------------------------------------- | ---------------------------------------------------------------------------- | ----------- -`edge(h, g)` | `edge_descriptor` | The edge corresponding to `h` and `opposite(h)`. -`halfedge(e, g)` | `halfedge_descriptor` | One of the halfedges corresponding to `e`. -`halfedge(v, g)` | `halfedge_descriptor` | A halfedge with target `v`. -`halfedge(u, v, g)` | `std::pair` | The halfedge with source `u` and target `v`. The Boolean is `true`, iff this halfedge exists. -`opposite(h, g)` | `halfedge_descriptor` | The halfedge with source and target swapped. -`source(h,g)` | `vertex_descriptor` | The source vertex of `h`. -`target(h,g)` | `vertex_descriptor` | The target vertex of `h`. -`next(h, g)` | `halfedge_descriptor` | The next halfedge around its face. -`prev(h, g)` | `halfedge_descriptor` | The previous halfedge around its face. -`boost::graph_traits::%null_halfedge()` | `halfedge_descriptor` | Returns a special halfedge that is not equal to any other halfedge. - -\cgalHeading{Invariants} - -`halfedge(edge(h,g))==h` - - */ class HalfedgeGraph {}; + +/*! \relates HalfedgeGraph +returns the edge corresponding to halfedges `h` and `opposite(h,g)`. + */ +template +boost::graph_traits::edge_descriptor +edge(boost::graph_traits::halfedge_descriptor h, const HalfedgeGraph& g); + +/*! \relates HalfedgeGraph +returns one of the halfedges corresponding to `e`. + */ +template +boost::graph_traits::halfedge_descriptor +halfedge(boost::graph_traits::edge_descriptor f, const HalfedgeGraph& g); + +/*! \relates HalfedgeGraph +returns a halfedge with target `v`. + */ +template +boost::graph_traits::halfedge_descriptor +halfedge(boost::graph_traits::vertex_descriptor v, const HalfedgeGraph& g); + + +/*! \relates HalfedgeGraph +returns the halfedge with source `u` and target `v`. The Boolean is `true`, iff this halfedge exists. + */ +template +std::pair::halfedge_descriptor,bool> +halfedge(boost::graph_traits::vertex_descriptor u, + boost::graph_traits::vertex_descriptor v, + const HalfedgeGraph& g); + +/*! \relates HalfedgeGraph +returns the halfedge with source and target swapped. + */ +template +boost::graph_traits::halfedge_descriptor +opposite(boost::graph_traits::halfedge_descriptor h, const HalfedgeGraph& g); + +/*! \relates HalfedgeGraph +returns the source vertex of `h`. + */ +template +boost::graph_traits::vertex_descriptor +source(boost::graph_traits::halfedge_descriptor h, const HalfedgeGraph& g); + +/*! \relates HalfedgeGraph +returns the target vertex of `h`. + */ +template +boost::graph_traits::vertex_descriptor +target(boost::graph_traits::halfedge_descriptor h, const HalfedgeGraph& g); + +/*! \relates HalfedgeGraph +returns the next halfedge around its face. + */ +template +boost::graph_traits::halfedge_descriptor +next(boost::graph_traits::halfedge_descriptor h, const HalfedgeGraph& g); + +/*! \relates HalfedgeGraph +returns the previous halfedge around its face. + */ +template +boost::graph_traits::halfedge_descriptor +prev(boost::graph_traits::halfedge_descriptor h, const HalfedgeGraph& g); + +/*! \relates HalfedgeGraph +returns a special halfedge that is not equal to any other halfedge. + */ +template +boost::graph_traits::halfedge_descriptor +null_halfedge(const HalfedgeGraph& g); diff --git a/BGL/doc/BGL/Concepts/HalfedgeListGraph.h b/BGL/doc/BGL/Concepts/HalfedgeListGraph.h index 4d5ce8ffc3f..b7e61b02207 100644 --- a/BGL/doc/BGL/Concepts/HalfedgeListGraph.h +++ b/BGL/doc/BGL/Concepts/HalfedgeListGraph.h @@ -9,35 +9,25 @@ and adds the requirements for traversal of all halfedges in the graph. \cgalHasModel `CGAL::Polyhedron_3` \cgalHasModel `CGAL::Surface_mesh` -\cgalHeading{Notations} - -
-
`G`
A type that is a model of `HalfedgeListGraph`.
-
`g`
An object of type `G`.
-
- -\cgalHeading{Associated Types} - -Type | Description --------------------- | ------------ -`boost::graph_traits::%halfedge_iterator` | A `BidirectionalIterator` over all halfedges in a graph. Must be `DefaultConstructible`, `Assignable`, `EqualityComparable`. -`boost::graph_traits::%halfedges_size_type` | A size type. - - -\cgalHeading{Valid Expressions} - -Expression | Returns | Description -------------------------------------- | ------------------------------------------| ----------- -`num_halfedges(g)` | `halfedges_size_type` | An upper bound of the number of halfedges of the graph. -`halfedges(g)` | `std::pair` | An iterator range over the halfedges of the graph. - -\attention `num_halfedges()` may return a number larger than `std::distance(halfedges(g).first,halfedges(g).second)`. -This is the case for implementations only marking halfedges deleted in the halfedge container. - - - */ class HalfedgeListGraph {}; + +/*! \relates HalfedgeListGraph + * returns an iterator range over all halfedges. + */ +template +std::pair::halfedge_iterator, + boost::graph_traits::halfedge_iterator> +halfedges(const HalfedgeListGraph& g); + + +/*! \relates HalfedgeListGraph + returns an upper bound of the number of halfedges of the graph. + \attention `num_halfedges()` may return a number larger than `std::distance(halfedges(g).first, halfedges(g).second)`. + This is the case for implementations only marking halfedges deleted in the halfedge container. + */ +template +boost::graph_traits::halfedge_size_type +num_halfedges(const HalfedgeListGraph& g); + diff --git a/BGL/doc/BGL/Concepts/MutableFaceGraph.h b/BGL/doc/BGL/Concepts/MutableFaceGraph.h index f9bae954cf3..e5b2ac7dac4 100644 --- a/BGL/doc/BGL/Concepts/MutableFaceGraph.h +++ b/BGL/doc/BGL/Concepts/MutableFaceGraph.h @@ -11,23 +11,40 @@ the requirement for operations to add faces and to modify face-halfedge relation \cgalHasModel `CGAL::Surface_mesh` \cgalHasModel `CGAL::Linear_cell_complex_for_combinatorial_map` -\cgalHeading{Notations} - -
-
`G`
A type that is a model of `MutableFaceGraph`.
-
`g`
An object of type `G`.
-
`h`
A halfedge descriptor.
-
`f`
A face descriptor.
-
- -\cgalHeading{Valid Expressions} - -Expression | returns | Description ------------------------ | ------------ | ----------- -`add_face(g)` | `face_descriptor` | Adds a new face to the graph without initializing the connectivity. -`remove_face(f, g)` | `void` | Removes `f` from the graph. -`set_face(h, f, g)` | `void` | Sets the corresponding face of `h` to `f`. -`set_halfedge(f, h, g)` | `void` | Sets the corresponding halfedge of `f` to `h`. -`reserve(g, nv, ne, nf)`| `void` | Called to indicate the expected size of vertices (`nv`), edges (`ed`) and faces (`nf`) */ class MutableFaceGraph{}; + +/*! \relates MutableFaceGraph +Adds a new face to the graph without initializing the connectivity. + */ +template +boost::graph_traits::face_descriptor +add_face(MutableFaceGraph& g); + +/*! \relates MutableFaceGraph +Removes `f` from the graph. + */ +template +boost::graph_traits::face_descriptor +remove_face(boost::graph_traits::face_descriptor f, MutableFaceGraph& g); + +/*! \relates MutableFaceGraph +Sets the corresponding face of `h` to `f`. + */ +template +void +set_face(boost::graph_traits::halfedge_descriptor h, boost::graph_traits::face_descriptor f, MutableFaceGraph& g); + +/*! \relates MutableFaceGraph +Sets the corresponding halfedge of `f` to `h`. + */ +template +void +set_halfedge(boost::graph_traits::face_descriptor f, boost::graph_traits::halfedge_descriptor h, MutableFaceGraph& g); + +/*! \relates MutableFaceGraph +Indicates the expected size of vertices (`nv`), edges (`ed`) and faces (`nf`). + */ +template +void +reserve(MutableFaceGraph& g, boost::graph_traits::vertices_size_type nv, boost::graph_traits::vertices_size_type ne, boost::graph_traits::vertices_size_type nf); diff --git a/BGL/doc/BGL/Concepts/MutableHalfedgeGraph.h b/BGL/doc/BGL/Concepts/MutableHalfedgeGraph.h index c06bca6769e..55f99b8c9a5 100644 --- a/BGL/doc/BGL/Concepts/MutableHalfedgeGraph.h +++ b/BGL/doc/BGL/Concepts/MutableHalfedgeGraph.h @@ -12,28 +12,57 @@ update the incidence information between vertices and halfedges. \cgalHasModel `CGAL::Surface_mesh` \cgalHasModel `CGAL::Linear_cell_complex_for_combinatorial_map` -\cgalHeading{Notations} - -
-
`G`
A type that is a model of `MutableHalfedgeGraph`.
-
`g`
An object of type `G`.
-
`v`
A vertex descriptor.
-
`h`, `h1`, `h2`
Halfedge descriptors.
-
`e`
An edge descriptor.
-
- -\cgalHeading{Valid Expressions} - -Expression | returns | Description -------------------------- | ------------ | ----------- -`add_vertex(g)` | `vertex_descriptor` | Adds a new vertex to the graph without initializing the connectivity. -`remove_vertex(v, g)` | `void` | Removes `v` from the graph. -`add_edge(g)` | `edge_descriptor` | Adds two opposite halfedges to the graph without initializing the connectivity. -`remove_edge(e, g)` | `void` | Removes the two halfedges corresponding to `e` from the graph. -`set_target(h, v, g)` | `void` | Sets the target vertex of `h` and the source of `opposite(h)` to `v`. -`set_halfedge(v, h, g)` | `void` | Sets the halfedge of `v` to `h`. The target vertex of `h` must be `v`. -`set_next(h1, h2, g)` | `void` | Sets the successor of `h1` around a face to `h2`, and the prededecessor of `h2` to `h1`. - - */ class MutableHalfedgeGraph{}; + + +/*! \relates MutableFaceGraph +Adds a new vertex to the graph without initializing the connectivity. + */ +template +boost::graph_traits::face_descriptor +add_vertex(MutableHalfedgeGraph& g); + +/*! \relates MutableHalfedgeGraph +Removes `v` from the graph. + */ +template +boost::graph_traits::face_descriptor +remove_vertex(boost::graph_traits::vertex_descriptor v, MutableHalfedgeGraph& g); + +/*! \relates MutableFaceGraph +Adds two opposite halfedges to the graph without initializing the connectivity. + */ +template +boost::graph_traits::edge_descriptor +add_edge(MutableHalfedgeGraph& g); + +/*! \relates MutableHalfedgeGraph +Removes the two halfedges corresponding to `e` from the graph. + */ +template +boost::graph_traits::face_descriptor +remove_edge(boost::graph_traits::edge_descriptor e, MutableHalfedgeGraph& g); + + +/*! \relates MutableHalfedgeGraph +Sets the target vertex of `h` and the source of `opposite(h)` to `v`. + */ +template +void +set_target(boost::graph_traits::halfedge_descriptor h, boost::graph_traits::vertex_descriptor v, MutableHalfedgeGraph& g); + +/*! \relates MutableHalfedgeGraph +Sets the halfedge of `v` to `h`. The target vertex of `h` must be `v`. + */ +template +void +set_halfedge(boost::graph_traits::vertex_descriptor v, boost::graph_traits::halfedge_descriptor h, MutableHalfedgeGraph& g); + + +/*! \relates MutableHalfedgeGraph +Sets the successor of `h1` around a face to `h2`, and the prededecessor of `h2` to `h1`. + */ +template +void +set_next(boost::graph_traits::halfedge_descriptor h1, boost::graph_traits::halfede_descriptor h2, MutableHalfedgeGraph& g); diff --git a/BGL/doc/BGL/Concepts/VertexListGraph.h b/BGL/doc/BGL/Concepts/VertexListGraph.h new file mode 100644 index 00000000000..b76ea193a56 --- /dev/null +++ b/BGL/doc/BGL/Concepts/VertexListGraph.h @@ -0,0 +1,33 @@ +/*! +\ingroup PkgBGLConcepts +\cgalConcept + +The concept `VertexListGraph` refines the concept `Graph` and adds +the requirement for traversal of all vertices in a graph. + +\cgalRefines `Graph` +\cgalHasModel `CGAL::Polyhedron_3` +\cgalHasModel `CGAL::Surface_mesh` + +*/ +class VertexListGraph{}; + + +/*! \relates VertexListGraph + * returns an iterator range over all vertices. + */ +template +std::pair::vertex_iterator, + boost::graph_traits::vertex_iterator> +vertices(const VertexListGraph& g); + + +/*! \relates VertexListGraph + returns an upper bound of the number of vertices of the graph. + \attention `num_vertices()` may return a number larger than `std::distance(vertices(g).first, vertices(g).second)`. + This is the case for implementations only marking vertices deleted in the vertex container. + */ +template +boost::graph_traits::ver_size_type +num_vertices(const VertexListGraph& g); + diff --git a/BGL/doc/BGL/PackageDescription.txt b/BGL/doc/BGL/PackageDescription.txt index 14a89eb4242..e3e0e2cb5ce 100644 --- a/BGL/doc/BGL/PackageDescription.txt +++ b/BGL/doc/BGL/PackageDescription.txt @@ -1,33 +1,195 @@ /// \defgroup PkgBGL CGAL and the Boost Graph Library Reference -/// \defgroup PkgBGLConcepts Concepts -/// \ingroup PkgBGL -/// -/// We extend the Boost Graph Library(\sc{Bgl} for short) with a set of new concepts. -/// The documentation of the concepts lists at the same time the functions -/// related to it. Models of the concept and their related functions -/// must be in the same namespace (they will be found by Koenig lookup). -/// -///\dot -///digraph example { -/// node [shape=record, fontname=Helvetica, fontsize=10]; -/// rankdir=BT -/// -/// "boost Graph" [ URL="http://www.boost.org/libs/graph/doc/Graph.html" ]; -/// HalfedgeGraph [ URL="\ref HalfedgeGraph"]; -/// HalfedgeListGraph [ URL="\ref HalfedgeListGraph"]; -/// MutableHalfedgeGraph [ URL="\ref MutableHalfedgeGraph"]; -/// FaceGraph [ URL="\ref FaceGraph"]; -/// FaceListGraph [ URL="\ref FaceListGraph"]; -/// MutableFaceGraph [ URL="\ref MutableFaceGraph"]; -/// -/// MutableHalfedgeGraph -> HalfedgeGraph -> "boost Graph" [ arrowhead="open", label="refines" ]; -/// FaceListGraph -> FaceGraph -> HalfedgeGraph [ arrowhead="open", label="refines" ]; -/// MutableFaceGraph -> MutableHalfedgeGraph [ arrowhead="open", label="refines" ]; -/// MutableFaceGraph -> FaceGraph [ arrowhead="open", label="refines" ]; -/// HalfedgeListGraph -> HalfedgeGraph [ arrowhead="open", label="refines" ]; -///} -///\enddot +/*! \defgroup PkgBGLConcepts Concepts + \ingroup PkgBGL + + We extend the Boost Graph Library (\sc{Bgl} for short) with a set of new concepts. + In order to make this documentation self-contained we here also document + concepts that are defined in the original version of the \sc{Bgl}. + The documentation of the concepts lists at the same time the functions + related to it. Models of the concept and their related functions + must be in the same namespace (they will be found by Koenig lookup). + + + +\dot +digraph example { + node [shape=record, fontname=Helvetica, fontsize=10]; + rankdir=BT + + "boost Graph" [ URL="http://www.boost.org/libs/graph/doc/Graph.html" ]; + HalfedgeGraph [ URL="\ref HalfedgeGraph"]; + HalfedgeListGraph [ URL="\ref HalfedgeListGraph"]; + MutableHalfedgeGraph [ URL="\ref MutableHalfedgeGraph"]; + FaceGraph [ URL="\ref FaceGraph"]; + FaceListGraph [ URL="\ref FaceListGraph"]; + MutableFaceGraph [ URL="\ref MutableFaceGraph"]; + + MutableHalfedgeGraph -> HalfedgeGraph -> "boost Graph" [ arrowhead="open", label="refines" ]; + FaceListGraph -> FaceGraph -> HalfedgeGraph [ arrowhead="open", label="refines" ]; + MutableFaceGraph -> MutableHalfedgeGraph [ arrowhead="open", label="refines" ]; + MutableFaceGraph -> FaceGraph [ arrowhead="open", label="refines" ]; + HalfedgeListGraph -> HalfedgeGraph [ arrowhead="open", label="refines" ]; +} +\enddot + + \cgalHeading{Notations} + +
+
`G`
A type that is a model of a graph concept.
+
`g`
An object of type `G`.
+
`u`, `v`
An object of type `boost::graph_traits::%vertex_descriptor`.
+
`h`
An object of type `boost::graph_traits::%halfedge_descriptor`.
+
`e`
An object of type `boost::graph_traits::%edge_descriptor`.
+
`f`
An object of type `boost::graph_traits::%face_descriptor`.
+
+ +\cgalHeading{%VertexListGraph} + +The concept `VertexListGraph` refines the concept `Graph` and adds +the requirement for traversal of all vertices in a graph. + +Associated Type | Description +----------------- | ----------- +`boost::graph_traits::%vertex_iterator` | %Iterator over all vertices. +`boost::graph_traits::%vertices_size_type` | Unsigned integer type for number of vertices. + + + +Valid Expression | returns | Description +----------------- | --------------- | ----------------------- +`vertices(g)` | `std::pair` | An iterator range over all vertices. +`num_vertices(g)` | `vertices_size_type` | An upper bound of the number of vertices of the graph. + +\cgalHeading{%EdgeListGraph} + +The concept `EdgeListGraph` refines the concept `Graph` and adds +the requirement for traversal of all edges in a graph. + +Associated Type | Description +----------------- | ----------- +`boost::graph_traits::%edge_iterator` | %Iterator over all edges. +`boost::graph_traits::%edges_size_type` | Unsigned integer type for number of edges. + + +Valid Expression | returns | Description +----------------- | --------------- | ----------------------- +`edges(g)` | `std::pair` | An iterator range over all edges. +`num_edges(g)` | `edges_size_type` | An upper bound of the number of edges of the graph. +`source(e,g)` | `vertex_descriptor` | The source vertex of `e`. +`target(e,g)` | `vertex_descriptor` | The target vertex of `e`. + +\cgalHeading{%HalfedgeGraph} + +The concept `HalfedgeGraph` refines the concept `Graph` and adds +the notion of halfedges, where each edge corresponds to two opposite halfedges. + +Associated Type | Description +--------------------------------------------------------- | ------------ +`boost::graph_traits::%halfedge_descriptor` | A `halfedge_descriptor` corresponds to a halfedge in a graph. Must be `DefaultConstructible`, `Assignable`, `EqualityComparable` and `LessThanComparable`. + +Valid Expression | Returns | Description +--------------------------------------- | --------------------------------------------| ----------- +`edge(h, g)` | `edge_descriptor` | The edge corresponding to halfedges `h` and `opposite(h)`. +`halfedge(e, g)` | `halfedge_descriptor` | One of the halfedges corresponding to `e`. +`halfedge(v, g)` | `halfedge_descriptor` | A halfedge with target `v`. +`halfedge(u, v, g)` | `std::pair` | The halfedge with source `u` and target `v`. The Boolean is `true`, iff this halfedge exists. +`opposite(h, g)` | `halfedge_descriptor` | The halfedge with source and target swapped. +`source(h,g)` | `vertex_descriptor` | The source vertex of `h`. +`target(h,g)` | `vertex_descriptor` | The target vertex of `h`. +`next(h, g)` | `halfedge_descriptor` | The next halfedge around its face. +`prev(h, g)` | `halfedge_descriptor` | The previous halfedge around its face. +`boost::graph_traits::%null_halfedge()` | `halfedge_descriptor` | Returns a special halfedge that is not equal to any other halfedge. + +The `HalfedgeGraph` has the invariant `halfedge(edge(h,g))==h`. + +\cgalHeading{%MutableHalfedgeGraph} + +The concept `MutableHalfedgeGraph` refines the concept `HalfedgeGraph` +and adds the requirements for operations to add vertices and edges, and to +update the incidence information between vertices and halfedges. + +Valid Expression | returns | Description +------------------------- | ------------ | ----------- +`add_vertex(g)` | `vertex_descriptor` | Adds a new vertex to the graph without initializing the connectivity. +`remove_vertex(v, g)` | `void` | Removes `v` from the graph. +`add_edge(g)` | `edge_descriptor` | Adds two opposite halfedges to the graph without initializing the connectivity. +`remove_edge(e, g)` | `void` | Removes the two halfedges corresponding to `e` from the graph. +`set_target(h, v, g)` | `void` | Sets the target vertex of `h` and the source of `opposite(h)` to `v`. +`set_halfedge(v, h, g)` | `void` | Sets the halfedge of `v` to `h`. The target vertex of `h` must be `v`. +`set_next(h1, h2, g)` | `void` | Sets the successor of `h1` around a face to `h2`, and the prededecessor of `h2` to `h1`. + + +\cgalHeading{%HalfedgeListGraph} + +The concept `HalfedgeListGraph` refines the concept `HalfedgeGraph` +and adds the requirements for traversal of all halfedges in the graph. + +Associated Type | Description +-------------------- | ------------ +`boost::graph_traits::%halfedge_iterator` | A `BidirectionalIterator` over all halfedges in a graph. Must be `DefaultConstructible`, `Assignable`, `EqualityComparable`. +`boost::graph_traits::%halfedges_size_type` | A size type. + + +Valid Expression | Returns | Description +------------------------------------- | ------------------------------------------| ----------- +`num_halfedges(g)` | `halfedges_size_type` | An upper bound of the number of halfedges of the graph. +`halfedges(g)` | `std::pair` | An iterator range over the halfedges of the graph. + +\cgalHeading{%FaceGraph} + +The concept `FaceGraph` refines the concept `HalfedgeGraph`. +It adds the requirements for a graph to explicitly +maintain faces described by halfedges, to provide access from a face to +an incident halfedge, and to provide access from a halfedge to its incident +face. + +Associated Type | Description +-------------------------------------------- | ------------ +`boost::graph_traits::%face_descriptor` | A `face_descriptor` corresponds to a unique face in a graph. Must be `DefaultConstructible`, `Assignable`, `EqualityComparable` and `LessThanComparable`. + + +Valid Expression | Returns | Description +-------------------------------------- | ------------------------------------------------------------------------ | ------------------------ +`face(h, g)` | `face_descriptor` | The face incident to halfedge `h`. +`halfedge(f, g)` | `halfedge_descriptor` | A halfedge incident to face `f`. +`degree(f,g)` | `degree_size_type` | The number of halfedges incident to face `f`. +`boost::graph_traits::%null_face()` | `face_descriptor` | A special face that is not equal to any other face. + + +\cgalHeading{%MutableFaceGraph} + +The concept `MutableFaceGraph` refines the concepts `FaceGraph` and `MutableHalfedgeGraph` and adds +the requirement for operations to add faces and to modify face-halfedge relations. + +Valid Expression | returns | Description +----------------------- | ------------ | ----------- +`add_face(g)` | `face_descriptor` | Adds a new face to the graph without initializing the connectivity. +`remove_face(f, g)` | `void` | Removes `f` from the graph. +`set_face(h, f, g)` | `void` | Sets the corresponding face of `h` to `f`. +`set_halfedge(f, h, g)` | `void` | Sets the corresponding halfedge of `f` to `h`. +`reserve(g, nv, ne, nf)`| `void` | Called to indicate the expected size of vertices (`nv`), edges (`ed`) and faces (`nf`) + +\cgalHeading{%FaceListGraph} + +The concept `FaceListGraph` refines the concept `FaceGraph` and adds +the requirement for traversal of all faces in a graph. + +Associated Type | Description +------------------------------------------ | ----------- +`boost::graph_traits::%face_iterator` | %Iterator over all faces. +`boost::graph_traits::%faces_size_type` | Unsigned integer type for number of faces. + + + + +Valid Expression | returns | Description +----------------- | --------------- | ----------------------- +`faces(g)` | `std::pair` | An iterator range over all faces. +`num_faces(g)` | `faces_size_type` | An upper bound of the number of faces of the graph. + + +*/ /// The property tags model of the boost concept PropertyTag. /// These tags are used to retrieve default property maps using the traits class boost::property_map. @@ -46,10 +208,27 @@ /// \defgroup PkgBGLSelectionFct Selection Functions /// \ingroup PkgBGL +/// \defgroup PkgBGLEulerOperations Euler Operations +/// \ingroup PkgBGL + +/*! +\addtogroup PkgBGLHelper +Several classes that enable to store ids in vertices/halfedges/faces of a `CGAL::Polyhedron_3`, as well as adapters such as `CGAL::Dual`. +*/ + +/*! +\addtogroup PkgBGLHelperFct +Generic convenience functions for testing if an edge is a border edge, if a mesh is triangular, +for conversion between models of different `FaceGraph` concepts, etc. + +Most functions are in the header file `` +*/ + /*! \addtogroup PkgBGLIterators -Several iterators and circulators are provided that enable to iterate through the halfedges incident to a given face or vertex. +Several iterators and circulators are provided that enable, for example, +to iterate through the halfedges incident to a given face or vertex. Starting at a halfedge `h`, applying several times `next(h,g)` brings us back to the halfedge where we started. All halfedges traversed on the way are @@ -59,10 +238,14 @@ in another cycle, namely the cycle of halfedges which are incident to the same vertex. For convenience, two iterator and circulator types enable iterating through all the halfedges incident to a given face, and all the halfedges having a given vertex as target. + +All functions are in the header file ` */ -/// \defgroup PkgBGLEulerOperations Euler Operations -/// \ingroup PkgBGL +/*! +\addtogroup PkgBGLSelectionFct +Several functions to enlarge or reduce a k-ring selection of vertices, edges, or faces. +*/ /*! \addtogroup PkgBGLTraits @@ -91,6 +274,8 @@ incident to a given face, and all the halfedges having a given vertex as target. \cgalClassifedRefPages ## Concepts ## +- `VertexListGraph` +- `EdgeListGraph` - `HalfedgeGraph` - `HalfedgeListGraph` - `MutableHalfedgeGraph` diff --git a/BGL/doc/BGL/examples.txt b/BGL/doc/BGL/examples.txt index f5260c52f1a..c84dda9d44c 100644 --- a/BGL/doc/BGL/examples.txt +++ b/BGL/doc/BGL/examples.txt @@ -12,6 +12,8 @@ \example BGL_triangulation_2/dijkstra.cpp \example BGL_triangulation_2/dijkstra_with_internal_properties.cpp \example BGL_triangulation_2/emst.cpp +\example BGL_triangulation_2/emst_regular.cpp +\example BGL_triangulation_2/emst_cdt_plus_hierarchy.cpp \example BGL_surface_mesh/prim.cpp \example BGL_surface_mesh/surface_mesh_dual.cpp \example Surface_mesh_skeletonization/simple_mcfskel_example.cpp diff --git a/BGL/doc/BGL/graph_traits.txt b/BGL/doc/BGL/graph_traits.txt index cbb6d43e411..5f6783f56ed 100644 --- a/BGL/doc/BGL/graph_traits.txt +++ b/BGL/doc/BGL/graph_traits.txt @@ -16,7 +16,7 @@ Defined in `` We provide partial specialization for the class `CGAL::Surface_mesh` so that it is a model of the graph concepts `BidirectionalGraph` and -`EdgeAndVertexListGraph` +`VertexAndEdgeListGraph` and of the concept `MutableFaceGraph`. The const specialization, `boost::graph_traits< CGAL::Surface_mesh const>` @@ -53,7 +53,7 @@ Defined in `` We provide partial specialization for the class `CGAL::Polyhedron_3` so that it is a model of the graph concepts `BidirectionalGraph` and -`EdgeAndVertexListGraph` +`VertexAndEdgeListGraph` and of the concept `MutableFaceGraph`. The const specialization, `boost::graph_traits< CGAL::Polyhedron_3 const>` @@ -148,7 +148,7 @@ Defined in `` We provide partial specialization for the class `OpenMesh::PolyMesh_ArrayKernelT` so that it is a model of the graph concepts `BidirectionalGraph` and -`EdgeAndVertexListGraph` +`VertexAndEdgeListGraph` and of the concept `MutableFaceGraph`. The traits class `boost::graph_traits >` provides the following types: @@ -181,7 +181,7 @@ Defined in `` We provide partial specialization for the class `OpenMesh::TriMesh_ArrayKernelT` so that it is a model of the graph concepts `BidirectionalGraph` and -`EdgeAndVertexListGraph` +`VertexAndEdgeListGraph` and of the concept `MutableFaceGraph`. The traits class `boost::graph_traits >` provides the following types: @@ -210,12 +210,22 @@ The traits class `boost::graph_traits >` provi \section BGLT2GT Specializations for the 2D Triangulation Classes -Defined in `` and `` +Defined in ``, +``, +``, +``, +``, +``, and +``. -We provide partial specialization for the classes `CGAL::Triangulation_2` and `CGAL::Delaunay_triangulation_2` +We provide partial specialization for the classes +`CGAL::Triangulation_2`, `CGAL::Delaunay_triangulation_2`, +`CGAL::Regular_triangulation_2` `CGAL::Constrained_triangulation_2`, +`CGAL::Constrained_Delaunay_triangulation_2`, `CGAL::Constrained_triangulation_plus_2`, +and `CGAL::Triangulation_hierarchy_2` so that they are model of the graph concepts `BidirectionalGraph` and -`EdgeAndVertexListGraph`. +`VertexAndEdgeListGraph`. The mapping between vertices and edges of the triangulation and the @@ -266,7 +276,7 @@ Defined in `` We provide partial specialization for the class `Arrangement_2` so that it is model of the graph concepts `BidirectionalGraph` and -`EdgeAndVertexListGraph`. +`VertexAndEdgeListGraph`. The const specialization, `boost::graph_traits< CGAL::Arrangement_2 const>` is also defined, using the constant handles in the arrangement. diff --git a/BGL/examples/BGL_polyhedron_3/copy_polyhedron.cpp b/BGL/examples/BGL_polyhedron_3/copy_polyhedron.cpp index ec36c663545..bdbe9bed40e 100644 --- a/BGL/examples/BGL_polyhedron_3/copy_polyhedron.cpp +++ b/BGL/examples/BGL_polyhedron_3/copy_polyhedron.cpp @@ -2,11 +2,7 @@ #include #include -#include -#include - #include -#include #if defined(CGAL_USE_OPENMESH) #include @@ -80,7 +76,7 @@ int main(int argc, char* argv[]) CGAL::copy_face_graph(T1, S, std::inserter(v2v, v2v.end()), std::inserter(h2h, h2h.end())); std::ofstream out("reverse.off"); - out << T1; + out << S; } return 0; } diff --git a/BGL/examples/BGL_polyhedron_3/distance.cpp b/BGL/examples/BGL_polyhedron_3/distance.cpp index bd789517360..51da1ac49d7 100644 --- a/BGL/examples/BGL_polyhedron_3/distance.cpp +++ b/BGL/examples/BGL_polyhedron_3/distance.cpp @@ -1,8 +1,6 @@ #include #include -#include #include -#include #include diff --git a/BGL/examples/BGL_polyhedron_3/incident_vertices.cpp b/BGL/examples/BGL_polyhedron_3/incident_vertices.cpp index 12a53e2bede..6f7b8d24e00 100644 --- a/BGL/examples/BGL_polyhedron_3/incident_vertices.cpp +++ b/BGL/examples/BGL_polyhedron_3/incident_vertices.cpp @@ -1,7 +1,5 @@ #include #include -#include -#include #include #include #include diff --git a/BGL/examples/BGL_polyhedron_3/kruskal.cpp b/BGL/examples/BGL_polyhedron_3/kruskal.cpp index 1080b250cd4..4d55340c4d5 100644 --- a/BGL/examples/BGL_polyhedron_3/kruskal.cpp +++ b/BGL/examples/BGL_polyhedron_3/kruskal.cpp @@ -1,7 +1,5 @@ #include #include -#include -#include #include #include diff --git a/BGL/examples/BGL_polyhedron_3/kruskal_with_stored_id.cpp b/BGL/examples/BGL_polyhedron_3/kruskal_with_stored_id.cpp index 5d811882822..dc20778f740 100644 --- a/BGL/examples/BGL_polyhedron_3/kruskal_with_stored_id.cpp +++ b/BGL/examples/BGL_polyhedron_3/kruskal_with_stored_id.cpp @@ -1,8 +1,6 @@ #include #include #include -#include -#include #include #include diff --git a/BGL/examples/BGL_polyhedron_3/normals.cpp b/BGL/examples/BGL_polyhedron_3/normals.cpp index 0f97f386ab3..eed947b01fd 100644 --- a/BGL/examples/BGL_polyhedron_3/normals.cpp +++ b/BGL/examples/BGL_polyhedron_3/normals.cpp @@ -9,12 +9,8 @@ // Polyhedron #include #include -#include #include -// Graph traits adaptors -#include - typedef CGAL::Cartesian Kernel; typedef Kernel::Point_3 Point; typedef Kernel::Vector_3 Vector; diff --git a/BGL/examples/BGL_polyhedron_3/range.cpp b/BGL/examples/BGL_polyhedron_3/range.cpp index a5433947989..35bac222042 100644 --- a/BGL/examples/BGL_polyhedron_3/range.cpp +++ b/BGL/examples/BGL_polyhedron_3/range.cpp @@ -1,8 +1,6 @@ #include #include #include -#include -#include #include diff --git a/BGL/examples/BGL_polyhedron_3/transform_iterator.cpp b/BGL/examples/BGL_polyhedron_3/transform_iterator.cpp index 949df8a3586..a990901c61b 100644 --- a/BGL/examples/BGL_polyhedron_3/transform_iterator.cpp +++ b/BGL/examples/BGL_polyhedron_3/transform_iterator.cpp @@ -1,11 +1,10 @@ #include #include -#include -#include -#include -#include +#include #include + +#include #include typedef CGAL::Simple_cartesian Kernel; diff --git a/BGL/examples/BGL_triangulation_2/emst_cdt_plus_hierarchy.cpp b/BGL/examples/BGL_triangulation_2/emst_cdt_plus_hierarchy.cpp new file mode 100644 index 00000000000..acac3a76a68 --- /dev/null +++ b/BGL/examples/BGL_triangulation_2/emst_cdt_plus_hierarchy.cpp @@ -0,0 +1,112 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +typedef CGAL::Exact_predicates_inexact_constructions_kernel K; +typedef K::Point_2 Point; + +typedef CGAL::Triangulation_vertex_base_2 Vbb; +typedef CGAL::Triangulation_hierarchy_vertex_base_2 Vb; +typedef CGAL::Constrained_triangulation_face_base_2 Fb; +typedef CGAL::Triangulation_data_structure_2 TDS; +typedef CGAL::Exact_predicates_tag Itag; +typedef CGAL::Constrained_Delaunay_triangulation_2 CDT; +typedef CGAL::Triangulation_hierarchy_2 CDTH; +typedef CGAL::Constrained_triangulation_plus_2 Triangulation; + + +// As we only consider finite vertices and edges +// we need the following filter + +template +struct Is_finite { + + const T* t_; + + Is_finite() + : t_(NULL) + {} + + Is_finite(const T& t) + : t_(&t) + { } + + template + bool operator()(const VertexOrEdge& voe) const { + return ! t_->is_infinite(voe); + } +}; + +typedef Is_finite Filter; +typedef boost::filtered_graph Finite_triangulation; +typedef boost::graph_traits::vertex_descriptor vertex_descriptor; +typedef boost::graph_traits::vertex_iterator vertex_iterator; +typedef boost::graph_traits::edge_descriptor edge_descriptor; + +// The BGL makes use of indices associated to the vertices +// We use a std::map to store the index +typedef std::map VertexIndexMap; +VertexIndexMap vertex_id_map; + +// A std::map is not a property map, because it is not lightweight +typedef boost::associative_property_map VertexIdPropertyMap; +VertexIdPropertyMap vertex_index_pmap(vertex_id_map); + +int +main(int argc,char* argv[]) +{ + const char* filename = (argc > 1) ? argv[1] : "data/points.xy"; + std::ifstream input(filename); + Triangulation t; + Filter is_finite(t); + Finite_triangulation ft(t, is_finite, is_finite); + + Point p ; + while(input >> p){ + t.insert(p); + } + + vertex_iterator vit, ve; + // Associate indices to the vertices + int index = 0; + // boost::tie assigns the first and second element of the std::pair + // returned by boost::vertices to the variables vit and ve + for(boost::tie(vit,ve)=boost::vertices(ft); vit!=ve; ++vit ){ + vertex_descriptor vd = *vit; + vertex_id_map[vd]= index++; + } + + + // We use the default edge weight which is the squared length of the edge + // This property map is defined in graph_traits_Triangulation_2.h + + // In the function call you can see a named parameter: vertex_index_map + std::list mst; + boost::kruskal_minimum_spanning_tree(ft, + std::back_inserter(mst), + vertex_index_map(vertex_index_pmap)); + + + std::cout << "The edges of the Euclidean mimimum spanning tree:" << std::endl; + + for(std::list::iterator it = mst.begin(); it != mst.end(); ++it){ + edge_descriptor ed = *it; + vertex_descriptor svd = source(ed,t); + vertex_descriptor tvd = target(ed,t); + Triangulation::Vertex_handle sv = svd; + Triangulation::Vertex_handle tv = tvd; + std::cout << "[ " << sv->point() << " | " << tv->point() << " ] " << std::endl; + } + + return 0; +} diff --git a/BGL/examples/BGL_triangulation_2/emst_regular.cpp b/BGL/examples/BGL_triangulation_2/emst_regular.cpp new file mode 100644 index 00000000000..e32f8bbd51d --- /dev/null +++ b/BGL/examples/BGL_triangulation_2/emst_regular.cpp @@ -0,0 +1,98 @@ +#include +#include +#include + +#include +#include +#include + +typedef CGAL::Exact_predicates_inexact_constructions_kernel K; +typedef K::Point_2 Point; + +typedef CGAL::Regular_triangulation_2 Triangulation; + +// As we only consider finite vertices and edges +// we need the following filter + +template +struct Is_finite { + + const T* t_; + + Is_finite() + : t_(NULL) + {} + + Is_finite(const T& t) + : t_(&t) + { } + + template + bool operator()(const VertexOrEdge& voe) const { + return ! t_->is_infinite(voe); + } +}; + +typedef Is_finite Filter; +typedef boost::filtered_graph Finite_triangulation; +typedef boost::graph_traits::vertex_descriptor vertex_descriptor; +typedef boost::graph_traits::vertex_iterator vertex_iterator; +typedef boost::graph_traits::edge_descriptor edge_descriptor; + +// The BGL makes use of indices associated to the vertices +// We use a std::map to store the index +typedef std::map VertexIndexMap; +VertexIndexMap vertex_id_map; + +// A std::map is not a property map, because it is not lightweight +typedef boost::associative_property_map VertexIdPropertyMap; +VertexIdPropertyMap vertex_index_pmap(vertex_id_map); + +int +main(int argc,char* argv[]) +{ + const char* filename = (argc > 1) ? argv[1] : "data/points.xy"; + std::ifstream input(filename); + Triangulation t; + Filter is_finite(t); + Finite_triangulation ft(t, is_finite, is_finite); + + Point p ; + while(input >> p){ + t.insert(p); + } + + vertex_iterator vit, ve; + // Associate indices to the vertices + int index = 0; + // boost::tie assigns the first and second element of the std::pair + // returned by boost::vertices to the variables vit and ve + for(boost::tie(vit,ve)=boost::vertices(ft); vit!=ve; ++vit ){ + vertex_descriptor vd = *vit; + vertex_id_map[vd]= index++; + } + + + // We use the default edge weight which is the squared length of the edge + // This property map is defined in graph_traits_Triangulation_2.h + + // In the function call you can see a named parameter: vertex_index_map + std::list mst; + boost::kruskal_minimum_spanning_tree(ft, + std::back_inserter(mst), + vertex_index_map(vertex_index_pmap)); + + + std::cout << "The edges of the Euclidean mimimum spanning tree:" << std::endl; + + for(std::list::iterator it = mst.begin(); it != mst.end(); ++it){ + edge_descriptor ed = *it; + vertex_descriptor svd = source(ed,t); + vertex_descriptor tvd = target(ed,t); + Triangulation::Vertex_handle sv = svd; + Triangulation::Vertex_handle tv = tvd; + std::cout << "[ " << sv->point() << " | " << tv->point() << " ] " << std::endl; + } + + return 0; +} diff --git a/BGL/include/CGAL/boost/graph/Graph_with_descriptor_with_graph.h b/BGL/include/CGAL/boost/graph/Graph_with_descriptor_with_graph.h index 041d1ed67d7..41301dfdcc6 100644 --- a/BGL/include/CGAL/boost/graph/Graph_with_descriptor_with_graph.h +++ b/BGL/include/CGAL/boost/graph/Graph_with_descriptor_with_graph.h @@ -30,10 +30,13 @@ namespace CGAL { -template +template struct Gwdwg_descriptor { public: + typedef Graph_ Graph; + typedef Descriptor_ Descriptor; + Graph* graph; Descriptor descriptor; @@ -124,9 +127,10 @@ Property maps can be wrapped with `Graph_with_descriptor_with_graph_property_map \cgalModels `MutableFaceGraph` if `Graph` is a model of `MutableFaceGraph` */ -template +template struct Graph_with_descriptor_with_graph { + typedef Graph_ Graph; Graph* graph; typedef boost::graph_traits gt; @@ -135,11 +139,13 @@ struct Graph_with_descriptor_with_graph typedef Gwdwg_descriptor edge_descriptor; typedef Gwdwg_descriptor face_descriptor; + Graph_with_descriptor_with_graph() + : graph(NULL) + {} + Graph_with_descriptor_with_graph(Graph& graph) : graph(&graph) {} -private: - Graph_with_descriptor_with_graph(const Graph_with_descriptor_with_graph&){} // disable copy-constructor to avoid non-wanted copies }; diff --git a/BGL/include/CGAL/boost/graph/boost_parameters_interface.h b/BGL/include/CGAL/boost/graph/boost_parameters_interface.h new file mode 100644 index 00000000000..7c2098371db --- /dev/null +++ b/BGL/include/CGAL/boost/graph/boost_parameters_interface.h @@ -0,0 +1,22 @@ +// Copyright (c) 2017 GeometryFactory (France). All rights reserved. +// +// This file is part of CGAL (www.cgal.org); you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +// +// $URL$ +// $Id$ +// +// +// Author(s) : Maxime Gimeno + +// List the named parameters imported from boost we are using in CGAL +CGAL_add_named_parameter(vertex_index_t, vertex_index, vertex_index_map) +CGAL_add_named_parameter(graph_visitor_t, visitor, visitor) diff --git a/BGL/include/CGAL/boost/graph/helpers.h b/BGL/include/CGAL/boost/graph/helpers.h index 4055b6a3152..630e7a974c8 100644 --- a/BGL/include/CGAL/boost/graph/helpers.h +++ b/BGL/include/CGAL/boost/graph/helpers.h @@ -697,6 +697,32 @@ make_tetrahedron(const P& p0, const P& p1, const P& p2, const P& p3, Graph& g) return opposite(h2,g); } +/// \cond SKIP_IN_DOC +template +bool is_degenerate_triangle_face( + typename boost::graph_traits::halfedge_descriptor hd, + TriangleMesh& tmesh, + const VertexPointMap& vpmap, + const Traits& traits) +{ + CGAL_assertion(!is_border(hd, tmesh)); + + const typename Traits::Point_3& p1 = get(vpmap, target( hd, tmesh) ); + const typename Traits::Point_3& p2 = get(vpmap, target(next(hd, tmesh), tmesh) ); + const typename Traits::Point_3& p3 = get(vpmap, source( hd, tmesh) ); + return traits.collinear_3_object()(p1, p2, p3); +} + +template +bool is_degenerate_triangle_face( + typename boost::graph_traits::face_descriptor fd, + TriangleMesh& tmesh, + const VertexPointMap& vpmap, + const Traits& traits) +{ + return is_degenerate_triangle_face(halfedge(fd,tmesh), tmesh, vpmap, traits); +} +/// \endcond namespace internal { @@ -725,7 +751,7 @@ clear_impl(FaceGraph& g) } } -} +} //end of internal namespace /** * \ingroup PkgBGLHelperFct @@ -751,6 +777,7 @@ void clear(FaceGraph& g) CGAL_postcondition(num_faces(g) == 0); } + } // namespace CGAL // Include "Euler_operations.h" at the end, because its implementation diff --git a/BGL/include/CGAL/boost/graph/named_function_params.h b/BGL/include/CGAL/boost/graph/named_function_params.h index 907cd82af96..e54eefb81a8 100644 --- a/BGL/include/CGAL/boost/graph/named_function_params.h +++ b/BGL/include/CGAL/boost/graph/named_function_params.h @@ -101,17 +101,26 @@ namespace boost{ } //end of namespace boost #endif -namespace CGAL { - enum vertex_is_fixed_t { vertex_is_fixed } ; - enum set_cache_policy_t { set_cache_policy } ; - enum get_cost_policy_t { get_cost_policy } ; - enum get_cost_policy_params_t { get_cost_policy_params } ; - enum get_placement_policy_t { get_placement_policy } ; - enum get_placement_policy_params_t { get_placement_policy_params } ; - enum edge_is_constrained_t { edge_is_constrained } ; - enum edge_is_constrained_params_t { edge_is_constrained_params } ; - +namespace CGAL { +namespace internal_np{ + +// for uniformity we import them in this namespace. Note that +// it is an import so that if we use the named parameter function +// from boost it will work +using boost::vertex_index_t; +using boost::vertex_index; +using boost::graph_visitor_t; +using boost::visitor; + +// define enum types and values for new named parameters +#define CGAL_add_named_parameter(X, Y, Z) \ + enum X { Y }; +#include +#undef CGAL_add_named_parameter + +}//internal_np + template struct cgal_bgl_named_params : boost::bgl_named_params { @@ -121,232 +130,35 @@ namespace CGAL { cgal_bgl_named_params(T v = T()) : base(v) {} cgal_bgl_named_params(T v, const Base& b) : base(v, b) {} - template - cgal_bgl_named_params - vertex_index_map(const IndexMap& p) const - { - typedef cgal_bgl_named_params Params; - return Params(p, *this); - } - - template - cgal_bgl_named_params - vertex_point_map(const PointMap& p) const - { - typedef cgal_bgl_named_params Params; - return Params(p, *this); - } - - template - cgal_bgl_named_params - vertex_is_fixed_map(const IsFixedMap& p) const - { - typedef cgal_bgl_named_params Params; - return Params(p, *this); - } - - template - cgal_bgl_named_params - edge_index_map(const IndexMap& p) const - { - typedef cgal_bgl_named_params Params; - return Params(p, *this); - } - - template - cgal_bgl_named_params - halfedge_index_map(const IndexMap& p) const - { - typedef cgal_bgl_named_params Params; - return Params(p, *this); - } - - template - cgal_bgl_named_params - face_index_map(const IndexMap& p) const - { - typedef cgal_bgl_named_params Params; - return Params(p, *this); - } - - template - cgal_bgl_named_params - visitor(const Visitor& p) const - { - typedef cgal_bgl_named_params Params; - return Params(p, *this); - } - - template - cgal_bgl_named_params - set_cache(const SetCache& p) const - { - typedef cgal_bgl_named_params Params; - return Params(p, *this); - } - - template - cgal_bgl_named_params - get_cost(const GetCost& p) const - { - typedef cgal_bgl_named_params Params; - return Params(p, *this); - } - - template - cgal_bgl_named_params - get_cost_params(const GetCostParams& p) const - { - typedef cgal_bgl_named_params Params; - return Params(p, *this); - } - - template - cgal_bgl_named_params - get_placement(const GetPlacement& p) const - { - typedef cgal_bgl_named_params Params; - return Params(p, *this); - } - - template - cgal_bgl_named_params - get_placement_params(const GetPlacementParams& p) const - { - typedef cgal_bgl_named_params Params; - return Params(p, *this); - } - - template - cgal_bgl_named_params - edge_is_constrained_map(const EdgeIsConstrained& em) const - { - typedef cgal_bgl_named_params Params; - return Params(em, *this); - } - - template - cgal_bgl_named_params - edge_is_constrained_map_params(const EdgeIsConstrainedParams& em) const - { - typedef cgal_bgl_named_params Params; - return Params(em, *this); - } +// create the functions for new named parameters and the one imported boost +// used to concatenate several parameters +#define CGAL_add_named_parameter(X, Y, Z) \ + template \ + cgal_bgl_named_params \ + Z(const K& k) const \ + { \ + typedef cgal_bgl_named_params Params;\ + return Params(k, *this); \ + } +#include +#include +#undef CGAL_add_named_parameter }; namespace parameters { - template - cgal_bgl_named_params - vertex_index_map(IndexMap const& p) - { - typedef cgal_bgl_named_params Params; - return Params(p); - } - - template - cgal_bgl_named_params - halfedge_index_map(IndexMap const& p) - { - typedef cgal_bgl_named_params Params; - return Params(p); - } - - template - cgal_bgl_named_params - face_index_map(IndexMap const& p) - { - typedef cgal_bgl_named_params Params; - return Params(p); - } - - template - cgal_bgl_named_params - vertex_point_map(PointMap const& p) - { - typedef cgal_bgl_named_params Params; - return Params(p); - } - - template - cgal_bgl_named_params - vertex_is_fixed_map(IsFixedMap const& p) - { - typedef cgal_bgl_named_params Params; - return Params(p); - } - - template - cgal_bgl_named_params - edge_index_map(IndexMap const& pmap) - { - typedef cgal_bgl_named_params Params; - return Params(pmap); - } - - template - cgal_bgl_named_params - visitor(const Visitor& p) - { - typedef cgal_bgl_named_params Params; - return Params(p); - } - - template - cgal_bgl_named_params - set_cache(const SetCache& p) - { - typedef cgal_bgl_named_params Params; - return Params(p); - } - - template - cgal_bgl_named_params - get_cost(const GetCost& p) - { - typedef cgal_bgl_named_params Params; - return Params(p); - } - - template - cgal_bgl_named_params - get_cost_params(const GetCostParams& p) - { - typedef cgal_bgl_named_params Params; - return Params(p); - } - - template - cgal_bgl_named_params - get_placement(const GetPlacement& p) - { - typedef cgal_bgl_named_params Params; - return Params(p); - } - - template - cgal_bgl_named_params - get_placement_params(const GetPlacementParams& p) - { - typedef cgal_bgl_named_params Params; - return Params(p); - } - - template - cgal_bgl_named_params - edge_is_constrained_map(const EdgeIsConstrained& em) - { - typedef cgal_bgl_named_params Params; - return Params(em); - } - - template - cgal_bgl_named_params - edge_is_constrained_map_params(const EdgeIsConstrainedParams& em) - { - typedef cgal_bgl_named_params Params; - return Params(em); +// define free functions for named parameters +#define CGAL_add_named_parameter(X, Y, Z) \ + template \ + cgal_bgl_named_params \ + Z(K const& p) \ + { \ + typedef cgal_bgl_named_params Params;\ + return Params(p); \ } +#include +#include +#undef CGAL_add_named_parameter } // namespace parameters diff --git a/BGL/include/CGAL/boost/graph/parameters_interface.h b/BGL/include/CGAL/boost/graph/parameters_interface.h new file mode 100644 index 00000000000..4ba3af1e61c --- /dev/null +++ b/BGL/include/CGAL/boost/graph/parameters_interface.h @@ -0,0 +1,30 @@ +// Copyright (c) 2017 GeometryFactory (France). All rights reserved. +// +// This file is part of CGAL (www.cgal.org); you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +// +// $URL$ +// $Id$ +// +// +// Author(s) : Maxime Gimeno + +// List of named parameters that we use in CGAL +CGAL_add_named_parameter(vertex_point_t, vertex_point, vertex_point_map) +CGAL_add_named_parameter(face_index_t, face_index, face_index_map) +CGAL_add_named_parameter(edge_index_t, edge_index, edge_index_map) +CGAL_add_named_parameter(halfedge_index_t, halfedge_index, halfedge_index_map) +CGAL_add_named_parameter(edge_is_constrained_t, edge_is_constrained, edge_is_constrained_map) +CGAL_add_named_parameter(set_cache_policy_t, set_cache_policy, set_cache) +CGAL_add_named_parameter(get_cost_policy_t, get_cost_policy, get_cost) +CGAL_add_named_parameter(get_cost_policy_params_t, get_cost_policy_params, get_cost_params) +CGAL_add_named_parameter(get_placement_policy_t, get_placement_policy, get_placement) +CGAL_add_named_parameter(get_placement_policy_params_t, get_placement_policy_params, get_placement_params) diff --git a/BGL/include/CGAL/boost/graph/selection.h b/BGL/include/CGAL/boost/graph/selection.h index c2fab703357..ff32f390abf 100644 --- a/BGL/include/CGAL/boost/graph/selection.h +++ b/BGL/include/CGAL/boost/graph/selection.h @@ -213,7 +213,7 @@ reduce_face_selection( /*! \ingroup PkgBGLSelectionFct -discovers and puts in `out` all faces incident to the target vertex +Discovers and puts in `out` all faces incident to the target vertex of a halfedge in `hedges`. Faces are put exactly once in `out`. \tparam HalfedgeRange a range of halfedge descriptors, model of `Range`. Its iterator type is `InputIterator`. @@ -252,7 +252,6 @@ select_incident_faces( return out; } -// Operations on edges /*! \ingroup PkgBGLSelectionFct Augments a selection with edges of `fg` that are adjacent @@ -406,7 +405,6 @@ reduce_edge_selection( return out; } -// Operations on vertices /*! \ingroup PkgBGLSelectionFct Augments a selection with vertices of `fg` that are adjacent diff --git a/BGL/include/CGAL/boost/graph/split_graph_into_polylines.h b/BGL/include/CGAL/boost/graph/split_graph_into_polylines.h index 70426aca193..b1811992a5e 100644 --- a/BGL/include/CGAL/boost/graph/split_graph_into_polylines.h +++ b/BGL/include/CGAL/boost/graph/split_graph_into_polylines.h @@ -21,11 +21,12 @@ #define CGAL_SPLIT_GRAPH_INTO_POLYLINES #include -#include +#include +#include #include #include -#include #include +#include namespace CGAL { @@ -318,10 +319,11 @@ split_graph_into_polylines(const Graph& graph, polyline_visitor.add_node(g_copy[v]); internal::bgl_sgip_maybe_call_visitor_add_edge(polyline_visitor, g_copy[*b]); + if (degree(v, g_copy)==1) + terminal.erase(v); remove_edge(b, g_copy); u = v; } - terminal.erase(u); polyline_visitor.end_polyline(); } diff --git a/BGL/test/BGL/graph_concept_Triangulation_2.cpp b/BGL/test/BGL/graph_concept_Triangulation_2.cpp index 294d9ccaaee..88f75e5696c 100644 --- a/BGL/test/BGL/graph_concept_Triangulation_2.cpp +++ b/BGL/test/BGL/graph_concept_Triangulation_2.cpp @@ -1,10 +1,21 @@ #include #include +#include +#include +#include +#include +#include #include typedef CGAL::Simple_cartesian Kernel; typedef CGAL::Triangulation_2 Triangulation; +typedef CGAL::Delaunay_triangulation_2 DT2; +typedef CGAL::Constrained_triangulation_2 CT2; +typedef CGAL::Constrained_Delaunay_triangulation_2 CDT2; +typedef CGAL::Constrained_triangulation_plus_2 CDTP2; +typedef CGAL::Triangulation_hierarchy_2 THDT2; +typedef CGAL::Triangulation_hierarchy_2 THCDTP2; template void concept_check_triangulation() { @@ -15,5 +26,11 @@ void concept_check_triangulation() { int main() { concept_check_triangulation(); + concept_check_triangulation(); + concept_check_triangulation(); + concept_check_triangulation(); + concept_check_triangulation(); + concept_check_triangulation(); + concept_check_triangulation(); return 0; } diff --git a/BGL/test/BGL/test_Triangulation_2.cpp b/BGL/test/BGL/test_Triangulation_2.cpp deleted file mode 100644 index b1a68271b07..00000000000 --- a/BGL/test/BGL/test_Triangulation_2.cpp +++ /dev/null @@ -1,52 +0,0 @@ -#include -#include - -#include -#include -#include - -typedef CGAL::Simple_cartesian Kernel; -typedef CGAL::Triangulation_2 Triangulation; -typedef typename Triangulation::Point Point; -typedef typename Triangulation::Vertex Vertex; -typedef typename Triangulation::Vertex Vertex_handle; - -int test_main(int, char*[]) -{ - using namespace boost::assign; - - Triangulation t; - { - std::vector v; - // taken from the triangulation test cases, should be randomly generated - v += Point(5,6,1), Point(1,9,1), Point(6,14,1), Point(4,12,1), Point(3,29,1), Point(6,7,1), - Point(6,39,1), Point(8,9,1), Point(10,18,1), Point(75625,155625,10000), - Point(10,50,2), Point(6,15,2), Point(6,16,2), Point(10,11,1), - Point(10,40,1), Point(60,-10,1); - - t.insert(v.begin(), v.end()); - } - - typedef typename boost::graph_traits::vertex_descriptor vertex_t; - std::vector vv; - for(typename Triangulation::Finite_vertices_iterator it = t.finite_vertices_begin(); - it != t.finite_vertices_end(); ++it) { - vv.push_back(it); - } - - - std::vector< std::pair > e; - for(Triangulation::All_edges_iterator it = t.all_edges_begin(); - it != t.all_edges_end(); ++it) { - e.push_back( - std::make_pair( - it->first->vertex((it->second + 2) % 3) - , it->first->vertex((it->second + 1) % 3))); - } - - boost::graph_test gt; - gt.test_bidirectional_graph(vv, e, t); - return 0; -} - - diff --git a/BGL/test/BGL/test_cgal_bgl_named_params.cpp b/BGL/test/BGL/test_cgal_bgl_named_params.cpp index 2d118bdf99a..3eea4eb4173 100644 --- a/BGL/test/BGL/test_cgal_bgl_named_params.cpp +++ b/BGL/test/BGL/test_cgal_bgl_named_params.cpp @@ -2,6 +2,8 @@ #include #include + + template struct A{ A(int v):v(v){} @@ -20,36 +22,33 @@ template void test(const NamedParameters& np) { // test values - assert( get_param(np,boost::vertex_index).v == 0 ); - assert( get_param(np,boost::halfedge_index).v == 1 ); - assert( get_param(np,boost::face_index).v == 2 ); - assert( get_param(np,boost::vertex_point).v == 3 ); - assert( get_param(np,CGAL::vertex_is_fixed).v == 4 ); - assert( get_param(np,boost::edge_index).v == 5 ); + assert( get_param(np,CGAL::internal_np::vertex_index).v == 0 ); + assert( get_param(np,CGAL::internal_np::halfedge_index).v == 1 ); + assert( get_param(np,CGAL::internal_np::face_index).v == 2 ); + assert( get_param(np,CGAL::internal_np::vertex_point).v == 3 ); + assert( get_param(np,CGAL::internal_np::edge_index).v == 5 ); assert( get_param(np,boost::graph_visitor).v == 6 ); - assert( get_param(np,CGAL::set_cache_policy).v == 7 ); - assert( get_param(np,CGAL::get_cost_policy).v == 8 ); - assert( get_param(np,CGAL::get_cost_policy_params).v == 9 ); - assert( get_param(np,CGAL::get_placement_policy).v == 10 ); - assert( get_param(np,CGAL::get_placement_policy_params).v == 11 ); - assert( get_param(np,CGAL::edge_is_constrained).v == 12 ); - assert( get_param(np,CGAL::edge_is_constrained_params).v == 13 ); + assert( get_param(np,CGAL::internal_np::set_cache_policy).v == 7 ); + assert( get_param(np,CGAL::internal_np::get_cost_policy).v == 8 ); + assert( get_param(np,CGAL::internal_np::get_cost_policy_params).v == 9 ); + assert( get_param(np,CGAL::internal_np::get_placement_policy).v == 10 ); + assert( get_param(np,CGAL::internal_np::get_placement_policy_params).v == 11 ); + assert( get_param(np,CGAL::internal_np::edge_is_constrained).v == 12 ); + //test types check_same_type<0>( get_param(np,boost::vertex_index) ); - check_same_type<1>( get_param(np,boost::halfedge_index) ); - check_same_type<2>( get_param(np,boost::face_index) ); - check_same_type<3>( get_param(np,boost::vertex_point) ); - check_same_type<4>( get_param(np,CGAL::vertex_is_fixed) ); - check_same_type<5>( get_param(np,boost::edge_index) ); + check_same_type<1>( get_param(np,CGAL::internal_np::halfedge_index) ); + check_same_type<2>( get_param(np,CGAL::internal_np::face_index) ); + check_same_type<3>( get_param(np,CGAL::internal_np::vertex_point) ); + check_same_type<5>( get_param(np,CGAL::internal_np::edge_index) ); check_same_type<6>( get_param(np,boost::graph_visitor) ); - check_same_type<7>( get_param(np,CGAL::set_cache_policy) ); - check_same_type<8>( get_param(np,CGAL::get_cost_policy) ); - check_same_type<9>( get_param(np,CGAL::get_cost_policy_params) ); - check_same_type<10>( get_param(np,CGAL::get_placement_policy) ); - check_same_type<11>( get_param(np,CGAL::get_placement_policy_params) ); - check_same_type<12>( get_param(np,CGAL::edge_is_constrained) ); - check_same_type<13>( get_param(np,CGAL::edge_is_constrained_params) ); + check_same_type<7>( get_param(np,CGAL::internal_np::set_cache_policy) ); + check_same_type<8>( get_param(np,CGAL::internal_np::get_cost_policy) ); + check_same_type<9>( get_param(np,CGAL::internal_np::get_cost_policy_params) ); + check_same_type<10>( get_param(np,CGAL::internal_np::get_placement_policy) ); + check_same_type<11>( get_param(np,CGAL::internal_np::get_placement_policy_params) ); + check_same_type<12>( get_param(np,CGAL::internal_np::edge_is_constrained) ); } int main() @@ -59,7 +58,6 @@ int main() halfedge_index_map(A<1>(1)). face_index_map(A<2>(2)). vertex_point_map(A<3>(3)). - vertex_is_fixed_map(A<4>(4)). edge_index_map(A<5>(5)). visitor(A<6>(6)). set_cache(A<7>(7)). @@ -67,7 +65,6 @@ int main() get_cost_params(A<9>(9)). get_placement(A<10>(10)). get_placement_params(A<11>(11)). - edge_is_constrained_map(A<12>(12)). - edge_is_constrained_map_params(A<13>(13)) + edge_is_constrained_map(A<12>(12)) ); } diff --git a/BGL/test/BGL/test_graph_traits.cpp b/BGL/test/BGL/test_graph_traits.cpp index 97f4967c42a..6024ec4782a 100644 --- a/BGL/test/BGL/test_graph_traits.cpp +++ b/BGL/test/BGL/test_graph_traits.cpp @@ -9,9 +9,8 @@ typedef boost::unordered_set id_map; template -void test_isolated_vertex(const Graph& g) +void test_isolated_vertex() { - std::cerr << typeid(g).name() << std::endl; Graph G; typedef boost::graph_traits< Graph > Traits; typedef typename Traits::vertex_descriptor vertex_descriptor; @@ -273,8 +272,8 @@ test(const std::vector& graphs) test_faces(p); test_halfedge_around_vertex_iterator(p); test_halfedge_around_face_iterator(p); - test_isolated_vertex(p); } + test_isolated_vertex(); } int diff --git a/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/CMakeLists.txt b/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/CMakeLists.txt index 7b36966e196..e6fcc010d28 100644 --- a/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/CMakeLists.txt +++ b/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/CMakeLists.txt @@ -4,6 +4,9 @@ project( Boolean_set_operations_2_GraphicsView_Demo ) cmake_minimum_required(VERSION 2.8.11) +if(POLICY CMP0053) + cmake_policy(SET CMP0053 OLD) +endif() if(POLICY CMP0043) cmake_policy(SET CMP0043 OLD) endif() diff --git a/Boolean_set_operations_2/examples/Boolean_set_operations_2/circle_segment.cpp b/Boolean_set_operations_2/examples/Boolean_set_operations_2/circle_segment.cpp index 77aeb25e426..523f1961907 100644 --- a/Boolean_set_operations_2/examples/Boolean_set_operations_2/circle_segment.cpp +++ b/Boolean_set_operations_2/examples/Boolean_set_operations_2/circle_segment.cpp @@ -43,7 +43,7 @@ Polygon_2 construct_polygon (const Circle_2& circle) return pgn; } -// Construct a point from a rectangle. +// Construct a polygon from a rectangle. Polygon_2 construct_polygon (const Point_2& p1, const Point_2& p2, const Point_2& p3, const Point_2& p4) { diff --git a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_on_surface_base_2.h b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_on_surface_base_2.h index 5955dc3fab8..67e33d6ba0e 100644 --- a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_on_surface_base_2.h +++ b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_on_surface_base_2.h @@ -1187,6 +1187,13 @@ protected: // accessor for low-level arrangement fonctionalities CGAL::Arr_accessor accessor(*arr); + // the face field of outer and inner ccb are used in the loop to access the old face an halfedge + // used to contribute to. These two vectors are used to delay the association to the new face to + // avoid overwriting a field that is still needed + typedef std::pair Outer_ccb_and_face; + typedef std::pair Inner_ccb_and_face; + std::vector outer_ccb_and_new_face_pairs; + std::vector inner_ccb_and_new_face_pairs; // update halfedge ccb pointers for (Halfedge_iterator itr = arr->halfedges_begin(); itr != arr->halfedges_end(); ++itr) { @@ -1208,11 +1215,12 @@ protected: f = *(face_handles[ (*uf_faces.find(face_handles[f->id()]))->id() ]); - if (h->flag()==ON_INNER_CCB || h->flag()==NOT_VISITED) + if (h->flag()==ON_INNER_CCB) { - typename Aos_2::Dcel::Inner_ccb* inner_ccb = inner_ccbs_to_remove.empty()? + bool reuse_inner_ccb = !inner_ccbs_to_remove.empty(); + typename Aos_2::Dcel::Inner_ccb* inner_ccb = !reuse_inner_ccb? accessor.new_inner_ccb():inner_ccbs_to_remove.back(); - if ( !inner_ccbs_to_remove.empty() ) inner_ccbs_to_remove.pop_back(); + if ( reuse_inner_ccb ) inner_ccbs_to_remove.pop_back(); Halfedge_handle hstart=h; do{ @@ -1222,9 +1230,13 @@ protected: }while(hstart!=h); f->add_inner_ccb(inner_ccb,_halfedge(h)); inner_ccb->set_halfedge(_halfedge(h)); - inner_ccb->set_face(f); + if (!reuse_inner_ccb) + inner_ccb->set_face(f); + else + inner_ccb_and_new_face_pairs.push_back( std::make_pair(inner_ccb, f) ); } else{ + // we never create more outer ccb than what was available CGAL_assertion(!outer_ccbs_to_remove.empty()); typename Aos_2::Dcel::Outer_ccb* outer_ccb = outer_ccbs_to_remove.back(); outer_ccbs_to_remove.pop_back(); @@ -1236,11 +1248,17 @@ protected: }while(hstart!=h); f->add_outer_ccb(outer_ccb,_halfedge(h)); outer_ccb->set_halfedge(_halfedge(h)); - outer_ccb->set_face(f); + outer_ccb_and_new_face_pairs.push_back( std::make_pair(outer_ccb, f) ); } } } + // now set the new face for all ccbs + BOOST_FOREACH(Outer_ccb_and_face& ccb_and_face, outer_ccb_and_new_face_pairs) + ccb_and_face.first->set_face(ccb_and_face.second); + BOOST_FOREACH(Inner_ccb_and_face& ccb_and_face, inner_ccb_and_new_face_pairs) + ccb_and_face.first->set_face(ccb_and_face.second); + //remove no longer used edges, vertices and faces accessor.delete_vertices( vertices_to_remove ); accessor.delete_edges( edges_to_remove ); diff --git a/Bounding_volumes/include/CGAL/Minimum_enclosing_quadrilateral_traits_2.h b/Bounding_volumes/include/CGAL/Minimum_enclosing_quadrilateral_traits_2.h index f26292044b7..191e57083d4 100644 --- a/Bounding_volumes/include/CGAL/Minimum_enclosing_quadrilateral_traits_2.h +++ b/Bounding_volumes/include/CGAL/Minimum_enclosing_quadrilateral_traits_2.h @@ -24,10 +24,11 @@ #include +#define CGAL_DEPRECATED_HEADER "" +#define CGAL_REPLACEMENT_HEADER "" +#include -#ifndef CGAL_NO_DEPRECATED_CODE #include -#endif // CGAL_NO_DEPRECATED_CODE #endif // ! (CGAL_MINIMUM_ENCLOSING_QUADRILATERAL_TRAITS_2_H) diff --git a/Bounding_volumes/include/CGAL/minimum_enclosing_quadrilateral_2.h b/Bounding_volumes/include/CGAL/minimum_enclosing_quadrilateral_2.h index 136e614241f..e7d1082c1d7 100644 --- a/Bounding_volumes/include/CGAL/minimum_enclosing_quadrilateral_2.h +++ b/Bounding_volumes/include/CGAL/minimum_enclosing_quadrilateral_2.h @@ -24,10 +24,11 @@ #include +#define CGAL_DEPRECATED_HEADER "" +#define CGAL_REPLACEMENT_HEADER "" +#include -#ifndef CGAL_NO_DEPRECATED_CODE #include -#endif // CGAL_NO_DEPRECATED_CODE #endif // ! (CGAL_MINIMUM_ENCLOSING_QUADRILATERAL_2_H) diff --git a/CGAL_Core/include/CGAL/CORE/BigFloat_impl.h b/CGAL_Core/include/CGAL/CORE/BigFloat_impl.h index 16528db6de1..a0271b538d4 100644 --- a/CGAL_Core/include/CGAL/CORE/BigFloat_impl.h +++ b/CGAL_Core/include/CGAL/CORE/BigFloat_impl.h @@ -137,7 +137,7 @@ BigFloatRep::BigFloatRep(double d) : m(0), err(0), exp(0) { exp--; stop++; } -#ifdef CORE_DEBUG +#ifdef CGAL_CORE_DEBUG CGAL_assertion (s >= 0); #endif @@ -277,7 +277,7 @@ void BigFloatRep::normal() { // bits of error long f = chunkFloor(--le); // f is roughly equal to floor(le/CHUNK_BIT) long bits_f = bits(f); // f chunks will have bits_f many bits -#ifdef CORE_DEBUG +#ifdef CGAL_CORE_DEBUG CGAL_assertion (bits_f >= 0); #endif @@ -305,7 +305,7 @@ void BigFloatRep::bigNormal(BigInt& bigErr) { } else { long f = chunkFloor(--le); long bits_f = bits(f); -#ifdef CORE_DEBUG +#ifdef CGAL_CORE_DEBUG CGAL_assertion(bits_f >= 0); #endif @@ -684,7 +684,7 @@ void BigFloatRep::sqrt(const BigFloatRep& x, const extLong& a, const BigFloat& A } else { // p > 0 m = chunkShift(z.m, chunkCeil(p)); long r = CHUNK_BIT - 1 - (p + CHUNK_BIT - 1) % CHUNK_BIT; -#ifdef CORE_DEBUG +#ifdef CGAL_CORE_DEBUG CGAL_assertion(r >= 0); #endif @@ -727,7 +727,7 @@ void BigFloatRep::sqrt(const BigFloatRep& x, const extLong& a, const BigFloat& A } else { // q > 0 m = chunkShift(z.m, chunkCeil(q)); long r = CHUNK_BIT - 1 - (q + CHUNK_BIT - 1) % CHUNK_BIT; -#ifdef CORE_DEBUG +#ifdef CGAL_CORE_DEBUG CGAL_assertion(r >= 0); #endif @@ -961,7 +961,7 @@ BigFloatRep::toDecimal(unsigned int width, bool Scientific) const { } decOut.isScientific = false; } -#ifdef CORE_DEBUG +#ifdef CGAL_CORE_DEBUG CGAL_assertion(decOut.noSignificant >= 0); #endif @@ -1025,7 +1025,7 @@ void BigFloatRep :: fromString(const char *str, extLong prec ) { // i.e., input is A/10^{e10}. else { e = str + strlen(str); -#ifdef CORE_DEBUG +#ifdef CGAL_CORE_DEBUG CGAL_assertion(*e == '\0'); #endif @@ -1116,7 +1116,7 @@ std::istream& BigFloatRep :: operator >>(std::istream& i) { p = str + size; size *= 2; } -#ifdef CORE_DEBUG +#ifdef CGAL_CORE_DEBUG CGAL_assertion((p-str) < size); #endif @@ -1142,7 +1142,7 @@ std::istream& BigFloatRep :: operator >>(std::istream& i) { p = str + len; } -#ifdef CORE_DEBUG +#ifdef CGAL_CORE_DEBUG CGAL_assertion(p - str < size); #endif @@ -1229,7 +1229,7 @@ BigInt BigFloatRep::toBigInt() const { long le = clLg(err); if (le == -1) le = 0; -#ifdef CORE_DEBUG +#ifdef CGAL_CORE_DEBUG CGAL_assertion (le >= 0); #endif @@ -1249,7 +1249,7 @@ long BigFloatRep :: toLong() const { // convert a BigFloat to a long integer, rounded toward -\infty. long e2 = bits(exp); long le = clLg(err); -#ifdef CORE_DEBUG +#ifdef CGAL_CORE_DEBUG CGAL_assertion (le >= 0); #endif diff --git a/CGAL_Core/include/CGAL/CORE/Expr.h b/CGAL_Core/include/CGAL/CORE/Expr.h index 6768c64a244..83b0fad0a8d 100644 --- a/CGAL_Core/include/CGAL/CORE/Expr.h +++ b/CGAL_Core/include/CGAL/CORE/Expr.h @@ -82,7 +82,7 @@ public: Expr(float f) : RCExpr(NULL) { // check for valid numbers // (i.e., not infinite and not NaN) if (! CGAL_CORE_finite(f)) { - std::cerr << " ERROR : constructed an invalid float! " << std::endl; + core_error(" ERROR : constructed an invalid float! ", __FILE__, __LINE__, false); if (get_static_AbortFlag()) abort(); get_static_InvalidFlag() = -1; @@ -93,7 +93,7 @@ public: Expr(double d) : RCExpr(NULL) { // check for valid numbers // (i.e., not infinite and not NaN) if (! CGAL_CORE_finite(d)) { - std::cerr << " ERROR : constructed an invalid double! " << std::endl; + core_error(" ERROR : constructed an invalid double! ", __FILE__, __LINE__, false); if (get_static_AbortFlag()) abort(); get_static_InvalidFlag() = -2; @@ -183,7 +183,7 @@ public: /// /= operator Expr& operator/=(const Expr& e) { if ((e.rep)->getSign() == 0) { - std::cerr << " ERROR : division by zero ! " << std::endl; + core_error(" ERROR : division by zero ! ",__FILE__, __LINE__, false); if (get_static_AbortFlag()) abort(); get_static_InvalidFlag() = -3; @@ -386,7 +386,7 @@ inline Expr operator*(const Expr& e1, const Expr& e2) { /// division inline Expr operator/(const Expr& e1, const Expr& e2) { if (e2.sign() == 0) { - std::cerr << " ERROR : division by zero ! " << std::endl; + core_error(" ERROR : division by zero ! ", __FILE__, __LINE__, false); if (get_static_AbortFlag()) abort(); get_static_InvalidFlag() = -4; @@ -489,7 +489,7 @@ inline bool isDivisible(const Expr& e1, const Expr& e2) { /// square root inline Expr sqrt(const Expr& e) { if (e.sign() < 0) { - std::cerr << " ERROR : sqrt of negative value ! " << std::endl; + core_error(" ERROR : sqrt of negative value ! ", __FILE__, __LINE__, false); if (get_static_AbortFlag()) abort(); get_static_InvalidFlag() = -5; diff --git a/CGAL_Core/include/CGAL/CORE/ExprRep.h b/CGAL_Core/include/CGAL/CORE/ExprRep.h index 87ee74c1458..8a9f45a3e1c 100644 --- a/CGAL_Core/include/CGAL/CORE/ExprRep.h +++ b/CGAL_Core/include/CGAL/CORE/ExprRep.h @@ -42,6 +42,7 @@ #include #include #include +#include #if defined(BOOST_MSVC) # pragma warning(push) @@ -51,7 +52,7 @@ namespace CORE { -#if defined(CORE_DEBUG_BOUND) && !defined(CGAL_HEADER_ONLY) +#if defined(CGAL_CORE_DEBUG_BOUND) && !defined(CGAL_HEADER_ONLY) // These counters are incremented each time each bound is recognized as equal // to the best one in computeBound(). extern unsigned int BFMSS_counter; @@ -91,7 +92,7 @@ struct NodeInfo { bool flagsComputed; ///< true if rootBound parameters have been computed extLong knownPrecision; ///< Precision achieved by current approx value -#ifdef CORE_DEBUG +#ifdef CGAL_CORE_DEBUG extLong relPrecision; extLong absPrecision; unsigned long numNodes; @@ -229,7 +230,7 @@ public: return nodeInfo->knownPrecision; } -#ifdef CORE_DEBUG +#ifdef CGAL_CORE_DEBUG const extLong& relPrecision() const { return nodeInfo->relPrecision; } @@ -463,7 +464,7 @@ public: /// reset the flag "visited" virtual void clearFlag() = 0; //@} -#ifdef CORE_DEBUG +#ifdef CGAL_CORE_DEBUG virtual unsigned long dagSize() = 0; virtual void fullClearFlag() = 0; #endif @@ -502,7 +503,7 @@ protected: void clearFlag() { visited() = false; } -#ifdef CORE_DEBUG +#ifdef CGAL_CORE_DEBUG unsigned long dagSize(); void fullClearFlag(); #endif @@ -746,7 +747,7 @@ protected: /// clear visited flag void clearFlag(); -#ifdef CORE_DEBUG +#ifdef CGAL_CORE_DEBUG unsigned long dagSize(); void fullClearFlag(); #endif @@ -854,7 +855,7 @@ protected: /** This is now a misnomer, but historically accurate. */ extLong count(); -#ifdef CORE_DEBUG +#ifdef CGAL_CORE_DEBUG unsigned long dagSize(); void fullClearFlag(); #endif @@ -1024,12 +1025,12 @@ void AddSubRep::computeExactFlags() { extLong l = core_max(lf, ls); extLong u = core_max(uf, us); -#ifdef CORE_TRACE +#ifdef CGAL_CORE_TRACE std::cout << "INSIDE Add/sub Rep: " << std::endl; #endif if (Op(sf, ss) != 0) { // can't possibly cancel out -#ifdef CORE_TRACE +#ifdef CGAL_CORE_TRACE std::cout << "Add/sub Rep: Op(sf, ss) non-zero" << std::endl; #endif @@ -1037,38 +1038,38 @@ void AddSubRep::computeExactFlags() { lMSB() = l; // lMSB = core_min(lf, ls)+1 better sign() = sf; } else { // might cancel out -#ifdef CORE_TRACE +#ifdef CGAL_CORE_TRACE std::cout << "Add/sub Rep: Op(sf, ss) zero" << std::endl; #endif uMSB() = u + EXTLONG_ONE; uMSB() = u; if (lf >= us + EXTLONG_TWO) {// one is at least 1 order of magnitude larger -#ifdef CORE_TRACE +#ifdef CGAL_CORE_TRACE std::cout << "Add/sub Rep: Can't cancel" << std::endl; #endif lMSB() = lf - EXTLONG_ONE; // can't possibly cancel out sign() = sf; } else if (ls >= uf + EXTLONG_TWO) { -#ifdef CORE_TRACE +#ifdef CGAL_CORE_TRACE std::cout << "Add/sub Rep: Can't cancel" << std::endl; #endif lMSB() = ls - EXTLONG_ONE; sign() = Op(ss); } else if (ffVal.isOK()) {// begin filter computation -#ifdef CORE_TRACE +#ifdef CGAL_CORE_TRACE std::cout << "Add/sub Rep: filter used" << std::endl; #endif -#ifdef CORE_DEBUG_FILTER +#ifdef CGAL_CORE_DEBUG_FILTER std::cout << "call filter in " << op() << "Rep" << std::endl; #endif sign() = ffVal.sign(); lMSB() = ffVal.lMSB(); uMSB() = ffVal.uMSB(); } else { // about the same size, might cancel out -#ifdef CORE_TRACE +#ifdef CGAL_CORE_TRACE std::cout << "Add/sub Rep: iteration start" << std::endl; #endif @@ -1108,7 +1109,7 @@ void AddSubRep::computeExactFlags() { sign() = 0; } } else { // else do progressive evaluation -#ifdef CORE_TRACE +#ifdef CGAL_CORE_TRACE std::cout << "Add/sub Rep: progressive eval" << std::endl; #endif // Oct 30, 2002: fixed a bug here! Old versions used relative @@ -1124,7 +1125,7 @@ void AddSubRep::computeExactFlags() { extLong ua = lowBound.asLong() + EXTLONG_ONE; // NOTE: ua is allowed to be CORE_INFTY -#ifdef CORE_DEBUG_BOUND +#ifdef CGAL_CORE_DEBUG_BOUND std::cout << "DebugBound:" << "ua = " << ua << std::endl; #endif // We initially set the lMSB and sign as if the value is zero: @@ -1135,7 +1136,7 @@ void AddSubRep::computeExactFlags() { // Now we try to determine the real lMSB and sign, // in case it is not really zero: -#ifdef CORE_TRACE +#ifdef CGAL_CORE_TRACE std::cout << "Upper bound (ua) for iteration is " << ua << std::endl; std::cout << "Starting iteration at i = " << i << std::endl; #endif @@ -1156,7 +1157,7 @@ void AddSubRep::computeExactFlags() { Real newValue = Op(first->getAppValue(CORE_INFTY, i), second->getAppValue(CORE_INFTY, i)); -#ifdef CORE_TRACE +#ifdef CGAL_CORE_TRACE if (newValue.getRep().ID() == REAL_BIGFLOAT) std::cout << "BigFloat! newValue->rep->ID() = " << newValue.getRep().ID() << std::endl; @@ -1180,10 +1181,10 @@ void AddSubRep::computeExactFlags() { lMSB() = newValue.lMSB(); uMSB() = newValue.uMSB(); sign() = newValue.sign(); -#ifdef CORE_DEBUG_BOUND +#ifdef CGAL_CORE_DEBUG_BOUND std::cout << "DebugBound(Exit Loop): " << "i=" << i << std::endl; #endif -#ifdef CORE_TRACE +#ifdef CGAL_CORE_TRACE std::cout << "Zero is not in, lMSB() = " << lMSB() << ", uMSB() = " << uMSB() << ", sign() = " << sign() << std::endl; @@ -1200,7 +1201,7 @@ void AddSubRep::computeExactFlags() { if (get_static_EscapePrecWarning()) std::cout<< "Escape Precision triggered at " << get_static_EscapePrec() << " bits" << std::endl; -#ifdef CORE_DEBUG +#ifdef CGAL_CORE_DEBUG std::cout << "EscapePrecFlags=" << get_static_EscapePrecFlag() << std::endl; std::cout << "ua =" << ua << ",lowBound=" << lowBound << std::endl; #endif @@ -1208,7 +1209,7 @@ void AddSubRep::computeExactFlags() { }// if }// for (long i=1...) -#if defined(CORE_DEBUG_BOUND) && !defined(CGAL_HEADER_ONLY) +#if defined(CGAL_CORE_DEBUG_BOUND) && !defined(CGAL_HEADER_ONLY) rootBoundHitCounter++; #endif @@ -1243,8 +1244,9 @@ void AddSubRep::computeApproxValue(const extLong& relPrec, // handling overflow and underflow if (lMSB() >= EXTLONG_BIG || lMSB() <= EXTLONG_SMALL) { - std::cerr << "lMSB = " << lMSB() << std::endl; // should be in core_error - core_error("CORE WARNING: a huge lMSB in AddSubRep", + std::ostringstream oss; + oss << "CORE WARNING: a huge lMSB in AddSubRep: " << lMSB(); + core_error(oss.str(), __FILE__, __LINE__, false); } @@ -1338,7 +1340,7 @@ inline int ExprRep::getExactSign() { if (!flagsComputed()) { degreeBound(); -#ifdef CORE_DEBUG +#ifdef CGAL_CORE_DEBUG dagSize(); fullClearFlag(); #endif diff --git a/CGAL_Core/include/CGAL/CORE/Expr_impl.h b/CGAL_Core/include/CGAL/CORE/Expr_impl.h index a313f77ea17..5fdac520f11 100644 --- a/CGAL_Core/include/CGAL/CORE/Expr_impl.h +++ b/CGAL_Core/include/CGAL/CORE/Expr_impl.h @@ -42,6 +42,7 @@ #include #include +#include namespace CORE { @@ -1028,8 +1029,9 @@ void MultRep::computeApproxValue(const extLong& relPrec, // handling overflow and underflow if (lMSB() >= EXTLONG_BIG || lMSB() <= EXTLONG_SMALL) { - std::cerr << "lMSB = " << lMSB() << std::endl; // should be in core_error - core_error("CORE WARNING: a huge lMSB in AddSubRep", + std::ostringstream oss; + oss << "CORE WARNING: a huge lMSB in AddSubRep " << lMSB(); + core_error(oss.str(), __FILE__, __LINE__, false); } @@ -1050,8 +1052,9 @@ void DivRep::computeApproxValue(const extLong& relPrec, // handling overflow and underflow if (lMSB() >= EXTLONG_BIG || lMSB() <= EXTLONG_SMALL) { - std::cerr << "lMSB = " << lMSB() << std::endl; // should be in core_error - core_error("CORE WARNING: a huge lMSB in AddSubRep", + std::ostringstream oss; + oss << "CORE WARNING: a huge lMSB in AddSubRep " << lMSB(); + core_error(oss.str(), __FILE__, __LINE__, false); } diff --git a/CGAL_Core/include/CGAL/CORE/poly/Curves.tcc b/CGAL_Core/include/CGAL/CORE/poly/Curves.tcc index 9e89be0322a..6e52c4101d6 100644 --- a/CGAL_Core/include/CGAL/CORE/poly/Curves.tcc +++ b/CGAL_Core/include/CGAL/CORE/poly/Curves.tcc @@ -34,6 +34,7 @@ * $Id$ ***************************************************************************/ +#include //CONSTRUCTORS FOR THE BIPOLY CLASS //////////////////////////////////////////////////////// @@ -306,7 +307,9 @@ int BiPoly::getbasicterm(string s, BiPoly & P){ Polynomial q(0, cs); P.coeffX.push_back(q); }else{ +#ifdef CGAL_CORE_TRACE std::cout <<"ERROR IN PARSING BASIC TERM" << std::endl; +#endif } //i+1 points to the beginning of next syntaxtic object in the string. if(cstr[i+1] == '^'){ @@ -404,8 +407,11 @@ BiPoly BiPoly::getbipoly(string s){ P += R; else if(cstr[oind + 1] == '-') P -= R; - else + else{ +#ifdef CGAL_CORE_TRACE std::cout << "ERROR IN PARSING BIPOLY! " << std::endl; +#endif + } } return P; @@ -1337,7 +1343,11 @@ cout <<"Number of roots at " << xCurr << " are " << numRoots< Polynomial::getpoly(string & s){ P += R; else if(cstr[oind + 1] == '-') P -= R; - else + else{ +#ifdef CGAL_CORE_TRACE std::cout << "ERROR IN PARSING POLY! " << std::endl; +#endif + } } return (P); @@ -677,8 +682,7 @@ Polynomial Polynomial::pseudoRemainder ( tmpB.contract(); // local copy of B C = NT(1); // Initialized to C=1. if (B.degree == -1) { - std::cout << "ERROR in Polynomial::pseudoRemainder :\n" << - " -- divide by zero polynomial" << std::endl; + core_error("ERROR in Polynomial::pseudoRemainder :\n -- divide by zero polynomial", __FILE__, __LINE__, false); return Polynomial(0); // Unit Polynomial (arbitrary!) } if (B.degree > degree) { diff --git a/CGAL_ImageIO/archive/demo/CGALimageIO/CMakeLists.txt b/CGAL_ImageIO/archive/demo/CGALimageIO/CMakeLists.txt index b4f486f3c23..45e75e952bd 100644 --- a/CGAL_ImageIO/archive/demo/CGALimageIO/CMakeLists.txt +++ b/CGAL_ImageIO/archive/demo/CGALimageIO/CMakeLists.txt @@ -1,6 +1,9 @@ project(CGALimageIO_Demo) cmake_minimum_required(VERSION 2.8.11) +if(POLICY CMP0053) + cmake_policy(SET CMP0053 OLD) +endif() if(POLICY CMP0043) cmake_policy(SET CMP0043 OLD) endif() diff --git a/CGAL_ipelets/demo/CGAL_ipelets/CMakeLists.txt b/CGAL_ipelets/demo/CGAL_ipelets/CMakeLists.txt index 2bbc2546642..f4a09f16191 100644 --- a/CGAL_ipelets/demo/CGAL_ipelets/CMakeLists.txt +++ b/CGAL_ipelets/demo/CGAL_ipelets/CMakeLists.txt @@ -1,6 +1,9 @@ project(CGAL_ipelets_Demo) cmake_minimum_required(VERSION 3.1) +if(POLICY CMP0053) + cmake_policy(SET CMP0053 OLD) +endif() if(POLICY CMP0043) cmake_policy(SET CMP0043 OLD) endif() diff --git a/CGAL_ipelets/examples/CGAL_ipelets/test_grabbers.cpp b/CGAL_ipelets/examples/CGAL_ipelets/test_grabbers.cpp index 1a1e37b8657..f9dbb4e7578 100644 --- a/CGAL_ipelets/examples/CGAL_ipelets/test_grabbers.cpp +++ b/CGAL_ipelets/examples/CGAL_ipelets/test_grabbers.cpp @@ -3,9 +3,6 @@ #include #include #include -#include - - #include typedef CGAL::Simple_cartesian Kernel; diff --git a/CGAL_ipelets/include/CGAL/CGAL_Ipelet_base_v6.h b/CGAL_ipelets/include/CGAL/CGAL_Ipelet_base_v6.h index 4c58308facb..75394e3baa7 100644 --- a/CGAL_ipelets/include/CGAL/CGAL_Ipelet_base_v6.h +++ b/CGAL_ipelets/include/CGAL/CGAL_Ipelet_base_v6.h @@ -29,7 +29,6 @@ typedef unsigned int uint; #include #include -#include #include #include #include diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Weighted_point_2.h b/Cartesian_kernel/include/CGAL/Cartesian/Weighted_point_2.h index c277488be7e..f6bea855929 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Weighted_point_2.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Weighted_point_2.h @@ -1,9 +1,9 @@ -// Copyright (c) 1999, 2016 +// Copyright (c) 1999, 2016 // Utrecht University (The Netherlands), // ETH Zurich (Switzerland), // INRIA Sophia-Antipolis (France), // Max-Planck-Institute Saarbruecken (Germany), -// and Tel-Aviv University (Israel). All rights reserved. +// and Tel-Aviv University (Israel). All rights reserved. // // This file is part of CGAL (www.cgal.org); you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public License as @@ -18,7 +18,6 @@ // // $URL$ // $Id$ -// // // Author(s) : Mariette Yvinec // Sylvain Pion @@ -26,28 +25,34 @@ #ifndef CGAL_CARTESIAN_WEIGHTED_POINT_2_H #define CGAL_CARTESIAN_WEIGHTED_POINT_2_H -#include +#include +#include + #include +#include + namespace CGAL { template < class R_ > class Weighted_pointC2 { - typedef typename R_::Point_2 Point_2; - typedef typename R_::FT FT; - typedef typename R_::FT Weight; - typedef boost::tuple Rep; + typedef typename R_::Point_2 Point_2; + typedef typename R_::FT FT; + typedef FT Weight; + + typedef boost::tuple Rep; typedef typename R_::template Handle::type Base; Base base; public: - Weighted_pointC2 () {} - //explicit + Weighted_pointC2(const Origin &o) + : base(o, 0) {} + Weighted_pointC2 (const Point_2 &p) : base(p,0) {} @@ -56,31 +61,27 @@ public: : base(p,w) {} - // Constructors from coordinates are also provided for convenience, except // that they are only from Cartesian coordinates, and with no weight, so as // to avoid any potential ambiguity between the homogeneous weight and the - // power weight (it should be easy enough to pass a Point explicitly in those + // power weight (it should be easy enough to pass a Point_2 explicitly in those // cases). - Weighted_pointC2(const FT& x, const FT& y) - : base(Point_2(x,y),0) + Weighted_pointC2 (const FT& x, const FT& y) + : base(Point_2(x,y), 0) {} const Point_2 & point() const { - return get_pointee_or_identity(base).template get<0>(); + return get_pointee_or_identity(base).template get<0>(); } const Weight & weight() const { - return get_pointee_or_identity(base).template get<1>(); + return get_pointee_or_identity(base).template get<1>(); } - - }; - template < class R_ > std::ostream & operator<<(std::ostream &os, const Weighted_pointC2 &p) @@ -94,7 +95,7 @@ operator<<(std::ostream &os, const Weighted_pointC2 &p) write(os, p.weight()); return os; default: - return os << "Weighted_point(" << p.point() << ", " << p.weight() << ")"; + return os << "Weighted_point_2(" << p.point() << ", " << p.weight() << ")"; } } @@ -103,7 +104,7 @@ std::istream & operator>>(std::istream &is, Weighted_pointC2 &wp) { typename Weighted_pointC2::Weight w; - typename Weighted_pointC2::Point p; + typename Weighted_pointC2::Point_2 p; is >> p; if(!is) return is; if(is_ascii(is)) diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Weighted_point_3.h b/Cartesian_kernel/include/CGAL/Cartesian/Weighted_point_3.h index a9e9505181d..847177367ee 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Weighted_point_3.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Weighted_point_3.h @@ -1,9 +1,9 @@ -// Copyright (c) 1999,2016 +// Copyright (c) 1999,2016 // Utrecht University (The Netherlands), // ETH Zurich (Switzerland), // INRIA Sophia-Antipolis (France), // Max-Planck-Institute Saarbruecken (Germany), -// and Tel-Aviv University (Israel). All rights reserved. +// and Tel-Aviv University (Israel). All rights reserved. // // This file is part of CGAL (www.cgal.org); you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public License as @@ -18,7 +18,6 @@ // // $URL$ // $Id$ -// // // Author(s) : Mariette Yvinec // Sylvain Pion @@ -26,31 +25,34 @@ #ifndef CGAL_CARTESIAN_WEIGHTED_POINT_3_H #define CGAL_CARTESIAN_WEIGHTED_POINT_3_H -#include +#include +#include + #include +#include + namespace CGAL { template < class R_ > class Weighted_pointC3 { - typedef typename R_::Point_3 Point_3; + typedef typename R_::Point_3 Point_3; + typedef typename R_::FT FT; + typedef FT Weight; - typedef typename R_::FT FT; - typedef FT Weight; - typedef boost::tuple Rep; + typedef boost::tuple Rep; typedef typename R_::template Handle::type Base; Base base; public: - - - Weighted_pointC3 () {} - //explicit + Weighted_pointC3(const Origin &o) + : base(o,0) {} + Weighted_pointC3 (const Point_3 &p) : base(p,0) {} @@ -59,15 +61,12 @@ public: : base(p,w) {} - // Constructors from coordinates are also provided for convenience, except // that they are only from Cartesian coordinates, and with no weight, so as // to avoid any potential ambiguity between the homogeneous weight and the // power weight (it should be easy enough to pass a Point_3 explicitly in those // cases). - - Weighted_pointC3 (const FT &x, const FT &y, const FT &z) : base(Point_3(x, y, z), 0) {} @@ -81,10 +80,8 @@ public: { return get_pointee_or_identity(base).template get<1>(); } - }; - template < class R_ > std::ostream & operator<<(std::ostream &os, const Weighted_pointC3 &p) diff --git a/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h b/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h index 22598ec283d..0a67eb67e03 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h @@ -96,6 +96,13 @@ namespace CartesianKernelFunctors { r.x(), r.y(), r.z(), s.x(), s.y(), s.z()); } + + result_type + operator()(const Point_3& p, const Point_3& q, + const Point_3& r, const Vector_3& n) const + { + return enum_cast(orientation(p,q,r,r+n)); + } }; template @@ -507,8 +514,6 @@ namespace CartesianKernelFunctors { } }; - - template < typename K > class Compare_power_distance_2 { @@ -517,11 +522,11 @@ namespace CartesianKernelFunctors { typedef typename K::Point_2 Point_2; typedef typename K::Comparison_result Comparison_result; - typedef Comparison_result result_type; + typedef Comparison_result result_type; Comparison_result operator()(const Point_2& r, - const Weighted_point_2& q, - const Weighted_point_2& p) const + const Weighted_point_2& p, + const Weighted_point_2& q) const { return CGAL::compare_power_distanceC2(p.x(), p.y(), p.weight(), q.x(), q.y(), q.weight(), @@ -529,7 +534,6 @@ namespace CartesianKernelFunctors { } }; - template class Compare_squared_radius_3 { @@ -1726,7 +1730,6 @@ namespace CartesianKernelFunctors { }; - template class Construct_base_vector_3 { @@ -1760,8 +1763,21 @@ namespace CartesianKernelFunctors { if ( CGAL_NTS is_zero(h.c()) ) // parallel to z-axis return Vector_3(FT(0), FT(0), FT(1)); - - return Vector_3(-h.b(), h.a(), FT(0)); + + FT a = CGAL::abs(h.a()), + b = CGAL::abs(h.b()), + c = CGAL::abs(h.c()); + + // to avoid badly defined vectors with coordinates all close + // to 0 when the plane is almost horizontal, we ignore the + // smallest coordinate instead of always ignoring Z + if (CGAL::possibly(a <= b && a <= c)) + return Vector_3(FT(0), -h.c(), h.b()); + + if (CGAL::possibly(b <= a && b <= c)) + return Vector_3(-h.c(), FT(0), h.a()); + + return Vector_3(-h.b(), h.a(), FT(0)); } else { return cp(co(h), this->operator()(h,1)); } @@ -3051,40 +3067,87 @@ namespace CartesianKernelFunctors { template class Construct_weighted_point_2 { - typedef typename K::RT RT; - typedef typename K::Point_2 Point_2; - typedef typename K::Weighted_point_2 Weighted_point_2; + typedef typename K::FT FT; + typedef typename K::Point_2 Point_2; + typedef typename K::Weighted_point_2 Weighted_point_2; typedef typename Weighted_point_2::Rep Rep; public: - typedef Weighted_point_2 result_type; + typedef Weighted_point_2 result_type; Rep - operator()(Return_base_tag, const Point_2& p, const RT& w) const + operator()(Return_base_tag, Origin o) const + { return Rep(o); } + + Rep + operator()(Return_base_tag, const Point_2& p, const FT& w) const { return Rep(p,w); } Rep - operator()(Return_base_tag, const RT& x, const RT& y) const + operator()(Return_base_tag, const FT& x, const FT& y) const { return Rep(x,y); } + + Weighted_point_2 + operator()(Origin o) const + { return Weighted_point_2(o); } + + Weighted_point_2 + operator()(const Point_2& p, const FT& w) const + { return Weighted_point_2(p,w); } + + Weighted_point_2 + operator()(const FT& x, const FT& y) const + { return Weighted_point_2(x, y); } + + Weighted_point_2 + operator()(const Point_2& p) const + { return Weighted_point_2(p,0); } + + const Weighted_point_2& + operator()(const Weighted_point_2 & wp) const + { return wp; } }; template class Construct_weighted_point_3 { - typedef typename K::RT RT; - typedef typename K::FT FT; - typedef typename K::Point_3 Point_3; - typedef typename K::Weighted_point_3 Weighted_point_3; + typedef typename K::FT FT; + typedef typename K::Point_3 Point_3; + typedef typename K::Weighted_point_3 Weighted_point_3; typedef typename Weighted_point_3::Rep Rep; public: - typedef Weighted_point_3 result_type; + typedef Weighted_point_3 result_type; Rep - operator()(Return_base_tag, const Point_3& p, const RT& w) const + operator()(Return_base_tag, Origin o) const + { return Rep(o); } + + Rep + operator()(Return_base_tag, const Point_3& p, const FT& w) const { return Rep(p,w); } Rep operator()(Return_base_tag, const FT& x, const FT& y, const FT& z) const { return Rep(x,y,z); } + + Weighted_point_3 + operator()(Origin o) const + { return Weighted_point_3(o); } + + Weighted_point_3 + operator()(const Point_3& p, const FT& w) const + { return Rep(p,w); } + + Weighted_point_3 + operator()(const FT& x, const FT& y, const FT& z) const + { return Weighted_point_3(x,y,z); } + + Weighted_point_3 + operator()(const Point_3& p) const + { return Weighted_point_3(p,0); } + + const Weighted_point_3& + operator()(const Weighted_point_3& wp) const + { return wp; } }; @@ -4078,89 +4141,50 @@ namespace CartesianKernelFunctors { } }; -template < typename K > -class Power_side_of_oriented_power_sphere_3 -{ -public: - typedef typename K::Weighted_point_3 Weighted_point_3; - typedef typename K::Oriented_side Oriented_side; - typedef Oriented_side result_type; + template < typename K > + class Power_side_of_oriented_power_circle_2 + { + public: + typedef typename K::Weighted_point_2 Weighted_point_2; + typedef typename K::Oriented_side Oriented_side; - Oriented_side operator() ( const Weighted_point_3 & p, - const Weighted_point_3 & q, - const Weighted_point_3 & r, - const Weighted_point_3 & s, - const Weighted_point_3 & t) const - { - return power_side_of_oriented_power_sphereC3(p.x(), p.y(), p.z(), p.weight(), - q.x(), q.y(), q.z(), q.weight(), - r.x(), r.y(), r.z(), r.weight(), - s.x(), s.y(), s.z(), s.weight(), - t.x(), t.y(), t.z(), t.weight()); - } + typedef Oriented_side result_type; - Oriented_side operator() ( const Weighted_point_3 & p, - const Weighted_point_3 & q, - const Weighted_point_3 & r, - const Weighted_point_3 & s) const - { - return power_side_of_oriented_power_sphereC3(p.x(), p.y(), p.z(), p.weight(), - q.x(), q.y(), q.z(), q.weight(), - r.x(), r.y(), r.z(), r.weight(), - s.x(), s.y(), s.z(), s.weight()); - } - - Oriented_side operator() ( const Weighted_point_3 & p, - const Weighted_point_3 & q, - const Weighted_point_3 & r) const - { - return power_side_of_oriented_power_sphereC3(p.x(), p.y(), p.z(), p.weight(), - q.x(), q.y(), q.z(), q.weight(), - r.x(), r.y(), r.z(), r.weight()); - } - - Oriented_side operator() ( const Weighted_point_3 & p, - const Weighted_point_3 & q) const - { - return power_side_of_oriented_power_sphereC3(p.weight(),q.weight()); - } -}; - - -template < typename K > -class Power_side_of_oriented_power_circle_2 -{ -public: - typedef typename K::Weighted_point_2 Weighted_point_2; - typedef typename K::Oriented_side Oriented_side; - - typedef Oriented_side result_type; - - Oriented_side operator() ( const Weighted_point_2 & p, - const Weighted_point_2 & q, - const Weighted_point_2 & r, - const Weighted_point_2 & t) const + Oriented_side operator()(const Weighted_point_2& p, + const Weighted_point_2& q, + const Weighted_point_2& r, + const Weighted_point_2& t) const { //CGAL_kernel_precondition( ! collinear(p, q, r) ); return power_side_of_oriented_power_circleC2(p.x(), p.y(), p.weight(), - q.x(), q.y(), q.weight(), - r.x(), r.y(), r.weight(), - t.x(), t.y(), t.weight()); + q.x(), q.y(), q.weight(), + r.x(), r.y(), r.weight(), + t.x(), t.y(), t.weight()); } - Oriented_side operator() ( const Weighted_point_2 & p, - const Weighted_point_2 & q, - const Weighted_point_2 & t) const + // The methods below are currently undocumented because the definition of + // orientation is unclear for 2 and 1 point configurations in a 2D space. + + // One should be (very) careful with the order of vertices when using them, + // as swapping points will change the result and one must therefore have a + // precise idea of what is the positive orientation in the full space. + // For example, these functions are (currently) used safely in the regular + // triangulations classes because we always call them on vertices of + // triangulation cells, which are always positively oriented. + + Oriented_side operator()(const Weighted_point_2& p, + const Weighted_point_2& q, + const Weighted_point_2& t) const { //CGAL_kernel_precondition( collinear(p, q, r) ); //CGAL_kernel_precondition( p.point() != q.point() ); return power_side_of_oriented_power_circleC2(p.point().x(), p.y(), p.weight(), - q.x(), q.y(), q.weight(), - t.x(), t.y(), t.weight()); - } + q.x(), q.y(), q.weight(), + t.x(), t.y(), t.weight()); + } - Oriented_side operator() ( const Weighted_point_2 & p, - const Weighted_point_2 & t) const + Oriented_side operator()(const Weighted_point_2& p, + const Weighted_point_2& t) const { //CGAL_kernel_precondition( p.point() == r.point() ); Comparison_result r = CGAL::compare(p.weight(), t.weight()); @@ -4168,7 +4192,7 @@ public: else if (r == SMALLER) return ON_POSITIVE_SIDE; return ON_ORIENTED_BOUNDARY; } -}; + }; template class Oriented_side_2 diff --git a/Cartesian_kernel/include/CGAL/constructions/kernel_ftC2.h b/Cartesian_kernel/include/CGAL/constructions/kernel_ftC2.h index bc7e134ceef..20401e3e734 100644 --- a/Cartesian_kernel/include/CGAL/constructions/kernel_ftC2.h +++ b/Cartesian_kernel/include/CGAL/constructions/kernel_ftC2.h @@ -418,12 +418,11 @@ scaled_distance_to_lineC2( const FT &px, const FT &py, return determinant(px-rx, py-ry, qx-rx, qy-ry); } - template < class RT > void weighted_circumcenter_translateC2(const RT &dqx, const RT &dqy, const RT &dqw, - const RT &drx, const RT &dry, const RT &drw, - RT &dcx, RT &dcy) + const RT &drx, const RT &dry, const RT &drw, + RT &dcx, RT &dcy) { // Given 3 points P, Q, R, this function takes as input: // qx-px, qy-py,qw-pw, rx-px, ry-py, rw-pw. And returns cx-px, cy-py, @@ -449,33 +448,76 @@ weighted_circumcenter_translateC2(const RT &dqx, const RT &dqy, const RT &dqw, template < class RT, class We> void weighted_circumcenterC2( const RT &px, const RT &py, const We &pw, - const RT &qx, const RT &qy, const We &qw, - const RT &rx, const RT &ry, const We &rw, - RT &x, RT &y ) + const RT &qx, const RT &qy, const We &qw, + const RT &rx, const RT &ry, const We &rw, + RT &x, RT &y ) { RT dqw = RT(qw-pw); RT drw = RT(rw-pw); - + weighted_circumcenter_translateC2(qx-px, qy-py, dqw,rx-px, ry-py,drw,x, y); x += px; y += py; } +template< class FT > +FT +power_productC2(const FT &px, const FT &py, const FT &pw, + const FT &qx, const FT &qy, const FT &qw) +{ + // computes the power product of two weighted points + FT qpx = qx - px; + FT qpy = qy - py; + FT qp2 = CGAL_NTS square(qpx) + CGAL_NTS square(qpy); + return qp2 - pw - qw; +} template < class RT , class We> void radical_axisC2(const RT &px, const RT &py, const We &pw, - const RT &qx, const RT &qy, const We &qw, - RT &a, RT &b, RT& c ) + const RT &qx, const RT &qy, const We &qw, + RT &a, RT &b, RT& c ) { a = RT(2)*(px - qx); b = RT(2)*(py - qy); - c = - CGAL_NTS square(px) - CGAL_NTS square(py) - + CGAL_NTS square(qx) + CGAL_NTS square(qy) - +RT(pw) - RT(qw); + c = - CGAL_NTS square(px) - CGAL_NTS square(py) + + CGAL_NTS square(qx) + CGAL_NTS square(qy) + + RT(pw) - RT(qw); } +template< class FT > +CGAL_KERNEL_MEDIUM_INLINE +FT +squared_radius_orthogonal_circleC2(const FT &px, const FT &py, const FT &pw, + const FT &qx, const FT &qy, const FT &qw, + const FT &rx, const FT &ry, const FT &rw) +{ + FT FT4(4); + FT dpx = px - rx; + FT dpy = py - ry; + FT dqx = qx - rx; + FT dqy = qy - ry; + FT dpp = CGAL_NTS square(dpx) + CGAL_NTS square(dpy) - pw + rw; + FT dqq = CGAL_NTS square(dqx) + CGAL_NTS square(dqy) - qw + rw; + FT det0 = determinant(dpx, dpy, dqx, dqy); + FT det1 = determinant(dpp, dpy, dqq, dqy); + FT det2 = determinant(dpx, dpp, dqx, dqq); + + return (CGAL_NTS square(det1) + CGAL_NTS square(det2)) / + (FT4 * CGAL_NTS square(det0)) - rw; +} + +template< class FT > +CGAL_KERNEL_MEDIUM_INLINE +FT +squared_radius_smallest_orthogonal_circleC2(const FT &px, const FT &py, const FT &pw, + const FT &qx, const FT &qy, const FT &qw) +{ + FT FT4(4); + FT dpz = CGAL_NTS square(px - qx) + CGAL_NTS square(py - qy); + return (CGAL_NTS square(dpz - pw + qw) / (FT4 * dpz) - qw); +} } //namespace CGAL diff --git a/Cartesian_kernel/include/CGAL/constructions/kernel_ftC3.h b/Cartesian_kernel/include/CGAL/constructions/kernel_ftC3.h index 46f5dd16a7e..456d0109820 100644 --- a/Cartesian_kernel/include/CGAL/constructions/kernel_ftC3.h +++ b/Cartesian_kernel/include/CGAL/constructions/kernel_ftC3.h @@ -1,4 +1,4 @@ -// Copyright (c) 2000 +// Copyright (c) 2000 // Utrecht University (The Netherlands), // ETH Zurich (Switzerland), // INRIA Sophia-Antipolis (France), @@ -403,113 +403,109 @@ squared_areaC3(const FT &px, const FT &py, const FT &pz, return (CGAL_NTS square(vx) + CGAL_NTS square(vy) + CGAL_NTS square(vz))/4; } - template void determinants_for_weighted_circumcenterC3( - const FT &px, const FT &py, const FT &pz, const FT &pw, - const FT &qx, const FT &qy, const FT &qz, const FT &qw, - const FT &rx, const FT &ry, const FT &rz, const FT &rw, - const FT &sx, const FT &sy, const FT &sz, const FT &sw, - FT &num_x, FT &num_y, FT &num_z, FT& den) + const FT &px, const FT &py, const FT &pz, const FT &pw, + const FT &qx, const FT &qy, const FT &qz, const FT &qw, + const FT &rx, const FT &ry, const FT &rz, const FT &rw, + const FT &sx, const FT &sy, const FT &sz, const FT &sw, + FT &num_x, FT &num_y, FT &num_z, FT& den) { // translate origin to p // and compute determinants for weighted_circumcenter and // circumradius - FT qpx = qx-px; - FT qpy = qy-py; - FT qpz = qz-pz; + FT qpx = qx - px; + FT qpy = qy - py; + FT qpz = qz - pz; FT qp2 = CGAL_NTS square(qpx) + CGAL_NTS square(qpy) + CGAL_NTS square(qpz) - qw + pw; - FT rpx = rx-px; - FT rpy = ry-py; - FT rpz = rz-pz; + FT rpx = rx - px; + FT rpy = ry - py; + FT rpz = rz - pz; FT rp2 = CGAL_NTS square(rpx) + CGAL_NTS square(rpy) + CGAL_NTS square(rpz) - rw + pw; - FT spx = sx-px; - FT spy = sy-py; - FT spz = sz-pz; + FT spx = sx - px; + FT spy = sy - py; + FT spz = sz - pz; FT sp2 = CGAL_NTS square(spx) + CGAL_NTS square(spy) + CGAL_NTS square(spz) - sw + pw; num_x = determinant(qpy,qpz,qp2, - rpy,rpz,rp2, - spy,spz,sp2); + rpy,rpz,rp2, + spy,spz,sp2); num_y = determinant(qpx,qpz,qp2, - rpx,rpz,rp2, - spx,spz,sp2); + rpx,rpz,rp2, + spx,spz,sp2); num_z = determinant(qpx,qpy,qp2, - rpx,rpy,rp2, - spx,spy,sp2); + rpx,rpy,rp2, + spx,spy,sp2); den = determinant(qpx,qpy,qpz, - rpx,rpy,rpz, - spx,spy,spz); + rpx,rpy,rpz, + spx,spy,spz); } template void -determinants_for_circumcenterC3( - const FT &px, const FT &py, const FT &pz, - const FT &qx, const FT &qy, const FT &qz, - const FT &rx, const FT &ry, const FT &rz, - const FT &sx, const FT &sy, const FT &sz, - FT &num_x, FT &num_y, FT &num_z, FT& den) +determinants_for_circumcenterC3(const FT &px, const FT &py, const FT &pz, + const FT &qx, const FT &qy, const FT &qz, + const FT &rx, const FT &ry, const FT &rz, + const FT &sx, const FT &sy, const FT &sz, + FT &num_x, FT &num_y, FT &num_z, FT& den) { // translate origin to p // and compute determinants for weighted_circumcenter and // circumradius - FT qpx = qx-px; - FT qpy = qy-py; - FT qpz = qz-pz; + FT qpx = qx - px; + FT qpy = qy - py; + FT qpz = qz - pz; FT qp2 = CGAL_NTS square(qpx) + CGAL_NTS square(qpy) + CGAL_NTS square(qpz); - FT rpx = rx-px; - FT rpy = ry-py; - FT rpz = rz-pz; + FT rpx = rx - px; + FT rpy = ry - py; + FT rpz = rz - pz; FT rp2 = CGAL_NTS square(rpx) + CGAL_NTS square(rpy) + CGAL_NTS square(rpz); - FT spx = sx-px; - FT spy = sy-py; - FT spz = sz-pz; + FT spx = sx - px; + FT spy = sy - py; + FT spz = sz - pz; FT sp2 = CGAL_NTS square(spx) + CGAL_NTS square(spy) + CGAL_NTS square(spz); num_x = determinant(qpy,qpz,qp2, - rpy,rpz,rp2, - spy,spz,sp2); + rpy,rpz,rp2, + spy,spz,sp2); num_y = determinant(qpx,qpz,qp2, - rpx,rpz,rp2, - spx,spz,sp2); + rpx,rpz,rp2, + spx,spz,sp2); num_z = determinant(qpx,qpy,qp2, - rpx,rpy,rp2, - spx,spy,sp2); + rpx,rpy,rp2, + spx,spy,sp2); den = determinant(qpx,qpy,qpz, - rpx,rpy,rpz, - spx,spy,spz); + rpx,rpy,rpz, + spx,spy,spz); } - template < class FT> void -weighted_circumcenterC3( - const FT &px, const FT &py, const FT &pz, const FT &pw, - const FT &qx, const FT &qy, const FT &qz, const FT &qw, - const FT &rx, const FT &ry, const FT &rz, const FT &rw, - const FT &sx, const FT &sy, const FT &sz, const FT &sw, - FT &x, FT &y, FT &z) +weighted_circumcenterC3(const FT &px, const FT &py, const FT &pz, const FT &pw, + const FT &qx, const FT &qy, const FT &qz, const FT &qw, + const FT &rx, const FT &ry, const FT &rz, const FT &rw, + const FT &sx, const FT &sy, const FT &sz, const FT &sw, + FT &x, FT &y, FT &z) { - // this function compute the weighted circumcenter point only + // this function computes the weighted circumcenter point only // Translate p to origin and compute determinants FT num_x, num_y, num_z, den; determinants_for_weighted_circumcenterC3(px, py, pz, pw, - qx, qy, qz, qw, - rx, ry, rz, rw, - sx, sy, sz, sw, - num_x, num_y, num_z,den); + qx, qy, qz, qw, + rx, ry, rz, rw, + sx, sy, sz, sw, + num_x, num_y, num_z,den); CGAL_assertion( ! CGAL_NTS is_zero(den) ); - FT inv = FT(1)/(FT(2) * den); + FT inv = FT(1)/(FT(2) * den); x = px + num_x*inv; y = py - num_y*inv; @@ -518,248 +514,231 @@ weighted_circumcenterC3( template < class FT> void -weighted_circumcenterC3( - const FT &px, const FT &py, const FT &pz, const FT &pw, - const FT &qx, const FT &qy, const FT &qz, const FT &qw, - const FT &rx, const FT &ry, const FT &rz, const FT &rw, - const FT &sx, const FT &sy, const FT &sz, const FT &sw, - FT &x, FT &y, FT &z, FT &w) +weighted_circumcenterC3(const FT &px, const FT &py, const FT &pz, const FT &pw, + const FT &qx, const FT &qy, const FT &qz, const FT &qw, + const FT &rx, const FT &ry, const FT &rz, const FT &rw, + const FT &sx, const FT &sy, const FT &sz, const FT &sw, + FT &x, FT &y, FT &z, FT &w) { - // this function compute the weighted circumcenter point + // this function computes the weighted circumcenter point // and the squared weighted circumradius // Translate p to origin and compute determinants FT num_x, num_y, num_z, den; determinants_for_weighted_circumcenterC3(px, py, pz, pw, - qx, qy, qz, qw, - rx, ry, rz, rw, - sx, sy, sz, sw, - num_x, num_y, num_z, den); + qx, qy, qz, qw, + rx, ry, rz, rw, + sx, sy, sz, sw, + num_x, num_y, num_z, den); CGAL_assertion( ! CGAL_NTS is_zero(den) ); - FT inv = FT(1)/(FT(2) * den); + FT inv = FT(1)/(FT(2) * den); x = px + num_x*inv; y = py - num_y*inv; z = pz + num_z*inv; - w = (CGAL_NTS square(num_x)+CGAL_NTS square(num_y)+CGAL_NTS square(num_z)) - *CGAL_NTS square(inv) - pw; + w = (CGAL_NTS square(num_x) + CGAL_NTS square(num_y) + CGAL_NTS square(num_z)) + * CGAL_NTS square(inv) - pw; } - template< class FT > FT squared_radius_orthogonal_sphereC3( - const FT &px, const FT &py, const FT &pz, const FT &pw, - const FT &qx, const FT &qy, const FT &qz, const FT &qw, - const FT &rx, const FT &ry, const FT &rz, const FT &rw, - const FT &sx, const FT &sy, const FT &sz, const FT &sw) + const FT &px, const FT &py, const FT &pz, const FT &pw, + const FT &qx, const FT &qy, const FT &qz, const FT &qw, + const FT &rx, const FT &ry, const FT &rz, const FT &rw, + const FT &sx, const FT &sy, const FT &sz, const FT &sw) { - - // this function compute the squared weighted circumradius only + // this function computes the squared weighted circumradius only // Translate p to origin and compute determinants FT num_x, num_y, num_z, den; determinants_for_weighted_circumcenterC3(px, py, pz, pw, - qx, qy, qz, qw, - rx, ry, rz, rw, - sx, sy, sz, sw, - num_x, num_y, num_z,den); + qx, qy, qz, qw, + rx, ry, rz, rw, + sx, sy, sz, sw, + num_x, num_y, num_z,den); CGAL_assertion( ! CGAL_NTS is_zero(den) ); - FT inv = FT(1)/(FT(2) * den); + FT inv = FT(1)/(FT(2) * den); - return - (CGAL_NTS square(num_x)+CGAL_NTS square(num_y)+CGAL_NTS square(num_z)) - *CGAL_NTS square(inv) - pw; + return (CGAL_NTS square(num_x) + CGAL_NTS square(num_y) + CGAL_NTS square(num_z)) + * CGAL_NTS square(inv) - pw; } - template void determinants_for_weighted_circumcenterC3( - const FT &px, const FT &py, const FT &pz, const FT &pw, - const FT &qx, const FT &qy, const FT &qz, const FT &qw, - const FT &rx, const FT &ry, const FT &rz, const FT &rw, - FT &num_x, FT &num_y, FT &num_z, FT &den) + const FT &px, const FT &py, const FT &pz, const FT &pw, + const FT &qx, const FT &qy, const FT &qz, const FT &qw, + const FT &rx, const FT &ry, const FT &rz, const FT &rw, + FT &num_x, FT &num_y, FT &num_z, FT &den) { - // translate origin to p - // and compute determinants for weighted_circumcenter and - // circumradius + // translate origin to p and compute determinants for weighted_circumcenter + // and circumradius // Translate s to origin to simplify the expression. - FT qpx = qx-px; - FT qpy = qy-py; - FT qpz = qz-pz; + FT qpx = qx - px; + FT qpy = qy - py; + FT qpz = qz - pz; FT qp2 = CGAL_NTS square(qpx) + CGAL_NTS square(qpy) + CGAL_NTS square(qpz) - qw + pw; - FT rpx = rx-px; - FT rpy = ry-py; - FT rpz = rz-pz; + FT rpx = rx - px; + FT rpy = ry - py; + FT rpz = rz - pz; FT rp2 = CGAL_NTS square(rpx) + CGAL_NTS square(rpy) + CGAL_NTS square(rpz) - rw + pw; - FT sx = qpy*rpz-qpz*rpy; - FT sy = qpz*rpx-qpx*rpz; - FT sz = qpx*rpy-qpy*rpx; + FT sx = qpy*rpz - qpz*rpy; + FT sy = qpz*rpx - qpx*rpz; + FT sz = qpx*rpy - qpy*rpx; // The following determinants can be developped and simplified. - // - // FT num_x = determinant(qpy,qpz,qp2, - // rpy,rpz,rp2, - // sy,sz,FT(0)); - // FT num_y = determinant(qpx,qpz,qp2, - // rpx,rpz,rp2, - // sx,sz,FT(0)); - // FT num_z = determinant(qpx,qpy,qp2, - // rpx,rpy,rp2, - // sx,sy,FT(0)); +// +// FT num_x = determinant(qpy,qpz,qp2, +// rpy,rpz,rp2, +// sy,sz,FT(0)); +// FT num_y = determinant(qpx,qpz,qp2, +// rpx,rpz,rp2, +// sx,sz,FT(0)); +// FT num_z = determinant(qpx,qpy,qp2, +// rpx,rpy,rp2, +// sx,sy,FT(0)); num_x = qp2 * determinant(rpy,rpz,sy,sz) - - rp2 * determinant(qpy,qpz,sy,sz); + - rp2 * determinant(qpy,qpz,sy,sz); num_y = qp2 * determinant(rpx,rpz,sx,sz) - - rp2 * determinant(qpx,qpz,sx,sz); + - rp2 * determinant(qpx,qpz,sx,sz); num_z = qp2 * determinant(rpx,rpy,sx,sy) - - rp2 * determinant(qpx,qpy,sx,sy); + - rp2 * determinant(qpx,qpy,sx,sy); den = determinant(qpx,qpy,qpz, - rpx,rpy,rpz, - sx,sy,sz); + rpx,rpy,rpz, + sx,sy,sz); } template < class FT > void -weighted_circumcenterC3( - const FT &px, const FT &py, const FT &pz, const FT &pw, - const FT &qx, const FT &qy, const FT &qz, const FT &qw, - const FT &rx, const FT &ry, const FT &rz, const FT &rw, - FT &x, FT &y, FT &z) +weighted_circumcenterC3(const FT &px, const FT &py, const FT &pz, const FT &pw, + const FT &qx, const FT &qy, const FT &qz, const FT &qw, + const FT &rx, const FT &ry, const FT &rz, const FT &rw, + FT &x, FT &y, FT &z) { - // this function compute the weighted circumcenter point only + // this function computes the weighted circumcenter point only -// Translate p to origin and compute determinants + // Translate p to origin and compute determinants FT num_x, num_y, num_z, den; determinants_for_weighted_circumcenterC3(px, py, pz, pw, - qx, qy, qz, qw, - rx, ry, rz, rw, - num_x, num_y, num_z, den); + qx, qy, qz, qw, + rx, ry, rz, rw, + num_x, num_y, num_z, den); CGAL_assertion( den != FT(0) ); - FT inv = FT(1)/(FT(2) * den); + FT inv = FT(1) / (FT(2) * den); x = px + num_x*inv; y = py - num_y*inv; z = pz + num_z*inv; } - template < class FT > void -weighted_circumcenterC3( - const FT &px, const FT &py, const FT &pz, const FT &pw, - const FT &qx, const FT &qy, const FT &qz, const FT &qw, - const FT &rx, const FT &ry, const FT &rz, const FT &rw, - FT &x, FT &y, FT &z, FT &w) +weighted_circumcenterC3(const FT &px, const FT &py, const FT &pz, const FT &pw, + const FT &qx, const FT &qy, const FT &qz, const FT &qw, + const FT &rx, const FT &ry, const FT &rz, const FT &rw, + FT &x, FT &y, FT &z, FT &w) { - // this function compute the weighted circumcenter and + // this function computes the weighted circumcenter and // the weighted squared circumradius -// Translate p to origin and compute determinants + // Translate p to origin and compute determinants FT num_x, num_y, num_z, den; determinants_for_weighted_circumcenterC3(px, py, pz, pw, - qx, qy, qz, qw, - rx, ry, rz, rw, - num_x, num_y, num_z, den); + qx, qy, qz, qw, + rx, ry, rz, rw, + num_x, num_y, num_z, den); CGAL_assertion( den != FT(0) ); - FT inv = FT(1)/(FT(2) * den); + FT inv = FT(1) / (FT(2) * den); x = px + num_x*inv; y = py - num_y*inv; z = pz + num_z*inv; - w = (CGAL_NTS square(num_x)+CGAL_NTS square(num_y)+CGAL_NTS square(num_z)) - *CGAL_NTS square(inv) - pw; + w = (CGAL_NTS square(num_x) + CGAL_NTS square(num_y) + CGAL_NTS square(num_z)) + *CGAL_NTS square(inv) - pw; } - template< class FT > CGAL_MEDIUM_INLINE FT squared_radius_smallest_orthogonal_sphereC3( - const FT &px, const FT &py, const FT &pz, const FT &pw, - const FT &qx, const FT &qy, const FT &qz, const FT &qw, - const FT &rx, const FT &ry, const FT &rz, const FT &rw) + const FT &px, const FT &py, const FT &pz, const FT &pw, + const FT &qx, const FT &qy, const FT &qz, const FT &qw, + const FT &rx, const FT &ry, const FT &rz, const FT &rw) { - // this function compute the weighted squared circumradius only + // this function computes the weighted squared circumradius only -// Translate p to origin and compute determinants + // Translate p to origin and compute determinants FT num_x, num_y, num_z, den; determinants_for_weighted_circumcenterC3(px, py, pz, pw, - qx, qy, qz, qw, - rx, ry, rz, rw, - num_x, num_y, num_z, den); + qx, qy, qz, qw, + rx, ry, rz, rw, + num_x, num_y, num_z, den); CGAL_assertion( den != FT(0) ); FT inv = FT(1)/(FT(2) * den); - return - (CGAL_NTS square(num_x)+CGAL_NTS square(num_y)+CGAL_NTS square(num_z)) - *CGAL_NTS square(inv) - pw; + return (CGAL_NTS square(num_x) + CGAL_NTS square(num_y) + CGAL_NTS square(num_z)) + * CGAL_NTS square(inv) - pw; } - - template < class FT > void -weighted_circumcenterC3( - const FT &px, const FT &py, const FT &pz, const FT &pw, - const FT &qx, const FT &qy, const FT &qz, const FT &qw, - FT &x, FT &y, FT &z) +weighted_circumcenterC3(const FT &px, const FT &py, const FT &pz, const FT &pw, + const FT &qx, const FT &qy, const FT &qz, const FT &qw, + FT &x, FT &y, FT &z) { -// this function compute the weighted circumcenter point only - FT qpx = qx-px; - FT qpy = qy-py; - FT qpz = qz-pz; +// this function computes the weighted circumcenter point only + FT qpx = qx - px; + FT qpy = qy - py; + FT qpz = qz - pz; FT qp2 = CGAL_NTS square(qpx) + CGAL_NTS square(qpy) + CGAL_NTS square(qpz); - FT inv = FT(1)/(FT(2)*qp2); - FT alpha = 1/FT(2) + (pw-qw)*inv; + FT inv = FT(1) / (FT(2) * qp2); + FT alpha = 1 / FT(2) + (pw-qw) * inv; x = px + alpha * qpx; y = py + alpha * qpy; z = pz + alpha * qpz; } - template < class FT > void -weighted_circumcenterC3( - const FT &px, const FT &py, const FT &pz, const FT &pw, - const FT &qx, const FT &qy, const FT &qz, const FT &qw, - FT &x, FT &y, FT &z, FT &w) +weighted_circumcenterC3(const FT &px, const FT &py, const FT &pz, const FT &pw, + const FT &qx, const FT &qy, const FT &qz, const FT &qw, + FT &x, FT &y, FT &z, FT &w) { - // this function compute the weighted circumcenter point and + // this function computes the weighted circumcenter point and // the weighted circumradius - FT qpx = qx-px; - FT qpy = qy-py; - FT qpz = qz-pz; + FT qpx = qx - px; + FT qpy = qy - py; + FT qpz = qz - pz; FT qp2 = CGAL_NTS square(qpx) + CGAL_NTS square(qpy) + CGAL_NTS square(qpz); - FT inv = FT(1)/(FT(2)*qp2); - FT alpha = 1/FT(2) + (pw-qw)*inv; + FT inv = FT(1) / (FT(2) * qp2); + FT alpha = 1 / FT(2) + (pw-qw) * inv; x = px + alpha * qpx; y = py + alpha * qpy; z = pz + alpha * qpz; - w = CGAL_NTS square(alpha)*qp2 - pw; + w = CGAL_NTS square(alpha) * qp2 - pw; } - template< class FT > CGAL_MEDIUM_INLINE FT @@ -767,30 +746,27 @@ squared_radius_smallest_orthogonal_sphereC3( const FT &px, const FT &py, const FT &pz, const FT &pw, const FT &qx, const FT &qy, const FT &qz, const FT &qw) { - // this function computes - // the weighted circumradius only - FT qpx = qx-px; - FT qpy = qy-py; - FT qpz = qz-pz; + // this function computes the weighted circumradius only + FT qpx = qx - px; + FT qpy = qy - py; + FT qpz = qz - pz; FT qp2 = CGAL_NTS square(qpx) + CGAL_NTS square(qpy) + CGAL_NTS square(qpz); - FT inv = FT(1)/(FT(2)*qp2); - FT alpha = 1/FT(2) + (pw-qw)*inv; + FT inv = FT(1) / (FT(2) * qp2); + FT alpha = 1 / FT(2) + (pw-qw) * inv; return CGAL_NTS square(alpha)*qp2 - pw; } - template< class FT > FT -power_productC3( - const FT &px, const FT &py, const FT &pz, const FT &pw, - const FT &qx, const FT &qy, const FT &qz, const FT &qw) +power_productC3(const FT &px, const FT &py, const FT &pz, const FT &pw, + const FT &qx, const FT &qy, const FT &qz, const FT &qw) { // computes the power product of two weighted points - FT qpx = qx-px; - FT qpy = qy-py; - FT qpz = qz-pz; + FT qpx = qx - px; + FT qpy = qy - py; + FT qpz = qz - pz; FT qp2 = CGAL_NTS square(qpx) + CGAL_NTS square(qpy) + CGAL_NTS square(qpz); return qp2 - pw - qw ; @@ -799,17 +775,17 @@ power_productC3( template < class RT , class We> void radical_axisC3(const RT &px, const RT &py, const RT &pz, const We & /* pw */, - const RT &qx, const RT &qy, const RT &qz, const We & /* qw */, - const RT &rx, const RT &ry, const RT &rz, const We & /* rw */, - RT &a, RT &b, RT& c ) + const RT &qx, const RT &qy, const RT &qz, const We & /* qw */, + const RT &rx, const RT &ry, const RT &rz, const We & /* rw */, + RT &a, RT &b, RT& c ) { RT dqx=qx-px, dqy=qy-py, dqz=qz-pz, drx=rx-px, dry=ry-py, drz=rz-pz; //il manque des tests... - a= RT(1)*determinant(dqy, dqz, dry, drz); - b= - RT(1)*determinant(dqx, dqz, drx, drz); - c= RT(1)*determinant(dqx, dqy, drx, dry); + a = RT(1)*determinant(dqy, dqz, dry, drz); + b = - RT(1)*determinant(dqx, dqz, drx, drz); + c = RT(1)*determinant(dqx, dqy, drx, dry); } // function used in critical_squared_radiusC3 @@ -817,77 +793,69 @@ radical_axisC3(const RT &px, const RT &py, const RT &pz, const We & /* pw */, // circle orthogonal (p,pw), (q,qw), (r,rw), (s,sw) template < class FT> FT -power_to_orthogonal_sphereC3( - const FT &px, const FT &py, const FT &pz, const FT &pw, - const FT &qx, const FT &qy, const FT &qz, const FT &qw, - const FT &rx, const FT &ry, const FT &rz, const FT &rw, - const FT &sx, const FT &sy, const FT &sz, const FT &sw, - const FT &tx, const FT &ty, const FT &tz, const FT &tw) +power_to_orthogonal_sphereC3(const FT &px, const FT &py, const FT &pz, const FT &pw, + const FT &qx, const FT &qy, const FT &qz, const FT &qw, + const FT &rx, const FT &ry, const FT &rz, const FT &rw, + const FT &sx, const FT &sy, const FT &sz, const FT &sw, + const FT &tx, const FT &ty, const FT &tz, const FT &tw) { - //to get the value of the determinant - // We translate the points so that t becomes the origin. - FT dpx = px - tx; - FT dpy = py - ty; - FT dpz = pz - tz; - FT dpt = CGAL_NTS square(dpx) + CGAL_NTS square(dpy) + - CGAL_NTS square(dpz) - pw + tw ; - FT dqx = qx - tx; - FT dqy = qy - ty; - FT dqz = qz - tz; - FT dqt = CGAL_NTS square(dqx) + CGAL_NTS square(dqy) + - CGAL_NTS square(dqz) - qw + tw; - FT drx = rx - tx; - FT dry = ry - ty; - FT drz = rz - tz; - FT drt = CGAL_NTS square(drx) + CGAL_NTS square(dry) + - CGAL_NTS square(drz) - rw + tw; - FT dsx = sx - tx; - FT dsy = sy - ty; - FT dsz = sz - tz; - FT dst = CGAL_NTS square(dsx) + CGAL_NTS square(dsy) + - CGAL_NTS square(dsz) - sw + tw; - - return determinant(dpx, dpy, dpz, dpt, - dqx, dqy, dqz, dqt, - drx, dry, drz, drt, - dsx, dsy, dsz, dst); + //to get the value of the determinant + // We translate the points so that t becomes the origin. + FT dpx = px - tx; + FT dpy = py - ty; + FT dpz = pz - tz; + FT dpt = CGAL_NTS square(dpx) + CGAL_NTS square(dpy) + + CGAL_NTS square(dpz) - pw + tw ; + FT dqx = qx - tx; + FT dqy = qy - ty; + FT dqz = qz - tz; + FT dqt = CGAL_NTS square(dqx) + CGAL_NTS square(dqy) + + CGAL_NTS square(dqz) - qw + tw; + FT drx = rx - tx; + FT dry = ry - ty; + FT drz = rz - tz; + FT drt = CGAL_NTS square(drx) + CGAL_NTS square(dry) + + CGAL_NTS square(drz) - rw + tw; + FT dsx = sx - tx; + FT dsy = sy - ty; + FT dsz = sz - tz; + FT dst = CGAL_NTS square(dsx) + CGAL_NTS square(dsy) + + CGAL_NTS square(dsz) - sw + tw; + return determinant(dpx, dpy, dpz, dpt, + dqx, dqy, dqz, dqt, + drx, dry, drz, drt, + dsx, dsy, dsz, dst); } - - // compute the critical weight tw // where weighted point t is orthogonal to weighted points p, q,r,s template < class FT> FT -power_distance_to_power_sphereC3( - const FT &px, const FT &py, const FT &pz, const FT &pw, - const FT &qx, const FT &qy, const FT &qz, const FT &qw, - const FT &rx, const FT &ry, const FT &rz, const FT &rw, - const FT &sx, const FT &sy, const FT &sz, const FT &sw, - const FT &tx, const FT &ty, const FT &tz, const FT & ) +power_distance_to_power_sphereC3(const FT &px, const FT &py, const FT &pz, const FT &pw, + const FT &qx, const FT &qy, const FT &qz, const FT &qw, + const FT &rx, const FT &ry, const FT &rz, const FT &rw, + const FT &sx, const FT &sy, const FT &sz, const FT &sw, + const FT &tx, const FT &ty, const FT &tz, const FT & ) { // the 5x5 det is a linear function of tw ff(tw)= ff(0) + tw ff(1) // the critical value for tw is - ff(0)/( ff(1) - ff(0)) + FT ff0 = power_to_orthogonal_sphereC3(px, py, pz, pw, + qx, qy, qz, qw, + rx, ry, rz, rw, + sx, sy, sz, sw, + tx, ty, tz, FT(0)); - FT ff0 = power_to_orthogonal_sphereC3(px, py, pz, pw, - qx, qy, qz, qw, - rx, ry, rz, rw, - sx, sy, sz, sw, - tx, ty, tz, FT(0)); + FT ff1 = power_to_orthogonal_sphereC3(px, py, pz, pw, + qx, qy, qz, qw, + rx, ry, rz, rw, + sx, sy, sz, sw, + tx, ty, tz, FT(1)); - FT ff1 = power_to_orthogonal_sphereC3(px, py, pz, pw, - qx, qy, qz, qw, - rx, ry, rz, rw, - sx, sy, sz, sw, - tx, ty, tz, FT(1)); - - return -ff0/(ff1 - ff0); + return -ff0/(ff1 - ff0); } - - // I will use this to test if the radial axis of three spheres // intersect the triangle formed by the centers. // // resolution of the system (where we note c the center) @@ -913,9 +881,7 @@ power_distance_to_power_sphereC3( // FT Mu = (dqq*dp-dpp*dpdq)/denom; // return (CGAL_NTS square(Lambda)*dp+CGAL_NTS square(Mu)*dq -// +FT2*Lambda*Mu*dpdq - rw); - - +// + FT2*Lambda*Mu*dpdq - rw); } //namespace CGAL diff --git a/Cartesian_kernel/include/CGAL/predicates/kernel_ftC2.h b/Cartesian_kernel/include/CGAL/predicates/kernel_ftC2.h index d1f8ad9ed00..ee1577db5ba 100644 --- a/Cartesian_kernel/include/CGAL/predicates/kernel_ftC2.h +++ b/Cartesian_kernel/include/CGAL/predicates/kernel_ftC2.h @@ -635,12 +635,11 @@ side_of_oriented_lineC2(const FT &a, const FT &b, const FT &c, return CGAL_NTS sign(a*x+b*y+c); } - template Comparison_result compare_power_distanceC2(const FT& px, const FT& py, const FT& pwt, - const FT& qx, const FT& qy, const FT& qwt, - const FT& rx, const FT& ry) + const FT& qx, const FT& qy, const FT& qwt, + const FT& rx, const FT& ry) { // returns SMALLER if r is closer to p w.r.t. the power metric FT d1 = CGAL_NTS square(rx - px) + CGAL_NTS square(ry - py) - pwt; @@ -648,58 +647,73 @@ compare_power_distanceC2(const FT& px, const FT& py, const FT& pwt, return CGAL_NTS compare(d1, d2); } +template +CGAL_KERNEL_MEDIUM_INLINE +Bounded_side +power_side_of_bounded_power_circleC2(const FT &px, const FT &py, const FT &pw, + const FT &qx, const FT &qy, const FT &qw, + const FT &tx, const FT &ty, const FT &tw) +{ + FT dpx = px - qx; + FT dpy = py - qy; + FT dtx = tx - qx; + FT dty = ty - qy; + FT dpz = CGAL_NTS square(dpx) + CGAL_NTS square(dpy); + + return enum_cast + (CGAL_NTS sign(-(CGAL_NTS square(dtx) + CGAL_NTS square(dty)-tw+qw)*dpz + +(dpz-pw+qw)*(dpx*dtx+dpy*dty))); +} template Oriented_side -power_side_of_oriented_power_circleC2( const FT &px, const FT &py, const FT &pwt, - const FT &qx, const FT &qy, const FT &qwt, - const FT &rx, const FT &ry, const FT &rwt, - const FT &tx, const FT &ty, const FT &twt) +power_side_of_oriented_power_circleC2(const FT &px, const FT &py, const FT &pwt, + const FT &qx, const FT &qy, const FT &qwt, + const FT &rx, const FT &ry, const FT &rwt, + const FT &tx, const FT &ty, const FT &twt) { - // Note: maybe this can be further optimized like the usual in_circle() ? + // Note: maybe this can be further optimized like the usual in_circle() ? - // We translate the 4 points so that T becomes the origin. - FT dpx = px - tx; - FT dpy = py - ty; - FT dpz = CGAL_NTS square(dpx) + CGAL_NTS square(dpy) - pwt + twt; - FT dqx = qx - tx; - FT dqy = qy - ty; - FT dqz = CGAL_NTS square(dqx) + CGAL_NTS square(dqy) - qwt + twt; - FT drx = rx - tx; - FT dry = ry - ty; - FT drz = CGAL_NTS square(drx) + CGAL_NTS square(dry) - rwt + twt; + // We translate the 4 points so that T becomes the origin. + FT dpx = px - tx; + FT dpy = py - ty; + FT dpz = CGAL_NTS square(dpx) + CGAL_NTS square(dpy) - pwt + twt; + FT dqx = qx - tx; + FT dqy = qy - ty; + FT dqz = CGAL_NTS square(dqx) + CGAL_NTS square(dqy) - qwt + twt; + FT drx = rx - tx; + FT dry = ry - ty; + FT drz = CGAL_NTS square(drx) + CGAL_NTS square(dry) - rwt + twt; - return sign_of_determinant(dpx, dpy, dpz, - dqx, dqy, dqz, - drx, dry, drz); + return sign_of_determinant(dpx, dpy, dpz, + dqx, dqy, dqz, + drx, dry, drz); } - template Oriented_side -power_side_of_oriented_power_circleC2( const FT &px, const FT &py, const FT &pwt, - const FT &qx, const FT &qy, const FT &qwt, - const FT &tx, const FT &ty, const FT &twt) +power_side_of_oriented_power_circleC2(const FT &px, const FT &py, const FT &pwt, + const FT &qx, const FT &qy, const FT &qwt, + const FT &tx, const FT &ty, const FT &twt) { - // Same translation as above. - FT dpx = px - tx; - FT dpy = py - ty; - FT dpz = CGAL_NTS square(dpx) + CGAL_NTS square(dpy) - pwt + twt; - FT dqx = qx - tx; - FT dqy = qy - ty; - FT dqz = CGAL_NTS square(dqx) + CGAL_NTS square(dqy) - qwt + twt; + // Same translation as above. + FT dpx = px - tx; + FT dpy = py - ty; + FT dpz = CGAL_NTS square(dpx) + CGAL_NTS square(dpy) - pwt + twt; + FT dqx = qx - tx; + FT dqy = qy - ty; + FT dqz = CGAL_NTS square(dqx) + CGAL_NTS square(dqy) - qwt + twt; - // We do an orthogonal projection on the (x) axis, if possible. - Comparison_result cmpx = CGAL_NTS compare(px, qx); - if (cmpx != EQUAL) - return cmpx * sign_of_determinant(dpx, dpz, dqx, dqz); + // We do an orthogonal projection on the (x) axis, if possible. + Comparison_result cmpx = CGAL_NTS compare(px, qx); + if (cmpx != EQUAL) + return cmpx * sign_of_determinant(dpx, dpz, dqx, dqz); - // If not possible, then on the (y) axis. - Comparison_result cmpy = CGAL_NTS compare(py, qy); - return cmpy * sign_of_determinant(dpy, dpz, dqy, dqz); + // If not possible, then on the (y) axis. + Comparison_result cmpy = CGAL_NTS compare(py, qy); + return cmpy * sign_of_determinant(dpy, dpz, dqy, dqz); } - } //namespace CGAL #endif // CGAL_PREDICATES_KERNEL_FTC2_H diff --git a/Cartesian_kernel/include/CGAL/predicates/kernel_ftC3.h b/Cartesian_kernel/include/CGAL/predicates/kernel_ftC3.h index d0358a628ce..f8cccb8dd0f 100644 --- a/Cartesian_kernel/include/CGAL/predicates/kernel_ftC3.h +++ b/Cartesian_kernel/include/CGAL/predicates/kernel_ftC3.h @@ -561,98 +561,99 @@ has_smaller_signed_dist_to_planeC3( template CGAL_KERNEL_MEDIUM_INLINE typename Same_uncertainty_nt::type -power_side_of_oriented_power_sphereC3( const FT &px, const FT &py, const FT &pz, const FT &pwt, - const FT &qx, const FT &qy, const FT &qz, const FT &qwt, - const FT &rx, const FT &ry, const FT &rz, const FT &rwt, - const FT &sx, const FT &sy, const FT &sz, const FT &swt, - const FT &tx, const FT &ty, const FT &tz, const FT &twt) +power_side_of_oriented_power_sphereC3( + const FT &px, const FT &py, const FT &pz, const FT &pwt, + const FT &qx, const FT &qy, const FT &qz, const FT &qwt, + const FT &rx, const FT &ry, const FT &rz, const FT &rwt, + const FT &sx, const FT &sy, const FT &sz, const FT &swt, + const FT &tx, const FT &ty, const FT &tz, const FT &twt) { - // We translate the points so that T becomes the origin. - FT dpx = px - tx; - FT dpy = py - ty; - FT dpz = pz - tz; - FT dpt = CGAL_NTS square(dpx) + CGAL_NTS square(dpy) + - CGAL_NTS square(dpz) + (twt - pwt); - FT dqx = qx - tx; - FT dqy = qy - ty; - FT dqz = qz - tz; - FT dqt = CGAL_NTS square(dqx) + CGAL_NTS square(dqy) + - CGAL_NTS square(dqz) + (twt - qwt); - FT drx = rx - tx; - FT dry = ry - ty; - FT drz = rz - tz; - FT drt = CGAL_NTS square(drx) + CGAL_NTS square(dry) + - CGAL_NTS square(drz) + (twt - rwt); - FT dsx = sx - tx; - FT dsy = sy - ty; - FT dsz = sz - tz; - FT dst = CGAL_NTS square(dsx) + CGAL_NTS square(dsy) + - CGAL_NTS square(dsz) + (twt - swt); + // We translate the points so that T becomes the origin. + FT dpx = px - tx; + FT dpy = py - ty; + FT dpz = pz - tz; + FT dpt = CGAL_NTS square(dpx) + CGAL_NTS square(dpy) + + CGAL_NTS square(dpz) + (twt - pwt); + FT dqx = qx - tx; + FT dqy = qy - ty; + FT dqz = qz - tz; + FT dqt = CGAL_NTS square(dqx) + CGAL_NTS square(dqy) + + CGAL_NTS square(dqz) + (twt - qwt); + FT drx = rx - tx; + FT dry = ry - ty; + FT drz = rz - tz; + FT drt = CGAL_NTS square(drx) + CGAL_NTS square(dry) + + CGAL_NTS square(drz) + (twt - rwt); + FT dsx = sx - tx; + FT dsy = sy - ty; + FT dsz = sz - tz; + FT dst = CGAL_NTS square(dsx) + CGAL_NTS square(dsy) + + CGAL_NTS square(dsz) + (twt - swt); - return - sign_of_determinant(dpx, dpy, dpz, dpt, - dqx, dqy, dqz, dqt, - drx, dry, drz, drt, - dsx, dsy, dsz, dst); + return - sign_of_determinant(dpx, dpy, dpz, dpt, + dqx, dqy, dqz, dqt, + drx, dry, drz, drt, + dsx, dsy, dsz, dst); } - template CGAL_KERNEL_MEDIUM_INLINE typename Same_uncertainty_nt::type -power_side_of_oriented_power_sphereC3(const FT &px, const FT &py, const FT &pz, const FT &pwt, - const FT &qx, const FT &qy, const FT &qz, const FT &qwt, - const FT &rx, const FT &ry, const FT &rz, const FT &rwt, - const FT &tx, const FT &ty, const FT &tz, const FT &twt) +power_side_of_oriented_power_sphereC3( + const FT &px, const FT &py, const FT &pz, const FT &pwt, + const FT &qx, const FT &qy, const FT &qz, const FT &qwt, + const FT &rx, const FT &ry, const FT &rz, const FT &rwt, + const FT &tx, const FT &ty, const FT &tz, const FT &twt) { - // Same translation as above. - FT dpx = px - tx; - FT dpy = py - ty; - FT dpz = pz - tz; - FT dpt = CGAL_NTS square(dpx) + CGAL_NTS square(dpy) + - CGAL_NTS square(dpz) + (twt - pwt); - FT dqx = qx - tx; - FT dqy = qy - ty; - FT dqz = qz - tz; - FT dqt = CGAL_NTS square(dqx) + CGAL_NTS square(dqy) + - CGAL_NTS square(dqz) + (twt - qwt); - FT drx = rx - tx; - FT dry = ry - ty; - FT drz = rz - tz; - FT drt = CGAL_NTS square(drx) + CGAL_NTS square(dry) + - CGAL_NTS square(drz) + (twt - rwt); - Sign cmp; + // Same translation as above. + FT dpx = px - tx; + FT dpy = py - ty; + FT dpz = pz - tz; + FT dpt = CGAL_NTS square(dpx) + CGAL_NTS square(dpy) + + CGAL_NTS square(dpz) + (twt - pwt); + FT dqx = qx - tx; + FT dqy = qy - ty; + FT dqz = qz - tz; + FT dqt = CGAL_NTS square(dqx) + CGAL_NTS square(dqy) + + CGAL_NTS square(dqz) + (twt - qwt); + FT drx = rx - tx; + FT dry = ry - ty; + FT drz = rz - tz; + FT drt = CGAL_NTS square(drx) + CGAL_NTS square(dry) + + CGAL_NTS square(drz) + (twt - rwt); + Sign cmp; - // Projection on the (xy) plane. - cmp = sign_of_determinant(dpx, dpy, dpt, - dqx, dqy, dqt, - drx, dry, drt); - if (cmp != ZERO) - return cmp * sign_of_determinant(px-rx, py-ry, - qx-rx, qy-ry); + // Projection on the (xy) plane. + cmp = sign_of_determinant(dpx, dpy, dpt, + dqx, dqy, dqt, + drx, dry, drt); + if (cmp != ZERO) + return cmp * sign_of_determinant(px-rx, py-ry, + qx-rx, qy-ry); - // Projection on the (xz) plane. - cmp = sign_of_determinant(dpx, dpz, dpt, - dqx, dqz, dqt, - drx, drz, drt); - if (cmp != ZERO) - return cmp * sign_of_determinant(px-rx, pz-rz, - qx-rx, qz-rz); + // Projection on the (xz) plane. + cmp = sign_of_determinant(dpx, dpz, dpt, + dqx, dqz, dqt, + drx, drz, drt); + if (cmp != ZERO) + return cmp * sign_of_determinant(px-rx, pz-rz, + qx-rx, qz-rz); - // Projection on the (yz) plane. - cmp = sign_of_determinant(dpy, dpz, dpt, - dqy, dqz, dqt, - dry, drz, drt); - return cmp * sign_of_determinant(py-ry, pz-rz, - qy-ry, qz-rz); + // Projection on the (yz) plane. + cmp = sign_of_determinant(dpy, dpz, dpt, + dqy, dqz, dqt, + dry, drz, drt); + return cmp * sign_of_determinant(py-ry, pz-rz, + qy-ry, qz-rz); } - template CGAL_KERNEL_MEDIUM_INLINE typename Same_uncertainty_nt::type -power_side_of_oriented_power_sphereC3(const FT &px, const FT &py, const FT &pz, const FT &pwt, - const FT &qx, const FT &qy, const FT &qz, const FT &qwt, - const FT &tx, const FT &ty, const FT &tz, const FT &twt) +power_side_of_oriented_power_sphereC3( + const FT &px, const FT &py, const FT &pz, const FT &pwt, + const FT &qx, const FT &qy, const FT &qz, const FT &qwt, + const FT &tx, const FT &ty, const FT &tz, const FT &twt) { // Same translation as above. FT dpx = px - tx; @@ -687,28 +688,25 @@ CGAL_KERNEL_MEDIUM_INLINE typename Same_uncertainty_nt::type power_side_of_oriented_power_sphereC3(const FT &pwt, const FT &qwt) { - return CGAL_NTS compare(qwt, pwt); + return CGAL_NTS compare(qwt, pwt); } - template < class FT > Comparison_result -compare_power_distanceC3( - const FT &px, const FT &py, const FT &pz, - const FT &qx, const FT &qy, const FT &qz, const FT &qw, - const FT &rx, const FT &ry, const FT &rz, const FT &rw) +compare_power_distanceC3(const FT &px, const FT &py, const FT &pz, + const FT &qx, const FT &qy, const FT &qz, const FT &qw, + const FT &rx, const FT &ry, const FT &rz, const FT &rw) { - FT dqx = qx - px; - FT dqy = qy - py; - FT dqz = qz - pz; - FT drx = rx - px; - FT dry = ry - py; - FT drz = rz - pz; - return CGAL_NTS compare(dqx*dqx + dqy*dqy + dqz*dqz - qw, - drx*drx + dry*dry + drz*drz - rw); + FT dqx = qx - px; + FT dqy = qy - py; + FT dqz = qz - pz; + FT drx = rx - px; + FT dry = ry - py; + FT drz = rz - pz; + return CGAL_NTS compare(dqx*dqx + dqy*dqy + dqz*dqz - qw, + drx*drx + dry*dry + drz*drz - rw); } - //return the sign of the power test of weighted point (sx,sy,sz,sw) //with respect to the smallest sphere orthogonal to //p,q,r @@ -716,12 +714,12 @@ template< class FT > CGAL_KERNEL_MEDIUM_INLINE typename Same_uncertainty_nt::type power_side_of_bounded_power_sphereC3( - const FT &px, const FT &py, const FT &pz, const FT &pw, - const FT &qx, const FT &qy, const FT &qz, const FT &qw, - const FT &rx, const FT &ry, const FT &rz, const FT &rw, - const FT &sx, const FT &sy, const FT &sz, const FT &sw) + const FT &px, const FT &py, const FT &pz, const FT &pw, + const FT &qx, const FT &qy, const FT &qz, const FT &qw, + const FT &rx, const FT &ry, const FT &rz, const FT &rw, + const FT &sx, const FT &sy, const FT &sz, const FT &sw) { - // Translate p to origin and compute determinants + // Translate p to origin and compute determinants FT qpx = qx-px; FT qpy = qy-py; FT qpz = qz-pz; @@ -738,11 +736,11 @@ power_side_of_bounded_power_sphereC3( FT rpw = rr - rw + pw ; FT den = determinant(qq,qr, - qr,rr); + qr,rr); FT detq = determinant(qpw,qr, - rpw,rr); + rpw,rr); FT detr = determinant(qq,qpw, - qr,rpw); + qr,rpw); // Smallest smallest orthogonal sphere center // c = detq/2*den q + detr/2*den r (origin at p) @@ -751,26 +749,25 @@ power_side_of_bounded_power_sphereC3( FT spx = sx-px; FT spy = sy-py; FT spz = sz-pz; - FT ss = CGAL_NTS square(spx) + CGAL_NTS square(spy) + CGAL_NTS square(spz); + FT ss = CGAL_NTS square(spx) + CGAL_NTS square(spy) + CGAL_NTS square(spz); FT sq = spx*qpx + spy*qpy + spz*qpz; FT sr = spx*rpx + spy*rpy + spz*rpz; CGAL_assertion( ! CGAL_NTS is_zero(den) ); // return - sign of (c- s)^2 - (c^2 - pw) - sw note that den >= 0 - return enum_cast( - - CGAL_NTS sign( den*(ss - sw + pw)- detq*sq - detr*sr)); + - CGAL_NTS sign( den*(ss - sw + pw)- detq*sq - detr*sr)); } - // return the sign of the power test of weighted point (rx,ry,rz,rw) // with respect to the smallest sphere orthogoanal to // p,q template< class FT > typename Same_uncertainty_nt::type power_side_of_bounded_power_sphereC3( - const FT &px, const FT &py, const FT &pz, const FT &pw, - const FT &qx, const FT &qy, const FT &qz, const FT &qw, - const FT &rx, const FT &ry, const FT &rz, const FT &rw) + const FT &px, const FT &py, const FT &pz, const FT &pw, + const FT &qx, const FT &qy, const FT &qz, const FT &qw, + const FT &rx, const FT &ry, const FT &rz, const FT &rw) { FT FT2(2); FT FT4(4); @@ -789,9 +786,6 @@ power_side_of_bounded_power_sphereC3( - CGAL_NTS sign (dr2 - dp2/FT4 + dpr*dpw/dp2 - drw )); } - - - -} //namespace CGAL +} // namespace CGAL #endif // CGAL_PREDICATES_KERNEL_FTC3_H diff --git a/Circular_kernel_2/test/Circular_kernel_2/test_Line_arc.cpp b/Circular_kernel_2/test/Circular_kernel_2/test_Line_arc.cpp index 406b143c357..189de5d6f2a 100644 --- a/Circular_kernel_2/test/Circular_kernel_2/test_Line_arc.cpp +++ b/Circular_kernel_2/test/Circular_kernel_2/test_Line_arc.cpp @@ -832,7 +832,7 @@ void _test_intersection_Line_arc_Circular_arc(CK ck) do{ p_random4 = Point_2(theRandom.get_int(random_min, random_max), theRandom.get_int(random_min, random_max)); - }while(p_random4 == center_circle_random1); + } while (p_random4 == center_circle_random1 || (p_random3 == p_random4)); std::vector< CGAL::Object > vector_for_intersection_random3; diff --git a/Circular_kernel_3/demo/Circular_kernel_3/CMakeLists.txt b/Circular_kernel_3/demo/Circular_kernel_3/CMakeLists.txt index 2574d6718ce..b7dd9bb6df0 100644 --- a/Circular_kernel_3/demo/Circular_kernel_3/CMakeLists.txt +++ b/Circular_kernel_3/demo/Circular_kernel_3/CMakeLists.txt @@ -1,6 +1,9 @@ project (Circular_kernel_3_Demo) cmake_minimum_required(VERSION 2.8.11) +if(POLICY CMP0053) + cmake_policy(SET CMP0053 OLD) +endif() if(POLICY CMP0043) cmake_policy(SET CMP0043 OLD) endif() diff --git a/Combinatorial_map/doc/Combinatorial_map/Combinatorial_map.txt b/Combinatorial_map/doc/Combinatorial_map/Combinatorial_map.txt index d0f58900dfd..0ea4f517a5c 100644 --- a/Combinatorial_map/doc/Combinatorial_map/Combinatorial_map.txt +++ b/Combinatorial_map/doc/Combinatorial_map/Combinatorial_map.txt @@ -501,7 +501,7 @@ Let E be a set, and p a partial permutation on E. An elemen Now we can give the definition of a combinatorial map in any dimension. Let d\f$ \geq\f$ 0. A d-dimensional combinatorial map (or d-map) is a (d+1)-tuple M=(D,\f$ \beta_1\f$,...,\f$ \beta_d\f$) where:
  1. D is a finite set of darts; -
  2. \f$ \beta_1\f$ is a partial permutation on D; +
  3. \f$ \beta_1\f$ is a partial permutation on D; let \f$ \beta_0\f$ denote \f$ \beta_1^{-1}\f$;
  4. \f$ \forall \f$ i, 2 \f$ \leq \f$ i \f$ \leq \f$ d, \f$ \beta_i\f$ is a partial involution on D without fixed point;
  5. \anchor condcomposition \f$ \forall \f$ i: 0 \f$ \leq \f$ i \f$ \leq\f$ d-2, \f$ \forall \f$ j: 3 \f$ \leq \f$j \f$ \leq \f$ d, i+2 \f$ \leq \f$ j, \f$ \beta_i \f$ \f$ \circ \f$ \f$ \beta_j \f$ is a partial involution.
diff --git a/Combinatorial_map/include/CGAL/Cell_attribute.h b/Combinatorial_map/include/CGAL/Cell_attribute.h index a64ad29e47c..f5a1e796368 100644 --- a/Combinatorial_map/include/CGAL/Cell_attribute.h +++ b/Combinatorial_map/include/CGAL/Cell_attribute.h @@ -20,6 +20,9 @@ #ifndef CGAL_CELL_ATTRIBUTE_H #define CGAL_CELL_ATTRIBUTE_H 1 +#include +#include + namespace CGAL { template diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map_constructors.h b/Combinatorial_map/include/CGAL/Combinatorial_map_constructors.h index 6ebb50f4503..3761d306f88 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map_constructors.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map_constructors.h @@ -20,6 +20,8 @@ #ifndef CGAL_COMBINATORIAL_MAP_CONSTRUCTORS_H #define CGAL_COMBINATORIAL_MAP_CONSTRUCTORS_H 1 +#include + #ifndef CGAL_NO_DEPRECATED_CODE namespace CGAL { diff --git a/Combinatorial_map/include/CGAL/Dart.h b/Combinatorial_map/include/CGAL/Dart.h index 7206b54e346..4e841186f66 100644 --- a/Combinatorial_map/include/CGAL/Dart.h +++ b/Combinatorial_map/include/CGAL/Dart.h @@ -21,6 +21,7 @@ #define CGAL_DART_H 1 #include +#include #include #include #include diff --git a/Combinatorial_map/test/Combinatorial_map/Combinatorial_map_test.cpp b/Combinatorial_map/test/Combinatorial_map/Combinatorial_map_test.cpp index 88c39847403..c56fb675c91 100644 --- a/Combinatorial_map/test/Combinatorial_map/Combinatorial_map_test.cpp +++ b/Combinatorial_map/test/Combinatorial_map/Combinatorial_map_test.cpp @@ -179,6 +179,7 @@ bool test_get_new_mark() if ( !res ) { std::cerr<<"PB we can reserve NB_MARK+1 !! mark, exit."< +#include +#include +#include +#include + +#include + +typedef CGAL::Exact_predicates_inexact_constructions_kernel K; +typedef K::Point_2 Point_2; + + +template +struct Forward_bool_functor + : public F +{ + const std::vector& points; + + Forward_bool_functor(const std::vector& points) + : points(points) + {} + + template + bool operator() (const Id& p, const Id& q) const + { + return static_cast(this)->operator()(points[p], points[q]); + } + + template + bool operator() (const Id& p, const Id& q, const Id& r) const + { + return static_cast(this)->operator()(points[p], points[q], points[r]); + } + + template + bool operator() (const Id& p, const Id& q, const Id& r, const Id& s) const + { + return static_cast(this)->operator()(points[p], points[q], points[r], points[s]); + } +}; + +template +struct CH_traits_for_point_ids +{ + const std::vector& points; + + CH_traits_for_point_ids(const std::vector& points) + : points(points) + {} + + typedef std::size_t Point_2; + typedef CGAL::Convex_hull_traits_2 Base; + typedef Forward_bool_functor Less_xy_2; + typedef Forward_bool_functor Less_yx_2; + typedef Forward_bool_functor Less_signed_distance_to_line_2; + typedef Forward_bool_functor Less_rotate_ccw_2; + typedef Forward_bool_functor Left_turn_2; + typedef Forward_bool_functor Equal_2; + + struct Orientation_2 + { + const std::vector& points; + + Orientation_2(const std::vector& points) + : points(points) + {} + + CGAL::Orientation + operator()(Point_2 p, Point_2 q, Point_2 r) const + { + return typename Base::Orientation_2()(points[p], points[q], points[r]); + } + }; + + Equal_2 equal_2_object () const + { + return Equal_2(points); + } + + Less_xy_2 less_xy_2_object () const + { + return Less_xy_2(points); + } + + Less_yx_2 less_yx_2_object () const + { + return Less_yx_2(points); + } + + Less_signed_distance_to_line_2 less_signed_distance_to_line_2_object () const + { + return Less_signed_distance_to_line_2(points); + } + + Less_rotate_ccw_2 less_rotate_ccw_2_object () const + { + return Less_rotate_ccw_2(points); + } + + Left_turn_2 left_turn_2_object () const + { + return Left_turn_2(points); + } + + Orientation_2 orientation_2_object () const + { + return Orientation_2(points); + } +}; + +int main() +{ + std::vector input_points; + std::vector result; + + input_points.push_back( Point_2(0,0) ); + input_points.push_back( Point_2(0,1) ); + input_points.push_back( Point_2(1,0) ); + input_points.push_back( Point_2(0.25,0.25) ); + + CGAL::convex_hull_2( boost::counting_iterator(0), + boost::counting_iterator(input_points.size()), + std::back_inserter(result), CH_traits_for_point_ids(input_points) ); + + BOOST_FOREACH(std::size_t i, result) + { + std::cout << input_points[i] << " - " << i << "\n"; + } + + assert( result.size() == 3 ); + + return 0; +} diff --git a/Convex_hull_3/demo/Convex_hull_3/CMakeLists.txt b/Convex_hull_3/demo/Convex_hull_3/CMakeLists.txt index f8b71af25ae..5f5be576dd5 100644 --- a/Convex_hull_3/demo/Convex_hull_3/CMakeLists.txt +++ b/Convex_hull_3/demo/Convex_hull_3/CMakeLists.txt @@ -5,6 +5,9 @@ project( Convex_hull_3_Demo ) cmake_minimum_required(VERSION 2.8.11) +if(POLICY CMP0053) + cmake_policy(SET CMP0053 OLD) +endif() if(POLICY CMP0043) cmake_policy(SET CMP0043 OLD) endif() diff --git a/Convex_hull_d/include/CGAL/Convex_hull_d.h b/Convex_hull_d/include/CGAL/Convex_hull_d.h index 026cbed7af4..0e720128a2e 100644 --- a/Convex_hull_d/include/CGAL/Convex_hull_d.h +++ b/Convex_hull_d/include/CGAL/Convex_hull_d.h @@ -32,7 +32,8 @@ #include #define CGAL_DEPRECATED_HEADER "" -#define CGAL_REPLACEMENT_HEADER "the Triangulation package (see http://doc.cgal.org/latest/Triangulation)" +#define CGAL_DEPRECATED_MESSAGE_DETAILS \ + "The Triangulation package (see http://doc.cgal.org/latest/Triangulation) should be used instead." #include /*{\Manpage {Convex_hull_d}{R}{Convex Hulls}{C}}*/ diff --git a/Convex_hull_d/include/CGAL/Convex_hull_d_to_polyhedron_3.h b/Convex_hull_d/include/CGAL/Convex_hull_d_to_polyhedron_3.h index c3839607505..8a59aa0fd10 100644 --- a/Convex_hull_d/include/CGAL/Convex_hull_d_to_polyhedron_3.h +++ b/Convex_hull_d/include/CGAL/Convex_hull_d_to_polyhedron_3.h @@ -24,7 +24,8 @@ #include #define CGAL_DEPRECATED_HEADER "" -#define CGAL_REPLACEMENT_HEADER "the Triangulation package (see http://doc.cgal.org/latest/Triangulation)" +#define CGAL_DEPRECATED_MESSAGE_DETAILS \ + "The Triangulation package (see http://doc.cgal.org/latest/Triangulation) should be used instead." #include #include diff --git a/Convex_hull_d/include/CGAL/Convex_hull_d_traits_3.h b/Convex_hull_d/include/CGAL/Convex_hull_d_traits_3.h index 00ef6daaee6..0094716bf32 100644 --- a/Convex_hull_d/include/CGAL/Convex_hull_d_traits_3.h +++ b/Convex_hull_d/include/CGAL/Convex_hull_d_traits_3.h @@ -24,7 +24,8 @@ #include #define CGAL_DEPRECATED_HEADER "" -#define CGAL_REPLACEMENT_HEADER "the Triangulation package (see http://doc.cgal.org/latest/Triangulation)" +#define CGAL_DEPRECATED_MESSAGE_DETAILS \ + "The Triangulation package (see http://doc.cgal.org/latest/Triangulation) should be used instead." #include #include diff --git a/Convex_hull_d/include/CGAL/Delaunay_d.h b/Convex_hull_d/include/CGAL/Delaunay_d.h index a68629e343e..a18065b5a66 100644 --- a/Convex_hull_d/include/CGAL/Delaunay_d.h +++ b/Convex_hull_d/include/CGAL/Delaunay_d.h @@ -32,7 +32,8 @@ #include #define CGAL_DEPRECATED_HEADER "" -#define CGAL_REPLACEMENT_HEADER "the Triangulation package (see http://doc.cgal.org/latest/Triangulation)" +#define CGAL_DEPRECATED_MESSAGE_DETAILS \ + "The Triangulation package (see http://doc.cgal.org/latest/Triangulation) should be used instead." #include /*{\Manpage {Delaunay_d}{R,Lifted_R}{Delaunay Triangulations}{DT}}*/ diff --git a/Convex_hull_d/include/CGAL/Regular_complex_d.h b/Convex_hull_d/include/CGAL/Regular_complex_d.h index 3424894c7a1..a832becf4f7 100644 --- a/Convex_hull_d/include/CGAL/Regular_complex_d.h +++ b/Convex_hull_d/include/CGAL/Regular_complex_d.h @@ -32,7 +32,8 @@ #include #define CGAL_DEPRECATED_HEADER "" -#define CGAL_REPLACEMENT_HEADER "the Triangulation package (see http://doc.cgal.org/latest/Triangulation)" +#define CGAL_DEPRECATED_MESSAGE_DETAILS \ + "The Triangulation package (see http://doc.cgal.org/latest/Triangulation) should be used instead." #include #include diff --git a/Documentation/doc/CMakeLists.txt b/Documentation/doc/CMakeLists.txt index 889a6d15a82..144461b8c65 100644 --- a/Documentation/doc/CMakeLists.txt +++ b/Documentation/doc/CMakeLists.txt @@ -78,6 +78,10 @@ function(configure_doxygen_package CGAL_PACKAGE_NAME) if(EXISTS "${CGAL_PACKAGE_DIR}/examples") file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} "EXAMPLE_PATH = ${CGAL_PACKAGE_DIR}/examples\n") endif() + if(CGAL_GENERATE_XML) + file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} "GENERATE_XML = YES\n") + endif() + file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} "GENERATE_TAGFILE = ${CGAL_DOC_TAG_GEN_DIR}/${CGAL_PACKAGE_NAME}.tag\n") file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} "STRIP_FROM_PATH = ${CGAL_PACKAGE_DOC_DIR}/\n") file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} "STRIP_FROM_PATH += ${CGAL_PACKAGE_DIR}/include/\n") @@ -199,7 +203,7 @@ set(CGAL_DOC_DXY_DIR "${CMAKE_BINARY_DIR}/doc_dxy") file(MAKE_DIRECTORY "${CGAL_DOC_DXY_DIR}") #Setting the resource directory depending on the version of doxygen -set(CGAL_DOC_RESOURCE_DIR_DEFAULT "${CMAKE_CURRENT_LIST_DIR}/resources/1.8.4") +set(CGAL_DOC_RESOURCE_DIR_DEFAULT "${CMAKE_CURRENT_LIST_DIR}/resources/1.8.13") # first look if resources for the specific doxygen version is available, fallback # on the default otherwise diff --git a/Documentation/doc/Documentation/Installation.txt b/Documentation/doc/Documentation/Installation.txt index 37bc318f113..29c6b5c855c 100644 --- a/Documentation/doc/Documentation/Installation.txt +++ b/Documentation/doc/Documentation/Installation.txt @@ -175,7 +175,7 @@ In order to build the \cgal libraries, you need a \cpp compiler. In order to configure, build, and install the \cgal libraries, examples and demos, you need CMake, a cross-platform "makefile generator". If CMake is not installed already you can obtain it from `http://www.cmake.org/`. -CMake version 2.8.11 or higher is required. +CMake version 3.1 or higher is required. This manual explains only those features of CMake which are needed in order to build \cgal. Please refer to the CMake documentation at `http://www.cmake.org/` for further details. diff --git a/Documentation/doc/biblio/cgal_manual.bib b/Documentation/doc/biblio/cgal_manual.bib index 4fb97254856..2944afcbb36 100644 --- a/Documentation/doc/biblio/cgal_manual.bib +++ b/Documentation/doc/biblio/cgal_manual.bib @@ -1556,7 +1556,7 @@ ABSTRACT = {We present the first complete, exact and efficient C++ implementatio ,organization = {The Geometry Center} ,address = {University of Minnesota} ,year = 1996 - ,url = {http://www.geom.umn.edu/software/download/geomview.html} + ,url = {http://www.geomview.org/docs/} ,annote = {Reference for object file format (OFF).} ,update = "03.04 kettner" } @@ -2722,6 +2722,26 @@ pages = "207--221" number = {5 }, year = {2011}, } + +@mastersthesis{cloop:mthesis, + author = {Charles Loop}, + title = {Smooth Subdivision Surfaces Based on Triangles}, + school = {University of Utah}, + year = 1987, +} + +@article{doo1978behaviour, + title={Behaviour of recursive division surfaces near extraordinary points}, + author={Doo, Daniel and Sabin, Malcolm}, + journal={Computer-Aided Design}, + volume={10}, + number={6}, + pages={356--360}, + year={1978}, + publisher={Elsevier} +} + + % ---------------------------------------------------------------------------- % END OF BIBFILE % ---------------------------------------------------------------------------- diff --git a/Documentation/doc/resources/1.8.13/BaseDoxyfile.in b/Documentation/doc/resources/1.8.13/BaseDoxyfile.in index 6121fdf771c..448bae7be6f 100644 --- a/Documentation/doc/resources/1.8.13/BaseDoxyfile.in +++ b/Documentation/doc/resources/1.8.13/BaseDoxyfile.in @@ -931,7 +931,8 @@ EXCLUDE_SYMBOLS = Tr \ Cb \ Fb \ K \ - Traits + Traits \ + internal # The EXAMPLE_PATH tag can be used to specify one or more files or directories # that contain example code fragments that are included (see the \include diff --git a/Documentation/doc/resources/1.8.4/BaseDoxyfile.in b/Documentation/doc/resources/1.8.4/BaseDoxyfile.in index 972fb8ed031..03daafc1db4 100644 --- a/Documentation/doc/resources/1.8.4/BaseDoxyfile.in +++ b/Documentation/doc/resources/1.8.4/BaseDoxyfile.in @@ -816,7 +816,8 @@ EXCLUDE_SYMBOLS = Tr \ Cb \ Fb \ K \ - Traits + Traits \ + internal # The EXAMPLE_PATH tag can be used to specify one or more files or # directories that contain example code fragments that are included (see diff --git a/Documentation/doc/scripts/compare_testsuites.sh b/Documentation/doc/scripts/compare_testsuites.sh new file mode 100644 index 00000000000..ec4e941e451 --- /dev/null +++ b/Documentation/doc/scripts/compare_testsuites.sh @@ -0,0 +1,47 @@ +#!/bin/bash +if [ "$1" == '--help' ]; then + echo "Usage: $0 [doc 2]" + exho "doc 1 and doc 2 are paths to doxygen outputs (doc_output)." + echo "Parse the xml output of doc 1 and creates a directory with organized text files." + echo "Then, if doc_2 is specified, do the same for its xml output and make the diff between them." + exit 0 +fi +#Path to the CGAL_Documentation_build_directory/doc_output +PATH_TO_DOC="$1" + +if ! [ -d "$PATH_TO_DOC" ] || [ $(basename $PATH_TO_DOC) != "doc_output" ]; then + echo "wrong path" + exit 1 +fi + +#path to the repository containing the output of this script for the reference documentation. +DOC_REF="$2" +#output in a new directory +mkdir -p doc_data +cd ./doc_data +if [ $# -gt 5 ]; then + echo "too many arguments" + exit 1 + fi + +FAILURES=() +for dir in $PATH_TO_DOC/* +do + OUTPUT=$(basename $dir) + python ../documentation_parser.py $dir/xml > ./"$OUTPUT.txt" + if [ $? -eq 0 ]; then + echo "$dir OK" + else + echo "$dir FAILED" + FAILURES+="$dir " + fi +done +cd .. +echo "Output generated" +if ! [ -d "$DOC_REF" ]; then + echo "No reference given. Script is finished." + exit 2 +fi + +#diff the output and the reference output, ignoring the differences in whitespaces +diff -u -N -w ./doc_data $DOC_REF > ./diff.txt diff --git a/Documentation/doc/scripts/documentation_parser.py b/Documentation/doc/scripts/documentation_parser.py new file mode 100644 index 00000000000..187b175bf4f --- /dev/null +++ b/Documentation/doc/scripts/documentation_parser.py @@ -0,0 +1,182 @@ +from pyquery import PyQuery as pq +from collections import defaultdict +from sys import argv +import os.path as op + +# if _in is part of args, return true. +def check_type(_in, args): + if _in in args: + return True + else: + return False + +root_path=argv[1] +d = pq(filename=op.join(op.sep, root_path,'index.xml'), parser="xml") +compounds=[p.text() for p in d('compound').items()] +types=[p.attr('kind') for p in d('compound').items()] +type_map = defaultdict(list) #map +dict_map = defaultdict(dict)#map > +#FOREACH compounds : fill maps +for i in xrange(0,len(compounds)): + if check_type(types[i], "typedef"): + types[i]="type" + name=d('compound').children("name").eq(i).text() + members=[p.text() for p in d('compound').eq(i).children("member").items()] + m_types=[p.attr('kind') for p in d('compound').eq(i).children("member").items()] + if (not check_type(types[i], ['example', 'file', 'dir', 'page', 'group']) and + not (types[i] == "namespace" and len(members) == 0) and + not (types[i] == "enum" and len(members) == 0) ): + if (types[i] == "class"):#check if the class is a concept class + compound=d('compound').children("name").eq(i).text().replace('_', '__').replace('::', '_1_1') + filepath='class'+compound+'.xml' + total_path=op.join(op.sep, root_path,filepath) + if(op.isfile(total_path)): + e = pq(filename=total_path, parser="xml") + compoundnames=[p.text() for p in e('includes').items()] + + if(len(compoundnames) > 1 and compoundnames[0].find("Concept") != -1): + types[i] = 'Concept '+types[i].lower() + type_map[types[i]].append(name) + + mtype_map = defaultdict(list)# map + + #FOREACH member : + for j in xrange(0,len(members)): + if(check_type(types[i], ['class', 'Concept class']) + and m_types[j] == "function"): + m_types[j]="method" + if(m_types[j] == "typedef"): + m_types[j]="type" + mtype_map[m_types[j]].append(members[j]) + #end FOREACH member + dict_map[name]=mtype_map +#end FOREACH compound +indent="" + + + + +#print +#FOREACH type +for btype in type_map: + out=btype + if btype.endswith('s'): + out+='e' + print out.title()+'s' + indent+=" " + #FOREACH name + for name in type_map[btype]: + filepath="" + if check_type(btype, ['class', 'Concept class']): + filepath='/class'+name.replace('_', '__').replace('::', '_1_1')+'.xml' + elif btype == 'namespace': + filepath='/namespace'+name.replace('_', '__').replace('::', '_1_1')+'.xml' + templates=[] + if op.isfile(op.join(op.sep, root_path,filepath)): + f=pq(filename=op.join(op.sep, root_path,filepath), parser="xml") + templateparams=f("compounddef").children("templateparamlist").eq(0).children("param").items() + for param in templateparams: + template_type="" + template_name="" + template_defval="" + template_type=param.children("type").text() + template_name=param.children("declname").text() + template_defval=param.children("defval").text() + complete_template="" + if not template_type is None: + complete_template+=template_type+' ' + if not template_name is None: + complete_template+=template_name + if not template_defval is None: + complete_template+=' = '+template_defval + templates.append(complete_template) + if templates==[]:#if no child was found, just take param.text() + templates=[t.text() for t in param.items()] + suffix="<" + #as template got type, defname and declname, name is twice in template. keep only one of them. + to_remove=[""] + for template in templates: + suffix+=template+', ' + if suffix == "<": + suffix="" + if suffix.endswith(', '): + suffix = suffix[:-2]+'>' + print indent+name+suffix + + indent+=" " + #FOREACH mtype + for mtype in (dict_map[name]): + out=mtype + if mtype.endswith('s'): + out+='e' + print indent+out.title()+'s' + indent+=" " + #FOREACH member + overload_map = defaultdict(int) #contains the number of times a member has appeared (to manage the overloads) + templateparams=[] + for member in dict_map[name][mtype]: + templates=[] + args="" # will contain the arguments of the methods and functions + return_type="" #will contain the return type of a function/method + + #look for arguments + if op.isfile(op.join(op.sep, root_path,filepath)): + f=pq(filename=op.join(op.sep, root_path,filepath), parser="xml") + index=0 + memberdefs=[m.text() for m in f("memberdef").items()] + for i in xrange(0,len(memberdefs)): + member_names=[member_name.text() for member_name in f('memberdef').eq(i).children("name").items()] + if f('memberdef').eq(i).children("name").text() == member: + if (index < overload_map[member]): + index+=1 + elif (index == overload_map[member]): + if check_type(mtype, ['function', 'method']): + args=[f('memberdef').eq(i).children("argsstring").text()] + templateparams=f('memberdef').eq(i).children("templateparamlist").children("param").items() + if check_type(mtype, ['function', 'method', 'type', 'variable']): + return_type=[f('memberdef').eq(i).children("type").text()] + break; + #end foreach memberdef + arguments="" + for arg in args: + arguments+=arg + template_types=[] + template_names=[] + for param in templateparams: + template_type="" + template_name="" + template_defval="" + template_type=param.children("type").text() + template_name=param.children("declname").text() + template_defval=param.children("defval").text() + complete_template="" + if not template_type is None: + complete_template+=template_type+' ' + if not template_name is None: + complete_template+=template_name + if not template_defval is None: + complete_template+=' = '+template_defval + templates.append(complete_template) + if templates==[]:#if no child was found, just take param.text() + templates=[t.text() for t in param.items()] + + prefix="template <" + for template in templates: + prefix+=template+', ' + if prefix == "template <": + prefix="" + if prefix.endswith(', '): + prefix = prefix[:-2]+'>\n'+indent+" " + for definition in return_type: + prefix+=definition + if(prefix != ""): + prefix+=" " + print indent+prefix+member+arguments + overload_map[member]+=1 + #END foreach member + indent=indent[:-2] + #END foreach mtype + indent=indent[:-2] + #END foreach name + indent=indent[:-2] +#END foreach type diff --git a/Documentation/doc/scripts/test_doxygen_versions.sh b/Documentation/doc/scripts/test_doxygen_versions.sh new file mode 100644 index 00000000000..1b435c88d77 --- /dev/null +++ b/Documentation/doc/scripts/test_doxygen_versions.sh @@ -0,0 +1,106 @@ +#!/bin/bash +if [ "$1" == '--help' ]; then + echo "Usage: $0 [doxygen_2] [publish_dir]" + echo "Compares the output of doxygen_1 and doxygen_2 of this CGAL version, " + echo "where doxygen_1 and doxygen_2 are valid paths to doxygen executables." + echo "If doxygen_2 is not specified, the master branch of doxygen will be cloned, built and used as doxygen_2." + echo "publish_dir is the path to the dir where the testsuite results are kept" + echo "$0 must be called from doc/scripts" + exit 0 +fi +#build reference +PATH_TO_1="$1" +PATH_TO_2="$2" +PUBLISH_DIR="$3" +NB_CORES="$(grep -c ^processor /proc/cpuinfo)" + +if [ -z $PATH_TO_1 ] || [ $(basename $PATH_TO_1) != "doxygen" ] || [ ! -e $PATH_TO_1 ]; then + echo "Please specify a valid path to a doxygen executable." + echo "$0 --help for more information." + exit 0 +fi + +#Find the CGAL directory. If there is a directory called Documentation, this is a branch build. +#Else it is from a release. +TEMP=$PWD +IS_RELEASE=1 +cd $PWD/../.. +if [ "$(basename $PWD)" = 'Documentation' ]; then + ROOT=$PWD/.. + IS_RELEASE=0 +else + ROOT=$PWD +fi +cd $TEMP #scripts + + +mkdir ./build_doc +cd ./build_doc +cmake -DCGAL_GENERATE_XML=ON -DDOXYGEN_EXECUTABLE="$PATH_TO_1" ../.. &> /dev/null +make -j$NB_CORES doc &> /dev/null +cd ../ #scripts +bash compare_testsuites.sh $PWD/build_doc/doc_output +mv ./doc_data ./doc_ref + +#download and build doxygen_master +if [ -z $PATH_TO_2 ] || [ $(basename $PATH_TO_2) != "doxygen" ] || [ ! -e $PATH_TO_2 ]; then + echo "No second path detected. Cloning Doxygen master branch..." + git clone https://github.com/doxygen/doxygen.git doxygen_master &> /dev/null + cd doxygen_master + MASTER_DESCRIBE=$(git describe --tags) + mkdir build + cd build + cmake .. &> /dev/null + make -j$NB_CORES &> /dev/null + cd ../.. #scripts + PATH_TO_2="$PWD/doxygen_master/build/bin/doxygen" + echo "done." +fi +#build doc with doxygen master +mv ./build_doc ./doc_dir +mkdir build_doc +cd ./build_doc +cmake -DCGAL_GENERATE_XML=ON -DDOXYGEN_EXECUTABLE="$PATH_TO_2" ../.. &> /dev/null +make -j$NB_CORES doc &> /dev/null +cd ../ #scripts +DOXYGEN_1=$($PATH_TO_1 --version) +DOXYGEN_2=$($PATH_TO_2 --version) +bash ./compare_testsuites.sh $PWD/build_doc/doc_output $PWD/doc_ref +#rebuild doc with Doxygen_1 to get the right doc_tags without GENERATE_XML because it ignores the EXCLUDE_SYMBOLS, +#which disrupts the logs +mv ./build_doc ./doc_master +rm -rf ./doc_dir +mkdir ./doc_dir +cd ./doc_dir +cmake -DCGAL_DOC_CREATE_LOGS=true -DDOXYGEN_EXECUTABLE="$PATH_TO_1" ../.. &> /dev/null +make -j$NB_CORES doc &> /dev/null +make -j$NB_CORES doc &> /dev/null +cd .. #scripts +#get VERSION's content +if [ $IS_RELEASE = 0 ]; then + cd $ROOT + mkdir -p ./build && cd ./build + cmake .. + CGAL_NAME="$(cat $PWD/VERSION)" + cd ..$ROOT + rm -rf ./build + cd $ROOT/Documentation/doc/scripts +else + CGAL_NAME="$(cat $ROOT/VERSION)" +fi + +#update overview + +python ./testsuite.py --output-dir $PWD/doc_dir/doc_output/ --doc-log-dir $PWD/doc_dir/doc_log/ \ + --publish $PUBLISH_DIR --diff $PWD/diff.txt --master-dir $PWD/doc_master/doc_output/ \ + --cgal-version "$CGAL_NAME" --do-copy-results --version-to-keep 10 --doxygen-version "$DOXYGEN_1" --master-describe "$MASTER_DESCRIBE" + +#clean-up +rm -rf ./build_doc +rm -rf ./doc_dir +rm -rf ./doc_master +rm -rf ./doc_ref +rm -rf ./doc_data +if [ -z $PATH_TO_2 ]; then + rm -rf ./doxygen_master +fi diff --git a/Documentation/doc/scripts/testsuite.py b/Documentation/doc/scripts/testsuite.py index ffc64689fb6..6c5af94a0eb 100755 --- a/Documentation/doc/scripts/testsuite.py +++ b/Documentation/doc/scripts/testsuite.py @@ -84,8 +84,15 @@ body {color: black; background-color: #C0C0D0; font-family: sans-serif;} ''' if args.publish and args.do_copy_results: - link="\nLink to this documentation\n" - d = pq(page_header+link+page_footer) + suffix='' + if args.doxygen_version: + suffix = "built with Doxygen "+args.doxygen_version + link="\nLink to this documentation {_suffix}\n".format(_suffix=suffix) + suffix = '' + if args.master_describe: + suffix=args.master_describe + link_master="\n
Link to documentation built with Doxygen Master {_suffix}\n".format(_suffix=suffix) + d = pq(page_header+link+" "+link_master+page_footer) else: d = pq(page_header+page_footer) logs=sorted(glob.glob('./*.log')) @@ -115,10 +122,14 @@ def main(): parser.add_argument('--publish', metavar='/path/to/publish', help='Specify this argument if the results should be published.') parser.add_argument('--doc-log-dir', default='.', metavar='/path/to/cgal/build/dir/doc_log', help='The path of the documentation logs.') + parser.add_argument('--master-dir', default='.', metavar='/path/to/cgal/build/master_dir/doc_output', help='The path to the master build documentation.') parser.add_argument('--output-dir', default='.', metavar='/path/to/cgal/build/dir/doc_output', help='The path to the build documentation') + parser.add_argument('--diff', metavar='/path/to/diff', help='The path to the diff file.') parser.add_argument('--cgal-version', help='Path to a version.h file from the current release. If not specified use git hash instead.') parser.add_argument('--version-to-keep', help='indicates the number of release testsuites that should be kept at the publishing location.') parser.add_argument('--do-copy-results', action="store_true", help='Specify this argument if you want to copy the generated documentation into the publishing location.') + parser.add_argument('--doxygen-version', default ='', help='Specify this argument if you want to add a version number to the name of the link to the documentation.') + parser.add_argument('--master-describe', default ='', help='Specify this argument if you want to add a suffix to the name of the link to the doxygen master documentation.') args = parser.parse_args() @@ -135,7 +146,14 @@ def main(): title=d('#maintitle') title.text(title.text() + ' for ' + version_string) write_out_html(d, './index.html') - + + # does the diff exist ? + diff='n/a' + if args.diff: + diff_file=args.diff + if not os.path.isfile(diff_file): + sys.stderr.write('Diff file ' + diff_file + ' is not a file. Cannot diff.\n') + sys.exit(1) if args.publish: if args.publish.endswith('/'): publish_dir=args.publish @@ -150,12 +168,12 @@ def main(): sys.stderr.write('Logs for this revision have already been publish under: ' + publish_dir + 'log' + version_string + ' Cannot publish.\n') sys.exit(1) - + log_target=publish_dir + version_string # does the index file exist? if not write out a skeleton try: with open(publish_dir + 'index.html') as f: pass except IOError as e: - print('No index.html in the publish directory found. Writing a skeleton.') + print('No index.html in the publish directory found. Writing a skeleton.') with open(publish_dir + 'index.html', 'w') as f: f.write('''