diff --git a/.gitattributes b/.gitattributes
index 38320ad4f0b..4211b302eb1 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -58,7 +58,6 @@ Scripts/developer_scripts/check_svn_keywords text eol=lf
Scripts/developer_scripts/create_cgal_test text eol=lf
Scripts/developer_scripts/create_cgal_test_with_cmake text eol=lf
Scripts/developer_scripts/create_internal_release text eol=lf
-Scripts/developer_scripts/create_macosx_installer text eol=lf
Scripts/developer_scripts/create_new_release text eol=lf
Scripts/developer_scripts/detect_files_with_mixed_eol_styles text eol=lf
Scripts/developer_scripts/detect_packages_licenses text eol=lf
diff --git a/.github/workflows/build_doc.yml b/.github/workflows/build_doc.yml
index 9735cd3d3c8..e0813de0236 100644
--- a/.github/workflows/build_doc.yml
+++ b/.github/workflows/build_doc.yml
@@ -1,56 +1,115 @@
-name: Documentation
+name: Build Documentation
on:
+ workflow_dispatch:
+ inputs:
+ pr_number:
+ description: 'Pull request number for which the documentation should be built'
+ type: number
+ required: true
+ doc_version:
+ description: 'Version number of the documentation build'
+ type: string
+ required: true
+ force_build:
+ description: 'Force the build of the documentation'
+ type: boolean
+ required: false
+ default: false
+
issue_comment:
- types: [created]
+ types: [created]
+
+env:
+ author_association: ${{ github.event.comment.author_association }}
+ comment_body: ${{ github.event.comment.body }}
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
- build:
+ pre_build_checks:
+ runs-on: ubuntu-latest
+ name: Trigger the build?
+ outputs:
+ trigger_build: ${{ steps.get_doc_version.outputs.result && steps.get_doc_version.outputs.result != '' }}
+ force_build: ${{ steps.check_comment_body.outputs.force_build }}
+ pr_number: ${{ steps.get_pr_number.outputs.pr_number }}
+ doc_version: ${{ steps.get_doc_version.outputs.result }}
+ steps:
+ - name: Display inputs
+ run: |
+ echo "pr_number=${{ inputs.pr_number || github.event.issue.number }}"
+ echo "doc_version=${{ inputs.doc_version }}"
+ echo "force_build=${{ inputs.force_build || startsWith(env.comment_body, '/force-build:') }}"
+ - name: Check comment body
+ id: check_comment_body
+ env:
+ trigger_build: ${{ inputs && inputs.pr_number || startsWith(env.comment_body, '/build:') || startsWith(env.comment_body, '/force-build:') }}
+ force_build: ${{ inputs && inputs.force_build || startsWith(env.comment_body, '/force-build:') }}
+ if: inputs.pr_number || startsWith(env.comment_body, '/build:') || startsWith(env.comment_body, '/force-build:')
+ run: |
+ if [ "${trigger_build}" = "false" ]; then
+ echo "No build requested"
+ exit 1
+ fi
+ echo "force_build=${force_build}" >> $GITHUB_OUTPUT
+ echo "trigger_build=${trigger_build}" >> $GITHUB_OUTPUT
+ - name: Check permissions
+ if: ( steps.check_comment_body.outputs.trigger_build || false ) && (inputs.pr_number || env.author_association == 'OWNER' || env.author_association == 'MEMBER')
+ run: echo "Authorized"
+
+ - name: No permissions
+ if: ( steps.check_comment_body.outputs.trigger_build || false ) && (! inputs.pr_number && env.author_association != 'OWNER' && env.author_association != 'MEMBER' )
+ run: |
+ echo 'ERROR: User ${{ github.actor }} is not allowed to trigger the build of the documentation with /build:* or /force-build:*'
+ exit 1
+
+ - name: Get PR number
+ if: ( steps.check_comment_body.outputs.trigger_build || false )
+ id: get_pr_number
+ env:
+ pr_number: ${{ inputs.pr_number || github.event.issue.number }}
+ run: echo "pr_number=$pr_number" >> $GITHUB_OUTPUT
+
+ - name: Get doc version
+ if: ( steps.check_comment_body.outputs.trigger_build || false )
+ uses: actions/github-script@v7
+ id: get_doc_version
+ with:
+ result-encoding: string
+ script: |
+ if ( context.payload.input && context.payload.inputs.doc_version ) {
+ return context.payload.inputs.doc_version
+ }
+ const body = context.payload.comment.body
+ const re = /\/(force-)?build:(\w+)\s*/;
+ if(re.test(body)) {
+ const res = re.exec(body)
+ return res[2]
+ }
+ throw new Error('No version found')
+
+ build_doc:
+ name: |
+ ${{ format('{0}: Build Documentation version "{1}"', github.actor, needs.pre_build_checks.outputs.doc_version) }}
+ needs: pre_build_checks
permissions:
contents: read # to fetch code (actions/checkout)
pull-requests: write # to create comment
-
runs-on: ubuntu-latest
+ env:
+ force_build: ${{ needs.pre_build_checks.outputs.force_build }}
+ pr_number: ${{ needs.pre_build_checks.outputs.pr_number }}
+ doc_version: ${{ needs.pre_build_checks.outputs.doc_version }}
+ if: ${{ fromJSON(needs.pre_build_checks.outputs.trigger_build || false) }}
steps:
- - uses: actions/github-script@v7
- id: get_round
- with:
- result-encoding: string
- script: |
- const asso = context.payload.comment.author_association
- if(asso == 'OWNER' || asso == 'MEMBER') {
- const body = context.payload.comment.body
- if(body.includes("build:")) {
- const re = /\/(force-)?build:(\w+)\s*/;
- if(re.test(body)){
- const res = re.exec(body)
- if(body.includes("force-")) {
- return res[2]+":yes"
- }
- else{
- return res[2]+":no"
- }
- }
- }
- }
- return 'stop'
- - uses: actions/github-script@v7
- if: steps.get_round.outputs.result != 'stop'
- id: get_pr_number
- with:
- result-encoding: string
- script: |
- //get pullrequest url
- const pr_number = context.payload.issue.number
- return pr_number
- name: Emoji-comment
+ if: github.event_name == 'issue_comment'
+ continue-on-error: true
uses: actions/github-script@v7
- if: steps.get_round.outputs.result != 'stop'
with:
script: |
github.rest.reactions.createForIssueComment({
@@ -62,17 +121,23 @@ jobs:
- uses: actions/checkout@v4
name: "checkout branch"
- if: steps.get_round.outputs.result != 'stop'
with:
- repository: ${{ github.repository }}
- ref: refs/pull/${{ steps.get_pr_number.outputs.result }}/merge
- fetch-depth: 2
+ repository: ${{ github.repository }}
+ ref: refs/pull/${{ env.pr_number }}/head
+ fetch-depth: 0
- - name: install dependencies
- if: steps.get_round.outputs.result != 'stop'
+ - name: Install dependencies
run: |
set -x
- sudo apt-get update && sudo apt-get install -y graphviz ssh bibtex2html
+
+ # Install Github CLI `gh`
+ (type -p wget >/dev/null || (sudo apt update && sudo apt-get install wget -y))
+ sudo mkdir -p -m 755 /etc/apt/keyrings
+ wget -qO- https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null
+ sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg
+ echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
+
+ sudo apt-get update && sudo apt-get install -y gh cmake graphviz ssh bibtex2html
sudo pip install lxml
sudo pip install pyquery
wget --no-verbose -O doxygen_exe https://cgal.geometryfactory.com/~cgaltest/doxygen_1_9_6_patched/doxygen
@@ -81,36 +146,40 @@ jobs:
git config --global user.email "cgal@geometryfactory.com"
git config --global user.name "cgaltest"
- - name: configure all
- if: steps.get_round.outputs.result != 'stop'
+ - name: CMake configuration of Documentation/doc
run: |
set -ex
mkdir -p build_doc && cd build_doc && cmake ../Documentation/doc
- - name: Build and Upload Doc
+ - name: Build and upload Doc
id: build_and_run
- if: steps.get_round.outputs.result != 'stop'
+ env:
+ GH_TOKEN: ${{ github.token }}
run: |
set -ex
- PR_NUMBER=${{ steps.get_pr_number.outputs.result }}
- TMP_ROUND=${{ steps.get_round.outputs.result }}
- ROUND=$(echo $TMP_ROUND | cut -d ":" -f 1)
- force=$(echo $TMP_ROUND | cut -d ":" -f 2)
- wget --no-verbose cgal.github.io -O tmp.html
- if ! egrep -q "\/$PR_NUMBER\/$ROUND" tmp.html || [ "$force" = "yes" ]; then
+ PR_NUMBER=$pr_number
+ ROUND=$doc_version
+ force=$force_build
+ wget --no-verbose cgal.github.io -O index.html
+ if ! egrep -qF "/$PR_NUMBER/$ROUND" index.html || [ "$force" = "yes" ]; then
#list impacted packages
- LIST_OF_PKGS=$(git diff --name-only HEAD^1 HEAD |cut -s -d/ -f1 |sort -u | xargs -I {} echo {} && ls -d {}/package_info 2>/dev/null |cut -d/ -f1 |egrep -v Installation||true)
+ LIST_OF_PKGS=$(git diff --name-only origin/master...HEAD |cut -s -d/ -f1 |sort -u | xargs -I {} echo {} && ls -d {}/package_info 2>/dev/null |cut -d/ -f1 |egrep -v Installation||true)
if [ "$LIST_OF_PKGS" = "" ]; then
echo "DoxygenError=No package affected." >> $GITHUB_OUTPUT
exit 1
fi
+ for p in $LIST_OF_PKGS; do
+ if [ -f $p/doc/$p/dependencies ]; then
+ LIST_OF_PKGS="$LIST_OF_PKGS $(cat $p/doc/$p/dependencies)"
+ fi
+ done
+ LIST_OF_PKGS=$(echo $LIST_OF_PKGS | tr ' ' '\n' | sort -u)
cd build_doc && make -j$(nproc) doc
- make -j$(nproc) doc_with_postprocessing 2>tmp.log
- if [ -s tmp.log ]; then
- content=`cat ./tmp.log`
+ make -j$(nproc) doc_with_postprocessing 2>build.log
+ if [ -s build.log ]; then
delimiter="$(openssl rand -hex 8)"
echo "DoxygenError<<${delimiter}" >> "${GITHUB_OUTPUT}"
- cat tmp.log >> "${GITHUB_OUTPUT}"
+ cat build.log >> "${GITHUB_OUTPUT}"
echo "${delimiter}" >> "${GITHUB_OUTPUT}"
exit 1
fi
@@ -118,18 +187,16 @@ jobs:
git clone https://CGAL:${{ secrets.PUSH_TO_CGAL_GITHUB_IO_TOKEN }}@github.com/CGAL/cgal.github.io.git
mkdir -p cgal.github.io/${PR_NUMBER}/$ROUND
rm cgal.github.io/${PR_NUMBER}/$ROUND/* -rf
- for f in $LIST_OF_PKGS
+ for f in $LIST_OF_PKGS Manual
do
if [ -d ./build_doc/doc_output/$f ]; then
cp -r ./build_doc/doc_output/$f ./cgal.github.io/${PR_NUMBER}/$ROUND
fi
done
- cp -r ./build_doc/doc_output/Manual ./cgal.github.io/${PR_NUMBER}/$ROUND
cd ./cgal.github.io
- egrep -v " ${PR_NUMBER}\." index.html > tmp.html || true
- echo "
Manual for PR ${PR_NUMBER} ($ROUND)." >> ./tmp.html
- mv tmp.html index.html
- git add ${PR_NUMBER}/$ROUND index.html && git commit -q --amend -m "base commit" && git push -q -f -u origin master
+ echo "Manual for PR ${PR_NUMBER} ($ROUND)." >> ./index.html
+ ./cleanup.bash
+ git add ${PR_NUMBER}/$ROUND index.html && git commit -q --amend -m "sole commit" && git push -q -f -u origin master
else
echo "DoxygenError=This round already exists. Overwrite it with /force-build." >> $GITHUB_OUTPUT
exit 1
@@ -137,13 +204,11 @@ jobs:
- name: Post address
uses: actions/github-script@v7
- if: ${{ success() && steps.get_round.outputs.result != 'stop' }}
+ if: ${{ success() }}
with:
script: |
- const tmp_round = "${{ steps.get_round.outputs.result }}";
- const id = tmp_round.indexOf(":");
- const round = tmp_round.substring(0,id);
- const address = "The documentation is built. It will be available, after a few minutes, here: https://cgal.github.io/${{ steps.get_pr_number.outputs.result }}/"+round+"/Manual/index.html"
+ const round = "${{ env.doc_version }}"
+ const address = "The documentation is built. It will be available, after a few minutes, here: https://cgal.github.io/${{ env.pr_number }}/"+round+"/Manual/index.html"
github.rest.issues.createComment({
owner: "CGAL",
repo: "cgal",
@@ -155,7 +220,7 @@ jobs:
env:
ERRORMSG: ${{steps.build_and_run.outputs.DoxygenError}}
uses: actions/github-script@v7
- if: ${{ failure() && steps.get_round.outputs.result != 'stop' }}
+ if: ${{ failure() }}
with:
script: |
const error = process.env.ERRORMSG
diff --git a/.github/workflows/delete_doc.yml b/.github/workflows/delete_doc.yml
index 0910e74ef3b..00fd3bac27a 100644
--- a/.github/workflows/delete_doc.yml
+++ b/.github/workflows/delete_doc.yml
@@ -1,27 +1,33 @@
name: Documentation Removal
on:
+ workflow_dispatch:
+ inputs:
+ PR_NUMBER:
+ description: 'Pull request number for which the documentation should be removed'
+ type: number
+ required: true
pull_request_target:
- types: [closed, removed, workflow_dispatch]
+ types: [closed]
permissions:
contents: read
jobs:
- build:
-
+ delete_doc:
permissions:
contents: write # for Git to git push
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- - name: delete directory
+ - name: delete directory ${{ github.event.inputs.PR_NUMBER || github.event.pull_request.number }}/ in cgal.github.io
+ env:
+ PR_NUMBER: ${{ github.event.inputs.PR_NUMBER || github.event.pull_request.number }}
run: |
set -x
git config --global user.email "cgal@geometryfactory.com"
git config --global user.name "cgaltest"
git clone https://CGAL:${{ secrets.PUSH_TO_CGAL_GITHUB_IO_TOKEN }}@github.com/CGAL/cgal.github.io.git
- PR_NUMBER=$(python -c "import json; import os; y = json.load(open(os.environ['GITHUB_EVENT_PATH'])); print(y[\"number\"])")
cd cgal.github.io/
egrep -v " ${PR_NUMBER}\." index.html > tmp.html || true
if [ -n "$(diff -q ./index.html ./tmp.html)" ]; then
diff --git a/.github/workflows/reuse.yml b/.github/workflows/reuse.yml
index f76a99b18dd..e312e8a88ad 100644
--- a/.github/workflows/reuse.yml
+++ b/.github/workflows/reuse.yml
@@ -12,15 +12,15 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: REUSE version
- uses: fsfe/reuse-action@v3
+ uses: fsfe/reuse-action@v4
with:
args: --version
- name: REUSE lint
- uses: fsfe/reuse-action@v3
+ uses: fsfe/reuse-action@v4
with:
args: --include-submodules lint
- name: REUSE SPDX SBOM
- uses: fsfe/reuse-action@v3
+ uses: fsfe/reuse-action@v4
with:
args: spdx
- name: install dependencies
@@ -30,6 +30,6 @@ jobs:
mkdir -p ./release
cmake -DDESTINATION=./release -DCGAL_VERSION=9.9 -P ./Scripts/developer_scripts/cgal_create_release_with_cmake.cmake
- name: REUSE lint release tarball
- uses: fsfe/reuse-action@v3
+ uses: fsfe/reuse-action@v4
with:
args: --root ./release/CGAL-9.9 --include-submodules lint
diff --git a/.gitignore b/.gitignore
index 90f003227c6..b6fe952fd56 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1058,7 +1058,7 @@ cmake_install.cmake
*~
.#*
-# MacOS file https://en.wikipedia.org/wiki/.DS_Store
+# macOS file https://en.wikipedia.org/wiki/.DS_Store
.DS_Store
# Binaries:
diff --git a/.reuse/dep5 b/.reuse/dep5
deleted file mode 100644
index 06784d71d6b..00000000000
--- a/.reuse/dep5
+++ /dev/null
@@ -1,12 +0,0 @@
-Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
-Upstream-Name: CGAL
-Upstream-Contact: CGAL Editorial Board
-Source: https://github.com/CGAL/cgal
-
-Files: .* *.cmake *.md .github/* Maintenance/* */TODO */doc/* */deb/* */applications/* */doc_html/* */scripts/* */developer_scripts/* */demo/* */examples/* */src/* */test/* */benchmarks/* */benchmark/* */package_info/* */data/* */cmake/*
-Copyright: 1995-2023 The CGAL Project
-License: CC0-1.0
-
-Files: CMakeLists.txt GraphicsView/include/CGAL/Qt/ImageInterface.ui GraphicsView/include/CGAL/Qt/resources/qglviewer-icon.xpm Installation/AUTHORS Installation/CMakeLists.txt Installation/README Installation/auxiliary/cgal_create_cmake_script.1 Installation/auxiliary/gmp/README Installation/include/CGAL/license/gpl_package_list.txt MacOSX/auxiliary/cgal_app.icns copyright
-Copyright: 1995-2023 The CGAL Project
-License: CC0-1.0
diff --git a/AABB_tree/include/CGAL/AABB_tree.h b/AABB_tree/include/CGAL/AABB_tree.h
index c63fdf38679..9dd8460abd2 100644
--- a/AABB_tree/include/CGAL/AABB_tree.h
+++ b/AABB_tree/include/CGAL/AABB_tree.h
@@ -551,7 +551,7 @@ public:
traits.intersection(query, singleton_data());
break;
default: // if(size() >= 2)
- root_node()->template traversal_with_priority_and_group_traversal(m_primitives, query, traits, m_primitives.size(), 0, group_traversal_bound);
+ root_node()->traversal_with_priority_and_group_traversal(m_primitives, query, traits, m_primitives.size(), 0, group_traversal_bound);
}
}
diff --git a/AABB_tree/include/CGAL/AABB_tree/internal/AABB_node.h b/AABB_tree/include/CGAL/AABB_tree/internal/AABB_node.h
index a5c09f42fb4..bf878268f59 100644
--- a/AABB_tree/include/CGAL/AABB_tree/internal/AABB_node.h
+++ b/AABB_tree/include/CGAL/AABB_tree/internal/AABB_node.h
@@ -56,7 +56,7 @@ public:
/**
* @brief General traversal query
* @param query the query
- * @param traits the traversal traits that define the traversal behaviour
+ * @param traits the traversal traits that define the traversal behavior
* @param nb_primitives the number of primitive
*
* General traversal query. The traits class allows using it for the various
diff --git a/Algebraic_foundations/include/CGAL/Test/_test_algebraic_structure.h b/Algebraic_foundations/include/CGAL/Test/_test_algebraic_structure.h
index 56c421eee1f..08412f96ea4 100644
--- a/Algebraic_foundations/include/CGAL/Test/_test_algebraic_structure.h
+++ b/Algebraic_foundations/include/CGAL/Test/_test_algebraic_structure.h
@@ -426,7 +426,7 @@ void test_algebraic_structure_intern(
//commutative
assert(a+b+c==c+b+a);
assert(a*b*c==c*b*a);
- //distributiv
+ //distributive
assert((a-b)*c==a*c-b*c);
assert((a+b)*c==a*c+b*c);
//binom
diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes.h
index 654ffa9a46d..1527a3eb7d4 100644
--- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes.h
+++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes.h
@@ -65,7 +65,7 @@ class Bitstream_descartes;
/*
- * \brief Thrown whenever a non-specialised virtual member function is called
+ * \brief Thrown whenever a non-specialized virtual member function is called
*/
class Virtual_method_exception {};
@@ -128,7 +128,7 @@ public:
/*!
* Constructor computing an interval containing all real roots of \c f,
- * and initialising the Bitstream Descartes tree
+ * and initializing the Bitstream Descartes tree
*/
Generic_descartes_rep(Bitstream_descartes_type type,
Polynomial f,
@@ -170,7 +170,7 @@ public:
/*!
* Constructor that copies the Bitstream tree given from outside
- * and initialising the Bitstream Descartes tree
+ * and initializing the Bitstream Descartes tree
* The tree must "fit" to the polynomial
*/
Generic_descartes_rep(Bitstream_descartes_type type,
@@ -367,7 +367,7 @@ public:
/*!
* \brief When does the isolation algorithm terminate?
*
- * This method must be specialised by derived classes
+ * This method must be specialized by derived classes
*/
virtual bool termination_condition() {
throw Virtual_method_exception();
@@ -378,7 +378,7 @@ public:
* \brief gives an opportunity to process the nodes after
* the subdivision steps are finished
*
- * This method must be specialised by derived classes, but can
+ * This method must be specialized by derived classes, but can
* remain empty in many cases.
*/
virtual void process_nodes() {
@@ -389,7 +389,7 @@ public:
/*! \brief returns whether the \c i th root is definitely a simple root
* of the isolated polynomial
*
- * Must be specialised by derived class
+ * Must be specialized by derived class
*/
virtual bool is_certainly_simple_root(int) const {
throw Virtual_method_exception();
@@ -399,7 +399,7 @@ public:
/*! \brief returns whether the \c i th root is definitely a multiple root
* of the isolated polynomial
*
- * Must be specialised by derived class
+ * Must be specialized by derived class
*/
virtual bool is_certainly_multiple_root(int) const {
throw Virtual_method_exception();
@@ -1082,7 +1082,7 @@ protected:
* variant of the Bitstream Descartes method: The Square_free_descartes_tag
* starts the usual Bitstream method for square free integer polynomials.
* With the M_k_descartes tag, it is able to handle one multiple root in
- * favourable situations, the Backshear_descartes_tag allows to isolate
+ * favorable situations, the Backshear_descartes_tag allows to isolate
* even more complicated polynomials, if the multiple roots with even
* multiplicity can be refined from outside. See the corresponding
* constructors for more information.
diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes_rndl_tree.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes_rndl_tree.h
index a76e1c6ceca..8e64832546a 100644
--- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes_rndl_tree.h
+++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Bitstream_descartes_rndl_tree.h
@@ -865,7 +865,7 @@ public:
by trying randomly and checking. This randomization means
the same polynomial and same initial interval may give rise
to different intervals each time this class is used.
- As indicated in the paper, we favour subdivision ratios
+ As indicated in the paper, we favor subdivision ratios
with a small denominator. Hence we first try denominator
2 (subdivision at midpoint), then denominator 16, and
only then the "proper" denominator prescribed by theory.
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 6fecb592a12..a3dc59edfea 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
@@ -469,7 +469,7 @@ public:
* (\c SHEAR_ONLY_AT_IRRATIONAL_STRATEGY)
* is to \c shear the curve
* if a degenerate situation is detected during the analysis,
- * except at rational x-coordinates where the curve can be analysed
+ * except at rational x-coordinates where the curve can be analyzed
* more directly. The analysis
* is then performed in the sheared system, and finally translated back
* into the original system.
diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/LRU_hashed_map.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/LRU_hashed_map.h
index e53c9100aec..1a710084058 100644
--- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/LRU_hashed_map.h
+++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/LRU_hashed_map.h
@@ -140,7 +140,7 @@ public:
virtual ~LRU_hashed_map()
{ }
- /*! \brief implements cache-like behaviour of the map
+ /*! \brief implements cache-like behavior of the map
*
* If the object is not in the map, it is constructed using \c Creator
* and added to the map
@@ -312,7 +312,7 @@ public:
~LRU_hashed_map_with_kernel()
{ }
- /*! \brief implements cache-like behaviour of the map
+ /*! \brief implements cache-like behavior of the map
*
* If the object is not in the map, it is constructed using \c Creator
* and added to the map
diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/exceptions.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/exceptions.h
index 4dd9c4b5122..6a184c377e8 100644
--- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/exceptions.h
+++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/exceptions.h
@@ -25,7 +25,7 @@ namespace CGAL {
/*!
* \brief Exception class for not sufficiently generic positions.
*
- * Must be thrown whenever a curve cannot be analysed because its position
+ * Must be thrown whenever a curve cannot be analyzed because its position
* is not "good enough".
*/
class Non_generic_position_exception {
@@ -40,7 +40,7 @@ namespace CGAL {
/*!
* \brief Exception class for not sufficiently generic positions.
*
- * Must be thrown whenever a curve cannot be analysed because its position
+ * Must be thrown whenever a curve cannot be analyzed because its position
* is not "good enough".
*/
template
diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/flags.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/flags.h
index 6b402fbfd23..0317bf7ea11 100644
--- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/flags.h
+++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/flags.h
@@ -76,7 +76,7 @@
/**
* If set, the curve and curve pair analysis are using specialized code
- * to analyse conic curves, i.e. curves of degree 2
+ * to analyze conic curves, i.e. curves of degree 2
*/
#ifndef CGAL_ACK_USE_SPECIAL_TREATMENT_FOR_CONIX
#define CGAL_ACK_USE_SPECIAL_TREATMENT_FOR_CONIX 0
diff --git a/Algebraic_kernel_d/test/Algebraic_kernel_d/Curve_analysis_2.cpp b/Algebraic_kernel_d/test/Algebraic_kernel_d/Curve_analysis_2.cpp
index f8ba0d8495e..9527a887650 100644
--- a/Algebraic_kernel_d/test/Algebraic_kernel_d/Curve_analysis_2.cpp
+++ b/Algebraic_kernel_d/test/Algebraic_kernel_d/Curve_analysis_2.cpp
@@ -330,7 +330,7 @@ template void test_routine() {
#endif
}
- { // More tests...just analyse some curves and compute their segments
+ { // More tests...just analyze some curves and compute their segments
Poly_int2 f = from_string("P[8(0,P[8(0,24)(1,-8)(2,-162)(3,204)(4,106)(5,-340)(6,240)(7,-72)(8,8)])(1,P[6(0,-60)(1,8)(2,304)(3,-400)(4,148)(5,8)(6,-8)])(2,P[6(0,18)(1,80)(2,-165)(3,-132)(4,367)(5,-212)(6,38)])(3,P[4(0,-30)(1,-136)(2,264)(3,-72)(4,-26)])(4,P[4(0,-15)(1,36)(2,89)(3,-144)(4,49)])(5,P[2(0,30)(1,-24)(2,-6)])(6,P[2(0,-6)(1,-28)(2,22)])(8,P[0(0,3)])]");
Curve_analysis_2 curve= construct_curve_2(f);
#if CGAL_ACK_DEBUG_FLAG
diff --git a/Alpha_shapes_3/include/CGAL/Alpha_shape_3.h b/Alpha_shapes_3/include/CGAL/Alpha_shape_3.h
index a4a93f82515..f468f9056f8 100644
--- a/Alpha_shapes_3/include/CGAL/Alpha_shape_3.h
+++ b/Alpha_shapes_3/include/CGAL/Alpha_shape_3.h
@@ -1638,7 +1638,7 @@ compute_edge_status( const Cell_handle& c,
last=ccirc;
while (is_infinite(ccirc) ) ++ccirc; //skip infinite incident cells
alpha = (*ccirc).get_alpha();
- as.set_alpha_mid(alpha); // initialise as.alpha_mid to alpha value of an incident cell
+ as.set_alpha_mid(alpha); // initialize as.alpha_mid to alpha value of an incident cell
as.set_alpha_max(alpha); // same for as.alpha_max
while (++ccirc != last)
{
diff --git a/Alpha_shapes_3/test/Alpha_shapes_3/include/CGAL/_count_alpha.h b/Alpha_shapes_3/test/Alpha_shapes_3/include/CGAL/_count_alpha.h
index f7c0fb41d4d..c38cd3bb53e 100644
--- a/Alpha_shapes_3/test/Alpha_shapes_3/include/CGAL/_count_alpha.h
+++ b/Alpha_shapes_3/test/Alpha_shapes_3/include/CGAL/_count_alpha.h
@@ -218,7 +218,7 @@ test_filtration(AS &A, bool verbose)
typename AS::NT alpha;
if(verbose) {
std::cerr << std::endl;
- std::cerr << "Analyse filtration " << std::endl;
+ std::cerr << "Analyze filtration " << std::endl;
}
for (; filtre_it != filtration.end(); filtre_it++) {
if(assign(vertex, *filtre_it)) {
diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementDemoTab.h b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementDemoTab.h
index 54ece4964c2..febc992fd59 100644
--- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementDemoTab.h
+++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementDemoTab.h
@@ -38,7 +38,6 @@ namespace Qt
{
class Callback;
class ArrangementGraphicsItemBase;
-class ArrangementGraphicsItemBase;
class GraphicsViewCurveInputBase;
class GraphicsViewNavigation;
enum class CurveType;
diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/CurveInputMethods.cpp b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/CurveInputMethods.cpp
index 91a64dad22e..06ebae10a20 100644
--- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/CurveInputMethods.cpp
+++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/CurveInputMethods.cpp
@@ -111,13 +111,10 @@ void CurveInputMethod::beginInput_()
static inline void clearPainterPath(QPainterPath& ppath)
{
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 13, 0))
ppath.clear();
-#else
- ppath = {};
-#endif
}
+
void CurveInputMethod::reset()
{
this->resetInput();
diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/GridGraphicsItem.cpp b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/GridGraphicsItem.cpp
index 535f4684975..01723db026e 100644
--- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/GridGraphicsItem.cpp
+++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/GridGraphicsItem.cpp
@@ -67,11 +67,7 @@ void GridGraphicsItem::setSpacing(int spacing_)
static inline qreal
horizontalAdvance(const QFontMetrics& fm, const QString& text)
{
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
return fm.horizontalAdvance(text);
-#else
- return fm.boundingRect(text).width();
-#endif
}
void GridGraphicsItem::paint(
diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2_earth/Aos.cpp b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2_earth/Aos.cpp
index 27dd2a5968b..2d782eec1ac 100644
--- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2_earth/Aos.cpp
+++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2_earth/Aos.cpp
@@ -40,7 +40,7 @@ namespace {
Flag(bool init) : v{ init } {}
};
- // EXTENDED AOS for analysing the arrangement
+ // EXTENDED AOS for analyzing the arrangement
using Ext_dcel = CGAL::Arr_extended_dcel;
using Ext_topol_traits =
CGAL::Arr_spherical_topology_traits_2;
diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_counting_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_counting_traits_2.h
index 4707748fff6..55a75efd7de 100644
--- a/Arrangement_on_surface_2/include/CGAL/Arr_counting_traits_2.h
+++ b/Arrangement_on_surface_2/include/CGAL/Arr_counting_traits_2.h
@@ -342,13 +342,13 @@ public:
{}
/*! Operate */
- bool operator()(const X_monotone_curve_2& xc1,
- const X_monotone_curve_2& xc2) const
- { ++m_counter1; return m_object(xc1, xc2); }
+ bool operator()(const Point_2& p1, const Point_2& p2) const
+ { ++m_counter1; return m_object(p1, p2); }
/*! Operate */
- bool operator()(const Point_2& p1, const Point_2& p2) const
- { ++m_counter2; return m_object(p1, p2); }
+ bool operator()(const X_monotone_curve_2& xc1,
+ const X_monotone_curve_2& xc2) const
+ { ++m_counter2; return m_object(xc1, xc2); }
};
/*! A functor that compares compares the y-coordinates of two x-monotone
@@ -563,7 +563,7 @@ public:
*/
class Is_on_x_identification_2 {
private:
- typename Base::Is_on_x_identificiation_2 m_object;
+ typename Base::Is_on_x_identification_2 m_object;
size_t& m_counter1;
size_t& m_counter2;
@@ -571,17 +571,17 @@ public:
/*! Construct */
Is_on_x_identification_2(const Base* base,
size_t& counter1, size_t& counter2) :
- m_object(base->is_on_x_identificiation_2_object()),
+ m_object(base->is_on_x_identification_2_object()),
m_counter1(counter1),
m_counter2(counter2)
{}
/*! Operate */
- Arr_parameter_space operator()(const Point_2& p) const
+ bool operator()(const Point_2& p) const
{ ++m_counter1; return m_object(p); }
/*! Operate */
- Arr_parameter_space operator()(const X_monotone_curve_2& xc) const
+ bool operator()(const X_monotone_curve_2& xc) const
{ ++m_counter2; return m_object(xc); }
};
@@ -666,7 +666,7 @@ public:
*/
class Is_on_y_identification_2 {
private:
- typename Base::Is_on_y_identificiation_2 m_object;
+ typename Base::Is_on_y_identification_2 m_object;
size_t& m_counter1;
size_t& m_counter2;
@@ -674,18 +674,18 @@ public:
/*! Construct */
Is_on_y_identification_2(const Base* base,
size_t& counter1, size_t& counter2) :
- m_object(base->is_on_y_identificiation_2_object()),
+ m_object(base->is_on_y_identification_2_object()),
m_counter1(counter1),
m_counter2(counter2)
{}
/*! Operate */
- Arr_parameter_space operator()(const Point_2& p) const
+ bool operator()(const Point_2& p) const
{ ++m_counter1; return m_object(p); }
/*! Operate */
- Arr_parameter_space operator()(const X_monotone_curve_2& xc) const
+ bool operator()(const X_monotone_curve_2& xc) const
{ ++m_counter2; return m_object(xc); }
};
@@ -824,10 +824,10 @@ public:
m_counters[IS_ON_X_IDENTIFICATION_CURVE_OP]);
}
- Compare_y_on_boundary_2 compare_on_boundary_2_object() const
+ Compare_y_on_boundary_2 compare_y_on_boundary_2_object() const
{ return Compare_y_on_boundary_2(this, m_counters[COMPARE_Y_ON_BOUNDARY_OP]); }
- Compare_y_near_boundary_2 compare_near_boundary_2_object() const
+ Compare_y_near_boundary_2 compare_y_near_boundary_2_object() const
{
return Compare_y_near_boundary_2(this,
m_counters[COMPARE_Y_NEAR_BOUNDARY_OP]);
@@ -943,7 +943,7 @@ Out_stream& operator<<(Out_stream& os,
<< traits.count_parameter_space_in_x_point() << std::endl
<< "# of PARAMETER_SPACE_IN_X curve operation = "
<< traits.count_parameter_space_in_x_curve() << std::endl
- << "# of IS_ON_X_IDENTIFICIATION point operation = "
+ << "# of IS_ON_X_IDENTIFICATION point operation = "
<< traits.count_is_on_x_identification_point() << std::endl
<< "# of IS_ON_X_IDENTIFICATION curve operation = "
<< traits.count_is_on_x_identification_curve() << std::endl
@@ -958,7 +958,7 @@ Out_stream& operator<<(Out_stream& os,
<< traits.count_parameter_space_in_y_point() << std::endl
<< "# of PARAMETER_SPACE_IN_Y curve operation = "
<< traits.count_parameter_space_in_y_curve() << std::endl
- << "# of IS_ON_Y_IDENTIFICIATION point operation = "
+ << "# of IS_ON_Y_IDENTIFICATION point operation = "
<< traits.count_is_on_y_identification_point() << std::endl
<< "# of IS_ON_Y_IDENTIFICATION curve operation = "
<< traits.count_is_on_y_identification_curve() << std::endl
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 ed552b8c9fc..65ab748e0ee 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
@@ -641,8 +641,7 @@ public:
* \param[in] plane the containing plane.
* \param[in] source the source-point direction.
* \param[in] target the target-point direction.
- * \pre Both endpoint lie on the given plane.
- * \pre Both endpoint lie on the given plane.
+ * \pre Both endpoints lie on the given plane.
*/
X_monotone_curve_2 operator()(const Point_2& source, const Point_2& target,
const Direction_3& normal) const
@@ -3113,7 +3112,7 @@ public:
* \param is_directed_right is the arc directed from left to right?
* \param is_full is the arc a full circle?
* \param is_degenerate is the arc degenerate (single point)?
- * \pre Both endpoint lie on the given plane.
+ * \pre Both endpoints lie on the given plane.
*/
Arr_x_monotone_geodesic_arc_on_sphere_3
(const Arr_extended_direction_3& src,
@@ -3312,8 +3311,7 @@ public:
* \param plane the containing plane.
* \param source the source-point direction.
* \param target the target-point direction.
- * \pre Both endpoint lie on the given plane.
- * \pre Both endpoint lie on the given plane.
+ * \pre Both endpoints lie on the given plane.
*/
Arr_x_monotone_geodesic_arc_on_sphere_3
(const Arr_extended_direction_3& source,
diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Rational_arc_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Rational_arc_2.h
index c1a690bcb8e..aea70d5331a 100644
--- a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Rational_arc_2.h
+++ b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Rational_arc_2.h
@@ -339,7 +339,7 @@ public:
if (! valid)
return;
- // Analyze the behaviour of the rational function at x = -oo (the source).
+ // Analyze the behavior of the rational function at x = -oo (the source).
Algebraic y0;
const Arr_parameter_space inf_s =
_analyze_at_minus_infinity (_numer, _denom, y0);
@@ -351,7 +351,7 @@ public:
else // if (inf_s == ARR_INTERIOR)
_ps = Point_2 (0, y0);
- // Analyze the behaviour of the rational function at x = +oo (the target).
+ // Analyze the behavior of the rational function at x = +oo (the target).
const Arr_parameter_space inf_t =
_analyze_at_plus_infinity (_numer, _denom, y0);
@@ -735,7 +735,7 @@ public:
*/
Self split_at_pole (const Algebraic& x0)
{
- // Analyze the behaviour of the function near the given pole.
+ // Analyze the behavior of the function near the given pole.
const std::pair signs = _analyze_near_pole (x0);
const CGAL::Sign sign_left = signs.first;
const CGAL::Sign sign_right = signs.second;
diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_polycurve_basic_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_polycurve_basic_traits_2.h
index 30c326b1876..f540146b2cb 100644
--- a/Arrangement_on_surface_2/include/CGAL/Arr_polycurve_basic_traits_2.h
+++ b/Arrangement_on_surface_2/include/CGAL/Arr_polycurve_basic_traits_2.h
@@ -26,6 +26,7 @@
#include
#include
+#include
#include
#include
@@ -40,44 +41,44 @@ namespace CGAL {
template >
class Arr_polycurve_basic_traits_2 {
public:
- typedef SubcurveTraits_2 Subcurve_traits_2;
+ using Subcurve_traits_2 = SubcurveTraits_2;
/// \name Types and functors inherited from the subcurve geometry traits.
//@{
- typedef typename Subcurve_traits_2::Has_left_category Has_left_category;
- typedef typename Subcurve_traits_2::Has_do_intersect_category
- Has_do_intersect_category;
+ using Has_left_category = typename Subcurve_traits_2::Has_left_category;
+ using Has_do_intersect_category =
+ typename Subcurve_traits_2::Has_do_intersect_category;
- typedef typename Subcurve_traits_2::Left_side_category Left_side_category;
- typedef typename Subcurve_traits_2::Bottom_side_category Bottom_side_category;
- typedef typename Subcurve_traits_2::Top_side_category Top_side_category;
- typedef typename Subcurve_traits_2::Right_side_category Right_side_category;
+ using Left_side_category = typename Subcurve_traits_2::Left_side_category;
+ using Bottom_side_category = typename Subcurve_traits_2::Bottom_side_category;
+ using Top_side_category = typename Subcurve_traits_2::Top_side_category;
+ using Right_side_category = typename Subcurve_traits_2::Right_side_category;
- typedef typename Arr_all_sides_oblivious_category::result
- All_sides_oblivious_category;
+ using All_sides_oblivious_category =
+ typename Arr_all_sides_oblivious_category::result;
- typedef typename Arr_two_sides_category::result
- Bottom_or_top_sides_category;
+ using Bottom_or_top_sides_category =
+ typename Arr_two_sides_category::result;
- typedef typename Subcurve_traits_2::Point_2 Point_2;
- typedef typename Subcurve_traits_2::X_monotone_curve_2 X_monotone_subcurve_2;
- typedef typename Subcurve_traits_2::Multiplicity Multiplicity;
+ using Point_2 = typename Subcurve_traits_2::Point_2;
+ using X_monotone_subcurve_2 = typename Subcurve_traits_2::X_monotone_curve_2;
+ using Multiplicity = typename Subcurve_traits_2::Multiplicity;
//@}
// Backward compatibility:
- typedef X_monotone_subcurve_2 X_monotone_segment_2;
+ using X_monotone_segment_2 = X_monotone_subcurve_2;
private:
- typedef Arr_polycurve_basic_traits_2 Self;
+ using Self = Arr_polycurve_basic_traits_2;
// Data members:
- const Subcurve_traits_2* m_subcurve_traits; // The base segment-traits class.
+ const Subcurve_traits_2* m_subcurve_traits; // the base segment-traits class.
bool m_own_traits;
protected:
@@ -91,8 +92,8 @@ public:
{}
/*! Construct from a subcurve traits.
- * \param seg_traits an already existing subcurve tarits which is passed will
- * be used by the class.
+ * \param seg_traits an already existing subcurve tarits, which is passed in;
+ * it will be used by the class.
*/
Arr_polycurve_basic_traits_2(const Subcurve_traits_2* geom_traits) :
m_subcurve_traits(geom_traits), m_own_traits(false) {}
@@ -126,64 +127,67 @@ public:
// ArrangementBasicTraits concept.
//@{
- /*! An x monotone polycurve represents a continuous piecewise-linear
- * curve which is either strongly x-monotone or vertical. Again,
+ /*! An \f$x\f$-monotone polycurve represents a continuous piecewise-linear
+ * curve which is either strongly \f$x\f$-monotone or vertical. Again,
* the polycurve is without degenerated subcurves.
*/
- typedef internal::X_monotone_polycurve_2
- X_monotone_curve_2;
- typedef typename X_monotone_curve_2::Size Size;
- typedef typename X_monotone_curve_2::size_type size_type;
+ using X_monotone_curve_2 =
+ internal::X_monotone_polycurve_2;
+ using Size = typename X_monotone_curve_2::Size;
+ using size_type = typename X_monotone_curve_2::size_type;
-
- /*! Compare the x-coordinates of two points. */
+ //! Compare the \f$x\f$-coordinates of two points.
class Compare_x_2 {
protected:
- typedef Arr_polycurve_basic_traits_2
- Polycurve_basic_traits_2;
+ using Polycurve_basic_traits_2 =
+ Arr_polycurve_basic_traits_2;
- /*! The polycurve traits (in case it has state). */
+ //! The polycurve traits (in case it has state).
const Polycurve_basic_traits_2& m_poly_traits;
- public:
+ friend class Arr_polycurve_basic_traits_2;
+
/*! Constructor. */
Compare_x_2(const Polycurve_basic_traits_2& traits) :
m_poly_traits(traits)
{}
- /*! Compare the x-coordinates of two directional points.
+ public:
+ /*! Compare the \f$x\f$-coordinates of two directional points.
* \param p1 the first directional point.
* \param p2 the second directional point.
- * \return SMALLER - x(p1) < x(p2);
- * EQUAL - x(p1) = x(p2);
- * LARGER - x(p1) > x(p2).
+ * \return `SMALLER` - \f$x\f$(`p1`) < \f$x\f$(`p2`);
+ * `EQUAL` - \f$x\f$(`p1`) = \f$x\f$(`p2`);
+ * `LARGER` - \f$x\f$(`p1`) > \f$x\f$(`p2`).
* \pre p1 does not lie on the boundary.
* \pre p2 does not lie on the boundary.
*/
Comparison_result operator()(const Point_2& p1, const Point_2& p2) const
{ return m_poly_traits.subcurve_traits_2()->compare_x_2_object()(p1, p2); }
- /*! Compare two ends of x-monotone curves in x.
+ /*! Compare two ends of \f$x\f$-monotone curves in \f$x\f$.
* \param xs1 the first curve.
- * \param ce1 the curve-end indicator of the first x-monotone curve xs1:
- * ARR_MIN_END - the minimal end of xs1 or
- * ARR_MAX_END - the maximal end of xs1.
+ * \param ce1 the curve-end indicator of the first \f$x\f$-monotone curve
+ * `xs1`:
+ * `ARR_MIN_END` - the minimal end of `xs1` or
+ * `ARR_MAX_END` - the maximal end of `xs1`.
* \param p2 the second curve end.
*/
Comparison_result operator()(const X_monotone_subcurve_2& xs1,
- Arr_curve_end ce1,
- const Point_2& p2)
+ Arr_curve_end ce1, const Point_2& p2)
{ return operator()(xs1, ce1, p2, All_sides_oblivious_category()); }
- /*! Compare two ends of x-monotone curves in x.
+ /*! Compare two ends of \f$x\f$-monotone curves in x.
* \param xs1 the first curve.
- * \param ce1 the curve-end indicator of the first x-monotone curve xs1:
- * ARR_MIN_END - the minimal end of xs1 or
- * ARR_MAX_END - the maximal end of xs1.
+ * \param ce1 the curve-end indicator of the first \f$x\f$-monotone curve
+ * `xs1`:
+ * `ARR_MIN_END` - the minimal end of `xs1` or
+ * `ARR_MAX_END` - the maximal end of `xs1`.
* \param xs2 the second curve.
- * \param ce2 the curve-end indicator of the second x-monoton curve xs2:
- * ARR_MIN_END - the minimal end of xs2 or
- * ARR_MAX_END - the maximal end of xs2.
+ * \param ce2 the curve-end indicator of the second \f$x\f$-monoton curve
+ * `xs2`:
+ * `ARR_MIN_END` - the minimal end of `xs2` or
+ * `ARR_MAX_END` - the maximal end of `xs2`.
*/
Comparison_result operator()(const X_monotone_subcurve_2& xs1,
Arr_curve_end ce1,
@@ -194,12 +198,10 @@ public:
private:
// Oblivious implementation
Comparison_result operator()(const X_monotone_subcurve_2& xs1,
- Arr_curve_end ce1,
- const Point_2& p2,
- Arr_all_sides_oblivious_tag) const
- {
- const Subcurve_traits_2* geom_traits = m_poly_traits.subcurve_traits_2();
- const Point_2& p1 = (ce1 == ARR_MAX_END) ?
+ Arr_curve_end ce1, const Point_2& p2,
+ Arr_all_sides_oblivious_tag) const {
+ const auto* geom_traits = m_poly_traits.subcurve_traits_2();
+ auto p1 = (ce1 == ARR_MAX_END) ?
geom_traits->construct_max_vertex_2_object()(xs1) :
geom_traits->construct_min_vertex_2_object()(xs1);
return geom_traits->compare_x_2_object()(p1, p2);
@@ -207,13 +209,10 @@ public:
// Boundary implementation
Comparison_result operator()(const X_monotone_subcurve_2& xs1,
- Arr_curve_end ce1,
- const Point_2& p2,
- Arr_not_all_sides_oblivious_tag) const
- {
- const Subcurve_traits_2* geom_traits = m_poly_traits.subcurve_traits_2();
- typename Subcurve_traits_2::Parameter_space_in_x_2 ps_x =
- geom_traits->parameter_space_in_x_2_object();
+ Arr_curve_end ce1, const Point_2& p2,
+ Arr_not_all_sides_oblivious_tag) const {
+ const auto* geom_traits = m_poly_traits.subcurve_traits_2();
+ auto ps_x = geom_traits->parameter_space_in_x_2_object();
const Arr_parameter_space ps_x1 = ps_x(xs1, ce1);
if (ps_x1 != ARR_INTERIOR) {
@@ -221,17 +220,15 @@ public:
if (ps_x1 == ARR_RIGHT_BOUNDARY) return LARGER;
}
- typename Subcurve_traits_2::Parameter_space_in_y_2 ps_y =
- geom_traits->parameter_space_in_y_2_object();
+ auto ps_y = geom_traits->parameter_space_in_y_2_object();
const Arr_parameter_space ps_y1 = ps_y(xs1, ce1);
if (ps_y1 == ARR_INTERIOR) {
- const Point_2& p1 = (ce1 == ARR_MAX_END) ?
+ auto p1 = (ce1 == ARR_MAX_END) ?
geom_traits->construct_max_vertex_2_object()(xs1) :
geom_traits->construct_min_vertex_2_object()(xs1);
return geom_traits->compare_x_2_object()(p1, p2);
}
- typename Subcurve_traits_2::Compare_x_on_boundary_2 cmp_x_on_bnd =
- geom_traits->compare_x_on_boundary_2_object();
+ auto cmp_x_on_bnd = geom_traits->compare_x_on_boundary_2_object();
return opposite(cmp_x_on_bnd(p2, xs1, ce1));
}
@@ -240,13 +237,12 @@ public:
Arr_curve_end ce1,
const X_monotone_subcurve_2& xs2,
Arr_curve_end ce2,
- Arr_all_sides_oblivious_tag) const
- {
- const Subcurve_traits_2* geom_traits = m_poly_traits.subcurve_traits_2();
- const Point_2& p1 = (ce1 == ARR_MAX_END) ?
+ Arr_all_sides_oblivious_tag) const {
+ const auto* geom_traits = m_poly_traits.subcurve_traits_2();
+ auto p1 = (ce1 == ARR_MAX_END) ?
geom_traits->construct_max_vertex_2_object()(xs1) :
geom_traits->construct_min_vertex_2_object()(xs1);
- const Point_2& p2 = (ce2 == ARR_MAX_END) ?
+ auto p2 = (ce2 == ARR_MAX_END) ?
geom_traits->construct_max_vertex_2_object()(xs2) :
geom_traits->construct_min_vertex_2_object()(xs2);
return geom_traits->compare_x_2_object()(p1, p2);
@@ -257,11 +253,9 @@ public:
Arr_curve_end ce1,
const X_monotone_subcurve_2& xs2,
Arr_curve_end ce2,
- Arr_not_all_sides_oblivious_tag) const
- {
- const Subcurve_traits_2* geom_traits = m_poly_traits.subcurve_traits_2();
- typename Subcurve_traits_2::Parameter_space_in_x_2 ps_x =
- geom_traits->parameter_space_in_x_2_object();
+ Arr_not_all_sides_oblivious_tag) const {
+ const auto* geom_traits = m_poly_traits.subcurve_traits_2();
+ auto ps_x = geom_traits->parameter_space_in_x_2_object();
const Arr_parameter_space ps_x1 = ps_x(xs1, ce1);
const Arr_parameter_space ps_x2 = ps_x(xs2, ce2);
@@ -275,30 +269,27 @@ public:
// ps_x1 == ps_x2
if (ps_x1 != ARR_INTERIOR) return EQUAL;
- typename Subcurve_traits_2::Parameter_space_in_y_2 ps_y =
- geom_traits->parameter_space_in_y_2_object();
+ auto ps_y = geom_traits->parameter_space_in_y_2_object();
const Arr_parameter_space ps_y1 = ps_y(xs1, ce1);
const Arr_parameter_space ps_y2 = ps_y(xs2, ce2);
if (ps_y1 == ARR_INTERIOR) {
- const Point_2& p1 = (ce1 == ARR_MAX_END) ?
+ auto p1 = (ce1 == ARR_MAX_END) ?
geom_traits->construct_max_vertex_2_object()(xs1) :
geom_traits->construct_min_vertex_2_object()(xs1);
if (ps_y2 == ARR_INTERIOR) {
- const Point_2& p2 = (ce2 == ARR_MAX_END) ?
+ auto p2 = (ce2 == ARR_MAX_END) ?
geom_traits->construct_max_vertex_2_object()(xs2) :
geom_traits->construct_min_vertex_2_object()(xs2);
return geom_traits->compare_x_2_object()(p1, p2);
}
- typename Subcurve_traits_2::Compare_x_on_boundary_2 cmp_x_on_bnd =
- geom_traits->compare_x_on_boundary_2_object();
+ auto cmp_x_on_bnd = geom_traits->compare_x_on_boundary_2_object();
return cmp_x_on_bnd(p1, xs2, ce2);
}
if (ps_y2 == ARR_INTERIOR) {
- const Point_2& p2 = (ce2 == ARR_MAX_END) ?
+ auto p2 = (ce2 == ARR_MAX_END) ?
geom_traits->construct_max_vertex_2_object()(xs2) :
geom_traits->construct_min_vertex_2_object()(xs2);
- typename Subcurve_traits_2::Compare_x_on_boundary_2 cmp_x_on_bnd =
- geom_traits->compare_x_on_boundary_2_object();
+ auto cmp_x_on_bnd = geom_traits->compare_x_on_boundary_2_object();
return opposite(cmp_x_on_bnd(p2, xs1, ce1));
}
return geom_traits->compare_x_on_boundary_2_object()(xs1, ce1, xs2, ce2);
@@ -306,59 +297,64 @@ public:
};
/*! Obtain a Compare_x_2 functor object. */
- Compare_x_2 compare_x_2_object() const
- { return Compare_x_2(*this); }
+ Compare_x_2 compare_x_2_object() const { return Compare_x_2(*this); }
- /*! Compare two curve-ends or points lexigoraphically: by x, then by y. */
+ //! Compare two curve-ends or points lexigoraphically: by x, then by y.
class Compare_xy_2 {
protected:
- typedef Arr_polycurve_basic_traits_2
- Polycurve_basic_traits_2;
+ using Polycurve_basic_traits_2 =
+ Arr_polycurve_basic_traits_2;
- /*! The polycurve traits (in case it has state). */
+ //! The polycurve traits (in case it has state).
const Polycurve_basic_traits_2& m_poly_traits;
- public:
+ friend class Arr_polycurve_basic_traits_2;
+
/*! Constructor. */
Compare_xy_2(const Polycurve_basic_traits_2& traits) :
m_poly_traits(traits)
{}
- /*! Compare two directional points lexigoraphically: by x, then by y.
+ public:
+ /*! Compare two directional points lexigoraphically: by \f$x\f$, then by
+ * \f$y\f$.
* \param p1 the first endpoint directional point.
* \param p2 the second endpoint directional point.
- * \return SMALLER - x(p1) < x(p2);
- * SMALLER - x(p1) = x(p2) and y(p1) < y(p2);
- * EQUAL - x(p1) = x(p2) and y(p1) = y(p2);
- * LARGER - x(p1) = x(p2) and y(p1) > y(p2);
- * LARGER - x(p1) > x(p2).
- * \pre p1 does not lie on the boundary.
- * \pre p2 does not lie on the boundary.
+ * \return
+ * `SMALLER` - \f$x\f$(p1) < \f$x\f$(p2);
+ * `SMALLER` - \f$x\f$(p1) = \f$x\f$(p2) and \f$y\f$(p1) < \f$y\f$(p2);
+ * `EQUAL` - \f$x\f$(p1) = \f$x\f$(p2) and \f$y\f$(p1) = \f$y\f$(p2);
+ * `LARGER` - \f$x\f$(p1) = \f$x\f$(p2) and \f$y\f$(p1) > \f$y\f$(p2);
+ * `LARGER` - \f$x\f$(p1) > \f$x\f$(p2).
+ * \pre `p1` does not lie on the boundary.
+ * \pre `p2` does not lie on the boundary.
*/
Comparison_result operator()(const Point_2& p1, const Point_2& p2) const
{ return m_poly_traits.subcurve_traits_2()->compare_xy_2_object()(p1, p2); }
- /*! Compare two ends of x-monotone curves lexicographically.
+ /*! Compare two ends of \f$x\f$-monotone curves lexicographically.
* \param xs1 the first curve.
- * \param ce1 the curve-end indicator of the first x-monotone curve xs1:
- * ARR_MIN_END - the minimal end of xs1 or
- * ARR_MAX_END - the maximal end of xs1.
+ * \param ce1 the curve-end indicator of the first \f$x\f$-monotone curve
+ * `xs1`:
+ * `ARR_MIN_END` - the lexicographically smallest end of `xs1` or
+ * `ARR_MAX_END` - the lexicographically largest end of `xs1`.
* \param p2 the second curve end.
*/
Comparison_result operator()(const X_monotone_subcurve_2& xs1,
- Arr_curve_end ce1,
- const Point_2& p2)
+ Arr_curve_end ce1, const Point_2& p2)
{ return operator()(xs1, ce1, p2, All_sides_oblivious_category()); }
- /*! Compare two ends of x-monotone curves lexicographically.
+ /*! Compare two ends of \f$x\f$-monotone curves lexicographically.
* \param xs1 the first curve.
- * \param ce1 the curve-end indicator of the first x-monotone curve xs1:
- * ARR_MIN_END - the minimal end of xs1 or
- * ARR_MAX_END - the maximal end of xs1.
+ * \param ce1 the curve-end indicator of the first \f$x\f$-monotone curve
+ * `xs1`:
+ * `ARR_MIN_END` - the minimal end of `xs1` or
+ * `ARR_MAX_END` - the maximal end of `xs1`.
* \param xs2 the second curve.
- * \param ce2 the curve-end indicator of the second x-monoton curve xs2:
- * ARR_MIN_END - the minimal end of xs2 or
- * ARR_MAX_END - the maximal end of xs2.
+ * \param ce2 the curve-end indicator of the second \f$x\f$-monoton curve
+ * `xs2`:
+ * `ARR_MIN_END` - the minimal end of `xs2` or
+ * `ARR_MAX_END` - the maximal end of `xs2`.
*/
Comparison_result operator()(const X_monotone_subcurve_2& xs1,
Arr_curve_end ce1,
@@ -369,12 +365,10 @@ public:
private:
// Oblivious implementation
Comparison_result operator()(const X_monotone_subcurve_2& xs1,
- Arr_curve_end ce1,
- const Point_2& p2,
- Arr_all_sides_oblivious_tag) const
- {
- const Subcurve_traits_2* geom_traits = m_poly_traits.subcurve_traits_2();
- const Point_2& p1 = (ce1 == ARR_MAX_END) ?
+ Arr_curve_end ce1, const Point_2& p2,
+ Arr_all_sides_oblivious_tag) const {
+ const auto* geom_traits = m_poly_traits.subcurve_traits_2();
+ auto p1 = (ce1 == ARR_MAX_END) ?
geom_traits->construct_max_vertex_2_object()(xs1) :
geom_traits->construct_min_vertex_2_object()(xs1);
return geom_traits->compare_xy_2_object()(p1, p2);
@@ -382,15 +376,11 @@ public:
// Boundary implementation
Comparison_result operator()(const X_monotone_subcurve_2& xs1,
- Arr_curve_end ce1,
- const Point_2& p2,
- Arr_not_all_sides_oblivious_tag) const
- {
- const Subcurve_traits_2* geom_traits = m_poly_traits.subcurve_traits_2();
- typename Subcurve_traits_2::Parameter_space_in_x_2 ps_x =
- geom_traits->parameter_space_in_x_2_object();
- typename Subcurve_traits_2::Parameter_space_in_y_2 ps_y =
- geom_traits->parameter_space_in_y_2_object();
+ Arr_curve_end ce1, const Point_2& p2,
+ Arr_not_all_sides_oblivious_tag) const {
+ const auto* geom_traits = m_poly_traits.subcurve_traits_2();
+ auto ps_x = geom_traits->parameter_space_in_x_2_object();
+ auto ps_y = geom_traits->parameter_space_in_y_2_object();
const Arr_parameter_space ps_x1 = ps_x(xs1, ce1);
const Arr_parameter_space ps_y1 = ps_y(xs1, ce1);
@@ -400,15 +390,14 @@ public:
}
if (ps_y1 == ARR_INTERIOR) {
- const Point_2& p1 = (ce1 == ARR_MAX_END) ?
+ auto p1 = (ce1 == ARR_MAX_END) ?
geom_traits->construct_max_vertex_2_object()(xs1) :
geom_traits->construct_min_vertex_2_object()(xs1);
return geom_traits->compare_xy_2_object()(p1, p2);
}
// EFEF: missing implementation for open boundary.
- typename Subcurve_traits_2::Compare_x_on_boundary_2 cmp_x_on_bnd =
- geom_traits->compare_x_on_boundary_2_object();
+ auto cmp_x_on_bnd = geom_traits->compare_x_on_boundary_2_object();
Comparison_result res = opposite(cmp_x_on_bnd(p2, xs1, ce1));
if (res != EQUAL) return res;
if (ps_y1 == ARR_TOP_BOUNDARY) return LARGER;
@@ -421,13 +410,12 @@ public:
Arr_curve_end ce1,
const X_monotone_subcurve_2& xs2,
Arr_curve_end ce2,
- Arr_all_sides_oblivious_tag) const
- {
- const Subcurve_traits_2* geom_traits = m_poly_traits.subcurve_traits_2();
- const Point_2& p1 = (ce1 == ARR_MAX_END) ?
+ Arr_all_sides_oblivious_tag) const {
+ const auto* geom_traits = m_poly_traits.subcurve_traits_2();
+ auto p1 = (ce1 == ARR_MAX_END) ?
geom_traits->construct_max_vertex_2_object()(xs1) :
geom_traits->construct_min_vertex_2_object()(xs1);
- const Point_2& p2 = (ce2 == ARR_MAX_END) ?
+ auto p2 = (ce2 == ARR_MAX_END) ?
geom_traits->construct_max_vertex_2_object()(xs2) :
geom_traits->construct_min_vertex_2_object()(xs2);
return geom_traits->compare_xy_2_object()(p1, p2);
@@ -438,13 +426,10 @@ public:
Arr_curve_end ce1,
const X_monotone_subcurve_2& xs2,
Arr_curve_end ce2,
- Arr_not_all_sides_oblivious_tag) const
- {
- const Subcurve_traits_2* geom_traits = m_poly_traits.subcurve_traits_2();
- typename Subcurve_traits_2::Parameter_space_in_x_2 ps_x =
- geom_traits->parameter_space_in_x_2_object();
- typename Subcurve_traits_2::Parameter_space_in_y_2 ps_y =
- geom_traits->parameter_space_in_y_2_object();
+ Arr_not_all_sides_oblivious_tag) const {
+ const auto* geom_traits = m_poly_traits.subcurve_traits_2();
+ auto ps_x = geom_traits->parameter_space_in_x_2_object();
+ auto ps_y = geom_traits->parameter_space_in_y_2_object();
const Arr_parameter_space ps_x1 = ps_x(xs1, ce1);
const Arr_parameter_space ps_y1 = ps_y(xs1, ce1);
const Arr_parameter_space ps_x2 = ps_x(xs2, ce2);
@@ -458,13 +443,13 @@ public:
}
if ((ps_x1 == ARR_INTERIOR) && (ps_y1 == ARR_INTERIOR)) {
- const Point_2& p1 = (ce1 == ARR_MAX_END) ?
+ auto p1 = (ce1 == ARR_MAX_END) ?
geom_traits->construct_max_vertex_2_object()(xs1) :
geom_traits->construct_min_vertex_2_object()(xs1);
// ps1 == ARR_INTERIOR
if ((ps_x2 == ARR_INTERIOR) && (ps_y2 == ARR_INTERIOR)) {
- const Point_2& p2 = (ce2 == ARR_MAX_END) ?
+ auto p2 = (ce2 == ARR_MAX_END) ?
geom_traits->construct_max_vertex_2_object()(xs2) :
geom_traits->construct_min_vertex_2_object()(xs2);
@@ -480,8 +465,7 @@ public:
// ps_y2 != ARR_INTERIOR
CGAL_assertion(ps_x2 == ARR_INTERIOR);
// EFEF: missing implementation for open boundary.
- typename Subcurve_traits_2::Compare_x_on_boundary_2 cmp_x_on_bnd =
- geom_traits->compare_x_on_boundary_2_object();
+ auto cmp_x_on_bnd = geom_traits->compare_x_on_boundary_2_object();
Comparison_result res = cmp_x_on_bnd(p1, xs2, ce2);
if (res != EQUAL) return res;
if (ps_y2 == ARR_TOP_BOUNDARY) return SMALLER;
@@ -491,7 +475,7 @@ public:
// ps1 != ARR_INTERIOR
if ((ps_x2 == ARR_INTERIOR) && (ps_y2 == ARR_INTERIOR)) {
- const Point_2& p2 = (ce2 == ARR_MAX_END) ?
+ auto p2 = (ce2 == ARR_MAX_END) ?
geom_traits->construct_max_vertex_2_object()(xs2) :
geom_traits->construct_min_vertex_2_object()(xs2);
@@ -501,8 +485,7 @@ public:
// ps_y1 != ARR_INTERIOR
// ps2 == ARR_INTERIOR
CGAL_assertion(ps_x1 == ARR_INTERIOR);
- typename Subcurve_traits_2::Compare_x_on_boundary_2 cmp_x_on_bnd =
- geom_traits->compare_x_on_boundary_2_object();
+ auto cmp_x_on_bnd = geom_traits->compare_x_on_boundary_2_object();
Comparison_result res = cmp_x_on_bnd(p2, xs1, ce1);
if (res != EQUAL) return opposite(res);
if (ps_y1 == ARR_TOP_BOUNDARY) return LARGER;
@@ -524,10 +507,10 @@ public:
}
CGAL_assertion(ce1 == ce2);
- const Point_2& p1 = (ce1 == ARR_MAX_END) ?
+ auto p1 = (ce1 == ARR_MAX_END) ?
geom_traits->construct_max_vertex_2_object()(xs1) :
geom_traits->construct_min_vertex_2_object()(xs1);
- const Point_2& p2 = (ce2 == ARR_MAX_END) ?
+ auto p2 = (ce2 == ARR_MAX_END) ?
geom_traits->construct_max_vertex_2_object()(xs2) :
geom_traits->construct_min_vertex_2_object()(xs2);
return geom_traits->compare_y_on_boundary_2_object()(p1, p2);
@@ -535,40 +518,46 @@ public:
};
/*! Obtain a Compare_xy_2 functor object. */
- Compare_xy_2 compare_xy_2_object() const
- { return Compare_xy_2(*this); }
+ Compare_xy_2 compare_xy_2_object() const { return Compare_xy_2(*this); }
+ /*! A functor that obtain the lexicographically smallest endpoint of an
+ * \f$x\f$-monotone curve.
+ */
class Construct_min_vertex_2 {
protected:
- typedef Arr_polycurve_basic_traits_2
- Polycurve_basic_traits_2;
+ using Polycurve_basic_traits_2 =
+ Arr_polycurve_basic_traits_2;
- /*! The polycurve traits (in case it has state). */
+ //! The polycurve traits (in case it has state).
const Polycurve_basic_traits_2& m_poly_traits;
- public:
+ friend class Arr_polycurve_basic_traits_2;
+
/* Constructor. */
Construct_min_vertex_2(const Polycurve_basic_traits_2& traits) :
m_poly_traits(traits)
{}
- /*! Obtain the left endpoint of the x-monotone polycurve.
- * \todo: is it possible to make the return type const reference if the
- * return type of the subcurve traits is const reference?
- * \param cv The polycurve curve.
- * \return The left endpoint.
+ public:
+ /*! Obtain the left endpoint of the \f$x\f$-monotone polycurve. The return
+ * type is the same as the return type of the corresponding operator in the
+ * functor of the subtraits, which is either by value or by reference.
+ * \param xcv the polycurve curve.
+ * \return the lexicographically smallest endpoint.
*/
- Point_2 operator()(const X_monotone_curve_2& cv) const
- {
- CGAL_assertion(cv.number_of_subcurves() > 0);
+ using Subcurve_ctr = typename Subcurve_traits_2::Construct_min_vertex_2;
+ decltype(std::declval().
+ operator()(std::declval()))
+ operator()(const X_monotone_curve_2& xcv) const {
+ CGAL_assertion(xcv.number_of_subcurves() > 0);
- const Subcurve_traits_2* geom_traits = m_poly_traits.subcurve_traits_2();
+ const auto* geom_traits = m_poly_traits.subcurve_traits_2();
- if (geom_traits->compare_endpoints_xy_2_object()(cv[0]) == SMALLER)
- return geom_traits->construct_min_vertex_2_object()(cv[0]);
+ if (geom_traits->compare_endpoints_xy_2_object()(xcv[0]) == SMALLER)
+ return geom_traits->construct_min_vertex_2_object()(xcv[0]);
else
return geom_traits->
- construct_min_vertex_2_object()(cv[cv.number_of_subcurves()-1]);
+ construct_min_vertex_2_object()(xcv[xcv.number_of_subcurves()-1]);
}
};
@@ -576,37 +565,41 @@ public:
Construct_min_vertex_2 construct_min_vertex_2_object() const
{ return Construct_min_vertex_2(*this); }
+ /*! A functor that obtain the lexicographically largest endpoint of an
+ * \f$x\f$-monotone curve.
+ */
class Construct_max_vertex_2 {
protected:
- typedef Arr_polycurve_basic_traits_2
- Polycurve_basic_traits_2;
+ using Polycurve_basic_traits_2 =
+ Arr_polycurve_basic_traits_2;
- /*! The polycurve traits (in case it has state). */
+ //! The polycurve traits (in case it has state).
const Polycurve_basic_traits_2& m_poly_traits;
- public:
+ friend class Arr_polycurve_basic_traits_2;
+
/*! Constructor. */
Construct_max_vertex_2(const Polycurve_basic_traits_2& traits) :
m_poly_traits(traits)
{}
- /*! Obtain the right endpoint of the x-monotone polycurve.
- * \todo: is it possible to make the return type const reference if the
- * return type of the subcurve traits is const reference?
- * \param cv The polycurve.
- * \return The right endpoint.
+ public:
+ /*! Obtain the right endpoint of the \f$x\f$-monotone polycurve. The return
+ * type is the same as the return type of the corresponding operator in the
+ * functor of the subtraits, which is either by value or by reference.
+ * \param xcv the polycurve.
+ * \return the lexicographically largest endpoint.
*/
- Point_2 operator()(const X_monotone_curve_2& cv) const
- {
- CGAL_assertion(cv.number_of_subcurves() > 0);
-
- const Subcurve_traits_2* geom_traits = m_poly_traits.subcurve_traits_2();
-
- if (geom_traits->compare_endpoints_xy_2_object()(cv[0]) == SMALLER)
- return geom_traits->
- construct_max_vertex_2_object()(cv[cv.number_of_subcurves()-1]);
- else
- return geom_traits->construct_max_vertex_2_object()(cv[0]);
+ using Subcurve_ctr = typename Subcurve_traits_2::Construct_max_vertex_2;
+ decltype(std::declval().
+ operator()(std::declval()))
+ operator()(const X_monotone_curve_2& xcv) const {
+ CGAL_assertion(xcv.number_of_subcurves() > 0);
+ const auto* geom_traits = m_poly_traits.subcurve_traits_2();
+ auto ctr_max_vertex = geom_traits->construct_max_vertex_2_object();
+ if (geom_traits->compare_endpoints_xy_2_object()(xcv[0]) == SMALLER)
+ return ctr_max_vertex(xcv[xcv.number_of_subcurves()-1]);
+ else return ctr_max_vertex(xcv[0]);
}
};
@@ -614,47 +607,51 @@ public:
Construct_max_vertex_2 construct_max_vertex_2_object() const
{ return Construct_max_vertex_2(*this); }
+ /*! A functor that checks whether an \f$x\f$-monotone curve is a vertical. */
class Is_vertical_2 {
protected:
- typedef Arr_polycurve_basic_traits_2
- Polycurve_basic_traits_2;
+ using Polycurve_basic_traits_2 =
+ Arr_polycurve_basic_traits_2;
- /*! The polycurve traits (in case it has state). */
+ //! The polycurve traits (in case it has state).
const Polycurve_basic_traits_2& m_poly_traits;
- public:
+ friend class Arr_polycurve_basic_traits_2;
+
/*! Constructor. */
Is_vertical_2(const Polycurve_basic_traits_2& traits) :
m_poly_traits(traits)
{}
- /*! Check whether the given x-monotone curve is a vertical segment.
- * \param cv The curve.
- * \return (true) if the curve is a vertical segment;(false) otherwise.
+ public:
+ /*! Check whether the given \f$x\f$-monotone curve is a vertical segment.
+ * \param cv the curve.
+ * \return `true` if the curve is a vertical segment; `false` otherwise.
*/
- bool operator()(const X_monotone_curve_2& cv) const
- {
- // An x-monotone polycurve can represent a vertical segment only if it
- // comprises vertical segments. If the first subcurve is vertical,
- // all subcurves are vertical in an x-monotone polycurve
+ bool operator()(const X_monotone_curve_2& cv) const {
+ /* An \f$x\f$-monotone polycurve can represent a vertical segment only if
+ * it comprises vertical segments. If the first subcurve is vertical,
+ * all subcurves are vertical in an \f$x\f$-monotone polycurve
+ */
return m_poly_traits.subcurve_traits_2()->is_vertical_2_object()(cv[0]);
}
};
/*! Obtain an Is_vertical_2 functor object. */
- Is_vertical_2 is_vertical_2_object() const
- { return Is_vertical_2(*this); }
+ Is_vertical_2 is_vertical_2_object() const { return Is_vertical_2(*this); }
+ /*! A functor that compares the \f$y\f$-coordinates of a point and an
+ * \f$x\f$-monotone curve at the point \f$x\f$-coordinate
+ */
class Compare_y_at_x_2 {
private:
// Oblivious implementation
Comparison_result operator()(const X_monotone_subcurve_2& xs1,
Arr_curve_end ce1,
const X_monotone_subcurve_2& xs2,
- Arr_all_sides_oblivious_tag) const
- {
- const Subcurve_traits_2* geom_traits = m_poly_traits.subcurve_traits_2();
- const Point_2& p = (ce1 == ARR_MAX_END) ?
+ Arr_all_sides_oblivious_tag) const {
+ const auto* geom_traits = m_poly_traits.subcurve_traits_2();
+ auto p = (ce1 == ARR_MAX_END) ?
geom_traits->construct_max_vertex_2_object()(xs1) :
geom_traits->construct_min_vertex_2_object()(xs1);
return geom_traits->compare_y_at_x_2_object()(p, xs2);
@@ -664,17 +661,12 @@ public:
Comparison_result operator()(const X_monotone_subcurve_2& xs1,
Arr_curve_end ce1,
const X_monotone_subcurve_2& xs2,
- Arr_not_all_sides_oblivious_tag) const
- {
- const Subcurve_traits_2* geom_traits = m_poly_traits.subcurve_traits_2();
- typename Subcurve_traits_2::Parameter_space_in_x_2 ps_x =
- geom_traits->parameter_space_in_x_2_object();
- typename Subcurve_traits_2::Parameter_space_in_y_2 ps_y =
- geom_traits->parameter_space_in_y_2_object();
- typename Subcurve_traits_2::Construct_min_vertex_2 min_vertex =
- geom_traits->construct_min_vertex_2_object();
- typename Subcurve_traits_2::Construct_max_vertex_2 max_vertex =
- geom_traits->construct_max_vertex_2_object();
+ Arr_not_all_sides_oblivious_tag) const {
+ const auto* geom_traits = m_poly_traits.subcurve_traits_2();
+ auto ps_x = geom_traits->parameter_space_in_x_2_object();
+ auto ps_y = geom_traits->parameter_space_in_y_2_object();
+ auto min_vertex = geom_traits->construct_min_vertex_2_object();
+ auto max_vertex = geom_traits->construct_max_vertex_2_object();
const Arr_parameter_space ps_x1 = ps_x(xs1, ce1);
const Arr_parameter_space ps_y1 = ps_y(xs1, ce1);
@@ -683,103 +675,125 @@ public:
((ce1 == ARR_MIN_END) && (ps_x1 != ARR_RIGHT_BOUNDARY)));
if (ps_x1 == ARR_INTERIOR) {
+ auto p = (ce1 == ARR_MAX_END) ? max_vertex(xs1) : min_vertex(xs1);
if (ps_y1 == ARR_TOP_BOUNDARY) {
- typename Subcurve_traits_2::Equal_2 equal =
- geom_traits->equal_2_object();
- const Point_2& p = (ce1 == ARR_MAX_END) ?
- max_vertex(xs1) : min_vertex(xs1);
+ auto equal = geom_traits->equal_2_object();
if (equal(p, max_vertex(xs2))) return EQUAL;
if (equal(p, min_vertex(xs2))) return EQUAL;
return LARGER;
}
if (ps_y1 == ARR_BOTTOM_BOUNDARY) {
- typename Subcurve_traits_2::Equal_2 equal =
- geom_traits->equal_2_object();
- const Point_2& p = (ce1 == ARR_MAX_END) ?
- max_vertex(xs1) : min_vertex(xs1);
+ auto equal = geom_traits->equal_2_object();
if (equal(p, max_vertex(xs2))) return EQUAL;
if (equal(p, min_vertex(xs2))) return EQUAL;
return SMALLER;
}
// ps_y1 == ARR_INTERIOR
- const Point_2& p = (ce1 == ARR_MAX_END) ?
- max_vertex(xs1) : min_vertex(xs1);
return geom_traits->compare_y_at_x_2_object()(p, xs2);
}
// ps_x1 == ARR_RIGHT_BOUNDARY || ARR_LEFT_BOUNDARY
- const Point_2& p1 = (ce1 == ARR_MAX_END) ?
- max_vertex(xs1) : min_vertex(xs1);
- const Point_2& p2 = (ce1 == ARR_MAX_END) ?
- max_vertex(xs2) : min_vertex(xs2);
+ auto p1 = (ce1 == ARR_MAX_END) ? max_vertex(xs1) : min_vertex(xs1);
+ auto p2 = (ce1 == ARR_MAX_END) ? max_vertex(xs2) : min_vertex(xs2);
return geom_traits->compare_y_on_boundary_2_object()(p1, p2);
}
- protected:
- typedef Arr_polycurve_basic_traits_2
- Polycurve_basic_traits_2;
+ // Compare vertical
+ Comparison_result compare_vertical(const Point_2& p,
+ const X_monotone_curve_2& xcv) const {
+ const auto* geom_traits = m_poly_traits.subcurve_traits_2();
+#ifdef CGAL_ALWAYS_LEFT_TO_RIGHT
+ const Comparison_result l2r_smaller = SMALLER;
+ const Comparison_result l2r_larger = LARGER;
+#else
+ auto cmp_endpints_xy = m_poly_traits.compare_endpoints_xy_2_object();
+ const bool l2r = cmp_endpints_xy(xcv[0]) == SMALLER;
+ const Comparison_result l2r_smaller = l2r ? SMALLER : LARGER;
+ const Comparison_result l2r_larger = l2r ? LARGER : SMALLER;
+#endif
+ Comparison_result rc = geom_traits->compare_y_at_x_2_object()(p, xcv[0]);
+ if (rc == l2r_smaller) return l2r_smaller;
+ std::size_t n = xcv.number_of_subcurves();
+ rc = geom_traits->compare_y_at_x_2_object()(p, xcv[n-1]);
+ return (rc == l2r_larger) ? l2r_larger : EQUAL;
+ }
- /*! The polycurve traits (in case it has state). */
+ // Compare non_vertical
+ Comparison_result compare_non_vertical(const Point_2& p,
+ const X_monotone_curve_2& xcv) const {
+ const auto* geom_traits = m_poly_traits.subcurve_traits_2();
+ // Get the index of the subcurve in xcv containing p.
+ auto i = m_poly_traits.locate_impl(xcv, p, All_sides_oblivious_category());
+ CGAL_precondition(i != INVALID_INDEX);
+
+ // Compare the subcurve xcv[i] and p.
+ return geom_traits->compare_y_at_x_2_object()(p, xcv[i]);
+ }
+
+ // Oblivious implementation
+ Comparison_result operator()(const Point_2& p,
+ const X_monotone_curve_2& xcv,
+ Arr_all_sides_oblivious_tag) const {
+ if (! m_poly_traits.is_vertical_2_object()(xcv))
+ return compare_non_vertical(p, xcv);
+ return compare_vertical(p, xcv);
+ }
+
+ // Boundary implementation
+ Comparison_result operator()(const Point_2& p,
+ const X_monotone_curve_2& xcv,
+ Arr_not_all_sides_oblivious_tag) const {
+ if (! m_poly_traits.is_vertical_2_object()(xcv)) {
+ const auto* geom_traits = m_poly_traits.subcurve_traits_2();
+ if (geom_traits->is_on_y_identification_2_object()(p)) {
+ auto cmp_y = geom_traits->compare_y_on_boundary_2_object();
+ return cmp_y(p, m_poly_traits.construct_min_vertex_2_object()(xcv));
+ }
+ return compare_non_vertical(p, xcv);
+ }
+ return compare_vertical(p, xcv);
+ }
+
+ protected:
+ using Polycurve_basic_traits_2 =
+ Arr_polycurve_basic_traits_2;
+
+ //! The polycurve traits (in case it has state).
const Polycurve_basic_traits_2& m_poly_traits;
- public:
+ friend class Arr_polycurve_basic_traits_2;
+
/*! Constructor. */
Compare_y_at_x_2(const Polycurve_basic_traits_2& traits) :
- m_poly_traits(traits) {}
+ m_poly_traits(traits)
+ {}
+ public:
/*! Obtain the location of the given point with respect to the input curve.
- * \param p The point.
- * \param xcv The polycurve curve.
- * \pre p is in the x-range of cv.
- * \return SMALLER if y(p) < cv(x(p)), i.e. the point is below the curve;
- * LARGER if y(p) > cv(x(p)), i.e. the point is above the curve;
- * EQUAL if p lies on the curve.
+ * \param p the point.
+ * \param xcv the polycurve curve.
+ * \pre `p` is in the \f$x\f$-range of `xcv`.
+ * \return
+ * `SMALLER` if \f$y\f$(p) < cv(x(p)), i.e. the point is below the curve;
+ * `LARGER` if \f$y\f$(p) > cv(x(p)), i.e. the point is above the curve;
+ * `EQUAL` if `p` lies on the curve.
*/
Comparison_result operator()(const Point_2& p,
const X_monotone_curve_2& xcv) const
- {
- const Subcurve_traits_2* geom_traits = m_poly_traits.subcurve_traits_2();
- if (! m_poly_traits.is_vertical_2_object()(xcv)) {
- // Get the index of the subcurve in xcv containing p.
- std::size_t i =
- m_poly_traits.locate_impl(xcv, p, All_sides_oblivious_category());
- CGAL_precondition(i != INVALID_INDEX);
-
- // Compare the subcurve xcv[i] and p.
- return geom_traits->compare_y_at_x_2_object()(p, xcv[i]);
- }
- // The curve is vertical
- #ifdef CGAL_ALWAYS_LEFT_TO_RIGHT
- const Comparison_result SMLLR = SMALLER;
- const Comparison_result LRGR = LARGER;
- #else
- const bool is_left_to_right = m_poly_traits.subcurve_traits_2()->
- compare_endpoints_xy_2_object()(xcv[0])
- == SMALLER;
- const Comparison_result SMLLR = is_left_to_right?SMALLER:LARGER;
- const Comparison_result LRGR = is_left_to_right?LARGER:SMALLER;
- #endif
-
- Comparison_result rc = geom_traits->compare_y_at_x_2_object()(p, xcv[0]);
- if (rc == SMLLR) return SMLLR;
- std::size_t n = xcv.number_of_subcurves();
- rc = geom_traits->compare_y_at_x_2_object()(p, xcv[n-1]);
- if (rc == LRGR) return LRGR;
- return EQUAL;
- }
+ { return operator()(p, xcv, All_sides_oblivious_category()); }
/*! Obtain the location of the given curve_end with respect to the input
* curve.
* \param xcv The polycurve curve.
- * \param ce the curve-end indicator of the x-monotone subcurve xl:
- * ARR_MIN_END - the minimal end of xl or
- * ARR_MAX_END - the maximal end of xl.
+ * \param ce the curve-end indicator of the \f$x\f$-monotone subcurve xl:
+ * `ARR_MIN_END` - the minimal end of xl or
+ * `ARR_MAX_END` - the maximal end of xl.
* \param xcv The polycurve curve.
- * \pre the curve-end is in the x-range of xcv.
- * \return SMALLER if if y(xs, ce) < cv(x(xs, ce)), i.e. the curve-end
- * is below the curve xcv;
- * LARGER if y(xs, ce) > cv(x(xs, ce)), i.e. the curve-end is
- * above the curve xcv;
- * EQUAL if the curve-end lies on the curve xcv.
+ * \pre the curve-end is in the \f$x\f$-range of `xcv`.
+ * \return `SMALLER` if if \f$y\f$(xs, ce) < cv(x(xs, ce)), i.e. the
+ * curve-end is below the curve xcv;
+ * `LARGER` if \f$y\f$(xs, ce) > cv(x(xs, ce)), i.e. the curve-end
+ * is above the curve `xcv`;
+ * `EQUAL` if the curve-end lies on the curve `xcv`.
*/
Comparison_result operator()(const X_monotone_subcurve_2& xs1,
Arr_curve_end ce1,
@@ -791,34 +805,38 @@ public:
Compare_y_at_x_2 compare_y_at_x_2_object() const
{ return Compare_y_at_x_2(*this); }
+ /*! A functor that compares the \f$y\f$-coordinates of two \f$x\f$-monotone
+ * curves immediately to the left of their intersection point.
+ */
class Compare_y_at_x_left_2 {
protected:
- typedef Arr_polycurve_basic_traits_2
- Polycurve_basic_traits_2;
+ using Polycurve_basic_traits_2 =
+ Arr_polycurve_basic_traits_2;
- /*! The polycurve traits (in case it has state). */
+ //! The polycurve traits (in case it has state).
const Polycurve_basic_traits_2& m_poly_traits;
- public:
+ friend class Arr_polycurve_basic_traits_2;
+
/*! Constructor. */
Compare_y_at_x_left_2(const Polycurve_basic_traits_2& traits) :
m_poly_traits(traits)
{}
- /*! Compare the y value of two x-monotone curves immediately to the left
- * of their intersection point.
- * \param cv1 The first polycurve curve.
- * \param cv2 The second polycurve curve.
- * \param p The intersection point.
- * \pre The point p lies on both curves, and both of them must be also be
- * defined(lexicographically) to its left.
- * \return The relative position of cv1 with respect to cv2 immdiately to
- * the left of p: SMALLER, LARGER or EQUAL.
+ public:
+ /*! Compare the y value of two \f$x\f$-monotone curves immediately to the
+ * left of their intersection point.
+ * \param cv1 the first polycurve curve.
+ * \param cv2 the second polycurve curve.
+ * \param p the intersection point.
+ * \pre the point `p` lies on both curves, and both of them must be also be
+ * defined (lexicographically) to its left.
+ * \return the relative position of `cv1` with respect to `cv2` immdiately
+ * to the left of `p`: `SMALLER`, `LARGER`, or `EQUAL`.
*/
Comparison_result operator()(const X_monotone_curve_2& cv1,
const X_monotone_curve_2& cv2,
- const Point_2& p) const
- {
+ const Point_2& p) const {
// Get the indices of the subcurves in cv1 and cv2 containing p and
// defined to its left.
std::size_t i1 = m_poly_traits.locate_side(cv1, p, false);
@@ -828,8 +846,8 @@ public:
CGAL_precondition(i2 != INVALID_INDEX);
// Compare cv1[i1] and cv2[i2] at p's left.
- return m_poly_traits.subcurve_traits_2()->
- compare_y_at_x_left_2_object()(cv1[i1], cv2[i2], p);
+ const auto* geom_traits = m_poly_traits.subcurve_traits_2();
+ return geom_traits->compare_y_at_x_left_2_object()(cv1[i1], cv2[i2], p);
}
};
@@ -837,45 +855,49 @@ public:
Compare_y_at_x_left_2 compare_y_at_x_left_2_object() const
{ return Compare_y_at_x_left_2(*this); }
+ /*! A functor that compares the \f$y\f$-coordinates of two \f$x\f$-monotone
+ * curves immediately to the right of their intersection point.
+ */
class Compare_y_at_x_right_2 {
protected:
- typedef Arr_polycurve_basic_traits_2
- Polycurve_basic_traits_2;
+ using Polycurve_basic_traits_2 =
+ Arr_polycurve_basic_traits_2;
- /*! The polycurve traits (in case it has state). */
+ //! The polycurve traits (in case it has state).
const Polycurve_basic_traits_2& m_poly_traits;
- public:
+ friend class Arr_polycurve_basic_traits_2;
+
/*! Constructor. */
Compare_y_at_x_right_2(const Polycurve_basic_traits_2& traits) :
m_poly_traits(traits)
{}
- /*! Compare the y value of two x-monotone curves immediately to the right
- * of their intersection point.
- * \param cv1 The first curve.
- * \param cv2 The second curve.
- * \param p The intersection point.
- * \pre The point p lies on both curves, and both of them must be also be
- * defined(lexicographically) to its right.
- * \return The relative position of cv1 with respect to cv2 immdiately to
- * the right of p: SMALLER, LARGER or EQUAL.
+ public:
+ /*! Compare the \f$y\f$-value of two \f$x\f$-monotone curves immediately to
+ * the right of their intersection point.
+ * \param cv1 the first curve.
+ * \param cv2 the second curve.
+ * \param p the intersection point.
+ * \pre the point `p` lies on both curves, and both of them must be also be
+ * defined (lexicographically) to its right.
+ * \return the relative position of `cv1` with respect to `cv2` immdiately
+ * to the right of `p`: `SMALLER`, `LARGER`, or `EQUAL`.
*/
Comparison_result operator()(const X_monotone_curve_2& cv1,
const X_monotone_curve_2& cv2,
- const Point_2& p) const
- {
+ const Point_2& p) const {
// Get the indices of the subcurves in cv1 and cv2 containing p and
// defined to its right.
- std::size_t i1=m_poly_traits.locate_side(cv1, p, true);
- std::size_t i2=m_poly_traits.locate_side(cv2, p, true);
+ std::size_t i1 = m_poly_traits.locate_side(cv1, p, true);
+ std::size_t i2 = m_poly_traits.locate_side(cv2, p, true);
CGAL_precondition(i1 != INVALID_INDEX);
CGAL_precondition(i2 != INVALID_INDEX);
// Compare cv1[i1] and cv2[i2] at p's right.
- return m_poly_traits.subcurve_traits_2()->
- compare_y_at_x_right_2_object()(cv1[i1], cv2[i2], p);
+ const auto* geom_traits = m_poly_traits.subcurve_traits_2();
+ return geom_traits->compare_y_at_x_right_2_object()(cv1[i1], cv2[i2], p);
}
};
@@ -884,58 +906,55 @@ public:
Compare_y_at_x_right_2 compare_y_at_x_right_2_object() const
{ return Compare_y_at_x_right_2(*this); }
+ /*! A functor that checks whether two points and two \f$x\f$-monotone
+ * curves are identical.
+ */
class Equal_2 {
protected:
- typedef Arr_polycurve_basic_traits_2
- Polycurve_basic_traits_2;
+ using Polycurve_basic_traits_2 =
+ Arr_polycurve_basic_traits_2;
- /*! The polycurve traits (in case it has state). */
+ //! The polycurve traits (in case it has state).
const Polycurve_basic_traits_2& m_poly_traits;
- public:
+ friend class Arr_polycurve_basic_traits_2;
+
/*! Constructor. */
Equal_2(const Polycurve_basic_traits_2& poly_tr) : m_poly_traits(poly_tr) {}
+ public:
/*! Check whether the two points are the same.
- * \param p1 The first point.
- * \param p2 The second point.
- * \return (true) if the two point are the same;(false) otherwise.
+ * \param p1 the first point.
+ * \param p2 the second point.
+ * \return `true` if the two point are the same; `false` otherwise.
*/
bool operator()(const Point_2& p1, const Point_2& p2) const
{ return m_poly_traits.subcurve_traits_2()->equal_2_object()(p1, p2); }
- /*! Check whether the two x-monotone curves are the same (have the same
- * graph).
- * \param cv1 The first curve.
- * \param cv2 The second curve.
- * \return(true) if the two curves are the same;(false) otherwise.
+ /*! Check whether the two \f$x\f$-monotone curves are the same (have the
+ * same graph).
+ * \param cv1 the first curve.
+ * \param cv2 the second curve.
+ * \return `true` if the two curves are the same; `false` otherwise.
*/
bool operator()(const X_monotone_curve_2& cv1,
- const X_monotone_curve_2& cv2) const
- {
+ const X_monotone_curve_2& cv2) const {
// Check the pairwise equality of the contained subcurves.
- const Subcurve_traits_2* geom_traits = m_poly_traits.subcurve_traits_2();
- typename Subcurve_traits_2::Equal_2 equal =
- geom_traits->equal_2_object();
- typename Subcurve_traits_2::Compare_x_2 compare_x =
- geom_traits->compare_x_2_object();
- typename Subcurve_traits_2::Compare_y_at_x_2 compare_y_at_x =
- geom_traits->compare_y_at_x_2_object();
- typename Subcurve_traits_2::Construct_max_vertex_2 max_vertex =
- geom_traits->construct_max_vertex_2_object();
- typename Subcurve_traits_2::Compare_endpoints_xy_2 comp_endpt =
- geom_traits->compare_endpoints_xy_2_object();
- Is_vertical_2 is_vertical = m_poly_traits.is_vertical_2_object();
- Construct_min_vertex_2 xpoly_min_v =
- m_poly_traits.construct_min_vertex_2_object();
- Construct_max_vertex_2 xpoly_max_v =
- m_poly_traits.construct_max_vertex_2_object();
+ const auto* geom_traits = m_poly_traits.subcurve_traits_2();
+ auto equal = geom_traits->equal_2_object();
+ auto cmp_x = geom_traits->compare_x_2_object();
+ auto cmp_y_at_x = geom_traits->compare_y_at_x_2_object();
+ auto max_vertex = geom_traits->construct_max_vertex_2_object();
+ auto cmp_endpt = geom_traits->compare_endpoints_xy_2_object();
+ auto is_vertical = m_poly_traits.is_vertical_2_object();
+ auto xpoly_min_v = m_poly_traits.construct_min_vertex_2_object();
+ auto xpoly_max_v = m_poly_traits.construct_max_vertex_2_object();
// The first and last points of the subcurves should be equal.
bool res = equal(xpoly_min_v(cv1), xpoly_min_v(cv2));
- if (!res) return false;
+ if (! res) return false;
res = equal(xpoly_max_v(cv1), xpoly_max_v(cv2));
- if (!res) return false;
+ if (! res) return false;
// If the first and last points are equal and the curves are vertical,
// it means that it is equal.
@@ -952,29 +971,16 @@ public:
std::size_t j = 0;
std::size_t n1 = cv1.number_of_subcurves();
std::size_t n2 = cv2.number_of_subcurves();
- Comparison_result is_cv1_left_to_right = comp_endpt(cv1[0]);
- Comparison_result is_cv2_left_to_right = comp_endpt(cv2[0]);
+ Comparison_result is_cv1_left_to_right = cmp_endpt(cv1[0]);
+ Comparison_result is_cv2_left_to_right = cmp_endpt(cv2[0]);
while ((i < (n1-1)) || (j < (n2-1))) {
- Point_2 point1, point2;
- std::size_t cv1_seg_ind, cv2_seg_ind;
- if (SMALLER == is_cv1_left_to_right) {
- cv1_seg_ind = i;
- point1 = max_vertex(cv1[cv1_seg_ind]);
- }
- else {
- cv1_seg_ind = n1 - 1 - i;
- point1 = max_vertex(cv1[cv1_seg_ind]);
- }
- if (SMALLER == is_cv2_left_to_right) {
- cv2_seg_ind = j;
- point2 = max_vertex(cv2[cv2_seg_ind]);
- }
- else {
- cv2_seg_ind = n2 - 1 - j;
- point2 = max_vertex(cv2[cv2_seg_ind]);
- }
-
+ std::size_t cv1_seg_ind = (SMALLER == is_cv1_left_to_right) ?
+ i : n1 - 1 - i;
+ auto point1 = max_vertex(cv1[cv1_seg_ind]);
+ std::size_t cv2_seg_ind = (SMALLER == is_cv2_left_to_right) ?
+ j : n2 - 1 - j;
+ auto point2 = max_vertex(cv2[cv2_seg_ind]);
bool res = equal(point1, point2);
// Easy case - the two points are equal
if (res) {
@@ -982,18 +988,16 @@ public:
++j;
}
else {
- Comparison_result res_x = compare_x(point1,point2);
+ Comparison_result res_x = cmp_x(point1, point2);
// Check if the different point is a collinear point situated on
// the line between its two neighbors.
if (SMALLER == res_x) {
- Comparison_result res_y_at_x =
- compare_y_at_x(point1, cv2[cv2_seg_ind]);
+ Comparison_result res_y_at_x = cmp_y_at_x(point1, cv2[cv2_seg_ind]);
if (EQUAL == res_y_at_x) ++i;
else return false;
}
else if (LARGER == res_x) {
- Comparison_result res_y_at_x =
- compare_y_at_x(point2,cv1[cv1_seg_ind]);
+ Comparison_result res_y_at_x = cmp_y_at_x(point2, cv1[cv1_seg_ind]);
if (EQUAL == res_y_at_x) ++j;
else return false;
}
@@ -1007,31 +1011,33 @@ public:
/*! Obtain an Equal_2 functor object. */
Equal_2 equal_2_object() const { return Equal_2(*this); }
+ /*! A functor that lexicographically compares the endpoints of a curve. */
class Compare_endpoints_xy_2 {
protected:
- typedef Arr_polycurve_basic_traits_2
- Polycurve_basic_traits_2;
+ using Polycurve_basic_traits_2 =
+ Arr_polycurve_basic_traits_2;
/*! The traits (in case it has state). */
const Polycurve_basic_traits_2& m_poly_traits;
- public:
+ friend class Arr_polycurve_basic_traits_2;
+
/*! Constructor. */
Compare_endpoints_xy_2(const Polycurve_basic_traits_2& traits) :
m_poly_traits(traits)
{}
+ public:
/*! Compare the endpoints of an \(x\)-monotone curve lexicographically.
* (assuming the curve has a designated source and target points).
- * \param cv The curve.
- * \return SMALLER if the curve is oriented left-to-right;
- * LARGER if the curve is oriented right-to-left.
+ * \param cv the curve.
+ * \return `SMALLER` if `cv` is oriented left-to-right;
+ * `LARGER` if `cv` is oriented right-to-left.
*/
- Comparison_result operator()(const X_monotone_curve_2& xcv) const
- {
- return (m_poly_traits.subcurve_traits_2()->
- compare_endpoints_xy_2_object()(xcv[0]) == SMALLER) ?
- (SMALLER) : (LARGER);
+ Comparison_result operator()(const X_monotone_curve_2& xcv) const {
+ const auto* geom_traits = m_poly_traits.subcurve_traits_2();
+ auto cmp_endpt = geom_traits->compare_endpoints_xy_2_object();
+ return (cmp_endpt(xcv[0]) == SMALLER) ? (SMALLER) : (LARGER);
}
};
//@}
@@ -1043,37 +1049,39 @@ public:
Compare_endpoints_xy_2 compare_endpoints_xy_2_object() const
{ return Compare_endpoints_xy_2(*this); }
+ /*! A functor that construct an \f$x\f$-monotone curve with the same endpoints
+ * of a given curve, but directed in the opposite direction.
+ */
class Construct_opposite_2 {
protected:
- typedef Arr_polycurve_basic_traits_2
- Polycurve_basic_traits_2;
+ using Polycurve_basic_traits_2 =
+ Arr_polycurve_basic_traits_2;
- /*! The traits (in case it has state). */
+ //! The traits (in case it has state).
const Polycurve_basic_traits_2& m_poly_traits;
- public:
+ friend class Arr_polycurve_basic_traits_2;
+
/*! Constructor */
Construct_opposite_2(const Polycurve_basic_traits_2& traits) :
m_poly_traits(traits)
{}
- /*! Construct the reversed \(x\)-monotone polycurve of the input.
+ public:
+ /*! Construct the reversed \f$x\f$-monotone polycurve of the input.
* Note that the functor constructs the opposites of _all_ subcurves
- * constituting xcv.
- * \param xcv the \(x\)-monotone polycurve to be reveres
+ * constituting `xcv`.
+ * \param xcv the \f$x\f$-monotone polycurve to be reveres
* \pre xcv contains at least one subcurve
- * \return An \(x\)-monotone polycurve with the same graph as the input xcv
- * only with a reverse orientation.
+ * \return an \f$x\f$-monotone polycurve with the same graph as the input
+ * `xcv` only with a reverse orientation.
*/
- X_monotone_curve_2 operator()(const X_monotone_curve_2& xcv) const
- {
- const Subcurve_traits_2* geom_traits = m_poly_traits.subcurve_traits_2();
- typename Subcurve_traits_2::Construct_opposite_2 const_op =
- geom_traits->construct_opposite_2_object();
+ X_monotone_curve_2 operator()(const X_monotone_curve_2& xcv) const {
+ const auto* geom_traits = m_poly_traits.subcurve_traits_2();
+ auto const_op = geom_traits->construct_opposite_2_object();
std::vector rev_segs(xcv.number_of_subcurves());;
- typename X_monotone_curve_2::Subcurve_const_iterator sit;
- typename X_monotone_curve_2::Subcurve_iterator tit = rev_segs.begin();
- for (sit = xcv.subcurves_begin(); sit != xcv.subcurves_end(); ++sit)
+ auto tit = rev_segs.begin();
+ for (auto sit = xcv.subcurves_begin(); sit != xcv.subcurves_end(); ++sit)
*tit++ = const_op(*sit);
return X_monotone_curve_2(rev_segs.rbegin(), rev_segs.rend());
}
@@ -1135,44 +1143,73 @@ public:
return approximate_2_object_impl(Is_void());
}
- //
- class Construct_x_monotone_curve_2 {
+ //! A functor that constructs a point.
+ class Construct_point_2 {
protected:
- typedef Arr_polycurve_basic_traits_2
- Polycurve_basic_traits_2;
+ using Polycurve_basic_traits_2 =
+ Arr_polycurve_basic_traits_2;
- /*! The polycurve traits (in case it has state). */
+ //! The polycurve traits (in case it has state).
const Polycurve_basic_traits_2& m_poly_traits;
+ /*! Constructor. */
+ Construct_point_2(const Polycurve_basic_traits_2& traits) :
+ m_poly_traits(traits)
+ {}
+
+ friend class Arr_polycurve_basic_traits_2;
+
public:
+ /*! Construct a point.
+ * Apply perfect forwarding.
+ */
+ template
+ Point_2 operator()(Args ... args) const {
+ const auto* geom_traits = m_poly_traits.subcurve_traits_2();
+ auto ctr_point = geom_traits->construct_point_2_object();
+ return ctr_point(std::forward(args)...);
+ }
+ };
+
+ /*! Obtain a Construct_x_monotone_curve_2 functor object. */
+ Construct_point_2 construct_point_2_object() const
+ { return Construct_point_2(*this); }
+
+ //! A functor that constructs an \f$x\f$-monotone curve.
+ class Construct_x_monotone_curve_2 {
+ protected:
+ using Polycurve_basic_traits_2 =
+ Arr_polycurve_basic_traits_2;
+
+ //! The polycurve traits (in case it has state).
+ const Polycurve_basic_traits_2& m_poly_traits;
+
+ friend class Arr_polycurve_basic_traits_2;
+
/*! Constructor. */
Construct_x_monotone_curve_2(const Polycurve_basic_traits_2& traits) :
m_poly_traits(traits)
{}
- /*! Obtain an x-monotone polycurve that consists of one given subcurve.
+ public:
+ /*! Obtain an \f$x\f$-monotone polycurve that consists of one given subcurve.
* \param seg input subcurve.
* \pre seg is not degenerated.
- * \return An x-monotone polycurve with one subcurve.
+ * \return an \f$x\f$-monotone polycurve with one subcurve.
*/
- X_monotone_curve_2 operator()(const X_monotone_subcurve_2& seg) const
- {
+ X_monotone_curve_2 operator()(const X_monotone_subcurve_2& seg) const {
CGAL_precondition_code
(
/* Test that the subcurve is not degenerated. We do this test
* independently from the subcurve traits in use, as we do not
* allow a polycurve with degenerated subcurves.
*/
- const Subcurve_traits_2* geom_traits =
- m_poly_traits.subcurve_traits_2();
- typename Subcurve_traits_2::Construct_min_vertex_2 get_min_v =
- geom_traits->construct_min_vertex_2_object();
- typename Subcurve_traits_2::Construct_max_vertex_2 get_max_v =
- geom_traits->construct_max_vertex_2_object();
- typename Subcurve_traits_2::Equal_2 equal =
- geom_traits->equal_2_object();
+ const auto* geom_traits = m_poly_traits.subcurve_traits_2();
+ auto get_min_v = geom_traits->construct_min_vertex_2_object();
+ auto get_max_v = geom_traits->construct_max_vertex_2_object();
+ auto equal = geom_traits->equal_2_object();
- CGAL_precondition_msg(!equal(get_min_v(seg),get_max_v(seg)),
+ CGAL_precondition_msg(! equal(get_min_v(seg), get_max_v(seg)),
"Cannot construct a degenerated subcurve");
);
@@ -1186,29 +1223,29 @@ public:
return X_monotone_curve_2(seg);
}
- /*! Construct an x-monotone polycurve which is well-oriented from a range of
- * elements.
- * \pre Range should from a continuous well-oriented x-monotone polycurve.
+ /*! Construct an \f$x\f$-monotone polycurve, which is well-oriented, from a
+ * range of elements.
+ * \pre the elements in the range should form a continuous well-oriented
+ * \f$x\f$-monotone polycurve.
*/
template
X_monotone_curve_2 operator()(ForwardIterator begin,
- ForwardIterator end) const
- {
- typedef typename std::iterator_traits::value_type VT;
- typedef typename std::is_same::type Is_point;
+ ForwardIterator end) const {
+ using VT = typename std::iterator_traits::value_type;
+ using Is_point = typename std::is_same::type;
// Dispatch the range to the appropriate implementation.
return constructor_impl(begin, end, Is_point());
}
- /*! Construct an x-monotone polycurve from a range of points.
+ /*! Construct an \f$x\f$-monotone polycurve from a range of points.
* The polycurve may be oriented left-to-right or right-to-left
- * depending on the lexicographical order of the points in the
- * input.
- * \pre Range contains at least two points.
- * \pre No two consecutive points are the same.
- * \pre The points form an continuous well-oriented x-monotone polycurve.
- * \post By the construction the returned polycurve is well-oriented.
+ * depending on the lexicographical order of the points in the input.
+ * \pre range contains at least two points.
+ * \pre no two consecutive points are the same.
+ * \pre the points form an continuous well-oriented \f$x\f$-monotone
+ * polycurve.
+ * \post by the construction the returned polycurve is well-oriented.
*/
template
X_monotone_curve_2 constructor_impl(ForwardIterator /* begin */,
@@ -1216,26 +1253,25 @@ public:
std::true_type) const
{ CGAL_error_msg("Cannot construct a polycurve from a range of points!"); }
- /*! Obtain an x-monotone polycurve from a range of subcurves.
+ /*! Obtain an \f$x\f$-monotone polycurve from a range of subcurves.
* \param begin An iterator pointing to the first subcurve in the range.
* \param end An iterator pointing to the past-the-end subcurve
* in the range.
- * \pre The range contains at least one subcurve.
- * \pre Subcurves correspond to a well-oriented polycurve. That
+ * \pre the range contains at least one subcurve.
+ * \pre subcurves correspond to a well-oriented polycurve. That
* is, the target of the i-th subcurve is an source of the
* (i+1)th subcurve.
- * \pre The sequence of subcurves in the range forms a weak x-monotone
+ * \pre the sequence of subcurves in the range forms a weak \f$x\f$-monotone
* polycurve.
- * \pre The container should support bidirectional iteration.
- * \return A continuous, well-oriented x-monotone polycurve which
+ * \pre the container should support bidirectional iteration.
+ * \return a continuous, well-oriented \f$x\f$-monotone polycurve ,which
* is directed either left-to-right or right-to-left
* depending on the subcurves in the input.
*/
template
X_monotone_curve_2 constructor_impl(ForwardIterator begin,
ForwardIterator end,
- std::false_type) const
- {
+ std::false_type) const {
CGAL_precondition_msg
(
begin != end,
@@ -1244,16 +1280,11 @@ public:
CGAL_precondition_code
(
- const Subcurve_traits_2* geom_traits =
- m_poly_traits.subcurve_traits_2();
- typename Subcurve_traits_2::Compare_endpoints_xy_2 cmp_seg_endpts =
- geom_traits->compare_endpoints_xy_2_object();
- typename Subcurve_traits_2::Construct_min_vertex_2 get_min_v =
- geom_traits->construct_min_vertex_2_object();
- typename Subcurve_traits_2::Construct_max_vertex_2 get_max_v =
- geom_traits->construct_max_vertex_2_object();
- typename Subcurve_traits_2::Equal_2 equal =
- geom_traits->equal_2_object();
+ const auto* geom_traits = m_poly_traits.subcurve_traits_2();
+ auto cmp_seg_endpts = geom_traits->compare_endpoints_xy_2_object();
+ auto get_min_v = geom_traits->construct_min_vertex_2_object();
+ auto get_max_v = geom_traits->construct_max_vertex_2_object();
+ auto equal = geom_traits->equal_2_object();
ForwardIterator curr = begin;
ForwardIterator next = begin;
@@ -1263,7 +1294,7 @@ public:
CGAL_precondition_msg
(
- (next != end) || !equal(get_max_v(*curr),get_min_v(*curr)),
+ (next != end) || ! equal(get_max_v(*curr),get_min_v(*curr)),
"Cannot construct a polycurve with degenerated subcurve"
);
@@ -1325,62 +1356,62 @@ public:
//@{
/*! A function object that obtains the parameter space of a geometric
- * entity along the x-axis
+ * entity along the \f$x\f$-axis
*/
class Parameter_space_in_x_2 {
protected:
- typedef Arr_polycurve_basic_traits_2
- Polycurve_basic_traits_2;
+ using Polycurve_basic_traits_2 =
+ Arr_polycurve_basic_traits_2;
- /*! The polycurve traits (in case it has state). */
+ //! The polycurve traits (in case it has state).
const Polycurve_basic_traits_2& m_poly_traits;
- public:
+ friend class Arr_polycurve_basic_traits_2;
+
/*! Constructor. */
Parameter_space_in_x_2(const Polycurve_basic_traits_2& traits) :
m_poly_traits(traits)
{}
- /*! Obtains the parameter space at the end of a curve along the x-axis .
- * Note that if the curve-end coincides with a pole, then unless the curve
- * coincides with the identification curve, the curve-end is considered to
- * be approaching the boundary, but not on the boundary.
+ public:
+ /*! Obtains the parameter space at the end of a curve along the
+ * \f$x\f$-axis. Note that if the curve-end coincides with a pole, then
+ * unless the curve coincides with the identification curve, the curve-end
+ * is considered to be approaching the boundary, but not on the boundary.
* If the curve coincides with the identification curve, it is assumed to
* be smaller than any other object.
* \param xcv the curve
* \param ce the curve-end indicator:
- * ARR_MIN_END - the minimal end of xc or
- * ARR_MAX_END - the maximal end of xc
+ * `ARR_MIN_END` - the minimal end of `xcv` or
+ * `ARR_MAX_END` - the maximal end of `xcv`
* \return the parameter space at the ce end of the curve xcv.
- * ARR_LEFT_BOUNDARY - the curve approaches the identification curve
- * from the right at the curve left end.
- * ARR_INTERIOR - the curve does not approache the identification
- * curve.
- * ARR_RIGHT_BOUNDARY - the curve approaches the identification curve
- * from the left at the curve right end.
+ * `ARR_LEFT_BOUNDARY` - the curve approaches the identification curve
+ * from the right at the curve left end.
+ * `ARR_INTERIOR` - the curve does not approache the identification
+ * curve.
+ * `ARR_RIGHT_BOUNDARY` - the curve approaches the identification curve
+ * from the left at the curve right end.
* \pre xcv does not coincide with the vertical identification curve.
*/
Arr_parameter_space operator()(const X_monotone_curve_2& xcv,
- Arr_curve_end ce) const
- {
- const Subcurve_traits_2* geom_traits = m_poly_traits.subcurve_traits_2();
- Comparison_result direction =
- geom_traits->compare_endpoints_xy_2_object()(xcv[0]);
+ Arr_curve_end ce) const {
+ const auto* geom_traits = m_poly_traits.subcurve_traits_2();
+ auto cmp_endpt = geom_traits->compare_endpoints_xy_2_object();
+ Comparison_result direction = cmp_endpt(xcv[0]);
const X_monotone_subcurve_2& xs =
- (((direction == SMALLER) && (ce == ARR_MAX_END)) ||
- ((direction == LARGER) && (ce == ARR_MIN_END))) ?
- xcv[xcv.number_of_subcurves()-1] : xcv[0];
+ (((direction == SMALLER) && (ce == ARR_MIN_END)) ||
+ ((direction == LARGER) && (ce == ARR_MAX_END))) ?
+ xcv[0] : xcv[xcv.number_of_subcurves()-1];
return geom_traits->parameter_space_in_x_2_object()(xs, ce);
}
- /*! Obtains the parameter space at a point along the x-axis.
+ /*! Obtains the parameter space at a point along the \f$x\f$-axis.
* \param p the point.
- * \return the parameter space at p.
- * \pre p does not lie on the vertical identification curve.
+ * \return the parameter space at `p`.
+ * \pre `p` does not lie on the vertical identification curve.
*/
- Arr_parameter_space operator()(const Point_2 p) const
- {
- const Subcurve_traits_2* geom_traits = m_poly_traits.subcurve_traits_2();
+ Arr_parameter_space operator()(const Point_2 p) const {
+ const auto* geom_traits = m_poly_traits.subcurve_traits_2();
return geom_traits->parameter_space_in_x_2_object()(p);
}
};
@@ -1390,63 +1421,63 @@ public:
{ return Parameter_space_in_x_2(*this); }
/*! A function object that obtains the parameter space of a geometric
- * entity along the y-axis
+ * entity along the \f$y\f$-axis
*/
class Parameter_space_in_y_2 {
protected:
- typedef Arr_polycurve_basic_traits_2
- Polycurve_basic_traits_2;
+ using Polycurve_basic_traits_2 =
+ Arr_polycurve_basic_traits_2;
- /*! The polycurve traits (in case it has state). */
+ //! The polycurve traits (in case it has state).
const Polycurve_basic_traits_2& m_poly_traits;
- public:
+ friend class Arr_polycurve_basic_traits_2;
+
/*! Constructor. */
Parameter_space_in_y_2(const Polycurve_basic_traits_2& traits) :
m_poly_traits(traits)
{}
- /*! Obtains the parameter space at the end of an curve along the y-axis .
- * Note that if the curve-end coincides with a pole, then unless the curve
- * coincides with the identification curve, the curve-end is considered to
- * be approaching the boundary, but not on the boundary.
+ public:
+ /*! Obtains the parameter space at the end of an curve along the
+ * \f$y\f$-axis. Note that if the curve-end coincides with a pole, then
+ * unless the curve coincides with the identification curve, the curve-end
+ * is considered to be approaching the boundary, but not on the boundary.
* If the curve coincides with the identification curve, it is assumed to
* be smaller than any other object.
* \param xcv the curve
* \param ce the curve-end indicator:
- * ARR_MIN_END - the minimal end of xcv or
- * ARR_MAX_END - the maximal end of xcv
+ * `ARR_MIN_END` - the minimal end of `xcv` or
+ * `ARR_MAX_END` - the maximal end of `xcv`
* \return the parameter space at the ce end of the curve xcv.
- * ARR_BOTTOM_BOUNDARY - the curve approaches the south pole at the
- * curve left end.
- * ARR_INTERIOR - the curve does not approache a contraction
- * point.
- * ARR_TOP_BOUNDARY - the curve approaches the north pole at the
- * curve right end.
+ * `ARR_BOTTOM_BOUNDARY` - the curve approaches the south pole at the
+ * curve left end.
+ * `ARR_INTERIOR` - the curve does not approache a contraction
+ * point.
+ * `ARR_TOP_BOUNDARY` - the curve approaches the north pole at the
+ * curve right end.
* There are no horizontal identification curves!
*/
Arr_parameter_space operator()(const X_monotone_curve_2& xcv,
- Arr_curve_end ce) const
- {
- const Subcurve_traits_2* geom_traits = m_poly_traits.subcurve_traits_2();
- Comparison_result direction =
- geom_traits->compare_endpoints_xy_2_object()(xcv[0]);
+ Arr_curve_end ce) const {
+ const auto* geom_traits = m_poly_traits.subcurve_traits_2();
+ auto cmp_endpt = geom_traits->compare_endpoints_xy_2_object();
+ Comparison_result direction = cmp_endpt(xcv[0]);
const X_monotone_subcurve_2& xs =
- (((direction == SMALLER) && (ce == ARR_MAX_END)) ||
- ((direction == LARGER) && (ce == ARR_MIN_END))) ?
- xcv[xcv.number_of_subcurves()-1] : xcv[0];
+ (((direction == SMALLER) && (ce == ARR_MIN_END)) ||
+ ((direction == LARGER) && (ce == ARR_MAX_END))) ?
+ xcv[0] : xcv[xcv.number_of_subcurves()-1];
return geom_traits->parameter_space_in_y_2_object()(xs, ce);
}
- /*! Obtains the parameter space at a point along the y-axis.
+ /*! Obtains the parameter space at a point along the \f$y\f$-axis.
* \param p the point.
- * \return the parameter space at p.
+ * \return the parameter space at `p`.
* \pre p does not lie on the horizontal identification curve.
* There are no horizontal identification curves!
*/
- Arr_parameter_space operator()(const Point_2 p) const
- {
- const Subcurve_traits_2* geom_traits = m_poly_traits.subcurve_traits_2();
+ Arr_parameter_space operator()(const Point_2 p) const {
+ const auto* geom_traits = m_poly_traits.subcurve_traits_2();
return geom_traits->parameter_space_in_y_2_object()(p);
}
};
@@ -1455,63 +1486,65 @@ public:
Parameter_space_in_y_2 parameter_space_in_y_2_object() const
{ return Parameter_space_in_y_2(*this); }
- /*! A functor that compares the x-coordinate of curve-ends and points on the
- * boundary of the parameter space.
+ /*! A functor that compares the \f$x\f$-coordinate of curve-ends and points on
+ * the boundary of the parameter space.
*/
class Compare_x_on_boundary_2 {
protected:
- typedef Arr_polycurve_basic_traits_2
- Polycurve_basic_traits_2;
+ using Polycurve_basic_traits_2 =
+ Arr_polycurve_basic_traits_2;
- /*! The polycurve traits (in case it has state). */
+ //! The polycurve traits (in case it has state).
const Polycurve_basic_traits_2& m_poly_traits;
- public:
+ friend class Arr_polycurve_basic_traits_2;
+
/*! Constructor. */
Compare_x_on_boundary_2(const Polycurve_basic_traits_2& traits) :
m_poly_traits(traits)
{}
- /*! Compare the x-coordinates of a point with the x-coordinate of an
- * x-curve-end on the boundary.
+ public:
+ /*! Compare the \f$x\f$-coordinates of a point with the \f$x\f$-coordinate
+ * of an \f$x\f$-curve-end on the boundary.
* \param point the point.
- * \param xcv the x-curve, the endpoint of which is compared.
- * \param ce the x-curve-end indicator:
- * ARR_MIN_END - the minimal end of xcv or
- * ARR_MAX_END - the maximal end of xcv.
+ * \param xcv the \f$x\f$-monotone curve, the endpoint of which is compared.
+ * \param ce the \f$x\f$-monotone curve-end indicator:
+ * `ARR_MIN_END` - the minimal end of xcv or
+ * `ARR_MAX_END` - the maximal end of xcv.
* \return the comparison result:
- * SMALLER - x(p) < x(xcv, ce);
- * EQUAL - x(p) = x(xcv, ce);
- * LARGER - x(p) > x(xcv, ce).
- * \pre p lies in the interior of the parameter space.
- * \pre the ce end of the x-curve xcv lies on the top boundary.
- * \pre xcv does not coincide with the vertical identification curve.
+ * `SMALLER` - \f$x\f$(`p`) < \f$x\f$(`xcv`, `ce`);
+ * `EQUAL` - \f$x\f$(`p`) = \f$x\f$(`xcv`, `ce`);
+ * `LARGER` - \f$x\f$(`p`) > \f$x\f$(`xcv`, `ce`).
+ * \pre `p` lies in the interior of the parameter space.
+ * \pre the `ce` end of `xcv` lies on the top boundary.
+ * \pre `xcv` does not coincide with the vertical identification curve.
*/
Comparison_result operator()(const Point_2& point,
const X_monotone_curve_2& xcv,
Arr_curve_end ce) const
{ return operator()(point, xcv, ce, Bottom_or_top_sides_category()); }
- /*! Compare the x-coordinates of 2 curve-ends on the boundary of the
+ /*! Compare the \f$x\f$-coordinates of 2 curve-ends on the boundary of the
* parameter space.
* \param xcv1 the first curve.
* \param ce1 the first curve-end indicator:
- * ARR_MIN_END - the minimal end of xcv1 or
- * ARR_MAX_END - the maximal end of xcv1.
+ * `ARR_MIN_END` - the minimal end of `xcv1` or
+ * `ARR_MAX_END` - the maximal end of `xcv1`.
* \param xcv2 the second curve.
* \param ce2 the second curve-end indicator:
- * ARR_MIN_END - the minimal end of xcv2 or
- * ARR_MAX_END - the maximal end of xcv2.
+ * `ARR_MIN_END` - the minimal end of `xcv2` or
+ * `ARR_MAX_END` - the maximal end of `xcv2`.
* \return the second comparison result:
- * SMALLER - x(xcv1, ce1) < x(xcv2, ce2);
- * EQUAL - x(xcv1, ce1) = x(xcv2, ce2);
- * LARGER - x(xcv1, ce1) > x(xcv2, ce2).
- * \pre the ce1 end of the curve xcv1 lies on a pole (implying ce1 is
+ * `SMALLER` - \f$\f$x(`xcv1`, `ce1`) < \f$x\f$(`xcv2`, `ce2`);
+ * `EQUAL` - \f$x\f$(`xcv1`, `ce1`) = \f$x\f$(`xcv2`, `ce2`);
+ * `LARGER` - \f$x\f$(`xcv1`, `ce1`) > \f$x\f$(`xcv2`, `ce2`).
+ * \pre the `ce1` end of `xcv1` lies on a pole (implying `xcv1` is
* vertical).
- * \pre the ce2 end of the curve xcv2 lies on a pole (implying ce2 is
+ * \pre the `ce2` end of `xcv2` lies on a pole (implying `xcv2` is
* vertical).
- * \pre xcv1 does not coincide with the vertical identification curve.
- * \pre xcv2 does not coincide with the vertical identification curve.
+ * \pre `xcv1` does not coincide with the vertical identification curve.
+ * \pre `xcv2` does not coincide with the vertical identification curve.
*/
Comparison_result operator()(const X_monotone_curve_2& xcv1,
Arr_curve_end ce1,
@@ -1520,118 +1553,99 @@ public:
{ return operator()(xcv1, ce1, xcv2, ce2, Bottom_or_top_sides_category()); }
private:
- /*! \brief compares the x-coordinates of a point with the x-coordinate of
- * an x-curve-end on the boundary.
+ /*! \brief compares the \f$x\f$-coordinates of a point with the
+ * \f$x\f$-coordinate of an \f$x\f$-monotone curve-end on the boundary.
*/
Comparison_result operator()(const Point_2& point,
const X_monotone_curve_2& xcv,
Arr_curve_end ce,
- Arr_boundary_cond_tag) const
- {
- const Subcurve_traits_2* geom_traits = m_poly_traits.subcurve_traits_2();
- Comparison_result direction =
- geom_traits->compare_endpoints_xy_2_object()(xcv[0]);
+ Arr_boundary_cond_tag) const {
+ const auto* geom_traits = m_poly_traits.subcurve_traits_2();
+ auto cmp_endpt = geom_traits->compare_endpoints_xy_2_object();
+ Comparison_result direction = cmp_endpt(xcv[0]);
const X_monotone_subcurve_2& xs =
- (((direction == SMALLER) && (ce == ARR_MAX_END)) ||
- ((direction == LARGER) && (ce == ARR_MIN_END))) ?
+ (((direction == SMALLER) && (ce == ARR_MIN_END)) ||
+ ((direction == LARGER) && (ce == ARR_MAX_END))) ?
xcv[0] : xcv[xcv.number_of_subcurves()-1];
return geom_traits->compare_x_on_boundary_2_object()(point, xs, ce);
}
- /*! \brief compares the x-coordinates of 2 curve-ends on the boundary of
- * the parameter space.
+ /*! \brief compares the \f$x\f$-coordinates of 2 curve-ends on the boundary
+ * of the parameter space.
*/
Comparison_result operator()(const X_monotone_curve_2& xcv1,
Arr_curve_end ce1,
const X_monotone_curve_2& xcv2,
Arr_curve_end ce2,
- Arr_boundary_cond_tag) const
- {
- const Subcurve_traits_2* geom_traits = m_poly_traits.subcurve_traits_2();
- Comparison_result direction1 =
- geom_traits->compare_endpoints_xy_2_object()(xcv1[0]);
+ Arr_boundary_cond_tag) const {
+ const auto* geom_traits = m_poly_traits.subcurve_traits_2();
+ auto cmp_endpt = geom_traits->compare_endpoints_xy_2_object();
+ Comparison_result direction1 = cmp_endpt(xcv1[0]);
const X_monotone_subcurve_2& xs1 =
- (((direction1 == SMALLER) && (ce1 == ARR_MAX_END)) ||
- ((direction1 == LARGER) && (ce1 == ARR_MIN_END))) ?
+ (((direction1 == SMALLER) && (ce1 == ARR_MIN_END)) ||
+ ((direction1 == LARGER) && (ce1 == ARR_MAX_END))) ?
xcv1[0] : xcv1[xcv1.number_of_subcurves()-1];
- Comparison_result direction2 =
- geom_traits->compare_endpoints_xy_2_object()(xcv2[0]);
+ Comparison_result direction2 = cmp_endpt(xcv2[0]);
const X_monotone_subcurve_2& xs2 =
- (((direction2 == SMALLER) && (ce2 == ARR_MAX_END)) ||
- ((direction2 == LARGER) && (ce2 == ARR_MIN_END))) ?
+ (((direction2 == SMALLER) && (ce2 == ARR_MIN_END)) ||
+ ((direction2 == LARGER) && (ce2 == ARR_MAX_END))) ?
xcv2[0] : xcv2[xcv2.number_of_subcurves()-1];
return geom_traits->compare_x_on_boundary_2_object()(xs1, ce1, xs2, ce2);
}
size_type get_curve_index(const X_monotone_curve_2& xcv,
const Arr_curve_end ce) const
- {
- //waqar:: dont know why it is opposite in Parameter_space_in_x...
- // I think this is because of the way the subcurves are stored in the
- // curve_vector.
- // I am assuming that min end depends upon the direction and not the
- // x-value.
- // and also that min end subcurve is always placed at position 0 of the
- // vector.
- // Confirm with Eric.
- return (ce == ARR_MIN_END) ? 0 : xcv.number_of_subcurves() - 1;
- }
+ { return (ce == ARR_MIN_END) ? 0 : xcv.number_of_subcurves() - 1; }
- /*! Given a point p, an x-monotone curve C(t) = (X(t),Y(t)),
+ /*! Given a point \f$p\f$, an x-monotone curve \f$C(t) = (X(t),Y(t))\f$,
* and an enumerator that specifies either the minimum end or the
* maximum end of the curve, and thus maps to a parameter value
- * d in {0,1}, compare x_p and limit{t => d} X(t).
- * If the parameter space is unbounded, a precondition ensures that C has
- * a vertical asymptote at its d-end; that is limit{t => d} X(t) is finite.
+ * \f$d \in \{0,1\}\f$, compare x_p and limit{t => d} X(t).
+ * If the parameter space is unbounded, a precondition ensures that \f$C\f$
+ * has a vertical asymptote at its \f$d\f$-end; that is
+ * limit{t => d} X(t) is finite.
*/
Comparison_result operator()(const Point_2& p,
const X_monotone_curve_2& xcv,
Arr_curve_end ce,
- Arr_has_open_side_tag) const
- {
- const Subcurve_traits_2* geom_traits = m_poly_traits.subcurve_traits_2();
- typename Subcurve_traits_2::Compare_x_on_boundary_2
- compare_x_on_boundary = geom_traits->compare_x_on_boundary_2_object();
+ Arr_has_open_side_tag) const {
+ const auto* geom_traits = m_poly_traits.subcurve_traits_2();
+ auto cmp_x_on_boundary = geom_traits->compare_x_on_boundary_2_object();
size_type index = this->get_curve_index(xcv, ce);
- return compare_x_on_boundary(p, xcv[index], ce );
+ return cmp_x_on_boundary(p, xcv[index], ce);
}
- /*! Given two x-monotone curves C1(t) = (X1(t),Y1(t)) and
- * C2(t) = (X2(t),Y2(t)) and two enumerators that specify either the
- * minimum ends or the maximum ends of the curves, and thus map to
- * parameter values d1 in {0,1} and d2 in {0,1} for C1 and for C2,
- * respectively, compare limit{t => d1} X1(t) and limit{t => d2} X2(t).
+ /*! Given two \f$x\f$-monotone curves \f$C_1(t) = (X_1(t),Y_1(t))\f$ and
+ * \f$C2_(t) = (X_2(t),Y_2(t))\f$ and two enumerators that specify either
+ * the minimum ends or the maximum ends of the curves, and thus map to
+ * parameter values \f$d_1 \in \{0,1\}\f$ and \f$d_2 \in \{0,1\}\f$ for
+ * \f$C_1\f$ and for \f$C_2\f$, respectively, compare
+ * limit{t => d1} X1(t) and limit{t => d2} X2(t).
* If the parameter space is unbounded, a precondition ensures that
- * C1 and C2 have vertical asymptotes at their respective ends;
- * that is, limit{t => d1} X1(t) and limit{t =? d2} X2(t) are finite.
+ * \f$C_1\f$ and \f$C_2\f$ have vertical asymptotes at their respective
+ * ends; that is, limit{t => d1} X1(t) and limit{t =? d2} X2(t) are finite.
*/
Comparison_result operator()(const X_monotone_curve_2& xcv1,
Arr_curve_end ce1/* for xcv1 */,
- const X_monotone_curve_2 & xcv2,
+ const X_monotone_curve_2& xcv2,
Arr_curve_end ce2/*! for xcv2 */,
- Arr_has_open_side_tag) const
- {
- const Subcurve_traits_2* geom_traits = m_poly_traits.subcurve_traits_2();
- typename Subcurve_traits_2::Compare_x_at_on_boundary
- compare_x_on_boundary = geom_traits->compare_x_on_boundary_2_object();
-
+ Arr_has_open_side_tag) const {
+ const auto* geom_traits = m_poly_traits.subcurve_traits_2();
+ auto cmp_x_on_boundary = geom_traits->compare_x_on_boundary_2_object();
size_type index_1 = this->get_curve_index(xcv1, ce1);
size_type index_2 = this->get_curve_index(xcv2, ce2);
- return compare_x_on_boundary(xcv1[index_1], ce1, xcv2[index_2], ce2);
+ return cmp_x_on_boundary(xcv1[index_1], ce1, xcv2[index_2], ce2);
}
Comparison_result operator()(const X_monotone_curve_2& xcv,
Arr_curve_end ce1/* for xcv */,
const X_monotone_subcurve_2& xseg,
- Arr_curve_end ce2/*! for xseg */) const
- {
- const Subcurve_traits_2* geom_traits = m_poly_traits.subcurve_traits_2();
- typename Subcurve_traits_2::Compare_x_on_boundary_2
- compare_x_on_boundary = geom_traits->compare_x_on_boundary_2_object();
-
- size_type index = this->get_curve_index(xcv, ce1 );
- return compare_x_on_boundary(xcv[index], ce1, xseg, ce2);
+ Arr_curve_end ce2/*! for xseg */) const {
+ const auto* geom_traits = m_poly_traits.subcurve_traits_2();
+ auto cmp_x_on_boundary = geom_traits->compare_x_on_boundary_2_object();
+ size_type index = this->get_curve_index(xcv, ce1);
+ return cmp_x_on_boundary(xcv[index], ce1, xseg, ce2);
}
};
@@ -1639,42 +1653,33 @@ public:
Compare_x_on_boundary_2 compare_x_on_boundary_2_object() const
{ return Compare_x_on_boundary_2(*this); }
- class Compare_x_near_boundary_2{
+ /*! A functor that compares the \f$x\f$-coordinates of curve ends near the
+ * boundary of the parameter space.
+ */
+ class Compare_x_near_boundary_2 {
protected:
- typedef Arr_polycurve_basic_traits_2
- Polycurve_basic_traits_2;
+ using Polycurve_basic_traits_2 =
+ Arr_polycurve_basic_traits_2;
- /*! The polycurve traits (in case it has state). */
+ //! The polycurve traits (in case it has state).
const Polycurve_basic_traits_2& m_poly_traits;
- public:
+ friend class Arr_polycurve_basic_traits_2;
+
Compare_x_near_boundary_2(const Polycurve_basic_traits_2& traits) :
m_poly_traits(traits)
{}
+ public:
size_type get_curve_index(const X_monotone_curve_2& xcv,
const Arr_curve_end ce) const
- {
- //waqar:: dont know why it is opposite in Parameter_space_in_x...
- // I think this is because of the way the subcurves are stored in the
- // curve_vector.
- // I am assuming that min end depends upon the direction and not the
- // x-value.
- // and also that min end subcurve is always placed at position 0 of the
- // vector.
- // Confirm with Eric.
- size_type index = (ce == ARR_MIN_END) ? 0 : xcv.number_of_subcurves() - 1;
- return index;
- }
-
- Comparison_result operator()(const X_monotone_curve_2 xcv1,
- const X_monotone_curve_2 xcv2,
- Arr_curve_end ce) const
- {
- const Subcurve_traits_2* geom_traits = m_poly_traits.subcurve_traits_2();
- typename Subcurve_traits_2::Compare_x_near_boundary_2
- cmp_x_near_boundary = geom_traits->compare_x_near_boundary_2_object();
+ { return (ce == ARR_MIN_END) ? 0 : xcv.number_of_subcurves() - 1; }
+ Comparison_result operator()(const X_monotone_curve_2& xcv1,
+ const X_monotone_curve_2& xcv2,
+ Arr_curve_end ce) const {
+ const auto* geom_traits = m_poly_traits.subcurve_traits_2();
+ auto cmp_x_near_boundary = geom_traits->compare_x_near_boundary_2_object();
size_type index_1 = this->get_curve_index(xcv1, ce);
size_type index_2 = this->get_curve_index(xcv2, ce);
@@ -1685,36 +1690,37 @@ public:
Compare_x_near_boundary_2 compare_x_near_boundary_2_object() const
{ return Compare_x_near_boundary_2(*this); }
- /*! A functor that compares the y-coordinate of two given points
+ /*! A functor that compares the \f$y\f$-coordinate of two given points
* that lie on the vertical identification curve.
*/
class Compare_y_on_boundary_2 {
protected:
- typedef Arr_polycurve_basic_traits_2
- Polycurve_basic_traits_2;
+ using Polycurve_basic_traits_2 =
+ Arr_polycurve_basic_traits_2;
- /*! The polycurve traits (in case it has state). */
+ //! The polycurve traits (in case it has state).
const Polycurve_basic_traits_2& m_poly_traits;
- public:
+ friend class Arr_polycurve_basic_traits_2;
+
/*! Constructor. */
Compare_y_on_boundary_2(const Polycurve_basic_traits_2& traits) :
m_poly_traits(traits)
{}
- /*! Compare the y-coordinate of two given points that lie on the vertical
- * identification curve.
+ public:
+ /*! Compare the \f$y\f$-coordinate of two given points that lie on the
+ * vertical identification curve.
* \param p1 the first point.
* \param p2 the second point.
- * \return SMALLER - p1 is lexicographically smaller than p2;
- * EQUAL - p1 and p2 coincides;
- * LARGER - p1 is lexicographically larger than p2;
- * \pre p1 lies on the vertical identification curve.
- * \pre p2 lies on the vertical identification curve.
+ * \return `SMALLER` - `p1` is lexicographically smaller than `p2`;
+ * `EQUAL` - `p1` and `p2` coincides;
+ * `LARGER` - `p1` is lexicographically larger than `p2`;
+ * \pre `p1` lies on the vertical identification curve.
+ * \pre `p2` lies on the vertical identification curve.
*/
- Comparison_result operator()(const Point_2& p1, const Point_2& p2) const
- {
- const Subcurve_traits_2* geom_traits = m_poly_traits.subcurve_traits_2();
+ Comparison_result operator()(const Point_2& p1, const Point_2& p2) const {
+ const auto* geom_traits = m_poly_traits.subcurve_traits_2();
return geom_traits->compare_y_on_boundary_2_object()(p1, p2);
}
};
@@ -1723,52 +1729,52 @@ public:
Compare_y_on_boundary_2 compare_y_on_boundary_2_object() const
{ return Compare_y_on_boundary_2(*this); }
- /*! A functor that compares the y-coordinates of curve-ends near the
+ /*! A functor that compares the \f$y\f$-coordinates of curve-ends near the
* boundary of the parameter space.
*/
class Compare_y_near_boundary_2 {
protected:
- typedef Arr_polycurve_basic_traits_2
- Polycurve_basic_traits_2;
+ using Polycurve_basic_traits_2 =
+ Arr_polycurve_basic_traits_2;
- /*! The polycurve traits (in case it has state). */
+ //! The polycurve traits (in case it has state).
const Polycurve_basic_traits_2& m_poly_traits;
- public:
+ friend class Arr_polycurve_basic_traits_2;
+
/*! Constructor. */
Compare_y_near_boundary_2(const Polycurve_basic_traits_2& traits) :
m_poly_traits(traits)
{}
- /*! Compare the y-coordinates of 2 curves at their ends near the boundary
- * of the parameter space.
+ public:
+ /*! Compare the \f$y\f$-coordinates of 2 curves at their ends near the
+ * boundary of the parameter space.
* \param xcv1 the first curve.
* \param xcv2 the second curve.
* \param ce the curve-end indicator:
- * ARR_MIN_END - the minimal end or
- * ARR_MAX_END - the maximal end
+ * `ARR_MIN_END` - the minimal end or
+ * `ARR_MAX_END` - the maximal end
* \return the second comparison result.
- * \pre the ce ends of the curves xcv1 and xcv2 lie either on the left
+ * \pre the `ce` ends of the curves `xcv1` and `xcv2` lie either on the left
* boundary or on the right boundary of the parameter space (implying
* that they cannot be vertical).
* There is no horizontal identification curve!
*/
Comparison_result operator()(const X_monotone_curve_2& xcv1,
const X_monotone_curve_2& xcv2,
- Arr_curve_end ce) const
- {
- const Subcurve_traits_2* geom_traits = m_poly_traits.subcurve_traits_2();
- Comparison_result direction1 =
- geom_traits->compare_endpoints_xy_2_object()(xcv1[0]);
+ Arr_curve_end ce) const {
+ const auto* geom_traits = m_poly_traits.subcurve_traits_2();
+ auto cmp_endpt = geom_traits->compare_endpoints_xy_2_object();
+ Comparison_result direction1 = cmp_endpt(xcv1[0]);
const X_monotone_subcurve_2& xs1 =
- (((direction1 == SMALLER) && (ce == ARR_MAX_END)) ||
- ((direction1 == LARGER) && (ce == ARR_MIN_END))) ?
+ (((direction1 == SMALLER) && (ce == ARR_MIN_END)) ||
+ ((direction1 == LARGER) && (ce == ARR_MAX_END))) ?
xcv1[0] : xcv1[xcv1.number_of_subcurves()-1];
- Comparison_result direction2 =
- geom_traits->compare_endpoints_xy_2_object()(xcv2[0]);
+ Comparison_result direction2 = cmp_endpt(xcv2[0]);
const X_monotone_subcurve_2& xs2 =
- (((direction2 == SMALLER) && (ce == ARR_MAX_END)) ||
- ((direction2 == LARGER) && (ce == ARR_MIN_END))) ?
+ (((direction2 == SMALLER) && (ce == ARR_MIN_END)) ||
+ ((direction2 == LARGER) && (ce == ARR_MAX_END))) ?
xcv2[0] : xcv2[xcv2.number_of_subcurves()-1];
return geom_traits->compare_y_near_boundary_2_object()(xs1, xs2, ce);
}
@@ -1783,37 +1789,37 @@ public:
*/
class Is_on_y_identification_2 {
protected:
- typedef Arr_polycurve_basic_traits_2
- Polycurve_basic_traits_2;
+ using Polycurve_basic_traits_2 =
+ Arr_polycurve_basic_traits_2;
- /*! The polycurve traits (in case it has state). */
+ //! The polycurve traits (in case it has state).
const Polycurve_basic_traits_2& m_poly_traits;
- public:
+ friend class Arr_polycurve_basic_traits_2;
+
/*! Constructor. */
Is_on_y_identification_2(const Polycurve_basic_traits_2& traits) :
m_poly_traits(traits)
{}
+ public:
/*! Determine whether a point lies in the vertical boundary.
* \param p the point.
- * \return a Boolean indicating whether p lies in the vertical boundary.
+ * \return a Boolean indicating whether `p` lies in the vertical boundary.
*/
- bool operator()(const Point_2& p) const
- {
- const Subcurve_traits_2* geom_traits = m_poly_traits.subcurve_traits_2();
+ bool operator()(const Point_2& p) const {
+ const auto* geom_traits = m_poly_traits.subcurve_traits_2();
return geom_traits->is_on_y_identification_2_object()(p);
}
- /*! Determine whether an x-monotone curve lies in the vertical boundary.
- * \param xcv the x-monotone curve.
- * \return a Boolean indicating whether xcv lies in the vertical boundary.
+ /*! Determine whether an \f$x\f$-monotone curve lies in the vertical
+ * boundary.
+ * \param xcv the \f$x\f$-monotone curve.
+ * \return a Boolean indicating whether `xcv` lies in the vertical boundary.
*/
- bool operator()(const X_monotone_curve_2& xcv) const
- {
- const Subcurve_traits_2* geom_traits = m_poly_traits.subcurve_traits_2();
- typename X_monotone_curve_2::Subcurve_const_iterator it;
- for (it = xcv.subcurves_begin(); it != xcv.subcurves_end(); ++it)
+ bool operator()(const X_monotone_curve_2& xcv) const {
+ const auto* geom_traits = m_poly_traits.subcurve_traits_2();
+ for (auto it = xcv.subcurves_begin(); it != xcv.subcurves_end(); ++it)
if (! geom_traits->is_on_y_identification_2_object()(*it)) return false;
return true;
}
@@ -1828,37 +1834,37 @@ public:
*/
class Is_on_x_identification_2 {
protected:
- typedef Arr_polycurve_basic_traits_2
- Polycurve_basic_traits_2;
+ using Polycurve_basic_traits_2 =
+ Arr_polycurve_basic_traits_2;
- /*! The polycurve traits (in case it has state). */
+ //! The polycurve traits (in case it has state).
const Polycurve_basic_traits_2& m_poly_traits;
- public:
+ friend class Arr_polycurve_basic_traits_2;
+
/*! Constructor. */
Is_on_x_identification_2(const Polycurve_basic_traits_2& traits) :
m_poly_traits(traits)
{}
+ public:
/*! Determine whether a point lies in the vertical boundary.
* \param p the point.
- * \return a Boolean indicating whether p lies in the vertical boundary.
+ * \return a Boolean indicating whether `p` lies in the vertical boundary.
*/
- bool operator()(const Point_2& p) const
- {
- const Subcurve_traits_2* geom_traits = m_poly_traits.subcurve_traits_2();
+ bool operator()(const Point_2& p) const {
+ const auto* geom_traits = m_poly_traits.subcurve_traits_2();
return geom_traits->is_on_x_identification_2_object()(p);
}
- /*! Determine whether an x-monotone curve lies in the vertical boundary.
- * \param xcv the x-monotone curve.
- * \return a Boolean indicating whether xcv lies in the vertical boundary.
+ /*! Determine whether an \f$x\f$-monotone curve lies in the vertical
+ * boundary.
+ * \param `xcv` the \f$x\f$-monotone curve.
+ * \return a Boolean indicating whether `xcv` lies in the vertical boundary.
*/
- bool operator()(const X_monotone_curve_2& xcv) const
- {
- const Subcurve_traits_2* geom_traits = m_poly_traits.subcurve_traits_2();
- typename X_monotone_curve_2::Subcurve_const_iterator it;
- for (it = xcv.subcurves_begin(); it != xcv.subcurves_end(); ++it)
+ bool operator()(const X_monotone_curve_2& xcv) const {
+ const auto* geom_traits = m_poly_traits.subcurve_traits_2();
+ for (auto it = xcv.subcurves_begin(); it != xcv.subcurves_end(); ++it)
if (! geom_traits->is_on_x_identification_2_object()(*it)) return false;
return true;
}
@@ -1878,8 +1884,7 @@ public:
*/
class Number_of_points_2 {
public:
- size_type operator()(const X_monotone_curve_2& cv) const
- {
+ size_type operator()(const X_monotone_curve_2& cv) const {
size_type num_seg = cv.number_of_subcurves();
return (num_seg == 0) ? 0 : num_seg + 1;
}
@@ -1893,19 +1898,21 @@ public:
*/
class Push_back_2 {
protected:
- typedef Arr_polycurve_basic_traits_2
- Polycurve_basic_traits_2;
+ using Polycurve_basic_traits_2 =
+ Arr_polycurve_basic_traits_2;
- /*! The traits (in case it has state). */
+ //! The traits (in case it has state).
const Polycurve_basic_traits_2& m_poly_traits;
- public:
+ friend class Arr_polycurve_basic_traits_2;
+
/*! Constructor. */
Push_back_2(const Polycurve_basic_traits_2& traits) :
m_poly_traits(traits)
{}
- /*! Append a subcurve to an existing x-monotone polycurve at the back.
+ public:
+ /*! Append a subcurve to an existing \f$x\f$-monotone polycurve at the back.
*/
void operator()(X_monotone_curve_2& xcv, const X_monotone_subcurve_2& seg)
const
@@ -1913,40 +1920,33 @@ public:
private:
// Oblivious implementation
- template
+ template
void push_back_2_impl(X_monotone_curve_2& xcv,
const X_monotone_subcurve_2& seg,
- Arr_all_sides_oblivious_tag) const
- {
+ Arr_all_sides_oblivious_tag) const {
CGAL_precondition_code
(
- typedef typename X_monotone_curve_2::size_type size_type;
+ using size_type = typename X_monotone_curve_2::size_type;
size_type num_seg = xcv.number_of_subcurves();
- const Subcurve_traits_2* geom_traits =
- m_poly_traits.subcurve_traits_2();
- typename Subcurve_traits_2::Compare_endpoints_xy_2 cmp_seg_endpts =
- geom_traits->compare_endpoints_xy_2_object();
- Comparison_result dir = cmp_seg_endpts(seg);
- typename Subcurve_traits_2::Construct_max_vertex_2 get_max_v =
- geom_traits->construct_max_vertex_2_object();
- typename Subcurve_traits_2::Construct_min_vertex_2 get_min_v =
- geom_traits->construct_min_vertex_2_object();
- typename Subcurve_traits_2::Equal_2 equal =
- geom_traits->equal_2_object();
- typename Subcurve_traits_2::Is_vertical_2 is_vertical =
- geom_traits->is_vertical_2_object();
+ const auto* geom_traits = m_poly_traits.subcurve_traits_2();
+ auto cmp_endpts = geom_traits->compare_endpoints_xy_2_object();
+ Comparison_result dir = cmp_endpts(seg);
+ auto get_max_v = geom_traits->construct_max_vertex_2_object();
+ auto get_min_v = geom_traits->construct_min_vertex_2_object();
+ auto equal = geom_traits->equal_2_object();
+ auto is_vertical = geom_traits->is_vertical_2_object();
CGAL_precondition_msg((num_seg == 0) ||
((is_vertical(xcv[0]) && is_vertical(seg)) ||
- (!is_vertical(xcv[0]) && !is_vertical(seg))),
+ (! is_vertical(xcv[0]) && ! is_vertical(seg))),
"xcv is vertical and seg is not or vice versa!");
CGAL_precondition_msg((num_seg == 0) ||
- (cmp_seg_endpts(xcv[0]) == dir),
+ (cmp_endpts(xcv[0]) == dir),
"xcv and seg do not have the same orientation!");
CGAL_precondition_msg((num_seg == 0) ||
- !equal(get_min_v(seg), get_max_v(seg)),
+ ! equal(get_min_v(seg), get_max_v(seg)),
"Seg degenerates to a point!");
CGAL_precondition_msg((num_seg == 0) ||
@@ -1966,40 +1966,31 @@ public:
}
// Boundary implementation
- template
+ template
void push_back_2_impl(X_monotone_curve_2& xcv,
const X_monotone_subcurve_2& seg,
- Arr_not_all_sides_oblivious_tag) const
- {
+ Arr_not_all_sides_oblivious_tag) const {
CGAL_precondition_code
(
- typedef typename X_monotone_curve_2::size_type size_type;
+ using size_type = typename X_monotone_curve_2::size_type;
size_type num_seg = xcv.number_of_subcurves();
- const Subcurve_traits_2* geom_traits =
- m_poly_traits.subcurve_traits_2();
- typename Subcurve_traits_2::Compare_endpoints_xy_2 cmp_seg_endpts =
- geom_traits->compare_endpoints_xy_2_object();
- Comparison_result dir = cmp_seg_endpts(seg);
- typename Subcurve_traits_2::Construct_max_vertex_2 get_max_v =
- geom_traits->construct_max_vertex_2_object();
- typename Subcurve_traits_2::Construct_min_vertex_2 get_min_v =
- geom_traits->construct_min_vertex_2_object();
- typename Subcurve_traits_2::Equal_2 equal =
- geom_traits->equal_2_object();
- typename Subcurve_traits_2::Is_vertical_2 is_vertical =
- geom_traits->is_vertical_2_object();
- typename Subcurve_traits_2::Parameter_space_in_x_2 ps_x =
- geom_traits->parameter_space_in_x_2_object();
- typename Subcurve_traits_2::Parameter_space_in_y_2 ps_y =
- geom_traits->parameter_space_in_y_2_object();
+ const auto* geom_traits = m_poly_traits.subcurve_traits_2();
+ auto cmp_endpts = geom_traits->compare_endpoints_xy_2_object();
+ Comparison_result dir = cmp_endpts(seg);
+ auto get_max_v = geom_traits->construct_max_vertex_2_object();
+ auto get_min_v = geom_traits->construct_min_vertex_2_object();
+ auto equal = geom_traits->equal_2_object();
+ auto is_vertical = geom_traits->is_vertical_2_object();
+ auto ps_x = geom_traits->parameter_space_in_x_2_object();
+ auto ps_y = geom_traits->parameter_space_in_y_2_object();
CGAL_precondition_msg((num_seg == 0) ||
((is_vertical(xcv[0]) && is_vertical(seg)) ||
- (!is_vertical(xcv[0]) && !is_vertical(seg))),
+ (! is_vertical(xcv[0]) && ! is_vertical(seg))),
"xcv is vertical and seg is not or vice versa!");
CGAL_precondition_msg((num_seg == 0) ||
- (cmp_seg_endpts(xcv[0]) == dir),
+ (cmp_endpts(xcv[0]) == dir),
"xcv and seg do not have the same orientation!");
const Arr_parameter_space min_x_seg = ps_x(seg, ARR_MIN_END);
@@ -2030,7 +2021,7 @@ public:
((max_x_cv == ARR_INTERIOR) &&
(max_y_cv == ARR_INTERIOR))),
"Polycurve reaches the boundary to the right."
- "Can not push back any subcurve further." );
+ "Can not push back any subcurve further.");
// A subcurve should not be pushed if the polycurve is directed to
// the left and reaches the boundary.
@@ -2038,7 +2029,7 @@ public:
((min_x_cv == ARR_INTERIOR) &&
(min_y_cv == ARR_INTERIOR))),
"Polycurve reaches the boundary to the left."
- "Can not push back any subcurve further." );
+ "Can not push back any subcurve further.");
// Something like a line should not be pushed if there is already a
// subcurve present in the polycurve.
@@ -2046,7 +2037,7 @@ public:
(min_y_seg == ARR_INTERIOR)) ||
((max_x_seg == ARR_INTERIOR) &&
(max_y_seg == ARR_INTERIOR)) ||
- (num_seg == 0) ),
+ (num_seg == 0)),
"Subcurve reaching the boundary at both ends "
"can not be pushed if there is already one or "
"more subcurves present in the polycurve.");
@@ -2055,7 +2046,7 @@ public:
(max_x_seg == ARR_INTERIOR) && (max_y_seg == ARR_INTERIOR))
{
CGAL_precondition_msg((num_seg == 0) ||
- !equal(get_min_v(seg), get_max_v(seg)),
+ ! equal(get_min_v(seg), get_max_v(seg)),
"Seg degenerates to a point!");
}
@@ -2067,7 +2058,7 @@ public:
"Seg does not connect to the right!");
}
- if ((max_x_seg == ARR_INTERIOR) && (max_y_seg == ARR_INTERIOR) ) {
+ if ((max_x_seg == ARR_INTERIOR) && (max_y_seg == ARR_INTERIOR)) {
CGAL_precondition_msg((num_seg == 0) ||
(((dir != LARGER) ||
equal(get_min_v(xcv[num_seg-1]),
@@ -2088,18 +2079,20 @@ public:
*/
class Push_front_2 {
protected:
- typedef Arr_polycurve_basic_traits_2
- Polycurve_basic_traits_2;
+ using Polycurve_basic_traits_2 =
+ Arr_polycurve_basic_traits_2;
- /*! The traits (in case it has state). */
+ //! The traits (in case it has state).
const Polycurve_basic_traits_2& m_poly_traits;
- public:
+ friend class Arr_polycurve_basic_traits_2;
+
/*! Constructor. */
Push_front_2(const Polycurve_basic_traits_2& traits) :
m_poly_traits(traits)
{}
+ public:
/* Append a subcurve `seg` to an existing polycurve `xcv` at the front. */
void operator()(X_monotone_curve_2& xcv, const X_monotone_subcurve_2& seg)
const
@@ -2107,42 +2100,34 @@ public:
private:
// Oblivious implementation
- template
+ template
void push_front_2_impl(X_monotone_curve_2& xcv,
const X_monotone_subcurve_2& seg,
- Arr_all_sides_oblivious_tag)
- const
- {
+ Arr_all_sides_oblivious_tag) const {
CGAL_precondition_code
(
- typedef typename X_monotone_curve_2::size_type size_type;
+ using size_type = typename X_monotone_curve_2::size_type;
size_type num_seg = xcv.number_of_subcurves();
- const Subcurve_traits_2* geom_traits =
- m_poly_traits.subcurve_traits_2();
- typename Subcurve_traits_2::Compare_endpoints_xy_2 cmp_seg_endpts =
- geom_traits->compare_endpoints_xy_2_object();
- Comparison_result dir = cmp_seg_endpts(seg);
- typename Subcurve_traits_2::Construct_max_vertex_2 get_max_v =
- geom_traits->construct_max_vertex_2_object();
- typename Subcurve_traits_2::Construct_min_vertex_2 get_min_v =
- geom_traits->construct_min_vertex_2_object();
- typename Subcurve_traits_2::Equal_2 equal =
- geom_traits->equal_2_object();
- typename Subcurve_traits_2::Is_vertical_2 is_vertical =
- geom_traits->is_vertical_2_object();
+ const auto* geom_traits = m_poly_traits.subcurve_traits_2();
+ auto cmp_endpts = geom_traits->compare_endpoints_xy_2_object();
+ Comparison_result dir = cmp_endpts(seg);
+ auto get_max_v = geom_traits->construct_max_vertex_2_object();
+ auto get_min_v = geom_traits->construct_min_vertex_2_object();
+ auto equal = geom_traits->equal_2_object();
+ auto is_vertical = geom_traits->is_vertical_2_object();
CGAL_precondition_msg((num_seg == 0) ||
((is_vertical(xcv[0]) && is_vertical(seg)) ||
- (!is_vertical(xcv[0]) && !is_vertical(seg))),
+ (! is_vertical(xcv[0]) && !is_vertical(seg))),
"xcv is vertical and seg is not or vice versa!");
CGAL_precondition_msg((num_seg == 0) ||
- (cmp_seg_endpts(xcv[0]) == dir),
+ (cmp_endpts(xcv[0]) == dir),
"xcv and seg do not have the same orientation!");
CGAL_precondition_msg((num_seg == 0) ||
- !equal(get_min_v(seg), get_max_v(seg)),
+ ! equal(get_min_v(seg), get_max_v(seg)),
"Seg degenerates to a point!");
CGAL_precondition_msg((num_seg == 0) ||
(((dir != SMALLER) ||
@@ -2158,41 +2143,31 @@ public:
}
// Boundary implementation
- template
+ template
void push_front_2_impl(X_monotone_curve_2& xcv,
const X_monotone_subcurve_2& seg,
- Arr_not_all_sides_oblivious_tag)
- const
- {
+ Arr_not_all_sides_oblivious_tag) const {
CGAL_precondition_code
(
- typedef typename X_monotone_curve_2::size_type size_type;
+ using size_type = typename X_monotone_curve_2::size_type;
size_type num_seg = xcv.number_of_subcurves();
- const Subcurve_traits_2* geom_traits =
- m_poly_traits.subcurve_traits_2();
- typename Subcurve_traits_2::Compare_endpoints_xy_2 cmp_seg_endpts =
- geom_traits->compare_endpoints_xy_2_object();
- Comparison_result dir = cmp_seg_endpts(seg);
- typename Subcurve_traits_2::Construct_max_vertex_2 get_max_v =
- geom_traits->construct_max_vertex_2_object();
- typename Subcurve_traits_2::Construct_min_vertex_2 get_min_v =
- geom_traits->construct_min_vertex_2_object();
- typename Subcurve_traits_2::Equal_2 equal =
- geom_traits->equal_2_object();
- typename Subcurve_traits_2::Parameter_space_in_x_2 ps_x =
- geom_traits->parameter_space_in_x_2_object();
- typename Subcurve_traits_2::Parameter_space_in_y_2 ps_y =
- geom_traits->parameter_space_in_y_2_object();
- typename Subcurve_traits_2::Is_vertical_2 is_vertical =
- geom_traits->is_vertical_2_object();
+ const auto* geom_traits = m_poly_traits.subcurve_traits_2();
+ auto cmp_endpts = geom_traits->compare_endpoints_xy_2_object();
+ Comparison_result dir = cmp_endpts(seg);
+ auto get_max_v = geom_traits->construct_max_vertex_2_object();
+ auto get_min_v = geom_traits->construct_min_vertex_2_object();
+ auto equal = geom_traits->equal_2_object();
+ auto ps_x = geom_traits->parameter_space_in_x_2_object();
+ auto ps_y = geom_traits->parameter_space_in_y_2_object();
+ auto is_vertical = geom_traits->is_vertical_2_object();
CGAL_precondition_msg((num_seg == 0) ||
((is_vertical(xcv[0]) && is_vertical(seg)) ||
- (!is_vertical(xcv[0]) && !is_vertical(seg))),
+ (! is_vertical(xcv[0]) && ! is_vertical(seg))),
"xcv is vertical and seg is not or vice versa!");
CGAL_precondition_msg((num_seg == 0) ||
- (cmp_seg_endpts(xcv[0]) == dir),
+ (cmp_endpts(xcv[0]) == dir),
"xcv and seg do not have the same orientation!");
const Arr_parameter_space min_x_seg = ps_x(seg, ARR_MIN_END);
@@ -2227,7 +2202,7 @@ public:
(max_x_seg == ARR_INTERIOR) && (max_y_seg == ARR_INTERIOR))
{
CGAL_precondition_msg((num_seg == 0) ||
- !equal(get_min_v(seg), get_max_v(seg)),
+ ! equal(get_min_v(seg), get_max_v(seg)),
"Seg degenerates to a point!");
}
@@ -2253,72 +2228,65 @@ public:
/*! Obtain a Push_front_2 functor object. */
Push_front_2 push_front_2_object() const { return Push_front_2(*this); }
+ //! A functor that trimps an \f$x\f$-monotone curve.
class Trim_2 {
protected:
- typedef Arr_polycurve_basic_traits_2
- Polycurve_basic_traits_2;
+ using Polycurve_basic_traits_2 =
+ Arr_polycurve_basic_traits_2;
- /* The polycurve traits (in case it has state). */
+ //! The polycurve traits (in case it has state).
const Polycurve_basic_traits_2& m_poly_traits;
- /*! \brief returns a trimmed version of the polycurve with src and tgt as
- * end points.
- */
- public:
- /*! Constructor. */
- Trim_2(const Polycurve_basic_traits_2& traits) :
- m_poly_traits(traits)
- {}
+ friend class Arr_polycurve_basic_traits_2;
+ /*! Constructor. */
+ Trim_2(const Polycurve_basic_traits_2& traits) : m_poly_traits(traits) {}
+
+ public:
+ /*! \brief returns a trimmed version of the polycurve with `source` and
+ * `target` as end points.
+ */
X_monotone_curve_2 operator()(const X_monotone_curve_2& xcv,
- const Point_2& src,
- const Point_2& tgt)const
+ const Point_2& source,
+ const Point_2& target) const
{
- const Subcurve_traits_2* geom_traits = m_poly_traits.subcurve_traits_2();
- typename Subcurve_traits_2::Trim_2 trim = geom_traits->trim_2_object();
+ const auto* geom_traits = m_poly_traits.subcurve_traits_2();
+ auto min_vertex = geom_traits->construct_min_vertex_2_object();
+ auto max_vertex = geom_traits->construct_max_vertex_2_object();
+ auto trim = geom_traits->trim_2_object();
//check whether src and tgt lies on the polycurve/polycurve.
- CGAL_precondition(m_poly_traits.compare_y_at_x_2_object()(src, xcv) ==
- EQUAL);
- CGAL_precondition(m_poly_traits.compare_y_at_x_2_object()(tgt, xcv) ==
- EQUAL);
+ CGAL_precondition_code
+ (auto cmp_y_at_x_2 = m_poly_traits.compare_y_at_x_2_object());
+ CGAL_precondition(cmp_y_at_x_2(source, xcv) == EQUAL);
+ CGAL_precondition(cmp_y_at_x_2(target, xcv) == EQUAL);
/* Check whether the source and the target conform with the
* direction of the polycurve.
* since the direction of the poly-line/curve should not be changed.
* we will interchange the source and the target.
*/
- Point_2 source = src;
- Point_2 target = tgt;
- // If curve is oriented from right to left but points are left to right.
- if (m_poly_traits.compare_endpoints_xy_2_object()(xcv) == LARGER &&
- m_poly_traits.compare_x_2_object()(src, tgt) == SMALLER )
- {
- source = tgt;
- target = src;
- }
-
- /* If curve is oriented from left to right but points are from right
- * to left.
+ /* If the curve is oriented from right to left but points are left to
+ * right or if the curve is oriented from left to right but points are
+ * from right to left, reverse.
*/
- else if (m_poly_traits.compare_endpoints_xy_2_object()(xcv) == SMALLER &&
- m_poly_traits.compare_x_2_object()(src, tgt) == LARGER )
- {
- source = tgt;
- target = src;
- }
+ auto [src, trg] =
+ (((m_poly_traits.compare_endpoints_xy_2_object()(xcv) == LARGER) &&
+ (m_poly_traits.compare_x_2_object()(source, target) == SMALLER)) ||
+ ((m_poly_traits.compare_endpoints_xy_2_object()(xcv) == SMALLER) &&
+ (m_poly_traits.compare_x_2_object()(source, target) == LARGER))) ?
+ std::make_tuple(target, source) : std::make_tuple(source, target);
// std::cout << "**************the new source: " << source
// << "the new target: " << target << std::endl;
- /*
- * Get the source and target subcurve numbers from the polycurve.
+ /* Get the source and target subcurve numbers from the polycurve.
* The trimmed polycurve will have trimmed end subcurves(containing
* source and target) along with complete
* subcurves in between them.
*/
- std::size_t source_id = m_poly_traits.locate(xcv, source);
- std::size_t target_id = m_poly_traits.locate(xcv, target);
+ std::size_t src_id = m_poly_traits.locate(xcv, src);
+ std::size_t trg_id = m_poly_traits.locate(xcv, trg);
// std::cout << "source number: " << source_id << " Target number : "
// << target_id << std::endl;
// std::cout << "target subcurve: " << xcv[target_id] << std::endl;
@@ -2328,52 +2296,42 @@ public:
Comparison_result orientation =
m_poly_traits.compare_endpoints_xy_2_object()(xcv);
- Point_2 source_max_vertex =
- geom_traits->construct_max_vertex_2_object()(xcv[source_id]);
- Point_2 source_min_vertex =
- geom_traits->construct_min_vertex_2_object()(xcv[source_id]);
- Point_2 target_min_vertex =
- geom_traits->construct_min_vertex_2_object()(xcv[target_id]);
- Point_2 target_max_vertex =
- geom_traits->construct_max_vertex_2_object()(xcv[target_id]);
+ auto src_max_vertex = max_vertex(xcv[src_id]);
+ auto src_min_vertex = min_vertex(xcv[src_id]);
+ auto trg_min_vertex = min_vertex(xcv[trg_id]);
+ auto trg_max_vertex = max_vertex(xcv[trg_id]);
- //push the trimmed version of the source subcurve.
- // if(sorientation == SMALLER && source != source_max_vertex)
+ // Push the trimmed version of the source subcurve.
+ // if (sorientation == SMALLER && source != src_max_vertex)
if ((orientation == SMALLER) &&
- ! geom_traits->equal_2_object()(source, source_max_vertex) )
- {
- if (source_id != target_id )
- trimmed_subcurves.push_back(trim(xcv[source_id],
- source, source_max_vertex));
- else trimmed_subcurves.push_back(trim(xcv[source_id], source, target));
+ ! geom_traits->equal_2_object()(src, src_max_vertex)) {
+ if (src_id != trg_id)
+ trimmed_subcurves.push_back(trim(xcv[src_id], src, src_max_vertex));
+ else trimmed_subcurves.push_back(trim(xcv[src_id], src, trg));
}
- //else if(orientation == LARGER && source != source_min_vertex)
+ // else if(orientation == LARGER && source != src_min_vertex)
else if ((orientation == LARGER) &&
- ! geom_traits->equal_2_object()(source, source_min_vertex))
- {
- if (source_id != target_id )
- trimmed_subcurves.push_back(trim(xcv[source_id],
- source, source_min_vertex));
- else trimmed_subcurves.push_back(trim(xcv[source_id], source, target));
+ ! geom_traits->equal_2_object()(src, src_min_vertex)) {
+ if (src_id != trg_id)
+ trimmed_subcurves.push_back(trim(xcv[src_id], src, src_min_vertex));
+ else trimmed_subcurves.push_back(trim(xcv[src_id], src, trg));
}
- //push the middle subcurves as they are.
- for (size_t i = source_id+1; iequal_2_object()(target, target_min_vertex))
- trimmed_subcurves.push_back(trim(xcv[target_id],
- target_min_vertex, target));
+ ! geom_traits->equal_2_object()(trg, trg_min_vertex))
+ trimmed_subcurves.push_back(trim(xcv[trg_id], trg_min_vertex, trg));
- //else if (orientation == LARGER && target != target_max_vertex)
+ // else if (orientation == LARGER && target != trg_max_vertex)
else if ((orientation == LARGER) &&
- ! geom_traits->equal_2_object()(target, target_max_vertex))
- trimmed_subcurves.push_back(trim(xcv[target_id],
- target_max_vertex, target));
+ ! geom_traits->equal_2_object()(trg, trg_max_vertex))
+ trimmed_subcurves.push_back(trim(xcv[trg_id], trg_max_vertex, trg));
}
return X_monotone_curve_2(trimmed_subcurves.begin(),
@@ -2391,18 +2349,19 @@ protected:
* Roadmap: locate() should return an iterator to the located subcurve
*/
- /*! Obtain the index of the subcurve in the polycurve that contains the
- * point q in its x-range. The function performs a binary search, so if the
- * point q is in the x-range of the polycurve with n subcurves, the subcurve
- * containing it can be located in \cgalBigO{log n} operations.
- * \param cv The polycurve curve.
- * \param q The point.
- * \return An index i such that q is in the x-range of cv[i].
- * If q is not in the x-range of cv, returns INVALID_INDEX.
+ /*! Obtain the index of the subcurve in the polycurve that contains a point
+ * \f$q\f$ in its \f$x\f$-range. The function performs a binary search, so if
+ * the point \f$q\f$ is in the \f$x\f$-range of the polycurve with \f$n\f$
+ * subcurves, the subcurve containing it can be located in \cgalBigO{log n}
+ * operations.
+ * \param cv the polycurve curve.
+ * \param q the point.
+ * \return an index \f$i\f$ such that \f$q\f$ is in the \f$x\f$-range of
+ * `cv[i]`. If \f$q\f$ is not in the \f$x\f$-range of `cv`, returns
+ * `INVALID_INDEX`.
*/
template
- std::size_t locate_gen(const X_monotone_curve_2& cv, Compare compare) const
- {
+ std::size_t locate_gen(const X_monotone_curve_2& cv, Compare compare) const {
// The direction of cv. SMALLER means left-to-right and
// otherwise right-to-left
Comparison_result direction =
@@ -2429,12 +2388,10 @@ protected:
// Perform a binary search to locate the subcurve that contains q in its
// range:
while (((direction == SMALLER) && (to > from)) ||
- ((direction == LARGER) && (to < from)))
- {
+ ((direction == LARGER) && (to < from))) {
std::size_t mid = (from + to) / 2;
if (((direction == SMALLER) && (mid > from)) ||
- ((direction == LARGER) && (mid < from)))
- {
+ ((direction == LARGER) && (mid < from))) {
Comparison_result res_mid = compare(cv[mid], ARR_MIN_END);
if (res_mid == EQUAL) {
// Ensure that the returned subcurve contains the query point
@@ -2466,11 +2423,10 @@ protected:
template
class Compare_points {
private:
- /*! The polycurve traits (in case it has state). */
+ //! The polycurve traits (in case it has state).
const Subcurve_traits_2& m_subcurve_traits;
const Point_2& m_point;
-
Comparer m_compare;
public:
@@ -2484,9 +2440,8 @@ protected:
// Compare the given curve-end with the stored point.
Comparison_result operator()(const X_monotone_subcurve_2& xs,
- Arr_curve_end ce)
- {
- const Point_2& p = (ce == ARR_MAX_END) ?
+ Arr_curve_end ce) {
+ auto p = (ce == ARR_MAX_END) ?
m_subcurve_traits.construct_max_vertex_2_object()(xs) :
m_subcurve_traits.construct_min_vertex_2_object()(xs);
return m_compare(p, m_point);
@@ -2498,7 +2453,6 @@ protected:
class Compare_point_curve_end {
private:
const Point_2& m_point;
-
Comparer m_compare;
public:
@@ -2519,9 +2473,7 @@ protected:
class Compare_curve_ends {
private:
const X_monotone_subcurve_2& m_x_monotone_subcurve;
-
Arr_curve_end m_curve_end;
-
Comparer m_compare;
public:
@@ -2543,21 +2495,23 @@ protected:
* of a curve.
* This implementation is used in the case where at least one side of the
* parameter space is not oblivious.
- * \param xcv (in) the given polycurve.
- * \param xs (in) the given curve.
- * \param cd (in) the curve-end indicator.
+ * \param(in) xcv the given polycurve.
+ * \param(in) xs the given curve.
+ * \param(in) ce the curve-end indicator.
*/
std::size_t locate_impl(const X_monotone_curve_2& xcv,
const X_monotone_subcurve_2& xs,
Arr_curve_end ce,
- Arr_not_all_sides_oblivious_tag) const
- {
+ Arr_not_all_sides_oblivious_tag) const {
const Subcurve_traits_2* geom_traits = subcurve_traits_2();
if (geom_traits->is_vertical_2_object()(xcv[0])) {
- // Verify that q has the same x-coord as xcv (which is vertical)
- Compare_x_2 compare_x = compare_x_2_object();
- Comparison_result res = compare_x(xcv[0], ARR_MIN_END, xs, ce);
- if (res != EQUAL) return INVALID_INDEX;
+ CGAL_precondition_code
+ (
+ // Verify that q has the same x-coord as xcv (which is vertical)
+ Compare_x_2 cmp_x = compare_x_2_object();
+ Comparison_result res = cmp_x(xcv[0], ARR_MIN_END, xs, ce);
+ if (res != EQUAL) return INVALID_INDEX;
+ );
Compare_curve_ends compare(compare_xy_2_object(), xs, ce);
return locate_gen(xcv, compare);
@@ -2571,39 +2525,39 @@ protected:
* of a curve.
* This implementation is used in the case where all sides of the parameter
* space is oblivious.
- * \param xcv (in) the given polycurve.
- * \param xs (in) the given curve.
- * \param cd (in) the curve-end indicator.
+ * \param(in) xcv the given polycurve.
+ * \param(in) xs the given curve.
+ * \param(in) cd the curve-end indicator.
*/
std::size_t locate_impl(const X_monotone_curve_2& xcv,
const X_monotone_subcurve_2& xs,
Arr_curve_end ce,
- Arr_all_sides_oblivious_tag) const
- {
+ Arr_all_sides_oblivious_tag) const {
const Subcurve_traits_2* geom_traits = subcurve_traits_2();
- const Point_2& p = (ce == ARR_MAX_END) ?
+ auto p = (ce == ARR_MAX_END) ?
geom_traits->construct_max_vertex_2_object()(xs) :
geom_traits->construct_min_vertex_2_object()(xs);
return locate(xcv, p);
}
- /*! Locate the index of a curve in a polycurve that contains an endpoint
- * of a curve.
+ /*! Locate the index of a curve in a polycurve that contains a point.
* This implementation is used in the case where at least one side of the
* parameter space is not oblivious.
- * \param xcv (in) the given polycurve.
- * \param p (in) the endpoint of a curve.
+ * \param(in) xcv the given polycurve.
+ * \param(in) p the query point.
*/
std::size_t locate_impl(const X_monotone_curve_2& xcv,
const Point_2& p,
- Arr_not_all_sides_oblivious_tag) const
- {
+ Arr_not_all_sides_oblivious_tag) const {
const Subcurve_traits_2* geom_traits = subcurve_traits_2();
if (geom_traits->is_vertical_2_object()(xcv[0])) {
- // Verify that q has the same x-coord as xcv (which is vertical)
- Compare_x_2 compare_x = compare_x_2_object();
- Comparison_result res = compare_x(xcv[0], ARR_MIN_END, p);
- if (res != EQUAL) return INVALID_INDEX;
+ CGAL_precondition_code
+ (
+ // Verify that q has the same x-coord as xcv (which is vertical)
+ auto cmp_x = compare_x_2_object();
+ Comparison_result res = cmp_x(xcv[0], ARR_MIN_END, p);
+ if (res != EQUAL) return INVALID_INDEX;
+ );
Compare_point_curve_end compare(compare_xy_2_object(), p);
return locate_gen(xcv, compare);
@@ -2613,29 +2567,28 @@ protected:
return locate_gen(xcv, compare);
}
- /*! Locate the index of a curve in a polycurve that contains an endpoint
- * of a curve.
+ /*! Locate the index of a curve in a polycurve that contains a point.
* This implementation is used in the case where all sides of the parameter
- * space is oblivious.
- * \param xcv (in) the given polycurve.
- * \param p (in) the endpoint of a curve.
+ * space are oblivious.
+ * \param(in) xcv the given polycurve.
+ * \param(in) p the query point.
*/
std::size_t locate_impl(const X_monotone_curve_2& xcv, const Point_2& p,
Arr_all_sides_oblivious_tag) const
{ return locate(xcv, p); }
//
- std::size_t locate(const X_monotone_curve_2& xcv, const Point_2& q) const
- {
+ std::size_t locate(const X_monotone_curve_2& xcv, const Point_2& q) const {
const Subcurve_traits_2* geom_traits = subcurve_traits_2();
if (geom_traits->is_vertical_2_object()(xcv[0])) {
- // Verify that q has the same x-coord as cv (which is vertical)
- typename Subcurve_traits_2::Construct_min_vertex_2 min_vertex =
- geom_traits->construct_min_vertex_2_object();
- typename Subcurve_traits_2::Compare_x_2 compare_x =
- geom_traits->compare_x_2_object();
- Comparison_result res = compare_x(min_vertex(xcv[0]), q);
- if (res != EQUAL) return INVALID_INDEX;
+ CGAL_precondition_code
+ (
+ // Verify that q has the same x-coord as cv (which is vertical)
+ auto min_vertex = geom_traits->construct_min_vertex_2_object();
+ auto cmp_x = geom_traits->compare_x_2_object();
+ Comparison_result res = cmp_x(min_vertex(xcv[0]), q);
+ if (res != EQUAL) return INVALID_INDEX;
+ );
Compare_points compare(*geom_traits,
compare_xy_2_object(), q);
@@ -2647,38 +2600,31 @@ protected:
}
/*! Find the index of the subcurve in the polycurve that is defined to the
- * left(or to the right) of the point q.
- * \param cv The polycurve curve.
- * \param q The point.
- * \param to_right(true) if we wish to locate a subcurve to the right of q,
- * (false) if we wish to locate a subcurve to its right.
- * \return An index i such that subcurves[i] is defined to the left(or to the
- * right) of q, or INVALID_INDEX if no such subcurve exists.
+ * left (or to the right) of the point `q`.
+ * \param cv the polycurve curve.
+ * \param q the point.
+ * \param to_right `true` if we wish to locate a subcurve to the right of q,
+ * `false` if we wish to locate a subcurve to its right.
+ * \return an index \f$i\f$ such that subcurves[i] is defined to the left (or
+ * to the right) of `q`, or `INVALID_INDEX` if no such subcurve exists.
*/
std::size_t locate_side(const X_monotone_curve_2& cv,
- const Point_2& q, const bool& to_right) const
- {
+ const Point_2& q, const bool& to_right) const {
// First locate a subcurve subcurves[i] that contains q in its x-range.
std::size_t i = locate(cv, q);
if (i == INVALID_INDEX) return INVALID_INDEX;
- typename Subcurve_traits_2::Equal_2 equal =
- subcurve_traits_2()->equal_2_object();
- typename Subcurve_traits_2::Compare_endpoints_xy_2 cmp_seg_endpts =
- subcurve_traits_2()->compare_endpoints_xy_2_object();
- typename Subcurve_traits_2::Compare_x_2 comp_x =
- subcurve_traits_2()->compare_x_2_object();
- typename Subcurve_traits_2::Is_vertical_2 is_vert =
- subcurve_traits_2()->is_vertical_2_object();
- typename Subcurve_traits_2::Construct_max_vertex_2 get_max_v =
- subcurve_traits_2()->construct_max_vertex_2_object();
- typename Subcurve_traits_2::Construct_min_vertex_2 get_min_v =
- subcurve_traits_2()->construct_min_vertex_2_object();
+ auto equal = subcurve_traits_2()->equal_2_object();
+ auto cmp_endpts = subcurve_traits_2()->compare_endpoints_xy_2_object();
+ auto cmp_x = subcurve_traits_2()->compare_x_2_object();
+ auto is_vert = subcurve_traits_2()->is_vertical_2_object();
+ auto get_max_v = subcurve_traits_2()->construct_max_vertex_2_object();
+ auto get_min_v = subcurve_traits_2()->construct_min_vertex_2_object();
- Comparison_result direction = cmp_seg_endpts(cv[i]);
+ Comparison_result direction = cmp_endpts(cv[i]);
- if ((!is_vert(cv[0]) && (comp_x(get_min_v(cv[i]), q) == EQUAL)) ||
- (is_vert(cv[0]) && equal(get_min_v(cv[i]), q))){
+ if ((! is_vert(cv[0]) && (cmp_x(get_min_v(cv[i]), q) == EQUAL)) ||
+ (is_vert(cv[0]) && equal(get_min_v(cv[i]), q))) {
// q is the left endpoint of the i'th subcurve:
if (to_right) return i;
else {
@@ -2694,11 +2640,10 @@ protected:
}
}
- if ((!is_vert(cv[0]) && (comp_x(get_max_v(cv[i]), q) == EQUAL)) ||
- (is_vert(cv[0]) && equal(get_max_v(cv[i]), q)))
- {
+ if ((! is_vert(cv[0]) && (cmp_x(get_max_v(cv[i]), q) == EQUAL)) ||
+ (is_vert(cv[0]) && equal(get_max_v(cv[i]), q))) {
// q is the right endpoint of the i'th subcurve:
- if (!to_right) return i;
+ if (! to_right) return i;
else {
if (direction == SMALLER) {
if (i == (cv.number_of_subcurves() - 1)) return INVALID_INDEX;
diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_polycurve_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_polycurve_traits_2.h
index 488ed21dea7..bab73408a4f 100644
--- a/Arrangement_on_surface_2/include/CGAL/Arr_polycurve_traits_2.h
+++ b/Arrangement_on_surface_2/include/CGAL/Arr_polycurve_traits_2.h
@@ -591,8 +591,7 @@ public:
Comparison_result dir = cmp_seg_endpts(xcv[0]);
// Locate the subcurve on the polycurve xcv that contains p.
- std::size_t i = m_poly_traits.locate(xcv, p);
-
+ auto i = m_poly_traits.locate_impl(xcv, p, All_sides_oblivious_category());
CGAL_precondition(i != Polycurve_traits_2::INVALID_INDEX);
// Clear the output curves.
diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_arc_d_1.h b/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_arc_d_1.h
index f3921b44149..71af407c54e 100644
--- a/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_arc_d_1.h
+++ b/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_arc_d_1.h
@@ -450,7 +450,7 @@ public:
_info = (_info | IS_DIRECTED_RIGHT);
- // Analyze the behaviour of the rational function at x = -oo (the source).
+ // Analyze the behavior of the rational function at x = -oo (the source).
Algebraic_real_1 y0;
const Arr_parameter_space inf_s = _analyze_at_minus_infinity(P, Q, y0);
@@ -460,7 +460,7 @@ public:
_info = (_info | SRC_AT_Y_PLUS_INFTY);
else // if (inf_s == ARR_INTERIOR)
_ps = Algebraic_point_2(); //the point is a dummy
- //Analyze the behaviour of the rational function at x = +oo (the target).
+ //Analyze the behavior of the rational function at x = +oo (the target).
const Arr_parameter_space inf_t = _analyze_at_plus_infinity(P, Q, y0);
if (inf_t == ARR_BOTTOM_BOUNDARY)
@@ -949,7 +949,7 @@ public:
Self split_at_pole(const Algebraic_real_1& x0)
{
- // Analyze the behaviour of the function near the given pole.
+ // Analyze the behavior of the function near the given pole.
const std::pair signs = _analyze_near_pole(x0);
const CGAL::Sign sign_left = signs.first;
const CGAL::Sign sign_right = signs.second;
diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_traits_adaptor_2.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_traits_adaptor_2.h
index 97c9b5b0f5b..d044c21edf0 100644
--- a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_traits_adaptor_2.h
+++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arr_traits_adaptor_2.h
@@ -1578,7 +1578,7 @@ public:
return res;
}
- // otherwise: both ends have asymptotic behaviour
+ // otherwise: both ends have asymptotic behavior
if (ps_y1 == ps_y2) { // need special y-comparison
if (ce1 == ce2) { // both ends approach asymptote from one side
Comparison_result res = m_self->compare_x_near_boundary_2_object()(xcv1, xcv2, ce2);
diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_traits.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_traits.h
index f2e6ecfc314..4c8c1a382bb 100644
--- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_traits.h
+++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_traits.h
@@ -24,7 +24,7 @@
* \brief
* defines class Curve_renderer_traits.
*
- * provides specialisations of Curve_renderer_traits for different number
+ * provides specializations of Curve_renderer_traits for different number
* types compatible with the curve renderer
*/
diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circle_segments/intersect b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circle_segments/intersect
index b0e0bbe6a46..6a3783c9cfc 100644
--- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circle_segments/intersect
+++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/data/circle_segments/intersect
@@ -1,6 +1,6 @@
# Input is based on the curves and points indexes from intersect.pt
# intersect.xcv. The first two numbers are the numbers of the input curves
-# to be intersected. After that there is the number of intesections and
+# to be intersected. After that there is the number of intersections and
# 2-3 numbers representing each intersection. Meaning, the input is of the form:
# intersect \
# [ \
diff --git a/BGL/examples/BGL_OpenMesh/CMakeLists.txt b/BGL/examples/BGL_OpenMesh/CMakeLists.txt
index d11ac1444c9..f461d55efb1 100644
--- a/BGL/examples/BGL_OpenMesh/CMakeLists.txt
+++ b/BGL/examples/BGL_OpenMesh/CMakeLists.txt
@@ -9,9 +9,9 @@ find_package(CGAL REQUIRED)
find_package(OpenMesh)
if(OpenMesh_FOUND)
- include(UseOpenMesh)
+ include(CGAL_OpenMesh_support)
create_single_source_cgal_program("TriMesh.cpp")
- target_link_libraries(TriMesh PRIVATE ${OPENMESH_LIBRARIES})
+ target_link_libraries(TriMesh PRIVATE CGAL::OpenMesh_support)
else()
message("NOTICE: This project requires OpenMesh and will not be compiled.")
endif()
diff --git a/BGL/examples/BGL_polyhedron_3/CMakeLists.txt b/BGL/examples/BGL_polyhedron_3/CMakeLists.txt
index 7c901c71d8e..eabe0b1bd40 100644
--- a/BGL/examples/BGL_polyhedron_3/CMakeLists.txt
+++ b/BGL/examples/BGL_polyhedron_3/CMakeLists.txt
@@ -18,8 +18,8 @@ create_single_source_cgal_program("copy_polyhedron.cpp")
find_package(OpenMesh QUIET)
if(OpenMesh_FOUND)
- target_link_libraries(copy_polyhedron PRIVATE ${OPENMESH_LIBRARIES})
- target_compile_definitions(copy_polyhedron PRIVATE -DCGAL_USE_OPENMESH)
+ include(CGAL_OpenMesh_support)
+ target_link_libraries(copy_polyhedron PRIVATE CGAL::OpenMesh_support)
else()
message(STATUS "NOTICE: The example 'copy_polyhedron' will not use OpenMesh.")
endif()
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 b5d16f74d3b..368c5fca524 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
@@ -733,7 +733,7 @@ struct Graph_with_descriptor_with_graph_property_map {
}
}; // class Graph_with_descriptor_with_graph_property_map
-//specialisation for lvaluepropertymaps
+//specialization for lvaluepropertymaps
template
struct Graph_with_descriptor_with_graph_property_map {
diff --git a/BGL/include/CGAL/boost/graph/METIS/partition_dual_graph.h b/BGL/include/CGAL/boost/graph/METIS/partition_dual_graph.h
index 53f8968f86f..9a217389d82 100644
--- a/BGL/include/CGAL/boost/graph/METIS/partition_dual_graph.h
+++ b/BGL/include/CGAL/boost/graph/METIS/partition_dual_graph.h
@@ -116,8 +116,8 @@ void partition_dual_graph(const TriangleMesh& tm,
delete[] eptr;
delete[] eind;
- std::free(npart);
- std::free(epart);
+ (std::free)(npart);
+ (std::free)(epart);
}
template
diff --git a/BGL/include/CGAL/boost/graph/METIS/partition_graph.h b/BGL/include/CGAL/boost/graph/METIS/partition_graph.h
index 08926a64116..42f8c240f01 100644
--- a/BGL/include/CGAL/boost/graph/METIS/partition_graph.h
+++ b/BGL/include/CGAL/boost/graph/METIS/partition_graph.h
@@ -151,8 +151,8 @@ void partition_graph(const TriangleMesh& tm,
delete[] eptr;
delete[] eind;
- std::free(npart);
- std::free(epart);
+ (std::free)(npart);
+ (std::free)(epart);
}
template
diff --git a/BGL/include/CGAL/boost/graph/copy_face_graph.h b/BGL/include/CGAL/boost/graph/copy_face_graph.h
index 956b640f879..e0d4cbd5b95 100644
--- a/BGL/include/CGAL/boost/graph/copy_face_graph.h
+++ b/BGL/include/CGAL/boost/graph/copy_face_graph.h
@@ -62,13 +62,15 @@ void copy_face_graph_impl(const SourceMesh& sm, TargetMesh& tm,
const tm_face_descriptor tm_null_face = boost::graph_traits::null_face();
const tm_vertex_descriptor tm_null_vertex = boost::graph_traits::null_vertex();
- reserve(tm, static_cast::vertices_size_type>(vertices(tm).size()+vertices(sm).size()),
- static_cast::edges_size_type>(edges(tm).size()+edges(sm).size()),
- static_cast::faces_size_type>(faces(tm).size()+faces(sm).size()) );
+ reserve(tm, static_cast::vertices_size_type>(internal::exact_num_vertices(tm)+internal::exact_num_vertices(sm)),
+ static_cast::edges_size_type>(internal::exact_num_edges(tm)+internal::exact_num_edges(sm)),
+ static_cast::faces_size_type>(internal::exact_num_faces(tm)+internal::exact_num_faces(sm)) );
//insert halfedges and create each vertex when encountering its halfedge
std::vector new_edges;
- new_edges.reserve(edges(sm).size());
+ std::vector new_vertices;
+ new_edges.reserve(internal::exact_num_edges(sm));
+ new_vertices.reserve(internal::exact_num_vertices(sm));
for(sm_edge_descriptor sm_e : edges(sm))
{
tm_edge_descriptor tm_e = add_edge(tm);
@@ -106,6 +108,7 @@ void copy_face_graph_impl(const SourceMesh& sm, TargetMesh& tm,
tm_vertex_descriptor tm_h_tgt = add_vertex(tm);
*v2v++=std::make_pair(sm_h_tgt, tm_h_tgt);
set_halfedge(tm_h_tgt, tm_h, tm);
+ new_vertices.push_back(tm_h);
set_target(tm_h, tm_h_tgt, tm);
put(tm_vpm, tm_h_tgt, conv(get(sm_vpm, sm_h_tgt)));
}
@@ -116,6 +119,7 @@ void copy_face_graph_impl(const SourceMesh& sm, TargetMesh& tm,
tm_vertex_descriptor tm_h_src = add_vertex(tm);
*v2v++=std::make_pair(sm_h_src, tm_h_src);
set_halfedge(tm_h_src, tm_h_opp, tm);
+ new_vertices.push_back(tm_h_opp);
set_target(tm_h_opp, tm_h_src, tm);
put(tm_vpm, tm_h_src, conv(get(sm_vpm, sm_h_src)));
}
@@ -163,11 +167,9 @@ void copy_face_graph_impl(const SourceMesh& sm, TargetMesh& tm,
}
}
// update halfedge vertex of all but the vertex halfedge
- for(tm_vertex_descriptor v : vertices(tm))
+ for(tm_halfedge_descriptor h : new_vertices)
{
- tm_halfedge_descriptor h = halfedge(v, tm);
- if (h==boost::graph_traits::null_halfedge())
- continue;
+ tm_vertex_descriptor v = target(h, tm);
tm_halfedge_descriptor next_around_vertex=h;
do{
next_around_vertex=opposite(next(next_around_vertex, tm), tm);
diff --git a/BGL/test/BGL/CMakeLists.txt b/BGL/test/BGL/CMakeLists.txt
index fd43a685fe5..2cf88ff3cbf 100644
--- a/BGL/test/BGL/CMakeLists.txt
+++ b/BGL/test/BGL/CMakeLists.txt
@@ -42,50 +42,31 @@ create_single_source_cgal_program("test_deprecated_io.cpp")
find_package(OpenMesh QUIET)
if(OpenMesh_FOUND)
- include(UseOpenMesh)
- add_definitions(-DCGAL_USE_OPENMESH)
+ include(CGAL_OpenMesh_support)
- target_link_libraries(test_clear PRIVATE ${OPENMESH_LIBRARIES})
- target_compile_definitions(test_clear PRIVATE -DCGAL_USE_OPENMESH)
- target_link_libraries(test_Euler_operations PRIVATE ${OPENMESH_LIBRARIES})
- target_compile_definitions(test_Euler_operations PRIVATE -DCGAL_USE_OPENMESH)
- target_link_libraries(test_Collapse_edge PRIVATE ${OPENMESH_LIBRARIES})
- target_compile_definitions(test_Collapse_edge PRIVATE -DCGAL_USE_OPENMESH)
- target_link_libraries(test_Face_filtered_graph PRIVATE ${OPENMESH_LIBRARIES})
- target_compile_definitions(test_Face_filtered_graph PRIVATE -DCGAL_USE_OPENMESH)
- target_link_libraries(test_graph_traits PRIVATE ${OPENMESH_LIBRARIES} )
- target_compile_definitions(test_graph_traits PRIVATE -DCGAL_USE_OPENMESH)
- target_link_libraries(test_Properties PRIVATE ${OPENMESH_LIBRARIES})
- target_compile_definitions(test_Properties PRIVATE -DCGAL_USE_OPENMESH)
- target_link_libraries(test_bgl_read_write PRIVATE ${OPENMESH_LIBRARIES})
- target_compile_definitions(test_bgl_read_write PRIVATE -DCGAL_USE_OPENMESH)
+ target_link_libraries(test_clear PRIVATE CGAL::OpenMesh_support)
+ target_link_libraries(test_Euler_operations PRIVATE CGAL::OpenMesh_support)
+ target_link_libraries(test_Collapse_edge PRIVATE CGAL::OpenMesh_support)
+ target_link_libraries(test_Face_filtered_graph PRIVATE CGAL::OpenMesh_support)
+ target_link_libraries(test_graph_traits PRIVATE CGAL::OpenMesh_support )
+ target_link_libraries(test_Properties PRIVATE CGAL::OpenMesh_support)
+ target_link_libraries(test_bgl_read_write PRIVATE CGAL::OpenMesh_support)
create_single_source_cgal_program("graph_concept_OpenMesh.cpp")
- target_link_libraries(graph_concept_OpenMesh PRIVATE ${OPENMESH_LIBRARIES})
+ target_link_libraries(graph_concept_OpenMesh PRIVATE CGAL::OpenMesh_support)
else()
message(STATUS "NOTICE: Tests that use OpenMesh will not be compiled.")
endif()
-find_package(VTK QUIET COMPONENTS vtkCommonCore vtkIOCore vtkIOLegacy vtkIOXML vtkFiltersCore vtkFiltersSources)
-if (VTK_FOUND)
- if(VTK_USE_FILE)
- include(${VTK_USE_FILE})
- endif()
-
- if ("${VTK_VERSION_MAJOR}" GREATER "5" OR VTK_VERSION VERSION_GREATER 5)
- if(TARGET VTK::CommonCore)
- set(VTK_LIBRARIES VTK::CommonCore VTK::IOCore VTK::IOLegacy VTK::IOXML VTK::FiltersCore VTK::FiltersSources)
- endif()
-
- if(VTK_LIBRARIES)
- target_link_libraries(test_bgl_read_write PRIVATE ${VTK_LIBRARIES})
- target_compile_definitions(test_bgl_read_write PRIVATE -DCGAL_USE_VTK -DNOMINMAX)
- target_link_libraries(test_deprecated_io PRIVATE ${VTK_LIBRARIES})
- target_compile_definitions(test_deprecated_io PRIVATE -DCGAL_USE_VTK -DNOMINMAX)
- else()
- message(STATUS "Tests that use VTK will not be compiled.")
- endif()
- endif()
+find_package(VTK 9.0 QUIET COMPONENTS CommonCore IOCore IOLegacy IOXML FiltersCore FiltersSources)
+if (VTK_FOUND AND VTK_LIBRARIES)
+ message(STATUS "VTK ${VTK_VERSION} found ${VTK_LIBRARIES}")
+ target_link_libraries(test_bgl_read_write PRIVATE ${VTK_LIBRARIES})
+ target_compile_definitions(test_bgl_read_write PRIVATE -DCGAL_USE_VTK -DNOMINMAX)
+ target_link_libraries(test_deprecated_io PRIVATE ${VTK_LIBRARIES})
+ target_compile_definitions(test_deprecated_io PRIVATE -DCGAL_USE_VTK -DNOMINMAX)
+else()
+ message(STATUS "Tests that use VTK will not be compiled.")
endif() #VTK_FOUND
find_path(3MF_INCLUDE_DIR
diff --git a/BGL/test/BGL/test_Euler_operations.cpp b/BGL/test/BGL/test_Euler_operations.cpp
index 941758cb1c3..615a4fd756d 100644
--- a/BGL/test/BGL/test_Euler_operations.cpp
+++ b/BGL/test/BGL/test_Euler_operations.cpp
@@ -17,6 +17,7 @@ test_copy_face_graph_nm_umbrella()
T g;
Kernel::Point_3 p(0,0,0);
+ // make two connected components
CGAL::make_tetrahedron(p, p, p, p, g);
CGAL::make_tetrahedron(p, p, p, p, g);
diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Boolean_set_operations_2.txt b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Boolean_set_operations_2.txt
index d03add5708a..661e4d89ae5 100644
--- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/Boolean_set_operations_2.txt
+++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/Boolean_set_operations_2.txt
@@ -542,13 +542,13 @@ boundary of each input (linear) polygon as a cyclic sequence of single
(\f$x\f$-monotone) polylines. By default, `UsePolylines` is set to
`CGAL::Tag_true`, which implies that the boundary of the each input
(linear) polygon is treated as a cyclic sequence of (\f$x\f$-monotone)
-polylines. In most cases this behaviour is superior (that is, less
+polylines. In most cases this behavior is superior (that is, less
time-consuming) because the number of events handled as part of the
execution of the plane-sweep algorithm is reduced. In cases where the
boundaries of the input polygons frequently intersect, treating them
as polylines may become less efficient. In these cases substitute the
`UsePolylines` template parameter with `CGAL::Tag_false` to restore
-the original behaviour (where the boundary of each input linear
+the original behavior (where the boundary of each input linear
polygon is treated as a cyclic sequence of single \f$x\f$-monotone
segments).
diff --git a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2.h b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2.h
index 32fbfe7a129..39faf23e21a 100644
--- a/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2.h
+++ b/Boolean_set_operations_2/doc/Boolean_set_operations_2/CGAL/Boolean_set_operations_2.h
@@ -1104,7 +1104,7 @@ do_intersect(const General_polygon_with_holes_2>& p
* \param traits a traits object.
* \return `true` if `pgn1` and `pgn2` intersect in their interior and `false`
* otherwise.
- * \pre `GpsTraits` must be a model of the concept `GeneralPolygonSetTraits_2`.
+ *
* \pre `GpsTraits` must be a model of the concept `GeneralPolygonSetTraits_2`.
*/
template
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 23af4802c19..8a6e443cd33 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
@@ -642,6 +642,7 @@ public:
unsigned int i = 1;
for (InputIterator itr = begin; itr != end; ++itr, ++i)
{
+ ValidationPolicy::is_valid((*itr), *m_traits);
arr_vec[i].first = new Aos_2(m_traits);
_insert(*itr, *(arr_vec[i].first));
}
@@ -666,6 +667,7 @@ public:
unsigned int i = 1;
for (InputIterator itr = begin; itr!=end; ++itr, ++i)
{
+ ValidationPolicy::is_valid((*itr), *m_traits);
arr_vec[i].first = new Aos_2(m_traits);
_insert(*itr, *(arr_vec[i].first));
}
diff --git a/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_annulus_d_traits_2.h b/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_annulus_d_traits_2.h
index d3c56d3b095..b2826180704 100644
--- a/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_annulus_d_traits_2.h
+++ b/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_annulus_d_traits_2.h
@@ -5,7 +5,7 @@ namespace CGAL {
\ingroup PkgBoundingVolumesRef
The class `Min_sphere_annulus_d_traits_2` is a traits class for the \f$ d\f$-dimensional
-optimisation algorithms using the two-dimensional \cgal kernel.
+optimization algorithms using the two-dimensional \cgal kernel.
\tparam K must bea model for `Kernel`.
\tparam ET NT are models for `RingNumberType`. Their default type is `K::RT`.
diff --git a/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_annulus_d_traits_3.h b/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_annulus_d_traits_3.h
index 84284beefc5..5d57a716ada 100644
--- a/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_annulus_d_traits_3.h
+++ b/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_annulus_d_traits_3.h
@@ -5,7 +5,7 @@ namespace CGAL {
\ingroup PkgBoundingVolumesRef
The class `Min_sphere_annulus_d_traits_3` is a traits class for the \f$ d\f$-dimensional
-optimisation algorithms using the three-dimensional \cgal kernel.
+optimization algorithms using the three-dimensional \cgal kernel.
\tparam K must be a model for `Kernel`.
\tparam ET NT are models for `RingNumberType`. Their default type is `K::RT`.
diff --git a/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_annulus_d_traits_d.h b/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_annulus_d_traits_d.h
index f2bc035794b..046cced2d58 100644
--- a/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_annulus_d_traits_d.h
+++ b/Bounding_volumes/doc/Bounding_volumes/CGAL/Min_sphere_annulus_d_traits_d.h
@@ -5,7 +5,7 @@ namespace CGAL {
\ingroup PkgBoundingVolumesRef
The class `Min_sphere_annulus_d_traits_d` is a traits class for the \f$ d\f$-dimensional
-optimisation algorithms using the \f$ d\f$-dimensional \cgal kernel.
+optimization algorithms using the \f$ d\f$-dimensional \cgal kernel.
\tparam K must be a model for `Kernel`.
\tparam ET NT are models for `RingNumberType`. Their default type is `K::RT`.
diff --git a/Bounding_volumes/include/CGAL/Approximate_min_ellipsoid_d/Khachiyan_approximation.h b/Bounding_volumes/include/CGAL/Approximate_min_ellipsoid_d/Khachiyan_approximation.h
index 0fc9ef14af1..e200621f7ea 100644
--- a/Bounding_volumes/include/CGAL/Approximate_min_ellipsoid_d/Khachiyan_approximation.h
+++ b/Bounding_volumes/include/CGAL/Approximate_min_ellipsoid_d/Khachiyan_approximation.h
@@ -71,7 +71,7 @@ namespace CGAL {
std::vector P; // input points
int n; // number of input points, i.e., P.size()
- // This class comes in two flavours:
+ // This class comes in two flavors:
//
// (i) When Embed is false, the input points are taken to be
// ordinary points in R^{d_P}, where d_P is the dimension of the
diff --git a/Bounding_volumes/include/CGAL/Min_sphere_of_spheres_d/Min_sphere_of_spheres_d_pair.h b/Bounding_volumes/include/CGAL/Min_sphere_of_spheres_d/Min_sphere_of_spheres_d_pair.h
index b51de487eb3..be95cea772c 100644
--- a/Bounding_volumes/include/CGAL/Min_sphere_of_spheres_d/Min_sphere_of_spheres_d_pair.h
+++ b/Bounding_volumes/include/CGAL/Min_sphere_of_spheres_d/Min_sphere_of_spheres_d_pair.h
@@ -33,7 +33,7 @@ namespace CGAL_MINIBALL_NAMESPACE {
// they are convertible to double.
// This is indeed the least invasive fix dropint the function that were
// defined here and cause linkage bug.
- // You can still have a behaviour of instantiating only if a type
+ // You can still have a behavior of instantiating only if a type
// is convertibale to double (by using type_traits together with _if)
// but until "the whole design should be overhauled at some point"
// this is fine.
diff --git a/Bounding_volumes/include/CGAL/min_quadrilateral_2.h b/Bounding_volumes/include/CGAL/min_quadrilateral_2.h
index 081520c0846..8e78c9f42a3 100644
--- a/Bounding_volumes/include/CGAL/min_quadrilateral_2.h
+++ b/Bounding_volumes/include/CGAL/min_quadrilateral_2.h
@@ -376,7 +376,7 @@ min_rectangle_2(
// quadruple of points defining the current rectangle
ForwardIterator curr[4];
- // initialised to the points defining the bounding box
+ // initialized to the points defining the bounding box
convex_bounding_box_2(f, l, curr, t);
// curr[i] can be advanced (cyclically) until it reaches limit[i]
@@ -482,7 +482,7 @@ min_parallelogram_2(ForwardIterator f,
// quadruple of points defining the bounding box
ForwardIterator curr[4];
- // initialised to the points defining the bounding box
+ // initialized to the points defining the bounding box
convex_bounding_box_2(first, l, curr, t);
@@ -659,7 +659,7 @@ min_strip_2(ForwardIterator f,
// quadruple of points defining the bounding box
ForwardIterator curr[4];
- // initialised to the points defining the bounding box
+ // initialized to the points defining the bounding box
convex_bounding_box_2(first, l, curr, t);
ForwardIterator low = curr[0];
diff --git a/Bounding_volumes/include/CGAL/rectangular_3_center_2.h b/Bounding_volumes/include/CGAL/rectangular_3_center_2.h
index 276f286fcbf..9d280f2eaf0 100644
--- a/Bounding_volumes/include/CGAL/rectangular_3_center_2.h
+++ b/Bounding_volumes/include/CGAL/rectangular_3_center_2.h
@@ -135,7 +135,7 @@ rectangular_3_center_2_type1(
rad = sdist(v(r, 2), v(r, 0));
// init to prevent default constructor requirement
Point bestpoint = *f;
- // (initialisation avoids warning)
+ // (initialization avoids warning)
unsigned int bestrun = 0;
// two cases: top-left & bottom-right or top-right & bottom-left
diff --git a/Bounding_volumes/test/Bounding_volumes/min_sphere_test.cpp b/Bounding_volumes/test/Bounding_volumes/min_sphere_test.cpp
index ff82ea1bdb0..816cb353d44 100644
--- a/Bounding_volumes/test/Bounding_volumes/min_sphere_test.cpp
+++ b/Bounding_volumes/test/Bounding_volumes/min_sphere_test.cpp
@@ -11,7 +11,7 @@
// release : $CGAL_Revision: CGAL-wip $
// release_date : $CGAL_Date$
//
-// chapter : $CGAL_Chapter: Optimisation $
+// chapter : $CGAL_Chapter: Geometric Optimization $
// package : $CGAL_Package: MinSphere $
// file : min_sphere_test.C
// source : web/Optimisation/Min_sphere_d.aw
diff --git a/Bounding_volumes/test/Bounding_volumes/min_sphere_traits_2_test.cpp b/Bounding_volumes/test/Bounding_volumes/min_sphere_traits_2_test.cpp
index 0f137fd20ff..cd79be09588 100644
--- a/Bounding_volumes/test/Bounding_volumes/min_sphere_traits_2_test.cpp
+++ b/Bounding_volumes/test/Bounding_volumes/min_sphere_traits_2_test.cpp
@@ -12,7 +12,7 @@
// release : $CGAL_Revision: CGAL-wip $
// release_date : $CGAL_Date$
//
-// chapter : $CGAL_Chapter: Optimisation $
+// chapter : $CGAL_Chapter: Geometric Optimization $
// package : $CGAL_Package: MinSphere $
// file : min_sphere_traits_2_test.C
// source : web/Optimisation/Min_sphere_d.aw
diff --git a/Bounding_volumes/test/Bounding_volumes/min_sphere_traits_3_test.cpp b/Bounding_volumes/test/Bounding_volumes/min_sphere_traits_3_test.cpp
index efb0bed98c8..01fb795f264 100644
--- a/Bounding_volumes/test/Bounding_volumes/min_sphere_traits_3_test.cpp
+++ b/Bounding_volumes/test/Bounding_volumes/min_sphere_traits_3_test.cpp
@@ -11,7 +11,7 @@
// release : $CGAL_Revision: CGAL-wip $
// release_date : $CGAL_Date$
//
-// chapter : $CGAL_Chapter: Optimisation $
+// chapter : $CGAL_Chapter: Geometric Optimization $
// package : $CGAL_Package: MinSphere $
// file : min_sphere_traits_3_test.C
// source : web/Optimisation/Min_sphere_d.aw
diff --git a/Bounding_volumes/test/Bounding_volumes/test_Min_annulus_d.h b/Bounding_volumes/test/Bounding_volumes/test_Min_annulus_d.h
index a1b3c9e88e0..f393618663f 100644
--- a/Bounding_volumes/test/Bounding_volumes/test_Min_annulus_d.h
+++ b/Bounding_volumes/test/Bounding_volumes/test_Min_annulus_d.h
@@ -13,7 +13,7 @@
//
// file : test/Min_annulus_d/test_Min_annulus_d.h
// package : $CGAL_Package: Min_annulus_d $
-// chapter : Geometric Optimisation
+// chapter : Geometric Optimization
//
// source : web/Min_annulus_d.aw
// revision : $Id$
diff --git a/Bounding_volumes/test/Bounding_volumes/test_Min_annulus_d_2.cpp b/Bounding_volumes/test/Bounding_volumes/test_Min_annulus_d_2.cpp
index 8592a9fe977..b13bb42c0e4 100644
--- a/Bounding_volumes/test/Bounding_volumes/test_Min_annulus_d_2.cpp
+++ b/Bounding_volumes/test/Bounding_volumes/test_Min_annulus_d_2.cpp
@@ -13,7 +13,7 @@
//
// file : test/Min_annulus_d/test_Min_annulus_d_2.cpp
// package : $CGAL_Package: Min_annulus_d $
-// chapter : Geometric Optimisation
+// chapter : Geometric Optimization
//
// revision : $Id$
// revision_date : $Date$
diff --git a/Bounding_volumes/test/Bounding_volumes/test_Min_annulus_d_3.cpp b/Bounding_volumes/test/Bounding_volumes/test_Min_annulus_d_3.cpp
index 09dbce7b680..b003679c0f9 100644
--- a/Bounding_volumes/test/Bounding_volumes/test_Min_annulus_d_3.cpp
+++ b/Bounding_volumes/test/Bounding_volumes/test_Min_annulus_d_3.cpp
@@ -13,7 +13,7 @@
//
// file : test/Min_annulus_d/test_Min_annulus_d_3.cpp
// package : $CGAL_Package: Min_annulus_d $
-// chapter : Geometric Optimisation
+// chapter : Geometric Optimization
//
// revision : $Id$
// revision_date : $Date$
diff --git a/Bounding_volumes/test/Bounding_volumes/test_Min_annulus_d_d.cpp b/Bounding_volumes/test/Bounding_volumes/test_Min_annulus_d_d.cpp
index 3d667bead47..4594b2b430e 100644
--- a/Bounding_volumes/test/Bounding_volumes/test_Min_annulus_d_d.cpp
+++ b/Bounding_volumes/test/Bounding_volumes/test_Min_annulus_d_d.cpp
@@ -13,7 +13,7 @@
//
// file : test/Min_annulus_d/test_Min_annulus_d_d.cpp
// package : $CGAL_Package: Min_annulus_d $
-// chapter : Geometric Optimisation
+// chapter : Geometric Optimization
//
// revision : $Id$
// revision_date : $Date$
diff --git a/Bounding_volumes/test/Bounding_volumes/test_Min_circle.cpp b/Bounding_volumes/test/Bounding_volumes/test_Min_circle.cpp
index 01ce8cc429a..5d94946b23e 100644
--- a/Bounding_volumes/test/Bounding_volumes/test_Min_circle.cpp
+++ b/Bounding_volumes/test/Bounding_volumes/test_Min_circle.cpp
@@ -13,7 +13,7 @@
//
// file : test/Min_circle_2/test_Min_circle_2.C
// package : $CGAL_Package: Min_circle_2 $
-// chapter : Geometric Optimisation
+// chapter : Geometric Optimization
//
// source : web/Min_circle_2.aw
// revision : $Id$
diff --git a/Bounding_volumes/test/Bounding_volumes/test_Min_ellipse_2.cpp b/Bounding_volumes/test/Bounding_volumes/test_Min_ellipse_2.cpp
index 535aa4674b1..2410147ccb5 100644
--- a/Bounding_volumes/test/Bounding_volumes/test_Min_ellipse_2.cpp
+++ b/Bounding_volumes/test/Bounding_volumes/test_Min_ellipse_2.cpp
@@ -13,7 +13,7 @@
//
// file : test/Min_ellipse_2/test_Min_ellipse_2.C
// package : $CGAL_Package: Min_ellipse_2 $
-// chapter : Geometric Optimisation
+// chapter : Geometric Optimization
//
// source : web/Min_ellipse_2.aw
// revision : $Id$
diff --git a/CGAL_Core/include/CGAL/CORE/ExprRep.h b/CGAL_Core/include/CGAL/CORE/ExprRep.h
index 0e721dda16a..a325930a2ab 100644
--- a/CGAL_Core/include/CGAL/CORE/ExprRep.h
+++ b/CGAL_Core/include/CGAL/CORE/ExprRep.h
@@ -595,7 +595,7 @@ public:
}
void operator delete( void *p, size_t ){
- MemoryPool::global_allocator().free(p);
+ (MemoryPool::global_allocator().free)(p);
}
private:
@@ -1248,7 +1248,7 @@ void * AddSubRep::operator new( size_t size)
template
void AddSubRep::operator delete( void *p, size_t )
-{ MemoryPool >::global_allocator().free(p); }
+{ (MemoryPool >::global_allocator().free)(p); }
/// \typedef AddRep
diff --git a/CGAL_Core/include/CGAL/CORE/Impl.h b/CGAL_Core/include/CGAL/CORE/Impl.h
index 4ff8b4fa3d4..2e21aab5ac0 100644
--- a/CGAL_Core/include/CGAL/CORE/Impl.h
+++ b/CGAL_Core/include/CGAL/CORE/Impl.h
@@ -51,14 +51,14 @@
CGAL_INLINE_FUNCTION void *T::operator new( size_t size) \
{ return MemoryPool::global_allocator().allocate(size); } \
CGAL_INLINE_FUNCTION void T::operator delete( void *p, size_t ) \
- { MemoryPool::global_allocator().free(p); }
+ { (MemoryPool::global_allocator().free)(p); }
#define CORE_MEMORY_IMPL_TEMPLATE_WITH_ONE_ARG(C) \
template \
CGAL_INLINE_FUNCTION void *C::operator new( size_t size) \
{ return MemoryPool >::global_allocator().allocate(size); } \
template \
CGAL_INLINE_FUNCTION void C::operator delete( void *p, size_t ) \
- { MemoryPool >::global_allocator().free(p); }
+ { (MemoryPool >::global_allocator().free)(p); }
#endif
// include some common header files
diff --git a/CGAL_Core/include/CGAL/CORE/MemoryPool.h b/CGAL_Core/include/CGAL/CORE/MemoryPool.h
index 2db3de8736e..1cfa96fa93d 100644
--- a/CGAL_Core/include/CGAL/CORE/MemoryPool.h
+++ b/CGAL_Core/include/CGAL/CORE/MemoryPool.h
@@ -73,7 +73,7 @@ public:
void* allocate(std::size_t size);
- void free(void* p);
+ void free BOOST_PREVENT_MACRO_SUBSTITUTION (void* p);
// Access the corresponding static global allocator.
static MemoryPool& global_allocator() {
@@ -116,7 +116,7 @@ void* MemoryPool< T, nObjects >::allocate(std::size_t) {
}
template< class T, int nObjects >
-void MemoryPool< T, nObjects >::free(void* t) {
+void MemoryPool< T, nObjects >::free BOOST_PREVENT_MACRO_SUBSTITUTION (void* t) {
CGAL_assertion(t != 0);
if (t == 0) return; // for safety
if(blocks.empty()){
diff --git a/CGAL_Core/include/CGAL/CORE/RealRep.h b/CGAL_Core/include/CGAL/CORE/RealRep.h
index 1c5d0f13a40..f2ec1e90cb3 100644
--- a/CGAL_Core/include/CGAL/CORE/RealRep.h
+++ b/CGAL_Core/include/CGAL/CORE/RealRep.h
@@ -154,7 +154,7 @@ void * Realbase_for::operator new( size_t size)
template
void Realbase_for::operator delete( void *p, size_t )
-{ MemoryPool >::global_allocator().free(p); }
+{ (MemoryPool >::global_allocator().free)(p); }
typedef Realbase_for RealLong;
typedef Realbase_for RealDouble;
diff --git a/CGAL_ImageIO/include/CGAL/ImageIO/analyze.h b/CGAL_ImageIO/include/CGAL/ImageIO/analyze.h
index 98d27a0d994..cbc4eae9109 100644
--- a/CGAL_ImageIO/include/CGAL/ImageIO/analyze.h
+++ b/CGAL_ImageIO/include/CGAL/ImageIO/analyze.h
@@ -21,7 +21,7 @@
#include
-/* read analyse format header
+/* read analyze format header
return:
-1: error
diff --git a/CGAL_ImageIO/include/CGAL/ImageIO/bmptypes.h b/CGAL_ImageIO/include/CGAL/ImageIO/bmptypes.h
index 9c27b948b3d..b6eb465253f 100644
--- a/CGAL_ImageIO/include/CGAL/ImageIO/bmptypes.h
+++ b/CGAL_ImageIO/include/CGAL/ImageIO/bmptypes.h
@@ -108,8 +108,8 @@ typedef std::uint32_t CGAL_UINT32;
*/
/*
- * Bitmapfileheader defines a single bitmap image. Its analogue in the
- * Windows SDK is the Bitmapfileheader. Its analogues in the OS/2 Toolkit are
+ * Bitmapfileheader defines a single bitmap image. Its analog in the
+ * Windows SDK is the Bitmapfileheader. Its analogs in the OS/2 Toolkit are
* the Bitmapfileheader and Bitmapfileheader2 structures.
*
* A BITMAPHEADER structure is always concatenated to the end of a
@@ -128,7 +128,7 @@ typedef struct Bitmapfileheader
/*
* BITMAPARRAYHEADER is used to establish a linked list of Bitmapfileheader
* structures for a bitmap file with multiple images in it. There is no
- * equivalent structure in the Windows SDK. Its analogues in the OS/2 toolkit
+ * equivalent structure in the Windows SDK. Its analogs in the OS/2 toolkit
* are the BITMAPARRAYFILEHEADER and BITMAPARRAYFILEHEADER2 structures.
*
* A Bitmapfileheader structure is always concatenated to the end of a
@@ -145,9 +145,9 @@ typedef struct BITMAPARRAYHEADER
/*
- * BITMAPHEADER defines the properties of a bitmap. Its analogues in the
+ * BITMAPHEADER defines the properties of a bitmap. Its analogs in the
* Windows SDK are the BITMAPCOREINFOHEADER and BITMAPINFOHEADER structures.
- * Its analogues in the OS/2 Toolkit are the BITMAPINFOHEADER and
+ * Its analogs in the OS/2 Toolkit are the BITMAPINFOHEADER and
* BITMAPINFOHEADER2 structures.
*
* A color table is concatenated to this structure. The number of elements in
@@ -188,8 +188,8 @@ typedef struct BITMAPHEADER
/*
- * RGB defines a single color palette entry. Its analogues in the Windows SDK
- * are the RGBTRIPLE and RGBQUAD structures. Its analogues in the OS/2
+ * RGB defines a single color palette entry. Its analogs in the Windows SDK
+ * are the RGBTRIPLE and RGBQUAD structures. Its analogs in the OS/2
* Toolkit are the RGB and RGB2 structure.
*/
typedef struct RGB
diff --git a/CGAL_ImageIO/include/CGAL/ImageIO/recline_impl.h b/CGAL_ImageIO/include/CGAL/ImageIO/recline_impl.h
index 4b5374898e5..e4b694efa78 100644
--- a/CGAL_ImageIO/include/CGAL/ImageIO/recline_impl.h
+++ b/CGAL_ImageIO/include/CGAL/ImageIO/recline_impl.h
@@ -283,7 +283,7 @@ RFcoefficientType * InitRecursiveCoefficients( double x,
b0 /= x;
b1 /= x;
- /*--- normalisation ---*/
+ /*--- normalization ---*/
switch ( derivative ) {
default :
CGAL_FALLTHROUGH;
diff --git a/CGAL_ipelets/demo/CGAL_ipelets/include/CGAL_ipelets/k_delaunay.h b/CGAL_ipelets/demo/CGAL_ipelets/include/CGAL_ipelets/k_delaunay.h
index 7709eb5df26..567ca6c42ad 100644
--- a/CGAL_ipelets/demo/CGAL_ipelets/include/CGAL_ipelets/k_delaunay.h
+++ b/CGAL_ipelets/demo/CGAL_ipelets/include/CGAL_ipelets/k_delaunay.h
@@ -30,17 +30,17 @@ void k_delaunay(Regular& rt,input_DS& input_wpt,int order){
typedef typename Kernel::Point_2 Point_2;
typedef typename Kernel::Weighted_point_2 Weighted_point_2;
- std::vector Current_sel;//DS that will contain all possible combinaisons of k points (iterator), where k is the order
+ std::vector Current_sel;//DS that will contain all possible combinations of k points (iterator), where k is the order
typename input_DS::iterator it_wpt = input_wpt.begin();
typename input_DS::iterator stop_combi = input_wpt.end();
for(int i=0;i
int main (int argc, char** argv)
{
- const std::string filename = (argc > 1) ? argv[1] : CGAL::data_file_path("meshes/b9.ply");
+ const std::string filename = (argc > 1) ? argv[1] : CGAL::data_file_path("points_3/b9.ply");
std::cerr << "Reading input" << std::endl;
std::vector pts;
diff --git a/Classification/examples/Classification/example_cluster_classification.cpp b/Classification/examples/Classification/example_cluster_classification.cpp
index 51c7e642b78..a036f878f0b 100644
--- a/Classification/examples/Classification/example_cluster_classification.cpp
+++ b/Classification/examples/Classification/example_cluster_classification.cpp
@@ -48,7 +48,7 @@ typedef Classification::Cluster Clu
int main (int argc, char** argv)
{
- std::string filename = CGAL::data_file_path("meshes/b9.ply");
+ std::string filename = CGAL::data_file_path("points_3/b9.ply");
std::string filename_config = "data/b9_clusters_config.bin";
if (argc > 1)
diff --git a/Classification/examples/Classification/example_feature.cpp b/Classification/examples/Classification/example_feature.cpp
index b0cdcd90054..d8bed02141b 100644
--- a/Classification/examples/Classification/example_feature.cpp
+++ b/Classification/examples/Classification/example_feature.cpp
@@ -66,7 +66,7 @@ public:
int main (int argc, char** argv)
{
- std::string filename (argc > 1 ? argv[1] : CGAL::data_file_path("meshes/b9.ply"));
+ std::string filename (argc > 1 ? argv[1] : CGAL::data_file_path("points_3/b9.ply"));
std::vector pts;
std::cerr << "Reading input" << std::endl;
diff --git a/Classification/include/CGAL/Classification/Feature/Elevation.h b/Classification/include/CGAL/Classification/Feature/Elevation.h
index 175b20b6a44..9ea9f267cc4 100644
--- a/Classification/include/CGAL/Classification/Feature/Elevation.h
+++ b/Classification/include/CGAL/Classification/Feature/Elevation.h
@@ -130,7 +130,7 @@ public:
std::nth_element (z.begin(), z.begin() + (z.size() / 10), z.end());
dtm_x(i,j) = z[z.size() / 10];
}
- dem.free();
+ (dem.free)();
if (grid.width() * grid.height() > input.size())
values.resize (input.size(), compressed_float(0));
@@ -162,7 +162,7 @@ public:
values[*it] = v;
}
}
- dtm_x.free();
+ (dtm_x.free)();
}
diff --git a/Classification/include/CGAL/Classification/Feature/Height_above.h b/Classification/include/CGAL/Classification/Feature/Height_above.h
index b59b108c1ac..3c85d27f91e 100644
--- a/Classification/include/CGAL/Classification/Feature/Height_above.h
+++ b/Classification/include/CGAL/Classification/Feature/Height_above.h
@@ -100,7 +100,7 @@ public:
std::size_t J = grid.y(i);
values[i] = float(dtm(I,J) - get (point_map, *(input.begin() + i)).z());
}
- dtm.free();
+ (dtm.free)();
}
}
diff --git a/Classification/include/CGAL/Classification/Feature/Height_below.h b/Classification/include/CGAL/Classification/Feature/Height_below.h
index 22371934155..f71195dd348 100644
--- a/Classification/include/CGAL/Classification/Feature/Height_below.h
+++ b/Classification/include/CGAL/Classification/Feature/Height_below.h
@@ -100,7 +100,7 @@ public:
std::size_t J = grid.y(i);
values[i] = float(get (point_map, *(input.begin() + i)).z() - dtm(I,J));
}
- dtm.free();
+ (dtm.free)();
}
}
diff --git a/Classification/include/CGAL/Classification/Feature/Vertical_range.h b/Classification/include/CGAL/Classification/Feature/Vertical_range.h
index 45b9c98d3ee..a4df1591c13 100644
--- a/Classification/include/CGAL/Classification/Feature/Vertical_range.h
+++ b/Classification/include/CGAL/Classification/Feature/Vertical_range.h
@@ -102,7 +102,7 @@ public:
std::size_t J = grid.y(i);
values[i] = dtm(I,J);
}
- dtm.free();
+ (dtm.free)();
}
}
diff --git a/Classification/include/CGAL/Classification/Image.h b/Classification/include/CGAL/Classification/Image.h
index 084e9572764..3bd915f0b5d 100644
--- a/Classification/include/CGAL/Classification/Image.h
+++ b/Classification/include/CGAL/Classification/Image.h
@@ -71,7 +71,7 @@ public:
{
}
- void free()
+ void free BOOST_PREVENT_MACRO_SUBSTITUTION ()
{
m_raw.reset();
m_sparse.reset();
diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map.h b/Combinatorial_map/include/CGAL/Combinatorial_map.h
index aaa360677b7..5135f5ec327 100644
--- a/Combinatorial_map/include/CGAL/Combinatorial_map.h
+++ b/Combinatorial_map/include/CGAL/Combinatorial_map.h
@@ -662,7 +662,7 @@ namespace CGAL {
}
/** Create a new dart and add it to the map.
- * The marks of the darts are initialised with mmask_marks, i.e. the dart
+ * The marks of the darts are initialized with mmask_marks, i.e. the dart
* is unmarked for all the marks.
* @return a Dart_descriptor on the new dart.
*/
@@ -1780,7 +1780,6 @@ namespace CGAL {
void basic_link_beta_for_involution(Dart_descriptor adart1, Dart_descriptor adart2,
unsigned int i)
{
- CGAL_assertion( i>=2 && i<=dimension );
CGAL_assertion( i>=2 && i<=dimension );
dart_link_beta(adart1, adart2, i);
dart_link_beta(adart2, adart1, i);
@@ -3708,6 +3707,9 @@ namespace CGAL {
this->automatic_attributes_management = newval;
}
+ void set_automatic_attributes_management_without_correction(bool newval)
+ { this->automatic_attributes_management = newval; }
+
/** Create an half-edge.
* @return a dart of the new half-edge.
*/
@@ -4112,7 +4114,7 @@ namespace CGAL {
}
if (ah != null_descriptor)
{
- // We initialise the 0-atttrib to ah
+ // We initialize the 0-atttrib to ah
internal::Set_i_attribute_of_dart_functor::
run(*this, d1, ah);
}
diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map/internal/Combinatorial_map_copy_functors.h b/Combinatorial_map/include/CGAL/Combinatorial_map/internal/Combinatorial_map_copy_functors.h
index 5cbf7b7861a..f570d59b187 100644
--- a/Combinatorial_map/include/CGAL/Combinatorial_map/internal/Combinatorial_map_copy_functors.h
+++ b/Combinatorial_map/include/CGAL/Combinatorial_map/internal/Combinatorial_map_copy_functors.h
@@ -228,7 +228,7 @@ struct Call_functor_if_both_attributes_have_point
const Pointconverter&)
{ return Map2::null_descriptor; }
};
-// Specialisation with i==0 and both attributes have points.
+// Specialization with i==0 and both attributes have points.
template< typename Map1, typename Map2, typename Pointconverter >
struct Call_functor_if_both_attributes_have_point
@@ -285,7 +285,7 @@ struct Copy_attribute_functor_if_nonvoid
cmap2.template set_attribute(dh2, res);
}
};
-// Specialisation when attr1 is void, and attr2 is non void i==0. Nothing to
+// Specialization when attr1 is void, and attr2 is non void i==0. Nothing to
// copy, but if 0-attributes has point and i==0, we need to create
// vertex attributes.
template(dh2, cmap2.template create_attribute<0>());
}
};
-// Specialisation when attr1 is void, and attr2 is non void i!=0.
+// Specialization when attr1 is void, and attr2 is non void i!=0.
// Nothing to do.
template
@@ -360,7 +360,7 @@ struct Copy_dart_info_functor_if_nonvoid
const DartInfoConverter& converter)
{ converter(map1, map2, dh1, dh2); }
};
-// Specialisation when Info1 is void.
+// Specialization when Info1 is void.
template
struct Copy_dart_info_functor_if_nonvoid
struct Copy_dart_info_functor_if_nonvoid
struct Copy_dart_info_functor_if_nonvoid
diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map_operations.h b/Combinatorial_map/include/CGAL/Combinatorial_map_operations.h
index 72c89d40142..c1ca6c1987e 100644
--- a/Combinatorial_map/include/CGAL/Combinatorial_map_operations.h
+++ b/Combinatorial_map/include/CGAL/Combinatorial_map_operations.h
@@ -36,7 +36,7 @@ namespace CGAL
{
static bool run(const CMap& amap, typename CMap::Dart_const_descriptor adart)
{
- // TODO? Optimisation for dim-2, and to not test all the darts of the cell?
+ // TODO? Optimization for dim-2, and to not test all the darts of the cell?
bool res = true;
for ( CGAL::CMap_dart_const_iterator_of_cell it(amap, adart);
res && it.cont(); ++it )
@@ -462,7 +462,7 @@ namespace CGAL
{
static bool run(const CMap& amap, typename CMap::Dart_const_descriptor adart)
{
- // TODO ? Optimisation possible to not test all the darts of the cell ?
+ // TODO ? Optimization possible to not test all the darts of the cell ?
bool res = true;
for ( CGAL::CMap_dart_const_iterator_of_cell it(amap, adart);
res && it.cont(); ++it )
diff --git a/Combinatorial_map/include/CGAL/Dart.h b/Combinatorial_map/include/CGAL/Dart.h
index 17ffde4b294..0fb809b6d81 100644
--- a/Combinatorial_map/include/CGAL/Dart.h
+++ b/Combinatorial_map/include/CGAL/Dart.h
@@ -156,7 +156,7 @@ namespace CGAL {
}
protected:
- /** Default constructor: no real initialisation,
+ /** Default constructor: no real initialization,
* because this is done in the combinatorial map class.
*/
Dart_without_info()
@@ -300,7 +300,7 @@ namespace CGAL {
{ return Base::operator==(other) && minfo==other.minfo; }
protected:
- /** Default constructor: no real initialisation,
+ /** Default constructor: no real initialization,
* because this is done in the combinatorial or generalized map class.
*/
Dart()=default; // default => zero-initializing built-in types
diff --git a/Combinatorial_map/test/Combinatorial_map/CMakeLists.txt b/Combinatorial_map/test/Combinatorial_map/CMakeLists.txt
index d0c26ec31c5..8df873f5de3 100644
--- a/Combinatorial_map/test/Combinatorial_map/CMakeLists.txt
+++ b/Combinatorial_map/test/Combinatorial_map/CMakeLists.txt
@@ -28,13 +28,12 @@ create_single_source_cgal_program(cmap_test_split_attribute.cpp)
# Link with OpenMesh if possible
find_package(OpenMesh QUIET)
-if(TARGET OpenMesh::OpenMesh)
+if(OpenMesh_FOUND)
message(STATUS "Found OpenMesh")
+ include(CGAL_OpenMesh_support)
- target_link_libraries(Combinatorial_map_copy_test PRIVATE OpenMesh::OpenMesh)
- target_compile_definitions(Combinatorial_map_copy_test PRIVATE -DCGAL_USE_OPENMESH)
- target_link_libraries(Combinatorial_map_copy_test_index PRIVATE OpenMesh::OpenMesh)
- target_compile_definitions(Combinatorial_map_copy_test_index PRIVATE -DCGAL_USE_OPENMESH)
+ target_link_libraries(Combinatorial_map_copy_test PRIVATE CGAL::OpenMesh_support)
+ target_link_libraries(Combinatorial_map_copy_test_index PRIVATE CGAL::OpenMesh_support)
else()
message(STATUS "NOTICE: Tests will not use OpenMesh.")
endif()
diff --git a/Cone_spanners_2/include/CGAL/Compute_cone_boundaries_2.h b/Cone_spanners_2/include/CGAL/Compute_cone_boundaries_2.h
index 4256fd0dc17..a4069a1168a 100644
--- a/Cone_spanners_2/include/CGAL/Compute_cone_boundaries_2.h
+++ b/Cone_spanners_2/include/CGAL/Compute_cone_boundaries_2.h
@@ -115,7 +115,7 @@ public:
#if defined(CGAL_USE_LEDA) || defined(CGAL_USE_CORE)
/*
- The specialised functor for computing the directions of cone boundaries exactly
+ The specialized functor for computing the directions of cone boundaries exactly
with a given cone number and a given initial direction.
*/
template <>
diff --git a/Cone_spanners_2/include/CGAL/Construct_theta_graph_2.h b/Cone_spanners_2/include/CGAL/Construct_theta_graph_2.h
index d4b47ed33c2..3d1ebc15efb 100644
--- a/Cone_spanners_2/include/CGAL/Construct_theta_graph_2.h
+++ b/Cone_spanners_2/include/CGAL/Construct_theta_graph_2.h
@@ -199,7 +199,7 @@ protected:
std::vector S(vit, ve);
std::sort(S.begin (), S.end (), orderD1);
- // Step 2: Initialise an empty set to store vertices sorted by orderD2
+ // Step 2: initialize an empty set to store vertices sorted by orderD2
typedef CGAL::ThetaDetail::Plane_scan_tree S(vit, ve);
std::sort(S.begin (), S.end (), orderD1);
- // Step 2: Initialise an empty set to store vertices sorted by orderD2
+ // Step 2: initialize an empty set to store vertices sorted by orderD2
Point_set pst(orderD2);
// Step 3: visit S in orderD1
diff --git a/Cone_spanners_2/include/CGAL/gnuplot_output_2.h b/Cone_spanners_2/include/CGAL/gnuplot_output_2.h
index 65324f60134..d2cb402e37a 100644
--- a/Cone_spanners_2/include/CGAL/gnuplot_output_2.h
+++ b/Cone_spanners_2/include/CGAL/gnuplot_output_2.h
@@ -93,7 +93,7 @@ std::string gnuplot_vertex_list (const Graph& g);
/* This struct is defined to use partial specialization to generate arrow styles differently for
* directed and undirected graphs.
- * Note: Need to use structs because C++ before 11 doesn't allow partial specialisation
+ * Note: Need to use structs because C++ before 11 doesn't allow partial specialization
* for functions
*/
template
diff --git a/Convex_decomposition_3/include/CGAL/Convex_decomposition_3/External_structure_builder.h b/Convex_decomposition_3/include/CGAL/Convex_decomposition_3/External_structure_builder.h
index 8c4c546590d..c6ecee86c0b 100644
--- a/Convex_decomposition_3/include/CGAL/Convex_decomposition_3/External_structure_builder.h
+++ b/Convex_decomposition_3/include/CGAL/Convex_decomposition_3/External_structure_builder.h
@@ -76,62 +76,13 @@ class External_structure_builder : public Modifier_base sedge2sface;
- /*
- SFace_iterator sfi;
- CGAL_forall_sfaces(sfi, *sncp) {
- SFace_cycle_iterator sfc;
- for(sfc = sfi->sface_cycles_begin(); sfc != sfi->sface_cycles_end(); ++sfc) {
- if(sfc.is_shalfedge()){
- SHalfedge_around_sface_circulator eaf(sfc), end(eaf);
- CGAL_For_all(eaf,end) {
- SHalfedge_handle se(eaf);
- sedge2sface[eaf] = sfi;
- }
- }
- }
- }
-
- // CGAL::SNC_io_parser O0(std::cerr, *sncp, false);
- // O0.print();
-
- SHalfedge_iterator sei;
- CGAL_forall_shalfedges(sei, *sncp) {
- SHalfedge_handle se(sei);
- if(sedge2sface[se] == SFace_handle()) {
- SM_decorator SD(&*sei->source()->source());
- SFace_handle sf_new = SD.new_sface();
- sf_new->mark() = sei->incident_sface()->mark();
-
- CGAL_NEF_TRACEN("new entry sedge " << sei->source()->point()
- << "->" << sei->twin()->source()->point()
- << " at " << sei->source()->source()->point());
-
- SD.link_as_face_cycle(sei, sf_new);
-
- SHalfedge_around_sface_circulator eaf(se), end(eaf);
- CGAL_For_all(eaf,end) {
- SHalfedge_handle se(eaf);
- sedge2sface[eaf] = sf_new;
- }
-
- // TODO: relink inner sface cycles
- }
- }
- */
SNC_point_locator* old_pl = pl;
pl = pl->clone();
sncpl.pl = pl;
- delete old_pl;
SNC_external_structure C(*sncp,pl);
C.clear_external_structure();
C.build_external_structure();
-
- // CGAL::SNC_io_parser Ox(std::cerr, *sncp, false);
- // Ox.print();
+ delete old_pl;
}
};
diff --git a/Convex_decomposition_3/test/Convex_decomposition_3/cd_nested_holes_test.cpp b/Convex_decomposition_3/test/Convex_decomposition_3/cd_nested_holes_test.cpp
new file mode 100644
index 00000000000..37a3c68264f
--- /dev/null
+++ b/Convex_decomposition_3/test/Convex_decomposition_3/cd_nested_holes_test.cpp
@@ -0,0 +1,53 @@
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel;
+typedef CGAL::Polyhedron_3 Polyhedron_3;
+typedef CGAL::Nef_polyhedron_3 Nef_polyhedron_3;
+typedef Nef_polyhedron_3::Volume_const_iterator Volume_const_iterator;
+
+std::size_t run(std::string path)
+{
+ Polyhedron_3 input;
+ std::ifstream(path) >> input;
+
+ Nef_polyhedron_3 N(input);
+
+ CGAL::convex_decomposition_3(N);
+ std::list convex_parts;
+
+ Volume_const_iterator ci = ++N.volumes_begin();
+ for( ; ci != N.volumes_end(); ++ci) {
+ if(ci->mark()) {
+ Polyhedron_3 P;
+ N.convert_inner_shell_to_polyhedron(ci->shells_begin(), P);
+ convex_parts.push_back(P);
+ }
+ }
+
+// int i=0;
+ for (const Polyhedron_3& P : convex_parts)
+ {
+// std::ofstream("out_"+std::to_string(i++)+".off") << std::setprecision(17) << P;
+ assert(P.size_of_vertices()!=0);
+ }
+
+ return convex_parts.size();
+}
+
+int main()
+{
+ std::size_t val = run("data/in1.off");
+ assert(val==9);
+ val = run("data/in2.off");
+ assert(val==10);
+ val = run("data/in3.off");
+ assert(val==13);
+ val = run("data/in4.off");
+ assert(val==17);
+}
diff --git a/Convex_decomposition_3/test/Convex_decomposition_3/data/in1.off b/Convex_decomposition_3/test/Convex_decomposition_3/data/in1.off
new file mode 100644
index 00000000000..dabda4d9d3e
--- /dev/null
+++ b/Convex_decomposition_3/test/Convex_decomposition_3/data/in1.off
@@ -0,0 +1,117 @@
+OFF 40 76 0
+5 -5 4
+5 -5 2
+5 5 2
+5 5 4
+5 -5 -2
+5 -5 -4
+5 5 -4
+5 5 -2
+-5 5 4
+-5 -5 4
+-4 -4 4
+-4 4 4
+4 4 4
+4 -4 4
+-5 -5 -4
+-5 5 -4
+-4 4 -4
+-4 -4 -4
+4 -4 -4
+4 4 -4
+-5 5 2
+-5 -5 2
+-5 -5 -2
+-5 5 -2
+4 4 2
+4 -4 2
+4 -4 -2
+4 4 -2
+-4 4 2
+-4 -4 2
+-4 4 -2
+-4 -4 -2
+6 -6 2
+6 -6 -2
+6 6 -2
+6 6 2
+-6 6 2
+-6 -6 2
+-6 -6 -2
+-6 6 -2
+3 0 2 3
+3 2 0 1
+3 4 6 7
+3 6 4 5
+3 3 12 0
+3 3 11 12
+3 11 8 10
+3 8 11 3
+3 13 0 12
+3 10 0 13
+3 10 9 0
+3 9 10 8
+3 5 18 6
+3 5 17 18
+3 17 14 16
+3 14 17 5
+3 19 6 18
+3 16 6 19
+3 16 15 6
+3 15 16 14
+3 21 8 20
+3 8 21 9
+3 14 23 15
+3 23 14 22
+3 2 8 3
+3 8 2 20
+3 6 23 7
+3 23 6 15
+3 21 0 9
+3 0 21 1
+3 14 4 22
+3 4 14 5
+3 25 12 24
+3 12 25 13
+3 18 27 19
+3 27 18 26
+3 10 28 11
+3 28 10 29
+3 31 16 30
+3 16 31 17
+3 28 12 11
+3 12 28 24
+3 16 27 30
+3 27 16 19
+3 25 10 13
+3 10 25 29
+3 18 31 26
+3 31 18 17
+3 32 34 35
+3 34 32 33
+3 35 2 32
+3 35 20 2
+3 20 36 21
+3 36 20 35
+3 1 32 2
+3 21 32 1
+3 21 37 32
+3 37 21 36
+3 28 25 24
+3 25 28 29
+3 33 4 34
+3 33 22 4
+3 22 38 23
+3 38 22 33
+3 7 34 4
+3 23 34 7
+3 23 39 34
+3 39 23 38
+3 31 27 26
+3 27 31 30
+3 38 36 39
+3 36 38 37
+3 34 36 35
+3 36 34 39
+3 38 32 37
+3 32 38 33
diff --git a/Convex_decomposition_3/test/Convex_decomposition_3/data/in2.off b/Convex_decomposition_3/test/Convex_decomposition_3/data/in2.off
new file mode 100644
index 00000000000..d09ff781d58
--- /dev/null
+++ b/Convex_decomposition_3/test/Convex_decomposition_3/data/in2.off
@@ -0,0 +1,144 @@
+OFF
+48 92 0
+
+2 2 2
+2 -2 2
+-2 2 2
+-2 -2 2
+-2 2 4
+2 2 4
+-2 -2 4
+2 -2 4
+5 -5 4
+-4 4 4
+5 5 4
+4 -4 4
+-5 -5 4
+-4 -4 -4
+5 -5 -4
+4 4 -4
+-5 5 -4
+-5 5 4
+5 5 -4
+-5 -5 -4
+4 4 4
+4 -4 -2
+-4 -4 4
+-4 4 -2
+-4 4 -4
+4 4 -2
+4 -4 -4
+6 -6 2
+5 5 2
+-5 5 2
+6 6 2
+5 -5 2
+-5 -5 2
+-6 -6 2
+5 -5 -2
+-5 -5 -2
+6 -6 -2
+5 5 -2
+-5 5 -2
+-6 6 -2
+-4 -4 -2
+-6 6 2
+6 6 -2
+-6 -6 -2
+-4 -4 2
+-4 4 2
+4 4 2
+4 -4 2
+3 2 4 5
+3 7 6 3
+3 5 7 1
+3 6 7 5
+3 3 6 4
+3 5 0 2
+3 3 1 7
+3 1 0 5
+3 5 4 6
+3 4 2 3
+3 8 28 10
+3 28 8 31
+3 34 18 37
+3 18 34 14
+3 10 20 8
+3 10 9 20
+3 9 17 22
+3 17 9 10
+3 11 8 20
+3 22 8 11
+3 22 12 8
+3 12 22 17
+3 14 26 18
+3 14 13 26
+3 13 19 24
+3 19 13 14
+3 15 18 26
+3 24 18 15
+3 24 16 18
+3 16 24 19
+3 32 17 29
+3 17 32 12
+3 19 38 16
+3 38 19 35
+3 28 17 10
+3 17 28 29
+3 18 38 37
+3 38 18 16
+3 32 8 12
+3 8 32 31
+3 19 34 35
+3 34 19 14
+3 47 20 46
+3 20 47 11
+3 26 25 15
+3 25 26 21
+3 22 45 9
+3 45 22 44
+3 40 24 23
+3 24 40 13
+3 45 20 9
+3 20 45 46
+3 24 25 23
+3 25 24 15
+3 47 22 11
+3 22 47 44
+3 26 40 21
+3 40 26 13
+3 27 42 30
+3 42 27 36
+3 30 28 27
+3 30 29 28
+3 29 41 32
+3 41 29 30
+3 31 27 28
+3 32 27 31
+3 32 33 27
+3 33 32 41
+3 2 0 45
+3 1 44 47
+3 36 34 42
+3 36 35 34
+3 35 43 38
+3 43 35 36
+3 37 42 34
+3 38 42 37
+3 38 39 42
+3 39 38 43
+3 40 25 21
+3 25 40 23
+3 43 41 39
+3 41 43 33
+3 42 41 30
+3 41 42 39
+3 43 27 33
+3 27 43 36
+3 44 1 3
+3 44 3 45
+3 45 3 2
+3 46 45 0
+3 46 0 47
+3 47 0 1
+
diff --git a/Convex_decomposition_3/test/Convex_decomposition_3/data/in3.off b/Convex_decomposition_3/test/Convex_decomposition_3/data/in3.off
new file mode 100644
index 00000000000..7685150981d
--- /dev/null
+++ b/Convex_decomposition_3/test/Convex_decomposition_3/data/in3.off
@@ -0,0 +1,180 @@
+OFF
+60 116 0
+
+1 1 4
+1 0.33333333333333337 4
+1 -1 4
+0.33333333333333337 -1 4
+-1 -1 4
+-1 0.33333333333333337 4
+-1 1 4
+0.33333333333333337 1 4
+-2 2 2
+5 -5 4
+-4 4 4
+5 5 4
+4 -4 4
+-5 -5 4
+-4 -4 -4
+5 -5 -4
+4 4 -4
+-5 5 -4
+-5 5 4
+5 5 -4
+-5 -5 -4
+4 4 4
+4 -4 -2
+-4 -4 4
+-4 4 -2
+-4 4 -4
+4 4 -2
+4 -4 -4
+6 -6 2
+5 5 2
+-5 5 2
+6 6 2
+5 -5 2
+-5 -5 2
+-6 -6 2
+5 -5 -2
+-5 -5 -2
+6 -6 -2
+5 5 -2
+-5 5 -2
+-6 6 -2
+-4 -4 -2
+-6 6 2
+6 6 -2
+-6 -6 -2
+-2 -2 2
+-4 -4 2
+-4 4 2
+4 4 2
+4 -4 2
+2 -2 2
+2 2 2
+-2 2 4
+2 2 4
+2 -2 4
+-2 -2 4
+1 1 2
+1 -1 2
+-1 -1 2
+-1 1 2
+3 8 52 53
+3 54 55 45
+3 53 54 50
+3 0 1 53
+3 45 55 52
+3 53 51 8
+3 45 50 54
+3 50 51 53
+3 4 5 55
+3 52 8 45
+3 9 29 11
+3 29 9 32
+3 35 19 38
+3 19 35 15
+3 11 21 9
+3 11 10 21
+3 10 18 23
+3 18 10 11
+3 12 9 21
+3 23 9 12
+3 23 13 9
+3 13 23 18
+3 15 27 19
+3 15 14 27
+3 14 20 25
+3 20 14 15
+3 16 19 27
+3 25 19 16
+3 25 17 19
+3 17 25 20
+3 33 18 30
+3 18 33 13
+3 20 39 17
+3 39 20 36
+3 29 18 11
+3 18 29 30
+3 19 39 38
+3 39 19 17
+3 33 9 13
+3 9 33 32
+3 20 35 36
+3 35 20 15
+3 49 21 48
+3 21 49 12
+3 27 26 16
+3 26 27 22
+3 23 47 10
+3 47 23 46
+3 41 25 24
+3 25 41 14
+3 47 21 10
+3 21 47 48
+3 25 26 24
+3 26 25 16
+3 49 23 12
+3 23 49 46
+3 27 41 22
+3 41 27 14
+3 28 43 31
+3 43 28 37
+3 31 29 28
+3 31 30 29
+3 30 42 33
+3 42 30 31
+3 32 28 29
+3 33 28 32
+3 33 34 28
+3 34 33 42
+3 8 51 47
+3 50 46 49
+3 37 35 43
+3 37 36 35
+3 36 44 39
+3 44 36 37
+3 38 43 35
+3 39 43 38
+3 39 40 43
+3 40 39 44
+3 41 26 22
+3 26 41 24
+3 44 42 40
+3 42 44 34
+3 43 42 31
+3 42 43 40
+3 44 28 34
+3 28 44 37
+3 46 50 45
+3 46 45 47
+3 47 45 8
+3 48 47 51
+3 48 51 49
+3 49 51 50
+3 52 55 5
+3 52 7 53
+3 52 5 6
+3 53 7 0
+3 52 6 7
+3 54 53 1
+3 54 2 3
+3 54 1 2
+3 55 54 3
+3 55 3 4
+3 58 57 56
+3 59 56 7
+3 2 57 3
+3 0 56 1
+3 5 59 6
+3 56 59 58
+3 57 1 56
+3 57 2 1
+3 58 5 4
+3 7 56 0
+3 58 3 57
+3 4 3 58
+3 59 5 58
+3 7 6 59
+
diff --git a/Convex_decomposition_3/test/Convex_decomposition_3/data/in4.off b/Convex_decomposition_3/test/Convex_decomposition_3/data/in4.off
new file mode 100644
index 00000000000..1a7bbd1ba82
--- /dev/null
+++ b/Convex_decomposition_3/test/Convex_decomposition_3/data/in4.off
@@ -0,0 +1,180 @@
+OFF
+60 116 0
+
+1 1 4
+1 0.5 4
+1 -1 4
+0.5 -1 4
+-1 -1 4
+-1 0.5 4
+-1 1 4
+0.5 1 4
+-2 2 2
+5 -5 4
+-4 4 4
+5 5 4
+4 -4 4
+-5 -5 4
+-4 -4 -4
+5 -5 -4
+4 4 -4
+-5 5 -4
+-5 5 4
+5 5 -4
+-5 -5 -4
+4 4 4
+4 -4 -2
+-4 -4 4
+-4 4 -2
+-4 4 -4
+4 4 -2
+4 -4 -4
+6 -6 2
+5 5 2
+-5 5 2
+6 6 2
+5 -5 2
+-5 -5 2
+-6 -6 2
+5 -5 -2
+-5 -5 -2
+6 -6 -2
+5 5 -2
+-5 5 -2
+-6 6 -2
+-4 -4 -2
+-6 6 2
+6 6 -2
+-6 -6 -2
+-2 -2 2
+-4 -4 2
+-4 4 2
+4 4 2
+4 -4 2
+2 -2 2
+2 2 2
+-2 2 4
+2 2 4
+2 -2 4
+-2 -2 4
+1 1 1
+1 -1 1
+-1 -1 1
+-1 1 1
+3 8 52 53
+3 54 55 45
+3 53 54 50
+3 0 1 53
+3 45 55 52
+3 53 51 8
+3 45 50 54
+3 50 51 53
+3 4 5 55
+3 52 8 45
+3 9 29 11
+3 29 9 32
+3 35 19 38
+3 19 35 15
+3 11 21 9
+3 11 10 21
+3 10 18 23
+3 18 10 11
+3 12 9 21
+3 23 9 12
+3 23 13 9
+3 13 23 18
+3 15 27 19
+3 15 14 27
+3 14 20 25
+3 20 14 15
+3 16 19 27
+3 25 19 16
+3 25 17 19
+3 17 25 20
+3 33 18 30
+3 18 33 13
+3 20 39 17
+3 39 20 36
+3 29 18 11
+3 18 29 30
+3 19 39 38
+3 39 19 17
+3 33 9 13
+3 9 33 32
+3 20 35 36
+3 35 20 15
+3 49 21 48
+3 21 49 12
+3 27 26 16
+3 26 27 22
+3 23 47 10
+3 47 23 46
+3 41 25 24
+3 25 41 14
+3 47 21 10
+3 21 47 48
+3 25 26 24
+3 26 25 16
+3 49 23 12
+3 23 49 46
+3 27 41 22
+3 41 27 14
+3 28 43 31
+3 43 28 37
+3 31 29 28
+3 31 30 29
+3 30 42 33
+3 42 30 31
+3 32 28 29
+3 33 28 32
+3 33 34 28
+3 34 33 42
+3 8 51 47
+3 50 46 49
+3 37 35 43
+3 37 36 35
+3 36 44 39
+3 44 36 37
+3 38 43 35
+3 39 43 38
+3 39 40 43
+3 40 39 44
+3 41 26 22
+3 26 41 24
+3 44 42 40
+3 42 44 34
+3 43 42 31
+3 42 43 40
+3 44 28 34
+3 28 44 37
+3 46 50 45
+3 46 45 47
+3 47 45 8
+3 48 47 51
+3 48 51 49
+3 49 51 50
+3 52 55 5
+3 52 7 53
+3 52 5 6
+3 53 7 0
+3 52 6 7
+3 54 53 1
+3 54 2 3
+3 54 1 2
+3 55 54 3
+3 55 3 4
+3 58 57 56
+3 59 56 7
+3 2 57 3
+3 0 56 1
+3 5 59 6
+3 56 59 58
+3 57 1 56
+3 57 2 1
+3 58 5 4
+3 7 56 0
+3 58 3 57
+3 4 3 58
+3 59 5 58
+3 7 6 59
+
diff --git a/Convex_hull_3/examples/Convex_hull_3/CMakeLists.txt b/Convex_hull_3/examples/Convex_hull_3/CMakeLists.txt
index 4b6f08ba252..add02f31d30 100644
--- a/Convex_hull_3/examples/Convex_hull_3/CMakeLists.txt
+++ b/Convex_hull_3/examples/Convex_hull_3/CMakeLists.txt
@@ -21,13 +21,13 @@ create_single_source_cgal_program("extreme_indices_3.cpp")
find_package(OpenMesh QUIET)
if(OpenMesh_FOUND)
- include(UseOpenMesh)
+ include(CGAL_OpenMesh_support)
message(STATUS "Found OpenMesh")
create_single_source_cgal_program("quickhull_OM_3.cpp")
- target_link_libraries(quickhull_OM_3 PRIVATE ${OPENMESH_LIBRARIES})
+ target_link_libraries(quickhull_OM_3 PRIVATE CGAL::OpenMesh_support)
create_single_source_cgal_program("dynamic_hull_OM_3.cpp")
- target_link_libraries(dynamic_hull_OM_3 PRIVATE ${OPENMESH_LIBRARIES})
+ target_link_libraries(dynamic_hull_OM_3 PRIVATE CGAL::OpenMesh_support)
else()
message(STATUS "NOTICE: Examples that use OpenMesh will not be compiled.")
endif()
diff --git a/Data/data/meshes/b9.ply b/Data/data/points_3/b9.ply
similarity index 100%
rename from Data/data/meshes/b9.ply
rename to Data/data/points_3/b9.ply
diff --git a/Distance_3/test/Distance_3/test_distance_3.cpp b/Distance_3/test/Distance_3/test_distance_3.cpp
index ab67ad18d79..f297e93016b 100644
--- a/Distance_3/test/Distance_3/test_distance_3.cpp
+++ b/Distance_3/test/Distance_3/test_distance_3.cpp
@@ -160,7 +160,6 @@ private:
assert(are_equal(res_o2o1, expected_result));
do_intersect_check(o1, o2);
- do_intersect_check(o1, o2);
}
template
@@ -169,7 +168,6 @@ private:
const FT res_o1o2 = CGAL::squared_distance(o1, o2);
const FT res_o2o1 = CGAL::squared_distance(o2, o1);
- do_intersect_check(o1, o2);
do_intersect_check(o1, o2);
assert(res_o1o2 <= ubound);
@@ -324,7 +322,7 @@ private:
check_squared_distance(S{p2, p3}, S{p4, p5}, 0);
check_squared_distance(S{p2, p3}, S{p5, p4}, 0);
check_squared_distance(S{p3, p2}, S{p4, p5}, 0);
- check_squared_distance(S{p3, p2}, S{p4, p5}, 0);
+ check_squared_distance(S{p3, p2}, S{p5, p4}, 0);
const double lambda_6 = r.get_double(0, 1);
const P p6 = p3 + FT(lambda_6) * V{p3 - p2};
@@ -332,7 +330,7 @@ private:
check_squared_distance(S{p2, p3}, S{p6, p5}, 0);
check_squared_distance(S{p2, p3}, S{p5, p6}, 0);
check_squared_distance(S{p3, p2}, S{p6, p5}, 0);
- check_squared_distance(S{p3, p2}, S{p6, p5}, 0);
+ check_squared_distance(S{p3, p2}, S{p5, p6}, 0);
const double lambda_7 = r.get_double(1, 2);
const P p7 = p3 + FT(lambda_7) * V{p3 - p2};
diff --git a/Documentation/doc/Documentation/Developer_manual/cmakelist_script.txt b/Documentation/doc/Documentation/Developer_manual/cmakelist_script.txt
index 26c1f7c0ef4..eeae486b236 100644
--- a/Documentation/doc/Documentation/Developer_manual/cmakelist_script.txt
+++ b/Documentation/doc/Documentation/Developer_manual/cmakelist_script.txt
@@ -17,7 +17,7 @@ configuration.
create a single executable for 'source' linked with
compilations of all other source files
(`*.cc`, `*.cp`, `*.cxx`, `*.cpp`, `*.CPP`, `*.c++`, or `*.C`).
-This behaviour is usually needed for (graphical) demos.
+This behavior is usually needed for (graphical) demos.
If the parameter is not given, the script creates one executable for each given
source file.
diff --git a/Documentation/doc/Documentation/Preliminaries.txt b/Documentation/doc/Documentation/Preliminaries.txt
index 2e2ae95e661..f2006d05154 100644
--- a/Documentation/doc/Documentation/Preliminaries.txt
+++ b/Documentation/doc/Documentation/Preliminaries.txt
@@ -47,7 +47,7 @@ also avoid CMake to link with the native threads support library on your system.
Much of the \cgal code contains assert statements for preconditions, and postconditions of functions
as well as in the code. These assertions can be switched on and off per package
-and the user can change the error behaviour. For details see Section \ref secchecks
+and the user can change the error behavior. For details see Section \ref secchecks
of Chapter \ref Chapter_STL_Extensions_for_CGAL.
\section Preliminaries_flags Compile-time Flags to Control Inlining
diff --git a/Documentation/doc/Documentation/Third_party.txt b/Documentation/doc/Documentation/Third_party.txt
index d56b8484a15..c62e06bf505 100644
--- a/Documentation/doc/Documentation/Third_party.txt
+++ b/Documentation/doc/Documentation/Third_party.txt
@@ -15,7 +15,7 @@ supporting C++17 or later.
| | `Clang` \cgalFootnote{\cgalFootnoteCode{https://clang.llvm.org/}} compiler version 15.0.7 |
| \ms Windows | \gnu `g++` 11.4.0 or later\cgalFootnote{\cgalFootnoteCode{https://gcc.gnu.org/}} |
| | \ms Visual `C++` 15.9, 16.10, 17.0 (\visualstudio 2017, 2019, and 2022)\cgalFootnote{\cgalFootnoteCode{https://visualstudio.microsoft.com/}} |
-| MacOS X | \gnu `g++` 11.4.0 or later\cgalFootnote{\cgalFootnoteCode{https://gcc.gnu.org/}} |
+| macOS | \gnu `g++` 11.4.0 or later\cgalFootnote{\cgalFootnoteCode{https://gcc.gnu.org/}} |
| | Apple `Clang` compiler versions 10.0.1, 12.0.5, and 15.0.0 |
@@ -72,23 +72,32 @@ As there is no canonical directory for where to find \boost on Windows,
we recommend that you define the environment variable
`BOOST_ROOT` and set it to where you have installed \boost, e.g., `C:\boost\boost_1_70_0`.
-\subsection thirdpartyMPFR GNU Multiple Precision Arithmetic (GMP) and GNU Multiple Precision Floating-Point Reliably (MPFR) Libraries
-GMP Version 5.0.1 or later, MPFR Version 3.0.0 or later
+\subsection thirdpartyMP Multi Precision Number Type Library
-The components \cgal, `CGAL_Core`, and `CGAL_Qt6` require
-\gmp and \mpfr which are libraries for multi precision integers and rational numbers,
-and for multi precision floating point numbers.
-
-\cgal combines floating point arithmetic with exact arithmetic
-in order to be efficient and reliable. \cgal has a built-in
-number type for that, but \gmp and \mpfr provide a faster
-solution, and we recommend using them.
+GNU Multiple Precision Arithmetic (GMP) and GNU Multiple Precision Floating-Point Reliably (MPFR) Libraries
+are libraries for multi precision integers and rational numbers, and for multi precision floating point numbers.
These libraries can be obtained from `https://gmplib.org/`
and `https://www.mpfr.org/`.
Since Visual \cpp is not properly supported by the \gmp and \mpfr projects,
we provide precompiled versions of \gmp and \mpfr, which can be downloaded
from the assets of a release.
+Version supported are GMP Version 5.0.1 or later, MPFR Version 3.0.0 or later.
+
+The \boost library also provides a module for multi precision integers and rational numbers:
+\boost multiprecision.
+Versions supported are \boost Version 1.72 or later.
+
+The components \cgal, and `CGAL_Qt6` require either \gmp and \mpfr, or \boost multiprecision
+for multi precision numbers. `CGAL_Core` requires \boost multiprecision.
+
+\cgal combines floating point arithmetic with exact arithmetic
+in order to be efficient and reliable. \cgal has a built-in
+number type for that, but previous alternatives are faster
+solutions, and we recommend using one of them.
+
+The CMake variable `CGAL_CMAKE_EXACT_NT_BACKEND` can be used to select
+the library that will be used internally for multi precision number types.
\section secoptional3rdpartysoftware Optional Third Party Libraries
@@ -226,9 +235,8 @@ imported target `CGAL::LASLIB_support` provided in
\laslib information can be obtained from
https://lastools.github.io/ and
https://rapidlasso.de/product-overview/.
-\laslib is usually distributed along with LAStools: for simplicity, \cgal
-provides a fork with a
-CMake based install procedure.
+\laslib is usually distributed along with LAStools. Current versions of \laslib provide CMake support.
+BUILD_SHARED_LIBS needs to be set to true on windows to create a dynamic linked library.
\subsection thirdpartyOpenCV OpenCV
diff --git a/Documentation/doc/Documentation/Tutorials/Tutorial_GIS.txt b/Documentation/doc/Documentation/Tutorials/Tutorial_GIS.txt
index 9ac43d3eb53..546e53c7cd8 100644
--- a/Documentation/doc/Documentation/Tutorials/Tutorial_GIS.txt
+++ b/Documentation/doc/Documentation/Tutorials/Tutorial_GIS.txt
@@ -193,7 +193,7 @@ An example of a raster image with a rainbow ramp representing height
is given in \cgalFigureRef{TutorialGISFigRastering}.
\cgalFigureBegin{TutorialGISFigRastering, raster.jpg}
-Raster visualisation of height using a rainbow ramp, ranging from
+Raster visualization of height using a rainbow ramp, ranging from
light blue for low values to dark red for high values.
\cgalFigureEnd
diff --git a/Documentation/doc/Documentation/Usage.txt b/Documentation/doc/Documentation/Usage.txt
index 68a3ae85001..8547affb691 100644
--- a/Documentation/doc/Documentation/Usage.txt
+++ b/Documentation/doc/Documentation/Usage.txt
@@ -36,7 +36,7 @@ Using \cgal requires a few core components to be previously installed:
a supported compiler (see Section \ref seccompilers),
\ref seccmake,
\ref thirdpartyBoost,
- \ref thirdpartyMPFR.
+ a \ref thirdpartyMP.
Optional third-party software might be required to build examples and demos shipped with \cgal,
diff --git a/Documentation/doc/Documentation/main.txt b/Documentation/doc/Documentation/main.txt
index 2026356b76c..acb38973dad 100644
--- a/Documentation/doc/Documentation/main.txt
+++ b/Documentation/doc/Documentation/main.txt
@@ -38,7 +38,7 @@ other contexts can be done by obtaining a commercial license from
[GeometryFactory](https://www.geometryfactory.com). For more details
see the \ref license "License" page.
-Acknowledgement
+Acknowledgment
We provide bibtex entries for each package so that you can cite \cgal correctly in your publications,
see the page \ref how_to_cite_cgal.
diff --git a/Documentation/doc/Documentation/windows.txt b/Documentation/doc/Documentation/windows.txt
index c7d613e5c3a..b0b8875c2ee 100644
--- a/Documentation/doc/Documentation/windows.txt
+++ b/Documentation/doc/Documentation/windows.txt
@@ -6,7 +6,7 @@
15.9, 16.0, 17.0 (\visualstudio 2017, 2019, and 2022).
\cgal is a library that has mandatory dependencies that must be first installed:
-\ref thirdpartyBoost and \ref thirdpartyMPFR.
+\ref thirdpartyBoost and a \ref thirdpartyMP.
You have two options to install \cgal and its dependencies: you can either use
the *Vcpkg library manager*, which will automatically install an appropriate version of
diff --git a/Documentation/doc/biblio/cgal_manual.bib b/Documentation/doc/biblio/cgal_manual.bib
index 7378480ed0e..3f0f258a870 100644
--- a/Documentation/doc/biblio/cgal_manual.bib
+++ b/Documentation/doc/biblio/cgal_manual.bib
@@ -1545,17 +1545,6 @@ Voronoi diagram"
,update = "97.04 kettner"
}
-@article{cgal:l-lsqp-82,
- title={Least squares quantization in PCM},
- author={Lloyd, Stuart},
- journal={IEEE transactions on information theory},
- volume={28},
- number={2},
- pages={129--137},
- year={1982},
- publisher={IEEE}
-}
-
@InProceedings{ cgal:lprm-lscm-02,
author = {Bruno L{\'e}vy and Sylvain Petitjean and Nicolas Ray
and J{\'e}rome Maillot},
@@ -2794,7 +2783,7 @@ author = "Pedro M.M. de Castro and Frederic Cazals and Sebastien Loriot and Moni
editor = "Jacob E. Goodman, J\'anos Pach and Emo Welzl",
year = {2005},
pages = {439-458},
- URL = {http://library.slmath.org/books/Book52/files/23liu.pdf},
+ URL = {https://library.slmath.org/books/Book52/files/23liu.pdf},
publisher = {MSRI Publications}
}
diff --git a/Documentation/doc/biblio/geom.bib b/Documentation/doc/biblio/geom.bib
index d6b9488ec1f..30ee53b25c4 100644
--- a/Documentation/doc/biblio/geom.bib
+++ b/Documentation/doc/biblio/geom.bib
@@ -9513,7 +9513,7 @@ sites with respect to the geodesic metric within a simple $n$-sided polygon."
, number = 1
, year = 1993
, pages = "27--35"
-, keywords = "polygon, triagulation"
+, keywords = "polygon, triangulation"
, update = "95.05 korneenko"
}
@@ -92400,7 +92400,7 @@ some 2 curves cross exponentially many times."
@inproceedings{kn-afrmt-97
, author = "Yoshiyuki Kusakari and Takao Nishizeki"
-, title = "An Algorithm for Finding a Region with the Minimum Total {$L_1$}-Distance from Prescibed Terminals"
+, title = "An Algorithm for Finding a Region with the Minimum Total {$L_1$}-Distance from Prescribed Terminals"
, booktitle = "Proc. 8th Annu. Internat. Sympos. Algorithms Comput."
, nickname = "ISAAC '97"
, site = "Singapore"
@@ -101937,7 +101937,7 @@ used in many computational geometry algorithms. Contains C++ code."
@inproceedings{mp-drlvd-84
, author = "T. Matsuyama and T. Phillips"
-, title = "Digital Realization of the Labelled {Voronoi} Diagram and its Application to Closed Boundary Detection"
+, title = "Digital Realization of the Labeled {Voronoi} Diagram and its Application to Closed Boundary Detection"
, booktitle = "Proc. IEEE Internat. Conf. Pattern Recogn."
, year = 1984
, pages = "478--480"
@@ -116182,7 +116182,7 @@ dither and stipple patterns."
@techreport{plvt-edecl-96
, author = "P. Parodi and R. Lancewicki and A. Vijh and J. K. Tsotsos"
-, title = "Empirically-derived Estimates of the Complexity of Labelling Line Drawings of Polyhedral Scenes"
+, title = "Empirically-derived Estimates of the Complexity of Labeling Line Drawings of Polyhedral Scenes"
, number = "RBCV-TR-96-52"
, institution = "Dept. Comput. Sci., Univ. Toronto"
, address = "Toronto, ON"
@@ -116759,7 +116759,7 @@ dither and stipple patterns."
@article{p-rflg-72
, author = "T. Pavlidis"
-, title = "Representation of figures by labelled graphs"
+, title = "Representation of figures by labeled graphs"
, journal = "Pattern Recogn."
, volume = 4
, year = 1972
@@ -133630,7 +133630,7 @@ Contains C code."
@inproceedings{sc-aipta-86
, author = "J. K. Sircar and J. A. Cerbrian"
-, title = "Application of image processing techniques to the automated labelling of raster digitized contours"
+, title = "Application of image processing techniques to the automated labeling of raster digitized contours"
, booktitle = "Proc. 2nd Internat. Sympos. Spatial Data Handling"
, year = 1986
, pages = "171--184"
@@ -151991,7 +151991,7 @@ month = {jun},
articleno = {156},
numpages = {14},
keywords = {polygonal surface mesh, Surface reconstruction, kinetic framework, surface approximation}
-}
+}
@article{levismooth,
title={Smooth Rotation Enhanced As-Rigid-As-Possible Mesh Animation},
diff --git a/Documentation/doc/resources/1.10.0/menu_version.js b/Documentation/doc/resources/1.10.0/menu_version.js
index 5b8d97efba0..74c82c3d818 100644
--- a/Documentation/doc/resources/1.10.0/menu_version.js
+++ b/Documentation/doc/resources/1.10.0/menu_version.js
@@ -5,29 +5,29 @@
var url_local = /.*\/doc_output\//;
var current_version_local = 'master'
var all_versions = [
- 'master',
- '6.0-beta1',
- '5.6.1',
- 'latest',
- '5.5.4',
- '5.4.4',
- '5.3.2',
- '5.2.4',
- '5.1.5',
- '5.0.4',
- '4.14.3',
- '4.13.2',
- '4.12.2',
- '4.11.3',
- '4.10.2',
- '4.9.1',
- '4.8.2',
- '4.7',
- '4.6.3',
- '4.5.2',
- '4.4',
- '4.3'
- ];
+ 'master',
+ '6.0',
+ 'latest',
+ '5.6.1',
+ '5.5.4',
+ '5.4.5',
+ '5.3.2',
+ '5.2.4',
+ '5.1.5',
+ '5.0.4',
+ '4.14.3',
+ '4.13.2',
+ '4.12.2',
+ '4.11.3',
+ '4.10.2',
+ '4.9.1',
+ '4.8.2',
+ '4.7',
+ '4.6.3',
+ '4.5.2',
+ '4.4',
+ '4.3'
+];
function build_select(current_version) {
if( current_version == 'master') {
diff --git a/Documentation/doc/resources/1.8.13/menu_version.js b/Documentation/doc/resources/1.8.13/menu_version.js
index 5b8d97efba0..74c82c3d818 100644
--- a/Documentation/doc/resources/1.8.13/menu_version.js
+++ b/Documentation/doc/resources/1.8.13/menu_version.js
@@ -5,29 +5,29 @@
var url_local = /.*\/doc_output\//;
var current_version_local = 'master'
var all_versions = [
- 'master',
- '6.0-beta1',
- '5.6.1',
- 'latest',
- '5.5.4',
- '5.4.4',
- '5.3.2',
- '5.2.4',
- '5.1.5',
- '5.0.4',
- '4.14.3',
- '4.13.2',
- '4.12.2',
- '4.11.3',
- '4.10.2',
- '4.9.1',
- '4.8.2',
- '4.7',
- '4.6.3',
- '4.5.2',
- '4.4',
- '4.3'
- ];
+ 'master',
+ '6.0',
+ 'latest',
+ '5.6.1',
+ '5.5.4',
+ '5.4.5',
+ '5.3.2',
+ '5.2.4',
+ '5.1.5',
+ '5.0.4',
+ '4.14.3',
+ '4.13.2',
+ '4.12.2',
+ '4.11.3',
+ '4.10.2',
+ '4.9.1',
+ '4.8.2',
+ '4.7',
+ '4.6.3',
+ '4.5.2',
+ '4.4',
+ '4.3'
+];
function build_select(current_version) {
if( current_version == 'master') {
diff --git a/Documentation/doc/resources/1.9.6/menu_version.js b/Documentation/doc/resources/1.9.6/menu_version.js
index 5b8d97efba0..74c82c3d818 100644
--- a/Documentation/doc/resources/1.9.6/menu_version.js
+++ b/Documentation/doc/resources/1.9.6/menu_version.js
@@ -5,29 +5,29 @@
var url_local = /.*\/doc_output\//;
var current_version_local = 'master'
var all_versions = [
- 'master',
- '6.0-beta1',
- '5.6.1',
- 'latest',
- '5.5.4',
- '5.4.4',
- '5.3.2',
- '5.2.4',
- '5.1.5',
- '5.0.4',
- '4.14.3',
- '4.13.2',
- '4.12.2',
- '4.11.3',
- '4.10.2',
- '4.9.1',
- '4.8.2',
- '4.7',
- '4.6.3',
- '4.5.2',
- '4.4',
- '4.3'
- ];
+ 'master',
+ '6.0',
+ 'latest',
+ '5.6.1',
+ '5.5.4',
+ '5.4.5',
+ '5.3.2',
+ '5.2.4',
+ '5.1.5',
+ '5.0.4',
+ '4.14.3',
+ '4.13.2',
+ '4.12.2',
+ '4.11.3',
+ '4.10.2',
+ '4.9.1',
+ '4.8.2',
+ '4.7',
+ '4.6.3',
+ '4.5.2',
+ '4.4',
+ '4.3'
+];
function build_select(current_version) {
if( current_version == 'master') {
diff --git a/Documentation/doc/scripts/generate_how_to_cite.py b/Documentation/doc/scripts/generate_how_to_cite.py
index ece849f18a9..409678ebb91 100644
--- a/Documentation/doc/scripts/generate_how_to_cite.py
+++ b/Documentation/doc/scripts/generate_how_to_cite.py
@@ -65,7 +65,7 @@ If you want to refer to \cgal manual, please cite the appropriate
The \cgal Project.
\cgal User and Reference Manual.
\cgal Editorial Board, ${CGAL_CREATED_VERSION_NUM} edition, ${CGAL_BUILD_YEAR4}.
-[ bib |
+[ bib |
http ]
|
@@ -160,7 +160,7 @@ def gen_txt_entry(title, authors, bib, anchor, k):
+ '.\n\
In \\cgal User and Reference Manual. \\cgal Editorial Board,\n\
${CGAL_CREATED_VERSION_NUM} edition, ${CGAL_BUILD_YEAR4}.\n\
-[ [ bib | \n\
addAboutCGAL();
+#if QT_SVG_LIB
this->setupExportSVG(action_Export_SVG, graphicsView);
+#endif
this->addRecentFiles(this->menuFile, this->actionQuit);
connect(this, SIGNAL(openRecentFile(QString)),
diff --git a/GraphicsView/demo/Triangulation_2/Constrained_Delaunay_triangulation_2.cpp b/GraphicsView/demo/Triangulation_2/Constrained_Delaunay_triangulation_2.cpp
index 076ad27660b..a83a3030f51 100644
--- a/GraphicsView/demo/Triangulation_2/Constrained_Delaunay_triangulation_2.cpp
+++ b/GraphicsView/demo/Triangulation_2/Constrained_Delaunay_triangulation_2.cpp
@@ -339,7 +339,9 @@ MainWindow::MainWindow()
this->setupOptionsMenu();
this->addAboutDemo(":/cgal/help/about_Constrained_Delaunay_triangulation_2.html");
this->addAboutCGAL();
+#if QT_SVG_LIB
this->setupExportSVG(this->actionExport_SVG, this->graphicsView);
+#endif
this->addRecentFiles(this->menuFile, this->actionQuit);
connect(this, SIGNAL(openRecentFile(QString)),
diff --git a/GraphicsView/demo/Triangulation_2/Delaunay_triangulation_2.cpp b/GraphicsView/demo/Triangulation_2/Delaunay_triangulation_2.cpp
index 55a11c0171b..15c35df4308 100644
--- a/GraphicsView/demo/Triangulation_2/Delaunay_triangulation_2.cpp
+++ b/GraphicsView/demo/Triangulation_2/Delaunay_triangulation_2.cpp
@@ -179,7 +179,9 @@ MainWindow::MainWindow()
this->setupOptionsMenu();
this->addAboutDemo(":/cgal/help/about_Delaunay_triangulation_2.html");
this->addAboutCGAL();
+#if QT_SVG_LIB
this->setupExportSVG(actionExport_SVG, graphicsView);
+#endif
this->addRecentFiles(this->menuFile, this->actionQuit);
connect(this, SIGNAL(openRecentFile(QString)),
diff --git a/GraphicsView/demo/Triangulation_2/include/CGAL/Lipschitz_sizing_field_criteria_2.h b/GraphicsView/demo/Triangulation_2/include/CGAL/Lipschitz_sizing_field_criteria_2.h
index ad844db31ac..1df267ad955 100644
--- a/GraphicsView/demo/Triangulation_2/include/CGAL/Lipschitz_sizing_field_criteria_2.h
+++ b/GraphicsView/demo/Triangulation_2/include/CGAL/Lipschitz_sizing_field_criteria_2.h
@@ -62,7 +62,7 @@ public:
const double& size() const { return second; }
const double& sine() const { return first; }
- // q1pivotPoint(); }
/*! Sets the Camera's position() and orientation() from an OpenGL ModelView
matrix.
-This enables a Camera initialisation from an other OpenGL application. \p
+This enables a Camera initialization from an other OpenGL application. \p
modelView is a 16 GLdouble vector representing a valid OpenGL ModelView matrix,
such as one can get using: \code GLdouble mvm[16];
glGetDoublev(GL_MODELVIEW_MATRIX, mvm);
diff --git a/GraphicsView/include/CGAL/Qt/manipulatedFrame.h b/GraphicsView/include/CGAL/Qt/manipulatedFrame.h
index b763a646580..52cc92105ba 100644
--- a/GraphicsView/include/CGAL/Qt/manipulatedFrame.h
+++ b/GraphicsView/include/CGAL/Qt/manipulatedFrame.h
@@ -270,13 +270,11 @@ private Q_SLOTS:
/*! @name Mouse event handlers */
//@{
protected:
- virtual void mousePressEvent(QMouseEvent *const event, Camera *const camera);
- virtual void mouseMoveEvent(QMouseEvent *const event, Camera *const camera);
- virtual void mouseReleaseEvent(QMouseEvent *const event,
- Camera *const camera);
- virtual void mouseDoubleClickEvent(QMouseEvent *const event,
- Camera *const camera);
- virtual void wheelEvent(QWheelEvent *const event, Camera *const camera);
+ void mousePressEvent (QMouseEvent *const event, Camera *const camera) override;
+ void mouseMoveEvent (QMouseEvent *const event, Camera *const camera) override;
+ void mouseReleaseEvent (QMouseEvent *const event, Camera *const camera) override;
+ void mouseDoubleClickEvent(QMouseEvent *const event, Camera *const camera) override;
+ void wheelEvent(QWheelEvent *const event, Camera *const camera) override;
//@}
public:
@@ -299,7 +297,7 @@ public:
/*! @name MouseGrabber implementation */
//@{
public:
- virtual void checkIfGrabsMouse(int x, int y, const Camera *const camera);
+ void checkIfGrabsMouse(int x, int y, const Camera *const camera) override;
//@}
#ifndef DOXYGEN
diff --git a/GraphicsView/include/CGAL/Qt/qglviewer.h b/GraphicsView/include/CGAL/Qt/qglviewer.h
index 8ee3b4135f2..e24a5fcd6d7 100644
--- a/GraphicsView/include/CGAL/Qt/qglviewer.h
+++ b/GraphicsView/include/CGAL/Qt/qglviewer.h
@@ -478,7 +478,6 @@ public:
qreal bufferTextureMaxU() const { return bufferTextureMaxU_; }
/*! Same as bufferTextureMaxU(), but for the v texture coordinate. */
qreal bufferTextureMaxV() const { return bufferTextureMaxV_; }
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 4, 0))
// These methods are part of the QGLWidget public API.
// As of version 2.7.0, the use of QOpenGLWidget instead means that they have
// to be provided for backward compatibility.
@@ -486,7 +485,6 @@ public:
const QFont &font = QFont());
void renderText(double x, double y, double z, const QString &str,
const QFont &font = QFont());
-#endif
public Q_SLOTS:
void copyBufferToTexture(GLint, GLenum = GL_NONE);
diff --git a/GraphicsView/include/CGAL/Qt/qglviewer_impl.h b/GraphicsView/include/CGAL/Qt/qglviewer_impl.h
index 7387b1f4874..01e8a68433d 100644
--- a/GraphicsView/include/CGAL/Qt/qglviewer_impl.h
+++ b/GraphicsView/include/CGAL/Qt/qglviewer_impl.h
@@ -354,7 +354,6 @@ camera is manipulated) : main drawing method. Should be overloaded. \arg
postDraw() : display of visual hints (world axis, FPS...) */
CGAL_INLINE_FUNCTION
void CGAL::QGLViewer::paintGL() {
- makeCurrent();
// Clears screen, set model view matrix...
preDraw();
// Used defined method. Default calls draw()
@@ -364,7 +363,6 @@ void CGAL::QGLViewer::paintGL() {
draw();
// Add visual hints: axis, camera, grid...
postDraw();
- doneCurrent();
Q_EMIT drawFinished(true);
}
@@ -720,7 +718,6 @@ CGAL_INLINE_FUNCTION
void CGAL::QGLViewer::drawLight(GLenum, qreal ) const {
}
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 4, 0))
CGAL_INLINE_FUNCTION
void CGAL::QGLViewer::renderText(int x, int y, const QString &str,
const QFont &font) {
@@ -742,7 +739,6 @@ void CGAL::QGLViewer::renderText(double x, double y, double z, const QString &st
const Vec proj = camera_->projectedCoordinatesOf(Vec(x, y, z));
renderText(int(proj.x), int(proj.y), str, font);
}
-#endif
/*! Draws \p text at position \p x, \p y (expressed in screen coordinates
pixels, origin in the upper left corner of the widget).
diff --git a/HalfedgeDS/include/CGAL/HalfedgeDS_vector.h b/HalfedgeDS/include/CGAL/HalfedgeDS_vector.h
index f13214b9bf9..871a27e9179 100644
--- a/HalfedgeDS/include/CGAL/HalfedgeDS_vector.h
+++ b/HalfedgeDS/include/CGAL/HalfedgeDS_vector.h
@@ -604,7 +604,7 @@ public:
// This guard is needed here because, rr==ll==begin, might be true
// at this point, causing the decrement to result in undefined
- // behaviour.
+ // behavior.
// [Fernando Cacciola]
if ( ll < rr )
{
diff --git a/Hash_map/include/CGAL/Hash_map/internal/chained_map.h b/Hash_map/include/CGAL/Hash_map/internal/chained_map.h
index bea9b0993f0..785443e2bee 100644
--- a/Hash_map/include/CGAL/Hash_map/internal/chained_map.h
+++ b/Hash_map/include/CGAL/Hash_map/internal/chained_map.h
@@ -17,6 +17,7 @@
#define CGAL_HASH_MAP_INTERNAL_CHAINED_MAP_H
#include
+#include
#include
#include
#include
@@ -44,7 +45,7 @@ class chained_map
chained_map_elem* table;
chained_map_elem* table_end;
- chained_map_elem* free;
+ chained_map_elem* freelist;
std::size_t table_size;
std::size_t table_size_1;
@@ -143,10 +144,10 @@ void chained_map::init_table(std::size_t n)
std::allocator_traits::construct(alloc,table + i);
}
- free = table + t;
+ freelist = table + t;
table_end = table + t + t/2;
- for (Item p = table; p < free; ++p)
+ for (Item p = table; p < freelist; ++p)
{ p->succ = nullptr;
p->k = nullkey;
}
@@ -160,10 +161,10 @@ inline void chained_map::insert(std::size_t x, T y)
q->k = x;
q->i = y;
} else {
- free->k = x;
- free->i = y;
- free->succ = q->succ;
- q->succ = free++;
+ freelist->k = x;
+ freelist->i = y;
+ freelist->succ = q->succ;
+ q->succ = freelist++;
}
}
@@ -213,7 +214,7 @@ T& chained_map::access(Item p, std::size_t x)
// index x not present, insert it
- if (free == table_end) // table full: rehash
+ if (freelist == table_end) // table full: rehash
{ rehash();
p = HASH(x);
}
@@ -224,7 +225,7 @@ T& chained_map::access(Item p, std::size_t x)
return p->i;
}
- q = free++;
+ q = freelist++;
q->k = x;
init_inf(q->i); // initializes q->i to xdef
q->succ = p->succ;
@@ -245,7 +246,7 @@ chained_map::chained_map(const chained_map& D)
{
init_table(D.table_size);
- for(Item p = D.table; p < D.free; ++p)
+ for(Item p = D.table; p < D.freelist; ++p)
{ if (p->k != nullkey || p >= D.table + D.table_size)
{ insert(p->k,p->i);
//D.copy_inf(p->i); // see chapter Implementation
@@ -257,7 +258,7 @@ chained_map::chained_map(chained_map&& D)
noexcept(std::is_nothrow_move_constructible_v && std::is_nothrow_move_constructible_v)
: table(std::exchange(D.table, nullptr))
, table_end(std::exchange(D.table_end, nullptr))
- , free(std::exchange(D.free, nullptr))
+ , freelist(std::exchange(D.freelist, nullptr))
, table_size(std::exchange(D.table_size, 0))
, table_size_1(std::exchange(D.table_size_1, 0))
, alloc(std::move(D.alloc))
@@ -272,7 +273,7 @@ chained_map& chained_map::operator=(const chained_ma
init_table(D.table_size);
- for(Item p = D.table; p < D.free; ++p)
+ for(Item p = D.table; p < D.freelist; ++p)
{ if (p->k != nullkey || p >= D.table + D.table_size)
{ insert(p->k,p->i);
//copy_inf(p->i); // see chapter Implementation
@@ -289,7 +290,7 @@ chained_map& chained_map::operator=(chained_map::statistics() const
std::size_t n = 0;
for (Item p = table; p < table + table_size; ++p)
if (p ->k != nullkey) ++n;
- std::size_t used_in_overflow = free - (table + table_size );
+ std::size_t used_in_overflow = freelist - (table + table_size );
n += used_in_overflow;
std::cout << "number of entries: " << n << "\n";
std::cout << "fraction of entries in first position: " <<
diff --git a/Hash_map/package_info/Hash_map/dependencies b/Hash_map/package_info/Hash_map/dependencies
index 25b30f26b79..b611de33d8e 100644
--- a/Hash_map/package_info/Hash_map/dependencies
+++ b/Hash_map/package_info/Hash_map/dependencies
@@ -1,3 +1,5 @@
Hash_map
Installation
+Kernel_23
+Profiling_tools
STL_Extension
diff --git a/Heat_method_3/include/CGAL/Heat_method_3/internal/Intrinsic_Delaunay_triangulation_3.h b/Heat_method_3/include/CGAL/Heat_method_3/internal/Intrinsic_Delaunay_triangulation_3.h
index 65d78512514..77a399704ec 100644
--- a/Heat_method_3/include/CGAL/Heat_method_3/internal/Intrinsic_Delaunay_triangulation_3.h
+++ b/Heat_method_3/include/CGAL/Heat_method_3/internal/Intrinsic_Delaunay_triangulation_3.h
@@ -25,7 +25,6 @@
#include
#include
#include
-#include
#include
#include
#include
diff --git a/Installation/.reuse/dep5 b/Installation/.reuse/dep5
deleted file mode 100644
index ef2e017a397..00000000000
--- a/Installation/.reuse/dep5
+++ /dev/null
@@ -1,12 +0,0 @@
-Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
-Upstream-Name: CGAL
-Upstream-Contact: CGAL Editorial Board
-Source: https://github.com/CGAL/cgal
-
-Files: *.cmake *.md doc/* doc_html/* scripts/* developer_scripts/* package_info/* demo/* examples/* src/* test/* benchmarks/* benchmark/* data/* cmake/*
-Copyright: 1995-2023 The CGAL Project
-License: CC0-1.0
-
-Files: include/CGAL/Qt/ImageInterface.ui include/CGAL/Qt/resources/qglviewer-icon.xpm AUTHORS CMakeLists.txt README auxiliary/cgal_create_cmake_script.1 auxiliary/gmp/README include/CGAL/license/gpl_package_list.txt auxiliary/cgal_app.icns copyright VERSION
-Copyright: 1995-2023 The CGAL Project
-License: CC0-1.0
diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md
index a8ddd38c1a1..f1b4b336cc3 100644
--- a/Installation/CHANGES.md
+++ b/Installation/CHANGES.md
@@ -1,8 +1,13 @@
# Release History
+## [Release 6.0.1](https://github.com/CGAL/cgal/releases/tag/v6.0.1)
+
+### [Poisson Surface Reconstruction](https://doc.cgal.org/6.0.1/Manual/packages.html#PkgPoissonSurfaceReconstruction3)
+- Made the implicit function thread-safe so that the parallel version of `make_mesh_3()` can be used.
+
## [Release 6.0](https://github.com/CGAL/cgal/releases/tag/v6.0)
-Release date: June 2024
+Release date: September 2024
### General Changes
@@ -13,6 +18,8 @@ Release date: June 2024
- LLVM Clang version 15.0.7 or later (on Linux)
- Apple Clang compiler versions 10.0.1, 12.0.5, and 15.0.0 (on macOS)
- The minimal supported version of Boost is now 1.72.0.
+- GMP/MPFR are no longer mandatory to use CGAL, [Boost.Multiprecision](https://www.boost.org/doc/libs/1_72_0/libs/multiprecision/doc/html/index.html).
+ can be used instead.
- The CGAL `Core` library is no longer based on GMP, but on
[Boost.Multiprecision](https://www.boost.org/doc/libs/1_72_0/libs/multiprecision/doc/html/index.html).
Either GMP backend or Boost backend can be used.
@@ -144,10 +151,6 @@ Release date: June 2024
to the [`GenericMap`](https://doc.cgal.org/6.0/Combinatorial_map/classGenericMap.html)
concept, which enables users to insert an edge between two different faces in order to create faces with holes.
-- Added new meshing criterion `edge_distance`, an upper bound for the distance from the edge to the 1D feature.
-- **Breaking change**: the concept `MeshEdgeCriteria_3` was modified to include the new meshing criterion `edge_distance`.
-
-
### [Quadtrees, Octrees, and Orthtrees](https://doc.cgal.org/6.0/Manual/packages.html#PkgOrthtree)
- **Breaking change**:
@@ -225,6 +228,9 @@ Release date: June 2024
as well as the class `Triangle_accessor`. These were no longer used for several releases.
- **Breaking change**: Removed the class templates `CGAL::Gray_image_mesh_domain_3`, `CGAL::Implicit_mesh_domain_3`,
and `CGAL::Labeled_image_mesh_domain_3`, which were deprecated since CGAL-4.13.
+- Added new meshing criterion `edge_distance`, an upper bound for the distance from the edge to the 1D feature.
+- **Breaking change**: the concept `MeshEdgeCriteria_3` was modified to include the new meshing criterion `edge_distance`.
+
### [3D Surface Mesh Generation](https://doc.cgal.org/6.0/Manual/packages.html#PkgSurfaceMesher3)
@@ -1914,7 +1920,7 @@ Release date: April 2018
after the observer is notified that the edge has been removed. This is
symmetric (opposite) to the order of notification when an edge is inserted.
- The user can restore old (non-symmetric) behaviour by defining the macro:
+ The user can restore old (non-symmetric) behavior by defining the macro:
`CGAL_NON_SYMETRICAL_OBSERVER_EDGE_REMOVAL_BACKWARD_COMPATIBILITY`
@@ -3455,7 +3461,7 @@ Release date: October 2013
vertices which would move of very small displacements.
- Introduce new data structures and options for speed-up and
compacity. Note that `Compact_mesh_cell_base_3` and
- `Mesh_vertex_base_3` are now our favoured implementations of the
+ `Mesh_vertex_base_3` are now our favored implementations of the
concepts MeshCellBase\_3 and MeshVertexBase\_3.
- Introduce a new constructor for `Polyhedral_mesh_domain_3` that
takes a bounding polyhedron to be meshed along with a polyhedral
@@ -4566,9 +4572,9 @@ fixes for this release.
- The new macro CGAL\_NO\_DEPRECATED\_CODE can be defined to disable
deprecated code, helping users discover if they rely on code that
may be removed in subsequent releases.
-- Assertion behaviour: It is not possible anymore to set the CONTINUE
+- Assertion behavior: It is not possible anymore to set the CONTINUE
mode for assertion failures. Functions that allow to change the
- assertion behaviour are now declared in
+ assertion behavior are now declared in
``.
- Qt3 based demos are still there but the documentation has been
removed as the CGAL::Qt\_Widget will be deprecated.
@@ -5117,7 +5123,7 @@ static runtime (/ML).
- 2D Placement of Streamlines (new package)
Visualizing vector fields is important for many application domains.
A good way to do it is to generate streamlines that describe the
- flow behaviour. This package implements the "Farthest Point Seeding"
+ flow behavior. This package implements the "Farthest Point Seeding"
algorithm for placing streamlines in 2D vector fields. It generates
a list of streamlines corresponding to an input flow using a
specified separating distance. The algorithm uses a Delaunay
@@ -5139,7 +5145,7 @@ static runtime (/ML).
structures. The package supports exact or inexact operations on
primitives which move along polynomial trajectories.
- Smallest Enclosing Ellipsoid (new package)
- This algorithm is new in the chapter Geometric Optimisation.
+ This algorithm is new in the chapter Geometric Optimization.
- 2D Arrangement (major revision)
This package can be used to construct, maintain, alter, and display
arrangements in the plane. Once an arrangement is constructed, the
@@ -5154,9 +5160,9 @@ static runtime (/ML).
construction history of the arrangement, such that it is possible to
obtain the originating curve of an arrangement subcurve.
-- Geometric Optimisation (major revision)
+- Geometric Optimization (major revision)
The underlying QP solver which is the foundation for several
- algorithms in the Geometric Optimisation chapter has been completely
+ algorithms in the Geometric Optimization chapter has been completely
rewritten.
- 3D Triangulation (new functionality)
Regular\_triangulation\_3 now offers vertex removal.
@@ -5482,7 +5488,7 @@ The following functionality has been added or changed:
Face\_handle or Vertex\_handle.
- New classes Triangulation\_vertex\_base\_with\_info\_2 (and 3)
and Triangulation\_face\_base\_with\_info\_2 (and 3) to make
- easier the customisation of base classes in most cases.
+ easier the customization of base classes in most cases.
- 2D Triangulation
- Regular triangulation provides an easy access to hidden points.
- The Triangulation\_hierarchy\_2, which provide an efficient
@@ -5984,7 +5990,7 @@ kernels themselves can be used as traits classes in many instances.
- The traits class requirements have been changed.
- The simplicity test has a completely new implementation.
- Properties like convexity, simplicity and area can now be cached
- by polygons. You need to set a flag to select this behaviour.
+ by polygons. You need to set a flag to select this behavior.
@@ -6157,7 +6163,7 @@ The following functionality has been added:
stored within a class, debugging is easier using this kernel. This
kernel can also be faster in some cases than the reference-counted
Cartesian kernel.
-- New optimisation algorithms
+- New optimization algorithms
- Min\_annulus\_d - Algorithm for computing the smallest enclosing
annulus of points in arbitrary dimension
- Polytope\_distance\_d - Algorithm for computing the (squared)
@@ -6214,7 +6220,7 @@ The following functionality has been added:
triangulations.
- Triangulations in 3D were added, both Delaunay triangulations and
regular triangulations.
-- Min\_quadrilateral optimisations have been added. These are
+- Min\_quadrilateral optimizations have been added. These are
algorithms to compute the minimum enclosing rectangle/parallelogram
(arbitrary orientation) and the minimum enclosing strip of a convex
point set.
diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt
index c5df6f680c6..11ade3231f1 100644
--- a/Installation/CMakeLists.txt
+++ b/Installation/CMakeLists.txt
@@ -480,8 +480,11 @@ if(CMAKE_COMPILER_IS_GNUCXX)
endif()
-message("== Generate version files (DONE) ==\n")
+if(CGAL_TEST_SUITE)
+ include(display-third-party-libs-versions)
+endif()
+message("== Generate version files (DONE) ==\n")
#--------------------------------------------------------------------------------------------------
#
# -= External libraries =-
@@ -934,7 +937,7 @@ if(CGAL_BRANCH_BUILD)
find_package(Doxygen REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(Qt6 COMPONENTS Core Widgets OpenGL Gui REQUIRED)
- find_package(VTK COMPONENTS vtkImagingGeneral vtkIOImage NO_MODULE)
+ find_package(VTK COMPONENTS ImagingGeneral IOImage NO_MODULE)
if(VTK_FOUND)
get_target_property(VTK_INCLUDE_DIRS VTK::IOImage INTERFACE_INCLUDE_DIRECTORIES)
endif()
diff --git a/Installation/REUSE.toml b/Installation/REUSE.toml
new file mode 100644
index 00000000000..34a4baee435
--- /dev/null
+++ b/Installation/REUSE.toml
@@ -0,0 +1,47 @@
+version = 1
+SPDX-PackageName = "CGAL"
+SPDX-PackageSupplier = "CGAL Editorial Board "
+SPDX-PackageDownloadLocation = "https://github.com/CGAL/cgal"
+
+[[annotations]]
+path = [
+ "**.cmake",
+ "**.md",
+ "doc/**",
+ "doc_html/**",
+ "scripts/**",
+ "developer_scripts/**",
+ "package_info/**",
+ "demo/**",
+ "examples/**",
+ "src/**",
+ "test/**",
+ "benchmarks/**",
+ "benchmark/**",
+ "data/**",
+ "cmake/**",
+ "**/*.natvis",
+]
+precedence = "aggregate"
+SPDX-FileCopyrightText = "1995-2024 The CGAL Project"
+SPDX-License-Identifier = "CC0-1.0"
+
+[[annotations]]
+path = [
+ "REUSE.toml",
+ "lib/cmake/CGAL/CGALConfig-installation-dirs.cmake.in",
+ "include/CGAL/Qt/ImageInterface.ui",
+ "include/CGAL/Qt/resources/qglviewer-icon.xpm",
+ "AUTHORS",
+ "CMakeLists.txt",
+ "README",
+ "auxiliary/cgal_create_cmake_script.1",
+ "auxiliary/gmp/README",
+ "include/CGAL/license/gpl_package_list.txt",
+ "auxiliary/cgal_app.icns",
+ "copyright",
+ "VERSION",
+]
+precedence = "aggregate"
+SPDX-FileCopyrightText = "1995-2024 The CGAL Project"
+SPDX-License-Identifier = "CC0-1.0"
diff --git a/Installation/cmake/modules/CGAL_LASLIB_support.cmake b/Installation/cmake/modules/CGAL_LASLIB_support.cmake
index 7c65da9ebf0..e471c93f02b 100644
--- a/Installation/cmake/modules/CGAL_LASLIB_support.cmake
+++ b/Installation/cmake/modules/CGAL_LASLIB_support.cmake
@@ -1,8 +1,19 @@
-if(LASLIB_FOUND AND NOT TARGET CGAL::LASLIB_support)
- add_library(CGAL::LASLIB_support INTERFACE IMPORTED)
- set_target_properties(CGAL::LASLIB_support PROPERTIES
- INTERFACE_COMPILE_DEFINITIONS "CGAL_LINKED_WITH_LASLIB"
- INTERFACE_INCLUDE_DIRECTORIES "${LASLIB_INCLUDE_DIR};${LASZIP_INCLUDE_DIR}"
- INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${LASLIB_INCLUDE_DIR};${LASZIP_INCLUDE_DIR}"
- INTERFACE_LINK_LIBRARIES "${LASLIB_LIBRARIES}")
+if(LASLIB_FOUND)
+ if (NOT TARGET CGAL::LASLIB_support)
+ if (NOT TARGET LASlib)
+ # message(STATUS "Found using MODULE mode")
+ add_library(CGAL::LASLIB_support INTERFACE IMPORTED)
+ set_target_properties(CGAL::LASLIB_support PROPERTIES
+ INTERFACE_COMPILE_DEFINITIONS "CGAL_LINKED_WITH_LASLIB"
+ INTERFACE_INCLUDE_DIRECTORIES "${LASLIB_INCLUDE_DIR}"
+ INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${LASLIB_INCLUDE_DIR}"
+ INTERFACE_LINK_LIBRARIES "${LASLIB_LIBRARIES}")
+ else()
+ # message(STATUS "Found using CONFIG mode")
+ add_library(CGAL::LASLIB_support INTERFACE IMPORTED)
+ set_target_properties(CGAL::LASLIB_support PROPERTIES
+ INTERFACE_COMPILE_DEFINITIONS "CGAL_LINKED_WITH_LASLIB")
+ target_link_libraries(CGAL::LASLIB_support INTERFACE LASlib)
+ endif()
+ endif()
endif()
diff --git a/Installation/cmake/modules/CGAL_OpenMesh_support.cmake b/Installation/cmake/modules/CGAL_OpenMesh_support.cmake
new file mode 100644
index 00000000000..97df95c8115
--- /dev/null
+++ b/Installation/cmake/modules/CGAL_OpenMesh_support.cmake
@@ -0,0 +1,17 @@
+
+if(OpenMesh_FOUND AND NOT TARGET CGAL::OpenMesh_support)
+
+ add_library(CGAL::OpenMesh_support INTERFACE IMPORTED)
+
+ if(TARGET OpenMeshCore)
+ target_link_libraries(CGAL::OpenMesh_support INTERFACE OpenMeshCore)
+ endif()
+
+ if(TARGET OpenMeshTools)
+ target_link_libraries(CGAL::OpenMesh_support INTERFACE OpenMeshTools)
+ endif()
+
+ target_compile_definitions(CGAL::OpenMesh_support
+ INTERFACE "CGAL_USE_OPENMESH;NOMINMAX;_USE_MATH_DEFINES")
+
+endif()
diff --git a/Installation/cmake/modules/FindCORE.cmake b/Installation/cmake/modules/FindCORE.cmake
index 6effa1d5e52..adb2ad05f15 100644
--- a/Installation/cmake/modules/FindCORE.cmake
+++ b/Installation/cmake/modules/FindCORE.cmake
@@ -3,8 +3,6 @@
# CORE_INCLUDE_DIR - the CORE include directory
# CORE_LIBRARIES - Libraries needed to use CORE
-# TODO: support Windows and MacOSX
-
# CORE needs GMP
include(FindPackageHandleStandardArgs)
@@ -17,7 +15,7 @@ if(GMP_FOUND)
find_path(CORE_INCLUDE_DIR NAMES CORE.h DOC "The directory containing the CORE include files")
find_library(CORE_LIBRARIES NAMES core++ DOC "Path to the core++ library")
-
+
get_filename_component(CORE_LIBRARIES_DIR ${CORE_LIBRARIES} PATH)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CORE "DEFAULT_MSG" CORE_LIBRARIES CORE_INCLUDE_DIR )
diff --git a/Installation/cmake/modules/FindGMP.cmake b/Installation/cmake/modules/FindGMP.cmake
index f452c0287f7..38108f3420a 100644
--- a/Installation/cmake/modules/FindGMP.cmake
+++ b/Installation/cmake/modules/FindGMP.cmake
@@ -5,8 +5,6 @@
# GMP_LIBRARIES_DIR - directory where the GMP libraries are located
# GMP_LIBRARIES - Link these to use GMP
-# TODO: support MacOSX
-
include(FindPackageHandleStandardArgs)
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_GeneratorSpecificSettings.cmake)
diff --git a/Installation/cmake/modules/FindGMPXX.cmake b/Installation/cmake/modules/FindGMPXX.cmake
index 277e4b19ef1..ce05fd70346 100644
--- a/Installation/cmake/modules/FindGMPXX.cmake
+++ b/Installation/cmake/modules/FindGMPXX.cmake
@@ -4,8 +4,6 @@
# GMPXX_INCLUDE_DIR - the GMPXX include directory
# GMPXX_LIBRARIES - Libraries needed to use GMPXX
-# TODO: support Windows and MacOSX
-
# GMPXX needs GMP
find_package( GMP QUIET )
diff --git a/Installation/cmake/modules/FindLASLIB.cmake b/Installation/cmake/modules/FindLASLIB.cmake
index 2353480c245..89a8d7fc693 100644
--- a/Installation/cmake/modules/FindLASLIB.cmake
+++ b/Installation/cmake/modules/FindLASLIB.cmake
@@ -9,14 +9,16 @@
# first look in user defined locations
find_path(LASLIB_INCLUDE_DIR
NAMES lasreader.hpp
- PATHS /usr/local/include/LASlib/
+ PATHS /usr/local/include/LASlib/
ENV LASLIB_INC_DIR
)
-
+
find_path(LASZIP_INCLUDE_DIR
NAMES mydefs.hpp
PATHS /usr/local/include/LASzip/
${LASLIB_INCLUDE_DIR}/../../LASzip/src
+ ${LASLIB_INCLUDE_DIR}/../LASzip
+ ${LASLIB_INCLUDE_DIR}
)
find_library(LASLIB_LIBRARIES
@@ -24,12 +26,27 @@ find_library(LASLIB_LIBRARIES
PATHS ENV LD_LIBRARY_PATH
ENV LIBRARY_PATH
/usr/local/lib
+ /usr/local/lib/LASlib
${LASLIB_INCLUDE_DIR}/../../lib
ENV LASLIB_LIB_DIR
)
+if (NOT LASLIB_LIBRARIES)
+ #library was renamed in recent versions of LAStools
+ find_library(LASLIB_LIBRARIES
+ NAMES LASlib
+ PATHS ENV LD_LIBRARY_PATH
+ ENV LIBRARY_PATH
+ /usr/local/lib
+ /usr/local/lib/LASlib
+ ${LASLIB_INCLUDE_DIR}/../../lib
+ ENV LASLIB_LIB_DIR
+ )
+endif()
-if(LASLIB_LIBRARIES AND LASLIB_INCLUDE_DIR)
+if(LASLIB_LIBRARIES AND LASLIB_INCLUDE_DIR AND LASZIP_INCLUDE_DIR)
+ if (NOT ${LASLIB_INCLUDE_DIR} STREQUAL ${LASZIP_INCLUDE_DIR})
+ list(APPEND LASLIB_INCLUDE_DIR ${LASZIP_INCLUDE_DIR})
+ endif()
set(LASLIB_FOUND TRUE)
set(LASLIB_USE_FILE "UseLASLIB")
endif()
-
diff --git a/Installation/cmake/modules/FindMPFR.cmake b/Installation/cmake/modules/FindMPFR.cmake
index 4d1bc43553d..b0507120ce0 100644
--- a/Installation/cmake/modules/FindMPFR.cmake
+++ b/Installation/cmake/modules/FindMPFR.cmake
@@ -4,8 +4,6 @@
# MPFR_LIBRARIES_DIR - Directory where the MPFR libraries are located
# MPFR_LIBRARIES - the MPFR libraries
-# TODO: support MacOSX
-
include(FindPackageHandleStandardArgs)
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_GeneratorSpecificSettings.cmake)
diff --git a/Installation/cmake/modules/FindOpenMesh.cmake b/Installation/cmake/modules/FindOpenMesh.cmake
deleted file mode 100644
index 86b6eaebc9e..00000000000
--- a/Installation/cmake/modules/FindOpenMesh.cmake
+++ /dev/null
@@ -1,79 +0,0 @@
-#This modules tries to find OpenMesh
-# Once done this will define
-#
-# OpenMesh_FOUND - system has OpenMesh
-# OPENMESH_INCLUDE_DIR - OpenMesh include directory
-# OPENMESH_LIBRARIES - OpenMesh libraries
-#
-
-find_package(OpenMesh NO_MODULE QUIET)
-
-# Is it already configured?
-if (NOT OpenMesh_FOUND)
-
- find_path(OPENMESH_INCLUDE_DIR
- NAMES OpenMesh/Core/Mesh/ArrayKernel.hh
- HINTS ENV OPENMESH_INC_DIR
- ENV OPENMESH_DIR
- /usr/include
- /usr/local/include
- PATH_SUFFIXES src
- DOC "The directory containing the OpenMesh header files WITHOUT the OpenMesh prefix"
- )
-
- find_library(OPENMESH_LIBRARY_RELEASE NAMES "OpenMeshCore"
- HINTS ENV OPENMESH_LIB_DIR
- ENV OPENMESH_DIR
- PATH_SUFFIXES lib
- DOC "Path to the OpenMeshCore library"
- )
-
- find_library(OPENMESH_LIBRARY_DEBUG NAMES "OpenMeshCored"
- HINTS ENV OPENMESH_LIB_DIR
- ENV OPENMESH_DIR
- PATH_SUFFIXES lib
- DOC "Path to the OpenMeshCored library"
- )
-
- if(OPENMESH_LIBRARY_RELEASE)
- if(OPENMESH_LIBRARY_DEBUG)
- set(OPENMESH_LIBRARIES optimized ${OPENMESH_LIBRARY_RELEASE} debug ${OPENMESH_LIBRARY_DEBUG})
- else()
- set(OPENMESH_LIBRARIES ${OPENMESH_LIBRARY_RELEASE})
- endif()
- endif()
-endif()
-
-include( FindPackageHandleStandardArgs )
-
-find_package_handle_standard_args(OpenMesh
- REQUIRED_VARS OPENMESH_INCLUDE_DIR OPENMESH_LIBRARIES
- FOUND_VAR OpenMesh_FOUND
- )
-
-if(OpenMesh_FOUND AND NOT TARGET OpenMesh::OpenMesh)
- add_library(OpenMesh::OpenMesh UNKNOWN IMPORTED)
-
- if(TARGET OpenMeshCore)
- target_link_libraries(OpenMesh::OpenMesh INTERFACE OpenMeshCore)
- return()
- endif()
-
- set_target_properties(OpenMesh::OpenMesh PROPERTIES
- INTERFACE_COMPILE_DEFINITIONS "CGAL_USE_OPENMESH;NOMINMAX;_USE_MATH_DEFINES"
- INTERFACE_INCLUDE_DIRECTORIES "${OPENMESH_INCLUDE_DIR}")
-
- if(OPENMESH_LIBRARY_RELEASE)
- set_property(TARGET OpenMesh::OpenMesh APPEND PROPERTY
- IMPORTED_CONFIGURATIONS RELEASE)
- set_target_properties(OpenMesh::OpenMesh PROPERTIES
- IMPORTED_LOCATION_RELEASE "${OPENMESH_LIBRARY_RELEASE}")
- endif()
-
- if(OPENMESH_LIBRARY_DEBUG)
- set_property(TARGET OpenMesh::OpenMesh APPEND PROPERTY
- IMPORTED_CONFIGURATIONS DEBUG)
- set_target_properties(OpenMesh::OpenMesh PROPERTIES
- IMPORTED_LOCATION_DEBUG "${OPENMESH_LIBRARY_DEBUG}")
- endif()
-endif()
diff --git a/Installation/cmake/modules/UseLASLIB.cmake b/Installation/cmake/modules/UseLASLIB.cmake
index 1af7a023ceb..f1ffb0bd906 100644
--- a/Installation/cmake/modules/UseLASLIB.cmake
+++ b/Installation/cmake/modules/UseLASLIB.cmake
@@ -3,4 +3,4 @@
add_definitions(-DCGAL_LINKED_WITH_LASLIB)
-message(DEPRECATION "This file UseLASLIB.cmake is deprecated, and the imported target `CGAL::TBB_support` from CGAL_LASLIB_support.cmake should be used instead.")
+message(DEPRECATION "This file UseLASLIB.cmake is deprecated, and the imported target `CGAL::LASLIB_support` from CGAL_LASLIB_support.cmake should be used instead.")
diff --git a/Installation/cmake/modules/UseOpenMesh.cmake b/Installation/cmake/modules/UseOpenMesh.cmake
deleted file mode 100644
index 23449d7cdf9..00000000000
--- a/Installation/cmake/modules/UseOpenMesh.cmake
+++ /dev/null
@@ -1,5 +0,0 @@
-# This module setups the compiler for using the OpenMesh library.
-# It assumes that find_package(OpenMesh) was already called.
-
-include_directories ( ${OPENMESH_INCLUDE_DIR} )
-add_definitions( -DNOMINMAX -D_USE_MATH_DEFINES )
diff --git a/Installation/cmake/modules/display-third-party-libs-versions.cmake b/Installation/cmake/modules/display-third-party-libs-versions.cmake
new file mode 100644
index 00000000000..96ef4e14992
--- /dev/null
+++ b/Installation/cmake/modules/display-third-party-libs-versions.cmake
@@ -0,0 +1,106 @@
+set(LIBRARIES_TO_CHECK
+ Eigen3 Qt6 TBB OpenMesh Boost
+ GMP Threads SuiteSparse MPFI METIS
+ VTK SCIP OSQP LASLIB GLPK
+ ITT Ceres MPFR libpointmatcher ITK
+ OpenGR OpenCV ZLIB
+)
+
+include(${CMAKE_CURRENT_LIST_DIR}/CGAL_TweakFindBoost.cmake)
+
+function(get_library_version header_path major_macro minor_macro patchlevel_macro version_var)
+ if(EXISTS ${header_path})
+ file(READ ${header_path} HEADER_CONTENT)
+ if("${HEADER_CONTENT}" MATCHES "#define[ \t]+${major_macro}[ \t]+([0-9]+)")
+ set(VERSION_MAJOR ${CMAKE_MATCH_1})
+ endif()
+ if("${HEADER_CONTENT}" MATCHES "#define[ \t]+${minor_macro}[ \t]+([0-9]+)")
+ set(VERSION_MINOR ${CMAKE_MATCH_1})
+ endif()
+ if("${HEADER_CONTENT}" MATCHES "#define[ \t]+${patchlevel_macro}[ \t]+([0-9]+)")
+ set(VERSION_PATCHLEVEL ${CMAKE_MATCH_1})
+ else()
+ set(VERSION_PATCHLEVEL "")
+ endif()
+ if(VERSION_PATCHLEVEL)
+ set(${version_var} "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCHLEVEL}" PARENT_SCOPE)
+ elseif(VERSION_MAJOR GREATER_EQUAL 0 OR VERSION_MINOR GREATER_EQUAL 0)
+ set(${version_var} "${VERSION_MAJOR}.${VERSION_MINOR}" PARENT_SCOPE)
+ endif()
+ endif()
+endfunction()
+
+function(check_library cgal_3rdparty_lib)
+ set(QT_NO_CREATE_VERSIONLESS_TARGETS ON)
+ set(CMAKE_FIND_PACKAGE_QUIET TRUE)
+ string(TOUPPER ${cgal_3rdparty_lib} cgal_3rdparty_lib_upper)
+ find_package(${cgal_3rdparty_lib} QUIET)
+ set(CMAKE_FIND_PACKAGE_QUIET FALSE)
+ if(${cgal_3rdparty_lib}_FOUND)
+ set(version_var "")
+ if(DEFINED ${cgal_3rdparty_lib}_VERSION)
+ set(version_var ${${cgal_3rdparty_lib}_VERSION})
+ elseif(DEFINED ${cgal_3rdparty_lib}_VERSION_STRING)
+ set(version_var ${${cgal_3rdparty_lib}_VERSION_STRING})
+ elseif(DEFINED ${cgal_3rdparty_lib_upper}_VERSION)
+ set(version_var ${${cgal_3rdparty_lib_upper}_VERSION})
+ elseif(DEFINED ${cgal_3rdparty_lib_upper}_VERSION_STRING)
+ set(version_var ${${cgal_3rdparty_lib_upper}_VERSION_STRING})
+ elseif(${cgal_3rdparty_lib} STREQUAL "GMP")
+ set(version_var "")
+ get_library_version("${GMP_INCLUDE_DIR}/gmp.h" "__GNU_MP_VERSION" "__GNU_MP_VERSION_MINOR" "__GNU_MP_VERSION_PATCHLEVEL" version_var)
+ if(NOT version_var)
+ file(READ "${GMP_INCLUDE_DIR}/gmp.h" GMP_HEADER_CONTENT)
+ string(REGEX MATCHALL "#include[ \t]+\"([^\"]+)\"" INCLUDED_HEADERS "${GMP_HEADER_CONTENT}")
+ foreach(INCLUDED_HEADER ${INCLUDED_HEADERS})
+ string(REGEX REPLACE "#include[ \t]+\"([^\"]+)\"" "\\1" GMP_ARCH_HEADER "${INCLUDED_HEADER}")
+ set(GMP_ARCH_HEADER_PATH "${GMP_INCLUDE_DIR}/${GMP_ARCH_HEADER}")
+ if(EXISTS ${GMP_ARCH_HEADER_PATH})
+ get_library_version("${GMP_ARCH_HEADER_PATH}" "__GNU_MP_VERSION" "__GNU_MP_VERSION_MINOR" "__GNU_MP_VERSION_PATCHLEVEL" version_var)
+ if(version_var)
+ break()
+ endif()
+ endif()
+ endforeach()
+ endif()
+ elseif(${cgal_3rdparty_lib} STREQUAL "GLPK")
+ get_library_version("${GLPK_INCLUDE_DIR}/glpk.h" "GLP_MAJOR_VERSION" "GLP_MINOR_VERSION" "" version_var)
+ elseif(${cgal_3rdparty_lib} STREQUAL "MPFR")
+ get_library_version("${MPFR_INCLUDE_DIR}/mpfr.h" "MPFR_VERSION_MAJOR" "MPFR_VERSION_MINOR" "MPFR_VERSION_PATCHLEVEL" version_var)
+ elseif(${cgal_3rdparty_lib} STREQUAL "METIS")
+ get_library_version("${METIS_INCLUDE_DIR}/metis.h" "METIS_VER_MAJOR" "METIS_VER_MINOR" "METIS_VER_SUBMINOR" version_var)
+ elseif(${cgal_3rdparty_lib} STREQUAL "SuiteSparse")
+ get_library_version("${SuiteSparse_Config_INCLUDE_DIR}/SuiteSparse_config.h" "SUITESPARSE_MAIN_VERSION" "SUITESPARSE_SUB_VERSION" "SUITESPARSE_SUBSUB_VERSION" version_var)
+ elseif(${cgal_3rdparty_lib} STREQUAL "LASLIB")
+ get_library_version("${LASLIB_INCLUDE_DIR}/lasdefinitions.hpp" "LAS_TOOLS_VERSION" "" "" version_var)
+ elseif(${cgal_3rdparty_lib} STREQUAL "ITT")
+ get_library_version("${ITT_INCLUDE_DIR}/ittnotify.h" "ITT_MAJOR" "ITT_MINOR" "" version_var)
+ elseif(${cgal_3rdparty_lib} STREQUAL "OpenMesh")
+ if (TARGET OpenMeshCore)
+ get_target_property(OpenMesh_INCLUDE_DIRS OpenMeshCore INTERFACE_INCLUDE_DIRECTORIES)
+ set(CONFIG_FILE_PATH "${OpenMesh_INCLUDE_DIRS}/OpenMesh/Core/System/config.h")
+ if(EXISTS ${CONFIG_FILE_PATH})
+ file(READ ${CONFIG_FILE_PATH} CONFIG_CONTENT)
+ if("${CONFIG_CONTENT}" MATCHES "#define[ \t]+OM_VERSION[ \t]+(0x[0-9A-F]+)")
+ set(VERSION_HEX ${CMAKE_MATCH_1})
+ math(EXPR VERSION_MAJOR "(${VERSION_HEX} & 0xF0000) >> 16")
+ math(EXPR VERSION_MINOR "(${VERSION_HEX} & 0x0FF00) >> 8")
+ math(EXPR VERSION_PATCH "(${VERSION_HEX} & 0x000FF)")
+ set(version_var "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
+ endif()
+ endif()
+ endif()
+ endif()
+ if(version_var)
+ message(STATUS "Third-party library ${cgal_3rdparty_lib} ${version_var}")
+ else()
+ message(STATUS "Third-party library ${cgal_3rdparty_lib} found")
+ endif()
+ else()
+ message(STATUS "Third-party library ${cgal_3rdparty_lib} not found")
+ endif()
+endfunction()
+
+foreach(cgal_3rdparty_lib IN LISTS LIBRARIES_TO_CHECK)
+ check_library(${cgal_3rdparty_lib})
+endforeach()
diff --git a/Installation/include/CGAL/config.h b/Installation/include/CGAL/config.h
index bd5dafbf017..ff437a7f444 100644
--- a/Installation/include/CGAL/config.h
+++ b/Installation/include/CGAL/config.h
@@ -37,6 +37,13 @@
#endif
#ifdef CGAL_INCLUDE_WINDOWS_DOT_H
+
+#if defined(_MSC_VER) && defined(_DEBUG)
+// Include support for memory leak detection
+// This is only available in debug mode and when _CRTDBG_MAP_ALLOC is defined.
+// It will include which will redefine `malloc` and `free`.
+# define _CRTDBG_MAP_ALLOC 1
+#endif
// Mimic users including this file which defines min max macros
// and other names leading to name clashes
#include
@@ -243,20 +250,6 @@
# define CGAL_SUNPRO_INITIALIZE(C)
#endif
-//----------------------------------------------------------------------//
-// MacOSX specific.
-//----------------------------------------------------------------------//
-
-#ifdef __APPLE__
-# if defined(__GNUG__) && (__GNUG__ == 4) && (__GNUC_MINOR__ == 0) \
- && defined(__OPTIMIZE__) && !defined(CGAL_NO_WARNING_FOR_MACOSX_GCC_4_0_BUG)
-# warning "Your configuration may exhibit run-time errors in CGAL code"
-# warning "This appears with g++ 4.0 on MacOSX when optimizing"
-# warning "You can disable this warning using -DCGAL_NO_WARNING_FOR_MACOSX_GCC_4_0_BUG"
-# warning "For more information, see https://www.cgal.org/FAQ.html#mac_optimization_bug"
-# endif
-#endif
-
//-------------------------------------------------------------------//
// When the global min and max are no longer defined (as macros)
// because of NOMINMAX flag definition, we define our own global
diff --git a/Installation/include/CGAL/license/Polygon_mesh_processing/combinatorial_repair.h b/Installation/include/CGAL/license/Polygon_mesh_processing/combinatorial_repair.h
index cf07529839b..8f3640a725d 100644
--- a/Installation/include/CGAL/license/Polygon_mesh_processing/combinatorial_repair.h
+++ b/Installation/include/CGAL/license/Polygon_mesh_processing/combinatorial_repair.h
@@ -9,7 +9,7 @@
//
// Author(s) : Andreas Fabri
//
-// Warning: this file is generated, see include/CGAL/licence/README.md
+// Warning: this file is generated, see include/CGAL/license/README.md
// not entirely true due to the backward compatibility issue
#ifndef CGAL_LICENSE_POLYGON_MESH_PROCESSING_COMBINATORIAL_REPAIR_H
diff --git a/Installation/include/CGAL/version.h b/Installation/include/CGAL/version.h
index 6840e2546e3..8cdee7a0aa3 100644
--- a/Installation/include/CGAL/version.h
+++ b/Installation/include/CGAL/version.h
@@ -17,12 +17,12 @@
#define CGAL_VERSION_H
#ifndef SWIG
-#define CGAL_VERSION 6.0-beta2
+#define CGAL_VERSION 6.0.1
#define CGAL_GIT_HASH abcdef
#endif
-#define CGAL_VERSION_NR 1060000920
+#define CGAL_VERSION_NR 1060011000
#define CGAL_SVN_REVISION 99999
-#define CGAL_RELEASE_DATE 20240701
+#define CGAL_RELEASE_DATE 20240925
#include
diff --git a/Installation/lib/cmake/CGAL/CGALConfigVersion.cmake b/Installation/lib/cmake/CGAL/CGALConfigVersion.cmake
index df15f9e3108..e5e2176a20b 100644
--- a/Installation/lib/cmake/CGAL/CGALConfigVersion.cmake
+++ b/Installation/lib/cmake/CGAL/CGALConfigVersion.cmake
@@ -1,8 +1,8 @@
set(CGAL_MAJOR_VERSION 6)
set(CGAL_MINOR_VERSION 0)
-set(CGAL_BUGFIX_VERSION 0)
+set(CGAL_BUGFIX_VERSION 1)
include(${CMAKE_CURRENT_LIST_DIR}/CGALConfigBuildVersion.cmake)
-set(CGAL_VERSION_PUBLIC_RELEASE_VERSION "6.0-beta2")
+set(CGAL_VERSION_PUBLIC_RELEASE_VERSION "6.0.1")
set(CGAL_VERSION_PUBLIC_RELEASE_NAME "CGAL-${CGAL_VERSION_PUBLIC_RELEASE_VERSION}")
if (CGAL_BUGFIX_VERSION AND CGAL_BUGFIX_VERSION GREATER 0)
diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Line_3_Ray_3_do_intersect.h b/Intersections_3/include/CGAL/Intersections_3/internal/Line_3_Ray_3_do_intersect.h
index f4aa1e8e37c..1cafde62ad3 100644
--- a/Intersections_3/include/CGAL/Intersections_3/internal/Line_3_Ray_3_do_intersect.h
+++ b/Intersections_3/include/CGAL/Intersections_3/internal/Line_3_Ray_3_do_intersect.h
@@ -38,11 +38,8 @@ do_intersect(const typename K::Line_3& l,
if(p0p1s == COLLINEAR)
return true;
- CGAL::Orientation stp0 = pred(r.source(), r.second_point(), l.point(0));
- if(stp0 == COLLINEAR)
- return Ray_3_has_on_collinear_Point_3(r,l.point(0),k);
-
- return (p0p1s != stp0);
+ typename K::Point_3 lst = l.point(0) + (r.point(1) - r.point(0));
+ return (pred(l.point(0), l.point(1), r.point(0), lst) != CGAL::POSITIVE);
}
template
diff --git a/Intersections_3/test/Intersections_3/test_intersections_Line_3.cpp b/Intersections_3/test/Intersections_3/test_intersections_Line_3.cpp
index 6fe55a40654..7285c22be72 100644
--- a/Intersections_3/test/Intersections_3/test_intersections_Line_3.cpp
+++ b/Intersections_3/test/Intersections_3/test_intersections_Line_3.cpp
@@ -156,9 +156,9 @@ public:
Pl pl(pl0, pl1, pl2);
P pl3 = pl0 + FT(this->r.get_double()) * V(pl1 - pl0) + FT(this->r.get_double()) * V(pl1 - pl0);
if(pl.has_on(l1))
- Base::template check_intersection(L(pl3, l1), pl, L(pl3, l1)); // both points on the plane
+ Base::check_intersection(L(pl3, l1), pl, L(pl3, l1)); // both points on the plane
else
- Base::template check_intersection(L(pl3, l1), pl, pl3); // single point on the plane
+ Base::check_intersection(L(pl3, l1), pl, pl3); // single point on the plane
if(pl.oriented_side(l0) != pl.oriented_side(l1)) // l0 xor l1 on pl is fine
{
@@ -232,6 +232,10 @@ public:
check_no_intersection(L(p(0,0,0),p(1,0,0)), R(p(3,0,1),p(6,0,1)));
check_no_intersection(L(p(0,0,0),p(1,0,0)), R(p(0,2,0),p(0,4,0)));
check_no_intersection(L(p(0,0,0),p(1,0,0)), R(p(6,2,0),p(5,4,0)));
+ check_no_intersection(L(p(0,0,0),p(0,1,0)), R(p(1,-1,0),p(1,0,0)));
+ check_no_intersection(L(p(0,-10,0),p(0,-9,0)), R(p(1,-1,0),p(2,0,0)));
+ check_no_intersection(L(p(0,-10,0),p(0,0,0)), R(p(1,-1,0),p(2,0,0)));
+ check_no_intersection(L(p(0,0,0),p(0,1,0)), R(p(1,-1,0),p(2,0,0)));
// Point intersection
check_intersection (L(p(0,0,0),p(1,0,0)), R(p(3,0,0),p(6,4,0)),
diff --git a/Intersections_3/test/Intersections_3/test_intersections_Ray_3.cpp b/Intersections_3/test/Intersections_3/test_intersections_Ray_3.cpp
index e1d603d4a5e..1ce4ab53642 100644
--- a/Intersections_3/test/Intersections_3/test_intersections_Ray_3.cpp
+++ b/Intersections_3/test/Intersections_3/test_intersections_Ray_3.cpp
@@ -74,6 +74,14 @@ public:
check_no_intersection (R(p(0,0,0), p(1,0,0)), R(p(0,1,0), p(0,2,0)));
check_no_intersection (R(p(0,0,0), p(1,0,0)), R(p(-1,0,0), p(-1,-1,0)));
+ check_no_intersection (R(p(1,-1,0), p(2,0,0)), R(p(2,-1,0), p(3,0,0)));
+ check_no_intersection (R(p(1,-1,0), p(2,0,0)), R(p(2,-1,0), p(3,-1,0)));
+ check_no_intersection (R(p(1,-1,0), p(2,0,0)), R(p(2,-1,0), p(3,-2,0)));
+ check_no_intersection (R(p(0,0,0), p(0,1,0)), R(p(0,-1,0), p(1,-1,0)));
+ check_no_intersection (R(p(0,0,0), p(0,1,0)), R(p(-1,-3,0),p(2,0,0)));
+ check_no_intersection (R(p(0,0,0), p(0,1,0)), R(p(-2,-4,0),p(-1,-3,0)));
+ check_no_intersection (R(p(0,0,0), p(0,1,0)), R(p(1,-1,0), p(2,0,0)));
+
// Point
check_intersection (R(p(0,0,0), p(1,0,0)), R(p(0,0,0), p(-1,0,0)),
p(0,0,0));
@@ -88,6 +96,10 @@ public:
check_intersection (R(p(0,0,0), p(1,0,0)), R(p(1,-2,0), p(1,-1,0)),
p(1,0,0));
+ check_intersection (R(p(0,0,0), p(1,0,0)), R(p(1,-2,0), p(1,-1,0)),
+ p(1,0,0));
+
+
// Segment
check_intersection (R(p(0,0,0), p(1,0,0)), R(p(2,0,0), p(-3,0,0)),
S(p(0,0,0), p(2,0,0)), false);
@@ -161,6 +173,8 @@ public:
for(int i=0; i::value_type vpm_value_type;
// typedef typename boost::property_traits::key_type vpm_key_type;
- //vertex indices are initialised to -1
+ //vertex indices are initialized to -1
static void reset_ring_indices(std::vector < Vertex * >&vces,
VertexPropertyMap& vpm);
diff --git a/Kernel_23/include/CGAL/Kernel/function_objects.h b/Kernel_23/include/CGAL/Kernel/function_objects.h
index 2e39f539753..5a7b0774e6d 100644
--- a/Kernel_23/include/CGAL/Kernel/function_objects.h
+++ b/Kernel_23/include/CGAL/Kernel/function_objects.h
@@ -1093,7 +1093,7 @@ namespace CommonKernelFunctors {
public:
typedef FT result_type;
- // There are 25 combinaisons, we use a template.
+ // There are 25 combinations, we use a template.
template
FT
operator()( const T1& t1, const T2& t2) const
@@ -1108,7 +1108,7 @@ namespace CommonKernelFunctors {
public:
typedef FT result_type;
- // There are 25 combinaisons, we use a template.
+ // There are 25 combinations, we use a template.
template
FT
operator()( const T1& t1, const T2& t2) const
diff --git a/Kernel_23/test/Kernel_23/Dimension.cpp b/Kernel_23/test/Kernel_23/Dimension.cpp
index ab9086f0e22..e5b7315d690 100644
--- a/Kernel_23/test/Kernel_23/Dimension.cpp
+++ b/Kernel_23/test/Kernel_23/Dimension.cpp
@@ -9,7 +9,6 @@
#include
#include
-#include
#include
template < typename K >
diff --git a/Kinetic_space_partition/examples/Kinetic_space_partition/kinetic_partition.cpp b/Kinetic_space_partition/examples/Kinetic_space_partition/kinetic_partition.cpp
index 2eaaf47bbe0..dafdd2fb478 100644
--- a/Kinetic_space_partition/examples/Kinetic_space_partition/kinetic_partition.cpp
+++ b/Kinetic_space_partition/examples/Kinetic_space_partition/kinetic_partition.cpp
@@ -40,7 +40,7 @@ int main(int argc, char** argv)
// Initialization of Kinetic_space_partition_3 object.
// 'debug' set to true exports intermediate results into files in the working directory.
// The resulting volumes are exported into a volumes folder, if the folder already exists.
- KSP ksp(CGAL::parameters::verbose(true).debug(true));
+ KSP ksp(CGAL::parameters::verbose(true).debug(false));
// Providing input polygons.
ksp.insert(input_vertices, input_faces);
diff --git a/Kinetic_space_partition/include/CGAL/KSP/utils.h b/Kinetic_space_partition/include/CGAL/KSP/utils.h
index d8e99ddddc2..64a2d997296 100644
--- a/Kinetic_space_partition/include/CGAL/KSP/utils.h
+++ b/Kinetic_space_partition/include/CGAL/KSP/utils.h
@@ -41,7 +41,6 @@
#include
#include