Merge branch 'master' into id-support-handler-hash-performance

This commit is contained in:
Giles Bathgate 2021-03-24 14:15:50 +00:00 committed by GitHub
commit d5032ec5ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2563 changed files with 222224 additions and 68731 deletions

12
.github/install.sh vendored Executable file
View File

@ -0,0 +1,12 @@
#!/bin/bash
sudo add-apt-repository ppa:mikhailnov/pulseeffects -y
sudo apt-get update
sudo apt-get install -y libmpfr-dev \
libeigen3-dev qtbase5-dev libqt5sql5-sqlite libqt5opengl5-dev qtscript5-dev \
libqt5svg5-dev qttools5-dev qttools5-dev-tools libboost1.72-dev zsh
#update cmake to 3.18.4
sudo apt purge --auto-remove cmake
cd /tmp
wget https://cmake.org/files/v3.18/cmake-3.18.4-Linux-x86_64.sh
sudo sh cmake-3.18.4-Linux-x86_64.sh --skip-license --prefix=/usr/local
rm cmake-3.18.4-Linux-x86_64.sh

13
.github/test.sh vendored Executable file
View File

@ -0,0 +1,13 @@
#!/bin/bash
/usr/local/bin/cmake --version
FACTOR=$1
set -ex
cd Polyhedron/demo
LIST_OF_PLUGINS=$(/usr/local/bin/cmake --build . -t help | egrep 'plugin$' |& cut -d\ -f2)
PLUGINS_ARRAY=(${LIST_OF_PLUGINS});
NB_OF_PLUGINS=${#PLUGINS_ARRAY[@]}
DEL=$(($NB_OF_PLUGINS / 4))
mkdir build
cd build
/usr/local/bin/cmake -DCGAL_DIR=$2 ../Polyhedron
make -j2 ${PLUGINS_ARRAY[@]:$(($FACTOR * $DEL)):$((($FACTOR + 1) * $DEL))}

View File

@ -1,8 +1,8 @@
name: Documentation name: Documentation
on: on:
pull_request_target: issue_comment:
types: [opened, synchronize, reopened, labeled] types: [created]
jobs: jobs:
build: build:
@ -10,51 +10,102 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/github-script@v3 - uses: actions/github-script@v3
id: check id: get_round
with: with:
result-encoding: string result-encoding: string
script: | script: |
const labels = context.payload.pull_request.labels const asso = context.payload.comment.author_association
names = [] if(asso == 'OWNER' || asso == 'MEMBER') {
for(const label of labels) { const body = context.payload.comment.body
names.push(label.name) if(body.includes("build:")) {
const re = /\/build:(\w+)\s*/;
if(re.test(body)){
const res = re.exec(body)
return res[1];
}
}
} }
if(names.includes("small feature")) {
return 'ok'
} else {
return 'stop' return 'stop'
} - uses: actions/github-script@v3
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
- uses: actions/checkout@v2
name: "checkout branch"
if: steps.get_round.outputs.result != 'stop'
with:
repository: ${{ github.repository }}
ref: refs/pull/${{ steps.get_pr_number.outputs.result }}/merge
token: ${{ secrets.PUSH_TO_CGAL_GITHUB_IO_TOKEN }}
fetch-depth: 2
- name: install dependencies - name: install dependencies
if: steps.check.outputs.result == 'ok' if: steps.get_round.outputs.result != 'stop'
run: | run: |
set -x set -x
sudo apt-get install -y graphviz ssh sudo apt-get update && sudo apt-get install -y graphviz ssh bibtex2html
sudo pip install lxml pyquery sudo pip install lxml
wget -O doxygen_exe https://cgal.geometryfactory.com/~mgimeno/doxygen/build_1_8_13/bin/doxygen sudo pip install 'pyquery==1.4.1' # it seems to be the last py2 compatible version
wget --no-verbose -O doxygen_exe https://cgal.geometryfactory.com/~mgimeno/doxygen/build_1_8_13/bin/doxygen
sudo mv doxygen_exe /usr/bin/doxygen sudo mv doxygen_exe /usr/bin/doxygen
sudo chmod +x /usr/bin/doxygen sudo chmod +x /usr/bin/doxygen
git config --global user.email "maxime.gimeno@geometryfactory.com" git config --global user.email "maxime.gimeno@geometryfactory.com"
git config --global user.name "Maxime Gimeno" git config --global user.name "Maxime Gimeno"
- name: configure all - name: configure all
if: steps.check.outputs.result == 'ok' if: steps.get_round.outputs.result != 'stop'
run: | run: |
git clone https://maxGimeno:${{ secrets.PUSH_TO_CGAL_GITHUB_IO_TOKEN }}@github.com/CGAL/cgal.github.io.git --depth=5 set -ex
mkdir -p build_doc && cd build_doc && cmake ../Documentation/doc mkdir -p build_doc && cd build_doc && cmake ../Documentation/doc
- name: Upload Doc - name: Build and Upload Doc
if: steps.check.outputs.result == 'ok' if: steps.get_round.outputs.result != 'stop'
run: | run: |
set -e set -ex
PR_NUMBER=$(python -c "import json; import os; y = json.load(open(os.environ['GITHUB_EVENT_PATH'])); print(y[\"number\"])") PR_NUMBER=${{ steps.get_pr_number.outputs.result }}
mkdir -p cgal.github.io/${PR_NUMBER} ROUND=${{ steps.get_round.outputs.result }}
cd build_doc && make -j2 doc && make -j2 doc_with_postprocessing wget --no-verbose cgal.github.io -O tmp.html
cp -r ./doc_output/* ../cgal.github.io/${PR_NUMBER}/ if ! egrep -q "\/$PR_NUMBER\/$ROUND" tmp.html; then
cd ../cgal.github.io #list impacted packages
if ! egrep -q " ${PR_NUMBER}\."; then LIST_OF_PKGS=$(git diff --name-only HEAD^1 HEAD |cut -s -d/ -f1 |sort -u | xargs -I {} ls -d {}/package_info 2>/dev/null |cut -d/ -f1 |egrep -v Installation||true)
echo "<li><a href=https://cgal.github.io/${PR_NUMBER}/Manual/index.html>Manual for PR ${PR_NUMBER}.</a></li>" >> ./index.html if [ "$LIST_OF_PKGS" = "" ]; then
exit 1
fi fi
git add ${PR_NUMBER} && git commit -a -m "Add ${PR_NUMBER}" && git push -u origin master cd build_doc && make -j2 doc && make -j2 doc_with_postprocessing
cd ..
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
for f in $LIST_OF_PKGS
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 "<li><a href=https://cgal.github.io/${PR_NUMBER}/$ROUND/Manual/index.html>Manual for PR ${PR_NUMBER} ($ROUND).</a></li>" >> ./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
else
exit 1
fi
- name: Post address
uses: actions/github-script@v3
if: steps.get_round.outputs.result != 'stop'
with:
script: |
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 }}/${{ steps.get_round.outputs.result }}/Manual/index.html"
github.issues.createComment({
owner: "CGAL",
repo: "cgal",
issue_number: ${{ github.event.issue.number }},
body: address
});

30
.github/workflows/checks.yml vendored Normal file
View File

@ -0,0 +1,30 @@
name: CMake Test Merge Branch
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.0.0
- name: install dependencies
run: |
.github/install.sh
set -x
sudo apt-get update && sudo apt-get install -y graphviz ssh bibtex2html
sudo pip install lxml
sudo pip install 'pyquery==1.4.1' # it seems to be the last py2 compatible version
wget --no-verbose -O doxygen_exe https://cgal.geometryfactory.com/~mgimeno/doxygen/build_1_8_13/bin/doxygen
sudo mv doxygen_exe /usr/bin/doxygen
sudo chmod +x /usr/bin/doxygen
git config --global user.email "maxime.gimeno@geometryfactory.com"
git config --global user.name "Maxime Gimeno"
- name: Run checks
run: |
zsh Scripts/developer_scripts/test_merge_of_branch HEAD
#test dependencies
bash Scripts/developer_scripts/cgal_check_dependencies.sh --check_headers /usr/bin/doxygen

View File

@ -18,8 +18,15 @@ jobs:
git clone https://maxGimeno:${{ secrets.PUSH_TO_CGAL_GITHUB_IO_TOKEN }}@github.com/CGAL/cgal.github.io.git --depth=5 git clone https://maxGimeno:${{ secrets.PUSH_TO_CGAL_GITHUB_IO_TOKEN }}@github.com/CGAL/cgal.github.io.git --depth=5
PR_NUMBER=$(python -c "import json; import os; y = json.load(open(os.environ['GITHUB_EVENT_PATH'])); print(y[\"number\"])") PR_NUMBER=$(python -c "import json; import os; y = json.load(open(os.environ['GITHUB_EVENT_PATH'])); print(y[\"number\"])")
cd cgal.github.io/ cd cgal.github.io/
egrep -v " ${PR_NUMBER}\." index.html > tmp.html egrep -v " ${PR_NUMBER}\." index.html > tmp.html || true
if [ -n "$(diff -q ./index.html ./tmp.html)" ]; then
mv tmp.html index.html mv tmp.html index.html
#git rm -r ${PR_NUMBER} && git commit -a -m "Remove ${PR_NUMBER}" && git push -u origin master fi
git commit -a -m "Remove ${PR_NUMBER}" && git push -u origin master if [ -d ${PR_NUMBER} ]; then
git rm -r ${PR_NUMBER}
fi
#git diff exits with 1 if there is a diff
if ! git diff --quiet; then
git commit -a --amend -m"base commit" && git push -f -u origin master
fi

37
.github/workflows/demo.yml vendored Normal file
View File

@ -0,0 +1,37 @@
name: Test Polyhedron Demo
on: [push, pull_request]
jobs:
batch_1:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.0.0
- name: install dependencies
run: .github/install.sh
- name: run1
run: ./.github/test.sh 0 ${{ github.workspace }}
batch_2:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.0.0
- name: install dependencies
run: .github/install.sh
- name: run2
run: ./.github/test.sh 1 ${{ github.workspace }}
batch_3:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.0.0
- name: install dependencies
run: .github/install.sh
- name: run3
run: ./.github/test.sh 2 ${{ github.workspace }}
batch_4:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.0.0
- name: install dependencies
run: .github/install.sh
- name: run4
run: ./.github/test.sh 3 ${{ github.workspace }}

2
.gitignore vendored
View File

@ -1,5 +1,7 @@
/*build* /*build*
/*/*/*/build /*/*/*/build
/*/*/*/VC*
/*/*/*/GCC
AABB_tree/demo/AABB_tree/AABB_demo AABB_tree/demo/AABB_tree/AABB_demo
AABB_tree/demo/AABB_tree/Makefile AABB_tree/demo/AABB_tree/Makefile
AABB_tree/examples/AABB_tree/*.kdev* AABB_tree/examples/AABB_tree/*.kdev*

View File

@ -1,80 +0,0 @@
language: cpp
dist: bionic
sudo: required
git:
depth: 3
env:
matrix:
- PACKAGE='CHECK'
- PACKAGE='AABB_tree Advancing_front_surface_reconstruction Algebraic_foundations '
- PACKAGE='Algebraic_kernel_d Algebraic_kernel_for_circles Algebraic_kernel_for_spheres '
- PACKAGE='Alpha_shapes_2 Alpha_shapes_3 Apollonius_graph_2 '
- PACKAGE='Arithmetic_kernel Arrangement_on_surface_2 BGL '
- PACKAGE='Barycentric_coordinates_2 Boolean_set_operations_2 Bounding_volumes '
- PACKAGE='Box_intersection_d CGAL_Core CGAL_ImageIO '
- PACKAGE='CGAL_ipelets Cartesian_kernel Circular_kernel_2 '
- PACKAGE='Circular_kernel_3 Circulator Classification '
- PACKAGE='Combinatorial_map Cone_spanners_2 Convex_decomposition_3 '
- PACKAGE='Convex_hull_2 Convex_hull_3 Convex_hull_d '
- PACKAGE='Distance_2 Distance_3 Envelope_2 '
- PACKAGE='Envelope_3 Filtered_kernel Generalized_map '
- PACKAGE='Generator Geomview GraphicsView '
- PACKAGE='HalfedgeDS Hash_map Heat_method_3 '
- PACKAGE='Homogeneous_kernel Hyperbolic_triangulation_2 Inscribed_areas '
- PACKAGE='Installation Interpolation Intersections_2 '
- PACKAGE='Intersections_3 Interval_skip_list Interval_support '
- PACKAGE='Inventor Jet_fitting_3 Kernel_23 '
- PACKAGE='Kernel_d LEDA Linear_cell_complex '
- PACKAGE='MacOSX Maintenance Matrix_search '
- PACKAGE='Mesh_2 Mesh_3 Mesher_level '
- PACKAGE='Minkowski_sum_2 Minkowski_sum_3 Modifier '
- PACKAGE='Modular_arithmetic Nef_2 Nef_3 '
- PACKAGE='Nef_S2 NewKernel_d Number_types '
- PACKAGE='OpenNL Optimal_bounding_box Optimal_transportation_reconstruction_2 '
- PACKAGE='Optimisation_basic Partition_2 Periodic_2_triangulation_2 '
- PACKAGE='Periodic_3_mesh_3 Periodic_3_triangulation_3 Periodic_4_hyperbolic_triangulation_2 '
- PACKAGE='Point_set_2 Point_set_3 Point_set_processing_3 '
- PACKAGE='Poisson_surface_reconstruction_3 Polygon Polygon_mesh_processing '
- PACKAGE='Polygonal_surface_reconstruction Polyhedron Polyhedron_IO '
- PACKAGE='Polyline_simplification_2 Polynomial Polytope_distance_d '
- PACKAGE='Principal_component_analysis Principal_component_analysis_LGPL Profiling_tools '
- PACKAGE='Property_map QP_solver Random_numbers '
- PACKAGE='Ridges_3 STL_Extension Scale_space_reconstruction_3 '
- PACKAGE='Scripts SearchStructures Segment_Delaunay_graph_2 '
- PACKAGE='Segment_Delaunay_graph_Linf_2 Set_movable_separability_2 Shape_detection '
- PACKAGE='Skin_surface_3 Snap_rounding_2 Solver_interface '
- PACKAGE='Spatial_searching Spatial_sorting Straight_skeleton_2 '
- PACKAGE='Stream_lines_2 Stream_support Subdivision_method_3 '
- PACKAGE='Surface_mesh Surface_mesh_approximation Surface_mesh_deformation '
- PACKAGE='Surface_mesh_parameterization Surface_mesh_segmentation Surface_mesh_shortest_path '
- PACKAGE='Surface_mesh_simplification Surface_mesh_skeletonization Surface_mesh_topology '
- PACKAGE='Surface_mesher Surface_sweep_2 TDS_2 '
- PACKAGE='TDS_3 Testsuite Tetrahedral_remeshing '
- PACKAGE='Three Triangulation Triangulation_2 '
- PACKAGE='Triangulation_3 Union_find Visibility_2 '
- PACKAGE='Voronoi_diagram_2 wininst '
compiler: clang
install:
- echo "$PWD"
- if [ -n "$TRAVIS_PULL_REQUEST_BRANCH" ] && [ "$PACKAGE" != CHECK ]; then DO_IGNORE=FALSE; for ARG in $(echo "$PACKAGE");do if [ "$ARG" = "Maintenance" ]; then continue; fi; . $PWD/.travis/test_package.sh "$PWD" "$ARG"; echo "DO_IGNORE is $DO_IGNORE"; if [ "$DO_IGNORE" = "FALSE" ]; then break; fi; done; if [ "$DO_IGNORE" = "TRUE" ]; then travis_terminate 0; fi;fi
- /usr/bin/time -f 'Spend time of %C -- %E (real)' bash .travis/install.sh
- export CXX=clang++-10 CC=clang-10;
before_script:
- wget -O doxygen_exe https://cgal.geometryfactory.com/~mgimeno/doxygen_exe
- sudo mv doxygen_exe /usr/bin/doxygen
- sudo chmod +x /usr/bin/doxygen
- mkdir -p build
- cd build
- /usr/bin/time -f 'Spend time of %C -- %E (real)' cmake -DCMAKE_CXX_FLAGS="-std=c++1y" -DCGAL_HEADER_ONLY=ON -DCMAKE_CXX_FLAGS_RELEASE=-DCGAL_NDEBUG -DWITH_examples=ON -DWITH_demos=ON -DWITH_tests=ON ..
- /usr/bin/time -f 'Spend time of %C -- %E (real)' make
- /usr/bin/time -f 'Spend time of %C -- %E (real)' sudo make install &>/dev/null
- cd ..
script:
- cd ./.travis
- /usr/bin/time -f 'Spend time of %C -- %E (real)' bash ./build_package.sh $PACKAGE
notifications:
email:
on_success: change
# default: always
on_failure: always
# default: always

View File

@ -1,193 +0,0 @@
#!/bin/bash
set -e
[ -n "$CGAL_DEBUG_TRAVIS" ] && set -x
CXX_FLAGS="-DCGAL_NDEBUG -ftemplate-backtrace-limit=0"
function mytime {
/usr/bin/time -f "Spend time of %C: %E (real)" "$@"
}
function build_examples {
mkdir -p build-travis
cd build-travis
mytime cmake -DCGAL_DIR="/usr/local/lib/cmake/CGAL" -DCMAKE_CXX_FLAGS="${CXX_FLAGS}" ..
mytime make -j2 VERBOSE=1
}
function build_tests {
build_examples
}
function build_demo {
mkdir -p build-travis
cd build-travis
EXTRA_CXX_FLAGS=
case "$CC" in
clang*)
EXTRA_CXX_FLAGS="-Werror=inconsistent-missing-override"
;;
esac
mytime cmake -DCGAL_DIR="/usr/local/lib/cmake/CGAL" -DCGAL_DONT_OVERRIDE_CMAKE_FLAGS:BOOL=ON -DCMAKE_CXX_FLAGS="${CXX_FLAGS} ${EXTRA_CXX_FLAGS}" ..
mytime make -j2 VERBOSE=1
}
old_IFS=$IFS
IFS=$' '
ROOT="$PWD/.."
for ARG in $(echo "$@")
do
#skip package maintenance
if [ "$ARG" = "Maintenance" ]; then
continue
fi
cd $ROOT
#install openmesh only if necessary
if [ "$ARG" = "CHECK" ] || [ "$ARG" = BGL ] || [ "$ARG" = Convex_hull_3 ] ||\
[ "$ARG" = Polygon_mesh_processing ] || [ "$ARG" = Property_map ] ||\
[ "$ARG" = Surface_mesh_deformation ] || [ "$ARG" = Surface_mesh_shortest_path ] ||\
[ "$ARG" = Surface_mesh_simplification ]; then
mytime sudo bash .travis/install_openmesh.sh
fi
if [ "$ARG" = "CHECK" ]
then
cd .travis
mytime ./generate_travis.sh --check
cd ..
IFS=$old_IFS
mytime zsh $ROOT/Scripts/developer_scripts/test_merge_of_branch HEAD
#test dependencies
cd $ROOT
mytime bash Scripts/developer_scripts/cgal_check_dependencies.sh --check_headers /usr/bin/doxygen
cd .travis
#parse current matrix and check that no package has been forgotten
IFS=$'\n'
COPY=0
MATRIX=()
for LINE in $(cat "$PWD/packages.txt")
do
MATRIX+="$LINE "
done
PACKAGES=()
cd ..
for f in *
do
if [ -d "$f/package_info/$f" ]
then
PACKAGES+="$f "
fi
done
DIFFERENCE=$(echo ${MATRIX[@]} ${PACKAGES[@]} | tr ' ' '\n' | sort | uniq -u)
IFS=$' '
if [ "${DIFFERENCE[0]}" != "" ]
then
echo "The matrix and the actual package list differ : ."
echo ${DIFFERENCE[*]}
echo "You should run generate_travis.sh."
exit 1
fi
echo "Matrix is up to date."
#check if non standard cgal installation works
cd $ROOT
mkdir build_test
cd build_test
mytime cmake -DCMAKE_INSTALL_PREFIX=install/ -DCGAL_BUILD_THREE_DOC=TRUE ..
mytime make install
# test install with minimal downstream example
mkdir installtest
cd installtest
touch main.cpp
mkdir build
echo 'project(Example)' >> CMakeLists.txt
echo 'set(PROJECT_SRCS ${PROJECT_SOURCE_DIR}/main.cpp)' >> CMakeLists.txt
echo 'find_package(CGAL REQUIRED)' >> CMakeLists.txt
echo 'add_executable(${PROJECT_NAME} ${PROJECT_SRCS})' >> CMakeLists.txt
echo 'target_link_libraries(${PROJECT_NAME} CGAL::CGAL)' >> CMakeLists.txt
echo '#include "CGAL/remove_outliers.h"' >> main.cpp
cd build
mytime cmake -DCMAKE_INSTALL_PREFIX=../../install -DCGAL_BUILD_THREE_DOC=TRUE ..
cd ..
exit 0
fi
IFS=$old_IFS
if [ -n "$TRAVIS_PULL_REQUEST_BRANCH" ] && [ "$ARG" != Polyhedron_demo ]; then
DO_IGNORE=FALSE
. $ROOT/.travis/test_package.sh "$ROOT" "$ARG"
echo "DO_IGNORE is $DO_IGNORE"
if [ "$DO_IGNORE" = "TRUE" ]; then
continue
fi
fi
IFS=$' '
EXAMPLES="$ARG/examples/$ARG"
TEST="$ARG/test/$ARG"
DEMOS=$ROOT/$ARG/demo/*
if [ -d "$ROOT/$EXAMPLES" ]
then
cd $ROOT/$EXAMPLES
if [ -f ./CMakeLists.txt ]; then
build_examples
else
for dir in ./*
do
if [ -f $dir/CMakeLists.txt ]; then
cd $ROOT/$EXAMPLES/$dir
build_examples
fi
done
fi
elif [ "$ARG" != Polyhedron_demo ]; then
echo "No example found for $ARG"
fi
if [ -d "$ROOT/$TEST" ]
then
cd $ROOT/$TEST
if [ -f ./CMakeLists.txt ]; then
build_tests
else
for dir in ./*
do
if [ -f $dir/CMakeLists.txt ]; then
cd $ROOT/$TEST/$dir
build_tests
fi
done
fi
elif [ "$ARG" != Polyhedron_demo ]; then
echo "No test found for $ARG"
fi
#Packages like Periodic_3_triangulation_3 contain multiple demos
for DEMO in $DEMOS; do
DEMO=${DEMO#"$ROOT"}
echo $DEMO
#If there is no demo subdir, try in GraphicsView
if [ ! -d "$ROOT/$DEMO" ] || [ ! -f "$ROOT/$DEMO/CMakeLists.txt" ]; then
DEMO="GraphicsView/demo/$ARG"
fi
if [ "$ARG" != Polyhedron ] && [ -d "$ROOT/$DEMO" ]
then
cd $ROOT/$DEMO
build_demo
elif [ "$ARG" != Polyhedron_demo ]; then
echo "No demo found for $ARG"
fi
done
if [ "$ARG" = Polyhedron_demo ]; then
DEMO=Polyhedron/demo/Polyhedron
cd "$ROOT/$DEMO"
build_demo
fi
done
IFS=$old_IFS
# Local Variables:
# tab-width: 2
# sh-basic-offset: 2
# End:

View File

@ -1,94 +0,0 @@
#!/bin/bash
CHECK=
case $1 in
--check) CHECK=y;;
esac
set -e
cd ../
if [ -f "$PWD/.travis/packages.txt" ]
then
rm "$PWD/.travis/packages.txt"
fi
#find all the packages
PACKAGES=()
INDEX=0
i=0
for f in *
do
if [ -d "$f/package_info/$f" ]
then
echo "$f" >> ./tmp.txt
fi
done
LC_ALL=C sort ./tmp.txt > ./.travis/packages.txt
rm ./tmp.txt
while read p; do
PACKAGES[$INDEX]+="$p "
i=$[i+1]
if [ $i = 3 ]
then
i=0
INDEX=$[INDEX+1]
fi
done <./.travis/packages.txt
if [ -f ".travis.yml" ]
then
#copy the current .travis.yml for later check
mv ./.travis.yml ./.travis.old
fi
#writes the first part of the file
old_IFS=$IFS
IFS=$'\n'
for LINE in $(cat "$PWD/.travis/template.txt")
do
if [ "$LINE" != " matrix:" ]
then
echo "$LINE" >> .travis.yml
else
break
fi
done
echo " matrix:" >> .travis.yml
#writes the matrix
echo " - PACKAGE='CHECK'" >> .travis.yml
for package in ${PACKAGES[@]}
do
echo " - PACKAGE='$package'" >> .travis.yml
done
#writes the end of the file
COPY=0
for LINE in $(cat "$PWD/.travis/template.txt")
do
if [ "$LINE" = "compiler: clang" ]
then
COPY=1
fi
if [ $COPY = 1 ]
then
echo "$LINE" >> .travis.yml
fi
done
IFS=$' '
#check if there are differences between the files
if ! cmp -s ./.travis.yml ./.travis.old;
then
echo ".travis.yml has changed : "
diff ./.travis.yml ./.travis.old
if [ -n "$CHECK" ]; then
echo "You should modify the file .travis/template.txt"
exit 1
fi
fi
#erase old travis
rm ./.travis.old
IFS=$old_IFS
# Local Variables:
# tab-width: 2
# sh-basic-offset: 2
# End:

View File

@ -1,16 +0,0 @@
#!/bin/bash
[ -n "$CGAL_DEBUG_TRAVIS" ] && set -x
DONE=0
sudo add-apt-repository ppa:mikhailnov/pulseeffects -y
sudo apt-get update
while [ $DONE = 0 ]
do
DONE=1 && sudo -E apt-get -yq --no-install-suggests --no-install-recommends --force-yes install clang-10 zsh \
flex bison cmake graphviz libgmp-dev libmpfr-dev libmpfi-dev zlib1g-dev libeigen3-dev \
qtbase5-dev libqt5sql5-sqlite libqt5opengl5-dev qtscript5-dev libqt5svg5-dev qttools5-dev qttools5-dev-tools qml-module-qtgraphicaleffects libopencv-dev mesa-common-dev libmetis-dev libglu1-mesa-dev \
libboost1.72-dev || DONE=0 && sudo apt-get update
done
exit 0

View File

@ -1,16 +0,0 @@
#!/bin/bash
mkdir -p openmesh
cd openmesh
wget -O openmesh.tar.gz https://www.openmesh.org/media/Releases/6.3/OpenMesh-6.3.tar.gz
tar xf openmesh.tar.gz --strip-components=1
sed -i '94i #include <sys/time.h>' src/OpenMesh/Tools/Utils/conio.cc
mkdir build
cd build
cmake -DBUILD_APPS=FALSE ..
make -j2
sudo make -j2 install &>/dev/null
#clean up
cd ../..
rm -rf ./openmesh

View File

@ -1,140 +0,0 @@
AABB_tree
Advancing_front_surface_reconstruction
Algebraic_foundations
Algebraic_kernel_d
Algebraic_kernel_for_circles
Algebraic_kernel_for_spheres
Alpha_shapes_2
Alpha_shapes_3
Apollonius_graph_2
Arithmetic_kernel
Arrangement_on_surface_2
BGL
Barycentric_coordinates_2
Boolean_set_operations_2
Bounding_volumes
Box_intersection_d
CGAL_Core
CGAL_ImageIO
CGAL_ipelets
Cartesian_kernel
Circular_kernel_2
Circular_kernel_3
Circulator
Classification
Combinatorial_map
Cone_spanners_2
Convex_decomposition_3
Convex_hull_2
Convex_hull_3
Convex_hull_d
Distance_2
Distance_3
Envelope_2
Envelope_3
Filtered_kernel
Generalized_map
Generator
Geomview
GraphicsView
HalfedgeDS
Hash_map
Heat_method_3
Homogeneous_kernel
Hyperbolic_triangulation_2
Inscribed_areas
Installation
Interpolation
Intersections_2
Intersections_3
Interval_skip_list
Interval_support
Inventor
Jet_fitting_3
Kernel_23
Kernel_d
LEDA
Linear_cell_complex
MacOSX
Maintenance
Matrix_search
Mesh_2
Mesh_3
Mesher_level
Minkowski_sum_2
Minkowski_sum_3
Modifier
Modular_arithmetic
Nef_2
Nef_3
Nef_S2
NewKernel_d
Number_types
OpenNL
Optimal_bounding_box
Optimal_transportation_reconstruction_2
Optimisation_basic
Partition_2
Periodic_2_triangulation_2
Periodic_3_mesh_3
Periodic_3_triangulation_3
Periodic_4_hyperbolic_triangulation_2
Point_set_2
Point_set_3
Point_set_processing_3
Poisson_surface_reconstruction_3
Polygon
Polygon_mesh_processing
Polygonal_surface_reconstruction
Polyhedron
Polyhedron_IO
Polyline_simplification_2
Polynomial
Polytope_distance_d
Principal_component_analysis
Principal_component_analysis_LGPL
Profiling_tools
Property_map
QP_solver
Random_numbers
Ridges_3
STL_Extension
Scale_space_reconstruction_3
Scripts
SearchStructures
Segment_Delaunay_graph_2
Segment_Delaunay_graph_Linf_2
Set_movable_separability_2
Shape_detection
Skin_surface_3
Snap_rounding_2
Solver_interface
Spatial_searching
Spatial_sorting
Straight_skeleton_2
Stream_lines_2
Stream_support
Subdivision_method_3
Surface_mesh
Surface_mesh_approximation
Surface_mesh_deformation
Surface_mesh_parameterization
Surface_mesh_segmentation
Surface_mesh_shortest_path
Surface_mesh_simplification
Surface_mesh_skeletonization
Surface_mesh_topology
Surface_mesher
Surface_sweep_2
TDS_2
TDS_3
Testsuite
Tetrahedral_remeshing
Three
Triangulation
Triangulation_2
Triangulation_3
Union_find
Visibility_2
Voronoi_diagram_2
wininst

View File

@ -1,34 +0,0 @@
language: cpp
dist: bionic
sudo: required
git:
depth: 3
env:
matrix:
PACKAGES_MATRIX
compiler: clang
install:
- echo "$PWD"
- if [ -n "$TRAVIS_PULL_REQUEST_BRANCH" ] && [ "$PACKAGE" != CHECK ]; then DO_IGNORE=FALSE; for ARG in $(echo "$PACKAGE");do if [ "$ARG" = "Maintenance" ]; then continue; fi; . $PWD/.travis/test_package.sh "$PWD" "$ARG"; echo "DO_IGNORE is $DO_IGNORE"; if [ "$DO_IGNORE" = "FALSE" ]; then break; fi; done; if [ "$DO_IGNORE" = "TRUE" ]; then travis_terminate 0; fi;fi
- /usr/bin/time -f 'Spend time of %C -- %E (real)' bash .travis/install.sh
- export CXX=clang++-10 CC=clang-10;
before_script:
- wget -O doxygen_exe https://cgal.geometryfactory.com/~mgimeno/doxygen_exe
- sudo mv doxygen_exe /usr/bin/doxygen
- sudo chmod +x /usr/bin/doxygen
- mkdir -p build
- cd build
- /usr/bin/time -f 'Spend time of %C -- %E (real)' cmake -DCMAKE_CXX_FLAGS="-std=c++1y" -DCGAL_HEADER_ONLY=ON -DCMAKE_CXX_FLAGS_RELEASE=-DCGAL_NDEBUG -DWITH_examples=ON -DWITH_demos=ON -DWITH_tests=ON ..
- /usr/bin/time -f 'Spend time of %C -- %E (real)' make
- /usr/bin/time -f 'Spend time of %C -- %E (real)' sudo make install &>/dev/null
- cd ..
script:
- cd ./.travis
- /usr/bin/time -f 'Spend time of %C -- %E (real)' bash ./build_package.sh $PACKAGE
notifications:
email:
on_success: change
# default: always
on_failure: always
# default: always

View File

@ -1,30 +0,0 @@
#!/bin/bash
#Will cd $1 and test package named $2
#to find out if it or one of its dependencies has changed in the current branch
DO_IGNORE=FALSE
cd $1
if [ ! -d "$2" ]; then
echo "$2 : MISSING PACKAGE. Ignoring."
DO_IGNORE=TRUE
exit 1
fi
if [ ! -f "$2/package_info/$2/dependencies" ];then
echo "No dependencies found for $2"
bash Scripts/developer_scripts/cgal_check_dependencies.sh --check_headers /usr/bin/doxygen
exit 1
fi
LIST_OF_FILES=$(git diff --name-only origin/master... |cut -d/ -f1 |uniq |sort)
LIST_OF_DEPS=$(cat "$2/package_info/$2/dependencies")
echo "$LIST_OF_DEPS"
for flie in $LIST_OF_DEPS
do
[[ $LIST_OF_FILES =~ (^|[[:space:]])$flie($|[[:space:]]) ]] && return
done
echo "Package ignored because none of its dependencies has been modified."
DO_IGNORE=TRUE

View File

@ -1,12 +0,0 @@
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
#define max(a,b) (((a) > (b)) ? (a) : (b))
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
#define min(a,b) (((a) < (b)) ? (a) : (b))
#define FAR #error named reserved in windows.h
#define far #error named reserved in windows.h
#define Polyline #error named reserved in windows.h
#define Polygon #error named reserved in windows.h

View File

@ -2,10 +2,16 @@
# This is the CMake script for compiling a CGAL application. # This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.14) cmake_minimum_required(VERSION 3.1...3.14)
project( AABB_traits_benchmark ) project(AABB_traits_benchmark)
find_package(CGAL REQUIRED QUIET OPTIONAL_COMPONENTS Core ) find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Core)
create_single_source_cgal_program( "test.cpp" ) # google benchmark
create_single_source_cgal_program( "tree_construction.cpp" ) find_package(benchmark)
if (benchmark_FOUND)
create_single_source_cgal_program("tree_creation.cpp")
target_link_libraries(tree_creation benchmark::benchmark)
endif()
create_single_source_cgal_program("test.cpp")
create_single_source_cgal_program("tree_construction.cpp")

View File

@ -0,0 +1,69 @@
#include <benchmark/benchmark.h>
#include <CGAL/AABB_tree.h>
#include <CGAL/AABB_traits.h>
#include <CGAL/AABB_face_graph_triangle_primitive.h>
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Surface_mesh.h>
#include <fstream>
typedef CGAL::Simple_cartesian<double> K;
typedef CGAL::Surface_mesh<K::Point_3> Surface_mesh;
typedef CGAL::AABB_face_graph_triangle_primitive<Surface_mesh> Primitive;
typedef CGAL::AABB_traits<K, Primitive> Traits;
typedef CGAL::AABB_tree<Traits> Tree;
typedef K::Segment_3 Segment;
typedef K::Point_3 Point_3;
Surface_mesh mesh;
static void BM_TreeCreation(benchmark::State& state)
{
for (auto _ : state)
{
benchmark::DoNotOptimize([]() {
Tree tree{mesh.faces_begin(), mesh.faces_end(), mesh};
tree.build();
return 0;
}());
}
}
BENCHMARK(BM_TreeCreation);
static void BM_Intersections(benchmark::State& state)
{
Point_3 p(-0.5, 0.03, 0.04);
Point_3 q(-0.5, 0.04, 0.06);
Tree tree{mesh.faces_begin(), mesh.faces_end(), mesh};
tree.accelerate_distance_queries();
Segment segment_query(p, q);
for (auto _ : state)
{
benchmark::DoNotOptimize([&]() {
tree.number_of_intersected_primitives(segment_query);
Point_3 point_query(2.0, 2.0, 2.0);
Point_3 closest = tree.closest_point(point_query);
return 0;
}());
}
}
BENCHMARK(BM_Intersections);
int main(int argc, char** argv)
{
const char* default_file = "data/handle.off";
const char* filename = argc > 2? argv[2] : default_file;
{
std::ifstream input(filename);
input >> mesh;
}
::benchmark::Initialize(&argc, argv);
::benchmark::RunSpecifiedBenchmarks();
return EXIT_SUCCESS;
}

View File

@ -19,18 +19,16 @@
#include <QApplication> #include <QApplication>
#include <CGAL/Qt/resources.h> #include <CGAL/Qt/resources.h>
#include <QMimeData> #include <QMimeData>
#include <CGAL/Qt/init_ogl_context.h>
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
CGAL::Qt::init_ogl_context(4,3);
QApplication app(argc, argv); QApplication app(argc, argv);
app.setOrganizationDomain("inria.fr"); app.setOrganizationDomain("inria.fr");
app.setOrganizationName("INRIA"); app.setOrganizationName("INRIA");
app.setApplicationName("AABB tree demo"); app.setApplicationName("AABB tree demo");
//for windows
#if (QT_VERSION >= QT_VERSION_CHECK(5, 3, 0))
app.setAttribute(Qt::AA_UseDesktopOpenGL);
#endif
// Import resources from libCGALQt (Qt5). // Import resources from libCGALQt (Qt5).
CGAL_QT_INIT_RESOURCES; CGAL_QT_INIT_RESOURCES;

View File

@ -1,7 +1,7 @@
# This is the CMake script for compiling the AABB tree demo. # This is the CMake script for compiling the AABB tree demo.
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.15)
project( AABB_tree_Demo ) project(AABB_tree_Demo)
# Find includes in corresponding build directories # Find includes in corresponding build directories
set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_INCLUDE_CURRENT_DIR ON)
@ -17,58 +17,56 @@ if(POLICY CMP0071)
endif() endif()
# Include this package's headers first # Include this package's headers first
include_directories( BEFORE ./ ./include ) include_directories(BEFORE ./ ./include)
# Find CGAL and CGAL Qt5 # Find CGAL and CGAL Qt5
find_package(CGAL COMPONENTS Qt5) find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5)
# Find Qt5 itself # Find Qt5 itself
find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Gui Svg) find_package(Qt5 QUIET COMPONENTS Script OpenGL Gui Svg)
if(CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND) if(CGAL_Qt5_FOUND AND Qt5_FOUND)
qt5_wrap_ui( UI_FILES MainWindow.ui ) qt5_wrap_ui(UI_FILES MainWindow.ui)
include(AddFileDependencies) include(AddFileDependencies)
qt5_generate_moc( "MainWindow.h" "${CMAKE_CURRENT_BINARY_DIR}/MainWindow_moc.cpp" ) qt5_generate_moc("MainWindow.h"
add_file_dependencies( MainWindow_moc.cpp "${CMAKE_CURRENT_SOURCE_DIR}/MainWindow.h" ) "${CMAKE_CURRENT_BINARY_DIR}/MainWindow_moc.cpp")
add_file_dependencies(MainWindow_moc.cpp
"${CMAKE_CURRENT_SOURCE_DIR}/MainWindow.h")
qt5_generate_moc( "Viewer.h" "${CMAKE_CURRENT_BINARY_DIR}/Viewer_moc.cpp" ) qt5_generate_moc("Viewer.h" "${CMAKE_CURRENT_BINARY_DIR}/Viewer_moc.cpp")
add_file_dependencies( Viewer_moc.cpp "${CMAKE_CURRENT_SOURCE_DIR}/Viewer.h" ) add_file_dependencies(Viewer_moc.cpp "${CMAKE_CURRENT_SOURCE_DIR}/Viewer.h")
qt5_generate_moc( "Scene.h" "${CMAKE_CURRENT_BINARY_DIR}/Scene_moc.cpp" ) qt5_generate_moc("Scene.h" "${CMAKE_CURRENT_BINARY_DIR}/Scene_moc.cpp")
add_file_dependencies( Scene_moc.cpp "${CMAKE_CURRENT_SOURCE_DIR}/Scene.h" ) add_file_dependencies(Scene_moc.cpp "${CMAKE_CURRENT_SOURCE_DIR}/Scene.h")
qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES AABB_demo.qrc ) qt5_add_resources(CGAL_Qt5_RESOURCE_FILES AABB_demo.qrc)
add_file_dependencies( AABB_demo.cpp "${CMAKE_CURRENT_BINARY_DIR}/MainWindow_moc.cpp" add_file_dependencies(
AABB_demo.cpp "${CMAKE_CURRENT_BINARY_DIR}/MainWindow_moc.cpp"
"${CMAKE_CURRENT_BINARY_DIR}/Viewer_moc.cpp" "${CMAKE_CURRENT_BINARY_DIR}/Viewer_moc.cpp"
"${CMAKE_CURRENT_BINARY_DIR}/Scene_moc.cpp" ) "${CMAKE_CURRENT_BINARY_DIR}/Scene_moc.cpp")
add_executable ( AABB_demo AABB_demo.cpp ${UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} add_executable(
AABB_demo AABB_demo.cpp ${UI_FILES} ${CGAL_Qt5_RESOURCE_FILES}
#${CGAL_Qt5_MOC_FILES} #${CGAL_Qt5_MOC_FILES}
) )
# Link with Qt libraries # Link with Qt libraries
target_link_libraries( AABB_demo PRIVATE target_link_libraries(AABB_demo PRIVATE Qt5::OpenGL Qt5::Gui
Qt5::OpenGL Qt5::Gui Qt5::Xml CGAL::CGAL CGAL::CGAL_Qt5)
CGAL::CGAL
CGAL::CGAL_Qt5
)
add_to_cached_list( CGAL_EXECUTABLE_TARGETS AABB_demo ) add_to_cached_list(CGAL_EXECUTABLE_TARGETS AABB_demo)
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
cgal_add_compilation_test(AABB_demo) cgal_add_compilation_test(AABB_demo)
else (CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND) else(CGAL_Qt5_FOUND
AND Qt5_FOUND)
set(AABB_MISSING_DEPS "") set(AABB_MISSING_DEPS "")
if(NOT CGAL_FOUND)
set(AABB_MISSING_DEPS "the CGAL library, ${AABB_MISSING_DEPS}")
endif()
if(NOT CGAL_Qt5_FOUND) if(NOT CGAL_Qt5_FOUND)
set(AABB_MISSING_DEPS "CGAL_Qt5, ${AABB_MISSING_DEPS}") set(AABB_MISSING_DEPS "CGAL_Qt5, ${AABB_MISSING_DEPS}")
endif() endif()
@ -77,6 +75,11 @@ else (CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND)
set(AABB_MISSING_DEPS "Qt5, ${AABB_MISSING_DEPS}") set(AABB_MISSING_DEPS "Qt5, ${AABB_MISSING_DEPS}")
endif() endif()
message(STATUS "NOTICE: This demo requires ${AABB_MISSING_DEPS}and will not be compiled.") message(
STATUS
"NOTICE: This demo requires ${AABB_MISSING_DEPS}and will not be compiled."
)
endif (CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) endif(
CGAL_Qt5_FOUND
AND Qt5_FOUND)

View File

@ -22,8 +22,6 @@ MainWindow::MainWindow(QWidget* parent)
// saves some pointers from ui, for latter use. // saves some pointers from ui, for latter use.
m_pViewer = ui->viewer; m_pViewer = ui->viewer;
// does not save the state of the viewer
m_pViewer->setStateFileName(QString());
// accepts drop events // accepts drop events
setAcceptDrops(true); setAcceptDrops(true);
@ -45,6 +43,7 @@ MainWindow::MainWindow(QWidget* parent)
MainWindow::~MainWindow() MainWindow::~MainWindow()
{ {
m_pViewer->makeCurrent();
delete ui; delete ui;
} }

View File

@ -91,8 +91,8 @@ void Scene::compile_shaders()
//Vertex source code //Vertex source code
const char vertex_source[] = const char vertex_source[] =
{ {
"#version 120 \n" "#version 150 \n"
"attribute highp vec4 vertex;\n" "in highp vec4 vertex;\n"
"uniform highp mat4 mvp_matrix;\n" "uniform highp mat4 mvp_matrix;\n"
"uniform highp mat4 f_matrix;\n" "uniform highp mat4 f_matrix;\n"
"void main(void)\n" "void main(void)\n"
@ -103,10 +103,11 @@ void Scene::compile_shaders()
//Vertex source code //Vertex source code
const char fragment_source[] = const char fragment_source[] =
{ {
"#version 120 \n" "#version 150 \n"
"uniform highp vec4 color; \n" "uniform highp vec4 color; \n"
"out highp vec4 out_color; \n"
"void main(void) { \n" "void main(void) { \n"
"gl_FragColor = color; \n" "out_color = color; \n"
"} \n" "} \n"
"\n" "\n"
}; };
@ -139,12 +140,12 @@ void Scene::compile_shaders()
//Vertex source code //Vertex source code
const char tex_vertex_source[] = const char tex_vertex_source[] =
{ {
"#version 120 \n" "#version 150 \n"
"attribute highp vec4 vertex;\n" "in highp vec4 vertex;\n"
"attribute highp vec2 tex_coord; \n" "in highp vec2 tex_coord; \n"
"uniform highp mat4 mvp_matrix;\n" "uniform highp mat4 mvp_matrix;\n"
"uniform highp mat4 f_matrix;\n" "uniform highp mat4 f_matrix;\n"
"varying highp vec2 texc;\n" "out highp vec2 texc;\n"
"void main(void)\n" "void main(void)\n"
"{\n" "{\n"
" gl_Position = mvp_matrix * f_matrix * vertex;\n" " gl_Position = mvp_matrix * f_matrix * vertex;\n"
@ -154,11 +155,12 @@ void Scene::compile_shaders()
//Vertex source code //Vertex source code
const char tex_fragment_source[] = const char tex_fragment_source[] =
{ {
"#version 120 \n" "#version 150 \n"
"uniform sampler2D texture;\n" "uniform sampler2D s_texture;\n"
"varying highp vec2 texc;\n" "in highp vec2 texc;\n"
"out highp vec4 out_color; \n"
"void main(void) { \n" "void main(void) { \n"
"gl_FragColor = texture2D(texture, texc.st);\n" "out_color = vec4(texture(s_texture, texc));\n"
"} \n" "} \n"
"\n" "\n"
}; };
@ -1319,12 +1321,8 @@ void Scene::deactivate_cutting_plane()
} }
void Scene::initGL() void Scene::initGL()
{ {
gl = new QOpenGLFunctions_2_1(); gl = new QOpenGLFunctions();
if(!gl->initializeOpenGLFunctions()) gl->initializeOpenGLFunctions();
{
qFatal("ERROR : OpenGL Functions not initialized. Check your OpenGL Verison (should be >=3.3)");
exit(1);
}
gl->glGenTextures(1, &textureId); gl->glGenTextures(1, &textureId);
compile_shaders(); compile_shaders();

View File

@ -86,7 +86,7 @@ public:
private: private:
// member data // member data
QOpenGLFunctions_2_1 *gl; QOpenGLFunctions *gl;
Bbox m_bbox; Bbox m_bbox;
Polyhedron *m_pPolyhedron; Polyhedron *m_pPolyhedron;
std::list<Point> m_points; std::list<Point> m_points;

View File

@ -35,7 +35,7 @@
\cgalCRPSection{Primitives} \cgalCRPSection{Primitives}
- `CGAL::AABB_triangle_primitive<GeomTraits, Iterator, CacheDatum>` - `CGAL::AABB_triangle_primitive<GeomTraits, Iterator, CacheDatum>`
- `CGAL::AABB_segment_primitive<GeomTraits, Iterator, CacheDatum>` - `CGAL::AABB_segment_primitive<GeomTraits, Iterator, CacheDatum>`
- `CGAL::AABB_primitive<Id,ObjectPropertyMap,PointPropertyMapPolyhedron,ExternalPropertyMaps,CacheDatum>` - `CGAL::AABB_primitive<Id,ObjectPropertyMap,PointPropertyMap,ExternalPropertyMaps,CacheDatum>`
- `CGAL::AABB_halfedge_graph_segment_primitive<HalfedgeGraph,Vpm,OneHalfedgeGraphPerTree,CacheDatum>` - `CGAL::AABB_halfedge_graph_segment_primitive<HalfedgeGraph,Vpm,OneHalfedgeGraphPerTree,CacheDatum>`
- `CGAL::AABB_face_graph_triangle_primitive<FaceGraph,Vpm,OneFaceGraphPerTree,CacheDatum>` - `CGAL::AABB_face_graph_triangle_primitive<FaceGraph,Vpm,OneFaceGraphPerTree,CacheDatum>`
*/ */

View File

@ -1,7 +1,5 @@
#include <iostream>
#include <fstream>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h> #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/AABB_tree.h> #include <CGAL/AABB_tree.h>
#include <CGAL/AABB_traits.h> #include <CGAL/AABB_traits.h>
#include <CGAL/Polyhedron_3.h> #include <CGAL/Polyhedron_3.h>
@ -9,6 +7,9 @@
#include <CGAL/AABB_face_graph_triangle_primitive.h> #include <CGAL/AABB_face_graph_triangle_primitive.h>
#include <CGAL/Timer.h> #include <CGAL/Timer.h>
#include <iostream>
#include <fstream>
typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef K::FT FT; typedef K::FT FT;
typedef K::Point_3 Point_3; typedef K::Point_3 Point_3;
@ -26,8 +27,12 @@ void triangle_mesh(const char* fname)
typedef CGAL::AABB_tree<Traits> Tree; typedef CGAL::AABB_tree<Traits> Tree;
TriangleMesh tmesh; TriangleMesh tmesh;
std::ifstream in(fname); if(!CGAL::read_polygon_mesh(fname, tmesh) || CGAL::is_triangle_mesh(tmesh))
in >> tmesh; {
std::cerr << "Invalid input." << std::endl;
return;
}
Timer t; Timer t;
t.start(); t.start();
Tree tree(faces(tmesh).first, faces(tmesh).second, tmesh); Tree tree(faces(tmesh).first, faces(tmesh).second, tmesh);
@ -36,7 +41,6 @@ void triangle_mesh(const char* fname)
std::cout << "Closest point to ORIGIN:" << tree.closest_point(CGAL::ORIGIN) << std::endl; std::cout << "Closest point to ORIGIN:" << tree.closest_point(CGAL::ORIGIN) << std::endl;
} }
Bbox_3 bbox(boost::graph_traits<Surface_mesh>::face_descriptor fd, Bbox_3 bbox(boost::graph_traits<Surface_mesh>::face_descriptor fd,
const Surface_mesh& p) const Surface_mesh& p)
{ {
@ -47,7 +51,6 @@ Bbox_3 bbox(boost::graph_traits<Surface_mesh>::face_descriptor fd,
return res; return res;
} }
void surface_mesh_cache_bbox(const char* fname) void surface_mesh_cache_bbox(const char* fname)
{ {
typedef boost::graph_traits<Surface_mesh>::face_descriptor face_descriptor; typedef boost::graph_traits<Surface_mesh>::face_descriptor face_descriptor;
@ -64,9 +67,9 @@ void surface_mesh_cache_bbox(const char* fname)
t.start(); t.start();
Bbox_pmap bb = tmesh.add_property_map<face_descriptor,Bbox_3>("f:bbox",Bbox_3()).first; Bbox_pmap bb = tmesh.add_property_map<face_descriptor,Bbox_3>("f:bbox",Bbox_3()).first;
for(face_descriptor fd : faces(tmesh)){ for(face_descriptor fd : faces(tmesh))
put(bb, fd, bbox(fd,tmesh)); put(bb, fd, bbox(fd,tmesh));
}
Traits traits(bb); Traits traits(bb);
Tree tree(traits); Tree tree(traits);
tree.insert(faces(tmesh).first, faces(tmesh).second, tmesh); tree.insert(faces(tmesh).first, faces(tmesh).second, tmesh);
@ -77,7 +80,6 @@ void surface_mesh_cache_bbox(const char* fname)
std::cout << "Closest point to ORIGIN:" << tree.closest_point(CGAL::ORIGIN) << std::endl; std::cout << "Closest point to ORIGIN:" << tree.closest_point(CGAL::ORIGIN) << std::endl;
} }
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
std::cout << "Polyhedron_3" << std::endl; std::cout << "Polyhedron_3" << std::endl;

View File

@ -1,14 +1,15 @@
#include <iostream>
#include <fstream>
#include <CGAL/Simple_cartesian.h> #include <CGAL/Simple_cartesian.h>
#include <CGAL/Surface_mesh.h>
#include <CGAL/AABB_tree.h> #include <CGAL/AABB_tree.h>
#include <CGAL/AABB_traits.h> #include <CGAL/AABB_traits.h>
#include <CGAL/Surface_mesh.h>
#include <CGAL/AABB_face_graph_triangle_primitive.h> #include <CGAL/AABB_face_graph_triangle_primitive.h>
#include <CGAL/Polygon_mesh_processing/compute_normal.h> #include <CGAL/Polygon_mesh_processing/compute_normal.h>
#include <CGAL/Polygon_mesh_processing/orientation.h> #include <CGAL/Polygon_mesh_processing/orientation.h>
#include <iostream>
#include <fstream>
typedef CGAL::Simple_cartesian<double> K; typedef CGAL::Simple_cartesian<double> K;
typedef K::FT FT; typedef K::FT FT;
typedef K::Point_3 Point; typedef K::Point_3 Point;
@ -24,8 +25,8 @@ typedef CGAL::AABB_traits<K, Primitive> Traits;
typedef CGAL::AABB_tree<Traits> Tree; typedef CGAL::AABB_tree<Traits> Tree;
typedef boost::optional<Tree::Intersection_and_primitive_id<Ray>::Type> Ray_intersection; typedef boost::optional<Tree::Intersection_and_primitive_id<Ray>::Type> Ray_intersection;
struct Skip
struct Skip { {
face_descriptor fd; face_descriptor fd;
Skip(const face_descriptor fd) Skip(const face_descriptor fd)
@ -44,14 +45,20 @@ struct Skip {
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
const char* filename = (argc > 1) ? argv[1] : "data/tetrahedron.off"; const char* filename = (argc > 1) ? argv[1] : "data/tetrahedron.off";
std::ifstream input(filename);
Mesh mesh; Mesh mesh;
input >> mesh; if(!CGAL::read_polygon_mesh(filename, mesh))
{
std::cerr << "Invalid input." << std::endl;
return 1;
}
Tree tree(faces(mesh).first, faces(mesh).second, mesh); Tree tree(faces(mesh).first, faces(mesh).second, mesh);
double d = CGAL::Polygon_mesh_processing::is_outward_oriented(mesh)?-1:1; double d = CGAL::Polygon_mesh_processing::is_outward_oriented(mesh)?-1:1;
for(face_descriptor fd : faces(mesh)){ for(face_descriptor fd : faces(mesh))
{
halfedge_descriptor hd = halfedge(fd,mesh); halfedge_descriptor hd = halfedge(fd,mesh);
Point p = CGAL::centroid(mesh.point(source(hd,mesh)), Point p = CGAL::centroid(mesh.point(source(hd,mesh)),
mesh.point(target(hd,mesh)), mesh.point(target(hd,mesh)),
@ -61,13 +68,16 @@ int main(int argc, char* argv[])
Ray ray(p,d * v); Ray ray(p,d * v);
Skip skip(fd); Skip skip(fd);
Ray_intersection intersection = tree.first_intersection(ray, skip); Ray_intersection intersection = tree.first_intersection(ray, skip);
if(intersection){ if(intersection)
{
if(boost::get<Point>(&(intersection->first))){ if(boost::get<Point>(&(intersection->first))){
const Point* p = boost::get<Point>(&(intersection->first) ); const Point* p = boost::get<Point>(&(intersection->first) );
std::cout << *p << std::endl; std::cout << *p << std::endl;
} }
} }
} }
std::cerr << "done" << std::endl; std::cerr << "done" << std::endl;
return 0; return 0;
} }

View File

@ -1,24 +1,16 @@
# Created by the script cgal_create_cmake_script # Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application. # This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.15)
project( AABB_tree_Examples ) project(AABB_tree_Examples)
find_package(CGAL REQUIRED)
find_package(CGAL QUIET) # create a target per cppfile
file(
if ( CGAL_FOUND ) GLOB cppfiles
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
# create a target per cppfile ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) foreach(cppfile ${cppfiles})
foreach(cppfile ${cppfiles}) create_single_source_cgal_program("${cppfile}")
create_single_source_cgal_program( "${cppfile}" ) endforeach()
endforeach()
else()
message(STATUS "This program requires the CGAL library, and will not be compiled.")
endif()

View File

@ -98,7 +98,7 @@ class AABB_face_graph_triangle_primitive
} }
public: public:
#ifdef DOXYGEN_RUNNING #ifdef DOXYGEN_RUNNING
/// \name Types /// \name Types
/// @{ /// @{
/*! /*!
@ -122,18 +122,32 @@ public:
If `OneFaceGraphPerTree` is CGAL::Tag_true, constructs a `Shared_data` object from a reference to the polyhedon `graph`. If `OneFaceGraphPerTree` is CGAL::Tag_true, constructs a `Shared_data` object from a reference to the polyhedon `graph`.
*/ */
static unspecified_type construct_shared_data( FaceGraph& graph ); static unspecified_type construct_shared_data( FaceGraph& graph );
#else #else
typedef typename Base::Id Id; typedef typename Base::Id Id;
#endif #endif
typedef typename boost::graph_traits<FaceGraph>::face_descriptor face_descriptor; typedef typename boost::graph_traits<FaceGraph>::face_descriptor face_descriptor;
// constructors // constructors
#ifdef DOXYGEN_RUNNING
/*! /*!
constructs a primitive.
\tparam Iterator an input iterator with `Id` as value type. \tparam Iterator an input iterator with `Id` as value type.
If `VertexPointPMap` is the default of the class, an additional constructor
is available with `vppm` set to `get(vertex_point, graph)`.
*/
template <class Iterator>
AABB_face_graph_triangle_primitive(Iterator it, const FaceGraph& graph, VertexPointPMap vppm);
/*!
constructs a primitive. constructs a primitive.
If `VertexPointPMap` is the default of the class, an additional constructor If `VertexPointPMap` is the default of the class, an additional constructor
is available with `vppm` set to `get(vertex_point, graph)`. is available with `vppm` set to `get(vertex_point, graph)`.
*/ */
AABB_face_graph_triangle_primitive(face_descriptor fd, const FaceGraph& graph, VertexPointPMap vppm);
#else
template <class Iterator> template <class Iterator>
AABB_face_graph_triangle_primitive(Iterator it, const FaceGraph& graph, VertexPointPMap_ vppm) AABB_face_graph_triangle_primitive(Iterator it, const FaceGraph& graph, VertexPointPMap_ vppm)
: Base( Id_(make_id(*it, graph, OneFaceGraphPerTree())), : Base( Id_(make_id(*it, graph, OneFaceGraphPerTree())),
@ -141,18 +155,12 @@ public:
Point_property_map(const_cast<FaceGraph*>(&graph),vppm) ) Point_property_map(const_cast<FaceGraph*>(&graph),vppm) )
{} {}
/*!
constructs a primitive.
If `VertexPointPMap` is the default of the class, an additional constructor
is available with `vppm` set to `get(vertex_point, graph)`.
*/
AABB_face_graph_triangle_primitive(face_descriptor fd, const FaceGraph& graph, VertexPointPMap_ vppm) AABB_face_graph_triangle_primitive(face_descriptor fd, const FaceGraph& graph, VertexPointPMap_ vppm)
: Base( Id_(make_id(fd, graph, OneFaceGraphPerTree())), : Base( Id_(make_id(fd, graph, OneFaceGraphPerTree())),
Triangle_property_map(const_cast<FaceGraph*>(&graph),vppm), Triangle_property_map(const_cast<FaceGraph*>(&graph),vppm),
Point_property_map(const_cast<FaceGraph*>(&graph),vppm) ) Point_property_map(const_cast<FaceGraph*>(&graph),vppm) )
{} {}
#ifndef DOXYGEN_RUNNING
template <class Iterator> template <class Iterator>
AABB_face_graph_triangle_primitive(Iterator it, const FaceGraph& graph) AABB_face_graph_triangle_primitive(Iterator it, const FaceGraph& graph)
: Base( Id_(make_id(*it, graph, OneFaceGraphPerTree())), : Base( Id_(make_id(*it, graph, OneFaceGraphPerTree())),

View File

@ -140,14 +140,27 @@ public:
#endif #endif
typedef typename boost::graph_traits<HalfedgeGraph>::edge_descriptor edge_descriptor; typedef typename boost::graph_traits<HalfedgeGraph>::edge_descriptor edge_descriptor;
#ifdef DOXYGEN_RUNNING
/*! /*!
constructs a primitive. constructs a primitive.
\tparam Iterator is an input iterator with `Id` as value type. \tparam Iterator is an input iterator with `Id` as value type.
This \ref AABB_tree/AABB_halfedge_graph_edge_example.cpp "example" gives a way to call this constructor This \ref AABB_tree/AABB_halfedge_graph_edge_example.cpp "example" gives a way to call this constructor
using the insert-by-range method of the class `AABB_tree<Traits>`. using the insert-by-range method of the class `AABB_tree<Traits>`.
If `VertexPointPMap` is the default of the class, an additional constructor If `VertexPointPMap` is the default of the class, an additional constructor
is available with `vppm` set to `boost::get(vertex_point, graph)`. is available with `vppm` set to `boost::get(vertex_point, graph)`.
*/ */
template <class Iterator>
AABB_halfedge_graph_segment_primitive(Iterator it, const HalfedgeGraph& graph, VertexPointPMap vppm);
/*!
constructs a primitive.
If `VertexPointPMap` is the default of the class, an additional constructor
is available with `vppm` set to `boost::get(vertex_point, graph)`.
*/
AABB_halfedge_graph_segment_primitive(edge_descriptor ed, const HalfedgeGraph& graph, VertexPointPMap vppm);
#else
template <class Iterator> template <class Iterator>
AABB_halfedge_graph_segment_primitive(Iterator it, const HalfedgeGraph& graph, VertexPointPMap_ vppm) AABB_halfedge_graph_segment_primitive(Iterator it, const HalfedgeGraph& graph, VertexPointPMap_ vppm)
: Base( Id_(make_id(*it, graph, OneHalfedgeGraphPerTree())), : Base( Id_(make_id(*it, graph, OneHalfedgeGraphPerTree())),
@ -155,18 +168,12 @@ public:
Point_property_map(const_cast<HalfedgeGraph*>(&graph), vppm) ) Point_property_map(const_cast<HalfedgeGraph*>(&graph), vppm) )
{} {}
/*!
constructs a primitive.
If `VertexPointPMap` is the default of the class, an additional constructor
is available with `vppm` set to `boost::get(vertex_point, graph)`.
*/
AABB_halfedge_graph_segment_primitive(edge_descriptor ed, const HalfedgeGraph& graph, VertexPointPMap_ vppm) AABB_halfedge_graph_segment_primitive(edge_descriptor ed, const HalfedgeGraph& graph, VertexPointPMap_ vppm)
: Base( Id_(make_id(ed, graph, OneHalfedgeGraphPerTree())), : Base( Id_(make_id(ed, graph, OneHalfedgeGraphPerTree())),
Segment_property_map(const_cast<HalfedgeGraph*>(&graph), vppm), Segment_property_map(const_cast<HalfedgeGraph*>(&graph), vppm),
Point_property_map(const_cast<HalfedgeGraph*>(&graph), vppm) ) Point_property_map(const_cast<HalfedgeGraph*>(&graph), vppm) )
{} {}
#ifndef DOXYGEN_RUNNING
template <class Iterator> template <class Iterator>
AABB_halfedge_graph_segment_primitive(Iterator it, const HalfedgeGraph& graph) AABB_halfedge_graph_segment_primitive(Iterator it, const HalfedgeGraph& graph)
: Base( Id_(make_id(*it, graph, OneHalfedgeGraphPerTree())), : Base( Id_(make_id(*it, graph, OneHalfedgeGraphPerTree())),
@ -177,7 +184,7 @@ public:
: Base( Id_(make_id(ed, graph, OneHalfedgeGraphPerTree())), : Base( Id_(make_id(ed, graph, OneHalfedgeGraphPerTree())),
Segment_property_map(const_cast<HalfedgeGraph*>(&graph)), Segment_property_map(const_cast<HalfedgeGraph*>(&graph)),
Point_property_map(const_cast<HalfedgeGraph*>(&graph)) ){} Point_property_map(const_cast<HalfedgeGraph*>(&graph)) ){}
#endif #endif
/// \internal /// \internal
typedef internal::Cstr_shared_data<HalfedgeGraph, Base, Segment_property_map, Point_property_map, OneHalfedgeGraphPerTree> Cstr_shared_data; typedef internal::Cstr_shared_data<HalfedgeGraph, Base, Segment_property_map, Point_property_map, OneHalfedgeGraphPerTree> Cstr_shared_data;

View File

@ -26,7 +26,6 @@
#include <CGAL/internal/AABB_tree/Primitive_helper.h> #include <CGAL/internal/AABB_tree/Primitive_helper.h>
#include <boost/optional.hpp> #include <boost/optional.hpp>
#include <boost/bind.hpp>
/// \file AABB_traits.h /// \file AABB_traits.h
@ -274,13 +273,13 @@ public:
switch(Traits::longest_axis(bbox)) switch(Traits::longest_axis(bbox))
{ {
case AT::CGAL_AXIS_X: // sort along x case AT::CGAL_AXIS_X: // sort along x
std::nth_element(first, middle, beyond, boost::bind(Traits::less_x,_1,_2,m_traits)); std::nth_element(first, middle, beyond, [this](const Primitive& p1, const Primitive& p2){ return Traits::less_x(p1, p2, this->m_traits); });
break; break;
case AT::CGAL_AXIS_Y: // sort along y case AT::CGAL_AXIS_Y: // sort along y
std::nth_element(first, middle, beyond, boost::bind(Traits::less_y,_1,_2,m_traits)); std::nth_element(first, middle, beyond, [this](const Primitive& p1, const Primitive& p2){ return Traits::less_y(p1, p2, this->m_traits); });
break; break;
case AT::CGAL_AXIS_Z: // sort along z case AT::CGAL_AXIS_Z: // sort along z
std::nth_element(first, middle, beyond, boost::bind(Traits::less_z,_1,_2,m_traits)); std::nth_element(first, middle, beyond, [this](const Primitive& p1, const Primitive& p2){ return Traits::less_z(p1, p2, this->m_traits); });
break; break;
default: default:
CGAL_error(); CGAL_error();
@ -429,6 +428,11 @@ public:
Closest_point closest_point_object() const {return Closest_point(*this);} Closest_point closest_point_object() const {return Closest_point(*this);}
Compare_distance compare_distance_object() const {return Compare_distance();} Compare_distance compare_distance_object() const {return Compare_distance();}
typedef enum { CGAL_AXIS_X = 0,
CGAL_AXIS_Y = 1,
CGAL_AXIS_Z = 2} Axis;
static Axis longest_axis(const Bounding_box& bbox);
private: private:
/** /**
@ -447,13 +451,6 @@ private:
return internal::Primitive_helper<AT>::get_datum(pr,*this).bbox(); return internal::Primitive_helper<AT>::get_datum(pr,*this).bbox();
} }
typedef enum { CGAL_AXIS_X = 0,
CGAL_AXIS_Y = 1,
CGAL_AXIS_Z = 2} Axis;
static Axis longest_axis(const Bounding_box& bbox);
/// Comparison functions /// Comparison functions
static bool less_x(const Primitive& pr1, const Primitive& pr2,const AABB_traits<GeomTraits,AABBPrimitive, BboxMap>& traits) static bool less_x(const Primitive& pr1, const Primitive& pr2,const AABB_traits<GeomTraits,AABBPrimitive, BboxMap>& traits)
{ {

View File

@ -13,6 +13,8 @@
#ifndef CGAL_AABB_TREE_H #ifndef CGAL_AABB_TREE_H
#define CGAL_AABB_TREE_H #define CGAL_AABB_TREE_H
#include <memory>
#include <CGAL/license/AABB_tree.h> #include <CGAL/license/AABB_tree.h>
#include <CGAL/disable_warnings.h> #include <CGAL/disable_warnings.h>
@ -62,6 +64,7 @@ namespace CGAL {
typedef std::vector<typename AABBTraits::Primitive> Primitives; typedef std::vector<typename AABBTraits::Primitive> Primitives;
typedef internal::Primitive_helper<AABBTraits> Helper; typedef internal::Primitive_helper<AABBTraits> Helper;
typedef AABB_tree<AABBTraits> Self;
public: public:
typedef AABBTraits AABB_traits; typedef AABBTraits AABB_traits;
@ -113,8 +116,17 @@ namespace CGAL {
/// class using `traits`. /// class using `traits`.
AABB_tree(const AABBTraits& traits = AABBTraits()); AABB_tree(const AABBTraits& traits = AABBTraits());
/// move constructor
AABB_tree(Self&&) noexcept;
/// assignment operator
Self& operator=(Self&&) noexcept;
// Disabled copy constructor & assignment operator
AABB_tree(const Self&) = delete;
Self& operator=(const Self&) = delete;
/** /**
* @brief Builds the datastructure from a sequence of primitives. * @brief Builds the data structure from a sequence of primitives.
* @param first iterator over first primitive to insert * @param first iterator over first primitive to insert
* @param beyond past-the-end iterator * @param beyond past-the-end iterator
* *
@ -475,10 +487,7 @@ public:
// clear nodes // clear nodes
void clear_nodes() void clear_nodes()
{ {
if( size() > 1 ) { m_nodes.clear();
delete [] m_p_root_node;
}
m_p_root_node = nullptr;
} }
// clears internal KD tree // clears internal KD tree
@ -491,8 +500,7 @@ public:
#endif #endif
{ {
CGAL_assertion( m_p_search_tree!=nullptr ); CGAL_assertion( m_p_search_tree!=nullptr );
delete m_p_search_tree; m_p_search_tree.reset();
m_p_search_tree = nullptr;
#ifdef CGAL_HAS_THREADS #ifdef CGAL_HAS_THREADS
m_atomic_search_tree_constructed.store(false, std::memory_order_relaxed); m_atomic_search_tree_constructed.store(false, std::memory_order_relaxed);
#else #else
@ -522,6 +530,22 @@ public:
private: private:
typedef AABB_node<AABBTraits> Node; typedef AABB_node<AABBTraits> Node;
/**
* @brief Builds the tree by recursive expansion.
* @param first the first primitive to insert
* @param last the last primitive to insert
* @param range the number of primitive of the range
*
* [first,last[ is the range of primitives to be added to the tree.
*/
template<typename ConstPrimitiveIterator, typename ComputeBbox, typename SplitPrimitives>
void expand(Node& node,
ConstPrimitiveIterator first,
ConstPrimitiveIterator beyond,
const std::size_t range,
const ComputeBbox& compute_bbox,
const SplitPrimitives& split_primitives,
const AABBTraits&);
public: public:
// returns a point which must be on one primitive // returns a point which must be on one primitive
@ -573,8 +597,8 @@ public:
AABBTraits m_traits; AABBTraits m_traits;
// set of input primitives // set of input primitives
Primitives m_primitives; Primitives m_primitives;
// single root node // tree nodes. first node is the root node
Node* m_p_root_node = nullptr; std::vector<Node> m_nodes;
#ifdef CGAL_HAS_THREADS #ifdef CGAL_HAS_THREADS
mutable CGAL_MUTEX build_mutex; // mutex used to protect const calls inducing build() and build_kd_tree() mutable CGAL_MUTEX build_mutex; // mutex used to protect const calls inducing build() and build_kd_tree()
#endif #endif
@ -594,7 +618,13 @@ public:
#endif #endif
const_cast< AABB_tree<AABBTraits>* >(this)->build(); const_cast< AABB_tree<AABBTraits>* >(this)->build();
} }
return m_p_root_node; return std::addressof(m_nodes[0]);
}
Node& new_node()
{
m_nodes.emplace_back();
return m_nodes.back();
} }
private: private:
const Primitive& singleton_data() const { const Primitive& singleton_data() const {
@ -603,7 +633,7 @@ public:
} }
// search KD-tree // search KD-tree
const Search_tree* m_p_search_tree = nullptr; mutable std::unique_ptr<const Search_tree> m_p_search_tree;
bool m_use_default_search_tree = true; // indicates whether the internal kd-tree should be built bool m_use_default_search_tree = true; // indicates whether the internal kd-tree should be built
#ifdef CGAL_HAS_THREADS #ifdef CGAL_HAS_THREADS
std::atomic<bool> m_atomic_need_build; std::atomic<bool> m_atomic_need_build;
@ -613,11 +643,6 @@ public:
mutable bool m_search_tree_constructed = false; mutable bool m_search_tree_constructed = false;
#endif #endif
private:
// Disabled copy constructor & assignment operator
typedef AABB_tree<AABBTraits> Self;
AABB_tree(const Self& src);
Self& operator=(const Self& src);
}; // end class AABB_tree }; // end class AABB_tree
@ -632,6 +657,30 @@ public:
#endif #endif
{} {}
template <typename Tr>
typename AABB_tree<Tr>::Self& AABB_tree<Tr>::operator=(Self&& tree) noexcept
{
m_traits = std::move(tree.m_traits);
m_primitives = std::move(tree.m_primitives);
m_nodes = std::move(tree.m_nodes);
m_p_search_tree = std::move(tree.m_p_search_tree);
m_use_default_search_tree = std::exchange(tree.m_use_default_search_tree, true);
#ifdef CGAL_HAS_THREADS
m_atomic_need_build = tree.m_atomic_need_build.load(std::memory_order_relaxed);
m_atomic_search_tree_constructed = tree.m_atomic_search_tree_constructed.load(std::memory_order_relaxed);
#else
m_need_build = std::exchange(tree.m_need_build, false);
m_search_tree_constructed = std::exchange(tree.m_search_tree_constructed, false);
#endif
return *this;
}
template<typename Tr>
AABB_tree<Tr>::AABB_tree(Self&& tree) noexcept
{
*this = std::move(tree);
}
template<typename Tr> template<typename Tr>
template<typename ConstPrimitiveIterator, typename ... T> template<typename ConstPrimitiveIterator, typename ... T>
AABB_tree<Tr>::AABB_tree(ConstPrimitiveIterator first, AABB_tree<Tr>::AABB_tree(ConstPrimitiveIterator first,
@ -704,6 +753,41 @@ public:
#endif #endif
} }
template<typename Tr>
template<typename ConstPrimitiveIterator, typename ComputeBbox, typename SplitPrimitives>
void
AABB_tree<Tr>::expand(Node& node,
ConstPrimitiveIterator first,
ConstPrimitiveIterator beyond,
const std::size_t range,
const ComputeBbox& compute_bbox,
const SplitPrimitives& split_primitives,
const Tr& traits)
{
node.set_bbox(compute_bbox(first, beyond));
// sort primitives along longest axis aabb
split_primitives(first, beyond, node.bbox());
switch(range)
{
case 2:
node.set_children(*first, *(first+1));
break;
case 3:
node.set_children(*first, new_node());
expand(node.right_child(), first+1, beyond, 2, compute_bbox, split_primitives, traits);
break;
default:
const std::size_t new_range = range/2;
node.set_children(new_node(), new_node());
expand(node.left_child(), first, first + new_range, new_range, compute_bbox, split_primitives, traits);
expand(node.right_child(), first + new_range, beyond, range - new_range, compute_bbox, split_primitives, traits);
}
}
// Build the data structure, after calls to insert(..)
template<typename Tr> template<typename Tr>
void AABB_tree<Tr>::build() void AABB_tree<Tr>::build()
{ {
@ -719,20 +803,15 @@ public:
const SplitPrimitives& split_primitives) const SplitPrimitives& split_primitives)
{ {
clear_nodes(); clear_nodes();
if(m_primitives.size() > 1) { if(m_primitives.size() > 1) {
// allocates tree nodes // allocates tree nodes
m_p_root_node = new Node[m_primitives.size()-1](); m_nodes.reserve(m_primitives.size()-1);
if(m_p_root_node == nullptr)
{
std::cerr << "Unable to allocate memory for AABB tree" << std::endl;
CGAL_assertion(m_p_root_node != nullptr);
m_primitives.clear();
clear();
}
// constructs the tree // constructs the tree
m_p_root_node->expand(m_primitives.begin(), m_primitives.end(), expand(new_node(),
m_primitives.begin(), m_primitives.end(),
m_primitives.size(), m_primitives.size(),
compute_bbox, compute_bbox,
split_primitives, split_primitives,
@ -768,10 +847,7 @@ public:
ConstPointIterator beyond) ConstPointIterator beyond)
{ {
clear_search_tree(); clear_search_tree();
m_p_search_tree = new Search_tree(first, beyond); m_p_search_tree = std::make_unique<const Search_tree>(first, beyond);
if(m_p_search_tree != nullptr)
{
#ifdef CGAL_HAS_THREADS #ifdef CGAL_HAS_THREADS
m_atomic_search_tree_constructed.store(true, std::memory_order_release); // in case build_kd_tree() is triggered by a call to best_hint() m_atomic_search_tree_constructed.store(true, std::memory_order_release); // in case build_kd_tree() is triggered by a call to best_hint()
#else #else
@ -779,12 +855,6 @@ public:
#endif #endif
return true; return true;
} }
else
{
std::cerr << "Unable to allocate memory for accelerating distance queries" << std::endl;
return false;
}
}
template<typename Tr> template<typename Tr>
void AABB_tree<Tr>::do_not_accelerate_distance_queries() void AABB_tree<Tr>::do_not_accelerate_distance_queries()
@ -793,7 +863,6 @@ public:
m_use_default_search_tree = false; m_use_default_search_tree = false;
} }
// constructs the search KD tree from internal primitives // constructs the search KD tree from internal primitives
template<typename Tr> template<typename Tr>
bool AABB_tree<Tr>::accelerate_distance_queries() bool AABB_tree<Tr>::accelerate_distance_queries()

View File

@ -32,6 +32,9 @@ namespace CGAL {
template<typename AABBTraits> template<typename AABBTraits>
class AABB_node class AABB_node
{ {
private:
typedef AABB_node<AABBTraits> Self;
public: public:
typedef typename AABBTraits::Bounding_box Bounding_box; typedef typename AABBTraits::Bounding_box Bounding_box;
@ -41,29 +44,15 @@ public:
, m_p_left_child(nullptr) , m_p_left_child(nullptr)
, m_p_right_child(nullptr) { }; , m_p_right_child(nullptr) { };
/// Non virtual Destructor AABB_node(Self&& node) = default;
/// Do not delete children because the tree hosts and delete them
~AABB_node() { }; // Disabled copy constructor & assignment operator
AABB_node(const Self& src) = delete;
Self& operator=(const Self& src) = delete;
/// Returns the bounding box of the node /// Returns the bounding box of the node
const Bounding_box& bbox() const { return m_bbox; } const Bounding_box& bbox() const { return m_bbox; }
/**
* @brief Builds the tree by recursive expansion.
* @param first the first primitive to insert
* @param last the last primitive to insert
* @param range the number of primitive of the range
*
* [first,last[ is the range of primitives to be added to the tree.
*/
template<typename ConstPrimitiveIterator, typename ComputeBbox, typename SplitPrimitives>
void expand(ConstPrimitiveIterator first,
ConstPrimitiveIterator beyond,
const std::size_t range,
const ComputeBbox& compute_bbox,
const SplitPrimitives& split_primitives,
const AABBTraits&);
/** /**
* @brief General traversal query * @brief General traversal query
* @param query the query * @param query the query
@ -95,8 +84,17 @@ public:
{ return *static_cast<Primitive*>(m_p_left_child); } { return *static_cast<Primitive*>(m_p_left_child); }
const Primitive& right_data() const const Primitive& right_data() const
{ return *static_cast<Primitive*>(m_p_right_child); } { return *static_cast<Primitive*>(m_p_right_child); }
template <class Left, class Right>
void set_children(Left& l, Right& r)
{
m_p_left_child = static_cast<void*>(std::addressof(l));
m_p_right_child = static_cast<void*>(std::addressof(r));
}
void set_bbox(const Bounding_box& bbox)
{
m_bbox = bbox;
}
private:
Node& left_child() { return *static_cast<Node*>(m_p_left_child); } Node& left_child() { return *static_cast<Node*>(m_p_left_child); }
Node& right_child() { return *static_cast<Node*>(m_p_right_child); } Node& right_child() { return *static_cast<Node*>(m_p_right_child); }
Primitive& left_data() { return *static_cast<Primitive*>(m_p_left_child); } Primitive& left_data() { return *static_cast<Primitive*>(m_p_left_child); }
@ -111,49 +109,8 @@ private:
void *m_p_left_child; void *m_p_left_child;
void *m_p_right_child; void *m_p_right_child;
private:
// Disabled copy constructor & assignment operator
typedef AABB_node<AABBTraits> Self;
AABB_node(const Self& src);
Self& operator=(const Self& src);
}; // end class AABB_node }; // end class AABB_node
template<typename Tr>
template<typename ConstPrimitiveIterator, typename ComputeBbox, typename SplitPrimitives>
void
AABB_node<Tr>::expand(ConstPrimitiveIterator first,
ConstPrimitiveIterator beyond,
const std::size_t range,
const ComputeBbox& compute_bbox,
const SplitPrimitives& split_primitives,
const Tr& traits)
{
m_bbox = compute_bbox(first, beyond);
// sort primitives along longest axis aabb
split_primitives(first, beyond, m_bbox);
switch(range)
{
case 2:
m_p_left_child = &(*first);
m_p_right_child = &(*(++first));
break;
case 3:
m_p_left_child = &(*first);
m_p_right_child = static_cast<Node*>(this)+1;
right_child().expand(first+1, beyond, 2, compute_bbox, split_primitives, traits);
break;
default:
const std::size_t new_range = range/2;
m_p_left_child = static_cast<Node*>(this) + 1;
m_p_right_child = static_cast<Node*>(this) + new_range;
left_child().expand(first, first + new_range, new_range, compute_bbox, split_primitives, traits);
right_child().expand(first + new_range, beyond, range - new_range, compute_bbox, split_primitives, traits);
}
}
template<typename Tr> template<typename Tr>
template<class Traversal_traits, class Query> template<class Traversal_traits, class Query>

View File

@ -83,7 +83,7 @@ namespace CGAL
typedef typename CGAL::Orthogonal_k_neighbor_search<TreeTraits> Neighbor_search; typedef typename CGAL::Orthogonal_k_neighbor_search<TreeTraits> Neighbor_search;
typedef typename Neighbor_search::Tree Tree; typedef typename Neighbor_search::Tree Tree;
private: private:
Tree* m_p_tree; Tree m_tree;
Point_and_primitive_id get_p_and_p(const Point_and_primitive_id& p) Point_and_primitive_id get_p_and_p(const Point_and_primitive_id& p)
@ -98,30 +98,22 @@ namespace CGAL
public: public:
template <class ConstPointIterator> template <class ConstPointIterator>
AABB_search_tree(ConstPointIterator begin, ConstPointIterator beyond) AABB_search_tree(ConstPointIterator begin, ConstPointIterator beyond)
: m_p_tree(nullptr) : m_tree{}
{ {
typedef typename Add_decorated_point<Traits, typename Traits::Primitive::Id>::Point_3 Decorated_point; typedef typename Add_decorated_point<Traits,typename Traits::Primitive::Id>::Point_3 Decorated_point;
std::vector<Decorated_point> points; std::vector<Decorated_point> points;
while(begin != beyond) { while(begin != beyond) {
Point_and_primitive_id pp = get_p_and_p(*begin); Point_and_primitive_id pp = get_p_and_p(*begin);
points.push_back(Decorated_point(pp.first,pp.second)); points.emplace_back(pp.first, pp.second);
++begin; ++begin;
} }
m_p_tree = new Tree(points.begin(), points.end()); m_tree.insert(points.begin(), points.end());
if(m_p_tree != nullptr) m_tree.build();
m_p_tree->build();
else
std::cerr << "unable to build the search tree!" << std::endl;
} }
~AABB_search_tree() {
delete m_p_tree;
}
Point_and_primitive_id closest_point(const Point& query) const Point_and_primitive_id closest_point(const Point& query) const
{ {
Neighbor_search search(*m_p_tree, query, 1); Neighbor_search search(m_tree, query, 1);
return Point_and_primitive_id(static_cast<Point>(search.begin()->first), search.begin()->first.id()); return Point_and_primitive_id(static_cast<Point>(search.begin()->first), search.begin()->first.id());
} }
}; };

View File

@ -1,26 +1,18 @@
# Created by the script cgal_create_cmake_script # Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application. # This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.15)
project( AABB_tree_Tests ) project(AABB_tree_Tests)
find_package(CGAL REQUIRED)
find_package(CGAL QUIET) include(${CGAL_USE_FILE}) # Kept to test the old behaviour.
if ( CGAL_FOUND )
include( ${CGAL_USE_FILE} ) # Kept to test the old behaviour.
# create a target per cppfile
file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
foreach(cppfile ${cppfiles})
create_single_source_cgal_program( "${cppfile}" )
endforeach()
else()
message(STATUS "This program requires the CGAL library, and will not be compiled.")
endif()
# create a target per cppfile
file(
GLOB cppfiles
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
foreach(cppfile ${cppfiles})
create_single_source_cgal_program("${cppfile}")
endforeach()

View File

@ -0,0 +1,207 @@
#include <iostream>
#include <list>
#include <utility>
#include <CGAL/AABB_face_graph_triangle_primitive.h>
#include <CGAL/AABB_halfedge_graph_segment_primitive.h>
#include <CGAL/AABB_segment_primitive.h>
#include <CGAL/AABB_traits.h>
#include <CGAL/AABB_tree.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Surface_mesh.h>
#include <CGAL/assertions.h>
#include <fstream>
template <int test_number>
class TestCase
{
};
// test 0 is from "aabb_test_singleton_tree"
template <>
class TestCase<0>
{
typedef CGAL::Simple_cartesian<double> K;
typedef K::FT FT;
typedef K::Point_3 Point;
typedef K::Plane_3 Plane;
typedef K::Segment_3 Segment;
typedef K::Triangle_3 Triangle;
typedef std::vector<Segment>::iterator Iterator;
typedef CGAL::AABB_segment_primitive<K, Iterator> Primitive;
typedef CGAL::AABB_traits<K, Primitive> Traits;
typedef CGAL::AABB_tree<Traits> Tree;
public:
Tree create_tree()
{
return Tree(segments.begin(), segments.end());
}
void init_tree(Tree&) {}
bool test_tree(Tree& tree)
{
Plane plane_query(a, b, d);
Triangle triangle_query(a, b, c);
// Test calls to all functions
CGAL::Emptyset_iterator devnull;
tree.all_intersections(triangle_query, devnull);
tree.all_intersected_primitives(triangle_query, devnull);
assert(tree.any_intersected_primitive(triangle_query));
assert(tree.any_intersection(triangle_query));
const CGAL::Bbox_3 bbox = tree.bbox();
assert(bbox == CGAL::Bbox_3(0, 0, 0, 2, 2, 2));
tree.clear();
tree.insert(segments.begin(), segments.end());
tree.build();
assert(tree.closest_point(Point(-0.1, -0.1, -0.1)) == Point(0, 0, 0));
assert(tree.closest_point(Point(-0.1, -0.1, -0.1), Point(0, 0, 0)) ==
Point(0, 0, 0));
assert(tree.closest_point_and_primitive(Point(-0.1, -0.1, -0.1)).second ==
segments.begin());
assert(tree.do_intersect(plane_query) == true);
assert(tree.do_intersect(triangle_query) == true);
assert(!tree.empty());
assert(tree.size() == 1);
tree.clear();
assert(tree.size() == 0);
tree.insert(segments.begin(), segments.end());
assert(tree.size() == 1);
assert(tree.number_of_intersected_primitives(plane_query) == 1);
tree.rebuild(segments.begin(), segments.end());
assert(tree.size() == 1);
assert(tree.number_of_intersected_primitives(triangle_query) == 1);
assert(tree.squared_distance(Point(0, 0, 0)) == 0);
return true;
}
private:
Point a = {1.0, 0.0, 0.0};
Point b = {0.0, 1.0, 0.0};
Point c = {0.0, 0.0, 1.0};
Point d = {0.0, 0.0, 0.0};
std::vector<Segment> segments = {Segment(Point(0, 0, 0), Point(2, 2, 2))};
};
// test 1 is from "aabb_test_all_intersected_primitives"
template <>
class TestCase<1>
{
typedef CGAL::Epick K;
typedef K::FT FT;
typedef K::Point_3 Point;
typedef K::Vector_3 Vector;
typedef K::Segment_3 Segment;
typedef K::Ray_3 Ray;
typedef CGAL::Surface_mesh<CGAL::Point_3<CGAL::Epick>> Mesh;
typedef CGAL::AABB_halfedge_graph_segment_primitive<Mesh, CGAL::Default,
CGAL::Tag_false>
S_Primitive;
typedef CGAL::AABB_face_graph_triangle_primitive<Mesh, CGAL::Default,
CGAL::Tag_false>
T_Primitive;
typedef CGAL::AABB_traits<K, T_Primitive> T_Traits;
typedef CGAL::AABB_traits<K, S_Primitive> S_Traits;
typedef CGAL::AABB_tree<T_Traits> T_Tree;
typedef CGAL::AABB_tree<S_Traits> S_Tree;
typedef T_Tree::Primitive_id T_Primitive_id;
typedef S_Tree::Primitive_id S_Primitive_id;
typedef std::pair<T_Tree, S_Tree> TreePair;
public:
TreePair create_tree()
{
static CGAL::Surface_mesh<CGAL::Point_3<CGAL::Epick>> m1 = {};
static CGAL::Surface_mesh<CGAL::Point_3<CGAL::Epick>> m2 = {};
static bool mesh_loaded = false;
if (!mesh_loaded) {
std::ifstream in("data/cube.off");
assert(in);
in >> m1;
in.close();
in.open("data/tetrahedron.off");
assert(in);
in >> m2;
in.close();
mesh_loaded = true;
}
return std::make_pair(T_Tree{faces(m1).first, faces(m1).second, m1},
S_Tree{edges(m2).first, edges(m2).second, m2});
}
void init_tree(TreePair& trees)
{
trees.first.build();
trees.second.build();
}
bool test_tree(TreePair& trees)
{
auto &cube_tree = trees.first;
auto &tet_tree = trees.second;
std::list<T_Tree::Primitive::Id> t_primitives;
std::list<S_Tree::Primitive::Id> s_primitives;
cube_tree.all_intersected_primitives(tet_tree,
std::back_inserter(t_primitives));
CGAL_assertion(t_primitives.size() == 6);
tet_tree.all_intersected_primitives(cube_tree,
std::back_inserter(s_primitives));
CGAL_assertion(s_primitives.size() == 6);
CGAL_assertion(tet_tree.do_intersect(cube_tree));
CGAL_assertion(cube_tree.do_intersect(tet_tree));
std::vector<T_Tree::Primitive::Id> all_primitives;
cube_tree.all_intersected_primitives(tet_tree,
std::back_inserter(all_primitives));
bool found_f5 = false;
for (auto prim : all_primitives) {
if ((int)prim.first == 5)
found_f5 = true;
}
CGAL_assertion(found_f5);
CGAL_USE(found_f5);
return true;
}
};
template <int test_number>
bool run_test()
{
TestCase<test_number> test_case;
// create_tree should return prvalue for guaranteed copy elision
auto tree_1 = test_case.create_tree();
test_case.init_tree(tree_1);
auto tree_2 = test_case.create_tree();
test_case.init_tree(tree_2);
auto tree_3 = test_case.create_tree();
test_case.init_tree(tree_3);
decltype(tree_1) tree_ctor{std::move(tree_2)};
decltype(tree_1) tree_assig{};
tree_assig = std::move(tree_3);
bool normal = test_case.test_tree(tree_1);
bool move_ctor = test_case.test_tree(tree_ctor);
bool move_ass =
test_case.test_tree(tree_assig); // test move assignment operator
if (!normal)
std::cout << "Test " << test_number << "failed on the original tree\n";
if (!move_ctor)
std::cout << "Test " << test_number << "failed on move constructed tree\n";
if (!move_ass)
std::cout << "Test " << test_number << "failed on move assigned tree\n";
return normal && move_ctor && move_ass;
}
int main() { return (run_test<0>() && run_test<1>()) ? 0 : 1; }

View File

@ -0,0 +1,159 @@
/*!
\ingroup PkgAdvancingFrontSurfaceReconstructionRef
\cgalConcept
The concept `AdvancingFrontSurfaceReconstructionTraits_3` describes the requirements
for the the geometric traits of the class `CGAL::Delaunay_triangulation_3`
used in the class `CGAL::Advancing_front_surface_reconstruction`.
It defines the geometric objects (points, segments...) forming the triangulation
together with a few geometric predicates and constructions on these objects.
\cgalRefines `DelaunayTriangulationTraits_3`
\cgalHasModel All models of `Kernel`.
*/
class AdvancingFrontSurfaceReconstructionTraits_3
{
public:
/// \name Types
/// @{
/*!
The coordinate type.
*/
typedef unspecified_type FT;
/*!
The vector type.
*/
typedef unspecified_type Vector_3;
/*!
The sphere type.
*/
typedef unspecified_type Sphere_3;
/*!
A constructor object that must provide the function operator
`Vector_3 operator()(Point_3 p, Point_3 q)`,
which constructs the vector `q-p`.
*/
typedef unspecified_type Construct_vector_3;
/*!
A constructor object that must provide the function operator
`Vector_3 operator()(Vector_3 v, Vector_3 w)`,
which returns the cross product of `v` and `w`.
*/
typedef unspecified_type Construct_cross_product_vector_3;
/*!
A constructor object that must provide the function operator
`FT operator()(Vector_3 v, Vector_3 w)`,
which returns the scalar (inner) product of `v` and `w`.
*/
typedef unspecified_type Compute_scalar_product_3;
/*!
A constructor object that must provide the function operator
`Sphere_3 operator()(Point_3 p, Point_3 q, Point_3 r)`,
which constructs a sphere initialized to the smallest sphere which passes
through the points `p`, `q`, and `r`.
*/
typedef unspecified_type Construct_sphere_3;
/*!
A constructor object that must provide the function operator
`Point_3 operator()(Sphere_3 s)`,
which returns the center of the sphere `s`.
*/
typedef unspecified_type Construct_center_3;
/*!
A constructor object that must provide the function operators
`FT operator()(Point_3 p, Point_3 q, Point_3 r, Point_3 s)`,
which returns the squared radius of the sphere passing through `p`, `q` and `r`,
and whose center is in the plane defined by these three points.
and
`FT operator()(Point_3 p, Point_3 q, Point_3 r, Point_3 s)`,
which returns the squared radius of the sphere passing through `p`, `q`, `r`, and `s`.
and
`FT operator()(Sphere_3 s)`,
which returns the squared radius of the sphere `s`.
*/
typedef unspecified_type Compute_squared_radius_3;
/*!
A constructor object that must provide the function operator
`FT operator()(Point_3 p, Point_3 q)`,
which returns the squared distance between the points `p` and `q`.
*/
typedef unspecified_type Compute_squared_distance_3;
/// @}
/// \name Operations
/// The following functions give access to the predicate and construction objects:
/// @{
/*!
gives access to the `Construct_vector_3` construction.
*/
Construct_vector_3 construct_vector_3_object();
/*!
gives access to the `Construct_cross_product_vector_3` construction.
*/
Construct_cross_product_vector_3 construct_cross_product_vector_3_object();
/*!
gives access to the `Compute_scalar_product_3` construction.
*/
Compute_scalar_product_3 compute_scalar_product_3_object();
/*!
gives access to the `Construct_sphere_3` construction.
*/
Construct_sphere_3 construct_sphere_3_object();
/*!
gives access to the `Construct_center_3` construction.
*/
Construct_center_3 construct_center_3_object();
/*!
gives access to the `Compute_squared_radius_3` construction.
*/
Compute_squared_radius_3 compute_squared_radius_3_object();
/*!
gives access to the `Compute_squared_distance_3` construction.
*/
Compute_squared_distance_3 compute_squared_distance_3_object();
/// @}
}; /* end AdvancingFrontSurfaceReconstructionTraits_3 */

View File

@ -1,5 +1,8 @@
/// \defgroup PkgAdvancingFrontSurfaceReconstructionRef Advancing Front Surface Reconstruction Reference /// \defgroup PkgAdvancingFrontSurfaceReconstructionRef Advancing Front Surface Reconstruction Reference
/// \defgroup PkgAdvancingFrontSurfaceReconstructionRefConcepts Concepts
/// \ingroup PkgAdvancingFrontSurfaceReconstructionRef
/*! /*!
\addtogroup PkgAdvancingFrontSurfaceReconstructionRef \addtogroup PkgAdvancingFrontSurfaceReconstructionRef
@ -25,6 +28,10 @@ of topological singularities. }
\cgalClassifedRefPages \cgalClassifedRefPages
\cgalCRPSection{Concepts}
- `AdvancingFrontSurfaceReconstructionTraits_3`
\cgalCRPSection{Classes} \cgalCRPSection{Classes}
- `CGAL::Advancing_front_surface_reconstruction` - `CGAL::Advancing_front_surface_reconstruction`

View File

@ -5,6 +5,7 @@ Algebraic_foundations
Circulator Circulator
Stream_support Stream_support
TDS_2 TDS_2
TDS_3
Triangulation_2 Triangulation_2
Triangulation_3 Triangulation_3
Number_types Number_types

View File

@ -1,24 +1,16 @@
# Created by the script cgal_create_cmake_script # Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application. # This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.15)
project( Advancing_front_surface_reconstruction_Examples ) project(Advancing_front_surface_reconstruction_Examples)
find_package(CGAL REQUIRED)
find_package(CGAL QUIET) # create a target per cppfile
file(
if ( CGAL_FOUND ) GLOB cppfiles
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
# create a target per cppfile ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) foreach(cppfile ${cppfiles})
foreach(cppfile ${cppfiles}) create_single_source_cgal_program("${cppfile}")
create_single_source_cgal_program( "${cppfile}" ) endforeach()
endforeach()
else()
message(STATUS "This program requires the CGAL library, and will not be compiled.")
endif()

View File

@ -9,7 +9,7 @@
#include <CGAL/Delaunay_triangulation_3.h> #include <CGAL/Delaunay_triangulation_3.h>
#include <CGAL/Triangulation_vertex_base_with_info_3.h> #include <CGAL/Triangulation_vertex_base_with_info_3.h>
#include <CGAL/Advancing_front_surface_reconstruction.h> #include <CGAL/Advancing_front_surface_reconstruction.h>
#include <CGAL/IO/read_xyz_points.h> #include <CGAL/IO/read_points.h>
#include <CGAL/disable_warnings.h> #include <CGAL/disable_warnings.h>
#include <boost/lexical_cast.hpp> #include <boost/lexical_cast.hpp>
@ -113,11 +113,8 @@ int main (int argc, char* argv[])
const char* fname = (argc>1) ? argv[1] : "data/cube.pwn"; const char* fname = (argc>1) ? argv[1] : "data/cube.pwn";
// Loading point set from a file. // Loading point set from a file.
std::ifstream stream(fname);
if (!stream || if (!CGAL::read_points(fname, std::back_inserter(points),
!CGAL::read_xyz_points(stream,
std::back_inserter(points),
CGAL::parameters::point_map(Point_map()). CGAL::parameters::point_map(Point_map()).
normal_map(Normal_map()))) normal_map(Normal_map())))
{ {

View File

@ -175,23 +175,42 @@ namespace CGAL {
store handles to the vertices and faces of the 3D triangulation, which enables the user to explore the store handles to the vertices and faces of the 3D triangulation, which enables the user to explore the
2D as well as 3D neighborhood of vertices and facets of the surface. 2D as well as 3D neighborhood of vertices and facets of the surface.
\tparam Dt must be a `Delaunay_triangulation_3` with \tparam Dt must be a `Delaunay_triangulation_3` whose `Traits` template parameter must be a model of
`Advancing_front_surface_reconstruction_vertex_base_3` and `Advancing_front_surface_reconstruction_cell_base_3` blended into the vertex and cell type. `AdvancingFrontSurfaceReconstructionTraits_3` and whose `Tds` template parameter must be
The default uses the `Exact_predicates_inexact_constructions_kernel` as geometric traits class. a model of `TriangulationDataStructure_3` with `Advancing_front_surface_reconstruction_vertex_base_3` and
`Advancing_front_surface_reconstruction_cell_base_3` blended into the vertex and cell type, respectively.
The default value is:
\code
CGAL::Delaunay_triangulation_3<CGAL::Exact_predicates_inexact_constructions_kernel,
CGAL::Triangulation_data_structure_3<
CGAL::Advancing_front_surface_reconstruction_vertex_base_3<
CGAL::Exact_predicates_inexact_constructions_kernel>,
CGAL::Advancing_front_surface_reconstruction_cell_base_3<
CGAL::Exact_predicates_inexact_constructions_kernel> > >`
\endcode
\tparam P must be a functor with `double operator()(AdvancingFront,Cell_handle,int)` returning the \tparam P must be a functor offering
priority of the facet `(Cell_handle,int)`. This functor enables the user to choose how candidate \code
triangles are prioritized. If a facet should not appear in the output, FT operator()(Advancing_front_surface_reconstruction,Cell_handle,int)
\endcode
returning the priority of the facet `(Cell_handle,int)`. This functor enables the user
to choose how candidate triangles are prioritized. If a facet should not appear in the output,
`infinity()` must be returned. It defaults to a functor that returns the `infinity()` must be returned. It defaults to a functor that returns the
`smallest_radius_delaunay_sphere()`. `smallest_radius_delaunay_sphere()`.
*/ */
template < template <class Dt = Default,
class Dt = Default,
class P = Default> class P = Default>
class Advancing_front_surface_reconstruction { class Advancing_front_surface_reconstruction
{
typedef typename Default::Get<Dt,Delaunay_triangulation_3<Exact_predicates_inexact_constructions_kernel, Triangulation_data_structure_3<Advancing_front_surface_reconstruction_vertex_base_3<Exact_predicates_inexact_constructions_kernel>, Advancing_front_surface_reconstruction_cell_base_3<Exact_predicates_inexact_constructions_kernel> > > >::type Triangulation; typedef typename Default::Get<Dt,
Delaunay_triangulation_3<
Exact_predicates_inexact_constructions_kernel,
Triangulation_data_structure_3<
Advancing_front_surface_reconstruction_vertex_base_3<
Exact_predicates_inexact_constructions_kernel>,
Advancing_front_surface_reconstruction_cell_base_3<
Exact_predicates_inexact_constructions_kernel> > > >::type Triangulation;
typedef typename Default::Get<P,AFSR::Default_priority>::type Priority; typedef typename Default::Get<P,AFSR::Default_priority>::type Priority;
public: public:
@ -202,9 +221,9 @@ namespace CGAL {
/*! /*!
The type of the 2D triangulation data structure describing the reconstructed surface, being a model of `TriangulationDataStructure_2`. The type of the 2D triangulation data structure describing the reconstructed surface, being a model of `TriangulationDataStructure_2`.
- The type `Triangulation_data_structure_2::Vertex` is model of the concept `TriangulationDataStructure_2::Vertex` and has additionally the - The type `Triangulation_data_structure_2::Vertex` is model of the concept `TriangulationDataStructure_2::Vertex` and has additionally the
method `vertex_3()` that returns a `#Vertex_handle` to the associated 3D vertex. method `vertex_3()` that returns a `Vertex_handle` to the associated 3D vertex.
- The type `Triangulation_data_structure_2::Face` is model of the concept `TriangulationDataStructure_2::Face` and has additionally the - The type `Triangulation_data_structure_2::Face` is model of the concept `TriangulationDataStructure_2::Face` and has additionally the
method `facet()` that returns the associated `#Facet`, and a method `bool is_on_surface()` method `facet()` that returns the associated `Facet`, and a method `bool is_on_surface()`
for testing if a face is part of the reconstructed surface or a face incident to a boundary edge. for testing if a face is part of the reconstructed surface or a face incident to a boundary edge.
In case the surface has boundaries, the 2D surface has one vertex which is associated to the infinite In case the surface has boundaries, the 2D surface has one vertex which is associated to the infinite
@ -213,15 +232,20 @@ namespace CGAL {
typedef unspecified_type Triangulation_data_structure_2; typedef unspecified_type Triangulation_data_structure_2;
/*! /*!
The type of the 3D triangulation. The type of the 3D Delaunay triangulation (the first template parameter).
*/ */
typedef unspecified_type Triangulation_3; typedef unspecified_type Triangulation_3;
/*! /*!
The type of the facet priority functor. The type of the facet priority functor (the second template parameter).
*/ */
typedef unspecified_type Priority; typedef unspecified_type Priority;
/*!
The number type.
*/
typedef typename Triangulation_3::Geom_traits::FT FT;
/*! /*!
The point type. The point type.
*/ */
@ -245,21 +269,21 @@ namespace CGAL {
/*! /*!
A bidirectional iterator range which enables to enumerate all points that were removed A bidirectional iterator range which enables to enumerate all points that were removed
from the 3D Delaunay triangulation during the surface reconstruction. The value type from the 3D Delaunay triangulation during the surface reconstruction. The value type
of the iterator is `#Point`. of the iterator is `Point`.
*/ */
typedef unspecified_type Outlier_range; typedef unspecified_type Outlier_range;
/*!
A bidirectional iterator range which enables to visit all vertices on a boundary.
The value type of the iterator is `Vertex_handle`.
*/
typedef unspecified_type Vertex_on_boundary_range;
/*! /*!
A bidirectional iterator range which enables to visit all boundaries. A bidirectional iterator range which enables to visit all boundaries.
The value type of the iterator is `Vertex_on_boundary_range`. The value type of the iterator is `Vertex_on_boundary_range`.
*/ */
typedef unspecified_type Boundary_range; typedef unspecified_type Boundary_range;
/*!
A bidirectional iterator range which enables to visit all vertices on a boundary.
The value type of the iterator is `#Vertex_handle`
*/
typedef unspecified_type Vertex_on_boundary_range;
/// @} /// @}
#endif #endif
@ -268,6 +292,7 @@ namespace CGAL {
typedef Advancing_front_surface_reconstruction<Dt,P> Extract; typedef Advancing_front_surface_reconstruction<Dt,P> Extract;
typedef typename Triangulation_3::Geom_traits Geom_traits; typedef typename Triangulation_3::Geom_traits Geom_traits;
typedef typename Kernel::FT FT;
typedef typename Kernel::FT coord_type; typedef typename Kernel::FT coord_type;
typedef typename Kernel::Point_3 Point; typedef typename Kernel::Point_3 Point;
@ -377,7 +402,23 @@ namespace CGAL {
std::list<Next_border_elt> nbe_pool; std::list<Next_border_elt> nbe_pool;
std::list<Intern_successors_type> ist_pool; std::list<Intern_successors_type> ist_pool;
public:
Vector construct_vector(const Point& p, const Point& q) const
{
return T.geom_traits().construct_vector_3_object()(p, q);
}
Vector construct_cross_product(const Vector& v, const Vector& w) const
{
return T.geom_traits().construct_cross_product_vector_3_object()(v, w);
}
FT compute_scalar_product(const Vector& v, const Vector& w) const
{
return T.geom_traits().compute_scalar_product_3_object()(v, w);
}
private:
Intern_successors_type* new_border() Intern_successors_type* new_border()
{ {
nbe_pool.resize(nbe_pool.size()+1); nbe_pool.resize(nbe_pool.size()+1);
@ -679,12 +720,14 @@ namespace CGAL {
++it; ++it;
}while(collinear(p,q,it->point())); }while(collinear(p,q,it->point()));
const Point& r = it->point(); const Point& r = it->point();
Vector u = q-r; Vector u = construct_vector(r, q);
Vector v = q-p; Vector v = construct_vector(p, q);
Vector w = r-p; Vector w = construct_vector(p, r);
Vector vw = cross_product(v,w); Vector vw = construct_cross_product(v,w);
double len = (std::max)(u*u,(std::max)(v*v,w*w)); double len = (std::max)(compute_scalar_product(u,u),
Point s = p + 10* len * (vw/(vw*vw)); (std::max)(compute_scalar_product(v,v),
compute_scalar_product(w,w)));
Point s = p + 10 * len * (vw/compute_scalar_product(vw,vw));
added_vertex = T.insert(s); added_vertex = T.insert(s);
} }
} }
@ -736,9 +779,9 @@ namespace CGAL {
\param radius_ratio_bound candidates incident to surface triangles which are not in the beta-wedge \param radius_ratio_bound candidates incident to surface triangles which are not in the beta-wedge
are discarded, if the ratio of their radius and the radius of the surface triangle is larger than `radius_ratio_bound`. are discarded, if the ratio of their radius and the radius of the surface triangle is larger than `radius_ratio_bound`.
Described in Section \ref AFSR_Boundaries Described in Section \ref AFSR_Boundaries.
\param beta half the angle of the wedge in which only the radius of triangles counts for the plausibility of candidates. \param beta half the angle of the wedge in which only the radius of triangles counts for the plausibility of candidates.
Described in Section \ref AFSR_Selection Described in Section \ref AFSR_Selection.
*/ */
void run(double radius_ratio_bound=5, double beta= 0.52) void run(double radius_ratio_bound=5, double beta= 0.52)
@ -1186,7 +1229,7 @@ namespace CGAL {
\param index index of the facet in `c` \param index index of the facet in `c`
*/ */
coord_type FT
smallest_radius_delaunay_sphere(const Cell_handle& c, smallest_radius_delaunay_sphere(const Cell_handle& c,
const int& index) const const int& index) const
{ {
@ -1249,16 +1292,16 @@ namespace CGAL {
const Point& pp2 = cc->vertex(i2)->point(); const Point& pp2 = cc->vertex(i2)->point();
const Point& pp3 = cc->vertex(i3)->point(); const Point& pp3 = cc->vertex(i3)->point();
Sphere facet_sphere(pp1, pp2, pp3); Sphere facet_sphere = T.geom_traits().construct_sphere_3_object()(pp1, pp2, pp3);
if (squared_distance(facet_sphere.center(), pp0) < if (squared_distance(T.geom_traits().construct_center_3_object()(facet_sphere), pp0) <
facet_sphere.squared_radius()) T.geom_traits().compute_squared_radius_3_object()(facet_sphere))
{ {
#ifdef AFSR_LAZY #ifdef AFSR_LAZY
value = lazy_squared_radius(cc); value = lazy_squared_radius(cc);
#else #else
// qualified with CGAL, to avoid a compilation error with clang // qualified with CGAL, to avoid a compilation error with clang
if(volume(pp0, pp1, pp2, pp3) != 0){ if(volume(pp0, pp1, pp2, pp3) != 0){
value = CGAL::squared_radius(pp0, pp1, pp2, pp3); value = T.geom_traits().compute_squared_radius_3_object()(pp0, pp1, pp2, pp3);
} else { } else {
typedef Exact_predicates_exact_constructions_kernel EK; typedef Exact_predicates_exact_constructions_kernel EK;
Cartesian_converter<Kernel, EK> to_exact; Cartesian_converter<Kernel, EK> to_exact;
@ -1280,26 +1323,30 @@ namespace CGAL {
cc = lazy_circumcenter(c); cc = lazy_circumcenter(c);
cn = lazy_circumcenter(n); cn = lazy_circumcenter(n);
#else #else
cc = CGAL::circumcenter(cp0, cp1, cp2, cp3); cc = T.geom_traits().construct_circumcenter_3_object()(cp0, cp1, cp2, cp3);
cn = CGAL::circumcenter(np0, np1, np2, np3); cn = T.geom_traits().construct_circumcenter_3_object()(np0, np1, np2, np3);
#endif #endif
// computation of the distance of cp1 to the dual segment cc, cn... // computation of the distance of cp1 to the dual segment cc, cn...
Vector V(cc - cn), Vc(cc - cp1), Vn(cp1 - cn); Vector V = construct_vector(cn, cc),
coord_type ac(V * Vc), an(V * Vn), norm_V(V * V); Vc = construct_vector(cp1, cc),
Vn = construct_vector(cn, cp1);
coord_type ac = compute_scalar_product(V, Vc),
an = compute_scalar_product(V, Vn),
norm_V = compute_scalar_product(V, V);
if ((ac > 0) && (an > 0)) if ((ac > 0) && (an > 0))
{ {
value = (Vc*Vc) - ac*ac/norm_V; value = compute_scalar_product(Vc, Vc) - ac*ac/norm_V;
if ((value < 0)||(norm_V > inv_eps_2)){ if ((value < 0)||(norm_V > inv_eps_2)){
// qualified with CGAL, to avoid a compilation error with clang // qualified with CGAL, to avoid a compilation error with clang
value = CGAL::squared_radius(cp1, cp2, cp3); value = T.geom_traits().compute_squared_radius_3_object()(cp1, cp2, cp3);
} }
} }
else else
{ {
if (ac <= 0) if (ac <= 0)
value = squared_distance(cc, cp1); value = T.geom_traits().compute_squared_distance_3_object()(cc, cp1);
else // (an <= 0) else // (an <= 0)
value = squared_distance(cn, cp1); value = T.geom_traits().compute_squared_distance_3_object()(cn, cp1);
} }
} }
} }
@ -1314,7 +1361,7 @@ namespace CGAL {
returns the infinite floating value that prevents a facet to be used. returns the infinite floating value that prevents a facet to be used.
*/ */
coord_type infinity() const { return std::numeric_limits<coord_type>::infinity(); } FT infinity() const { return std::numeric_limits<FT>::infinity(); }
/// @} /// @}
//--------------------------------------------------------------------- //---------------------------------------------------------------------
@ -1341,9 +1388,9 @@ namespace CGAL {
const Point& p2 = c->vertex(i2)->point(); const Point& p2 = c->vertex(i2)->point();
const Point& pc = c->vertex(i3)->point(); const Point& pc = c->vertex(i3)->point();
Vector P2P1 = p1-p2, P2Pn, PnP1; Vector P2P1 = construct_vector(p2, p1), P2Pn, PnP1;
Vector v2, v1 = cross_product(pc-p2, P2P1); Vector v2, v1 = construct_cross_product(construct_vector(p2, pc), P2P1);
coord_type norm, norm1 = v1*v1; coord_type norm, norm1 = v1*v1;
coord_type norm12 = P2P1*P2P1; coord_type norm12 = P2P1*P2P1;
@ -1375,12 +1422,12 @@ namespace CGAL {
{ {
const Point& pn = neigh->vertex(n_i3)->point(); const Point& pn = neigh->vertex(n_i3)->point();
P2Pn = pn-p2; P2Pn = construct_vector(p2, pn);
v2 = cross_product(P2P1,P2Pn); v2 = construct_cross_product(P2P1,P2Pn);
//pas necessaire de normer pour un bon echantillon: //pas necessaire de normer pour un bon echantillon:
// on peut alors tester v1*v2 >= 0 // on peut alors tester v1*v2 >= 0
norm = sqrt(norm1 * (v2*v2)); norm = sqrt(norm1 * compute_scalar_product(v2,v2));
pscal = v1*v2; pscal = v1*v2;
// check if the triangle will produce a sliver on the surface // check if the triangle will produce a sliver on the surface
bool sliver_facet = (pscal <= COS_ALPHA_SLIVER*norm); bool sliver_facet = (pscal <= COS_ALPHA_SLIVER*norm);
@ -1394,10 +1441,9 @@ namespace CGAL {
// We skip triangles having an internal angle along e // We skip triangles having an internal angle along e
// whose cosinus is smaller than -DELTA // whose cosinus is smaller than -DELTA
// that is the angle is larger than arcos(-DELTA) // that is the angle is larger than arcos(-DELTA)
border_facet = !((P2P1*P2Pn >= border_facet =
-DELTA*sqrt(norm12*(P2Pn*P2Pn)))&& !((P2P1*P2Pn >= -DELTA*sqrt(norm12*compute_scalar_product(P2Pn,P2Pn))) &&
(P2P1*PnP1 >= (P2P1*PnP1 >= -DELTA*sqrt(norm12*compute_scalar_product(PnP1,PnP1))));
-DELTA*sqrt(norm12*(PnP1*PnP1))));
// \todo investigate why we simply do not skip this triangle // \todo investigate why we simply do not skip this triangle
// but continue looking for a better candidate // but continue looking for a better candidate
// if (!border_facet){ // if (!border_facet){
@ -1569,9 +1615,11 @@ namespace CGAL {
int n_i3 = (6 - n_ind - n_i1 - n_i2); int n_i3 = (6 - n_ind - n_i1 - n_i2);
const Point& pn = neigh->vertex(n_i3)->point(); const Point& pn = neigh->vertex(n_i3)->point();
Vector v1 = cross_product(pc-p2,p1-p2), Vector v1 = construct_cross_product(construct_vector(p2, pc),
v2 = cross_product(p1-p2,pn-p2); construct_vector(p2, p1)),
coord_type norm = sqrt((v1*v1)*(v2*v2)); v2 = construct_cross_product(construct_vector(p2, p1),
construct_vector(p2, pn));
coord_type norm = sqrt(compute_scalar_product(v1, v1) * compute_scalar_product(v2, v2));
if (v1*v2 > COS_BETA*norm) if (v1*v2 > COS_BETA*norm)
return 1; // label bonne pliure sinon: return 1; // label bonne pliure sinon:
@ -2487,9 +2535,9 @@ namespace CGAL {
\param out output iterator \param out output iterator
\param radius_ratio_bound candidates incident to surface triangles which are not in the beta-wedge \param radius_ratio_bound candidates incident to surface triangles which are not in the beta-wedge
are discarded, if the ratio of their radius and the radius of the surface triangle is larger than `radius_ratio_bound`. are discarded, if the ratio of their radius and the radius of the surface triangle is larger than `radius_ratio_bound`.
Described in Section \ref AFSR_Boundaries Described in Section \ref AFSR_Boundaries.
\param beta half the angle of the wedge in which only the radius of triangles counts for the plausibility of candidates. \param beta half the angle of the wedge in which only the radius of triangles counts for the plausibility of candidates.
Described in Section \ref AFSR_Selection Described in Section \ref AFSR_Selection.
*/ */
template <typename PointInputIterator, typename IndicesOutputIterator> template <typename PointInputIterator, typename IndicesOutputIterator>
@ -2533,7 +2581,7 @@ namespace CGAL {
be convertible to `Exact_predicates_inexact_constructions_kernel::Point_3` with the `Cartesian_converter`. be convertible to `Exact_predicates_inexact_constructions_kernel::Point_3` with the `Cartesian_converter`.
\tparam IndicesOutputIterator must be an output iterator to which \tparam IndicesOutputIterator must be an output iterator to which
`std::array<std::size_t, 3>` can be assigned. `std::array<std::size_t, 3>` can be assigned.
\tparam Priority must be a functor with `double operator()(AdvancingFront,Cell_handle,int)` returning the \tparam Priority must be a functor with `double operator()(Advancing_front_surface_reconstruction,Cell_handle,int)` returning the
priority of the facet `(Cell_handle,int)`. priority of the facet `(Cell_handle,int)`.
\param b iterator on the first point of the sequence \param b iterator on the first point of the sequence

View File

@ -21,9 +21,9 @@ Modular_arithmetic
Number_types Number_types
Polygon Polygon
Polyhedron Polyhedron
Polyhedron_IO
Profiling_tools Profiling_tools
Property_map Property_map
Random_numbers
STL_Extension STL_Extension
Spatial_sorting Spatial_sorting
Stream_support Stream_support

View File

@ -1,24 +1,16 @@
# Created by the script cgal_create_cmake_script # Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application. # This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.15)
project( Advancing_front_surface_reconstruction_Tests ) project(Advancing_front_surface_reconstruction_Tests)
find_package(CGAL REQUIRED)
find_package(CGAL QUIET) # create a target per cppfile
file(
if ( CGAL_FOUND ) GLOB cppfiles
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
# create a target per cppfile ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) foreach(cppfile ${cppfiles})
foreach(cppfile ${cppfiles}) create_single_source_cgal_program("${cppfile}")
create_single_source_cgal_program( "${cppfile}" ) endforeach()
endforeach()
else()
message(STATUS "This program requires the CGAL library, and will not be compiled.")
endif()

View File

@ -22,7 +22,7 @@ namespace CGAL {
\ingroup PkgAlgebraicFoundationsRef \ingroup PkgAlgebraicFoundationsRef
The template function `compare()` compares the first argument with respect to The template function `compare()` compares the first argument with respect to
the second, i.e.\ it returns `CGAL::LARGER` if \f$ x\f$ is larger then \f$ y\f$. the second, i.e.\ it returns `CGAL::LARGER` if \f$ x\f$ is larger than \f$ y\f$.
In case the argument types `NT1` and `NT2` differ, In case the argument types `NT1` and `NT2` differ,
`compare` is performed with the semantic of the type determined via `compare` is performed with the semantic of the type determined via

View File

@ -1,24 +1,16 @@
# Created by the script cgal_create_cmake_script # Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application. # This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.15)
project( Algebraic_foundations_Examples ) project(Algebraic_foundations_Examples)
find_package(CGAL REQUIRED)
find_package(CGAL QUIET) # create a target per cppfile
file(
if ( CGAL_FOUND ) GLOB cppfiles
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
# create a target per cppfile ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) foreach(cppfile ${cppfiles})
foreach(cppfile ${cppfiles}) create_single_source_cgal_program("${cppfile}")
create_single_source_cgal_program( "${cppfile}" ) endforeach()
endforeach()
else()
message(STATUS "This program requires the CGAL library, and will not be compiled.")
endif()

View File

@ -14,7 +14,7 @@
/*! \file CGAL/Algebraic_extension_traits.h /*! \file CGAL/Algebraic_extension_traits.h
* \brief Defines traits class CGAL::Algebraic_extension_traits. * \brief defines traits class CGAL::Algebraic_extension_traits.
*/ */
#ifndef CGAL_ALGEBRAIC_NUMBER_TRAITS_H #ifndef CGAL_ALGEBRAIC_NUMBER_TRAITS_H

View File

@ -13,7 +13,7 @@
// ============================================================================= // =============================================================================
/*! \file NiX/Coercion_traits.h /*! \file NiX/Coercion_traits.h
* \brief Defines class NiX::Coercion_traits. * \brief defines class NiX::Coercion_traits.
* *
* Provides the general definition of the \c Coercion_traits<A,B> class, with * Provides the general definition of the \c Coercion_traits<A,B> class, with
* specializations for the builtin number types. * specializations for the builtin number types.

View File

@ -17,7 +17,7 @@
// they may be wrong now. // they may be wrong now.
/*! \file NiX/Fraction_traits.h /*! \file NiX/Fraction_traits.h
\brief Defines class NiX::Fraction_traits. \brief defines class NiX::Fraction_traits.
Provides dependent types and function objects for all the functions Provides dependent types and function objects for all the functions
beyond operators with specializations of the \c Fraction_traits<NT> beyond operators with specializations of the \c Fraction_traits<NT>

View File

@ -27,7 +27,7 @@ namespace CGAL {
class Parens_as_product_tag {}; class Parens_as_product_tag {};
/*! \ingroup NiX_io_parens /*! \ingroup NiX_io_parens
* \brief Decides whether this number requires parentheses * \brief decides whether this number requires parentheses
* in case it appears within a produkt. * in case it appears within a produkt.
*/ */
template <class NT> template <class NT>
@ -36,7 +36,7 @@ struct Needs_parens_as_product{
}; };
/*! \ingroup NiX_io_parens /*! \ingroup NiX_io_parens
* \brief Decides whether this number requires parentheses * \brief decides whether this number requires parentheses
* in case it appears within a produkt. * in case it appears within a produkt.
*/ */
template <class NT> template <class NT>

View File

@ -302,13 +302,13 @@ to_interval( const Real_embeddable& x) {
} }
template <typename NT> template <typename NT>
NT approximate_sqrt(const NT& nt, CGAL::Field_tag) NT approximate_sqrt(const NT& nt, CGAL::Null_functor)
{ {
return NT(sqrt(CGAL::to_double(nt))); return NT(sqrt(CGAL::to_double(nt)));
} }
template <typename NT> template <typename NT, typename Sqrt>
NT approximate_sqrt(const NT& nt, CGAL::Field_with_sqrt_tag) NT approximate_sqrt(const NT& nt, Sqrt sqrt)
{ {
return sqrt(nt); return sqrt(nt);
} }
@ -316,9 +316,12 @@ NT approximate_sqrt(const NT& nt, CGAL::Field_with_sqrt_tag)
template <typename NT> template <typename NT>
NT approximate_sqrt(const NT& nt) NT approximate_sqrt(const NT& nt)
{ {
// the initial version of this function was using Algebraic_category
// for the dispatch but some ring type (like Gmpz) provides a Sqrt
// functor even if not being Field_with_sqrt.
typedef CGAL::Algebraic_structure_traits<NT> AST; typedef CGAL::Algebraic_structure_traits<NT> AST;
typedef typename AST::Algebraic_category Algebraic_category; typedef typename AST::Sqrt Sqrt;
return approximate_sqrt(nt, Algebraic_category()); return approximate_sqrt(nt, Sqrt());
} }
CGAL_NTS_END_NAMESPACE CGAL_NTS_END_NAMESPACE

View File

@ -1,26 +1,18 @@
# Created by the script cgal_create_cmake_script # Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application. # This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.15)
project( Algebraic_foundations_Tests ) project(Algebraic_foundations_Tests)
find_package(CGAL REQUIRED COMPONENTS Core)
find_package(CGAL QUIET COMPONENTS Core) include(${CGAL_USE_FILE})
if ( CGAL_FOUND )
include(${CGAL_USE_FILE})
# create a target per cppfile
file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
foreach(cppfile ${cppfiles})
create_single_source_cgal_program( "${cppfile}" )
endforeach()
else()
message(STATUS "This program requires the CGAL library, and will not be compiled.")
endif()
# create a target per cppfile
file(
GLOB cppfiles
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
foreach(cppfile ${cppfiles})
create_single_source_cgal_program("${cppfile}")
endforeach()

View File

@ -1,28 +1,19 @@
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.15)
project( Algebraic_kernel_d_Examples ) project(Algebraic_kernel_d_Examples)
find_package(CGAL REQUIRED COMPONENTS Core)
find_package(MPFI QUIET)
find_package(CGAL QUIET COMPONENTS Core) if(MPFI_FOUND AND NOT CGAL_DISABLE_GMP)
include(${CGAL_USE_FILE})
if ( CGAL_FOUND ) include(${MPFI_USE_FILE})
find_package(MPFI QUIET) include(CGAL_VersionUtils)
endif() create_single_source_cgal_program("Compare_1.cpp")
create_single_source_cgal_program("Construct_algebraic_real_1.cpp")
if( CGAL_FOUND AND MPFI_FOUND) create_single_source_cgal_program("Isolate_1.cpp")
create_single_source_cgal_program("Sign_at_1.cpp")
include( ${CGAL_USE_FILE} ) create_single_source_cgal_program("Solve_1.cpp")
include( ${MPFI_USE_FILE} )
include( CGAL_VersionUtils )
create_single_source_cgal_program( "Compare_1.cpp" )
create_single_source_cgal_program( "Construct_algebraic_real_1.cpp" )
create_single_source_cgal_program( "Isolate_1.cpp" )
create_single_source_cgal_program( "Sign_at_1.cpp" )
create_single_source_cgal_program( "Solve_1.cpp" )
else() else()
message(STATUS "This program requires the CGAL, CGAL_Core and MPFI libraries, and will not be compiled.")
message(STATUS "This program requires the CGAL library and MPFI, and will not be compiled.")
endif() endif()

View File

@ -180,13 +180,13 @@ public:
} }
} }
/*! \brief Refines the isolating interval. */ /*! \brief refines the isolating interval. */
void refine() const{ this->ptr()->refine(); } void refine() const{ this->ptr()->refine(); }
/*! \brief Bisects the isolating interval. */ /*! \brief Bisects the isolating interval. */
void bisect() const{ this->ptr()->bisect(); } void bisect() const{ this->ptr()->bisect(); }
/*! \brief Refines the isolating interval until \a m is outside /*! \brief refines the isolating interval until \a m is outside
* the \c closed interval * the \c closed interval
*/ */
template < class NTX > template < class NTX >

View File

@ -375,7 +375,7 @@ public:
} }
/*! /*!
* \brief Gives an opportunity to process the nodes after * \brief gives an opportunity to process the nodes after
* the subdivision steps are finished * the subdivision steps are finished
* *
* This method must be specialised by derived classes, but can * This method must be specialised by derived classes, but can
@ -386,7 +386,7 @@ public:
return; return;
} }
/*! \brief Returns whether the \c i th root is definitely a simple root /*! \brief returns whether the \c i th root is definitely a simple root
* of the isolated polynomial * of the isolated polynomial
* *
* Must be specialised by derived class * Must be specialised by derived class
@ -396,7 +396,7 @@ public:
return false; return false;
} }
/*! \brief Returns whether the \c i th root is definitely a multiple root /*! \brief returns whether the \c i th root is definitely a multiple root
* of the isolated polynomial * of the isolated polynomial
* *
* Must be specialised by derived class * Must be specialised by derived class
@ -1040,7 +1040,7 @@ public:
} }
/*! \brief Returns whether the \c i th root is definitely a simple root /*! \brief returns whether the \c i th root is definitely a simple root
* of the isolated polynomial * of the isolated polynomial
* *
*/ */
@ -1048,7 +1048,7 @@ public:
return false; return false;
} }
/*! \brief Returns whether the \c i th root is definitely /*! \brief returns whether the \c i th root is definitely
* a multiple root * a multiple root
* of the isolated polynomial * of the isolated polynomial
* *
@ -1372,7 +1372,7 @@ public:
bool is_exact_root(int) const { return false; } bool is_exact_root(int) const { return false; }
/*! /*!
* \brief Returns true if the <tt>i</tt>th root is known to be a simple * \brief returns true if the <tt>i</tt>th root is known to be a simple
* root of the curve. * root of the curve.
*/ */
bool is_certainly_simple_root(int i) const { bool is_certainly_simple_root(int i) const {
@ -1381,7 +1381,7 @@ public:
} }
/*! /*!
* \brief Returns true if the <tt>i</tt>th root is known to be a multiple * \brief returns true if the <tt>i</tt>th root is known to be a multiple
* root of the curve. * root of the curve.
*/ */
bool is_certainly_multiple_root(int i) const { bool is_certainly_multiple_root(int i) const {
@ -1391,7 +1391,7 @@ public:
/*! /*!
* \brief Returns the multiplicity of the root if know, otherwise -1 * \brief returns the multiplicity of the root if know, otherwise -1
*/ */
int multiplicity_of_root(int i) const { int multiplicity_of_root(int i) const {
CGAL_assertion(is_isolated()); CGAL_assertion(is_isolated());
@ -1407,7 +1407,7 @@ public:
} }
/*! /*!
* \brief Returns the isolator of the polynomial f(1/x + q), if known * \brief returns the isolator of the polynomial f(1/x + q), if known
*/ */
Self inverse_transform_isolator() const { Self inverse_transform_isolator() const {
return this->ptr()->inverse_transform_isolator(); return this->ptr()->inverse_transform_isolator();

View File

@ -707,13 +707,13 @@ public:
this->ptr()->node_list_.erase(n); this->ptr()->node_list_.erase(n);
} }
/*! \brief Replace traits class /*! \brief replaces traits class
*/ */
void set_traits(TRAITS& traits) { void set_traits(TRAITS& traits) {
this->ptr()->b_from_p_.set_traits(traits); this->ptr()->b_from_p_.set_traits(traits);
} }
/*! \brief Returns a copy of this with its own representation /*! \brief returns a copy of this with its own representation
*/ */
Self make_unique() const { Self make_unique() const {
Self tmp = *this; Self tmp = *this;

View File

@ -1079,7 +1079,7 @@ public:
this->ptr()->node_list_.erase(n); this->ptr()->node_list_.erase(n);
} }
/*! \brief Replace traits class /*! \brief replaces traits class
*/ */
void set_traits(TRAITS& traits) { void set_traits(TRAITS& traits) {
@ -1090,7 +1090,7 @@ public:
} }
/*! \brief Returns a copy of this with its own representation /*! \brief returns a copy of this with its own representation
*/ */
Self make_unique() const { Self make_unique() const {
Self tmp = *this; Self tmp = *this;

View File

@ -512,7 +512,7 @@ public:
private: private:
/* /*
* \brief Sets all status lines at events and of intervals * \brief sets all status lines at events and of intervals
* *
* Writes the status lines of events and interval into the object. * Writes the status lines of events and interval into the object.
* The value type of both \c InputIterator1 and \c InputIterator2 * The value type of both \c InputIterator1 and \c InputIterator2
@ -571,7 +571,7 @@ private:
public: public:
/*! \brief Returns whether the curve has a valid defining polynomial /*! \brief returns whether the curve has a valid defining polynomial
*/ */
bool has_defining_polynomial() const { bool has_defining_polynomial() const {
return bool(this->ptr()->f); return bool(this->ptr()->f);
@ -579,7 +579,7 @@ public:
public: public:
/*! \brief Sets the defining polynomial. /*! \brief sets the defining polynomial.
* *
* \pre The object has no defining polynomial yet. * \pre The object has no defining polynomial yet.
*/ */
@ -595,7 +595,7 @@ public:
public: public:
/*! /*!
* \brief Returns whether the curve is y-regular * \brief returns whether the curve is y-regular
* *
* A curve is called y-regular if the leading coefficient of its defining * A curve is called y-regular if the leading coefficient of its defining
* polynomial wrt y is a constant, i.e., contains no x * polynomial wrt y is a constant, i.e., contains no x
@ -646,7 +646,7 @@ public:
public: public:
/*! /*!
* \brief Returns the number of event lines of the curve * \brief returns the number of event lines of the curve
* *
* Algebraically, the number of real roots of the discriminant of * Algebraically, the number of real roots of the discriminant of
* the curve's defining equation is returned. * the curve's defining equation is returned.
@ -664,7 +664,7 @@ public:
public: public:
/*! /*!
* \brief Returns whether the given x-coordinate is critical for the curve * \brief returns whether the given x-coordinate is critical for the curve
* and which event or interval index the x-coordinate belongs to. * and which event or interval index the x-coordinate belongs to.
* *
* \param is_event is set to \c true if the curve has an event * \param is_event is set to \c true if the curve has an event
@ -734,7 +734,7 @@ public:
private: private:
/* /*
* \brief Returns a status line for an exact value \c alpha that * \brief returns a status line for an exact value \c alpha that
* is not an event of the curve * is not an event of the curve
* *
* This function controls the internal cache that stores already created * This function controls the internal cache that stores already created
@ -1167,7 +1167,7 @@ private:
public: public:
/*! /*!
* \brief Returns the status line for the interval * \brief returns the status line for the interval
* preceeding the <tt>i</tt>th event * preceeding the <tt>i</tt>th event
* *
* Returns a status line for a reference x-coordinate of the <tt>i</tt>th * Returns a status line for a reference x-coordinate of the <tt>i</tt>th
@ -1235,7 +1235,7 @@ public:
private: private:
/* /*
* \brief Creates an intermediate line at position \c ar. * \brief creates an intermediate line at position \c ar.
* *
* It is required that none of the following situations occurs at position * It is required that none of the following situations occurs at position
* <tt>ar</tt>: singularity, vertical tangent line, vertical asymptote.\n * <tt>ar</tt>: singularity, vertical tangent line, vertical asymptote.\n
@ -1279,7 +1279,7 @@ private:
private: private:
/* /*
* \brief Returns an Event_line_builder instance * \brief returns an Event_line_builder instance
* *
* Note: So far, a new instance is created each time the function is called * Note: So far, a new instance is created each time the function is called
*/ */
@ -1444,7 +1444,7 @@ private:
public: public:
/*! /*!
* \brief Returns the <tt>i</tt>th Sturm-Habicht polynomial * \brief returns the <tt>i</tt>th Sturm-Habicht polynomial
* of the primitive part of the defining polynomial * of the primitive part of the defining polynomial
*/ */
Polynomial_2 sturm_habicht_of_primitive(size_type i) const Polynomial_2 sturm_habicht_of_primitive(size_type i) const
@ -1458,7 +1458,7 @@ public:
public: public:
/*! /*!
* \brief Returns the <tt>i</tt>th principal Sturm-Habicht coefficient * \brief returns the <tt>i</tt>th principal Sturm-Habicht coefficient
* of the primitive part of the defining polynomial * of the primitive part of the defining polynomial
*/ */
Polynomial_1 principal_sturm_habicht_of_primitive(size_type i) const Polynomial_1 principal_sturm_habicht_of_primitive(size_type i) const
@ -1477,7 +1477,7 @@ public:
public: public:
/*! /*!
* \brief Returns the <tt>i</tt>th coprincipal Sturm-Habicht coefficient * \brief returns the <tt>i</tt>th coprincipal Sturm-Habicht coefficient
* of the primitive part of the defining polynomial * of the primitive part of the defining polynomial
* *
* The coprincipal Sturm-Habicht coefficient is the coefficient * The coprincipal Sturm-Habicht coefficient is the coefficient
@ -1498,7 +1498,7 @@ public:
public: public:
/*! /*!
* \brief Returns an iterator to the principal Sturm-Habicht coefficients, * \brief returns an iterator to the principal Sturm-Habicht coefficients,
* starting with the <tt>0</tt>th one (the resultant) * starting with the <tt>0</tt>th one (the resultant)
*/ */
Principal_sturm_habicht_iterator principal_sturm_habicht_begin() const { Principal_sturm_habicht_iterator principal_sturm_habicht_begin() const {
@ -1930,7 +1930,7 @@ private:
public: public:
/*! /*!
* \brief Returns a \c Curve_analysis_2 object for a sheared curve. * \brief returns a \c Curve_analysis_2 object for a sheared curve.
* *
* The shear factor is given by the integer \c s. * The shear factor is given by the integer \c s.
* This functions only shears the primitive part of the defining equation. * This functions only shears the primitive part of the defining equation.
@ -2007,7 +2007,7 @@ public:
* *
* For each status line at an event and each status line that represents * For each status line at an event and each status line that represents
* an interval, all y-coordinates are approximated such that their * an interval, all y-coordinates are approximated such that their
* isolating interval has absolute size smaller then \c precision. * isolating interval has absolute size smaller than \c precision.
*/ */
void refine_all(Bound precision) { void refine_all(Bound precision) {
@ -2082,7 +2082,7 @@ public:
public: public:
/*! /*!
* \brief Returns the limit an infinite arc converges to * \brief returns the limit an infinite arc converges to
* *
* \pre <tt>loc==CGAL::LEFT_BOUNDARY || * \pre <tt>loc==CGAL::LEFT_BOUNDARY ||
* loc==CGAL::RIGHT_BOUNDARY</tt> * loc==CGAL::RIGHT_BOUNDARY</tt>
@ -2399,7 +2399,7 @@ private:
}; // class Algebraic_curve_2_2 }; // class Algebraic_curve_2_2
//! \brief Prints the objects. //! \brief prints the objects.
template<typename AlgebraicKernelWithAnalysis_2, template<typename AlgebraicKernelWithAnalysis_2,
typename Rep_> typename Rep_>
std::ostream& operator<< ( std::ostream& operator<< (
@ -2507,7 +2507,7 @@ std::ostream& operator<< (
return out; return out;
} }
//! \brief Reads the objects from stream //! \brief reads the objects from stream
template<typename AlgebraicKernelWithAnalysis_2, template<typename AlgebraicKernelWithAnalysis_2,
typename Rep_> typename Rep_>
std::istream& operator>> ( std::istream& operator>> (

View File

@ -611,7 +611,7 @@ public:
public: public:
/* /*
* \brief Returns the indices of the <tt>i</tt>th event value * \brief returns the indices of the <tt>i</tt>th event value
* *
* Returns a Event_indices <tt>(fg,ffy,ggy)</tt> such that * Returns a Event_indices <tt>(fg,ffy,ggy)</tt> such that
* the <tt>i</tt>th event root is the <tt>fg</tt>th root of the * the <tt>i</tt>th event root is the <tt>fg</tt>th root of the
@ -963,7 +963,7 @@ public:
} }
/*! /*!
* \brief Returns the number of event slices * \brief returns the number of event slices
* *
* Precisely, this is the number of points which are either root of * Precisely, this is the number of points which are either root of
* the resultant of the two curves, or root of discriminant of one * the resultant of the two curves, or root of discriminant of one
@ -1171,7 +1171,7 @@ private:
Integer s) const; Integer s) const;
/* /*
* \brief Reduces the number of possible intersections * \brief reduces the number of possible intersections
* *
* At the position given by the event lins \c e1 and \c e2 and the slice * At the position given by the event lins \c e1 and \c e2 and the slice
* info object \c slice, the points on the event lines are further refined * info object \c slice, the points on the event lines are further refined
@ -1197,7 +1197,7 @@ private:
}; // end of Curve_pair_analysis_2 }; // end of Curve_pair_analysis_2
//! \brief Prints the objects. //! \brief prints the objects.
template<typename AlgebraicKernelWithAnalysis_2> template<typename AlgebraicKernelWithAnalysis_2>
std::ostream& operator<< std::ostream& operator<<
(std::ostream& out, (std::ostream& out,

View File

@ -16,7 +16,7 @@
// they may be wrong now. // they may be wrong now.
/*! \file NiX/Descartes.h /*! \file NiX/Descartes.h
\brief Defines class NiX::Descartes. \brief defines class NiX::Descartes.
Isolate real roots of polynomials. Isolate real roots of polynomials.

View File

@ -114,7 +114,7 @@ public:
/*! /*!
* \brief Creates an event line at position \c alpha for the specified * \brief creates an event line at position \c alpha for the specified
* curve. * curve.
* *
* Additionally, the \c id of the event line to be created has to be * Additionally, the \c id of the event line to be created has to be

View File

@ -95,7 +95,7 @@ set_union_with_source(InputIterator1 first_begin,
} }
/* /*
* \brief Removes the leading term of the polynomial \c f as long as it * \brief removes the leading term of the polynomial \c f as long as it
* vanishes at \c alpha * vanishes at \c alpha
* *
*/ */
@ -169,7 +169,7 @@ template<typename AlgebraicKernel_1> typename AlgebraicKernel_1::Bound
/*! /*!
* \brief Produces intermediate rational values for a list of * \brief produces intermediate rational values for a list of
* algebraic reals. * algebraic reals.
* *
* For a list of Algebraic real values with \c n elements, a list with * For a list of Algebraic real values with \c n elements, a list with

View File

@ -36,7 +36,7 @@ namespace CGAL {
namespace internal { namespace internal {
/*! \brief Tries to find a SIMPLE rational q with a<q<b. /*! \brief tries to find a SIMPLE rational q with a<q<b.
* *
* In this context, simple means that the denominator of <tt>q</tt> * In this context, simple means that the denominator of <tt>q</tt>
* is a power of two, and is not too big. There is no guarantee to find * is a power of two, and is not too big. There is no guarantee to find

View File

@ -31,7 +31,7 @@ namespace internal {
} // namespace internal } // namespace internal
/*! /*!
* \brief Represents different strategies how to handle * \brief represents different strategies how to handle
* degenerate cases during the analysis * degenerate cases during the analysis
* *
* Currently, there are two possible strategies implemented. See the * Currently, there are two possible strategies implemented. See the

View File

@ -1,67 +1,69 @@
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.15)
project( Algebraic_kernel_d_Tests ) project(Algebraic_kernel_d_Tests)
# CGAL and its components # CGAL and its components
find_package( CGAL QUIET COMPONENTS Core) find_package(CGAL REQUIRED COMPONENTS Core)
if ( NOT CGAL_FOUND )
message(STATUS "This project requires the CGAL library, and will not be compiled.")
return()
endif()
find_package(RS3 QUIET) find_package(RS3 QUIET)
if(MPFI_FOUND) if(MPFI_FOUND)
include( ${MPFI_USE_FILE} ) include(${MPFI_USE_FILE})
endif() endif()
if(RS3_FOUND) if(RS3_FOUND)
include( ${RS3_USE_FILE} ) include(${RS3_USE_FILE})
endif() endif()
# Boost and its components # Boost and its components
find_package( Boost ) find_package(Boost)
if ( NOT Boost_FOUND ) if(NOT Boost_FOUND)
message(STATUS "This project requires the Boost library, and will not be compiled.") message(
STATUS "This project requires the Boost library, and will not be compiled.")
return() return()
endif() endif()
# include for local directory # include for local directory
include_directories( BEFORE include ) include_directories(BEFORE include)
include( ${CGAL_USE_FILE} ) include(${CGAL_USE_FILE})
# Creating entries for all .cpp/.C files with "main" routine # Creating entries for all .cpp/.C files with "main" routine
# ########################################################## # ##########################################################
create_single_source_cgal_program( "cyclic.cpp" ) create_single_source_cgal_program("cyclic.cpp")
create_single_source_cgal_program( "Algebraic_curve_kernel_2.cpp" ) create_single_source_cgal_program("Descartes.cpp")
create_single_source_cgal_program( "algebraic_curve_kernel_2_tools.cpp" ) if(NOT CGAL_DISABLE_GMP)
create_single_source_cgal_program( "Algebraic_kernel_d_1_LEDA.cpp" ) create_single_source_cgal_program("Algebraic_curve_kernel_2.cpp")
create_single_source_cgal_program("algebraic_curve_kernel_2_tools.cpp")
create_single_source_cgal_program("Algebraic_kernel_d_1_LEDA.cpp")
create_single_source_cgal_program( "Algebraic_kernel_d_1_CORE_Integer_rational.cpp" ) create_single_source_cgal_program(
create_single_source_cgal_program( "Algebraic_kernel_d_1_CORE_SqrtII_rational.cpp" ) "Algebraic_kernel_d_1_CORE_Integer_rational.cpp")
create_single_source_cgal_program( "Algebraic_kernel_d_1_CORE_SqrtRI_rational.cpp" ) create_single_source_cgal_program(
create_single_source_cgal_program( "Algebraic_kernel_d_1_CORE_SqrtRR_rational.cpp" ) "Algebraic_kernel_d_1_CORE_SqrtII_rational.cpp")
create_single_source_cgal_program(
"Algebraic_kernel_d_1_CORE_SqrtRI_rational.cpp")
create_single_source_cgal_program(
"Algebraic_kernel_d_1_CORE_SqrtRR_rational.cpp")
create_single_source_cgal_program( "Algebraic_kernel_d_1_GMP.cpp" ) create_single_source_cgal_program("Algebraic_kernel_d_1_GMP.cpp")
create_single_source_cgal_program( "Algebraic_kernel_d_2.cpp" ) create_single_source_cgal_program("Algebraic_kernel_d_2.cpp")
create_single_source_cgal_program( "Algebraic_real_d_1.cpp" ) create_single_source_cgal_program("Algebraic_real_d_1.cpp")
create_single_source_cgal_program( "Bitstream_descartes.cpp" ) create_single_source_cgal_program("Bitstream_descartes.cpp")
create_single_source_cgal_program( "Curve_analysis_2.cpp" ) create_single_source_cgal_program("Curve_analysis_2.cpp")
create_single_source_cgal_program( "Curve_pair_analysis_2.cpp" ) create_single_source_cgal_program("Curve_pair_analysis_2.cpp")
create_single_source_cgal_program( "Descartes.cpp" ) create_single_source_cgal_program("Real_embeddable_traits_extension.cpp")
create_single_source_cgal_program( "Real_embeddable_traits_extension.cpp" ) if(RS_FOUND)
if(RS_FOUND) create_single_source_cgal_program("Algebraic_kernel_rs_gmpq_d_1.cpp")
create_single_source_cgal_program( "Algebraic_kernel_rs_gmpq_d_1.cpp" ) create_single_source_cgal_program("Algebraic_kernel_rs_gmpz_d_1.cpp")
create_single_source_cgal_program( "Algebraic_kernel_rs_gmpz_d_1.cpp" ) else()
message(
STATUS
"NOTICE: Some tests require the RS library, and will not be compiled.")
endif()
else() else()
message(STATUS "NOTICE: Some tests require the RS library, and will not be compiled.") message(STATUS "NOTICE: Some tests require the CGAL_Core library, and will not be compiled.")
endif() endif()

View File

@ -1,26 +1,18 @@
# Created by the script cgal_create_cmake_script # Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application. # This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.15)
project( Algebraic_kernel_for_circles_Tests ) project(Algebraic_kernel_for_circles_Tests)
find_package(CGAL REQUIRED)
find_package(CGAL QUIET) include_directories(BEFORE "include")
if ( CGAL_FOUND )
include_directories (BEFORE "include")
# create a target per cppfile
file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
foreach(cppfile ${cppfiles})
create_single_source_cgal_program( "${cppfile}" )
endforeach()
else()
message(STATUS "This program requires the CGAL library, and will not be compiled.")
endif()
# create a target per cppfile
file(
GLOB cppfiles
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
foreach(cppfile ${cppfiles})
create_single_source_cgal_program("${cppfile}")
endforeach()

View File

@ -30,19 +30,19 @@ namespace CGAL {
template <typename RT> template <typename RT>
Comparison_result Comparison_result
compare_x(const CGAL::Root_for_spheres_2_3<RT>& r1, const CGAL::Root_for_spheres_2_3<RT>& r2){ compare_x(const CGAL::Root_for_spheres_2_3<RT>& r1, const CGAL::Root_for_spheres_2_3<RT>& r2){
return compare(r1.x(), r2.x()); return CGAL::compare(r1.x(), r2.x());
} }
template <typename RT> template <typename RT>
Comparison_result Comparison_result
compare_y(const CGAL::Root_for_spheres_2_3<RT>& r1, const CGAL::Root_for_spheres_2_3<RT>& r2){ compare_y(const CGAL::Root_for_spheres_2_3<RT>& r1, const CGAL::Root_for_spheres_2_3<RT>& r2){
return compare(r1.y(), r2.y()); return CGAL::compare(r1.y(), r2.y());
} }
template <typename RT> template <typename RT>
Comparison_result Comparison_result
compare_z(const CGAL::Root_for_spheres_2_3<RT>& r1, const CGAL::Root_for_spheres_2_3<RT>& r2){ compare_z(const CGAL::Root_for_spheres_2_3<RT>& r1, const CGAL::Root_for_spheres_2_3<RT>& r2){
return compare(r1.z(), r2.z()); return CGAL::compare(r1.z(), r2.z());
} }
template <typename RT> template <typename RT>

View File

@ -1,26 +1,18 @@
# Created by the script cgal_create_cmake_script # Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application. # This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.15)
project( Algebraic_kernel_for_spheres_Tests ) project(Algebraic_kernel_for_spheres_Tests)
find_package(CGAL REQUIRED)
find_package(CGAL QUIET) include_directories(BEFORE "include")
if ( CGAL_FOUND )
include_directories (BEFORE "include")
# create a target per cppfile
file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
foreach(cppfile ${cppfiles})
create_single_source_cgal_program( "${cppfile}" )
endforeach()
else()
message(STATUS "This program requires the CGAL library, and will not be compiled.")
endif()
# create a target per cppfile
file(
GLOB cppfiles
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
foreach(cppfile ${cppfiles})
create_single_source_cgal_program("${cppfile}")
endforeach()

View File

@ -134,9 +134,8 @@ All \cgal kernels are models of both concepts.
The triangulation data structure of the triangulation The triangulation data structure of the triangulation
has to be a model of the concept `TriangulationDataStructure_2`, has to be a model of the concept `TriangulationDataStructure_2`,
and it must be parameterized with whose vertex and face classes are models of the concepts
vertex and face classes which are models of the concepts `AlphaShapeVertex_2` and `AlphaShapeFace_2`, respectively.
`AlphaShapeVertex_2` and `AlphaShapeFace_2`.
The classes `Alpha_shape_vertex_base_2<Gt, Vb>` and `Alpha_shape_face_base_2<Gt, Fb>` The classes `Alpha_shape_vertex_base_2<Gt, Vb>` and `Alpha_shape_face_base_2<Gt, Fb>`
are models of these concepts and can be used for all type of alpha shapes, are models of these concepts and can be used for all type of alpha shapes,
provided that the template parameters `Vb` and `Fb` are appropriately chosen, provided that the template parameters `Vb` and `Fb` are appropriately chosen,

View File

@ -1,26 +0,0 @@
namespace CGAL {
/*!
\ingroup PkgAlphaShapes2Ref
\deprecated The class is deprecated since \cgal 4.10, as the weighted point and the function
objects for weighted points are part of the concept `Kernel`. The class is kept for backward
compatibility.
The class `Weighted_alpha_shape_euclidean_traits_2` was the default model for the concept
`AlphaShapeTraits_2` for the regular version of Alpha Shapes.
\tparam K must be a model of `Kernel`.
\cgalModels `AlphaShapeTraits_2`
*/
template< typename K >
class Weighted_alpha_shape_euclidean_traits_2
: public K
{
public:
}; /* end Weighted_alpha_shape_euclidean_traits_2 */
} /* end namespace CGAL */

View File

@ -45,7 +45,7 @@ typedef unspecified_type FT;
/*! /*!
A default constructor. A default constructor.
*/ */
AlphaShapeTraits_2(); WeightedAlphaShapeTraits_2();
/// @} /// @}

View File

@ -70,12 +70,12 @@ finite number of different \f$ \alpha\f$-shapes and corresponding
\cgalCRPSection{Concepts} \cgalCRPSection{Concepts}
- `AlphaShapeTraits_2` - `AlphaShapeTraits_2`
- `WeightedAlphaShapeTraits_2`
- `AlphaShapeFace_2` - `AlphaShapeFace_2`
- `AlphaShapeVertex_2` - `AlphaShapeVertex_2`
\cgalCRPSection{Classes} \cgalCRPSection{Classes}
- `CGAL::Alpha_shape_2<Dt>` - `CGAL::Alpha_shape_2<Dt>`
- `CGAL::Weighted_alpha_shape_euclidean_traits_2<K>`
- `CGAL::Alpha_shape_vertex_base_2<AlphaShapeTraits_2>` - `CGAL::Alpha_shape_vertex_base_2<AlphaShapeTraits_2>`
- `CGAL::Alpha_shape_face_base_2<AlphaShapeTraits_2, TriangulationFaceBase_2>` - `CGAL::Alpha_shape_face_base_2<AlphaShapeTraits_2, TriangulationFaceBase_2>`

View File

@ -1,24 +1,16 @@
# Created by the script cgal_create_cmake_script # Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application. # This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.15)
project( Alpha_shapes_2_Examples ) project(Alpha_shapes_2_Examples)
find_package(CGAL REQUIRED)
find_package(CGAL QUIET) # create a target per cppfile
file(
if ( CGAL_FOUND ) GLOB cppfiles
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
# create a target per cppfile ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) foreach(cppfile ${cppfiles})
foreach(cppfile ${cppfiles}) create_single_source_cgal_program("${cppfile}")
create_single_source_cgal_program( "${cppfile}" ) endforeach()
endforeach()
else()
message(STATUS "This program requires the CGAL library, and will not be compiled.")
endif()

View File

@ -1,29 +0,0 @@
// Copyright (c) 1997 INRIA Sophia-Antipolis (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org).
//
// $URL$
// $Id$
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
//
//
// Author(s) : Tran Kai Frank DA <Frank.Da@sophia.inria.fr>
// Andreas Fabri <Andreas.Fabri@geometryfactory.com>
#ifndef CGAL_ALPHA_SHAPE_EUCLIDEAN_TRAITS_H
#define CGAL_ALPHA_SHAPE_EUCLIDEAN_TRAITS_H
#include <CGAL/license/Alpha_shapes_2.h>
namespace CGAL {
template < class R >
class Alpha_shape_euclidean_traits_2 : public R
{};
} //namespace CGAL
#endif

View File

@ -1,37 +0,0 @@
// Copyright (c) 1997 INRIA Sophia-Antipolis (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org).
//
// $URL$
// $Id$
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
//
// Author(s) : Tran Kai Frank DA <Frank.Da@sophia.inria.fr>
// Andreas Fabri <Andreas.Fabri@geometryfactory.com>
#ifndef CGAL_WEIGHTED_ALPHA_SHAPE_EUCLIDEAN_TRAITS_2_H
#define CGAL_WEIGHTED_ALPHA_SHAPE_EUCLIDEAN_TRAITS_2_H
#include <CGAL/license/Alpha_shapes_2.h>
#define CGAL_DEPRECATED_HEADER "<CGAL/Weighted_alpha_shape_euclidean_traits_2.h>"
#define CGAL_DEPRECATED_MESSAGE_DETAILS \
"The kernel K can be used directly as traits since weighted points and "\
"the associated function objects are now part of the concept Kernel."
#include <CGAL/internal/deprecation_warning.h>
namespace CGAL {
template< class K_ >
class Weighted_alpha_shape_euclidean_traits_2
: public K_
{
public:
Weighted_alpha_shape_euclidean_traits_2() { }
Weighted_alpha_shape_euclidean_traits_2(const K_& k) : K_(k) { }
};
} // namespace CGAL
#endif // CGAL_WEIGHTED_ALPHA_SHAPE_EUCLIDEAN_TRAITS_2_H

View File

@ -1,24 +1,16 @@
# Created by the script cgal_create_cmake_script # Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application. # This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.15)
project( Alpha_shapes_2_Tests ) project(Alpha_shapes_2_Tests)
find_package(CGAL REQUIRED)
find_package(CGAL QUIET) # create a target per cppfile
file(
if ( CGAL_FOUND ) GLOB cppfiles
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
# create a target per cppfile ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) foreach(cppfile ${cppfiles})
foreach(cppfile ${cppfiles}) create_single_source_cgal_program("${cppfile}")
create_single_source_cgal_program( "${cppfile}" ) endforeach()
endforeach()
else()
message(STATUS "This program requires the CGAL library, and will not be compiled.")
endif()

View File

@ -12,14 +12,6 @@ when alpha is given as an int.
Alpha_shape_3(Dt& dt, bool swap=true, NT alpha = 0, Mode m = REGULARIZED) Alpha_shape_3(Dt& dt, bool swap=true, NT alpha = 0, Mode m = REGULARIZED)
The triangulation is swapped if swap=true and copied otherwise. The triangulation is swapped if swap=true and copied otherwise.
- suppress the traits classes Alpha_shape_euclidean_traits_3.h
and Weighted_alpha_shape_euclidean_traits_3.h
their purpose was to rename the Compute_squared_radius_3 constructor.
The same can be achieved in class Alpha_shapes_3 using the Weighted_tag
of the triangulation
- same as previous for Alpha_shapes_2
- test the taking into account of paramater alpha in functions - test the taking into account of paramater alpha in functions
get_alpha_shape_edges get_alpha_shape_edges
get_alpha_shape_facets get_alpha_shape_facets

View File

@ -5,18 +5,16 @@
#include <CGAL/Qt/resources.h> #include <CGAL/Qt/resources.h>
#include <CGAL/Qt/init_ogl_context.h>
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
QApplication application(argc,argv); CGAL::Qt::init_ogl_context(4,3);
QApplication application(argc,argv);
application.setOrganizationDomain("geometryfactory.com"); application.setOrganizationDomain("geometryfactory.com");
application.setOrganizationName("GeometryFactory"); application.setOrganizationName("GeometryFactory");
application.setApplicationName("Alpha Shape Reconstruction"); application.setApplicationName("Alpha Shape Reconstruction");
//for Windows
#if (QT_VERSION >= QT_VERSION_CHECK(5, 3, 0))
application.setAttribute(Qt::AA_UseDesktopOpenGL);
#endif
// Import resources from libCGALQt (Qt5). // Import resources from libCGALQt (Qt5).
// See https://doc.qt.io/qt-5/qdir.html#Q_INIT_RESOURCE // See https://doc.qt.io/qt-5/qdir.html#Q_INIT_RESOURCE

View File

@ -2,7 +2,7 @@
# This is the CMake script for compiling a CGAL application. # This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.15)
project (Alpha_shapes_3_Demo) project(Alpha_shapes_3_Demo)
# Find includes in corresponding build directories # Find includes in corresponding build directories
set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_INCLUDE_CURRENT_DIR ON)
@ -16,35 +16,38 @@ if(POLICY CMP0071)
cmake_policy(SET CMP0071 NEW) cmake_policy(SET CMP0071 NEW)
endif() endif()
find_package(CGAL COMPONENTS Qt5) find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5)
find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) find_package(Qt5 QUIET COMPONENTS Script OpenGL Svg)
if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) if(CGAL_Qt5_FOUND AND Qt5_FOUND)
add_definitions(-DQT_NO_KEYWORDS) add_definitions(-DQT_NO_KEYWORDS)
# include(${QT_USE_FILE}) # include(${QT_USE_FILE})
include_directories (BEFORE ./ ) include_directories(BEFORE ./)
# ui file, created wih Qt Designer # ui file, created wih Qt Designer
qt5_wrap_ui( uis MainWindow.ui ) qt5_wrap_ui(uis MainWindow.ui)
# qrc files (resources files, that contain icons, at least) # qrc files (resources files, that contain icons, at least)
qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES ./Alpha_shape_3.qrc ) qt5_add_resources(CGAL_Qt5_RESOURCE_FILES ./Alpha_shape_3.qrc)
add_executable ( Alpha_shape_3 Alpha_shape_3.cpp MainWindow.cpp Viewer.cpp ${uis} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) add_executable(
add_to_cached_list( CGAL_EXECUTABLE_TARGETS Alpha_shape_3 ) Alpha_shape_3 Alpha_shape_3.cpp MainWindow.cpp Viewer.cpp ${uis}
${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES})
add_to_cached_list(CGAL_EXECUTABLE_TARGETS Alpha_shape_3)
target_link_libraries( Alpha_shape_3 PRIVATE target_link_libraries(Alpha_shape_3 PRIVATE CGAL::CGAL CGAL::CGAL_Qt5
CGAL::CGAL CGAL::CGAL_Qt5 Qt5::OpenGL Qt5::Gui)
Qt5::OpenGL Qt5::Gui )
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
cgal_add_compilation_test(Alpha_shape_3) cgal_add_compilation_test(Alpha_shape_3)
else() else()
message(STATUS "NOTICE: This demo requires CGAL, and Qt5, and will not be compiled.") message(
STATUS "NOTICE: This demo requires CGAL, and Qt5, and will not be compiled."
)
endif() endif()

View File

@ -29,14 +29,14 @@ void Viewer::compile_shaders()
//Vertex source code //Vertex source code
const char vertex_source[] = const char vertex_source[] =
{ {
"#version 120 \n" "#version 150 \n"
"attribute highp vec4 vertex;\n" "in highp vec4 vertex;\n"
"attribute highp vec3 normal;\n" "in highp vec3 normal;\n"
"uniform highp mat4 mvp_matrix;\n" "uniform highp mat4 mvp_matrix;\n"
"uniform highp mat4 mv_matrix; \n" "uniform highp mat4 mv_matrix; \n"
"varying highp vec4 fP; \n" "out highp vec4 fP; \n"
"varying highp vec3 fN; \n" "out highp vec3 fN; \n"
"void main(void)\n" "void main(void)\n"
"{\n" "{\n"
" fP = mv_matrix * vertex; \n" " fP = mv_matrix * vertex; \n"
@ -47,15 +47,16 @@ void Viewer::compile_shaders()
//Fragment source code //Fragment source code
const char fragment_source[] = const char fragment_source[] =
{ {
"#version 120 \n" "#version 150 \n"
"varying highp vec4 fP; \n" "in highp vec4 fP; \n"
"varying highp vec3 fN; \n" "in highp vec3 fN; \n"
"uniform highp vec4 color; \n" "uniform highp vec4 color; \n"
"uniform highp vec4 light_pos; \n" "uniform highp vec4 light_pos; \n"
"uniform highp vec4 light_diff; \n" "uniform highp vec4 light_diff; \n"
"uniform highp vec4 light_spec; \n" "uniform highp vec4 light_spec; \n"
"uniform highp vec4 light_amb; \n" "uniform highp vec4 light_amb; \n"
"uniform float spec_power ; \n" "uniform float spec_power ; \n"
"out highp vec4 out_color; \n"
"void main(void) { \n" "void main(void) { \n"
@ -70,7 +71,7 @@ void Viewer::compile_shaders()
" highp vec4 diffuse = abs(dot(N,L)) * light_diff * color; \n" " highp vec4 diffuse = abs(dot(N,L)) * light_diff * color; \n"
" highp vec4 specular = pow(max(dot(R,V), 0.0), spec_power) * light_spec; \n" " highp vec4 specular = pow(max(dot(R,V), 0.0), spec_power) * light_spec; \n"
"gl_FragColor = light_amb*color + diffuse + specular ; \n" "out_color = light_amb*color + diffuse + specular ; \n"
"} \n" "} \n"
"\n" "\n"
}; };
@ -105,8 +106,8 @@ rendering_program.bind();
//Vertex source code //Vertex source code
const char vertex_source_points[] = const char vertex_source_points[] =
{ {
"#version 120 \n" "#version 150 \n"
"attribute highp vec4 vertex;\n" "in highp vec4 vertex;\n"
"uniform highp mat4 mvp_matrix;\n" "uniform highp mat4 mvp_matrix;\n"
"uniform highp float point_size;\n" "uniform highp float point_size;\n"
@ -119,11 +120,12 @@ const char vertex_source_points[] =
//Vertex source code //Vertex source code
const char fragment_source_points[] = const char fragment_source_points[] =
{ {
"#version 120 \n" "#version 150 \n"
"uniform highp vec4 color; \n" "uniform highp vec4 color; \n"
"out highp vec4 out_color; \n"
"void main(void) { \n" "void main(void) { \n"
"gl_FragColor = color; \n" "out_color = color; \n"
"} \n" "} \n"
"\n" "\n"
}; };

View File

@ -21,6 +21,7 @@ public:
Viewer(QWidget* parent); Viewer(QWidget* parent);
~Viewer() ~Viewer()
{ {
makeCurrent();
buffers[0].destroy(); buffers[0].destroy();
buffers[1].destroy(); buffers[1].destroy();
buffers[2].destroy(); buffers[2].destroy();

View File

@ -192,6 +192,10 @@ the vertices, edges, facets and cells of the different types
(`EXTERIOR`, `SINGULAR`, `REGULAR` or (`EXTERIOR`, `SINGULAR`, `REGULAR` or
`INTERIOR`). `INTERIOR`).
\subsection AlphaShape3DIO Input/Output
It is possible to export a 3D alpha shape to a `std::ostream` or to a `Geomview_stream`
using the `operator<<`, see the documentation of the class `Alpha_shape_3` for more information.
\section AlphaShape3D_ConceptAndModels Concepts and Models \section AlphaShape3D_ConceptAndModels Concepts and Models
We currently do not specify concepts for the underlying triangulation We currently do not specify concepts for the underlying triangulation
@ -215,8 +219,8 @@ in the non-weighted case and `WeightedAlphaShapeTraits_3` in the weighted case.
All \cgal kernels are models of both concepts. All \cgal kernels are models of both concepts.
The triangulation data structure of the triangulation The triangulation data structure of the triangulation
has to be a model of the concept `TriangulationDataStructure_3`, has to be a model of the concept `TriangulationDataStructure_3`
and it must be parameterized with vertex and cell classes, which are model of the concepts whose vertex and cell classes are model of the concepts
`AlphaShapeVertex_3` and `AlphaShapeCell_3`. `AlphaShapeVertex_3` and `AlphaShapeCell_3`.
The classes `Alpha_shape_vertex_base_3<Gt>` and `Alpha_shape_cell_base_3<Gt>` The classes `Alpha_shape_vertex_base_3<Gt>` and `Alpha_shape_cell_base_3<Gt>`
are models of these concepts and can be used for all type of alpha shapes, are models of these concepts and can be used for all type of alpha shapes,
@ -230,8 +234,8 @@ the traits class are described in the concepts `FixedAlphaShapeTraits_3`
in the non-weighted case and `FixedWeightedAlphaShapeTraits_3` in the weighted case. in the non-weighted case and `FixedWeightedAlphaShapeTraits_3` in the weighted case.
All \cgal kernels are models of both concepts. All \cgal kernels are models of both concepts.
The triangulation data structure of the triangulation The triangulation data structure of the triangulation
has to be a model of the concept `TriangulationDataStructure_3`, has to be a model of the concept `TriangulationDataStructure_3`
and it must be parameterized with vertex and cell classes, which are model of the concepts whose vertex and cell classes are model of the concepts
`FixedAlphaShapeVertex_3` and `FixedAlphaShapeCell_3`. `FixedAlphaShapeVertex_3` and `FixedAlphaShapeCell_3`.
The package provides models `Fixed_alpha_shape_vertex_base_3<Gt>` The package provides models `Fixed_alpha_shape_vertex_base_3<Gt>`
and `Fixed_alpha_shape_cell_base_3<Gt>`, respectively. and `Fixed_alpha_shape_cell_base_3<Gt>`, respectively.

View File

@ -1,24 +1,16 @@
# Created by the script cgal_create_cmake_script # Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application. # This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.15)
project( Alpha_shapes_3_Examples ) project(Alpha_shapes_3_Examples)
find_package(CGAL REQUIRED)
find_package(CGAL QUIET) # create a target per cppfile
file(
if ( CGAL_FOUND ) GLOB cppfiles
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
# create a target per cppfile ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) foreach(cppfile ${cppfiles})
foreach(cppfile ${cppfiles}) create_single_source_cgal_program("${cppfile}")
create_single_source_cgal_program( "${cppfile}" ) endforeach()
endforeach()
else()
message(STATUS "This program requires the CGAL library, and will not be compiled.")
endif()

View File

@ -1,27 +0,0 @@
// Copyright (c) 1997 INRIA Sophia-Antipolis (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org).
//
// $URL$
// $Id$
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
//
//
// Author(s) : Tran Kai Frank DA <Frank.Da@sophia.inria.fr>
#ifndef CGAL_ALPHA_SHAPE_EUCLIDEAN_TRAITS_3_H
#define CGAL_ALPHA_SHAPE_EUCLIDEAN_TRAITS_3_H
#include <CGAL/license/Alpha_shapes_3.h>
namespace CGAL {
template <class K>
class Alpha_shape_euclidean_traits_3 : public K {};
} //namespace CGAL
#endif //CGAL_ALPHA_SHAPE_EUCLIDEAN_TRAITS_3_H

View File

@ -5,21 +5,23 @@
// Max-Planck-Institute Saarbruecken (Germany), // Max-Planck-Institute Saarbruecken (Germany),
// and Tel-Aviv University (Israel). All rights reserved. // and Tel-Aviv University (Israel). All rights reserved.
// //
// This file is part of CGAL (www.cgal.org) // This file is part of CGAL (www.cgal.org).
// //
// $URL$ // $URL$
// $Id$ // $Id$
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
// //
// Author(s) : Andreas Fabri // Author(s) : Andreas Fabri
#ifndef CGAL_ALPHA_SHAPE_3_VRML_2_OSTREAM_H #ifndef CGAL_ALPHA_SHAPE_3_VRML_2_OSTREAM_H
#define CGAL_ALPHA_SHAPE_3_VRML_2_OSTREAM_H #define CGAL_ALPHA_SHAPE_3_VRML_2_OSTREAM_H
#include <CGAL/basic.h> #include <CGAL/license/Alpha_shapes_3.h>
#include <CGAL/IO/VRML_2_ostream.h>
#include <CGAL/Alpha_shape_3.h>
#include <CGAL/IO/VRML/VRML_2_ostream.h>
#include <CGAL/number_utils.h>
#ifdef CGAL_ALPHA_SHAPE_3_H
namespace CGAL { namespace CGAL {
template <class Dt > template <class Dt >
@ -90,6 +92,5 @@ operator<<(VRML_2_ostream& os,
} }
} //namespace CGAL } //namespace CGAL
#endif // CGAL_ALPHA_SHAPE_3_H
#endif CGAL_ALPHA_SHAPE_3_VRML_2_OSTREAM_H #endif // CGAL_ALPHA_SHAPE_3_VRML_2_OSTREAM_H

View File

@ -1,36 +0,0 @@
// Copyright (c) 1997 INRIA Sophia-Antipolis (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org).
//
// $URL$
// $Id$
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
//
// Author(s) : Tran Kai Frank DA <Frank.Da@sophia.inria.fr>
#ifndef CGAL_WEIGHTED_ALPHA_SHAPE_EUCLIDEAN_TRAITS_3_H
#define CGAL_WEIGHTED_ALPHA_SHAPE_EUCLIDEAN_TRAITS_3_H
#include <CGAL/license/Alpha_shapes_3.h>
#define CGAL_DEPRECATED_HEADER "<CGAL/Weighted_alpha_shape_euclidean_traits_3.h>"
#define CGAL_DEPRECATED_MESSAGE_DETAILS \
"The kernel K can be used directly as traits since weighted points and "\
"the associated function objects are now part of the concept Kernel."
#include <CGAL/internal/deprecation_warning.h>
namespace CGAL {
template < class K_ >
class Weighted_alpha_shape_euclidean_traits_3
: public K_
{
public:
Weighted_alpha_shape_euclidean_traits_3() { }
Weighted_alpha_shape_euclidean_traits_3(const K_& k) : K_(k) { }
};
} // namespace CGAL
#endif // CGAL_WEIGHTED_ALPHA_SHAPE_EUCLIDEAN_TRAITS_3_H

View File

@ -4,7 +4,6 @@ Arithmetic_kernel
Cartesian_kernel Cartesian_kernel
Circulator Circulator
Filtered_kernel Filtered_kernel
Geomview
Hash_map Hash_map
Homogeneous_kernel Homogeneous_kernel
Installation Installation

View File

@ -1,26 +1,18 @@
# Created by the script cgal_create_cmake_script # Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application. # This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.15)
project( Alpha_shapes_3_Tests ) project(Alpha_shapes_3_Tests)
find_package(CGAL REQUIRED)
find_package(CGAL QUIET) include_directories(BEFORE "include")
if ( CGAL_FOUND )
include_directories (BEFORE "include")
# create a target per cppfile
file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
foreach(cppfile ${cppfiles})
create_single_source_cgal_program( "${cppfile}" )
endforeach()
else()
message(STATUS "This program requires the CGAL library, and will not be compiled.")
endif()
# create a target per cppfile
file(
GLOB cppfiles
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
foreach(cppfile ${cppfiles})
create_single_source_cgal_program("${cppfile}")
endforeach()

View File

@ -181,7 +181,7 @@ two visible circles.
The 2D Apollonius graph class The 2D Apollonius graph class
`Apollonius_graph_2<ApolloniusGraphTraits_2,ApolloniusGraphDataStructure_2>` `Apollonius_graph_2<ApolloniusGraphTraits_2,ApolloniusGraphDataStructure_2>`
follows the design of the triangulation package of \cgal. It is follows the design of the triangulation packages of \cgal. It is
parametrized by two arguments: parametrized by two arguments:
<UL> <UL>
<LI>the <B>geometric traits</B> class. It provides the basic <LI>the <B>geometric traits</B> class. It provides the basic

View File

@ -4,14 +4,20 @@ namespace CGAL {
/*! /*!
\ingroup PkgApolloniusGraph2Ref \ingroup PkgApolloniusGraph2Ref
The class `Apollonius_graph_2` represents the The class `Apollonius_graph_2` represents the Apollonius graph.
Apollonius graph. It supports insertions and deletions of sites. It supports insertions and deletions of sites.
It is templated by two template arguments `Gt`, which
must be a model of `ApolloniusGraphTraits_2`, and `Agds`, \tparam Gt is the geometric traits class and must be a model of `ApolloniusGraphTraits_2`.
which must be a model of `ApolloniusGraphDataStructure_2`.
The second template argument defaults to \tparam Agds is the Apollonius graph data structure and must be a model of `ApolloniusGraphDataStructure_2`
`CGAL::Triangulation_data_structure_2< CGAL::Apollonius_graph_vertex_base_2<Gt,true>, CGAL::Triangulation_face_base_2<Gt> >`. whose vertex and face must be models of `ApolloniusGraphVertexBase_2` and `TriangulationFaceBase_2`,
\cgalModels `DelaunayGraph_2` respectively.
It defaults to:
\code
CGAL::Triangulation_data_structure_2<
CGAL::Apollonius_graph_vertex_base_2<Gt,true>,
CGAL::Triangulation_face_base_2<Gt> >`
\endcode
\cgalHeading{Traversal of the Apollonius Graph} \cgalHeading{Traversal of the Apollonius Graph}
@ -40,17 +46,11 @@ ag.incident_edges(ag.infinite_vertex());
ag.incident_edges(ag.infinite_vertex(), f); ag.incident_edges(ag.infinite_vertex(), f);
\endcode \endcode
\sa `DelaunayGraph_2` \cgalModels `DelaunayGraph_2`
\sa `ApolloniusGraphTraits_2`
\sa `ApolloniusGraphDataStructure_2`
\sa `ApolloniusGraphVertexBase_2`
\sa `TriangulationFaceBase_2`
\sa `CGAL::Apollonius_graph_traits_2<K,Method_tag>` \sa `CGAL::Apollonius_graph_traits_2<K,Method_tag>`
\sa `CGAL::Apollonius_graph_filtered_traits_2<CK,CM,EK,EM,FK,FM>` \sa `CGAL::Apollonius_graph_filtered_traits_2<CK,CM,EK,EM,FK,FM>`
\sa `CGAL::Triangulation_data_structure_2<Vb,Fb>` \sa `CGAL::Apollonius_graph_hierarchy_2<Gt,Agds>`
\sa `CGAL::Apollonius_graph_vertex_base_2<Gt,StoreHidden>`
\sa `CGAL::Triangulation_face_base_2<Gt>`
*/ */
template< typename Gt, typename Agds > template< typename Gt, typename Agds >
class Apollonius_graph_2 { class Apollonius_graph_2 {
@ -92,7 +92,7 @@ typedef Gt::Site_2 Site_2;
/// \name Handles And Iterators /// \name Handles And Iterators
/// The vertices and faces of the Apollonius graph are accessed /// The vertices and faces of the Apollonius graph are accessed
/// through `handles`, `iterators` and `circulators`. The iterators /// through `handles`, `iterators`, and `circulators`. The iterators
/// and circulators are all bidirectional and non-mutable. The /// and circulators are all bidirectional and non-mutable. The
/// circulators and iterators are assignable to the corresponding /// circulators and iterators are assignable to the corresponding
/// handle types, and they are also convertible to the corresponding /// handle types, and they are also convertible to the corresponding
@ -261,63 +261,62 @@ operator=(const Apollonius_graph_2<Gt,Agds>& other);
/*! /*!
Returns a reference to the Apollonius graph traits object. Returns a reference to the Apollonius graph traits object.
*/ */
Geom_traits geom_traits(); const Geom_traits& geom_traits() const;
/*! /*!
Returns a reference to the Returns a reference to the
underlying data structure. underlying data structure.
*/ */
Data_structure data_structure(); const Data_structure& data_structure() const;
/*! /*!
Same as `data_structure()`. This Same as `data_structure()`. This
method has been added in compliance with the `DelaunayGraph_2` method has been added in compliance with the `DelaunayGraph_2`
concept. concept.
*/ */
Data_structure tds(); const Data_structure& tds() const;
/*! /*!
Returns the dimension of the Apollonius graph. Returns the dimension of the Apollonius graph.
*/ */
int dimension(); int dimension() const;
/*! /*!
Returns the number of finite vertices. Returns the number of finite vertices.
*/ */
size_type number_of_vertices(); size_type number_of_vertices() const;
/*! /*!
Returns the number of visible sites. Returns the number of visible sites.
*/ */
size_type number_of_visible_sites(); size_type number_of_visible_sites() const;
/*! /*!
Returns the number of hidden sites. Returns the number of hidden sites.
*/ */
size_type number_of_hidden_sites(); size_type number_of_hidden_sites() const;
/*! /*!
Returns the number of faces (both finite and infinite) of the Returns the number of faces (both finite and infinite) of the
Apollonius graph. Apollonius graph.
*/ */
size_type number_of_faces(); size_type number_of_faces() const;
/*! /*!
Returns a face incident to the `infinite_vertex`. Returns a face incident to the `infinite_vertex`.
*/ */
Face_handle infinite_face(); Face_handle infinite_face() const;
/*! /*!
Returns the `infinite_vertex`. Returns the `infinite_vertex`.
*/ */
Vertex_handle Vertex_handle infinite_vertex() const;
infinite_vertex();
/*! /*!
Returns a vertex distinct from the `infinite_vertex`. Returns a vertex distinct from the `infinite_vertex`.
\pre The number of (visible) vertices in the Apollonius graph must be at least one. \pre The number of (visible) vertices in the Apollonius graph must be at least one.
*/ */
Vertex_handle finite_vertex(); Vertex_handle finite_vertex() const;
/// @} /// @}
@ -337,63 +336,62 @@ Vertex_handle finite_vertex();
/*! /*!
Starts at an arbitrary finite vertex. Starts at an arbitrary finite vertex.
*/ */
Finite_vertices_iterator finite_vertices_begin(); Finite_vertices_iterator finite_vertices_begin() const;
/*! /*!
Past-the-end iterator. Past-the-end iterator.
*/ */
Finite_vertices_iterator finite_vertices_end(); Finite_vertices_iterator finite_vertices_end() const;
/*! /*!
Starts at an arbitrary finite edge. Starts at an arbitrary finite edge.
*/ */
Finite_edges_iterator finite_edges_begin(); Finite_edges_iterator finite_edges_begin() const;
/*! /*!
Past-the-end iterator. Past-the-end iterator.
*/ */
Finite_edges_iterator finite_edges_end(); Finite_edges_iterator finite_edges_end() const;
/*! /*!
Starts at an arbitrary finite face. Starts at an arbitrary finite face.
*/ */
Finite_faces_iterator finite_faces_begin(); Finite_faces_iterator finite_faces_begin() const;
/*! /*!
Past-the-end iterator. Past-the-end iterator.
*/ */
Finite_faces_iterator finite_faces_end() Finite_faces_iterator finite_faces_end() const;
const;
/*! /*!
Starts at an arbitrary vertex. Starts at an arbitrary vertex.
*/ */
All_vertices_iterator all_vertices_begin(); All_vertices_iterator all_vertices_begin() const;
/*! /*!
Past-the-end iterator. Past-the-end iterator.
*/ */
All_vertices_iterator all_vertices_end(); All_vertices_iterator all_vertices_end() const;
/*! /*!
Starts at an arbitrary edge. Starts at an arbitrary edge.
*/ */
All_edges_iterator all_edges_begin(); All_edges_iterator all_edges_begin() const;
/*! /*!
Past-the-end iterator. Past-the-end iterator.
*/ */
All_edges_iterator all_edges_end(); All_edges_iterator all_edges_end() const;
/*! /*!
Starts at an arbitrary face. Starts at an arbitrary face.
*/ */
All_faces_iterator all_faces_begin(); All_faces_iterator all_faces_begin() const;
/*! /*!
Past-the-end iterator. Past-the-end iterator.
*/ */
All_faces_iterator all_faces_end(); All_faces_iterator all_faces_end() const;
/// @} /// @}
@ -407,32 +405,32 @@ All_faces_iterator all_faces_end();
/*! /*!
Starts at an arbitrary site. Starts at an arbitrary site.
*/ */
Sites_iterator sites_begin(); Sites_iterator sites_begin() const;
/*! /*!
Past-the-end iterator. Past-the-end iterator.
*/ */
Sites_iterator sites_end(); Sites_iterator sites_end() const;
/*! /*!
Starts at an arbitrary visible site. Starts at an arbitrary visible site.
*/ */
Visible_sites_iterator visible_sites_begin(); Visible_sites_iterator visible_sites_begin() const;
/*! /*!
Past-the-end iterator. Past-the-end iterator.
*/ */
Visible_sites_iterator visible_sites_end(); Visible_sites_iterator visible_sites_end() const;
/*! /*!
Starts at an arbitrary hidden site. Starts at an arbitrary hidden site.
*/ */
Hidden_sites_iterator hidden_sites_begin(); Hidden_sites_iterator hidden_sites_begin() const;
/*! /*!
Past-the-end iterator. Past-the-end iterator.
*/ */
Hidden_sites_iterator hidden_sites_end(); Hidden_sites_iterator hidden_sites_end() const;
/// @} /// @}
@ -454,39 +452,39 @@ Hidden_sites_iterator hidden_sites_end();
Starts at an arbitrary face incident Starts at an arbitrary face incident
to `v`. to `v`.
*/ */
Face_circulator incident_faces(Vertex_handle v); Face_circulator incident_faces(Vertex_handle v) const;
/*! /*!
Starts at face `f`. Starts at face `f`.
\pre Face `f` is incident to vertex `v`. \pre Face `f` is incident to vertex `v`.
*/ */
Face_circulator incident_faces(Vertex_handle v, Face_handle f); Face_circulator incident_faces(Vertex_handle v, Face_handle f) const;
/*! /*!
Starts at an arbitrary edge incident Starts at an arbitrary edge incident
to `v`. to `v`.
*/ */
Edge_circulator incident_edges(Vertex_handle v); Edge_circulator incident_edges(Vertex_handle v) const;
/*! /*!
Starts at the first edge of `f` incident to Starts at the first edge of `f` incident to
`v`, in counterclockwise order around `v`. `v`, in counterclockwise order around `v`.
\pre Face `f` is incident to vertex `v`. \pre Face `f` is incident to vertex `v`.
*/ */
Edge_circulator incident_edges(Vertex_handle v, Face_handle f); Edge_circulator incident_edges(Vertex_handle v, Face_handle f) const;
/*! /*!
Starts at an arbitrary vertex incident Starts at an arbitrary vertex incident
to `v`. to `v`.
*/ */
Vertex_circulator incident_vertices(Vertex_handle v); Vertex_circulator incident_vertices(Vertex_handle v) const;
/*! /*!
Starts at the first vertex of `f` adjacent to `v` Starts at the first vertex of `f` adjacent to `v`
in counterclockwise order around `v`. in counterclockwise order around `v`.
\pre Face `f` is incident to vertex `v`. \pre Face `f` is incident to vertex `v`.
*/ */
Vertex_circulator incident_vertices(Vertex_handle v, Face_handle f); Vertex_circulator incident_vertices(Vertex_handle v, Face_handle f) const;
/// @} /// @}
@ -516,7 +514,7 @@ bool is_infinite(Face_handle f, int i) const;
`true`, iff edge `e` is infinite. `true`, iff edge `e` is infinite.
*/ */
bool bool
is_infinite(Edge e) const; is_infinite(const Edge& e) const;
/*! /*!
`true`, iff edge `*ec` is infinite. `true`, iff edge `*ec` is infinite.
@ -544,7 +542,7 @@ site `s` in the Apollonius graph. If `s` is visible then the
vertex handle of `s` is returned, otherwise vertex handle of `s` is returned, otherwise
`Vertex_handle(nullptr)` is returned. `Vertex_handle(nullptr)` is returned.
*/ */
Vertex_handle insert(Site_2 s); Vertex_handle insert(const Site_2& s);
/*! /*!
Inserts `s` in the Apollonius graph using the site Inserts `s` in the Apollonius graph using the site
@ -553,8 +551,7 @@ the center of `s`. If `s` is visible then the vertex handle of
`s` is returned, otherwise `Vertex_handle(nullptr)` is `s` is returned, otherwise `Vertex_handle(nullptr)` is
returned. returned.
*/ */
Vertex_handle insert(Site_2 s, Vertex_handle Vertex_handle insert(const Site_2& s, Vertex_handle vnear);
vnear);
/// @} /// @}
@ -581,7 +578,7 @@ arbitrarily and one of the nearest neighbors of `p` is
returned. If there are no visible sites in the Apollonius diagram returned. If there are no visible sites in the Apollonius diagram
`Vertex_handle(nullptr)` is returned. `Vertex_handle(nullptr)` is returned.
*/ */
Vertex_handle nearest_neighbor(Point_2 p); Vertex_handle nearest_neighbor(const Point_2& p) const;
/*! /*!
Finds the nearest neighbor of the point Finds the nearest neighbor of the point
@ -591,8 +588,7 @@ arbitrarily and one of the nearest neighbors of `p` is
returned. If there are no visible sites in the Apollonius diagram returned. If there are no visible sites in the Apollonius diagram
`Vertex_handle(nullptr)` is returned. `Vertex_handle(nullptr)` is returned.
*/ */
Vertex_handle nearest_neighbor(Point_2 p, Vertex_handle nearest_neighbor(const Point_2& p, Vertex_handle vnear) const;
Vertex_handle vnear);
/// @} /// @}
@ -645,7 +641,7 @@ the stream `str`.
*/ */
template< class Stream > template< class Stream >
Stream& draw_primal(Stream& str); Stream& draw_primal(Stream& str) const;
/*! /*!
Draws the dual of the Draws the dual of the
@ -658,7 +654,7 @@ Apollonius graph, i.e., the Apollonius diagram, to the stream
*/ */
template < class Stream > template < class Stream >
Stream& draw_dual(Stream& str); Stream& draw_dual(Stream& str) const;
/*! /*!
Draws the edge Draws the edge
@ -669,7 +665,7 @@ Draws the edge
*/ */
template< class Stream > template< class Stream >
Stream& draw_primal_edge(Edge e, Stream& str); Stream& draw_primal_edge(const Edge& e, Stream& str) const;
/*! /*!
Draws the dual of the Draws the dual of the
@ -682,7 +678,7 @@ of the Apollonius diagram.
*/ */
template< class Stream > template< class Stream >
Stream& draw_dual_edge(Edge e, Stream& str); Stream& draw_dual_edge(const Edge& e, Stream& str) const;
/*! /*!
Writes the current Writes the current
@ -690,7 +686,7 @@ state of the Apollonius graph to an output stream. In particular,
all visible and hidden sites are written as well as the all visible and hidden sites are written as well as the
underlying combinatorial data structure. underlying combinatorial data structure.
*/ */
void file_output(std::ostream& os); void file_output(std::ostream& os) const;
/*! /*!
Reads the state of the Reads the state of the
@ -701,14 +697,12 @@ void file_input(std::istream& is);
/*! /*!
Writes the current state of the Apollonius graph to an output stream. Writes the current state of the Apollonius graph to an output stream.
*/ */
std::ostream& operator<<(std::ostream& os, std::ostream& operator<<(std::ostream& os, const Apollonius_graph_2<Gt,Agds>& ag) const;
Apollonius_graph_2<Gt,Agds> ag);
/*! /*!
Reads the state of the Apollonius graph from an input stream. Reads the state of the Apollonius graph from an input stream.
*/ */
std::istream& operator>>(std::istream& is, std::istream& operator>>(std::istream& is, const Apollonius_graph_2<Gt,Agds>& ag);
Apollonius_graph_2<Gt,Agds> ag);
/// @} /// @}
@ -721,9 +715,9 @@ Checks the validity of the Apollonius graph. If `verbose` is
is 0, only the data structure is validated. If `level` is 1, then is 0, only the data structure is validated. If `level` is 1, then
both the data structure and the Apollonius graph are both the data structure and the Apollonius graph are
validated. Negative values of `level` always return true, and validated. Negative values of `level` always return true, and
values greater then 1 are equivalent to `level` being 1. values greater than 1 are equivalent to `level` being 1.
*/ */
bool is_valid(bool verbose = false, int level = 1); bool is_valid(bool verbose = false, int level = 1) const;
/// @} /// @}
@ -737,12 +731,11 @@ void clear();
/*! /*!
The Apollonius graphs The Apollonius graphs
`other` and `ag` are swapped. `ag`.`swap(other)` should `other` and `ag` are swapped. `ag.swap(other)` should
be preferred to `ag`` = other` or to `ag``(other)` if be preferred to `ag = other` or to `ag(other)` if
`other` is deleted afterwards. `other` is deleted afterwards.
*/ */
void swap(Apollonius_graph_2<Gt,Agds> void swap(Apollonius_graph_2<Gt,Agds>& other);
other);
/// @} /// @}

View File

@ -19,36 +19,34 @@ find the nearest neighbor of \f$ p\f$ as in the
we use the nearest neighbor found at level \f$ i+1\f$ to find the nearest we use the nearest neighbor found at level \f$ i+1\f$ to find the nearest
neighbor at level \f$ i\f$. This is a variant of the corresponding neighbor at level \f$ i\f$. This is a variant of the corresponding
hierarchy for points found in \cgalCite{d-iirdt-98}. hierarchy for points found in \cgalCite{d-iirdt-98}.
The class has two template parameters which have essentially the same The class has two template parameters which have essentially the same
meaning as in the `Apollonius_graph_2<Gt,Agds>` class. The first meaning as in the `Apollonius_graph_2<Gt,Agds>` class.
template parameter must be a model of the
`ApolloniusGraphTraits_2` concept. \tparam Gt is the geometric traits class and must be a model of `ApolloniusGraphTraits_2`.
The second template parameter must be a model of the
`ApolloniusGraphDataStructure_2` concept. However, the vertex base \tparam Agds is the Apollonius graph data structure and must be a model of `ApolloniusGraphDataStructure_2`
class that is to be used in the Apollonius graph data structure must whose vertex and face must be models of `ApolloniusGraphHierarchyVertexBase_2` and `TriangulationFaceBase_2`, respectively.
be a model of the `ApolloniusGraphHierarchyVertexBase_2` concept. It defaults to:
The second template parameter defaults to \code
`Triangulation_data_structure_2< Apollonius_graph_hierarchy_vertex_base_2< Apollonius_graph_vertex_base_2<Gt,true> >, Triangulation_face_base_2<Gt> >`. CGAL::Triangulation_data_structure_2<
CGAL::Apollonius_graph_hierarchy_vertex_base_2<CGAL::Apollonius_graph_vertex_base_2<Gt,true> >,
CGAL::Triangulation_face_base_2<Gt> >
\endcode
\cgalHeading{Heritage}
The `Apollonius_graph_hierarchy_2` class derives publicly from the The `Apollonius_graph_hierarchy_2` class derives publicly from the
`Apollonius_graph_2<Gt,Agds>` class. The interface is `Apollonius_graph_2<Gt,Agds>` class. The interface is
the same with its base class. In the sequel only the methods the same with its base class. In the sequel only the methods
overridden are documented. overridden are documented.
\cgalHeading{Types}
`Apollonius_graph_hierarchy_2` does not introduce other types than those introduced by `Apollonius_graph_hierarchy_2` does not introduce other types than those introduced by
its base class `Apollonius_graph_2<Gt,Agds>`. its base class `Apollonius_graph_2<Gt,Agds>`.
\sa `ApolloniusGraphDataStructure_2`
\sa `ApolloniusGraphTraits_2`
\sa `ApolloniusGraphHierarchyVertexBase_2`
\sa `CGAL::Apollonius_graph_2<Gt,Agds>` \sa `CGAL::Apollonius_graph_2<Gt,Agds>`
\sa `CGAL::Triangulation_data_structure_2<Vb,Fb>`
\sa `CGAL::Apollonius_graph_traits_2<K,Method_tag>` \sa `CGAL::Apollonius_graph_traits_2<K,Method_tag>`
\sa `CGAL::Apollonius_graph_filtered_traits_2<CK,CM,EK,EM,FK,FM>` \sa `CGAL::Apollonius_graph_filtered_traits_2<CK,CM,EK,EM,FK,FM>`
\sa `CGAL::Apollonius_graph_hierarchy_vertex_base_2<Agvb>`
*/ */
template< typename Gt, typename Agds > template< typename Gt, typename Agds >
class Apollonius_graph_hierarchy_2 : public CGAL::Apollonius_graph_2<Gt,Agds> { class Apollonius_graph_hierarchy_2 : public CGAL::Apollonius_graph_2<Gt,Agds> {
@ -61,8 +59,7 @@ public:
Creates an hierarchy of Apollonius graphs using `gt` as Creates an hierarchy of Apollonius graphs using `gt` as
geometric traits. geometric traits.
*/ */
Apollonius_graph_hierarchy_2(Gt Apollonius_graph_hierarchy_2(Gt gt=Gt());
gt=Gt());
/*! /*!
Creates an Apollonius graph hierarchy using Creates an Apollonius graph hierarchy using
@ -70,17 +67,15 @@ Creates an Apollonius graph hierarchy using
range [`first`, `beyond`). range [`first`, `beyond`).
*/ */
template< class Input_iterator > template< class Input_iterator >
Apollonius_graph_hierarchy_2<Gt,Agds>(Input_iterator Apollonius_graph_hierarchy_2(Input_iterator first, Input_iterator beyond, Gt gt=Gt());
first, Input_iterator beyond, Gt gt=Gt());
/*! /*!
Copy constructor. All faces, vertices and inter-level pointers Copy constructor. All faces, vertices, and inter-level pointers
are duplicated. After the construction, `agh` and `other` refer are duplicated. After the construction, `agh` and `other` refer
to two different Apollonius graph hierarchies: if to two different Apollonius graph hierarchies: if
`other` is modified, `agh` is not. `other` is modified, `agh` is not.
*/ */
Apollonius_graph_hierarchy_2<Gt,Agds> Apollonius_graph_hierarchy_2(const Apollonius_graph_hierarchy_2<Gt,Agds>& other);
(Apollonius_graph_hierarchy_2<Gt,Agds> other);
/*! /*!
Assignment. All faces, vertices and inter-level pointers Assignment. All faces, vertices and inter-level pointers
@ -112,7 +107,7 @@ site `s` in the Apollonius graph hierarchy. If `s`
is visible then the vertex handle of `s` is returned, otherwise is visible then the vertex handle of `s` is returned, otherwise
`Vertex_handle(nullptr)` is returned. `Vertex_handle(nullptr)` is returned.
*/ */
Vertex_handle insert(Site_2 s); Vertex_handle insert(const Site_2& s);
/*! /*!
Inserts `s` in the Apollonius graph hierarchy using the Inserts `s` in the Apollonius graph hierarchy using the
@ -124,8 +119,7 @@ A call to this method is equivalent to `agh.insert(s);` and it has
been added for the sake of conformity with the interface of the been added for the sake of conformity with the interface of the
`Apollonius_graph_2<Gt,Agds>` class. `Apollonius_graph_2<Gt,Agds>` class.
*/ */
Vertex_handle insert(Site_2 s, Vertex_handle Vertex_handle insert(const Site_2& s, Vertex_handle vnear);
vnear);
/// @} /// @}
@ -152,7 +146,7 @@ arbitrarily and one of the nearest neighbors of `p` is
returned. If there are no visible sites in the Apollonius diagram returned. If there are no visible sites in the Apollonius diagram
`Vertex_handle(nullptr)` is returned. `Vertex_handle(nullptr)` is returned.
*/ */
Vertex_handle nearest_neighbor(Point p); Vertex_handle nearest_neighbor(const Point_2& p) const;
/*! /*!
Finds the nearest neighbor of the point Finds the nearest neighbor of the point
@ -163,8 +157,7 @@ A call to this method is equivalent to
conformity with the interface of the conformity with the interface of the
`Apollonius_graph_2<Gt,Agds>` class. `Apollonius_graph_2<Gt,Agds>` class.
*/ */
Vertex_handle nearest_neighbor(Point p, Vertex_handle nearest_neighbor(const Point_2& p, Vertex_handle vnear) const;
Vertex_handle vnear);
/// @} /// @}
@ -177,7 +170,7 @@ state of the Apollonius graph hierarchy to an output stream. In particular,
all visible and hidden sites are written as well as the all visible and hidden sites are written as well as the
underlying combinatorial hierarchical data structure. underlying combinatorial hierarchical data structure.
*/ */
void file_output(std::ostream& os); void file_output(std::ostream& os) const;
/*! /*!
Reads the state of the Reads the state of the
@ -189,7 +182,7 @@ void file_input(std::istream& is);
Writes the current state of the Apollonius graph hierarchy to an Writes the current state of the Apollonius graph hierarchy to an
output stream. output stream.
*/ */
std::ostream& operator<<(std::ostream& os, Apollonius_graph_hierarchy_2<Gt,Agds> agh); std::ostream& operator<<(std::ostream& os, Apollonius_graph_hierarchy_2<Gt,Agds> agh) const;
/*! /*!
Reads the state of the Apollonius graph hierarchy from an input stream. Reads the state of the Apollonius graph hierarchy from an input stream.
@ -209,7 +202,7 @@ is validated, as well as the inter-level pointers. If `level` is
1, then the data structure at all levels is validated, the inter-level 1, then the data structure at all levels is validated, the inter-level
pointers are validated and all levels of the Apollonius graph pointers are validated and all levels of the Apollonius graph
hierarchy are also validated. Negative values of `level` always hierarchy are also validated. Negative values of `level` always
return `true`, and values greater then 1 are equivalent to return `true`, and values greater than 1 are equivalent to
`level` being 1. `level` being 1.
*/ */
bool is_valid(bool verbose = false, int level = 1) const; bool is_valid(bool verbose = false, int level = 1) const;
@ -227,11 +220,10 @@ void clear();
/*! /*!
The Apollonius graph hierarchies `other` and `agh` are The Apollonius graph hierarchies `other` and `agh` are
swapped. `agh`.`swap(other)` should be preferred to `agh`` = swapped. `agh.swap(other)` should be preferred to `agh = other`
other` or to `agh``(other)` if `other` is deleted afterwards. or to `agh(other)` if `other` is deleted afterwards.
*/ */
void swap(Apollonius_graph_hierarchy_2<Gt,Agds> void swap(Apollonius_graph_hierarchy_2<Gt,Agds>& other);
other);
/// @} /// @}

View File

@ -13,10 +13,9 @@ of the `ApolloniusGraphVertexBase_2` concept.
\cgalModels `ApolloniusGraphHierarchyVertexBase_2` \cgalModels `ApolloniusGraphHierarchyVertexBase_2`
\sa `ApolloniusGraphVertexBase_2`
\sa `ApolloniusGraphHierarchyVertexBase_2`
\sa `CGAL::Apollonius_graph_vertex_base_2<Gt,StoreHidden>` \sa `CGAL::Apollonius_graph_vertex_base_2<Gt,StoreHidden>`
\sa `CGAL::Triangulation_data_structure_2<Vb,Fb>`
\sa `CGAL::Apollonius_graph_hierarchy_2<Gt,Agds>`
*/ */
template< typename Agvb > template< typename Agvb >
class Apollonius_graph_hierarchy_vertex_base_2 : Agvb { class Apollonius_graph_hierarchy_vertex_base_2 : Agvb {
@ -34,7 +33,7 @@ Apollonius_graph_hierarchy_vertex_base_2();
Constructs a vertex associated with the site `s` and Constructs a vertex associated with the site `s` and
embedded at the center of `s`. embedded at the center of `s`.
*/ */
Apollonius_graph_hierarchy_vertex_base_2(Site_2 s); Apollonius_graph_hierarchy_vertex_base_2(const Site_2& s);
/*! /*!
Constructs a vertex associated with Constructs a vertex associated with
@ -42,7 +41,7 @@ the site `s`, embedded at the center of `s`,
and pointing to the face associated with the face and pointing to the face associated with the face
handle `f`. handle `f`.
*/ */
Apollonius_graph_vertex_base_2(Site_2 s, Face_handle f); Apollonius_graph_hierarchy_vertex_base_2(const Site_2& s, Face_handle f);
/// @} /// @}

View File

@ -22,13 +22,8 @@ The way the predicates are evaluated is discussed in
\cgalModels `ApolloniusGraphTraits_2` \cgalModels `ApolloniusGraphTraits_2`
\sa `Kernel`
\sa `ApolloniusGraphTraits_2`
\sa `CGAL::Integral_domain_without_division_tag`
\sa `CGAL::Field_with_sqrt_tag`
\sa `CGAL::Apollonius_graph_2<Gt,Agds>` \sa `CGAL::Apollonius_graph_2<Gt,Agds>`
\sa `CGAL::Apollonius_graph_filtered_traits_2<CK,CM,EK,EM,FK,FM>` \sa `CGAL::Apollonius_graph_filtered_traits_2<CK,CM,EK,EM,FK,FM>`
*/ */
template< typename K, typename Method_tag > template< typename K, typename Method_tag >
class Apollonius_graph_traits_2 { class Apollonius_graph_traits_2 {
@ -45,14 +40,13 @@ Apollonius_graph_traits_2<K,Method_tag>();
/*! /*!
Copy constructor. Copy constructor.
*/ */
Apollonius_graph_traits_2<K,Method_tag>(Apollonius_graph_traits_2<K,Method_tag> other); Apollonius_graph_traits_2<K,Method_tag>(const Apollonius_graph_traits_2<K,Method_tag>& other);
/*! /*!
Assignment operator. Assignment operator.
*/ */
Apollonius_graph_traits_2<K,Method_tag> Apollonius_graph_traits_2<K,Method_tag>
operator=(Apollonius_graph_traits_2<K,Method_tag> operator=(const Apollonius_graph_traits_2<K,Method_tag>& other);
other);
/// @} /// @}

View File

@ -19,13 +19,8 @@ discarded. By default `StoreHidden` is set to `true`.
\cgalModels `ApolloniusGraphVertexBase_2` \cgalModels `ApolloniusGraphVertexBase_2`
\sa `ApolloniusGraphVertexBase_2`
\sa `ApolloniusGraphDataStructure_2`
\sa `ApolloniusGraphTraits_2`
\sa `CGAL::Triangulation_data_structure_2<Vb,Fb>` \sa `CGAL::Triangulation_data_structure_2<Vb,Fb>`
\sa `CGAL::Apollonius_graph_traits_2<K,Method_tag>` \sa `CGAL::Apollonius_graph_hierarchy_vertex_base_2<Gt>`
\sa `CGAL::Apollonius_graph_filtered_traits_2<CK,CM,EK,EM,FK,FM>`
*/ */
template< typename Gt, typename StoreHidden > template< typename Gt, typename StoreHidden >
class Apollonius_graph_vertex_base_2 { class Apollonius_graph_vertex_base_2 {
@ -37,13 +32,13 @@ public:
/*! /*!
%Default constructor. %Default constructor.
*/ */
Apollonius_graph_bertex_base_2(); Apollonius_graph_vertex_base_2();
/*! /*!
Constructs a vertex associated with the site `s` and Constructs a vertex associated with the site `s` and
embedded at the center of `s`. embedded at the center of `s`.
*/ */
Apollonius_graph_vertex_base_2(Site_2 s); Apollonius_graph_vertex_base_2(const Site_2& s);
/*! /*!
Constructs a vertex associated with Constructs a vertex associated with
@ -51,7 +46,7 @@ the site `s`, embedded at the center of `s`,
and pointing to the face associated with the face and pointing to the face associated with the face
handle `f`. handle `f`.
*/ */
Apollonius_graph_vertex_base_2(Site_2 s, Face_handle f); Apollonius_graph_vertex_base_2(const Site_2& s, Face_handle f);
/// @} /// @}

View File

@ -22,12 +22,9 @@ The I/O operators are defined for `iostream`.
The information output in the `iostream` is: the point of the The information output in the `iostream` is: the point of the
Apollonius site and its weight. Apollonius site and its weight.
\sa `Kernel`
\sa `ApolloniusSite_2`
\sa `CGAL::Qt_widget` \sa `CGAL::Qt_widget`
\sa `CGAL::Apollonius_graph_traits_2<K,Method_tag>` \sa `CGAL::Apollonius_graph_traits_2<K,Method_tag>`
\sa `CGAL::Apollonius_graph_filtered_traits_2<CK,CM,EK,EM,FK,FM>` \sa `CGAL::Apollonius_graph_filtered_traits_2<CK,CM,EK,EM,FK,FM>`
*/ */
template< typename K > template< typename K >
class Apollonius_site_2 { class Apollonius_site_2 {
@ -44,7 +41,7 @@ Apollonius_site_2(Point_2 p=Point_2(), Weight w= Weight(0));
/*! /*!
Copy constructor. Copy constructor.
*/ */
Apollonius_site_2(Apollonius_site_2<K> other); Apollonius_site_2(const Apollonius_site_2<K>& other);
/// @} /// @}
@ -57,8 +54,7 @@ Apollonius site `s` into the stream `os`.
\pre The insert operator must be defined for `Point_2` and `Weight`. \pre The insert operator must be defined for `Point_2` and `Weight`.
\relates Apollonius_site_2 \relates Apollonius_site_2
*/ */
std::ostream& operator<<(std::ostream& os, std::ostream& operator<<(std::ostream& os, const Apollonius_site_2<K>& s) const;
const Apollonius_site_2<K>& s);
/*! /*!
Reads an Apollonius site from the stream `is` and assigns it Reads an Apollonius site from the stream `is` and assigns it
@ -67,8 +63,7 @@ to `s`.
\pre The extract operator must be defined for `Point_2` and `Weight`. \pre The extract operator must be defined for `Point_2` and `Weight`.
\relates Apollonius_site_2 \relates Apollonius_site_2
*/ */
std::istream& operator>>(std::istream& is, std::istream& operator>>(std::istream& is, const Apollonius_site_2<K>& s);
const Apollonius_site_2<K>& s);
/*! /*!
Inserts the Apollonius site `s` into the `Qt_widget` stream `w`. Inserts the Apollonius site `s` into the `Qt_widget` stream `w`.
@ -76,7 +71,6 @@ Inserts the Apollonius site `s` into the `Qt_widget` stream `w`.
\pre The insert operator must be defined for `K::Circle_2`. \pre The insert operator must be defined for `K::Circle_2`.
\relates Apollonius_site_2 \relates Apollonius_site_2
*/ */
Qt_widget& operator<<(Qt_widget& w, Qt_widget& operator<<(Qt_widget& w, const Apollonius_site_2<K>& s) const;
const Apollonius_site_2<K>& s);
} /* end namespace CGAL */ } /* end namespace CGAL */

View File

@ -42,10 +42,10 @@ public:
/// @{ /// @{
/*! /*!
Inserts inserts a degree two vertex and two faces adjacent to it that have two common edges.
a degree two vertex and two faces adjacent to it that have two common
edges. The edge defined by the face handle `f` and the integer The edge defined by the face handle `f` and the integer `i` is duplicated. It returns a handle
`i` is duplicated. It returns a handle to the vertex created. to the vertex created.
*/ */
Vertex_handle insert_degree_2(Face_handle f, int i); Vertex_handle insert_degree_2(Face_handle f, int i);

View File

@ -19,17 +19,12 @@ next and previous level graphs.
`ApolloniusGraphHierarchyVertexBase_2` does not introduce any `ApolloniusGraphHierarchyVertexBase_2` does not introduce any
types in addition to those of `ApolloniusGraphVertexBase_2`. types in addition to those of `ApolloniusGraphVertexBase_2`.
\cgalHasModel CGAL::Apollonius_graph_hierarchy_vertex_base_2<CGAL::Apollonius_graph_vertex_base_2<Gt,StoreHidden> > \cgalHasModel `CGAL::Apollonius_graph_hierarchy_vertex_base_2<CGAL::Apollonius_graph_vertex_base_2<Gt,StoreHidden> >`
\sa `ApolloniusGraphDataStructure_2` \sa `ApolloniusGraphDataStructure_2`
\sa `ApolloniusGraphVertexBase_2`
\sa `CGAL::Apollonius_graph_hierarchy_2<Gt,Agds>` \sa `CGAL::Apollonius_graph_hierarchy_2<Gt,Agds>`
\sa `CGAL::Triangulation_data_structure_2<Vb,Fb>` \sa `CGAL::Triangulation_data_structure_2<Vb,Fb>`
\sa `CGAL::Apollonius_graph_vertex_base_2<Gt,StoreHidden>`
\sa `CGAL::Apollonius_graph_hierarchy_vertex_base_2<Agvb>`
*/ */
class ApolloniusGraphHierarchyVertexBase_2 { class ApolloniusGraphHierarchyVertexBase_2 {
public: public:
@ -37,8 +32,7 @@ public:
/// @{ /// @{
/*! /*!
Default %Default constructor.
constructor.
*/ */
ApolloniusGraphHierarchyVertexBase_2(); ApolloniusGraphHierarchyVertexBase_2();

View File

@ -3,8 +3,6 @@
\ingroup PkgApolloniusGraph2Concepts \ingroup PkgApolloniusGraph2Concepts
\cgalConcept \cgalConcept
\cgalRefines `TriangulationVertexBase_2`
The concept `ApolloniusGraphVertexBase_2` describes the The concept `ApolloniusGraphVertexBase_2` describes the
requirements for the vertex base class of the requirements for the vertex base class of the
`ApolloniusGraphDataStructure_2` concept. A vertex stores an `ApolloniusGraphDataStructure_2` concept. A vertex stores an
@ -12,14 +10,14 @@ Apollonius site and provides access to one of its incident faces
through a `Face_handle`. In addition, it maintains a container of through a `Face_handle`. In addition, it maintains a container of
sites. The container stores the hidden sites related to the vertex. sites. The container stores the hidden sites related to the vertex.
\cgalRefines `TriangulationVertexBase_2`
\cgalHasModel `CGAL::Apollonius_graph_vertex_base_2<Gt,StoreHidden>` \cgalHasModel `CGAL::Apollonius_graph_vertex_base_2<Gt,StoreHidden>`
\sa `ApolloniusGraphDataStructure_2` \sa `ApolloniusGraphDataStructure_2`
\sa `ApolloniusGraphTraits_2` \sa `CGAL::Apollonius_graph_2<Gt,Agds>`
\sa `CGAL::Apollonius_graph_vertex_base_2<Gt,StoreHidden>` \sa `CGAL::Triangulation_data_structure_2<Vb,Fb>`
*/ */
class ApolloniusGraphVertexBase_2 { class ApolloniusGraphVertexBase_2 {
public: public:
@ -77,7 +75,7 @@ typedef unspecified_type Hidden_sites_iterator;
/// @{ /// @{
/*! /*!
Default constructor. %Default constructor.
*/ */
ApolloniusGraphVertexBase_2(); ApolloniusGraphVertexBase_2();

View File

@ -43,18 +43,18 @@ aforementioned concepts.
\cgalCRPSection{Concepts} \cgalCRPSection{Concepts}
- `ApolloniusSite_2` - `ApolloniusSite_2`
- `ApolloniusGraphTraits_2`
- `ApolloniusGraphDataStructure_2` - `ApolloniusGraphDataStructure_2`
- `ApolloniusGraphVertexBase_2` - `ApolloniusGraphVertexBase_2`
- `ApolloniusGraphTraits_2`
- `ApolloniusGraphHierarchyVertexBase_2` - `ApolloniusGraphHierarchyVertexBase_2`
\cgalCRPSection{Classes} \cgalCRPSection{Classes}
- `CGAL::Apollonius_graph_2<Gt,Agds>` - `CGAL::Apollonius_graph_2<Gt,Agds>`
- `CGAL::Apollonius_site_2<K>` - `CGAL::Apollonius_site_2<K>`
- `CGAL::Apollonius_graph_vertex_base_2<Gt,StoreHidden>`
- `CGAL::Apollonius_graph_traits_2<K,Method_tag>` - `CGAL::Apollonius_graph_traits_2<K,Method_tag>`
- `CGAL::Apollonius_graph_filtered_traits_2<CK,CM,EK,EM,FK,FM>` - `CGAL::Apollonius_graph_filtered_traits_2<CK,CM,EK,EM,FK,FM>`
- `CGAL::Apollonius_graph_vertex_base_2<Gt,StoreHidden>`
- `CGAL::Apollonius_graph_hierarchy_2<Gt,Agds>` - `CGAL::Apollonius_graph_hierarchy_2<Gt,Agds>`
- `CGAL::Apollonius_graph_hierarchy_vertex_base_2<Agvb>` - `CGAL::Apollonius_graph_hierarchy_vertex_base_2<Agvb>`

View File

@ -1,26 +1,18 @@
# Created by the script cgal_create_cmake_script # Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application. # This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.15)
project( Apollonius_graph_2_Examples ) project(Apollonius_graph_2_Examples)
find_package(CGAL REQUIRED COMPONENTS Core)
find_package(CGAL QUIET COMPONENTS Core ) include(${CGAL_USE_FILE})
if ( CGAL_FOUND )
include(${CGAL_USE_FILE})
# create a target per cppfile
file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
foreach(cppfile ${cppfiles})
create_single_source_cgal_program( "${cppfile}" )
endforeach()
else()
message(STATUS "This program requires the CGAL library, and will not be compiled.")
endif()
# create a target per cppfile
file(
GLOB cppfiles
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
foreach(cppfile ${cppfiles})
create_single_source_cgal_program("${cppfile}")
endforeach()

View File

@ -1,26 +1,18 @@
# Created by the script cgal_create_cmake_script # Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application. # This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15) cmake_minimum_required(VERSION 3.1...3.15)
project( Apollonius_graph_2_Tests ) project(Apollonius_graph_2_Tests)
find_package(CGAL REQUIRED)
find_package(CGAL QUIET) include_directories(BEFORE "include")
if ( CGAL_FOUND )
include_directories (BEFORE "include")
# create a target per cppfile
file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
foreach(cppfile ${cppfiles})
create_single_source_cgal_program( "${cppfile}" )
endforeach()
else()
message(STATUS "This program requires the CGAL library, and will not be compiled.")
endif()
# create a target per cppfile
file(
GLOB cppfiles
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
foreach(cppfile ${cppfiles})
create_single_source_cgal_program("${cppfile}")
endforeach()

Some files were not shown because too many files have changed in this diff Show More