Merge remote-tracking branch cgal/master into Triangulation_segment_traverser_3-tvanlank
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# CGAL Resources
|
||||
|
||||
* [Official CGAL website](http://www.cgal.org)
|
||||
* [Online manual](http://doc.cgal.org/latest/Manual/index.html)
|
||||
* [Official CGAL website](https://www.cgal.org)
|
||||
* [Online manual](https://doc.cgal.org/latest/Manual/index.html)
|
||||
* [Guidelines for contributing](https://github.com/CGAL/cgal/wiki/Guidelines)
|
||||
* [Mailing lists](http://www.cgal.org/mailing_list.html)
|
||||
* [Mailing lists](https://www.cgal.org/mailing_list.html)
|
||||
|
||||
@@ -9,4 +9,6 @@ _Describe what your pull request changes to CGAL (this can be skipped if it solv
|
||||
* Affected package(s):
|
||||
* Issue(s) solved (if any): fix #0000, fix #0000,...
|
||||
* Feature/Small Feature (if any):
|
||||
* Link to compiled documentation (obligatory for small feature) [link](https://mydoc/Manual/Pkg)
|
||||
* License and copyright ownership:
|
||||
|
||||
|
||||
+53
-96
@@ -3,103 +3,60 @@ dist: trusty
|
||||
sudo: required
|
||||
git:
|
||||
depth: 3
|
||||
matrix:
|
||||
include:
|
||||
- compiler: gcc
|
||||
env: PACKAGE='CHECK'
|
||||
- compiler: clang-3.6
|
||||
env: PACKAGE='CHECK'
|
||||
- compiler: clang-3.6
|
||||
env: PACKAGE='AABB_tree Advancing_front_surface_reconstruction Algebraic_foundations '
|
||||
- compiler: clang-3.6
|
||||
env: PACKAGE='Algebraic_kernel_d Algebraic_kernel_for_circles Algebraic_kernel_for_spheres '
|
||||
- compiler: clang-3.6
|
||||
env: PACKAGE='Alpha_shapes_2 Alpha_shapes_3 Apollonius_graph_2 '
|
||||
- compiler: clang-3.6
|
||||
env: PACKAGE='Arithmetic_kernel Arrangement_on_surface_2 Barycentric_coordinates_2 '
|
||||
- compiler: clang-3.6
|
||||
env: PACKAGE='BGL Boolean_set_operations_2 Bounding_volumes '
|
||||
- compiler: clang-3.6
|
||||
env: PACKAGE='Box_intersection_d Cartesian_kernel CGAL_Core '
|
||||
- compiler: clang-3.6
|
||||
env: PACKAGE='CGAL_ImageIO CGAL_ipelets Circular_kernel_2 '
|
||||
- compiler: clang-3.6
|
||||
env: PACKAGE='Circular_kernel_3 Circulator Classification '
|
||||
- compiler: clang-3.6
|
||||
env: PACKAGE='Combinatorial_map Cone_spanners_2 Convex_decomposition_3 '
|
||||
- compiler: clang-3.6
|
||||
env: PACKAGE='Convex_hull_2 Convex_hull_3 Convex_hull_d '
|
||||
- compiler: clang-3.6
|
||||
env: PACKAGE='Distance_2 Distance_3 Envelope_2 '
|
||||
- compiler: clang-3.6
|
||||
env: PACKAGE='Envelope_3 Filtered_kernel Generalized_map '
|
||||
- compiler: clang-3.6
|
||||
env: PACKAGE='Generator Geomview GraphicsView '
|
||||
- compiler: clang-3.6
|
||||
env: PACKAGE='HalfedgeDS Hash_map Homogeneous_kernel '
|
||||
- compiler: clang-3.6
|
||||
env: PACKAGE='Inscribed_areas Installation Interpolation '
|
||||
- compiler: clang-3.6
|
||||
env: PACKAGE='Intersections_2 Intersections_3 Interval_skip_list '
|
||||
- compiler: clang-3.6
|
||||
env: PACKAGE='Interval_support Inventor Jet_fitting_3 '
|
||||
- compiler: clang-3.6
|
||||
env: PACKAGE='Kernel_23 Kernel_d LEDA '
|
||||
- compiler: clang-3.6
|
||||
env: PACKAGE='Linear_cell_complex MacOSX Maintenance '
|
||||
- compiler: clang-3.6
|
||||
env: PACKAGE='Matrix_search Mesh_2 Mesh_3 '
|
||||
- compiler: clang-3.6
|
||||
env: PACKAGE='Mesher_level Minkowski_sum_2 Minkowski_sum_3 '
|
||||
- compiler: clang-3.6
|
||||
env: PACKAGE='Modifier Modular_arithmetic Nef_2 '
|
||||
- compiler: clang-3.6
|
||||
env: PACKAGE='Nef_3 Nef_S2 NewKernel_d '
|
||||
- compiler: clang-3.6
|
||||
env: PACKAGE='Number_types OpenNL Operations_on_polyhedra '
|
||||
- compiler: clang-3.6
|
||||
env: PACKAGE='Optimal_transportation_reconstruction_2 Optimisation_basic Partition_2 '
|
||||
- compiler: clang-3.6
|
||||
env: PACKAGE='Periodic_2_triangulation_2 Periodic_3_triangulation_3 Point_set_2 '
|
||||
- compiler: clang-3.6
|
||||
env: PACKAGE='Point_set_3 Point_set_processing_3 Point_set_shape_detection_3 '
|
||||
- compiler: clang-3.6
|
||||
env: PACKAGE='Poisson_surface_reconstruction_3 Polygon Polygon_mesh_processing '
|
||||
- compiler: clang-3.6
|
||||
env: PACKAGE='Polyhedron Polyhedron_IO Polyline_simplification_2 '
|
||||
- compiler: clang-3.6
|
||||
env: PACKAGE='Polynomial Polytope_distance_d Principal_component_analysis '
|
||||
- compiler: clang-3.6
|
||||
env: PACKAGE='Principal_component_analysis_LGPL Profiling_tools Property_map '
|
||||
- compiler: clang-3.6
|
||||
env: PACKAGE='QP_solver Random_numbers Ridges_3 '
|
||||
- compiler: clang-3.6
|
||||
env: PACKAGE='Scale_space_reconstruction_3 Scripts SearchStructures '
|
||||
- compiler: clang-3.6
|
||||
env: PACKAGE='Segment_Delaunay_graph_2 Segment_Delaunay_graph_Linf_2 Set_movable_separability_2 '
|
||||
- compiler: clang-3.6
|
||||
env: PACKAGE='Skin_surface_3 Snap_rounding_2 Solver_interface '
|
||||
- compiler: clang-3.6
|
||||
env: PACKAGE='Spatial_searching Spatial_sorting STL_Extension '
|
||||
- compiler: clang-3.6
|
||||
env: PACKAGE='Straight_skeleton_2 Stream_lines_2 Stream_support '
|
||||
- compiler: clang-3.6
|
||||
env: PACKAGE='Subdivision_method_3 Surface_mesh Surface_mesh_deformation '
|
||||
- compiler: clang-3.6
|
||||
env: PACKAGE='Surface_mesher Surface_mesh_parameterization Surface_mesh_segmentation '
|
||||
- compiler: clang-3.6
|
||||
env: PACKAGE='Surface_mesh_shortest_path Surface_mesh_simplification Surface_mesh_skeletonization '
|
||||
- compiler: clang-3.6
|
||||
env: PACKAGE='Surface_sweep_2 TDS_2 TDS_3 '
|
||||
- compiler: clang-3.6
|
||||
env: PACKAGE='Testsuite Three Triangulation '
|
||||
- compiler: clang-3.6
|
||||
env: PACKAGE='Triangulation_2 Triangulation_3 Union_find '
|
||||
- compiler: clang-3.6
|
||||
env: PACKAGE='Visibility_2 Voronoi_diagram_2 wininst '
|
||||
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 Barycentric_coordinates_2 '
|
||||
- PACKAGE='BGL Boolean_set_operations_2 Bounding_volumes '
|
||||
- PACKAGE='Box_intersection_d Cartesian_kernel CGAL_Core '
|
||||
- PACKAGE='CGAL_ImageIO CGAL_ipelets 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 Homogeneous_kernel '
|
||||
- PACKAGE='Inscribed_areas Installation Interpolation '
|
||||
- PACKAGE='Intersections_2 Intersections_3 Interval_skip_list '
|
||||
- PACKAGE='Interval_support Inventor Jet_fitting_3 '
|
||||
- PACKAGE='Kernel_23 Kernel_d LEDA '
|
||||
- PACKAGE='Linear_cell_complex MacOSX Maintenance '
|
||||
- PACKAGE='Matrix_search Mesh_2 Mesh_3 '
|
||||
- PACKAGE='Mesher_level Minkowski_sum_2 Minkowski_sum_3 '
|
||||
- PACKAGE='Modifier Modular_arithmetic Nef_2 '
|
||||
- PACKAGE='Nef_3 Nef_S2 NewKernel_d '
|
||||
- PACKAGE='Number_types OpenNL Operations_on_polyhedra '
|
||||
- PACKAGE='Optimal_transportation_reconstruction_2 Optimisation_basic Partition_2 '
|
||||
- PACKAGE='Periodic_2_triangulation_2 Periodic_3_mesh_3 Periodic_3_triangulation_3 '
|
||||
- PACKAGE='Point_set_2 Point_set_3 Point_set_processing_3 '
|
||||
- PACKAGE='Point_set_shape_detection_3 Poisson_surface_reconstruction_3 Polygon '
|
||||
- PACKAGE='Polygon_mesh_processing 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 Scale_space_reconstruction_3 Scripts '
|
||||
- PACKAGE='SearchStructures Segment_Delaunay_graph_2 Segment_Delaunay_graph_Linf_2 '
|
||||
- PACKAGE='Set_movable_separability_2 Skin_surface_3 Snap_rounding_2 '
|
||||
- PACKAGE='Solver_interface Spatial_searching Spatial_sorting '
|
||||
- PACKAGE='STL_Extension Straight_skeleton_2 Stream_lines_2 '
|
||||
- PACKAGE='Stream_support Subdivision_method_3 Surface_mesh '
|
||||
- PACKAGE='Surface_mesh_deformation Surface_mesher Surface_mesh_parameterization '
|
||||
- PACKAGE='Surface_mesh_segmentation Surface_mesh_shortest_path Surface_mesh_simplification '
|
||||
- PACKAGE='Surface_mesh_skeletonization Surface_sweep_2 TDS_2 '
|
||||
- PACKAGE='TDS_3 Testsuite Three '
|
||||
- PACKAGE='Triangulation Triangulation_2 Triangulation_3 '
|
||||
- PACKAGE='Union_find Visibility_2 Voronoi_diagram_2 '
|
||||
- PACKAGE='wininst '
|
||||
compiler: clang-3.6
|
||||
install:
|
||||
- echo "$PWD"
|
||||
- if [ -n "$TRAVIS_PULL_REQUEST" ] && [ "$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
|
||||
- bash .travis/install.sh
|
||||
- if [[ "$CXX" = "clang++" ]]; then export CXX=clang++-3.6 CC=clang-3.6; fi
|
||||
- export CXX=clang++-3.6 CC=clang-3.6;
|
||||
before_script:
|
||||
- wget -O doxygen_exe https://cgal.geometryfactory.com/~mgimeno/doxygen_exe
|
||||
- sudo mv doxygen_exe /usr/bin/doxygen
|
||||
@@ -112,7 +69,7 @@ before_script:
|
||||
- cd ..
|
||||
script:
|
||||
- cd ./.travis
|
||||
- bash -x -e ./build_package.sh $PACKAGE
|
||||
- bash ./build_package.sh $PACKAGE
|
||||
notifications:
|
||||
email:
|
||||
on_success: change # default: always
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
[ -n "$CGAL_DEBUG_TRAVIS" ] && set -x
|
||||
|
||||
CXX_FLAGS="-DCGAL_NDEBUG"
|
||||
|
||||
@@ -51,9 +52,13 @@ old_IFS=$IFS
|
||||
IFS=$' '
|
||||
ROOT="$PWD/.."
|
||||
NEED_3D=0
|
||||
cd $ROOT
|
||||
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 ] ||\
|
||||
@@ -72,7 +77,8 @@ do
|
||||
zsh $ROOT/Scripts/developer_scripts/test_merge_of_branch HEAD
|
||||
#test dependencies
|
||||
cd $ROOT
|
||||
bash Scripts/developer_scripts/cgal_check_dependencies.sh /usr/bin/doxygen
|
||||
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
|
||||
|
||||
|
||||
@@ -41,32 +41,26 @@ old_IFS=$IFS
|
||||
IFS=$'\n'
|
||||
for LINE in $(cat "$PWD/.travis/template.txt")
|
||||
do
|
||||
if [ "$LINE" != " include:" ]
|
||||
if [ "$LINE" != " matrix:" ]
|
||||
then
|
||||
echo "$LINE" >> .travis.yml
|
||||
else
|
||||
break
|
||||
fi
|
||||
done
|
||||
echo " include: " >> .travis.yml
|
||||
echo " matrix: " >> .travis.yml
|
||||
#writes the matrix
|
||||
echo " - compiler: gcc " >> .travis.yml
|
||||
echo " env: PACKAGE='CHECK' " >> .travis.yml
|
||||
echo " - compiler: clang-3.6" >> .travis.yml
|
||||
echo " env: PACKAGE='CHECK' " >> .travis.yml
|
||||
echo " - PACKAGE='CHECK' " >> .travis.yml
|
||||
for package in ${PACKAGES[@]}
|
||||
do
|
||||
echo " - compiler: clang-3.6" >> .travis.yml
|
||||
echo " env: PACKAGE='$package' " >> .travis.yml
|
||||
echo " - PACKAGE='$package' " >> .travis.yml
|
||||
done
|
||||
#echo " - compiler: clang-3.6" >> .travis.yml
|
||||
#echo " env: PACKAGE='Polyhedron_demo' " >> .travis.yml
|
||||
|
||||
#writes the end of the file
|
||||
COPY=0
|
||||
for LINE in $(cat "$PWD/.travis/template.txt")
|
||||
do
|
||||
if [ "$LINE" = "install: " ]
|
||||
if [ "$LINE" = "compiler: clang-3.6" ]
|
||||
then
|
||||
COPY=1
|
||||
fi
|
||||
|
||||
+2
-1
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -x
|
||||
[ -n "$CGAL_DEBUG_TRAVIS" ] && set -x
|
||||
DONE=0
|
||||
while [ $DONE = 0 ]
|
||||
do
|
||||
@@ -21,4 +21,5 @@ libboost-system1.55-dev libboost-program-options1.55-dev libboost-thread1.55-dev
|
||||
qt55base qt55script qt55svg qt55tools qt55graphicaleffects libopencv-dev mesa-common-dev libmetis-dev libglu1-mesa-dev \
|
||||
|| DONE=0 && sudo apt-get update
|
||||
done
|
||||
exit 0
|
||||
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
mkdir -p openmesh
|
||||
cd openmesh
|
||||
wget -O openmesh.tar.gz https://www.openmesh.org/media/Releases/6.3/OpenMesh-6.3.tar.gz
|
||||
tar xvf openmesh.tar.gz --strip-components=1
|
||||
|
||||
tar xf openmesh.tar.gz --strip-components=1
|
||||
sed -i '94i #include <sys/time.h>' src/OpenMesh/Tools/Utils/conio.cc
|
||||
|
||||
mkdir build
|
||||
|
||||
@@ -74,6 +74,7 @@ Optimal_transportation_reconstruction_2
|
||||
Optimisation_basic
|
||||
Partition_2
|
||||
Periodic_2_triangulation_2
|
||||
Periodic_3_mesh_3
|
||||
Periodic_3_triangulation_3
|
||||
Point_set_2
|
||||
Point_set_3
|
||||
|
||||
@@ -3,12 +3,16 @@ dist: trusty
|
||||
sudo: required
|
||||
git:
|
||||
depth: 3
|
||||
matrix:
|
||||
include:
|
||||
env:
|
||||
matrix:
|
||||
PACKAGES_MATRIX
|
||||
|
||||
compiler: clang-3.6
|
||||
install:
|
||||
- echo "$PWD"
|
||||
- if [ -n "$TRAVIS_PULL_REQUEST" ] && [ "$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
|
||||
- bash .travis/install.sh
|
||||
- if [[ "$CXX" = "clang++" ]]; then export CXX=clang++-3.6 CC=clang-3.6; fi
|
||||
- export CXX=clang++-3.6 CC=clang-3.6;
|
||||
before_script:
|
||||
- wget -O doxygen_exe https://cgal.geometryfactory.com/~mgimeno/doxygen_exe
|
||||
- sudo mv doxygen_exe /usr/bin/doxygen
|
||||
@@ -21,7 +25,7 @@ before_script:
|
||||
- cd ..
|
||||
script:
|
||||
- cd ./.travis
|
||||
- bash -x -e ./build_package.sh $PACKAGE
|
||||
- bash ./build_package.sh $PACKAGE
|
||||
notifications:
|
||||
email:
|
||||
on_success: change # default: always
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
|
||||
DO_IGNORE=FALSE
|
||||
cd $1
|
||||
if [ ! -f "$2/package_info/$ARG/dependencies" ];then
|
||||
if [ ! -f "$2/package_info/$2/dependencies" ];then
|
||||
echo "No dependencies found for $2"
|
||||
return
|
||||
exit 1
|
||||
fi
|
||||
LIST_OF_FILES=$(git diff --name-only origin/master |cut -d/ -f1 |uniq |sort)
|
||||
LIST_OF_DEPS=$(cat "$2/package_info/$ARG/dependencies")
|
||||
LIST_OF_DEPS=$(cat "$2/package_info/$2/dependencies")
|
||||
echo "$LIST_OF_DEPS"
|
||||
for flie in $LIST_OF_DEPS
|
||||
do
|
||||
|
||||
@@ -27,14 +27,8 @@ find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Gui Svg)
|
||||
|
||||
include( ${CGAL_USE_FILE} )
|
||||
|
||||
# Find QGLViewer
|
||||
if(Qt5_FOUND)
|
||||
find_package(QGLViewer)
|
||||
endif(Qt5_FOUND)
|
||||
|
||||
if(CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND QGLVIEWER_FOUND)
|
||||
|
||||
include_directories ( ${QGLVIEWER_INCLUDE_DIR} )
|
||||
if(CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND)
|
||||
|
||||
qt5_wrap_ui( UI_FILES MainWindow.ui )
|
||||
|
||||
@@ -55,20 +49,22 @@ if(CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND QGLVIEWER_FOUND)
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/Viewer_moc.cpp"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/Scene_moc.cpp" )
|
||||
|
||||
add_executable ( AABB_demo AABB_demo.cpp ${UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES})
|
||||
add_executable ( AABB_demo AABB_demo.cpp ${UI_FILES} ${CGAL_Qt5_RESOURCE_FILES}
|
||||
#${CGAL_Qt5_MOC_FILES}
|
||||
)
|
||||
# Link with Qt libraries
|
||||
target_link_libraries( AABB_demo PRIVATE
|
||||
Qt5::OpenGL Qt5::Gui
|
||||
Qt5::OpenGL Qt5::Gui Qt5::Xml
|
||||
CGAL::CGAL
|
||||
CGAL::CGAL_Qt5
|
||||
${QGLVIEWER_LIBRARIES})
|
||||
)
|
||||
|
||||
add_to_cached_list( CGAL_EXECUTABLE_TARGETS AABB_demo )
|
||||
|
||||
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
|
||||
cgal_add_compilation_test(AABB_demo)
|
||||
|
||||
else (CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND QGLVIEWER_FOUND)
|
||||
else (CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND)
|
||||
|
||||
set(AABB_MISSING_DEPS "")
|
||||
|
||||
@@ -84,10 +80,6 @@ else (CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND QGLVIEWER_FOUND)
|
||||
set(AABB_MISSING_DEPS "Qt5, ${AABB_MISSING_DEPS}")
|
||||
endif()
|
||||
|
||||
if(NOT QGLVIEWER_FOUND)
|
||||
set(AABB_MISSING_DEPS "QGLViewer, ${AABB_MISSING_DEPS}")
|
||||
endif()
|
||||
|
||||
message(STATUS "NOTICE: This demo requires ${AABB_MISSING_DEPS}and will not be compiled.")
|
||||
|
||||
endif (CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND QGLVIEWER_FOUND)
|
||||
endif (CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND )
|
||||
|
||||
@@ -76,7 +76,7 @@ void MainWindow::updateViewerBBox()
|
||||
const double xmax = bbox.xmax();
|
||||
const double ymax = bbox.ymax();
|
||||
const double zmax = bbox.zmax();
|
||||
qglviewer::Vec
|
||||
CGAL::qglviewer::Vec
|
||||
vec_min(xmin, ymin, zmin),
|
||||
vec_max(xmax, ymax, zmax);
|
||||
m_pViewer->setSceneBoundingBox(vec_min,vec_max);
|
||||
@@ -411,27 +411,18 @@ void MainWindow::on_actionRefine_loop_triggered()
|
||||
|
||||
void MainWindow::on_actionSave_snapshot_triggered()
|
||||
{
|
||||
// save snapshot to file
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
QString filename = QFileDialog::getSaveFileName(this,tr("Save snapshot to file..."),"snapshot00.png","*.png");
|
||||
m_pViewer->saveSnapshot(filename);
|
||||
QApplication::restoreOverrideCursor();
|
||||
return;
|
||||
}
|
||||
void MainWindow::on_actionCopy_snapshot_triggered()
|
||||
{
|
||||
// copy snapshot to clipboard
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
QClipboard *qb = QApplication::clipboard();
|
||||
m_pViewer->makeCurrent();
|
||||
m_pViewer->raise();
|
||||
#if QGLVIEWER_VERSION >= 0x020700
|
||||
QImage snapshot = m_pViewer->grabFramebuffer();
|
||||
#else
|
||||
QImage snapshot = m_pViewer->grabFrameBuffer(true);
|
||||
|
||||
#endif
|
||||
qb->setImage(snapshot);
|
||||
QApplication::restoreOverrideCursor();
|
||||
QApplication::restoreOverrideCursor();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ class Refiner
|
||||
typedef typename Polyhedron::Edge_iterator Edge_iterator;
|
||||
typedef std::priority_queue<Edge,
|
||||
std::vector<Edge>,
|
||||
less<Edge> > PQueue;
|
||||
::less<Edge> > PQueue;
|
||||
// data
|
||||
PQueue m_queue;
|
||||
Polyhedron* m_pMesh;
|
||||
|
||||
@@ -490,7 +490,7 @@ void Scene::compute_texture(int i, int j,Color_ramp pos_ramp ,Color_ramp neg_ram
|
||||
|
||||
}
|
||||
|
||||
void Scene::attrib_buffers(QGLViewer* viewer)
|
||||
void Scene::attrib_buffers(CGAL::QGLViewer* viewer)
|
||||
{
|
||||
QMatrix4x4 mvpMatrix;
|
||||
double mat[16];
|
||||
@@ -589,7 +589,7 @@ void Scene::update_bbox()
|
||||
<< " facets)" << std::endl;
|
||||
}
|
||||
|
||||
void Scene::draw(QGLViewer* viewer)
|
||||
void Scene::draw(CGAL::QGLViewer* viewer)
|
||||
{
|
||||
if(!gl_init)
|
||||
initGL();
|
||||
@@ -613,7 +613,6 @@ void Scene::draw(QGLViewer* viewer)
|
||||
}
|
||||
if(m_view_points && pos_points.size()>0)
|
||||
{
|
||||
gl->glPointSize(2.0f);
|
||||
vao[0].bind();
|
||||
attrib_buffers(viewer);
|
||||
rendering_program.bind();
|
||||
@@ -766,8 +765,8 @@ Plane Scene::random_plane(const CGAL::Bbox_3& bbox)
|
||||
|
||||
Plane Scene::frame_plane() const
|
||||
{
|
||||
const qglviewer::Vec& pos = m_frame->position();
|
||||
const qglviewer::Vec& n = m_frame->inverseTransformOf(qglviewer::Vec(0.f, 0.f, 1.f));
|
||||
const CGAL::qglviewer::Vec& pos = m_frame->position();
|
||||
const CGAL::qglviewer::Vec& n = m_frame->inverseTransformOf(CGAL::qglviewer::Vec(0.f, 0.f, 1.f));
|
||||
|
||||
return Plane(n[0], n[1], n[2], - n * pos);
|
||||
}
|
||||
|
||||
@@ -17,9 +17,8 @@
|
||||
|
||||
#include <QtCore/qglobal.h>
|
||||
#include <QMap>
|
||||
#include <QGLViewer/manipulatedFrame.h>
|
||||
#include <QGLViewer/qglviewer.h>
|
||||
#include <QOpenGLFunctions_2_1>
|
||||
#include <CGAL/Qt/manipulatedFrame.h>
|
||||
#include <CGAL/Qt/qglviewer.h>
|
||||
#include <QOpenGLVertexArrayObject>
|
||||
#include <QOpenGLBuffer>
|
||||
#include <QOpenGLShaderProgram>
|
||||
@@ -71,7 +70,7 @@ private:
|
||||
typedef CGAL::AABB_traits<Kernel, Edge_Primitive> Edge_Traits;
|
||||
typedef CGAL::AABB_tree<Edge_Traits> Edge_tree;
|
||||
|
||||
typedef qglviewer::ManipulatedFrame ManipulatedFrame;
|
||||
typedef CGAL::qglviewer::ManipulatedFrame ManipulatedFrame;
|
||||
|
||||
enum Cut_planes_types {
|
||||
NONE, UNSIGNED_FACETS, SIGNED_FACETS, UNSIGNED_EDGES, CUT_SEGMENTS
|
||||
@@ -79,7 +78,7 @@ private:
|
||||
|
||||
public:
|
||||
QGLContext* context;
|
||||
void draw(QGLViewer*);
|
||||
void draw(CGAL::QGLViewer*);
|
||||
void update_bbox();
|
||||
Bbox bbox() { return m_bbox; }
|
||||
ManipulatedFrame* manipulatedFrame() const { return m_frame; }
|
||||
@@ -171,7 +170,7 @@ private:
|
||||
QOpenGLShaderProgram rendering_program;
|
||||
void initialize_buffers();
|
||||
void compute_elements(int mode);
|
||||
void attrib_buffers(QGLViewer*);
|
||||
void attrib_buffers(CGAL::QGLViewer*);
|
||||
void compile_shaders();
|
||||
void compute_texture(int, int, Color_ramp, Color_ramp);
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include <CGAL/Qt/CreateOpenGLContext.h>
|
||||
|
||||
Viewer::Viewer(QWidget* parent)
|
||||
: QGLViewer(CGAL::Qt::createOpenGLContext(),parent),
|
||||
: CGAL::QGLViewer(parent),
|
||||
m_pScene(NULL),
|
||||
m_custom_mouse(false)
|
||||
{
|
||||
@@ -18,7 +18,7 @@ void Viewer::setScene(Scene* pScene)
|
||||
|
||||
void Viewer::draw()
|
||||
{
|
||||
QGLViewer::draw();
|
||||
CGAL::QGLViewer::draw();
|
||||
if(m_pScene != NULL)
|
||||
{
|
||||
m_pScene->draw(this);
|
||||
@@ -28,7 +28,7 @@ void Viewer::draw()
|
||||
|
||||
void Viewer::initializeGL()
|
||||
{
|
||||
QGLViewer::initializeGL();
|
||||
CGAL::QGLViewer::initializeGL();
|
||||
setBackgroundColor(::Qt::white);
|
||||
//m_pScene->initGL(this);
|
||||
}
|
||||
@@ -43,7 +43,7 @@ void Viewer::mousePressEvent(QMouseEvent* e)
|
||||
m_custom_mouse = true;
|
||||
}
|
||||
|
||||
QGLViewer::mousePressEvent(e);
|
||||
CGAL::QGLViewer::mousePressEvent(e);
|
||||
}
|
||||
|
||||
void Viewer::mouseReleaseEvent(QMouseEvent* e)
|
||||
@@ -59,6 +59,6 @@ void Viewer::mouseReleaseEvent(QMouseEvent* e)
|
||||
m_custom_mouse = false;
|
||||
}
|
||||
|
||||
QGLViewer::mouseReleaseEvent(e);
|
||||
CGAL::QGLViewer::mouseReleaseEvent(e);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
#ifndef VIEWER_H
|
||||
#define VIEWER_H
|
||||
#include <QMap>
|
||||
#include <QGLViewer/qglviewer.h>
|
||||
#include <CGAL/Qt/qglviewer.h>
|
||||
|
||||
|
||||
// forward declarations
|
||||
class QWidget;
|
||||
class Scene;
|
||||
class Viewer : public QGLViewer{
|
||||
class Viewer : public CGAL::QGLViewer{
|
||||
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
Viewer(QWidget * parent);
|
||||
|
||||
// overload several QGLViewer virtual functions
|
||||
// overload several CGAL::QGLViewer virtual functions
|
||||
void draw();
|
||||
void initializeGL();
|
||||
void setScene(Scene* pScene);
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
<p>Copyright ©2009
|
||||
<a href="http://www-sop.inria.fr/">INRIA Sophia Antipolis - Mediterranee<a/></p>
|
||||
<p>This application illustrates the AABB tree component
|
||||
of <a href="http://www.cgal.org/">CGAL</a>, applied to polyhedron
|
||||
of <a href="https://www.cgal.org/">CGAL</a>, applied to polyhedron
|
||||
facets and edges.</p>
|
||||
<p>See also the following chapters of the manual:
|
||||
<ul>
|
||||
<li><a href="http://www.cgal.org/Pkg/Polyhedron">
|
||||
<li><a href="https://www.cgal.org/Pkg/Polyhedron">
|
||||
3D Polyhedral Surface</a>,
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -66,7 +66,8 @@ typedef unspecified_type Construct_sphere_3;
|
||||
|
||||
/*!
|
||||
A functor object to compute the point on a geometric primitive which is closest from a query. Provides the operator:
|
||||
`Point_3 operator()(const Type_2& type_2, const Point_3& p);` where `Type_2` is any type among `Segment_3` and `Triangle_3`. The operator returns the point on `type_2` which is closest to `p`.
|
||||
`Point_3 operator()(const Type_2& type_2, const Point_3& p);` where `Type_2` can be any of the following types : `Segment_3`, `Ray_3`, or `Triangle_3`.
|
||||
The operator returns the point on `type_2` which is closest to `p`.
|
||||
*/
|
||||
typedef unspecified_type Construct_projected_point_3;
|
||||
|
||||
|
||||
@@ -42,15 +42,16 @@ Bounding box type.
|
||||
typedef unspecified_type Bounding_box;
|
||||
|
||||
/*!
|
||||
enum required for axis selection
|
||||
*/
|
||||
enum Axis {
|
||||
X_AXIS,
|
||||
Y_AXIS,
|
||||
Z_AXIS
|
||||
CGAL_X_AXIS,
|
||||
CGAL_Y_AXIS,
|
||||
CGAL_Z_AXIS
|
||||
};
|
||||
|
||||
/*!
|
||||
|
||||
3D Point and Primitive Id type
|
||||
*/
|
||||
typedef std::pair<Point_3, Primitive::Id> Point_and_primitive_id;
|
||||
|
||||
|
||||
@@ -67,9 +67,9 @@ public:
|
||||
*
|
||||
*
|
||||
* \tparam ObjectPropertyMap is a model of `ReadablePropertyMap` with `Id` as
|
||||
* `key_type`. It must be default constructible.
|
||||
* `key_type`. It must be a model of `CopyConstructible`, `DefaultConstructible`, and `CopyAssignable`.
|
||||
* \tparam PointPropertyMap is a model of `ReadablePropertyMap` with `Id` as
|
||||
* `key_type`. It must be default constructible.
|
||||
* `key_type`. It must be a model of `CopyConstructible`, `DefaultConstructible`, and `CopyAssignable`.
|
||||
* \tparam ExternalPropertyMaps either `CGAL::Tag_true` or `CGAL::Tag_false`. In the former
|
||||
* case, the property maps will be stored in the traits class, while
|
||||
* in the latter they will be stored in the primitive
|
||||
@@ -126,6 +126,15 @@ struct AABB_primitive
|
||||
AABB_primitive(Id id,
|
||||
ObjectPropertyMap o_pmap=ObjectPropertyMap(),
|
||||
PointPropertyMap p_pmap=PointPropertyMap());
|
||||
|
||||
/*!
|
||||
Constructs a primitive from an iterator with `Id` as value type
|
||||
and initializes the property maps.
|
||||
*/
|
||||
template <class Iterator>
|
||||
AABB_primitive(Iterator it,
|
||||
ObjectPropertyMap o_pmap=ObjectPropertyMap(),
|
||||
PointPropertyMap p_pmap=PointPropertyMap());
|
||||
};
|
||||
#else
|
||||
template < class Id,
|
||||
@@ -150,6 +159,10 @@ public:
|
||||
AABB_primitive(Id id, ObjectPropertyMap obj_pmap=ObjectPropertyMap(), PointPropertyMap pt_pmap=PointPropertyMap())
|
||||
: Base(id), m_obj_pmap(obj_pmap), m_pt_pmap(pt_pmap) {}
|
||||
|
||||
template <class Iterator>
|
||||
AABB_primitive(Iterator it, ObjectPropertyMap obj_pmap=ObjectPropertyMap(), PointPropertyMap pt_pmap=PointPropertyMap())
|
||||
: Base(*it), m_obj_pmap(obj_pmap), m_pt_pmap(pt_pmap) {}
|
||||
|
||||
typename Base::Datum_reference
|
||||
datum() const { return get(m_obj_pmap,this->m_id); }
|
||||
|
||||
@@ -173,6 +186,10 @@ public:
|
||||
AABB_primitive(Id id, ObjectPropertyMap obj_pmap=ObjectPropertyMap(), PointPropertyMap pt_pmap=PointPropertyMap())
|
||||
: Base(id), m_datum( get(obj_pmap,id) ), m_pt_pmap(pt_pmap){}
|
||||
|
||||
template <class Iterator>
|
||||
AABB_primitive(Iterator it, ObjectPropertyMap obj_pmap=ObjectPropertyMap(), PointPropertyMap pt_pmap=PointPropertyMap())
|
||||
: Base(*it), m_datum( get(obj_pmap,*it) ), m_pt_pmap(pt_pmap){}
|
||||
|
||||
|
||||
Datum_reference datum() const { return m_datum; }
|
||||
|
||||
@@ -194,6 +211,10 @@ public:
|
||||
AABB_primitive(Id id, ObjectPropertyMap=ObjectPropertyMap(), PointPropertyMap=PointPropertyMap())
|
||||
: Base(id) {}
|
||||
|
||||
template <class Iterator>
|
||||
AABB_primitive(Iterator it, ObjectPropertyMap=ObjectPropertyMap(), PointPropertyMap=PointPropertyMap())
|
||||
: Base(*it) {}
|
||||
|
||||
typename Base::Datum_reference
|
||||
datum(const Shared_data& data) const { return get(data.first,this->m_id); }
|
||||
|
||||
@@ -220,6 +241,10 @@ public:
|
||||
AABB_primitive(Id id, ObjectPropertyMap obj_pmap=ObjectPropertyMap(), PointPropertyMap=PointPropertyMap())
|
||||
: Base(id), m_datum( get(obj_pmap,id) ) {}
|
||||
|
||||
template <class Iterator>
|
||||
AABB_primitive(Iterator it, ObjectPropertyMap obj_pmap=ObjectPropertyMap(), PointPropertyMap=PointPropertyMap())
|
||||
: Base(*it), m_datum( get(obj_pmap,*it) ) {}
|
||||
|
||||
Datum_reference datum(Shared_data) const { return m_datum; }
|
||||
|
||||
typename Base::Point_reference
|
||||
|
||||
@@ -249,7 +249,7 @@ public:
|
||||
/// \bug This is not documented for now in the AABBTraits concept.
|
||||
typedef typename GeomTraits::Iso_cuboid_3 Iso_cuboid_3;
|
||||
|
||||
///
|
||||
/// Bounding box type.
|
||||
typedef typename CGAL::Bbox_3 Bounding_box;
|
||||
|
||||
/// @}
|
||||
@@ -291,7 +291,8 @@ public:
|
||||
*/
|
||||
class Sort_primitives
|
||||
{
|
||||
const AABB_traits<GeomTraits,AABBPrimitive,BboxMap>& m_traits;
|
||||
typedef AABB_traits<GeomTraits,AABBPrimitive,BboxMap> Traits;
|
||||
const Traits& m_traits;
|
||||
public:
|
||||
Sort_primitives(const AABB_traits<GeomTraits,AABBPrimitive,BboxMap>& traits)
|
||||
: m_traits(traits) {}
|
||||
@@ -302,16 +303,16 @@ public:
|
||||
const typename AT::Bounding_box& bbox) const
|
||||
{
|
||||
PrimitiveIterator middle = first + (beyond - first)/2;
|
||||
switch(longest_axis(bbox))
|
||||
switch(Traits::longest_axis(bbox))
|
||||
{
|
||||
case AT::CGAL_AXIS_X: // sort along x
|
||||
std::nth_element(first, middle, beyond, boost::bind(less_x,_1,_2,m_traits));
|
||||
std::nth_element(first, middle, beyond, boost::bind(Traits::less_x,_1,_2,m_traits));
|
||||
break;
|
||||
case AT::CGAL_AXIS_Y: // sort along y
|
||||
std::nth_element(first, middle, beyond, boost::bind(less_y,_1,_2,m_traits));
|
||||
std::nth_element(first, middle, beyond, boost::bind(Traits::less_y,_1,_2,m_traits));
|
||||
break;
|
||||
case AT::CGAL_AXIS_Z: // sort along z
|
||||
std::nth_element(first, middle, beyond, boost::bind(less_z,_1,_2,m_traits));
|
||||
std::nth_element(first, middle, beyond, boost::bind(Traits::less_z,_1,_2,m_traits));
|
||||
break;
|
||||
default:
|
||||
CGAL_error();
|
||||
|
||||
@@ -91,7 +91,7 @@ namespace CGAL {
|
||||
typedef typename Primitives::size_type size_type;
|
||||
/// Type of bounding box.
|
||||
typedef typename AABBTraits::Bounding_box Bounding_box;
|
||||
///
|
||||
/// 3D Point and Primitive Id type
|
||||
typedef typename AABBTraits::Point_and_primitive_id Point_and_primitive_id;
|
||||
/// \deprecated
|
||||
typedef typename AABBTraits::Object_and_primitive_id Object_and_primitive_id;
|
||||
@@ -230,6 +230,7 @@ namespace CGAL {
|
||||
clear_nodes();
|
||||
m_primitives.clear();
|
||||
clear_search_tree();
|
||||
m_default_search_tree_constructed = false;
|
||||
}
|
||||
|
||||
/// Returns the axis-aligned bounding box of the whole tree.
|
||||
@@ -321,9 +322,9 @@ namespace CGAL {
|
||||
}
|
||||
#endif
|
||||
|
||||
bool build_kd_tree() const;
|
||||
template<typename ConstPointIterator>
|
||||
bool accelerate_distance_queries_impl(ConstPointIterator first,
|
||||
ConstPointIterator beyond) const;
|
||||
bool build_kd_tree(ConstPointIterator first, ConstPointIterator beyond) const;
|
||||
public:
|
||||
|
||||
/// \name Intersection Tests
|
||||
@@ -412,12 +413,14 @@ public:
|
||||
boost::optional< typename Intersection_and_primitive_id<Ray>::Type >
|
||||
first_intersection(const Ray& query, const SkipFunctor& skip) const;
|
||||
|
||||
/// \cond
|
||||
template<typename Ray>
|
||||
boost::optional< typename Intersection_and_primitive_id<Ray>::Type >
|
||||
first_intersection(const Ray& query) const
|
||||
{
|
||||
return first_intersection(query, boost::lambda::constant(false));
|
||||
}
|
||||
/// \endcond
|
||||
|
||||
/// Returns the primitive id closest to the source point of the ray
|
||||
/// query.
|
||||
@@ -435,12 +438,14 @@ public:
|
||||
boost::optional<Primitive_id>
|
||||
first_intersected_primitive(const Ray& query, const SkipFunctor& skip) const;
|
||||
|
||||
/// \cond
|
||||
template<typename Ray>
|
||||
boost::optional<Primitive_id>
|
||||
first_intersected_primitive(const Ray& query) const
|
||||
{
|
||||
return first_intersected_primitive(query, boost::lambda::constant(false));
|
||||
}
|
||||
/// \endcond
|
||||
///@}
|
||||
|
||||
/// \name Distance Queries
|
||||
@@ -539,21 +544,20 @@ public:
|
||||
|
||||
/// Constructs an internal KD-tree containing the specified point
|
||||
/// set, to be used as the set of potential hints for accelerating
|
||||
/// the distance queries.
|
||||
/// \tparam ConstPointIterator is an iterator with
|
||||
/// the distance queries.
|
||||
/// \tparam ConstPointIterator is an iterator with
|
||||
/// value type `Point_and_primitive_id`.
|
||||
template<typename ConstPointIterator>
|
||||
bool accelerate_distance_queries(ConstPointIterator first,
|
||||
ConstPointIterator beyond) const
|
||||
{
|
||||
#ifdef CGAL_HAS_THREADS
|
||||
//this ensures that this is done once at a time
|
||||
CGAL_SCOPED_LOCK(kd_tree_mutex);
|
||||
#endif
|
||||
clear_search_tree();
|
||||
return accelerate_distance_queries_impl(first,beyond);
|
||||
|
||||
}
|
||||
bool accelerate_distance_queries(ConstPointIterator first, ConstPointIterator beyond) const
|
||||
{
|
||||
#ifdef CGAL_HAS_THREADS
|
||||
//this ensures that this is done once at a time
|
||||
CGAL_SCOPED_LOCK(kd_tree_mutex);
|
||||
#endif
|
||||
clear_search_tree();
|
||||
m_default_search_tree_constructed = false; // not a default kd-tree
|
||||
return build_kd_tree(first,beyond);
|
||||
}
|
||||
|
||||
/// Returns the minimum squared distance between the query point
|
||||
/// and all input primitives. The internal KD-tree is not used.
|
||||
@@ -597,7 +601,6 @@ public:
|
||||
delete m_p_search_tree;
|
||||
m_p_search_tree = NULL;
|
||||
m_search_tree_constructed = false;
|
||||
m_default_search_tree_constructed = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -637,7 +640,9 @@ public:
|
||||
Point_and_primitive_id best_hint(const Point& query) const
|
||||
{
|
||||
if(m_search_tree_constructed)
|
||||
{
|
||||
return m_p_search_tree->closest_point(query);
|
||||
}
|
||||
else
|
||||
return this->any_reference_point_and_id();
|
||||
}
|
||||
@@ -675,7 +680,7 @@ public:
|
||||
// search KD-tree
|
||||
mutable const Search_tree* m_p_search_tree;
|
||||
mutable bool m_search_tree_constructed;
|
||||
mutable bool m_default_search_tree_constructed;
|
||||
mutable bool m_default_search_tree_constructed; // indicates whether the internal kd-tree should be built
|
||||
bool m_need_build;
|
||||
|
||||
private:
|
||||
@@ -1060,24 +1065,44 @@ public:
|
||||
m_primitives.size(), m_traits);
|
||||
}
|
||||
|
||||
// In case the users has switched on the accelerated distance query
|
||||
// data structure with the default arguments, then it has to be
|
||||
// rebuilt.
|
||||
if(m_default_search_tree_constructed)
|
||||
accelerate_distance_queries();
|
||||
|
||||
m_need_build = false;
|
||||
// In case the users has switched on the accelerated distance query
|
||||
// data structure with the default arguments, then it has to be
|
||||
// /built/rebuilt.
|
||||
if(m_default_search_tree_constructed)
|
||||
build_kd_tree();
|
||||
m_need_build = false;
|
||||
}
|
||||
// constructs the search KD tree from given points
|
||||
// to accelerate the distance queries
|
||||
template<typename Tr>
|
||||
bool AABB_tree<Tr>::build_kd_tree() const
|
||||
{
|
||||
// iterate over primitives to get reference points on them
|
||||
std::vector<Point_and_primitive_id> points;
|
||||
points.reserve(m_primitives.size());
|
||||
typename Primitives::const_iterator it;
|
||||
for(it = m_primitives.begin(); it != m_primitives.end(); ++it)
|
||||
points.push_back( Point_and_primitive_id(
|
||||
internal::Primitive_helper<AABB_traits>::get_reference_point(
|
||||
*it,m_traits), it->id() ) );
|
||||
|
||||
// clears current KD tree
|
||||
clear_search_tree();
|
||||
bool res = build_kd_tree(points.begin(), points.end());
|
||||
m_default_search_tree_constructed = true;
|
||||
return res;
|
||||
}
|
||||
|
||||
// constructs the search KD tree from given points
|
||||
// to accelerate the distance queries
|
||||
template<typename Tr>
|
||||
template<typename ConstPointIterator>
|
||||
bool AABB_tree<Tr>::accelerate_distance_queries_impl(ConstPointIterator first,
|
||||
bool AABB_tree<Tr>::build_kd_tree(ConstPointIterator first,
|
||||
ConstPointIterator beyond) const
|
||||
{
|
||||
m_p_search_tree = new Search_tree(first, beyond);
|
||||
m_default_search_tree_constructed = true;
|
||||
if(m_p_search_tree != NULL)
|
||||
{
|
||||
m_search_tree_constructed = true;
|
||||
@@ -1095,30 +1120,29 @@ public:
|
||||
bool AABB_tree<Tr>::accelerate_distance_queries() const
|
||||
{
|
||||
if(m_primitives.empty()) return true;
|
||||
#ifdef CGAL_HAS_THREADS
|
||||
//this ensures that this function will be done once
|
||||
CGAL_SCOPED_LOCK(kd_tree_mutex);
|
||||
#endif
|
||||
if (m_default_search_tree_constructed)
|
||||
{
|
||||
if (!m_need_build) return m_search_tree_constructed;
|
||||
return true; // default return type, no tree built
|
||||
}
|
||||
|
||||
//we only redo computation only if needed
|
||||
if (!m_need_build && m_default_search_tree_constructed)
|
||||
return m_search_tree_constructed;
|
||||
|
||||
// iterate over primitives to get reference points on them
|
||||
std::vector<Point_and_primitive_id> points;
|
||||
points.reserve(m_primitives.size());
|
||||
typename Primitives::const_iterator it;
|
||||
for(it = m_primitives.begin(); it != m_primitives.end(); ++it)
|
||||
points.push_back(
|
||||
Point_and_primitive_id(
|
||||
internal::Primitive_helper<AABB_traits>::get_reference_point(*it,m_traits), it->id()
|
||||
)
|
||||
);
|
||||
|
||||
// clears current KD tree
|
||||
clear_search_tree();
|
||||
m_default_search_tree_constructed = true;
|
||||
return accelerate_distance_queries_impl(points.begin(), points.end());
|
||||
if(!m_need_build) // the tree was already built, build the kd-tree
|
||||
{
|
||||
#ifdef CGAL_HAS_THREADS
|
||||
//this ensures that this function will be done once
|
||||
CGAL_SCOPED_LOCK(kd_tree_mutex);
|
||||
#endif
|
||||
if (!m_need_build)
|
||||
{
|
||||
// clears current KD tree
|
||||
clear_search_tree();
|
||||
bool res = build_kd_tree();
|
||||
m_default_search_tree_constructed = true;
|
||||
return res;
|
||||
};
|
||||
}
|
||||
m_default_search_tree_constructed = true;
|
||||
return m_search_tree_constructed;
|
||||
}
|
||||
|
||||
template<typename Tr>
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
#include <CGAL/AABB_face_graph_triangle_primitive.h>
|
||||
#include <CGAL/AABB_halfedge_graph_segment_primitive.h>
|
||||
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
|
||||
#include <CGAL/Polyhedron_3.h>
|
||||
|
||||
#include <CGAL/disable_warnings.h>
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
#include <CGAL/AABB_traits.h>
|
||||
|
||||
#include <CGAL/AABB_face_graph_triangle_primitive.h>
|
||||
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
|
||||
#include <CGAL/Polyhedron_3.h>
|
||||
|
||||
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
#include <CGAL/Simple_cartesian.h>
|
||||
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
||||
|
||||
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
|
||||
#include <CGAL/Polyhedron_3.h>
|
||||
|
||||
#include <CGAL/AABB_tree.h>
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
|
||||
#include <CGAL/AABB_tree.h>
|
||||
#include <CGAL/AABB_traits.h>
|
||||
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
|
||||
#include <CGAL/Polyhedron_3.h>
|
||||
|
||||
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
|
||||
#include <CGAL/AABB_tree.h>
|
||||
#include <CGAL/AABB_traits.h>
|
||||
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
|
||||
#include <CGAL/Polyhedron_3.h>
|
||||
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
|
||||
#include <CGAL/AABB_tree.h>
|
||||
#include <CGAL/AABB_traits.h>
|
||||
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
|
||||
#include <CGAL/Polyhedron_3.h>
|
||||
|
||||
#include "AABB_test_util.h"
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
#include <CGAL/Simple_cartesian.h>
|
||||
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
||||
|
||||
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
|
||||
#include <CGAL/Polyhedron_3.h>
|
||||
|
||||
#include <CGAL/AABB_tree.h>
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
#include <CGAL/Simple_cartesian.h>
|
||||
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
||||
|
||||
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
|
||||
#include <CGAL/Polyhedron_3.h>
|
||||
|
||||
#include <CGAL/AABB_tree.h>
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
#include <CGAL/Simple_cartesian.h>
|
||||
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
||||
|
||||
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
|
||||
#include <CGAL/Polyhedron_3.h>
|
||||
|
||||
#include <CGAL/AABB_tree.h>
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
#include <CGAL/Simple_cartesian.h>
|
||||
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
||||
|
||||
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
|
||||
#include <CGAL/Polyhedron_3.h>
|
||||
|
||||
#include <CGAL/AABB_tree.h>
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
|
||||
#include <CGAL/AABB_tree.h>
|
||||
#include <CGAL/AABB_traits.h>
|
||||
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
|
||||
#include <CGAL/Polyhedron_3.h>
|
||||
#include <CGAL/AABB_face_graph_triangle_primitive.h>
|
||||
#include <CGAL/Timer.h>
|
||||
|
||||
+3
-3
@@ -2313,7 +2313,7 @@ namespace CGAL {
|
||||
}
|
||||
|
||||
|
||||
struct Remove : public CGAL::unary_function<Vertex_handle, bool>
|
||||
struct Remove : public CGAL::cpp98::unary_function<Vertex_handle, bool>
|
||||
{
|
||||
|
||||
Extract& E;
|
||||
@@ -2451,7 +2451,7 @@ namespace CGAL {
|
||||
namespace AFSR {
|
||||
|
||||
template <typename T>
|
||||
struct Auto_count : public CGAL::unary_function<const T&,std::pair<T,std::size_t> >{
|
||||
struct Auto_count : public CGAL::cpp98::unary_function<const T&,std::pair<T,std::size_t> >{
|
||||
mutable std::size_t i;
|
||||
|
||||
Auto_count()
|
||||
@@ -2464,7 +2464,7 @@ namespace CGAL {
|
||||
};
|
||||
|
||||
template <typename T, typename CC>
|
||||
struct Auto_count_cc : public CGAL::unary_function<const T&,std::pair<T,std::size_t> >{
|
||||
struct Auto_count_cc : public CGAL::cpp98::unary_function<const T&,std::pair<T,std::size_t> >{
|
||||
mutable std::size_t i;
|
||||
CC cc;
|
||||
|
||||
|
||||
+3
-4
@@ -23,8 +23,7 @@
|
||||
|
||||
#include <CGAL/license/Advancing_front_surface_reconstruction.h>
|
||||
|
||||
|
||||
#include <CGAL/Triangulation_cell_base_3.h>
|
||||
#include <CGAL/Delaunay_triangulation_cell_base_3.h>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
@@ -36,9 +35,9 @@ namespace CGAL {
|
||||
|
||||
\tparam Traits has to be a model of `DelaunayTriangulationTraits_3`.
|
||||
|
||||
\tparam Cb has to be a model of `TriangulationCellBase_3`.
|
||||
\tparam Cb has to be a model of `DelaunayTriangulationCellBase_3`.
|
||||
*/
|
||||
template < typename Traits, typename Cb = Triangulation_cell_base_3<Traits> >
|
||||
template < typename Traits, typename Cb = Delaunay_triangulation_cell_base_3<Traits> >
|
||||
class Advancing_front_surface_reconstruction_cell_base_3 : public Cb
|
||||
{
|
||||
|
||||
|
||||
-1
@@ -29,5 +29,4 @@ Spatial_sorting
|
||||
Stream_support
|
||||
TDS_2
|
||||
TDS_3
|
||||
Triangulation_2
|
||||
Triangulation_3
|
||||
|
||||
@@ -47,7 +47,7 @@ public:
|
||||
//! computes the factor which normalizes a number to be integral after
|
||||
// multiplication
|
||||
class Normalization_factor
|
||||
: public CGAL::unary_function<Type,Type> {
|
||||
: public CGAL::cpp98::unary_function<Type,Type> {
|
||||
private:
|
||||
static Type
|
||||
normalization_factor(const Type&,Integral_domain_without_division_tag){
|
||||
@@ -68,7 +68,7 @@ public:
|
||||
};
|
||||
|
||||
class Denominator_for_algebraic_integers
|
||||
: public CGAL::unary_function<Type,Type> {
|
||||
: public CGAL::cpp98::unary_function<Type,Type> {
|
||||
public:
|
||||
//! determine normalization factor
|
||||
Type operator () (const Type&) {
|
||||
|
||||
@@ -112,7 +112,7 @@ class Algebraic_structure_traits_base< Type_, Null_tag > {
|
||||
|
||||
// does nothing by default
|
||||
class Simplify
|
||||
: public CGAL::unary_function< Type&, void > {
|
||||
: public CGAL::cpp98::unary_function< Type&, void > {
|
||||
public:
|
||||
void operator()( Type& ) const {}
|
||||
};
|
||||
@@ -151,7 +151,7 @@ class Algebraic_structure_traits_base< Type_,
|
||||
|
||||
// returns Type(1) by default
|
||||
class Unit_part
|
||||
: public CGAL::unary_function< Type, Type > {
|
||||
: public CGAL::cpp98::unary_function< Type, Type > {
|
||||
public:
|
||||
Type operator()( const Type& x ) const {
|
||||
return( x < Type(0)) ?
|
||||
@@ -160,7 +160,7 @@ class Algebraic_structure_traits_base< Type_,
|
||||
};
|
||||
|
||||
class Square
|
||||
: public CGAL::unary_function< Type, Type > {
|
||||
: public CGAL::cpp98::unary_function< Type, Type > {
|
||||
public:
|
||||
Type operator()( const Type& x ) const {
|
||||
return x*x;
|
||||
@@ -168,7 +168,7 @@ class Algebraic_structure_traits_base< Type_,
|
||||
};
|
||||
|
||||
class Is_zero
|
||||
: public CGAL::unary_function< Type, bool > {
|
||||
: public CGAL::cpp98::unary_function< Type, bool > {
|
||||
public:
|
||||
bool operator()( const Type& x ) const {
|
||||
return x == Type(0);
|
||||
@@ -176,7 +176,7 @@ class Algebraic_structure_traits_base< Type_,
|
||||
};
|
||||
|
||||
class Is_one
|
||||
: public CGAL::unary_function< Type, bool > {
|
||||
: public CGAL::cpp98::unary_function< Type, bool > {
|
||||
public:
|
||||
bool operator()( const Type& x ) const {
|
||||
return x == Type(1);
|
||||
@@ -221,7 +221,7 @@ class Algebraic_structure_traits_base< Type_,
|
||||
// Default implementation of Divides functor for unique factorization domains
|
||||
// x divides y if gcd(y,x) equals x up to inverses
|
||||
class Divides
|
||||
: public CGAL::binary_function<Type,Type,bool>{
|
||||
: public CGAL::cpp98::binary_function<Type,Type,bool>{
|
||||
public:
|
||||
bool operator()( const Type& x, const Type& y) const {
|
||||
typedef CGAL::Algebraic_structure_traits<Type> AST;
|
||||
@@ -257,7 +257,7 @@ class Algebraic_structure_traits_base< Type_,
|
||||
|
||||
// maps to \c Div by default.
|
||||
class Integral_division
|
||||
: public CGAL::binary_function< Type, Type,
|
||||
: public CGAL::cpp98::binary_function< Type, Type,
|
||||
Type > {
|
||||
public:
|
||||
Type operator()(
|
||||
@@ -279,7 +279,7 @@ class Algebraic_structure_traits_base< Type_,
|
||||
|
||||
// Algorithm from NiX/euclids_algorithm.h
|
||||
class Gcd
|
||||
: public CGAL::binary_function< Type, Type,
|
||||
: public CGAL::cpp98::binary_function< Type, Type,
|
||||
Type > {
|
||||
public:
|
||||
Type operator()(
|
||||
@@ -372,7 +372,7 @@ class Algebraic_structure_traits_base< Type_,
|
||||
|
||||
// based on \c Div_mod.
|
||||
class Div
|
||||
: public CGAL::binary_function< Type, Type,
|
||||
: public CGAL::cpp98::binary_function< Type, Type,
|
||||
Type > {
|
||||
public:
|
||||
Type operator()( const Type& x,
|
||||
@@ -390,7 +390,7 @@ class Algebraic_structure_traits_base< Type_,
|
||||
|
||||
// based on \c Div_mod.
|
||||
class Mod
|
||||
: public CGAL::binary_function< Type, Type,
|
||||
: public CGAL::cpp98::binary_function< Type, Type,
|
||||
Type > {
|
||||
public:
|
||||
Type operator()( const Type& x,
|
||||
@@ -408,7 +408,7 @@ class Algebraic_structure_traits_base< Type_,
|
||||
|
||||
// Divides for Euclidean Ring
|
||||
class Divides
|
||||
: public CGAL::binary_function<Type, Type, bool>{
|
||||
: public CGAL::cpp98::binary_function<Type, Type, bool>{
|
||||
public:
|
||||
bool operator()( const Type& x, const Type& y) const {
|
||||
typedef Algebraic_structure_traits<Type> AST;
|
||||
@@ -448,7 +448,7 @@ class Algebraic_structure_traits_base< Type_, Field_tag >
|
||||
|
||||
// returns the argument \a a by default
|
||||
class Unit_part
|
||||
: public CGAL::unary_function< Type, Type > {
|
||||
: public CGAL::cpp98::unary_function< Type, Type > {
|
||||
public:
|
||||
Type operator()( const Type& x ) const {
|
||||
return( x == Type(0)) ? Type(1) : x;
|
||||
@@ -456,7 +456,7 @@ class Algebraic_structure_traits_base< Type_, Field_tag >
|
||||
};
|
||||
// maps to \c operator/ by default.
|
||||
class Integral_division
|
||||
: public CGAL::binary_function< Type, Type,
|
||||
: public CGAL::cpp98::binary_function< Type, Type,
|
||||
Type > {
|
||||
public:
|
||||
Type operator()( const Type& x,
|
||||
@@ -475,7 +475,7 @@ class Algebraic_structure_traits_base< Type_, Field_tag >
|
||||
|
||||
// maps to \c 1/x by default.
|
||||
class Inverse
|
||||
: public CGAL::unary_function< Type, Type > {
|
||||
: public CGAL::cpp98::unary_function< Type, Type > {
|
||||
public:
|
||||
Type operator()( const Type& x ) const {
|
||||
return Type(1)/x;
|
||||
@@ -487,7 +487,7 @@ class Algebraic_structure_traits_base< Type_, Field_tag >
|
||||
// returns always true
|
||||
// \pre: x != 0
|
||||
class Divides
|
||||
: public CGAL::binary_function< Type, Type, bool > {
|
||||
: public CGAL::cpp98::binary_function< Type, Type, bool > {
|
||||
public:
|
||||
bool operator()( const Type& CGAL_precondition_code(x), const Type& /* y */) const {
|
||||
CGAL_precondition_code( typedef Algebraic_structure_traits<Type> AST);
|
||||
@@ -523,7 +523,7 @@ class Algebraic_structure_traits_base< Type_,
|
||||
typedef Field_with_sqrt_tag Algebraic_category;
|
||||
|
||||
struct Is_square
|
||||
:public CGAL::binary_function<Type,Type&,bool>
|
||||
:public CGAL::cpp98::binary_function<Type,Type&,bool>
|
||||
{
|
||||
bool operator()(const Type& ) const {return true;}
|
||||
bool operator()(
|
||||
@@ -580,7 +580,7 @@ class Algebraic_structure_traits_base< Type_,
|
||||
namespace INTERN_AST {
|
||||
template< class Type >
|
||||
class Div_per_operator
|
||||
: public CGAL::binary_function< Type, Type,
|
||||
: public CGAL::cpp98::binary_function< Type, Type,
|
||||
Type > {
|
||||
public:
|
||||
Type operator()( const Type& x,
|
||||
@@ -593,7 +593,7 @@ namespace INTERN_AST {
|
||||
|
||||
template< class Type >
|
||||
class Mod_per_operator
|
||||
: public CGAL::binary_function< Type, Type,
|
||||
: public CGAL::cpp98::binary_function< Type, Type,
|
||||
Type > {
|
||||
public:
|
||||
Type operator()( const Type& x,
|
||||
@@ -606,7 +606,7 @@ namespace INTERN_AST {
|
||||
|
||||
template< class Type >
|
||||
class Is_square_per_sqrt
|
||||
: public CGAL::binary_function< Type, Type&,
|
||||
: public CGAL::cpp98::binary_function< Type, Type&,
|
||||
bool > {
|
||||
public:
|
||||
bool operator()( const Type& x,
|
||||
|
||||
@@ -37,7 +37,7 @@ struct Is_zero_selector{ typedef AST_is_zero Type; };
|
||||
template< class T >
|
||||
struct Is_zero_selector< T, Null_functor >
|
||||
{
|
||||
struct Type : public CGAL::unary_function< T, bool >{
|
||||
struct Type : public CGAL::cpp98::unary_function< T, bool >{
|
||||
bool operator()( const T& x ) const {
|
||||
return x == T(0);
|
||||
}
|
||||
@@ -81,7 +81,7 @@ public:
|
||||
Is_zero;
|
||||
|
||||
//! The generic \c Is_finite functor returns true
|
||||
class Is_finite : public CGAL::unary_function< Type, Boolean > {
|
||||
class Is_finite : public CGAL::cpp98::unary_function< Type, Boolean > {
|
||||
public:
|
||||
Boolean operator()( const Type& ) const {
|
||||
return true;
|
||||
@@ -91,7 +91,7 @@ public:
|
||||
//! The generic \c Abs functor implementation
|
||||
//! uses one comparisons and the unary minus if necessary.
|
||||
class Abs
|
||||
: public CGAL::unary_function< Type, Type > {
|
||||
: public CGAL::cpp98::unary_function< Type, Type > {
|
||||
public:
|
||||
//! the function call.
|
||||
Type operator()( const Type& x ) const {
|
||||
@@ -101,7 +101,7 @@ public:
|
||||
|
||||
//! The generic \c Sgn functor implementation uses two comparisons.
|
||||
class Sgn
|
||||
: public CGAL::unary_function< Type, ::CGAL::Sign > {
|
||||
: public CGAL::cpp98::unary_function< Type, ::CGAL::Sign > {
|
||||
public:
|
||||
//! the function call.
|
||||
::CGAL::Sign operator()( const Type& x ) const {
|
||||
@@ -115,7 +115,7 @@ public:
|
||||
|
||||
//! The generic \c Is_positive functor implementation uses one comparison.
|
||||
class Is_positive
|
||||
: public CGAL::unary_function< Type, Boolean > {
|
||||
: public CGAL::cpp98::unary_function< Type, Boolean > {
|
||||
public:
|
||||
//! the function call.
|
||||
Boolean operator()( const Type& x ) const {
|
||||
@@ -125,7 +125,7 @@ public:
|
||||
|
||||
//! The generic \c Is_negative functor implementation uses one comparison.
|
||||
class Is_negative
|
||||
: public CGAL::unary_function< Type, Boolean > {
|
||||
: public CGAL::cpp98::unary_function< Type, Boolean > {
|
||||
public:
|
||||
//! the function call.
|
||||
Boolean operator()( const Type& x ) const {
|
||||
@@ -135,7 +135,7 @@ public:
|
||||
|
||||
//! The generic \c Compare functor implementation uses two comparisons.
|
||||
class Compare
|
||||
: public CGAL::binary_function< Type, Type,
|
||||
: public CGAL::cpp98::binary_function< Type, Type,
|
||||
Comparison_result > {
|
||||
public:
|
||||
//! the function call.
|
||||
@@ -152,7 +152,7 @@ public:
|
||||
Comparison_result )
|
||||
};
|
||||
|
||||
class To_double : public CGAL::unary_function< Type, double > {
|
||||
class To_double : public CGAL::cpp98::unary_function< Type, double > {
|
||||
public:
|
||||
double operator()( const Type& x ) const {
|
||||
return static_cast<double>(x);
|
||||
@@ -160,7 +160,7 @@ public:
|
||||
};
|
||||
|
||||
class To_interval
|
||||
: public CGAL::unary_function< Type, std::pair<double,double> > {
|
||||
: public CGAL::cpp98::unary_function< Type, std::pair<double,double> > {
|
||||
public:
|
||||
std::pair<double,double> operator()( const Type& x ) const {
|
||||
double dx(static_cast<double>(x));
|
||||
|
||||
@@ -922,18 +922,20 @@ void test_algebraic_structure(){
|
||||
w[0]= AS (10);
|
||||
w[1]= AS (-8);
|
||||
w[2]= AS (-2);
|
||||
std::pair<int,int> equal_pair(0,0);
|
||||
// functor
|
||||
// find_only_equal_pair is not yet implemented
|
||||
// equal_pair = find_only_equal_pair(v.begin(),v.end(),
|
||||
|
||||
// functor
|
||||
// find_only_equal_pair is not yet implemented
|
||||
// std::pair<int,int> equal_pair(0,0);
|
||||
//
|
||||
// equal_pair = find_only_equal_pair(v.begin(),v.end(),
|
||||
// w.begin(),w.end());
|
||||
// assert(1 == equal_pair.first);
|
||||
// assert(2 == equal_pair.second);
|
||||
// assert(1 == equal_pair.first);
|
||||
// assert(2 == equal_pair.second);
|
||||
//function
|
||||
// equal_pair = NiX::find_only_equal_pair(v.begin(),v.end(),
|
||||
// equal_pair = NiX::find_only_equal_pair(v.begin(),v.end(),
|
||||
// w.begin(),w.end());
|
||||
// assert(1 == equal_pair.first);
|
||||
// assert(2 == equal_pair.second);
|
||||
// assert(1 == equal_pair.first);
|
||||
// assert(2 == equal_pair.second);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ struct Is_zero :
|
||||
namespace internal {
|
||||
template <class NT, class Compare> struct Compare_base: public Compare {};
|
||||
template <class NT> struct Compare_base<NT,Null_functor>
|
||||
:public CGAL::binary_function< NT, NT, Comparison_result > {
|
||||
:public CGAL::cpp98::binary_function< NT, NT, Comparison_result > {
|
||||
Comparison_result operator()( const NT& x, const NT& y) const
|
||||
{
|
||||
if (x < y) return SMALLER;
|
||||
|
||||
@@ -194,7 +194,7 @@ protected:
|
||||
|
||||
//! polynomial canonicalizer, needed for the cache
|
||||
template <class Poly>
|
||||
struct Poly_canonicalizer : public CGAL::unary_function< Poly, Poly >
|
||||
struct Poly_canonicalizer : public CGAL::cpp98::unary_function< Poly, Poly >
|
||||
{
|
||||
// use Polynomial_traits_d<>::Canonicalize ?
|
||||
Poly operator()(Poly p)
|
||||
@@ -224,14 +224,20 @@ protected:
|
||||
|
||||
//! orders pair items by ids
|
||||
struct Pair_id_order {
|
||||
|
||||
#ifdef CGAL_ALGEBRAIC_KERNEL_DONT_SWAP
|
||||
template<class T1, class T2>
|
||||
const std::pair<T1, T2>& operator()(const std::pair<T1, T2>& p) const {
|
||||
return p;
|
||||
}
|
||||
#else
|
||||
template<class T1, class T2>
|
||||
std::pair<T1, T2> operator()(const std::pair<T1, T2>& p) const {
|
||||
|
||||
if(p.first.id() > p.second.id())
|
||||
return std::make_pair(p.second, p.first);
|
||||
return p;
|
||||
if(p.first.id() > p.second.id())
|
||||
return std::make_pair(p.second, p.first);
|
||||
return p;
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
class Curve_creator {
|
||||
@@ -350,7 +356,7 @@ public:
|
||||
// Composition of two unary functors
|
||||
template<typename InnerFunctor,typename OuterFunctor>
|
||||
class Unary_compose
|
||||
: public CGAL::unary_function<typename InnerFunctor::argument_type,
|
||||
: public CGAL::cpp98::unary_function<typename InnerFunctor::argument_type,
|
||||
typename OuterFunctor::result_type> {
|
||||
|
||||
public:
|
||||
@@ -413,7 +419,7 @@ public:
|
||||
* when appropriate
|
||||
*/
|
||||
class Construct_curve_2 :
|
||||
public CGAL::unary_function< Polynomial_2, Curve_analysis_2 > {
|
||||
public CGAL::cpp98::unary_function< Polynomial_2, Curve_analysis_2 > {
|
||||
|
||||
public:
|
||||
|
||||
@@ -437,7 +443,7 @@ public:
|
||||
* caching is used when appropriate
|
||||
*/
|
||||
class Construct_curve_pair_2 :
|
||||
public CGAL::binary_function<Curve_analysis_2, Curve_analysis_2,
|
||||
public CGAL::cpp98::binary_function<Curve_analysis_2, Curve_analysis_2,
|
||||
Curve_pair_analysis_2> {
|
||||
|
||||
public:
|
||||
@@ -630,7 +636,7 @@ public:
|
||||
|
||||
|
||||
class Compute_polynomial_x_2 :
|
||||
public CGAL::unary_function<Algebraic_real_2, Polynomial_1> {
|
||||
public CGAL::cpp98::unary_function<Algebraic_real_2, Polynomial_1> {
|
||||
|
||||
public:
|
||||
|
||||
@@ -650,7 +656,7 @@ public:
|
||||
compute_polynomial_x_2_object);
|
||||
|
||||
class Compute_polynomial_y_2 :
|
||||
public CGAL::unary_function<Algebraic_real_2, Polynomial_1> {
|
||||
public CGAL::cpp98::unary_function<Algebraic_real_2, Polynomial_1> {
|
||||
|
||||
public:
|
||||
|
||||
@@ -670,7 +676,7 @@ public:
|
||||
compute_polynomial_y_2_object);
|
||||
|
||||
|
||||
class Isolate_x_2 : public CGAL::binary_function<Algebraic_real_2,
|
||||
class Isolate_x_2 : public CGAL::cpp98::binary_function<Algebraic_real_2,
|
||||
Polynomial_1,
|
||||
std::pair<Bound,Bound> > {
|
||||
|
||||
@@ -693,7 +699,7 @@ public:
|
||||
CGAL_Algebraic_Kernel_cons(Isolate_x_2,
|
||||
isolate_x_2_object);
|
||||
|
||||
class Isolate_y_2 : public CGAL::binary_function<Algebraic_real_2,
|
||||
class Isolate_y_2 : public CGAL::cpp98::binary_function<Algebraic_real_2,
|
||||
Polynomial_1,
|
||||
std::pair<Bound,Bound> > {
|
||||
|
||||
@@ -881,7 +887,7 @@ public:
|
||||
|
||||
//! returns the x-coordinate of an \c Algebraic_real_2 object
|
||||
class Compute_x_2 :
|
||||
public CGAL::unary_function<Algebraic_real_2, Algebraic_real_1> {
|
||||
public CGAL::cpp98::unary_function<Algebraic_real_2, Algebraic_real_1> {
|
||||
|
||||
public:
|
||||
|
||||
@@ -916,7 +922,7 @@ public:
|
||||
* return approximation of the y-coordinate.
|
||||
*/
|
||||
class Compute_y_2 :
|
||||
public CGAL::unary_function<Algebraic_real_2, Algebraic_real_1> {
|
||||
public CGAL::cpp98::unary_function<Algebraic_real_2, Algebraic_real_1> {
|
||||
|
||||
public:
|
||||
|
||||
@@ -939,7 +945,7 @@ public:
|
||||
#endif
|
||||
|
||||
class Approximate_absolute_x_2
|
||||
: public CGAL::binary_function<Algebraic_real_2,int,std::pair<Bound,Bound> >{
|
||||
: public CGAL::cpp98::binary_function<Algebraic_real_2,int,std::pair<Bound,Bound> >{
|
||||
|
||||
public:
|
||||
|
||||
@@ -962,7 +968,7 @@ public:
|
||||
approximate_absolute_x_2_object);
|
||||
|
||||
class Approximate_relative_x_2
|
||||
: public CGAL::binary_function<Algebraic_real_2,int,std::pair<Bound,Bound> >{
|
||||
: public CGAL::cpp98::binary_function<Algebraic_real_2,int,std::pair<Bound,Bound> >{
|
||||
|
||||
public:
|
||||
|
||||
@@ -984,7 +990,7 @@ public:
|
||||
approximate_relative_x_2_object);
|
||||
|
||||
class Approximate_absolute_y_2
|
||||
: public CGAL::binary_function<Algebraic_real_2,int,std::pair<Bound,Bound> >{
|
||||
: public CGAL::cpp98::binary_function<Algebraic_real_2,int,std::pair<Bound,Bound> >{
|
||||
|
||||
public:
|
||||
|
||||
@@ -1014,7 +1020,7 @@ public:
|
||||
approximate_absolute_y_2_object);
|
||||
|
||||
class Approximate_relative_y_2
|
||||
: public CGAL::binary_function<Algebraic_real_2,int,std::pair<Bound,Bound> >{
|
||||
: public CGAL::cpp98::binary_function<Algebraic_real_2,int,std::pair<Bound,Bound> >{
|
||||
|
||||
public:
|
||||
|
||||
@@ -1165,7 +1171,7 @@ public:
|
||||
|
||||
//! \brief comparison of x-coordinates
|
||||
class Compare_x_2 :
|
||||
public CGAL::binary_function<Algebraic_real_2, Algebraic_real_2,
|
||||
public CGAL::cpp98::binary_function<Algebraic_real_2, Algebraic_real_2,
|
||||
Comparison_result > {
|
||||
|
||||
public:
|
||||
@@ -1258,7 +1264,7 @@ public:
|
||||
* If possible, it is recommended to avoid this functor for efficiency.}
|
||||
*/
|
||||
class Compare_y_2 :
|
||||
public CGAL::binary_function< Algebraic_real_2, Algebraic_real_2,
|
||||
public CGAL::cpp98::binary_function< Algebraic_real_2, Algebraic_real_2,
|
||||
Comparison_result > {
|
||||
|
||||
public:
|
||||
@@ -1370,7 +1376,7 @@ public:
|
||||
* to have equal x-coordinates, thus only the y-coordinates are compared.
|
||||
*/
|
||||
class Compare_xy_2 :
|
||||
public CGAL::binary_function<Algebraic_real_2, Algebraic_real_2,
|
||||
public CGAL::cpp98::binary_function<Algebraic_real_2, Algebraic_real_2,
|
||||
Comparison_result > {
|
||||
|
||||
public:
|
||||
@@ -1501,7 +1507,7 @@ public:
|
||||
* the polynomial \c p is square free.
|
||||
*/
|
||||
class Has_finite_number_of_self_intersections_2 :
|
||||
public CGAL::unary_function< Polynomial_2, bool > {
|
||||
public CGAL::cpp98::unary_function< Polynomial_2, bool > {
|
||||
|
||||
public:
|
||||
|
||||
@@ -1530,7 +1536,7 @@ public:
|
||||
* the two polynomials \c f and \c g are coprime.
|
||||
*/
|
||||
class Has_finite_number_of_intersections_2 :
|
||||
public CGAL::binary_function< Polynomial_2, Polynomial_2, bool > {
|
||||
public CGAL::cpp98::binary_function< Polynomial_2, Polynomial_2, bool > {
|
||||
|
||||
public:
|
||||
|
||||
@@ -1714,7 +1720,7 @@ public:
|
||||
//! Non-Algebraic name
|
||||
typedef Algebraic_real_2 Coordinate_2;
|
||||
|
||||
class Is_square_free_2 : public CGAL::unary_function<Polynomial_2,bool> {
|
||||
class Is_square_free_2 : public CGAL::cpp98::unary_function<Polynomial_2,bool> {
|
||||
|
||||
public:
|
||||
|
||||
@@ -1736,7 +1742,7 @@ public:
|
||||
typedef Has_finite_number_of_intersections_2 Is_coprime_2;
|
||||
CGAL_Algebraic_Kernel_cons(Is_coprime_2, is_coprime_2_object);
|
||||
|
||||
class Make_square_free_2 : public CGAL::unary_function<Polynomial_2,
|
||||
class Make_square_free_2 : public CGAL::cpp98::unary_function<Polynomial_2,
|
||||
Polynomial_2> {
|
||||
|
||||
public:
|
||||
@@ -1801,9 +1807,9 @@ public:
|
||||
* In pariticular, each singular point is x-critical.
|
||||
*/
|
||||
class X_critical_points_2 :
|
||||
public CGAL::binary_function< Curve_analysis_2,
|
||||
CGAL::iterator<std::output_iterator_tag, Algebraic_real_2>,
|
||||
CGAL::iterator<std::output_iterator_tag, Algebraic_real_2> > {
|
||||
public CGAL::cpp98::binary_function< Curve_analysis_2,
|
||||
CGAL::cpp98::iterator<std::output_iterator_tag, Algebraic_real_2>,
|
||||
CGAL::cpp98::iterator<std::output_iterator_tag, Algebraic_real_2> > {
|
||||
|
||||
public:
|
||||
|
||||
@@ -1880,9 +1886,9 @@ public:
|
||||
* In pariticular, each singular point is y-critical.
|
||||
*/
|
||||
class Y_critical_points_2 :
|
||||
public CGAL::binary_function< Curve_analysis_2,
|
||||
CGAL::iterator<std::output_iterator_tag, Algebraic_real_2>,
|
||||
CGAL::iterator<std::output_iterator_tag, Algebraic_real_2> > {
|
||||
public CGAL::cpp98::binary_function< Curve_analysis_2,
|
||||
CGAL::cpp98::iterator<std::output_iterator_tag, Algebraic_real_2>,
|
||||
CGAL::cpp98::iterator<std::output_iterator_tag, Algebraic_real_2> > {
|
||||
|
||||
|
||||
public:
|
||||
@@ -1975,7 +1981,7 @@ public:
|
||||
// Overload the Sign_at_1 functor, to enable filter steps in the
|
||||
// Curve analysis in a coherent way
|
||||
class Sign_at_1
|
||||
: public::CGAL::binary_function<Polynomial_1,Algebraic_real_1,Sign> {
|
||||
: public::CGAL::cpp98::binary_function<Polynomial_1,Algebraic_real_1,Sign> {
|
||||
|
||||
|
||||
public:
|
||||
@@ -2052,7 +2058,7 @@ public:
|
||||
* curve. Returns a value convertible to \c CGAL::Sign
|
||||
*/
|
||||
class Sign_at_2 :
|
||||
public CGAL::binary_function<Polynomial_2, Algebraic_real_2, Sign > {
|
||||
public CGAL::cpp98::binary_function<Polynomial_2, Algebraic_real_2, Sign > {
|
||||
|
||||
public:
|
||||
|
||||
@@ -2148,7 +2154,7 @@ public:
|
||||
CGAL_Algebraic_Kernel_pred(Sign_at_2, sign_at_2_object);
|
||||
|
||||
class Is_zero_at_2
|
||||
: public CGAL::binary_function<Polynomial_2,Algebraic_real_2,bool> {
|
||||
: public CGAL::cpp98::binary_function<Polynomial_2,Algebraic_real_2,bool> {
|
||||
|
||||
public:
|
||||
|
||||
@@ -2492,7 +2498,7 @@ public:
|
||||
CGAL_Algebraic_Kernel_cons(Solve_2, solve_2_object);
|
||||
|
||||
class Number_of_solutions_2
|
||||
: public CGAL::binary_function<Polynomial_2,Polynomial_2,size_type> {
|
||||
: public CGAL::cpp98::binary_function<Polynomial_2,Polynomial_2,size_type> {
|
||||
|
||||
public:
|
||||
|
||||
@@ -2518,7 +2524,7 @@ public:
|
||||
// Functor used to evaluate a Polynomial_2 in a Bound, up to a
|
||||
// constant factor
|
||||
class Evaluate_utcf_2
|
||||
: public CGAL::binary_function<Polynomial_2,Bound,Polynomial_1> {
|
||||
: public CGAL::cpp98::binary_function<Polynomial_2,Bound,Polynomial_1> {
|
||||
|
||||
public:
|
||||
|
||||
@@ -2594,7 +2600,7 @@ public:
|
||||
|
||||
//! Refines the x-coordinate of an Algebraic_real_2 object
|
||||
class Refine_x_2 :
|
||||
public CGAL::unary_function<Algebraic_real_2, void> {
|
||||
public CGAL::cpp98::unary_function<Algebraic_real_2, void> {
|
||||
|
||||
public:
|
||||
|
||||
@@ -2618,7 +2624,7 @@ public:
|
||||
CGAL_Algebraic_Kernel_pred(Refine_x_2, refine_x_2_object);
|
||||
|
||||
class Refine_y_2 :
|
||||
public CGAL::unary_function<Algebraic_real_2, void> {
|
||||
public CGAL::cpp98::unary_function<Algebraic_real_2, void> {
|
||||
|
||||
public:
|
||||
|
||||
|
||||
@@ -385,7 +385,7 @@ public:
|
||||
typedef internal::Algebraic_real_d_1< Coefficient, Rational, HandlePolicy, RepClass > Type;
|
||||
|
||||
class Compare
|
||||
: public CGAL::binary_function< Type, Type, CGAL::Comparison_result > {
|
||||
: public CGAL::cpp98::binary_function< Type, Type, CGAL::Comparison_result > {
|
||||
public:
|
||||
CGAL::Comparison_result operator()( const Type& a, const Type& b ) const
|
||||
{ return a.compare( b ); }
|
||||
@@ -414,7 +414,7 @@ public:
|
||||
};
|
||||
|
||||
class Sgn
|
||||
: public CGAL::unary_function< Type, CGAL::Sign > {
|
||||
: public CGAL::cpp98::unary_function< Type, CGAL::Sign > {
|
||||
public:
|
||||
CGAL::Sign operator()( const Type& a ) const {
|
||||
return a.compare( Rational(0) );
|
||||
@@ -422,7 +422,7 @@ public:
|
||||
};
|
||||
|
||||
class To_double
|
||||
: public CGAL::unary_function< Type, double > {
|
||||
: public CGAL::cpp98::unary_function< Type, double > {
|
||||
public:
|
||||
double operator()(const Type& a) const {
|
||||
return a.to_double();
|
||||
@@ -430,7 +430,7 @@ public:
|
||||
};
|
||||
|
||||
class To_interval
|
||||
: public CGAL::unary_function< Type, std::pair<double, double> > {
|
||||
: public CGAL::cpp98::unary_function< Type, std::pair<double, double> > {
|
||||
public:
|
||||
typename std::pair<double, double> operator()(const Type& a) const {
|
||||
return a.to_interval();
|
||||
|
||||
@@ -50,7 +50,7 @@ template <typename Coefficient_> struct Bitstream_coefficient_kernel {
|
||||
return Is_zero();
|
||||
}
|
||||
|
||||
struct Convert_to_bfi : public CGAL::unary_function
|
||||
struct Convert_to_bfi : public CGAL::cpp98::unary_function
|
||||
<Coefficient,Bigfloat_interval> {
|
||||
|
||||
Bigfloat_interval operator() (Coefficient c) const {
|
||||
|
||||
+2
-2
@@ -120,7 +120,7 @@ public:
|
||||
//! \name Functors
|
||||
//! @{
|
||||
|
||||
struct Is_zero : public CGAL::unary_function<Coefficient,bool> {
|
||||
struct Is_zero : public CGAL::cpp98::unary_function<Coefficient,bool> {
|
||||
|
||||
Is_zero(Algebraic_kernel_d_1* kernel,Algebraic_real_1 alpha)
|
||||
: _m_kernel(kernel),_m_alpha(alpha) {}
|
||||
@@ -140,7 +140,7 @@ public:
|
||||
}
|
||||
|
||||
struct Convert_to_bfi
|
||||
: public CGAL::unary_function<Coefficient,Bigfloat_interval> {
|
||||
: public CGAL::cpp98::unary_function<Coefficient,Bigfloat_interval> {
|
||||
|
||||
Convert_to_bfi(Algebraic_kernel_d_1* kernel,
|
||||
Algebraic_real_1 alpha)
|
||||
|
||||
@@ -108,7 +108,7 @@ template<typename Comparable>
|
||||
};
|
||||
|
||||
template<typename Comparable> struct Compare_for_vert_line_map
|
||||
: public CGAL::binary_function<Comparable,Comparable,bool> {
|
||||
: public CGAL::cpp98::binary_function<Comparable,Comparable,bool> {
|
||||
|
||||
BOOST_MPL_HAS_XXX_TRAIT_DEF(T)
|
||||
BOOST_MPL_HAS_XXX_TRAIT_DEF(Handle_policy)
|
||||
|
||||
@@ -66,7 +66,7 @@ template<>
|
||||
class Float_traits< leda_bigfloat > {
|
||||
public:
|
||||
struct Get_mantissa
|
||||
: public CGAL::unary_function< leda_bigfloat, leda_integer > {
|
||||
: public CGAL::cpp98::unary_function< leda_bigfloat, leda_integer > {
|
||||
leda_integer operator()( const leda_bigfloat& x ) const {
|
||||
//std::cout << x.get_significant() << std::endl;
|
||||
return x.get_significant();
|
||||
@@ -74,14 +74,14 @@ public:
|
||||
};
|
||||
|
||||
struct Get_exponent
|
||||
: public CGAL::unary_function< leda_bigfloat, long > {
|
||||
: public CGAL::cpp98::unary_function< leda_bigfloat, long > {
|
||||
long operator()( const leda_bigfloat& x ) const {
|
||||
return x.get_exponent().to_long();
|
||||
}
|
||||
};
|
||||
|
||||
struct Mul_by_pow_of_2
|
||||
: public CGAL::binary_function< leda_bigfloat, long, leda_bigfloat> {
|
||||
: public CGAL::cpp98::binary_function< leda_bigfloat, long, leda_bigfloat> {
|
||||
leda_bigfloat operator()( const leda_bigfloat& a, long e ) const {
|
||||
return leda_bigfloat(a.get_significant(), a.get_exponent()+e);
|
||||
}
|
||||
@@ -98,21 +98,21 @@ class Float_traits< CORE::BigFloat > {
|
||||
public:
|
||||
|
||||
struct Get_mantissa
|
||||
: public CGAL::unary_function< CORE::BigFloat, CORE::BigInt > {
|
||||
: public CGAL::cpp98::unary_function< CORE::BigFloat, CORE::BigInt > {
|
||||
CORE::BigInt operator()( const CORE::BigFloat& x ) const {
|
||||
return x.m();
|
||||
}
|
||||
};
|
||||
|
||||
struct Get_exponent
|
||||
: public CGAL::unary_function< CORE::BigFloat, long > {
|
||||
: public CGAL::cpp98::unary_function< CORE::BigFloat, long > {
|
||||
long operator()( const CORE::BigFloat& x ) const {
|
||||
return CORE::CHUNK_BIT*x.exp(); // The basis is 2^CORE::CHUNK_BIT
|
||||
}
|
||||
};
|
||||
|
||||
struct Mul_by_pow_of_2
|
||||
: public CGAL::binary_function
|
||||
: public CGAL::cpp98::binary_function
|
||||
< CORE::BigFloat, long , CORE::BigFloat> {
|
||||
CORE::BigFloat operator()( const CORE::BigFloat& a, long e ) const {
|
||||
return a*CORE::BigFloat::exp2(e);
|
||||
@@ -127,7 +127,7 @@ public:
|
||||
template<> class Float_traits< Gmpfr > {
|
||||
|
||||
struct Get_mantissa_exponent
|
||||
: public CGAL::unary_function< Gmpfr, std::pair<Gmpz,long> > {
|
||||
: public CGAL::cpp98::unary_function< Gmpfr, std::pair<Gmpz,long> > {
|
||||
|
||||
std::pair<Gmpz,long> operator()( const Gmpfr& x ) const {
|
||||
return x.to_integer_exp();
|
||||
@@ -135,21 +135,21 @@ template<> class Float_traits< Gmpfr > {
|
||||
};
|
||||
public:
|
||||
struct Get_mantissa
|
||||
: public CGAL::unary_function< Gmpfr, Gmpz > {
|
||||
: public CGAL::cpp98::unary_function< Gmpfr, Gmpz > {
|
||||
Gmpz operator()( const Gmpfr& x ) const {
|
||||
return Get_mantissa_exponent()(x).first;
|
||||
}
|
||||
};
|
||||
|
||||
struct Get_exponent
|
||||
: public CGAL::unary_function< Gmpfr, long > {
|
||||
: public CGAL::cpp98::unary_function< Gmpfr, long > {
|
||||
long operator()( const Gmpfr& x ) const {
|
||||
return Get_mantissa_exponent()(x).second;
|
||||
}
|
||||
};
|
||||
|
||||
struct Mul_by_pow_of_2
|
||||
: public CGAL::binary_function< Gmpfr, Gmpz, Gmpfr> {
|
||||
: public CGAL::cpp98::binary_function< Gmpfr, Gmpz, Gmpfr> {
|
||||
Gmpfr operator()( const Gmpfr& a, long e ) const {
|
||||
Gmpfr result(0,a.get_precision()); // just to get the prec of a
|
||||
if (e >= 0 ){
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace CGAL {
|
||||
namespace internal {
|
||||
|
||||
template<typename Polynomial_1, typename Bound>
|
||||
struct Interval_evaluate_1 : public CGAL::binary_function
|
||||
struct Interval_evaluate_1 : public CGAL::cpp98::binary_function
|
||||
<Polynomial_1,std::pair<Bound,Bound>,
|
||||
std::pair<typename CGAL::Coercion_traits<typename
|
||||
CGAL::Polynomial_traits_d<Polynomial_1>::Coefficient_type,Bound>::Type,
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace CGAL {
|
||||
namespace internal {
|
||||
|
||||
template<typename Polynomial_2, typename Bound>
|
||||
struct Interval_evaluate_2 : public CGAL::binary_function
|
||||
struct Interval_evaluate_2 : public CGAL::cpp98::binary_function
|
||||
<Polynomial_2,CGAL::cpp11::array<Bound,4>,
|
||||
std::pair<typename CGAL::Coercion_traits<typename CGAL::Polynomial_traits_d<Polynomial_2>::Innermost_coefficient_type,Bound>::Type,
|
||||
typename CGAL::Coercion_traits<typename CGAL::Polynomial_traits_d<Polynomial_2>::Innermost_coefficient_type,Bound>::Type> > {
|
||||
|
||||
@@ -103,7 +103,7 @@ template<>
|
||||
class Real_embeddable_extension< long > {
|
||||
public:
|
||||
struct Ceil_log2_abs
|
||||
: public CGAL::unary_function< long, long > {
|
||||
: public CGAL::cpp98::unary_function< long, long > {
|
||||
long operator()( long x ) {
|
||||
if (x < 0) x = -x;
|
||||
CGAL_precondition(x > 0);
|
||||
@@ -113,7 +113,7 @@ public:
|
||||
};
|
||||
|
||||
struct Floor_log2_abs
|
||||
: public CGAL::unary_function< long, long > {
|
||||
: public CGAL::cpp98::unary_function< long, long > {
|
||||
private:
|
||||
signed char floor_log2_4bit[16];
|
||||
public:
|
||||
@@ -149,11 +149,11 @@ public:
|
||||
};
|
||||
|
||||
struct Floor
|
||||
: public CGAL::unary_function< long, long > {
|
||||
: public CGAL::cpp98::unary_function< long, long > {
|
||||
long operator() (long x) { return x;}
|
||||
};
|
||||
struct Ceil
|
||||
: public CGAL::unary_function< long, long > {
|
||||
: public CGAL::cpp98::unary_function< long, long > {
|
||||
long operator() (long x) { return x;}
|
||||
};
|
||||
};
|
||||
@@ -168,7 +168,7 @@ public:
|
||||
typedef leda_integer Type;
|
||||
|
||||
struct Ceil_log2_abs
|
||||
: public CGAL::unary_function< leda_integer, long > {
|
||||
: public CGAL::cpp98::unary_function< leda_integer, long > {
|
||||
long operator()( const leda_integer& x ) const {
|
||||
CGAL_precondition(x != leda_integer(0));
|
||||
::leda::digit_sz ldgzeros = ::leda::digLeadingZeros(x.highword());
|
||||
@@ -188,7 +188,7 @@ public:
|
||||
};
|
||||
|
||||
struct Floor_log2_abs
|
||||
: public CGAL::unary_function< leda_integer, long > {
|
||||
: public CGAL::cpp98::unary_function< leda_integer, long > {
|
||||
long operator()( const leda_integer& x ) const {
|
||||
CGAL_precondition(x != leda_integer(0));
|
||||
::leda::digit_sz ldgzeros
|
||||
@@ -200,11 +200,11 @@ public:
|
||||
};
|
||||
|
||||
struct Floor
|
||||
: public CGAL::unary_function< leda_integer, leda_integer > {
|
||||
: public CGAL::cpp98::unary_function< leda_integer, leda_integer > {
|
||||
leda_integer operator() (const leda_integer& x) const { return x;}
|
||||
};
|
||||
struct Ceil
|
||||
: public CGAL::unary_function< leda_integer, leda_integer > {
|
||||
: public CGAL::cpp98::unary_function< leda_integer, leda_integer > {
|
||||
leda_integer operator() (const leda_integer& x) const { return x;}
|
||||
};
|
||||
};
|
||||
@@ -216,7 +216,7 @@ public:
|
||||
typedef leda_bigfloat Type;
|
||||
|
||||
struct Floor_log2_abs
|
||||
: public CGAL::unary_function< leda_bigfloat, long > {
|
||||
: public CGAL::cpp98::unary_function< leda_bigfloat, long > {
|
||||
long operator()( const leda_bigfloat& x ) const {
|
||||
CGAL_precondition(CGAL::sign(x) != CGAL::ZERO);
|
||||
::leda::integer abs_sign = abs(x.get_significant());
|
||||
@@ -226,7 +226,7 @@ public:
|
||||
};
|
||||
|
||||
struct Ceil_log2_abs
|
||||
: public CGAL::unary_function< leda_bigfloat, long > {
|
||||
: public CGAL::cpp98::unary_function< leda_bigfloat, long > {
|
||||
long operator()( const leda_bigfloat& x ) const {
|
||||
CGAL_precondition(CGAL::sign(x) != CGAL::ZERO);
|
||||
return ::leda::ilog2(x).to_long();
|
||||
@@ -234,14 +234,14 @@ public:
|
||||
};
|
||||
|
||||
struct Floor
|
||||
: public CGAL::unary_function< leda_bigfloat, leda_integer > {
|
||||
: public CGAL::cpp98::unary_function< leda_bigfloat, leda_integer > {
|
||||
leda_integer operator() ( const leda_bigfloat& x ) const {
|
||||
return leda::to_integer( x, leda::TO_N_INF );
|
||||
}
|
||||
};
|
||||
|
||||
struct Ceil
|
||||
: public CGAL::unary_function< leda_bigfloat, leda_integer > {
|
||||
: public CGAL::cpp98::unary_function< leda_bigfloat, leda_integer > {
|
||||
leda_integer operator() ( const leda_bigfloat& x ) const {
|
||||
return leda::to_integer( x, leda::TO_P_INF );
|
||||
}
|
||||
@@ -255,7 +255,7 @@ public:
|
||||
typedef leda_bigfloat_interval Type;
|
||||
|
||||
struct Floor_log2_abs
|
||||
: public CGAL::unary_function< leda_bigfloat_interval, long > {
|
||||
: public CGAL::cpp98::unary_function< leda_bigfloat_interval, long > {
|
||||
|
||||
result_type operator() (const argument_type& x) const {
|
||||
CGAL_precondition(! ::boost::numeric::in_zero(x));
|
||||
@@ -264,7 +264,7 @@ public:
|
||||
};
|
||||
|
||||
struct Ceil_log2_abs
|
||||
: public CGAL::unary_function< leda_bigfloat_interval, long > {
|
||||
: public CGAL::cpp98::unary_function< leda_bigfloat_interval, long > {
|
||||
long operator()( const leda_bigfloat_interval& x ) const {
|
||||
CGAL_precondition(!(::boost::numeric::in_zero(x) &&
|
||||
::boost::numeric::singleton(x)));
|
||||
@@ -273,7 +273,7 @@ public:
|
||||
};
|
||||
|
||||
struct Floor
|
||||
: public CGAL::unary_function< leda_bigfloat_interval, leda_integer > {
|
||||
: public CGAL::cpp98::unary_function< leda_bigfloat_interval, leda_integer > {
|
||||
leda_integer operator() ( const leda_bigfloat_interval& x )
|
||||
const {
|
||||
return internal::floor( x.lower() );
|
||||
@@ -281,7 +281,7 @@ public:
|
||||
};
|
||||
|
||||
struct Ceil
|
||||
: public CGAL::unary_function< leda_bigfloat_interval, leda_integer > {
|
||||
: public CGAL::cpp98::unary_function< leda_bigfloat_interval, leda_integer > {
|
||||
leda_integer operator() ( const leda_bigfloat_interval& x )
|
||||
const {
|
||||
return internal::ceil( x.upper() );
|
||||
@@ -299,27 +299,27 @@ class Real_embeddable_extension< CORE::BigInt > {
|
||||
public:
|
||||
typedef CORE::BigInt Type;
|
||||
struct Floor_log2_abs
|
||||
: public CGAL::unary_function< CORE::BigInt, long > {
|
||||
: public CGAL::cpp98::unary_function< CORE::BigInt, long > {
|
||||
long operator()( const CORE::BigInt& x ) const {
|
||||
return CORE::floorLg(x);
|
||||
}
|
||||
};
|
||||
|
||||
struct Ceil_log2_abs
|
||||
: public CGAL::unary_function< CORE::BigInt, long > {
|
||||
: public CGAL::cpp98::unary_function< CORE::BigInt, long > {
|
||||
long operator()( const CORE::BigInt& x ) const {
|
||||
return CORE::ceilLg(x);
|
||||
}
|
||||
};
|
||||
|
||||
struct Floor
|
||||
: public CGAL::unary_function< CORE::BigInt, CORE::BigInt > {
|
||||
: public CGAL::cpp98::unary_function< CORE::BigInt, CORE::BigInt > {
|
||||
CORE::BigInt operator() (const CORE::BigInt& x) const {
|
||||
return x;
|
||||
}
|
||||
};
|
||||
struct Ceil
|
||||
: public CGAL::unary_function< CORE::BigInt, CORE::BigInt > {
|
||||
: public CGAL::cpp98::unary_function< CORE::BigInt, CORE::BigInt > {
|
||||
CORE::BigInt operator() (const CORE::BigInt& x) const {
|
||||
return x;
|
||||
}
|
||||
@@ -332,7 +332,7 @@ class Real_embeddable_extension< CORE::BigFloat > {
|
||||
public:
|
||||
typedef CORE::BigFloat Type;
|
||||
struct Floor_log2_abs
|
||||
: public CGAL::unary_function< CORE::BigFloat, long > {
|
||||
: public CGAL::cpp98::unary_function< CORE::BigFloat, long > {
|
||||
long operator()( CORE::BigFloat x ) const {
|
||||
CGAL_precondition(!CGAL::zero_in(x));
|
||||
x = CGAL::abs(x);
|
||||
@@ -341,7 +341,7 @@ public:
|
||||
};
|
||||
|
||||
struct Ceil_log2_abs
|
||||
: public CGAL::unary_function< CORE::BigFloat, long > {
|
||||
: public CGAL::cpp98::unary_function< CORE::BigFloat, long > {
|
||||
long operator()( CORE::BigFloat x ) const {
|
||||
// (already commented out in EXACUS)...
|
||||
// NiX_precond(!(NiX::in_zero(x) && NiX::singleton(x)));
|
||||
@@ -351,7 +351,7 @@ public:
|
||||
};
|
||||
|
||||
struct Floor
|
||||
: public CGAL::unary_function< CORE::BigFloat, CORE::BigInt > {
|
||||
: public CGAL::cpp98::unary_function< CORE::BigFloat, CORE::BigInt > {
|
||||
CORE::BigInt operator() ( const CORE::BigFloat& x ) const {
|
||||
CORE::BigInt xi = x.BigIntValue();
|
||||
if(x.sign() < 0 && x.cmp(xi)!=0) {
|
||||
@@ -362,7 +362,7 @@ public:
|
||||
};
|
||||
|
||||
struct Ceil
|
||||
: public CGAL::unary_function< CORE::BigFloat, CORE::BigInt > {
|
||||
: public CGAL::cpp98::unary_function< CORE::BigFloat, CORE::BigInt > {
|
||||
CORE::BigInt operator() ( const CORE::BigFloat& x ) const {
|
||||
CORE::BigInt xi = x.BigIntValue();
|
||||
if(x.sign() >0 && x.cmp(xi)!=0) {
|
||||
@@ -385,7 +385,7 @@ public:
|
||||
typedef Gmpz Type;
|
||||
|
||||
struct Floor_log2_abs
|
||||
: public CGAL::unary_function< Gmpz, long > {
|
||||
: public CGAL::cpp98::unary_function< Gmpz, long > {
|
||||
long operator()( const Gmpz& x ) const {
|
||||
CGAL_precondition(!CGAL::is_zero(x));
|
||||
return static_cast<long>(mpz_sizeinbase(x.mpz(),2)-1);
|
||||
@@ -393,7 +393,7 @@ public:
|
||||
};
|
||||
|
||||
struct Ceil_log2_abs
|
||||
: public CGAL::unary_function< Gmpz, long > {
|
||||
: public CGAL::cpp98::unary_function< Gmpz, long > {
|
||||
long operator()( const Gmpz& x ) const {
|
||||
long pos = mpz_scan1(x.mpz(),0);
|
||||
long size = static_cast<long>(mpz_sizeinbase(x.mpz(),2));
|
||||
@@ -405,13 +405,13 @@ public:
|
||||
};
|
||||
|
||||
struct Floor
|
||||
: public CGAL::unary_function< Gmpz, Gmpz > {
|
||||
: public CGAL::cpp98::unary_function< Gmpz, Gmpz > {
|
||||
Gmpz operator() (const Gmpz& x) const {
|
||||
return x;
|
||||
}
|
||||
};
|
||||
struct Ceil
|
||||
: public CGAL::unary_function< Gmpz, Gmpz > {
|
||||
: public CGAL::cpp98::unary_function< Gmpz, Gmpz > {
|
||||
Gmpz operator() (const Gmpz& x) const {
|
||||
return x;
|
||||
}
|
||||
@@ -427,7 +427,7 @@ public:
|
||||
typedef Gmpfr Type;
|
||||
|
||||
struct Floor_log2_abs
|
||||
: public CGAL::unary_function< Gmpfr, long > {
|
||||
: public CGAL::cpp98::unary_function< Gmpfr, long > {
|
||||
long operator()( const Gmpfr& x ) const {
|
||||
Float_traits<Gmpfr>::Get_mantissa get_mantissa;
|
||||
Float_traits<Gmpfr>::Get_exponent get_exponent;
|
||||
@@ -438,7 +438,7 @@ public:
|
||||
};
|
||||
|
||||
struct Ceil_log2_abs
|
||||
: public CGAL::unary_function< Gmpfr, long > {
|
||||
: public CGAL::cpp98::unary_function< Gmpfr, long > {
|
||||
long operator()( const Gmpfr& x ) const {
|
||||
Float_traits<Gmpfr>::Get_mantissa get_mantissa;
|
||||
Float_traits<Gmpfr>::Get_exponent get_exponent;
|
||||
@@ -449,7 +449,7 @@ public:
|
||||
};
|
||||
|
||||
struct Floor
|
||||
: public CGAL::unary_function< Gmpfr, Gmpz > {
|
||||
: public CGAL::cpp98::unary_function< Gmpfr, Gmpz > {
|
||||
Gmpz operator() ( const Gmpfr& x ) const {
|
||||
Gmpz result;
|
||||
mpfr_get_z (result.mpz(),x.fr(),GMP_RNDD);
|
||||
@@ -458,7 +458,7 @@ public:
|
||||
};
|
||||
|
||||
struct Ceil
|
||||
: public CGAL::unary_function< Gmpfr, Gmpz > {
|
||||
: public CGAL::cpp98::unary_function< Gmpfr, Gmpz > {
|
||||
Gmpz operator() ( const Gmpfr& x ) const {
|
||||
Gmpz result;
|
||||
mpfr_get_z (result.mpz(),x.fr(),GMP_RNDU);
|
||||
@@ -476,7 +476,7 @@ public:
|
||||
typedef Gmpfi Type;
|
||||
|
||||
struct Floor_log2_abs
|
||||
: public CGAL::unary_function< Gmpfi, long > {
|
||||
: public CGAL::cpp98::unary_function< Gmpfi, long > {
|
||||
result_type operator() (const argument_type& x) const {
|
||||
CGAL_precondition(!x.is_zero());
|
||||
return internal::floor_log2_abs(x.abs().inf());
|
||||
@@ -484,7 +484,7 @@ public:
|
||||
};
|
||||
|
||||
struct Ceil_log2_abs
|
||||
: public CGAL::unary_function< Gmpfi, long > {
|
||||
: public CGAL::cpp98::unary_function< Gmpfi, long > {
|
||||
long operator()( const Gmpfi& x ) const {
|
||||
CGAL_precondition(!x.inf().is_zero() || !x.sup().is_zero());
|
||||
return internal::ceil_log2_abs(x.abs().sup());
|
||||
@@ -492,7 +492,7 @@ public:
|
||||
};
|
||||
|
||||
struct Floor
|
||||
: public CGAL::unary_function< Gmpfi, Gmpz > {
|
||||
: public CGAL::cpp98::unary_function< Gmpfi, Gmpz > {
|
||||
Gmpz operator() ( const Gmpfi& x )
|
||||
const {
|
||||
return internal::floor( x.inf() );
|
||||
@@ -500,7 +500,7 @@ public:
|
||||
};
|
||||
|
||||
struct Ceil
|
||||
: public CGAL::unary_function< Gmpfi, Gmpz > {
|
||||
: public CGAL::cpp98::unary_function< Gmpfi, Gmpz > {
|
||||
Gmpz operator() ( const Gmpfi& x )
|
||||
const {
|
||||
return internal::ceil( x.sup() );
|
||||
|
||||
@@ -71,12 +71,12 @@ protected:
|
||||
|
||||
// Some functors used for STL calls
|
||||
template<typename A,typename B>
|
||||
struct Pair_first : public CGAL::unary_function<std::pair<A,B>,A> {
|
||||
struct Pair_first : public CGAL::cpp98::unary_function<std::pair<A,B>,A> {
|
||||
A operator() (std::pair<A,B> pair) const { return pair.first; }
|
||||
};
|
||||
|
||||
template<typename A,typename B>
|
||||
struct Pair_second : public CGAL::unary_function<std::pair<A,B>,B> {
|
||||
struct Pair_second : public CGAL::cpp98::unary_function<std::pair<A,B>,B> {
|
||||
B operator() (std::pair<A,B> pair) const { return pair.second; }
|
||||
};
|
||||
|
||||
@@ -86,7 +86,7 @@ public:
|
||||
typedef Algebraic_real_1 Type;
|
||||
|
||||
struct Bound_between
|
||||
: public CGAL::binary_function< Type, Type, Bound > {
|
||||
: public CGAL::cpp98::binary_function< Type, Type, Bound > {
|
||||
Bound operator()( const Type& t1,
|
||||
const Type& t2 ) const {
|
||||
#if CGAL_AK_DONT_USE_SIMPLE_BOUND_BETWEEN
|
||||
@@ -99,21 +99,21 @@ public:
|
||||
};
|
||||
|
||||
struct Lower_bound
|
||||
: public CGAL::unary_function< Type, Bound > {
|
||||
: public CGAL::cpp98::unary_function< Type, Bound > {
|
||||
Bound operator()( const Type& t ) const {
|
||||
return t.low();
|
||||
}
|
||||
};
|
||||
|
||||
struct Upper_bound
|
||||
: public CGAL::unary_function< Type, Bound > {
|
||||
: public CGAL::cpp98::unary_function< Type, Bound > {
|
||||
Bound operator()( const Type& t ) const {
|
||||
return t.high();
|
||||
}
|
||||
};
|
||||
|
||||
struct Refine
|
||||
: public CGAL::unary_function< Type, void > {
|
||||
: public CGAL::cpp98::unary_function< Type, void > {
|
||||
void operator()( const Type& t ) const {
|
||||
t.refine();
|
||||
}
|
||||
@@ -151,7 +151,7 @@ public:
|
||||
};
|
||||
|
||||
struct Approximate_absolute_1:
|
||||
public CGAL::binary_function<Algebraic_real_1,int,std::pair<Bound,Bound> >{
|
||||
public CGAL::cpp98::binary_function<Algebraic_real_1,int,std::pair<Bound,Bound> >{
|
||||
std::pair<Bound,Bound>
|
||||
operator()(const Algebraic_real_1& x, int prec) const {
|
||||
Lower_bound lower;
|
||||
@@ -170,7 +170,7 @@ public:
|
||||
};
|
||||
|
||||
struct Approximate_relative_1:
|
||||
public CGAL::binary_function<Algebraic_real_1,int,std::pair<Bound,Bound> >{
|
||||
public CGAL::cpp98::binary_function<Algebraic_real_1,int,std::pair<Bound,Bound> >{
|
||||
std::pair<Bound,Bound>
|
||||
operator()(const Algebraic_real_1& x, int prec) const {
|
||||
|
||||
@@ -201,7 +201,9 @@ public:
|
||||
|
||||
|
||||
}; // class Algebraic_real_traits
|
||||
|
||||
|
||||
struct Construct_algebraic_real_1;
|
||||
|
||||
// Functors of Algebraic_kernel_d_1
|
||||
struct Solve_1 {
|
||||
public:
|
||||
@@ -278,7 +280,7 @@ public:
|
||||
/*
|
||||
// TODO: Can we avoid to use this?
|
||||
struct Greater_compare :
|
||||
public CGAL::binary_function<Algebraic_real_1,Algebraic_real_1,bool> {
|
||||
public CGAL::cpp98::binary_function<Algebraic_real_1,Algebraic_real_1,bool> {
|
||||
|
||||
bool operator() (const Algebraic_real_1& a, const Algebraic_real_1& b)
|
||||
const {
|
||||
@@ -336,7 +338,7 @@ public:
|
||||
};
|
||||
|
||||
class Number_of_solutions_1
|
||||
: public CGAL::unary_function<Polynomial_1,size_type> {
|
||||
: public CGAL::cpp98::unary_function<Polynomial_1,size_type> {
|
||||
|
||||
public:
|
||||
|
||||
@@ -352,7 +354,7 @@ public:
|
||||
|
||||
|
||||
struct Sign_at_1
|
||||
: public CGAL::binary_function< Polynomial_1, Algebraic_real_1, CGAL::Sign > {
|
||||
: public CGAL::cpp98::binary_function< Polynomial_1, Algebraic_real_1, CGAL::Sign > {
|
||||
CGAL::Sign operator()( const Polynomial_1& p, const Algebraic_real_1& ar ) const {
|
||||
if(CGAL::is_zero(p)) return ZERO;
|
||||
if(CGAL::degree(p)==0) return p.sign_at(0);
|
||||
@@ -375,7 +377,7 @@ public:
|
||||
}
|
||||
};
|
||||
struct Is_zero_at_1
|
||||
: public CGAL::binary_function< Polynomial_1, Algebraic_real_1, bool > {
|
||||
: public CGAL::cpp98::binary_function< Polynomial_1, Algebraic_real_1, bool > {
|
||||
bool operator()( const Polynomial_1& p, const Algebraic_real_1& ar ) const {
|
||||
if(CGAL::is_zero(p)) return true;
|
||||
if( ar.low() == ar.high() ) return p.sign_at( ar.low() ) == ZERO;
|
||||
@@ -385,7 +387,7 @@ public:
|
||||
};
|
||||
|
||||
struct Is_square_free_1
|
||||
: public CGAL::unary_function< Polynomial_1, bool > {
|
||||
: public CGAL::cpp98::unary_function< Polynomial_1, bool > {
|
||||
bool operator()( const Polynomial_1& p ) const {
|
||||
typename CGAL::Polynomial_traits_d< Polynomial_1 >::Is_square_free isf;
|
||||
return isf(p);
|
||||
@@ -393,7 +395,7 @@ public:
|
||||
};
|
||||
|
||||
struct Is_coprime_1
|
||||
: public CGAL::binary_function< Polynomial_1, Polynomial_1, bool > {
|
||||
: public CGAL::cpp98::binary_function< Polynomial_1, Polynomial_1, bool > {
|
||||
bool operator()( const Polynomial_1& p1, const Polynomial_1& p2 ) const {
|
||||
typename CGAL::Polynomial_traits_d< Polynomial_1 >::Total_degree total_degree;
|
||||
|
||||
@@ -403,7 +405,7 @@ public:
|
||||
};
|
||||
|
||||
struct Make_square_free_1
|
||||
: public CGAL::unary_function< Polynomial_1, Polynomial_1 > {
|
||||
: public CGAL::cpp98::unary_function< Polynomial_1, Polynomial_1 > {
|
||||
Polynomial_1 operator()( const Polynomial_1& p ) const {
|
||||
return typename CGAL::Polynomial_traits_d< Polynomial_1 >::Make_square_free()( p );
|
||||
}
|
||||
@@ -438,7 +440,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
struct Compute_polynomial_1 : public CGAL::unary_function<Algebraic_real_1,
|
||||
struct Compute_polynomial_1 : public CGAL::cpp98::unary_function<Algebraic_real_1,
|
||||
Polynomial_1> {
|
||||
Polynomial_1 operator()(const Algebraic_real_1& x) const {
|
||||
return x.polynomial();
|
||||
@@ -488,7 +490,7 @@ public:
|
||||
};
|
||||
|
||||
struct Compare_1
|
||||
: public CGAL::binary_function<Algebraic_real_1,
|
||||
: public CGAL::cpp98::binary_function<Algebraic_real_1,
|
||||
Algebraic_real_1,
|
||||
CGAL::Comparison_result>{
|
||||
|
||||
@@ -533,7 +535,7 @@ public:
|
||||
|
||||
public:
|
||||
|
||||
struct Isolate_1 : public CGAL::binary_function
|
||||
struct Isolate_1 : public CGAL::cpp98::binary_function
|
||||
< Algebraic_real_1,Polynomial_1,std::pair<Bound,Bound> > {
|
||||
|
||||
public:
|
||||
|
||||
@@ -259,39 +259,39 @@ public INTERN_RET::Real_embeddable_traits_base<
|
||||
Base;
|
||||
typedef typename Base::Compare Compare;
|
||||
|
||||
class Sgn:public CGAL::unary_function<Type,CGAL::Sign>{
|
||||
class Sgn:public CGAL::cpp98::unary_function<Type,CGAL::Sign>{
|
||||
public:
|
||||
CGAL::Sign operator()(const Type &a)const{
|
||||
return Compare()(a,Type(0));
|
||||
}
|
||||
};
|
||||
|
||||
class To_double:public CGAL::unary_function<Type,double>{
|
||||
class To_double:public CGAL::cpp98::unary_function<Type,double>{
|
||||
public:
|
||||
double operator()(const Type &a)const{return a.to_double();}
|
||||
};
|
||||
|
||||
class To_interval:
|
||||
public CGAL::unary_function<Type,std::pair<double,double> >{
|
||||
public CGAL::cpp98::unary_function<Type,std::pair<double,double> >{
|
||||
public:
|
||||
std::pair<double,double> operator()(const Type &a)const{
|
||||
return a.to_interval();
|
||||
}
|
||||
};
|
||||
|
||||
class Is_zero:public CGAL::unary_function<Type,Boolean>{
|
||||
class Is_zero:public CGAL::cpp98::unary_function<Type,Boolean>{
|
||||
public:
|
||||
bool operator()(const Type &a)const{
|
||||
return Sgn()(a)==CGAL::ZERO;
|
||||
}
|
||||
};
|
||||
|
||||
class Is_finite:public CGAL::unary_function<Type,Boolean>{
|
||||
class Is_finite:public CGAL::cpp98::unary_function<Type,Boolean>{
|
||||
public:
|
||||
bool operator()(const Type&)const{return true;}
|
||||
};
|
||||
|
||||
class Abs:public CGAL::unary_function<Type,Type>{
|
||||
class Abs:public CGAL::cpp98::unary_function<Type,Type>{
|
||||
public:
|
||||
Type operator()(const Type &a)const{
|
||||
return Sgn()(a)==CGAL::NEGATIVE?-a:a;
|
||||
|
||||
@@ -250,39 +250,39 @@ public INTERN_RET::Real_embeddable_traits_base<
|
||||
Base;
|
||||
typedef typename Base::Compare Compare;
|
||||
|
||||
class Sgn:public CGAL::unary_function<Type,CGAL::Sign>{
|
||||
class Sgn:public CGAL::cpp98::unary_function<Type,CGAL::Sign>{
|
||||
public:
|
||||
CGAL::Sign operator()(const Type &a)const{
|
||||
return Compare()(a,Type(0));
|
||||
}
|
||||
};
|
||||
|
||||
class To_double:public CGAL::unary_function<Type,double>{
|
||||
class To_double:public CGAL::cpp98::unary_function<Type,double>{
|
||||
public:
|
||||
double operator()(const Type &a)const{return a.to_double();}
|
||||
};
|
||||
|
||||
class To_interval:
|
||||
public CGAL::unary_function<Type,std::pair<double,double> >{
|
||||
public CGAL::cpp98::unary_function<Type,std::pair<double,double> >{
|
||||
public:
|
||||
std::pair<double,double> operator()(const Type &a)const{
|
||||
return a.to_interval();
|
||||
}
|
||||
};
|
||||
|
||||
class Is_zero:public CGAL::unary_function<Type,Boolean>{
|
||||
class Is_zero:public CGAL::cpp98::unary_function<Type,Boolean>{
|
||||
public:
|
||||
bool operator()(const Type &a)const{
|
||||
return Sgn()(a)==CGAL::ZERO;
|
||||
}
|
||||
};
|
||||
|
||||
class Is_finite:public CGAL::unary_function<Type,Boolean>{
|
||||
class Is_finite:public CGAL::cpp98::unary_function<Type,Boolean>{
|
||||
public:
|
||||
bool operator()(const Type&)const{return true;}
|
||||
};
|
||||
|
||||
class Abs:public CGAL::unary_function<Type,Type>{
|
||||
class Abs:public CGAL::cpp98::unary_function<Type,Type>{
|
||||
public:
|
||||
Type operator()(const Type &a)const{
|
||||
return Sgn()(a)==CGAL::NEGATIVE?-a:a;
|
||||
|
||||
@@ -61,7 +61,7 @@ struct Construct_algebraic_real_1{
|
||||
|
||||
template <class Polynomial_,class Algebraic_>
|
||||
struct Compute_polynomial_1:
|
||||
public CGAL::unary_function<Algebraic_,Polynomial_>{
|
||||
public CGAL::cpp98::unary_function<Algebraic_,Polynomial_>{
|
||||
typedef Polynomial_ Polynomial;
|
||||
typedef Algebraic_ Algebraic;
|
||||
Polynomial operator()(const Algebraic &x)const{
|
||||
@@ -71,7 +71,7 @@ public CGAL::unary_function<Algebraic_,Polynomial_>{
|
||||
|
||||
template <class Polynomial_,class Ptraits_>
|
||||
struct Is_coprime_1:
|
||||
public CGAL::binary_function<Polynomial_,Polynomial_,bool>{
|
||||
public CGAL::cpp98::binary_function<Polynomial_,Polynomial_,bool>{
|
||||
typedef Polynomial_ Polynomial;
|
||||
typedef Ptraits_ Ptraits;
|
||||
typedef typename Ptraits::Gcd_up_to_constant_factor Gcd;
|
||||
@@ -257,7 +257,7 @@ template <class Polynomial_,
|
||||
class Signat_,
|
||||
class Ptraits_>
|
||||
class Sign_at_1:
|
||||
public CGAL::binary_function<Polynomial_,Algebraic_,CGAL::Sign>{
|
||||
public CGAL::cpp98::binary_function<Polynomial_,Algebraic_,CGAL::Sign>{
|
||||
// This implementation will work with any polynomial type whose
|
||||
// coefficient type is explicit interoperable with Gmpfi.
|
||||
// TODO: Make this function generic.
|
||||
@@ -363,7 +363,7 @@ template <class Polynomial_,
|
||||
class Signat_,
|
||||
class Ptraits_>
|
||||
class Is_zero_at_1:
|
||||
public CGAL::binary_function<Polynomial_,Algebraic_,bool>{
|
||||
public CGAL::cpp98::binary_function<Polynomial_,Algebraic_,bool>{
|
||||
// This implementation will work with any polynomial type whose
|
||||
// coefficient type is explicit interoperable with Gmpfi.
|
||||
// TODO: Make this function generic.
|
||||
@@ -443,7 +443,7 @@ public CGAL::binary_function<Polynomial_,Algebraic_,bool>{
|
||||
// programs assume that this is equal to int
|
||||
template <class Polynomial_,class Isolator_>
|
||||
struct Number_of_solutions_1:
|
||||
public CGAL::unary_function<Polynomial_,int>{
|
||||
public CGAL::cpp98::unary_function<Polynomial_,int>{
|
||||
typedef Polynomial_ Polynomial_1;
|
||||
typedef Isolator_ Isolator;
|
||||
size_t operator()(const Polynomial_1 &p)const{
|
||||
@@ -459,7 +459,7 @@ template <class Algebraic_,
|
||||
class Bound_,
|
||||
class Comparator_>
|
||||
struct Compare_1:
|
||||
public CGAL::binary_function<Algebraic_,Algebraic_,CGAL::Comparison_result>{
|
||||
public CGAL::cpp98::binary_function<Algebraic_,Algebraic_,CGAL::Comparison_result>{
|
||||
typedef Algebraic_ Algebraic;
|
||||
typedef Bound_ Bound;
|
||||
typedef Comparator_ Comparator;
|
||||
@@ -511,7 +511,7 @@ template <class Algebraic_,
|
||||
class Bound_,
|
||||
class Comparator_>
|
||||
struct Bound_between_1:
|
||||
public CGAL::binary_function<Algebraic_,Algebraic_,Bound_>{
|
||||
public CGAL::cpp98::binary_function<Algebraic_,Algebraic_,Bound_>{
|
||||
typedef Algebraic_ Algebraic;
|
||||
typedef Bound_ Bound;
|
||||
typedef Comparator_ Comparator;
|
||||
@@ -551,7 +551,7 @@ template <class Polynomial_,
|
||||
class Signat_,
|
||||
class Ptraits_>
|
||||
struct Isolate_1:
|
||||
public CGAL::binary_function<Algebraic_,Polynomial_,std::pair<Bound_,Bound_> >{
|
||||
public CGAL::cpp98::binary_function<Algebraic_,Polynomial_,std::pair<Bound_,Bound_> >{
|
||||
typedef Polynomial_ Polynomial_1;
|
||||
typedef Bound_ Bound;
|
||||
typedef Algebraic_ Algebraic;
|
||||
@@ -589,7 +589,7 @@ template <class Polynomial_,
|
||||
class Algebraic_,
|
||||
class Refiner_>
|
||||
struct Approximate_absolute_1:
|
||||
public CGAL::binary_function<Algebraic_,int,std::pair<Bound_,Bound_> >{
|
||||
public CGAL::cpp98::binary_function<Algebraic_,int,std::pair<Bound_,Bound_> >{
|
||||
typedef Polynomial_ Polynomial_1;
|
||||
typedef Bound_ Bound;
|
||||
typedef Algebraic_ Algebraic;
|
||||
@@ -621,7 +621,7 @@ template <class Polynomial_,
|
||||
class Algebraic_,
|
||||
class Refiner_>
|
||||
struct Approximate_relative_1:
|
||||
public CGAL::binary_function<Algebraic_,int,std::pair<Bound_,Bound_> >{
|
||||
public CGAL::cpp98::binary_function<Algebraic_,int,std::pair<Bound_,Bound_> >{
|
||||
typedef Polynomial_ Polynomial_1;
|
||||
typedef Bound_ Bound;
|
||||
typedef Algebraic_ Algebraic;
|
||||
|
||||
@@ -69,7 +69,7 @@ struct Construct_algebraic_real_z_1{
|
||||
|
||||
template <class Polynomial_,class Algebraic_>
|
||||
struct Compute_polynomial_z_1:
|
||||
public CGAL::unary_function<Algebraic_,Polynomial_>{
|
||||
public CGAL::cpp98::unary_function<Algebraic_,Polynomial_>{
|
||||
typedef Polynomial_ Polynomial;
|
||||
typedef Algebraic_ Algebraic;
|
||||
Polynomial operator()(const Algebraic &x)const{
|
||||
@@ -79,7 +79,7 @@ public CGAL::unary_function<Algebraic_,Polynomial_>{
|
||||
|
||||
template <class Polynomial_,class Ptraits_>
|
||||
struct Is_coprime_z_1:
|
||||
public CGAL::binary_function<Polynomial_,Polynomial_,bool>{
|
||||
public CGAL::cpp98::binary_function<Polynomial_,Polynomial_,bool>{
|
||||
typedef Polynomial_ Polynomial;
|
||||
typedef Ptraits_ Ptraits;
|
||||
typedef typename Ptraits::Gcd_up_to_constant_factor Gcd;
|
||||
@@ -285,7 +285,7 @@ template <class Polynomial_,
|
||||
class Ptraits_,
|
||||
class ZPtraits_>
|
||||
class Sign_at_z_1:
|
||||
public CGAL::binary_function<Polynomial_,Algebraic_,CGAL::Sign>{
|
||||
public CGAL::cpp98::binary_function<Polynomial_,Algebraic_,CGAL::Sign>{
|
||||
// This implementation will work with any polynomial type whose
|
||||
// coefficient type is explicit interoperable with Gmpfi.
|
||||
// TODO: Make this function generic.
|
||||
@@ -397,7 +397,7 @@ template <class Polynomial_,
|
||||
class Ptraits_,
|
||||
class ZPtraits_>
|
||||
class Is_zero_at_z_1:
|
||||
public CGAL::binary_function<Polynomial_,Algebraic_,bool>{
|
||||
public CGAL::cpp98::binary_function<Polynomial_,Algebraic_,bool>{
|
||||
// This implementation will work with any polynomial type whose
|
||||
// coefficient type is explicit interoperable with Gmpfi.
|
||||
// TODO: Make this function generic.
|
||||
@@ -483,7 +483,7 @@ template <class Polynomial_,
|
||||
class PolConverter_,
|
||||
class Isolator_>
|
||||
struct Number_of_solutions_z_1:
|
||||
public CGAL::unary_function<Polynomial_,int>{
|
||||
public CGAL::cpp98::unary_function<Polynomial_,int>{
|
||||
typedef Polynomial_ Polynomial_1;
|
||||
typedef ZPolynomial_ ZPolynomial_1;
|
||||
typedef PolConverter_ PolConverter;
|
||||
@@ -501,7 +501,7 @@ template <class Algebraic_,
|
||||
class Bound_,
|
||||
class Comparator_>
|
||||
struct Compare_z_1:
|
||||
public CGAL::binary_function<Algebraic_,Algebraic_,CGAL::Comparison_result>{
|
||||
public CGAL::cpp98::binary_function<Algebraic_,Algebraic_,CGAL::Comparison_result>{
|
||||
typedef Algebraic_ Algebraic;
|
||||
typedef Bound_ Bound;
|
||||
typedef Comparator_ Comparator;
|
||||
@@ -553,7 +553,7 @@ template <class Algebraic_,
|
||||
class Bound_,
|
||||
class Comparator_>
|
||||
struct Bound_between_z_1:
|
||||
public CGAL::binary_function<Algebraic_,Algebraic_,Bound_>{
|
||||
public CGAL::cpp98::binary_function<Algebraic_,Algebraic_,Bound_>{
|
||||
typedef Algebraic_ Algebraic;
|
||||
typedef Bound_ Bound;
|
||||
typedef Comparator_ Comparator;
|
||||
@@ -596,7 +596,7 @@ template <class Polynomial_,
|
||||
class Ptraits_,
|
||||
class ZPtraits_>
|
||||
struct Isolate_z_1:
|
||||
public CGAL::binary_function<Algebraic_,Polynomial_,std::pair<Bound_,Bound_> >{
|
||||
public CGAL::cpp98::binary_function<Algebraic_,Polynomial_,std::pair<Bound_,Bound_> >{
|
||||
typedef Polynomial_ Polynomial_1;
|
||||
typedef ZPolynomial_ ZPolynomial_1;
|
||||
typedef PolConverter_ PolConverter;
|
||||
@@ -640,7 +640,7 @@ template <class Polynomial_,
|
||||
class Algebraic_,
|
||||
class Refiner_>
|
||||
struct Approximate_absolute_z_1:
|
||||
public CGAL::binary_function<Algebraic_,int,std::pair<Bound_,Bound_> >{
|
||||
public CGAL::cpp98::binary_function<Algebraic_,int,std::pair<Bound_,Bound_> >{
|
||||
typedef Polynomial_ Polynomial_1;
|
||||
typedef Bound_ Bound;
|
||||
typedef Algebraic_ Algebraic;
|
||||
@@ -672,7 +672,7 @@ template <class Polynomial_,
|
||||
class Algebraic_,
|
||||
class Refiner_>
|
||||
struct Approximate_relative_z_1:
|
||||
public CGAL::binary_function<Algebraic_,int,std::pair<Bound_,Bound_> >{
|
||||
public CGAL::cpp98::binary_function<Algebraic_,int,std::pair<Bound_,Bound_> >{
|
||||
typedef Polynomial_ Polynomial_1;
|
||||
typedef Bound_ Bound;
|
||||
typedef Algebraic_ Algebraic;
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace RS_AK1{
|
||||
|
||||
template <class InputPolynomial_,class OutputPolynomial_>
|
||||
struct Polynomial_converter_1:
|
||||
public CGAL::unary_function<InputPolynomial_,OutputPolynomial_>{
|
||||
public CGAL::cpp98::unary_function<InputPolynomial_,OutputPolynomial_>{
|
||||
typedef InputPolynomial_ InpPolynomial_1;
|
||||
typedef OutputPolynomial_ OutPolynomial_1;
|
||||
OutPolynomial_1 operator()(const InpPolynomial_1&)const;
|
||||
|
||||
@@ -25,6 +25,9 @@
|
||||
|
||||
#include <sstream>
|
||||
|
||||
// In the testsuite we do not want that pairs of Curve_analysis_2 are ordered
|
||||
#define CGAL_ALGEBRAIC_KERNEL_DONT_SWAP 1
|
||||
|
||||
#if CGAL_ACK_USE_EXACUS
|
||||
#include <AcX/Algebraic_curve_2.h>
|
||||
#include <AcX/Algebraic_curve_pair_2.h>
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include <CGAL/GMP_arithmetic_kernel.h>
|
||||
#include <CGAL/LEDA_arithmetic_kernel.h>
|
||||
#include <CGAL/CORE_arithmetic_kernel.h>
|
||||
|
||||
#include <CGAL/use.h>
|
||||
//#include <CGAL/Sqrt_extension.h> // used in this file
|
||||
|
||||
|
||||
@@ -54,6 +54,8 @@ void test_real_embeddable_extension(const NT_&){
|
||||
const Floor floor = Floor();
|
||||
typedef typename Floor::argument_type Argument_type;
|
||||
typedef typename Floor::result_type Result_type;
|
||||
CGAL_USE_TYPE(Argument_type);
|
||||
CGAL_USE_TYPE(Result_type);
|
||||
CGAL_static_assertion(( ::boost::is_same<NT, Argument_type>::value));
|
||||
CGAL_static_assertion(( ::boost::is_same<Integer, Result_type>::value));
|
||||
assert(Integer(42) == floor(NT(42)));
|
||||
@@ -64,6 +66,8 @@ void test_real_embeddable_extension(const NT_&){
|
||||
const Floor_log2_abs floor_log2_abs = Floor_log2_abs();
|
||||
typedef typename Floor_log2_abs::argument_type Argument_type;
|
||||
typedef typename Floor_log2_abs::result_type Result_type;
|
||||
CGAL_USE_TYPE(Argument_type);
|
||||
CGAL_USE_TYPE(Result_type);
|
||||
CGAL_static_assertion(( ::boost::is_same<NT, Argument_type>::value));
|
||||
CGAL_static_assertion(( ::boost::is_same<long, Result_type>::value));
|
||||
|
||||
@@ -89,6 +93,8 @@ void test_real_embeddable_extension(const NT_&){
|
||||
const Ceil ceil = Ceil();
|
||||
typedef typename Ceil::argument_type Argument_type;
|
||||
typedef typename Ceil::result_type Result_type;
|
||||
CGAL_USE_TYPE(Argument_type);
|
||||
CGAL_USE_TYPE(Result_type);
|
||||
CGAL_static_assertion(( ::boost::is_same<NT, Argument_type>::value));
|
||||
CGAL_static_assertion(( ::boost::is_same<Integer, Result_type>::value));
|
||||
assert(Integer(42) == ceil(NT(42)));
|
||||
@@ -99,6 +105,8 @@ void test_real_embeddable_extension(const NT_&){
|
||||
const Ceil_log2_abs ceil_log2_abs = Ceil_log2_abs();
|
||||
typedef typename Ceil_log2_abs::argument_type Argument_type;
|
||||
typedef typename Ceil_log2_abs::result_type Result_type;
|
||||
CGAL_USE_TYPE(Argument_type);
|
||||
CGAL_USE_TYPE(Result_type);
|
||||
CGAL_static_assertion(( ::boost::is_same<NT, Argument_type>::value));
|
||||
CGAL_static_assertion(( ::boost::is_same<long, Result_type>::value));
|
||||
|
||||
|
||||
@@ -101,6 +101,8 @@ void test_algebraic_kernel_2(const AlgebraicKernel_2& ak_2) {
|
||||
{ \
|
||||
typedef typename Name::argument_type AT_; \
|
||||
typedef typename Name::result_type RT_; \
|
||||
CGAL_USE_TYPE(AT_); \
|
||||
CGAL_USE_TYPE(RT_); \
|
||||
{CGAL_static_assertion(( ::boost::is_same<AT,AT_>::value));} \
|
||||
{CGAL_static_assertion(( ::boost::is_same<RT,RT_>::value));} \
|
||||
}
|
||||
@@ -109,6 +111,9 @@ void test_algebraic_kernel_2(const AlgebraicKernel_2& ak_2) {
|
||||
typedef typename Name::first_argument_type AT1_; \
|
||||
typedef typename Name::second_argument_type AT2_; \
|
||||
typedef typename Name::result_type RT_; \
|
||||
CGAL_USE_TYPE(AT1_); \
|
||||
CGAL_USE_TYPE(AT2_); \
|
||||
CGAL_USE_TYPE(RT_); \
|
||||
{CGAL_static_assertion(( ::boost::is_same<AT1,AT1_>::value));} \
|
||||
{CGAL_static_assertion(( ::boost::is_same<AT2,AT2_>::value));} \
|
||||
{CGAL_static_assertion(( ::boost::is_same<RT,RT_>::value));} \
|
||||
|
||||
@@ -68,7 +68,7 @@ public:
|
||||
typedef typename Dt::Triangulation_data_structure Tds;
|
||||
|
||||
// The Exact Comparison Tag cannot be used in conjonction with periodic triangulations
|
||||
// because the periodic triangulations' point() function return a temporary
|
||||
// because the periodic triangulations' point() function returns a temporary
|
||||
// value while the lazy predicate evaluations that are used when the Exact tag
|
||||
// is set to true rely on a permanent and safe access to the points.
|
||||
CGAL_static_assertion(
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace internal {
|
||||
//
|
||||
template < class Input_traits, class Kernel_approx, class Kernel_exact,
|
||||
class Weighted_tag >
|
||||
class Is_traits_point_convertible
|
||||
class Is_traits_point_convertible_2
|
||||
{
|
||||
typedef typename Kernel_traits<typename Input_traits::Point_2>::Kernel Kernel_input;
|
||||
|
||||
@@ -60,7 +60,7 @@ public:
|
||||
};
|
||||
|
||||
template < class Input_traits, class Kernel_approx, class Kernel_exact >
|
||||
class Is_traits_point_convertible<Input_traits, Kernel_approx, Kernel_exact,
|
||||
class Is_traits_point_convertible_2<Input_traits, Kernel_approx, Kernel_exact,
|
||||
::CGAL::Tag_true /* Weighted_tag */>
|
||||
{
|
||||
typedef typename Kernel_traits<typename Input_traits::Point_2>::Kernel Kernel_input;
|
||||
@@ -157,7 +157,7 @@ class Lazy_alpha_nt_2
|
||||
Approx_point to_approx(const Input_point& wp) const
|
||||
{
|
||||
// The traits class' Point_2 must be convertible using the Cartesian converter
|
||||
CGAL_static_assertion((Is_traits_point_convertible<
|
||||
CGAL_static_assertion((Is_traits_point_convertible_2<
|
||||
Input_traits, Kernel_approx, Kernel_exact, Weighted_tag>::value));
|
||||
|
||||
To_approx converter;
|
||||
@@ -167,7 +167,7 @@ class Lazy_alpha_nt_2
|
||||
Exact_point to_exact(const Input_point& wp) const
|
||||
{
|
||||
// The traits class' Point_2 must be convertible using the Cartesian converter
|
||||
CGAL_static_assertion((Is_traits_point_convertible<
|
||||
CGAL_static_assertion((Is_traits_point_convertible_2<
|
||||
Input_traits, Kernel_approx, Kernel_exact, Weighted_tag>::value));
|
||||
|
||||
To_exact converter;
|
||||
|
||||
@@ -21,15 +21,11 @@ include(${CGAL_USE_FILE})
|
||||
|
||||
find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg)
|
||||
|
||||
find_package(QGLViewer)
|
||||
|
||||
if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND QGLVIEWER_FOUND )
|
||||
if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND )
|
||||
|
||||
add_definitions(-DQT_NO_KEYWORDS)
|
||||
|
||||
# include(${QT_USE_FILE})
|
||||
|
||||
include_directories (${QGLVIEWER_INCLUDE_DIR})
|
||||
include_directories (BEFORE ../../include ./ )
|
||||
|
||||
# ui file, created wih Qt Designer
|
||||
@@ -43,14 +39,13 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND QGLVIEWER_FOUND )
|
||||
|
||||
target_link_libraries( Alpha_shape_3 PRIVATE
|
||||
CGAL::CGAL CGAL::CGAL_Qt5
|
||||
Qt5::OpenGL Qt5::Gui
|
||||
${QGLVIEWER_LIBRARIES} )
|
||||
Qt5::OpenGL Qt5::Gui )
|
||||
|
||||
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
|
||||
cgal_add_compilation_test(Alpha_shape_3)
|
||||
|
||||
else()
|
||||
|
||||
message(STATUS "NOTICE: This demo requires CGAL, the QGLViewer, and Qt5, and will not be compiled.")
|
||||
message(STATUS "NOTICE: This demo requires CGAL, and Qt5, and will not be compiled.")
|
||||
|
||||
endif()
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#include "Viewer.h"
|
||||
#include <vector>
|
||||
#include <CGAL/bounding_box.h>
|
||||
#include <QGLViewer/vec.h>
|
||||
#include <CGAL/Qt/vec.h>
|
||||
#include "CGAL/Qt/CreateOpenGLContext.h"
|
||||
|
||||
Viewer::Viewer(QWidget* parent)
|
||||
: QGLViewer(CGAL::Qt::createOpenGLContext(),parent)
|
||||
: CGAL::QGLViewer(parent)
|
||||
{
|
||||
are_buffers_initialized = false;
|
||||
}
|
||||
@@ -109,8 +109,10 @@ const char vertex_source_points[] =
|
||||
"attribute highp vec4 vertex;\n"
|
||||
|
||||
"uniform highp mat4 mvp_matrix;\n"
|
||||
"uniform highp float point_size;\n"
|
||||
"void main(void)\n"
|
||||
"{\n"
|
||||
" gl_PointSize = point_size; \n"
|
||||
" gl_Position = mvp_matrix * vertex;\n"
|
||||
"}"
|
||||
};
|
||||
@@ -198,7 +200,7 @@ void Viewer::initialize_buffers()
|
||||
}
|
||||
|
||||
|
||||
void Viewer::attrib_buffers(QGLViewer* viewer)
|
||||
void Viewer::attrib_buffers(CGAL::QGLViewer* viewer)
|
||||
{
|
||||
QMatrix4x4 mvpMatrix;
|
||||
QMatrix4x4 mvMatrix;
|
||||
@@ -261,7 +263,7 @@ void Viewer::attrib_buffers(QGLViewer* viewer)
|
||||
|
||||
void Viewer::initializeGL()
|
||||
{
|
||||
QGLViewer::initializeGL();
|
||||
CGAL::QGLViewer::initializeGL();
|
||||
compile_shaders();
|
||||
}
|
||||
|
||||
@@ -272,8 +274,8 @@ Viewer::sceneChanged()
|
||||
|
||||
Iso_cuboid_3 bb = CGAL::bounding_box(scene->points.begin(), scene->points.end());
|
||||
|
||||
this->camera()->setSceneBoundingBox(qglviewer::Vec(bb.xmin(), bb.ymin(), bb.zmin()),
|
||||
qglviewer::Vec(bb.xmax(),
|
||||
this->camera()->setSceneBoundingBox(CGAL::qglviewer::Vec(bb.xmin(), bb.ymin(), bb.zmin()),
|
||||
CGAL::qglviewer::Vec(bb.xmax(),
|
||||
bb.ymax(),
|
||||
bb.zmax()));
|
||||
|
||||
@@ -334,9 +336,9 @@ Viewer::draw()
|
||||
attrib_buffers(this);
|
||||
rendering_program_points.bind();
|
||||
color.setRgbF(1.0f, 0.0f, 0.0f);
|
||||
glPointSize(5);
|
||||
glEnable(GL_POINT_SMOOTH);
|
||||
rendering_program_points.setUniformValue(colorLocation_points, color);
|
||||
rendering_program_points.setUniformValue("point_size",5.0f);
|
||||
glDrawArrays(GL_POINTS, 0, static_cast<GLsizei>(pos_points.size()/3));
|
||||
rendering_program_points.release();
|
||||
vao[1].release();
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
|
||||
#include "typedefs.h"
|
||||
#include <QMap>
|
||||
#include <QGLViewer/qglviewer.h>
|
||||
#include <CGAL/Qt/qglviewer.h>
|
||||
#include <QOpenGLFunctions_2_1>
|
||||
#include <QOpenGLVertexArrayObject>
|
||||
#include <QOpenGLBuffer>
|
||||
#include <QOpenGLShaderProgram>
|
||||
|
||||
|
||||
class Viewer : public QGLViewer, protected QOpenGLFunctions_2_1{
|
||||
class Viewer : public CGAL::QGLViewer{
|
||||
Q_OBJECT
|
||||
|
||||
CGAL::Timer timer;
|
||||
@@ -61,7 +61,7 @@ private:
|
||||
QOpenGLShaderProgram rendering_program_points;
|
||||
void initialize_buffers();
|
||||
void compute_elements();
|
||||
void attrib_buffers(QGLViewer*);
|
||||
void attrib_buffers(CGAL::QGLViewer*);
|
||||
void compile_shaders();
|
||||
public Q_SLOTS:
|
||||
void initializeGL();
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
<h2>3D Alpha Shapes</h2>
|
||||
<p>Copyright © 2008 GeometryFactory</p>
|
||||
<p>This application illustrates the 3D Alpha shapes
|
||||
of <a href="http://www.cgal.org/">CGAL</a>.</p>
|
||||
<p>See also <a href="http://www.cgal.org/Pkg/AlphaShapes3">the online
|
||||
of <a href="https://www.cgal.org/">CGAL</a>.</p>
|
||||
<p>See also <a href="https://www.cgal.org/Pkg/AlphaShapes3">the online
|
||||
manual</a>.</p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -10,7 +10,7 @@ The class `Alpha_shape_cell_base_3` is the default model for the concept
|
||||
\tparam Traits is the geometric traits class that is provided
|
||||
to the `Alpha_shape_3` class.
|
||||
\tparam Cb must be a cell base class adapted to the type of triangulation that is being used.
|
||||
By default, it is instantiated with `Triangulation_cell_base_3<Traits>`,
|
||||
By default, it is instantiated with `Delaunay_triangulation_cell_base_3<Traits>`,
|
||||
which is appropriate for basic alpha shapes.
|
||||
\tparam ExactAlphaComparisonTag is a tag that, when set to
|
||||
\link Tag_true `Tag_true`\endlink, triggers exact comparisons between alpha values. See the description
|
||||
@@ -21,7 +21,7 @@ and \link Tag_false `Tag_false`\endlink otherwise. The default is \link Tag_fals
|
||||
|
||||
\cgalModels `AlphaShapeCell_3`
|
||||
|
||||
\sa `Triangulation_cell_base_3`
|
||||
\sa `Delaunay_triangulation_cell_base_3`
|
||||
\sa `Regular_triangulation_cell_base_3`
|
||||
\sa `Periodic_3_triangulation_ds_cell_base_3`
|
||||
*/
|
||||
|
||||
@@ -10,13 +10,13 @@ The class `Fixed_alpha_shape_cell_base_3` is the default model for the concept
|
||||
\tparam Traits is the geometric traits class that is provided
|
||||
to the `Alpha_shape_3` class.
|
||||
\tparam Cb must be a cell base class adapted to the type of triangulation that is being used.
|
||||
By default, it is instantiated with `Triangulation_cell_base_3<Traits>`,
|
||||
By default, it is instantiated with `Delaunay_triangulation_cell_base_3<Traits>`,
|
||||
which is appropriate for basic alpha shapes.
|
||||
|
||||
\cgalModels `FixedAlphaShapeCell_3`
|
||||
|
||||
\sa `Alpha_shape_cell_base_3`
|
||||
\sa `Triangulation_cell_base_3`
|
||||
\sa `Delaunay_triangulation_cell_base_3`
|
||||
\sa `Regular_triangulation_cell_base_3`
|
||||
\sa `Periodic_3_triangulation_ds_cell_base_3`
|
||||
*/
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
The concept `AlphaShapeCell_3` describes the requirements for the base cell of an alpha shape.
|
||||
|
||||
\cgalRefines `TriangulationCellBase_3`, if the underlying triangulation of the alpha shape is a Delaunay triangulation.
|
||||
\cgalRefines `DelaunayTriangulationCellBase_3`, if the underlying triangulation of the alpha shape is a Delaunay triangulation.
|
||||
\cgalRefines `RegularTriangulationCellBase_3`, if the underlying triangulation of the alpha shape is a regular triangulation.
|
||||
\cgalRefines `Periodic_3TriangulationDSCellBase_3`, if the underlying triangulation of the alpha shape is a periodic triangulation.
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
The concept `FixedAlphaShapeCell_3` describes the requirements for the base cell of a alpha shape with a fixed value alpha.
|
||||
|
||||
\cgalRefines `TriangulationCellBase_3`, if the underlying triangulation of the alpha shape is a Delaunay triangulation.
|
||||
\cgalRefines `DelaunayTriangulationCellBase_3`, if the underlying triangulation of the alpha shape is a Delaunay triangulation.
|
||||
\cgalRefines `RegularTriangulationCellBase_3`, if the underlying triangulation of the alpha shape is a regular triangulation.
|
||||
\cgalRefines `Periodic_3TriangulationDSCellBase_3`, if the underlying triangulation of the alpha shape is a periodic triangulation.
|
||||
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
||||
|
||||
#include <CGAL/Alpha_shape_3.h>
|
||||
#include <CGAL/Alpha_shape_cell_base_3.h>
|
||||
#include <CGAL/Alpha_shape_vertex_base_3.h>
|
||||
#include <CGAL/Delaunay_triangulation_3.h>
|
||||
|
||||
#include <fstream>
|
||||
#include <vector>
|
||||
|
||||
#include <boost/unordered_set.hpp>
|
||||
#include <boost/unordered_map.hpp>
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
typedef CGAL::Exact_predicates_inexact_constructions_kernel Gt;
|
||||
|
||||
typedef CGAL::Alpha_shape_vertex_base_3<Gt> Vb;
|
||||
typedef CGAL::Alpha_shape_cell_base_3<Gt> Fb;
|
||||
typedef CGAL::Triangulation_data_structure_3<Vb,Fb> Tds;
|
||||
typedef CGAL::Delaunay_triangulation_3<Gt,Tds> Triangulation_3;
|
||||
typedef CGAL::Alpha_shape_3<Triangulation_3> Alpha_shape_3;
|
||||
|
||||
typedef Gt::Point_3 Point;
|
||||
typedef Alpha_shape_3::Alpha_iterator Alpha_iterator;
|
||||
|
||||
int main()
|
||||
{
|
||||
std::vector<Point> points;
|
||||
|
||||
//read input
|
||||
std::ifstream is("data/bunny_5000");
|
||||
int n;
|
||||
is >> n;
|
||||
double x, y, z;
|
||||
for (int i=0;i<n;++i)
|
||||
{
|
||||
is >> x >> y >> z;
|
||||
points.push_back( Point(x, y, z) );
|
||||
}
|
||||
|
||||
std::cerr << points.size() << " points read.\n";
|
||||
// compute alpha shape
|
||||
Alpha_shape_3 as(points.begin(), points.end());
|
||||
Alpha_shape_3::NT alpha_solid = as.find_alpha_solid();
|
||||
as.set_alpha(alpha_solid);
|
||||
|
||||
std::cerr << "alpha_solid = " << alpha_solid << "\n";
|
||||
std::cerr << as.number_of_solid_components() << " number of solid components\n";
|
||||
|
||||
// collect alpha-shape facets accessible from the infinity
|
||||
// marks the cells that are in the same component as the infinite vertex by flooding
|
||||
boost::unordered_set< Alpha_shape_3::Cell_handle > marked_cells;
|
||||
std::vector< Alpha_shape_3::Cell_handle > queue;
|
||||
queue.push_back( as.infinite_cell() );
|
||||
|
||||
while(!queue.empty())
|
||||
{
|
||||
Alpha_shape_3::Cell_handle back = queue.back();
|
||||
queue.pop_back();
|
||||
|
||||
if ( !marked_cells.insert(back).second ) continue; //already visited
|
||||
|
||||
for (int i=0; i<4; ++i)
|
||||
{
|
||||
if (as.classify(Alpha_shape_3::Facet(back, i))==Alpha_shape_3::EXTERIOR &&
|
||||
marked_cells.count(back->neighbor(i))==0)
|
||||
queue.push_back( back->neighbor(i) );
|
||||
}
|
||||
}
|
||||
|
||||
// filter regular facets to restrict them to those adjacent to a marked cell
|
||||
std::vector< Alpha_shape_3::Facet > regular_facets;
|
||||
as.get_alpha_shape_facets(std::back_inserter( regular_facets ), Alpha_shape_3::REGULAR );
|
||||
|
||||
std::vector<Alpha_shape_3::Facet> filtered_regular_facets;
|
||||
BOOST_FOREACH(Alpha_shape_3::Facet f, regular_facets)
|
||||
{
|
||||
if ( marked_cells.count(f.first)==1 )
|
||||
filtered_regular_facets.push_back(f);
|
||||
else
|
||||
{
|
||||
f = as.mirror_facet(f);
|
||||
if ( marked_cells.count(f.first)==1 )
|
||||
filtered_regular_facets.push_back(f);
|
||||
}
|
||||
}
|
||||
|
||||
// dump into OFF format
|
||||
// assign an id per vertex
|
||||
boost::unordered_map< Alpha_shape_3::Vertex_handle, std::size_t> vids;
|
||||
points.clear();
|
||||
|
||||
BOOST_FOREACH(Alpha_shape_3::Facet f, filtered_regular_facets)
|
||||
{
|
||||
for (int i=1;i<4; ++i)
|
||||
{
|
||||
Alpha_shape_3::Vertex_handle vh = f.first->vertex((f.second+i)%4);
|
||||
if (vids.insert( std::make_pair(vh, points.size()) ).second)
|
||||
points.push_back( vh->point() );
|
||||
}
|
||||
}
|
||||
|
||||
// writing
|
||||
std::ofstream output("out.off");
|
||||
output << "OFF\n " << points.size() << " " << filtered_regular_facets.size() << " 0\n";
|
||||
std::copy(points.begin(), points.end(), std::ostream_iterator<Point>(output, "\n"));
|
||||
BOOST_FOREACH(const Alpha_shape_3::Facet& f, filtered_regular_facets)
|
||||
{
|
||||
output << 3;
|
||||
|
||||
for (int i=0;i<3; ++i)
|
||||
{
|
||||
Alpha_shape_3::Vertex_handle vh = f.first->vertex( as.vertex_triple_index(f.second, i) );
|
||||
output << " " << vids[vh];
|
||||
}
|
||||
output << "\n";
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -107,7 +107,7 @@ public:
|
||||
typedef typename Dt::Triangulation_data_structure Tds;
|
||||
|
||||
// The Exact Comparison Tag cannot be used in conjonction with periodic triangulations
|
||||
// because the periodic triangulations' point() function return a temporary
|
||||
// because the periodic triangulations' point() function returns a temporary
|
||||
// value while the lazy predicate evaluations that are used when the Exact tag
|
||||
// is set to true rely on a permanent and safe access to the points.
|
||||
CGAL_static_assertion(
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
#include <vector>
|
||||
#include <CGAL/Compact_container.h>
|
||||
#include <CGAL/Triangulation_cell_base_3.h>
|
||||
#include <CGAL/Delaunay_triangulation_cell_base_3.h>
|
||||
#include <CGAL/internal/Lazy_alpha_nt_3.h>
|
||||
#include <CGAL/Default.h>
|
||||
|
||||
@@ -61,9 +61,9 @@ template < class Gt,
|
||||
class ExactAlphaComparisonTag = Tag_false,
|
||||
class Weighted_tag = Tag_false >
|
||||
class Alpha_shape_cell_base_3
|
||||
: public Default::Get<Cb_, Triangulation_cell_base_3<Gt> >::type
|
||||
: public Default::Get<Cb_, Delaunay_triangulation_cell_base_3<Gt> >::type
|
||||
{
|
||||
typedef typename Default::Get<Cb_, Triangulation_cell_base_3<Gt> >::type Cb;
|
||||
typedef typename Default::Get<Cb_, Delaunay_triangulation_cell_base_3<Gt> >::type Cb;
|
||||
public:
|
||||
typedef typename Cb::Vertex_handle Vertex_handle;
|
||||
typedef typename Cb::Cell_handle Cell_handle;
|
||||
|
||||
@@ -28,12 +28,12 @@
|
||||
|
||||
#include <vector>
|
||||
#include <CGAL/Compact_container.h>
|
||||
#include <CGAL/Triangulation_cell_base_3.h>
|
||||
#include <CGAL/Delaunay_triangulation_cell_base_3.h>
|
||||
#include <CGAL/internal/Classification_type.h>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
template < class Gt, class Cb = Triangulation_cell_base_3<Gt> >
|
||||
template < class Gt, class Cb = Delaunay_triangulation_cell_base_3<Gt> >
|
||||
class Fixed_alpha_shape_cell_base_3
|
||||
: public Cb
|
||||
{
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace internal{
|
||||
//
|
||||
template < class Input_traits, class Kernel_approx, class Kernel_exact,
|
||||
class Weighted_tag >
|
||||
class Is_traits_point_convertible
|
||||
class Is_traits_point_convertible_3
|
||||
{
|
||||
typedef typename Kernel_traits<typename Input_traits::Point_3>::Kernel Kernel_input;
|
||||
|
||||
@@ -60,7 +60,7 @@ public:
|
||||
};
|
||||
|
||||
template < class Input_traits, class Kernel_approx, class Kernel_exact >
|
||||
class Is_traits_point_convertible<Input_traits, Kernel_approx, Kernel_exact,
|
||||
class Is_traits_point_convertible_3<Input_traits, Kernel_approx, Kernel_exact,
|
||||
::CGAL::Tag_true /* Weighted_tag */>
|
||||
{
|
||||
typedef typename Kernel_traits<typename Input_traits::Point_3>::Kernel Kernel_input;
|
||||
@@ -148,7 +148,7 @@ class Lazy_alpha_nt_3{
|
||||
Approx_point to_approx(const Input_point& wp) const
|
||||
{
|
||||
// The traits class' Point_3 must be convertible using the Cartesian converter
|
||||
CGAL_static_assertion((Is_traits_point_convertible<
|
||||
CGAL_static_assertion((Is_traits_point_convertible_3<
|
||||
Input_traits, Kernel_approx, Kernel_exact, Weighted_tag>::value));
|
||||
|
||||
To_approx converter;
|
||||
@@ -158,7 +158,7 @@ class Lazy_alpha_nt_3{
|
||||
Exact_point to_exact(const Input_point& wp) const
|
||||
{
|
||||
// The traits class' Point_3 must be convertible using the Cartesian converter
|
||||
CGAL_static_assertion((Is_traits_point_convertible<
|
||||
CGAL_static_assertion((Is_traits_point_convertible_3<
|
||||
Input_traits, Kernel_approx, Kernel_exact, Weighted_tag>::value));
|
||||
|
||||
To_exact converter;
|
||||
|
||||
@@ -11,7 +11,7 @@ endif()
|
||||
find_package(CGAL COMPONENTS Core Qt5 )
|
||||
include( ${CGAL_USE_FILE} )
|
||||
|
||||
find_package( Qt5 QUIET COMPONENTS Gui )
|
||||
find_package( Qt5 QUIET COMPONENTS Gui Widgets)
|
||||
|
||||
if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND CGAL_Core_FOUND)
|
||||
include_directories( ./ )
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "NewTabDialog.h"
|
||||
#include "ArrangementDemoWindow.h"
|
||||
#include "ui_NewTabDialog.h"
|
||||
#include <QButtonGroup>
|
||||
|
||||
NewTabDialog::NewTabDialog( QWidget* parent, Qt::WindowFlags f ) :
|
||||
QDialog( parent, f ),
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include <CGAL/Arr_segment_traits_2.h>
|
||||
#include <CGAL/Arr_extended_dcel.h>
|
||||
#include <CGAL/Arrangement_2.h>
|
||||
#include <CGAL/graph_traits_Dual_Arrangement_2.h>
|
||||
#include <CGAL/graph_traits_dual_arrangement_2.h>
|
||||
#include <CGAL/Arr_face_index_map.h>
|
||||
|
||||
#include <climits>
|
||||
|
||||
@@ -784,7 +784,7 @@ public:
|
||||
* \return SMALLER if the curve is directed right;
|
||||
* LARGER if the curve is directed left.
|
||||
*/
|
||||
Comparison_result operator() (const X_monotone_curve_2& cv)
|
||||
Comparison_result operator() (const X_monotone_curve_2& cv) const
|
||||
{
|
||||
if (cv.is_directed_right())
|
||||
return (SMALLER);
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
* The header file for the Arr_circle_segment_traits_2<Kenrel> class.
|
||||
*/
|
||||
|
||||
#include <CGAL/atomic.h>
|
||||
#include <CGAL/tags.h>
|
||||
#include <CGAL/Arr_tags.h>
|
||||
#include <CGAL/Arr_geometry_traits/Circle_segment_2.h>
|
||||
@@ -84,7 +85,11 @@ public:
|
||||
/*! Get the next curve index. */
|
||||
static unsigned int get_index ()
|
||||
{
|
||||
static unsigned int index = 0;
|
||||
#ifdef CGAL_NO_ATOMIC
|
||||
static unsigned int index;
|
||||
#else
|
||||
static CGAL::cpp11::atomic<unsigned int> index;
|
||||
#endif
|
||||
return (++index);
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
* The conic traits-class for the arrangement package.
|
||||
*/
|
||||
|
||||
#include <CGAL/atomic.h>
|
||||
#include <CGAL/tags.h>
|
||||
#include <CGAL/Arr_tags.h>
|
||||
#include <CGAL/Arr_geometry_traits/Conic_arc_2.h>
|
||||
@@ -114,7 +115,11 @@ public:
|
||||
/*! Get the next conic index. */
|
||||
static unsigned int get_index ()
|
||||
{
|
||||
static unsigned int index = 0;
|
||||
#ifdef CGAL_NO_ATOMIC
|
||||
static unsigned int index;
|
||||
#else
|
||||
static CGAL::cpp11::atomic<unsigned int> index;
|
||||
#endif
|
||||
return (++index);
|
||||
}
|
||||
|
||||
|
||||
@@ -908,6 +908,15 @@ protected:
|
||||
typedef In_place_list<Inner_ccb, false> Inner_ccb_list;
|
||||
typedef In_place_list<Isolated_vertex, false> Iso_vert_list;
|
||||
|
||||
#ifdef CGAL_CXX11
|
||||
typedef std::allocator_traits<Allocator> Allocator_traits;
|
||||
typedef typename Allocator_traits::template rebind_alloc<Vertex> Vertex_allocator;
|
||||
typedef typename Allocator_traits::template rebind_alloc<Halfedge> Halfedge_allocator;
|
||||
typedef typename Allocator_traits::template rebind_alloc<Face> Face_allocator;
|
||||
typedef typename Allocator_traits::template rebind_alloc<Outer_ccb> Outer_ccb_allocator;
|
||||
typedef typename Allocator_traits::template rebind_alloc<Inner_ccb> Inner_ccb_allocator;
|
||||
typedef typename Allocator_traits::template rebind_alloc<Isolated_vertex> Iso_vert_allocator;
|
||||
#else // not CGAL_CXX11
|
||||
// Vertex allocator.
|
||||
typedef typename Allocator::template rebind<Vertex> Vertex_alloc_rebind;
|
||||
typedef typename Vertex_alloc_rebind::other Vertex_allocator;
|
||||
@@ -932,6 +941,7 @@ protected:
|
||||
typedef typename Allocator::template rebind<Isolated_vertex>
|
||||
Iso_vert_alloc_rebind;
|
||||
typedef typename Iso_vert_alloc_rebind::other Iso_vert_allocator;
|
||||
#endif // not CGAL_CXX11
|
||||
|
||||
public:
|
||||
typedef typename Halfedge_list::size_type Size;
|
||||
@@ -1079,8 +1089,11 @@ public:
|
||||
Vertex* new_vertex()
|
||||
{
|
||||
Vertex* v = vertex_alloc.allocate(1);
|
||||
|
||||
#ifdef CGAL_CXX11
|
||||
std::allocator_traits<Vertex_allocator>::construct(vertex_alloc,v);
|
||||
#else
|
||||
vertex_alloc.construct(v, Vertex());
|
||||
#endif
|
||||
vertices.push_back(*v);
|
||||
return v;
|
||||
}
|
||||
@@ -1103,8 +1116,11 @@ public:
|
||||
Face* new_face()
|
||||
{
|
||||
Face* f = face_alloc.allocate(1);
|
||||
|
||||
#ifdef CGAL_CXX11
|
||||
std::allocator_traits<Face_allocator>::construct(face_alloc, f);
|
||||
#else
|
||||
face_alloc.construct(f, Face());
|
||||
#endif
|
||||
faces.push_back (*f);
|
||||
return(f);
|
||||
}
|
||||
@@ -1113,7 +1129,11 @@ public:
|
||||
Outer_ccb* new_outer_ccb()
|
||||
{
|
||||
Outer_ccb* oc = out_ccb_alloc.allocate(1);
|
||||
#ifdef CGAL_CXX11
|
||||
std::allocator_traits<Outer_ccb_allocator>::construct(out_ccb_alloc, oc);
|
||||
#else
|
||||
out_ccb_alloc.construct(oc, Outer_ccb());
|
||||
#endif
|
||||
out_ccbs.push_back(*oc);
|
||||
return (oc);
|
||||
}
|
||||
@@ -1122,7 +1142,11 @@ public:
|
||||
Inner_ccb* new_inner_ccb()
|
||||
{
|
||||
Inner_ccb* ic = in_ccb_alloc.allocate(1);
|
||||
#ifdef CGAL_CXX11
|
||||
std::allocator_traits<Inner_ccb_allocator>::construct(in_ccb_alloc, ic);
|
||||
#else
|
||||
in_ccb_alloc.construct(ic, Inner_ccb());
|
||||
#endif
|
||||
in_ccbs.push_back(*ic);
|
||||
return (ic);
|
||||
}
|
||||
@@ -1131,7 +1155,11 @@ public:
|
||||
Isolated_vertex* new_isolated_vertex()
|
||||
{
|
||||
Isolated_vertex* iv = iso_vert_alloc.allocate(1);
|
||||
#ifdef CGAL_CXX11
|
||||
std::allocator_traits<Iso_vert_allocator>::construct(iso_vert_alloc, iv);
|
||||
#else
|
||||
iso_vert_alloc.construct(iv, Isolated_vertex());
|
||||
#endif
|
||||
iso_verts.push_back(*iv);
|
||||
return (iv);
|
||||
}
|
||||
@@ -1143,7 +1171,11 @@ public:
|
||||
void delete_vertex(Vertex* v)
|
||||
{
|
||||
vertices.erase(v);
|
||||
#ifdef CGAL_CXX11
|
||||
std::allocator_traits<Vertex_allocator>::destroy(vertex_alloc, v);
|
||||
#else
|
||||
vertex_alloc.destroy(v);
|
||||
#endif
|
||||
vertex_alloc.deallocate(v,1);
|
||||
}
|
||||
|
||||
@@ -1159,7 +1191,11 @@ public:
|
||||
void delete_face(Face* f)
|
||||
{
|
||||
faces.erase(f);
|
||||
#ifdef CGAL_CXX11
|
||||
std::allocator_traits<Face_allocator>::destroy(face_alloc, f);
|
||||
#else
|
||||
face_alloc.destroy(f);
|
||||
#endif
|
||||
face_alloc.deallocate(f, 1);
|
||||
}
|
||||
|
||||
@@ -1167,7 +1203,11 @@ public:
|
||||
void delete_outer_ccb(Outer_ccb* oc)
|
||||
{
|
||||
out_ccbs.erase(oc);
|
||||
#ifdef CGAL_CXX11
|
||||
std::allocator_traits<Outer_ccb_allocator>::destroy(out_ccb_alloc, oc);
|
||||
#else
|
||||
out_ccb_alloc.destroy(oc);
|
||||
#endif
|
||||
out_ccb_alloc.deallocate(oc, 1);
|
||||
}
|
||||
|
||||
@@ -1175,7 +1215,11 @@ public:
|
||||
void delete_inner_ccb(Inner_ccb* ic)
|
||||
{
|
||||
in_ccbs.erase(ic);
|
||||
#ifdef CGAL_CXX11
|
||||
std::allocator_traits<Inner_ccb_allocator>::destroy(in_ccb_alloc, ic);
|
||||
#else
|
||||
in_ccb_alloc.destroy(ic);
|
||||
#endif
|
||||
in_ccb_alloc.deallocate(ic, 1);
|
||||
}
|
||||
|
||||
@@ -1183,7 +1227,11 @@ public:
|
||||
void delete_isolated_vertex(Isolated_vertex* iv)
|
||||
{
|
||||
iso_verts.erase(iv);
|
||||
#ifdef CGAL_CXX11
|
||||
std::allocator_traits<Iso_vert_allocator>::destroy(iso_vert_alloc, iv);
|
||||
#else
|
||||
iso_vert_alloc.destroy(iv);
|
||||
#endif
|
||||
iso_vert_alloc.deallocate(iv, 1);
|
||||
}
|
||||
|
||||
@@ -1444,7 +1492,11 @@ protected:
|
||||
Halfedge* _new_halfedge()
|
||||
{
|
||||
Halfedge* h = halfedge_alloc.allocate(1);
|
||||
#ifdef CGAL_CXX11
|
||||
std::allocator_traits<Halfedge_allocator>::construct(halfedge_alloc, h);
|
||||
#else
|
||||
halfedge_alloc.construct(h, Halfedge());
|
||||
#endif
|
||||
halfedges.push_back(*h);
|
||||
return (h);
|
||||
}
|
||||
@@ -1453,7 +1505,11 @@ protected:
|
||||
void _delete_halfedge(Halfedge* h)
|
||||
{
|
||||
halfedges.erase(h);
|
||||
#ifdef CGAL_CXX11
|
||||
std::allocator_traits<Halfedge_allocator>::destroy(halfedge_alloc,h);
|
||||
#else
|
||||
halfedge_alloc.destroy(h);
|
||||
#endif
|
||||
halfedge_alloc.deallocate(h, 1);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -143,7 +143,7 @@ public:
|
||||
return !equals(p);
|
||||
}
|
||||
|
||||
bool operator == (const Self& p)
|
||||
bool operator == (const Self& p) const
|
||||
{
|
||||
return equals(p);
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include <CGAL/Arrangement_2/Arr_traits_adaptor_2.h>
|
||||
#include <CGAL/Arr_point_location/Arr_lm_nearest_neighbor.h>
|
||||
#include <CGAL/Arr_batched_point_location.h>
|
||||
#include <CGAL/algorithm.h>
|
||||
|
||||
#include <list>
|
||||
#include <algorithm>
|
||||
@@ -457,7 +458,7 @@ protected:
|
||||
|
||||
// Apply a random shuffle on the points, since the batched point-location
|
||||
// returns them sorted.
|
||||
std::random_shuffle(pairs.begin(), pairs.end());
|
||||
CGAL::cpp98::random_shuffle(pairs.begin(), pairs.end());
|
||||
|
||||
// Insert all landmarks (paired with their current location in the
|
||||
// arrangement) into the nearest-neighbor search structure.
|
||||
|
||||
+100
-156
@@ -16,15 +16,15 @@
|
||||
// $Id$
|
||||
// SPDX-License-Identifier: GPL-3.0+
|
||||
//
|
||||
// Author(s) : Oren Nechushtan <theoren@math.tau.ac.il>
|
||||
// updated by: Michal Balas <balasmic@post.tau.ac.il>
|
||||
// Author(s): Oren Nechushtan <theoren@math.tau.ac.il>
|
||||
// Michal Balas <balasmic@post.tau.ac.il>
|
||||
// Efi Fogel <efifogel@gmail.com>
|
||||
|
||||
#ifndef CGAL_TD_ACTIVE_FICTITIOUS_VERTEX_H
|
||||
#define CGAL_TD_ACTIVE_FICTITIOUS_VERTEX_H
|
||||
|
||||
#include <CGAL/license/Arrangement_on_surface_2.h>
|
||||
|
||||
|
||||
/*! \file
|
||||
* Defintion of the Td_active_fictitious_vertex<Td_traits> class.
|
||||
*/
|
||||
@@ -33,7 +33,6 @@
|
||||
#include <boost/variant.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
|
||||
#ifdef CGAL_TD_DEBUG
|
||||
#define CGAL_TD_INLINE
|
||||
#else
|
||||
@@ -46,63 +45,61 @@ namespace CGAL {
|
||||
* Implementation of a pseudo-trapezoid as two halfedges(top,bottom)
|
||||
* and two curve-ends(left,right).
|
||||
* Trapezoids are represented as two curve-ends called right and left and
|
||||
* two halfedges called top and bottom. The curve-ends (points) lie on the
|
||||
* right and left boundaries of the trapezoid respectively and the halfedges
|
||||
* two halfedges called top and bottom. The curve-ends (points) lie on the
|
||||
* right and left boundaries of the trapezoid respectively and the halfedges
|
||||
* bound the trapezoid from above and below.
|
||||
* There exist degenerate trapezoids called infinite trapezoid; this happens
|
||||
* There exist degenerate trapezoids called infinite trapezoid; this happens
|
||||
* when one of the four sides is on the parameter space boundary.
|
||||
* Trapezoids are created as active and become inactive when Remove() member
|
||||
* function called.
|
||||
* Each trapezoid has at most four neighbouring trapezoids.
|
||||
* X_trapezoid structure can represent a real trapezoid, a Td-edge or an
|
||||
* X_trapezoid structure can represent a real trapezoid, a Td-edge or an
|
||||
* edge-end (end point).
|
||||
*/
|
||||
template <class Td_traits_>
|
||||
class Td_active_fictitious_vertex : public Handle
|
||||
{
|
||||
template <typename Td_traits_>
|
||||
class Td_active_fictitious_vertex : public Handle {
|
||||
public:
|
||||
|
||||
|
||||
//type of traits class
|
||||
typedef Td_traits_ Traits;
|
||||
|
||||
typedef Td_traits_ Traits;
|
||||
|
||||
//type of point (Point_2)
|
||||
typedef typename Traits::Point Point;
|
||||
typedef typename Traits::Point Point;
|
||||
|
||||
//type of X_monotone_curve_2
|
||||
typedef typename Traits::X_monotone_curve_2 X_monotone_curve_2;
|
||||
typedef typename Traits::X_monotone_curve_2 X_monotone_curve_2;
|
||||
|
||||
//type of Curve_end
|
||||
typedef typename Traits::Curve_end Curve_end;
|
||||
|
||||
typedef typename Traits::Curve_end Curve_end;
|
||||
|
||||
//type of Halfedge_const_handle (trapezoid edge)
|
||||
typedef typename Traits::Halfedge_const_handle Halfedge_const_handle;
|
||||
|
||||
typedef typename Traits::Halfedge_const_handle Halfedge_const_handle;
|
||||
|
||||
//type of Vertex_const_handle (trapezoid vertex)
|
||||
typedef typename Traits::Vertex_const_handle Vertex_const_handle;
|
||||
typedef typename Traits::Vertex_const_handle Vertex_const_handle;
|
||||
|
||||
//type of Halfedge_around_vertex_const_circulator
|
||||
typedef typename Traits::Halfedge_around_vertex_const_circulator
|
||||
typedef typename Traits::Halfedge_around_vertex_const_circulator
|
||||
Halfedge_around_vertex_const_circulator;
|
||||
|
||||
//type of Td_active_fictitious_vertex (Self)
|
||||
typedef typename Traits::Td_active_fictitious_vertex Self;
|
||||
|
||||
typedef typename Traits::Td_map_item Td_map_item;
|
||||
typedef typename Traits::Td_active_fictitious_vertex Self;
|
||||
|
||||
typedef typename Traits::Td_map_item Td_map_item;
|
||||
|
||||
//type of Trapezoidal decomposition
|
||||
typedef Trapezoidal_decomposition_2<Traits> TD;
|
||||
|
||||
typedef Trapezoidal_decomposition_2<Traits> TD;
|
||||
|
||||
//type of In face iterator
|
||||
typedef typename TD::In_face_iterator In_face_iterator;
|
||||
typedef typename TD::In_face_iterator In_face_iterator;
|
||||
|
||||
//type of Trapezoidal map search structure
|
||||
typedef typename TD::Dag_node Dag_node;
|
||||
|
||||
typedef typename TD::Dag_node Dag_node;
|
||||
|
||||
//friend class declarations:
|
||||
|
||||
friend class Trapezoidal_decomposition_2<Traits>;
|
||||
|
||||
|
||||
#ifdef CGAL_PM_FRIEND_CLASS
|
||||
#if defined(__SUNPRO_CC) || defined(__PGI) || defined(__INTEL_COMPILER)
|
||||
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
|
||||
@@ -113,199 +110,146 @@ public:
|
||||
#else
|
||||
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
|
||||
#endif
|
||||
|
||||
|
||||
#else
|
||||
friend class In_face_iterator;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/*! \class
|
||||
* Inner class Data derived from Rep class
|
||||
*/
|
||||
class Data : public Rep
|
||||
{
|
||||
* Inner class Data derived from Rep class
|
||||
*/
|
||||
class Data : public Rep {
|
||||
friend class Td_active_fictitious_vertex<Td_traits_>;
|
||||
|
||||
public:
|
||||
//c'tors
|
||||
Data (Vertex_const_handle _v,
|
||||
Halfedge_const_handle _cw_he,
|
||||
Dag_node* _p_node)
|
||||
: v(_v),cw_he(_cw_he),p_node(_p_node)
|
||||
{ }
|
||||
|
||||
~Data() { }
|
||||
Data(Vertex_const_handle _v, Halfedge_const_handle _cw_he,
|
||||
Dag_node* _p_node) :
|
||||
v(_v), cw_he(_cw_he), p_node(_p_node)
|
||||
{}
|
||||
|
||||
~Data() {}
|
||||
|
||||
protected:
|
||||
Vertex_const_handle v;
|
||||
Vertex_const_handle v;
|
||||
Halfedge_const_handle cw_he; //holds the first edge going cw starting at 12 o'clock
|
||||
Dag_node* p_node;
|
||||
};
|
||||
|
||||
private:
|
||||
|
||||
Data* ptr() const { return (Data*)(PTR); }
|
||||
|
||||
|
||||
private:
|
||||
Data* ptr() const { return (Data*)(PTR); }
|
||||
|
||||
Curve_end vtx_to_ce(Vertex_const_handle v) const
|
||||
{
|
||||
//the circulator is of incoming halfedges
|
||||
Halfedge_around_vertex_const_circulator he = v->incident_halfedges();
|
||||
Halfedge_around_vertex_const_circulator he = v->incident_halfedges();
|
||||
//if the vertex is associated with a point on the bounded coords,
|
||||
// we can take any incident halfedge. o/w if the vertex lies at infinity,
|
||||
// it has 2 fictitious incident halfedges
|
||||
if (v->is_at_open_boundary() && he->source()->is_at_open_boundary()) ++he;
|
||||
if (v->is_at_open_boundary() && he->source()->is_at_open_boundary()) ++he;
|
||||
|
||||
return Curve_end(he->curve(),
|
||||
(he->direction() == ARR_RIGHT_TO_LEFT)?
|
||||
ARR_MIN_END : ARR_MAX_END);
|
||||
return Curve_end(he->curve(), ((he->direction() == ARR_RIGHT_TO_LEFT) ?
|
||||
ARR_MIN_END : ARR_MAX_END));
|
||||
}
|
||||
|
||||
|
||||
#ifndef CGAL_TD_DEBUG
|
||||
#ifdef CGAL_PM_FRIEND_CLASS
|
||||
protected:
|
||||
protected:
|
||||
#else
|
||||
public: // workaround
|
||||
public: // workaround
|
||||
#endif
|
||||
#else //CGAL_TD_DEBUG
|
||||
public:
|
||||
public:
|
||||
#endif //CGAL_TD_DEBUG
|
||||
|
||||
|
||||
/*! Set the DAG node. */
|
||||
inline void set_dag_node(Dag_node* p)
|
||||
{
|
||||
ptr()->p_node = p;
|
||||
}
|
||||
|
||||
inline void set_dag_node(Dag_node* p) { ptr()->p_node = p; }
|
||||
|
||||
/*! Set the vertex handle (Vertex_const_handle). */
|
||||
inline void set_vertex(Vertex_const_handle v)
|
||||
inline void set_vertex(Vertex_const_handle v) { ptr()->v = v; }
|
||||
|
||||
/*! Set the first he going clockwise starting at 12 o'clock.
|
||||
*/
|
||||
inline void set_cw_he(Halfedge_const_handle he)
|
||||
{
|
||||
ptr()->v = v;
|
||||
}
|
||||
|
||||
/*! Set the first he going clockwise starting at 12 o'clock (Halfedge_const_handle). */
|
||||
inline void set_cw_he(Halfedge_const_handle he)
|
||||
{
|
||||
if (cw_he() != Traits::empty_he_handle() &&
|
||||
cw_he()->direction() != he->direction())
|
||||
{
|
||||
ptr()->cw_he = he->twin();
|
||||
}
|
||||
else
|
||||
{
|
||||
ptr()->cw_he = he;
|
||||
}
|
||||
ptr()->cw_he = ((cw_he() != Traits::empty_he_handle()) &&
|
||||
(cw_he()->direction() != he->direction())) ?
|
||||
he->twin() : he;
|
||||
}
|
||||
|
||||
|
||||
public:
|
||||
|
||||
/*! Reset the first he going clockwise starting at 12 o'clock.
|
||||
*/
|
||||
inline void reset_cw_he() { ptr()->cw_he = Traits::empty_he_handle(); }
|
||||
|
||||
public:
|
||||
/// \name Constructors.
|
||||
//@{
|
||||
|
||||
Td_active_fictitious_vertex ()
|
||||
Td_active_fictitious_vertex()
|
||||
{
|
||||
PTR = new Data
|
||||
(Traits::empty_vtx_handle(), Traits::empty_he_handle(), NULL);
|
||||
PTR = new Data(Traits::empty_vtx_handle(), Traits::empty_he_handle(), NULL);
|
||||
}
|
||||
|
||||
|
||||
/*! Constructor given Vertex & Halfedge handles. */
|
||||
Td_active_fictitious_vertex (Vertex_const_handle v,
|
||||
Halfedge_const_handle cw_he,
|
||||
Dag_node* node = 0)
|
||||
|
||||
|
||||
{
|
||||
PTR = new Data(v, cw_he, node);
|
||||
}
|
||||
|
||||
|
||||
Td_active_fictitious_vertex(Vertex_const_handle v,
|
||||
Halfedge_const_handle cw_he,
|
||||
Dag_node* node = 0)
|
||||
{ PTR = new Data(v, cw_he, node); }
|
||||
|
||||
|
||||
/*! Copy constructor. */
|
||||
Td_active_fictitious_vertex (const Self& tr) : Handle(tr)
|
||||
{
|
||||
}
|
||||
|
||||
Td_active_fictitious_vertex (const Self& tr) : Handle(tr) {}
|
||||
|
||||
//@}
|
||||
|
||||
|
||||
/// \name Operator overloading.
|
||||
//@{
|
||||
|
||||
/*! Assignment operator.
|
||||
* operator= should not copy m_dag_node (or otherwise update
|
||||
/*! Assignment operator.
|
||||
* operator= should not copy m_dag_node (or otherwise update
|
||||
* Dag_node::replace)
|
||||
*/
|
||||
inline Self& operator= (const Self& t2)
|
||||
inline Self& operator=(const Self& t2)
|
||||
{
|
||||
Handle::operator=(t2);
|
||||
return *this;
|
||||
Handle::operator=(t2);
|
||||
return *this;
|
||||
}
|
||||
|
||||
/*! Operator==. */
|
||||
inline bool operator== (const Self& t2) const
|
||||
{
|
||||
return (ptr() == t2.ptr());
|
||||
}
|
||||
inline bool operator==(const Self& t2) const { return (ptr() == t2.ptr()); }
|
||||
|
||||
/*! Operator!=. */
|
||||
inline bool operator!= (const Self& t2) const
|
||||
{
|
||||
return !(operator==(t2));
|
||||
}
|
||||
inline bool operator!=(const Self& t2) const { return !(operator==(t2)); }
|
||||
|
||||
//@}
|
||||
|
||||
|
||||
/// \name Access methods.
|
||||
//@{
|
||||
|
||||
inline Self& self()
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline const Self& self() const
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
inline Self& self() { return *this; }
|
||||
|
||||
inline const Self& self() const { return *this; }
|
||||
|
||||
/*! Access the trapezoid id (PTR). */
|
||||
inline unsigned long id() const
|
||||
{
|
||||
return (unsigned long) PTR;
|
||||
}
|
||||
inline unsigned long id() const { return (unsigned long) PTR; }
|
||||
|
||||
/*! Access trapezoid left.
|
||||
* filters out the infinite case which returns predefined dummy values
|
||||
*/
|
||||
inline Vertex_const_handle vertex() const
|
||||
{
|
||||
return ptr()->v;
|
||||
}
|
||||
/*! Access trapezoid left.
|
||||
* filters out the infinite case which returns predefined dummy values
|
||||
*/
|
||||
inline Vertex_const_handle vertex() const { return ptr()->v; }
|
||||
|
||||
Curve_end curve_end() const
|
||||
{
|
||||
return vtx_to_ce(vertex());
|
||||
}
|
||||
Curve_end curve_end() const { return vtx_to_ce(vertex()); }
|
||||
|
||||
/*! Access the first he starting at 12 o'clock clockwise.
|
||||
*/
|
||||
inline Halfedge_const_handle cw_he() const { return ptr()->cw_he; }
|
||||
|
||||
/*! Access the first he starting at 12 o'clock clockwise.
|
||||
*/
|
||||
inline Halfedge_const_handle cw_he () const
|
||||
{
|
||||
return ptr()->cw_he;
|
||||
}
|
||||
|
||||
|
||||
/*! Access DAG node. */
|
||||
Dag_node* dag_node() const {return ptr()->p_node; } //m_dag_node;}
|
||||
|
||||
|
||||
Dag_node* dag_node() const { return ptr()->p_node; } //m_dag_node;}
|
||||
|
||||
//@}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
} //namespace CGAL
|
||||
|
||||
@@ -16,15 +16,15 @@
|
||||
// $Id$
|
||||
// SPDX-License-Identifier: GPL-3.0+
|
||||
//
|
||||
// Author(s) : Oren Nechushtan <theoren@math.tau.ac.il>
|
||||
// updated by: Michal Balas <balasmic@post.tau.ac.il>
|
||||
// Author(s): Oren Nechushtan <theoren@math.tau.ac.il>
|
||||
// Michal Balas <balasmic@post.tau.ac.il>
|
||||
// Efi Fogel <efifogel@gmail.com>
|
||||
|
||||
#ifndef CGAL_TD_ACTIVE_VERTEX_H
|
||||
#define CGAL_TD_ACTIVE_VERTEX_H
|
||||
|
||||
#include <CGAL/license/Arrangement_on_surface_2.h>
|
||||
|
||||
|
||||
/*! \file
|
||||
* Defintion of the Td_active_vertex<Td_traits> class.
|
||||
*/
|
||||
@@ -46,63 +46,62 @@ namespace CGAL {
|
||||
* Implementation of a pseudo-trapezoid as two halfedges(top,bottom)
|
||||
* and two curve-ends(left,right).
|
||||
* Trapezoids are represented as two curve-ends called right and left and
|
||||
* two halfedges called top and bottom. The curve-ends (points) lie on the
|
||||
* right and left boundaries of the trapezoid respectively and the halfedges
|
||||
* two halfedges called top and bottom. The curve-ends (points) lie on the
|
||||
* right and left boundaries of the trapezoid respectively and the halfedges
|
||||
* bound the trapezoid from above and below.
|
||||
* There exist degenerate trapezoids called infinite trapezoid; this happens
|
||||
* There exist degenerate trapezoids called infinite trapezoid; this happens
|
||||
* when one of the four sides is on the parameter space boundary.
|
||||
* Trapezoids are created as active and become inactive when Remove() member
|
||||
* function called.
|
||||
* Each trapezoid has at most four neighbouring trapezoids.
|
||||
* X_trapezoid structure can represent a real trapezoid, a Td-edge or an
|
||||
* X_trapezoid structure can represent a real trapezoid, a Td-edge or an
|
||||
* edge-end (end point).
|
||||
*/
|
||||
template <class Td_traits_>
|
||||
class Td_active_vertex : public Handle
|
||||
{
|
||||
public:
|
||||
|
||||
template <typename Td_traits_>
|
||||
class Td_active_vertex : public Handle {
|
||||
public:
|
||||
|
||||
//type of traits class
|
||||
typedef Td_traits_ Traits;
|
||||
|
||||
typedef Td_traits_ Traits;
|
||||
|
||||
//type of point (Point_2)
|
||||
typedef typename Traits::Point Point;
|
||||
typedef typename Traits::Point Point;
|
||||
|
||||
//type of X_monotone_curve_2
|
||||
typedef typename Traits::X_monotone_curve_2 X_monotone_curve_2;
|
||||
typedef typename Traits::X_monotone_curve_2 X_monotone_curve_2;
|
||||
|
||||
//type of Curve_end
|
||||
typedef typename Traits::Curve_end Curve_end;
|
||||
typedef typename Traits::Curve_end Curve_end;
|
||||
|
||||
//type of Halfedge_const_handle (trapezoid edge)
|
||||
typedef typename Traits::Halfedge_const_handle Halfedge_const_handle;
|
||||
|
||||
typedef typename Traits::Halfedge_const_handle Halfedge_const_handle;
|
||||
|
||||
//type of Vertex_const_handle (trapezoid vertex)
|
||||
typedef typename Traits::Vertex_const_handle Vertex_const_handle;
|
||||
typedef typename Traits::Vertex_const_handle Vertex_const_handle;
|
||||
|
||||
//type of Halfedge_around_vertex_const_circulator
|
||||
typedef typename Traits::Halfedge_around_vertex_const_circulator
|
||||
typedef typename Traits::Halfedge_around_vertex_const_circulator
|
||||
Halfedge_around_vertex_const_circulator;
|
||||
|
||||
//type of Td_active_vertex (Self)
|
||||
typedef typename Traits::Td_active_vertex Self;
|
||||
|
||||
typedef typename Traits::Td_map_item Td_map_item;
|
||||
typedef typename Traits::Td_active_vertex Self;
|
||||
|
||||
typedef typename Traits::Td_map_item Td_map_item;
|
||||
|
||||
//type of Trapezoidal decomposition
|
||||
typedef Trapezoidal_decomposition_2<Traits> TD;
|
||||
|
||||
typedef Trapezoidal_decomposition_2<Traits> TD;
|
||||
|
||||
//type of In face iterator
|
||||
typedef typename TD::In_face_iterator In_face_iterator;
|
||||
typedef typename TD::In_face_iterator In_face_iterator;
|
||||
|
||||
//type of Trapezoidal map search structure
|
||||
typedef typename TD::Dag_node Dag_node;
|
||||
typedef typename TD::Dag_node Dag_node;
|
||||
|
||||
|
||||
//friend class declarations:
|
||||
|
||||
friend class Trapezoidal_decomposition_2<Traits>;
|
||||
|
||||
|
||||
#ifdef CGAL_PM_FRIEND_CLASS
|
||||
#if defined(__SUNPRO_CC) || defined(__PGI) || defined(__INTEL_COMPILER)
|
||||
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
|
||||
@@ -113,201 +112,145 @@ class Td_active_vertex : public Handle
|
||||
#else
|
||||
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
|
||||
#endif
|
||||
|
||||
|
||||
#else
|
||||
friend class In_face_iterator;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/*! \class
|
||||
* Inner class Data derived from Rep class
|
||||
*/
|
||||
class Data : public Rep
|
||||
{
|
||||
* Inner class Data derived from Rep class
|
||||
*/
|
||||
class Data : public Rep {
|
||||
friend class Td_active_vertex<Td_traits_>;
|
||||
|
||||
public:
|
||||
//c'tors
|
||||
Data (Vertex_const_handle _v,
|
||||
Halfedge_const_handle _cw_he,
|
||||
Dag_node* _p_node)
|
||||
: v(_v),cw_he(_cw_he),p_node(_p_node)
|
||||
{ }
|
||||
|
||||
~Data() { }
|
||||
Data(Vertex_const_handle _v, Halfedge_const_handle _cw_he,
|
||||
Dag_node* _p_node) :
|
||||
v(_v), cw_he(_cw_he), p_node(_p_node)
|
||||
{}
|
||||
|
||||
~Data() {}
|
||||
|
||||
protected:
|
||||
Vertex_const_handle v;
|
||||
Vertex_const_handle v;
|
||||
Halfedge_const_handle cw_he; //holds the first edge going cw starting at 12 o'clock
|
||||
Dag_node* p_node;
|
||||
Dag_node* p_node;
|
||||
};
|
||||
|
||||
private:
|
||||
|
||||
Data* ptr() const { return (Data*)(PTR); }
|
||||
|
||||
private:
|
||||
Data* ptr() const { return (Data*)(PTR); }
|
||||
|
||||
Curve_end vtx_to_ce(Vertex_const_handle v) const
|
||||
{
|
||||
//the circulator is of incoming halfedges
|
||||
Halfedge_around_vertex_const_circulator he = v->incident_halfedges();
|
||||
Halfedge_around_vertex_const_circulator he = v->incident_halfedges();
|
||||
//if the vertex is associated with a point on the bounded coords,
|
||||
// we can take any incident halfedge. o/w if the vertex lies at infinity,
|
||||
// it has 2 fictitious incident halfedges
|
||||
if (v->is_at_open_boundary() && he->source()->is_at_open_boundary()) ++he;
|
||||
if (v->is_at_open_boundary() && he->source()->is_at_open_boundary()) ++he;
|
||||
|
||||
return Curve_end(he->curve(),
|
||||
(he->direction() == ARR_RIGHT_TO_LEFT)?
|
||||
ARR_MIN_END : ARR_MAX_END);
|
||||
return Curve_end(he->curve(), ((he->direction() == ARR_RIGHT_TO_LEFT) ?
|
||||
ARR_MIN_END : ARR_MAX_END));
|
||||
}
|
||||
|
||||
|
||||
|
||||
#ifndef CGAL_TD_DEBUG
|
||||
#ifdef CGAL_PM_FRIEND_CLASS
|
||||
protected:
|
||||
protected:
|
||||
#else
|
||||
public: // workaround
|
||||
public: // workaround
|
||||
#endif
|
||||
#else //CGAL_TD_DEBUG
|
||||
public:
|
||||
public:
|
||||
#endif //CGAL_TD_DEBUG
|
||||
|
||||
|
||||
|
||||
|
||||
/*! Set the DAG node. */
|
||||
inline void set_dag_node(Dag_node* p)
|
||||
{
|
||||
ptr()->p_node = p;
|
||||
}
|
||||
|
||||
inline void set_dag_node(Dag_node* p) { ptr()->p_node = p; }
|
||||
|
||||
/*! Set the vertex handle (Vertex_const_handle). */
|
||||
inline void set_vertex(Vertex_const_handle v)
|
||||
inline void set_vertex(Vertex_const_handle v) { ptr()->v = v; }
|
||||
|
||||
/*! Set the first he going clockwise starting at 12 o'clock.
|
||||
*/
|
||||
inline void set_cw_he(Halfedge_const_handle he)
|
||||
{
|
||||
ptr()->v = v;
|
||||
ptr()->cw_he = ((cw_he() != Traits::empty_he_handle()) &&
|
||||
(cw_he()->direction() != he->direction())) ?
|
||||
he->twin() : he;
|
||||
}
|
||||
|
||||
/*! Set the first he going clockwise starting at 12 o'clock (Halfedge_const_handle). */
|
||||
inline void set_cw_he(Halfedge_const_handle he)
|
||||
{
|
||||
if (cw_he() != Traits::empty_he_handle() &&
|
||||
cw_he()->direction() != he->direction())
|
||||
{
|
||||
ptr()->cw_he = he->twin();
|
||||
}
|
||||
else
|
||||
{
|
||||
ptr()->cw_he = he;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
/*! Reset the first he going clockwise starting at 12 o'clock.
|
||||
*/
|
||||
inline void reset_cw_he() { ptr()->cw_he = Traits::empty_he_handle(); }
|
||||
|
||||
public:
|
||||
/// \name Constructors.
|
||||
//@{
|
||||
|
||||
Td_active_vertex ()
|
||||
Td_active_vertex()
|
||||
{
|
||||
PTR = new Data
|
||||
(Traits::empty_vtx_handle(), Traits::empty_he_handle(), NULL);
|
||||
PTR = new Data(Traits::empty_vtx_handle(), Traits::empty_he_handle(), NULL);
|
||||
}
|
||||
|
||||
|
||||
/*! Constructor given Vertex & Halfedge handles. */
|
||||
Td_active_vertex (Vertex_const_handle v,
|
||||
Halfedge_const_handle cw_he,
|
||||
Td_active_vertex(Vertex_const_handle v, Halfedge_const_handle cw_he,
|
||||
Dag_node* node = 0)
|
||||
|
||||
{
|
||||
PTR = new Data (v, cw_he, node);
|
||||
}
|
||||
|
||||
|
||||
|
||||
{ PTR = new Data(v, cw_he, node); }
|
||||
|
||||
|
||||
/*! Copy constructor. */
|
||||
Td_active_vertex(const Self& tr) : Handle(tr)
|
||||
{
|
||||
}
|
||||
|
||||
Td_active_vertex(const Self& tr) : Handle(tr) {}
|
||||
|
||||
//@}
|
||||
|
||||
|
||||
/// \name Operator overloading.
|
||||
//@{
|
||||
|
||||
/*! Assignment operator.
|
||||
* operator= should not copy m_dag_node (or otherwise update
|
||||
/*! Assignment operator.
|
||||
* operator= should not copy m_dag_node (or otherwise update
|
||||
* Dag_node::replace)
|
||||
*/
|
||||
inline Self& operator= (const Self& t2)
|
||||
inline Self& operator=(const Self& t2)
|
||||
{
|
||||
Handle::operator=(t2);
|
||||
return *this;
|
||||
Handle::operator=(t2);
|
||||
return *this;
|
||||
}
|
||||
|
||||
/*! Operator==. */
|
||||
inline bool operator== (const Self& t2) const
|
||||
{
|
||||
return (ptr() == t2.ptr());
|
||||
}
|
||||
inline bool operator==(const Self& t2) const { return (ptr() == t2.ptr()); }
|
||||
|
||||
/*! Operator!=. */
|
||||
inline bool operator!= (const Self& t2) const
|
||||
{
|
||||
return !(operator==(t2));
|
||||
}
|
||||
inline bool operator!=(const Self& t2) const { return !(operator==(t2)); }
|
||||
|
||||
//@}
|
||||
|
||||
|
||||
/// \name Access methods.
|
||||
//@{
|
||||
|
||||
inline Self& self()
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline const Self& self() const
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
inline Self& self() { return *this; }
|
||||
|
||||
inline const Self& self() const { return *this; }
|
||||
|
||||
/*! Access the trapezoid id (PTR). */
|
||||
inline unsigned long id() const
|
||||
{
|
||||
return (unsigned long) PTR;
|
||||
}
|
||||
inline unsigned long id() const { return (unsigned long) PTR; }
|
||||
|
||||
inline Vertex_const_handle vertex() const
|
||||
{
|
||||
return ptr()->v;
|
||||
}
|
||||
inline Vertex_const_handle vertex() const { return ptr()->v; }
|
||||
|
||||
Curve_end curve_end() const { return vtx_to_ce(vertex()); }
|
||||
|
||||
inline const Point& point() const { return vertex()->point(); }
|
||||
|
||||
/*! Access the first he starting at 12 o'clock clockwise.
|
||||
*/
|
||||
inline Halfedge_const_handle cw_he() const { return ptr()->cw_he; }
|
||||
|
||||
Curve_end curve_end() const
|
||||
{
|
||||
return vtx_to_ce(vertex());
|
||||
}
|
||||
|
||||
inline const Point& point() const
|
||||
{
|
||||
return vertex()->point();
|
||||
}
|
||||
|
||||
/*! Access the first he starting at 12 o'clock clockwise.
|
||||
*/
|
||||
inline Halfedge_const_handle cw_he () const
|
||||
{
|
||||
return ptr()->cw_he;
|
||||
}
|
||||
|
||||
/*! Access DAG node. */
|
||||
Dag_node* dag_node() const {return ptr()->p_node; }
|
||||
|
||||
|
||||
//@}
|
||||
|
||||
|
||||
|
||||
Dag_node* dag_node() const { return ptr()->p_node; }
|
||||
|
||||
//@}
|
||||
};
|
||||
|
||||
} //namespace CGAL
|
||||
|
||||
@@ -35,7 +35,7 @@ template < class Td_traits> class Trapezoidal_decomposition_2;
|
||||
|
||||
////MICHAL: not in use
|
||||
//template <class map_item>
|
||||
//struct Td_active_map_item : public CGAL::unary_function<map_item,bool>
|
||||
//struct Td_active_map_item : public CGAL::cpp98::unary_function<map_item,bool>
|
||||
//{
|
||||
// bool operator()(const map_item& item) const
|
||||
// {
|
||||
@@ -46,7 +46,7 @@ template < class Td_traits> class Trapezoidal_decomposition_2;
|
||||
////MICHAL: not in use
|
||||
//template <class X_trapezoid,class Traits>
|
||||
//struct Td_active_non_degenerate_trapezoid :
|
||||
//public CGAL::unary_function<X_trapezoid,bool>
|
||||
//public CGAL::cpp98::unary_function<X_trapezoid,bool>
|
||||
//{
|
||||
// Td_active_non_degenerate_trapezoid(Traits& t) : traits(t) {}
|
||||
// bool operator()(const X_trapezoid& tr) const
|
||||
@@ -59,7 +59,7 @@ template < class Td_traits> class Trapezoidal_decomposition_2;
|
||||
|
||||
template <class map_item,class Traits>
|
||||
struct Td_active_edge_item:
|
||||
public CGAL::unary_function<map_item,bool>
|
||||
public CGAL::cpp98::unary_function<map_item,bool>
|
||||
{
|
||||
Td_active_edge_item(const Traits& t) : traits(t) {}
|
||||
bool operator()(const map_item& item) const
|
||||
@@ -71,7 +71,7 @@ struct Td_active_edge_item:
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
struct Td_map_item_handle_less : public CGAL::binary_function<_Tp, _Tp, bool>
|
||||
struct Td_map_item_handle_less : public CGAL::cpp98::binary_function<_Tp, _Tp, bool>
|
||||
{
|
||||
bool operator()(const _Tp& __x, const _Tp& __y) const {
|
||||
return __x->id() < __y->id(); }
|
||||
|
||||
+49
-50
@@ -16,8 +16,9 @@
|
||||
// $Id$
|
||||
// SPDX-License-Identifier: GPL-3.0+
|
||||
//
|
||||
// Author(s) : Oren Nechushtan <theoren@math.tau.ac.il>
|
||||
// Iddo Hanniel <hanniel@math.tau.ac.il>
|
||||
// Author(s): Oren Nechushtan <theoren@math.tau.ac.il>
|
||||
// Iddo Hanniel <hanniel@math.tau.ac.il>
|
||||
// Efi Fogel <efifogel@gmail.com>
|
||||
|
||||
#ifndef CGAL_TRAPEZOIDAL_DECOMPOSITION_2_H
|
||||
#define CGAL_TRAPEZOIDAL_DECOMPOSITION_2_H
|
||||
@@ -29,6 +30,7 @@
|
||||
|
||||
#include <CGAL/Arr_tags.h>
|
||||
#include <CGAL/basic.h>
|
||||
#include <CGAL/algorithm.h>
|
||||
#include <CGAL/Arr_point_location/Td_predicates.h>
|
||||
#include <CGAL/Arr_point_location/Trapezoidal_decomposition_2_misc.h>
|
||||
|
||||
@@ -616,29 +618,36 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class set_cw_he_visitor : public boost::static_visitor<void>
|
||||
{
|
||||
/*! A visitor to set the cw halfedge of a vertex node.
|
||||
*/
|
||||
class set_cw_he_visitor : public boost::static_visitor<void> {
|
||||
public:
|
||||
set_cw_he_visitor (Halfedge_const_handle he) : m_cw_he(he) {}
|
||||
set_cw_he_visitor(Halfedge_const_handle he) : m_cw_he(he) {}
|
||||
|
||||
void operator()(Td_active_vertex& t) const { t.set_cw_he(m_cw_he); }
|
||||
|
||||
void operator()(Td_active_vertex& t) const
|
||||
{
|
||||
t.set_cw_he(m_cw_he);
|
||||
}
|
||||
void operator()(Td_active_fictitious_vertex& t) const
|
||||
{
|
||||
t.set_cw_he(m_cw_he);
|
||||
}
|
||||
{ t.set_cw_he(m_cw_he); }
|
||||
|
||||
template <typename T>
|
||||
void operator()(T& /*t*/) const { CGAL_assertion(false); }
|
||||
|
||||
template < typename T >
|
||||
void operator()(T& /*t*/) const
|
||||
{
|
||||
CGAL_assertion(false);
|
||||
}
|
||||
private:
|
||||
Halfedge_const_handle m_cw_he;
|
||||
};
|
||||
|
||||
/*! A visitor to reset the cw halfedge of a vertex node.
|
||||
*/
|
||||
class reset_cw_he_visitor : public boost::static_visitor<void> {
|
||||
public:
|
||||
void operator()(Td_active_vertex& t) const { t.reset_cw_he(); }
|
||||
|
||||
void operator()(Td_active_fictitious_vertex& t) const { t.reset_cw_he(); }
|
||||
|
||||
template <typename T>
|
||||
void operator()(T& /*t*/) const { CGAL_assertion(false); }
|
||||
};
|
||||
|
||||
class dag_node_visitor : public boost::static_visitor<Dag_node*>
|
||||
{
|
||||
public:
|
||||
@@ -1150,6 +1159,11 @@ protected:
|
||||
Halfedge_const_handle new_he,
|
||||
Td_map_item& vtx_item);
|
||||
|
||||
/*! Update the cw halfedge of an active vertex after a halfedge is removed.
|
||||
*/
|
||||
void update_vtx_cw_he_after_remove(Halfedge_const_handle old_he,
|
||||
Td_map_item& vtx_item);
|
||||
|
||||
////MICHAL: currently not in use since split is implemented as: remove and insert two
|
||||
//void set_trp_params_after_split_halfedge_update(Halfedge_const_handle new_he,
|
||||
// Td_map_item& vtx_item,
|
||||
@@ -1425,7 +1439,7 @@ public:
|
||||
start_over = false;
|
||||
|
||||
//random_shuffle the range
|
||||
std::random_shuffle(begin,end);
|
||||
CGAL::cpp98::random_shuffle(begin,end);
|
||||
|
||||
Halfedge_const_handle he_cst;
|
||||
Halfedge_iterator it = begin;
|
||||
@@ -1475,7 +1489,7 @@ public:
|
||||
// if(begin == end)
|
||||
// return;
|
||||
//
|
||||
// std::random_shuffle(begin,end);
|
||||
// CGAL::cpp98::random_shuffle(begin,end);
|
||||
//
|
||||
// curve_iterator it=begin,next=it;
|
||||
// while(it!=end)
|
||||
@@ -1757,22 +1771,20 @@ public:
|
||||
#endif
|
||||
|
||||
Halfedge_container container;
|
||||
|
||||
#ifdef CGAL_TD_DEBUG
|
||||
unsigned long rep = Halfedge_filter(container, &dag_root());
|
||||
#else
|
||||
Halfedge_filter(container, &dag_root());
|
||||
#endif
|
||||
|
||||
clear();
|
||||
|
||||
//// initialize container to point to curves in Td_map_item Tree
|
||||
//if (rep>0)
|
||||
//{
|
||||
//if (rep>0) {
|
||||
// bool o = set_with_guarantees(false);
|
||||
// typename std::vector<Halfedge_const_handle>::iterator
|
||||
// it = container.begin(),
|
||||
// it_end = container.end();
|
||||
// while(it!=it_end)
|
||||
// {
|
||||
// while (it != it_end) {
|
||||
// insert(*it);
|
||||
// ++it;
|
||||
// }
|
||||
@@ -1786,8 +1798,7 @@ public:
|
||||
#ifdef CGAL_TD_DEBUG
|
||||
CGAL_assertion(is_valid());
|
||||
unsigned long sz = number_of_curves();
|
||||
if (sz != rep)
|
||||
{
|
||||
if (sz != rep) {
|
||||
std::cerr << "\nnumber_of_curves()=" << sz;
|
||||
std::cerr << "\nrepresentatives.size()=" << rep;
|
||||
CGAL_assertion(number_of_curves() == rep);
|
||||
@@ -1831,47 +1842,38 @@ public:
|
||||
// return container.size();
|
||||
//}
|
||||
|
||||
/* Return a container for all active curves.
|
||||
*/
|
||||
template <typename Halfedge_container>
|
||||
unsigned long Halfedge_filter(Halfedge_container& container,
|
||||
const Dag_node* ds) const
|
||||
/* Return a container for all active curves */
|
||||
{
|
||||
unsigned long sz = number_of_curves();
|
||||
std::list<Td_map_item> representatives;
|
||||
//X_trapezoid_list representatives;
|
||||
ds->filter(representatives, Td_active_edge_item(*traits));
|
||||
|
||||
#ifndef CGAL_TD_DEBUG
|
||||
|
||||
CGAL_warning(sz==representatives.size());
|
||||
|
||||
CGAL_warning(sz == representatives.size());
|
||||
#else
|
||||
|
||||
unsigned long rep=representatives.size();
|
||||
if (sz != rep)
|
||||
{
|
||||
unsigned long rep = representatives.size();
|
||||
if (sz != rep) {
|
||||
std::cerr << "\nnumber_of_curves()=" << sz;
|
||||
std::cerr << "\nrepresentatives.size()=" << rep;
|
||||
CGAL_assertion(number_of_curves()==representatives.size());
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
if (sz > 0)
|
||||
{
|
||||
typename std::list<Td_map_item>::iterator it = representatives.begin(),
|
||||
it_end = representatives.end();
|
||||
//typename X_trapezoid_list::iterator it = representatives.begin(),
|
||||
// it_end = representatives.end();
|
||||
while(!(it==it_end))
|
||||
if (sz > 0) {
|
||||
for (typename std::list<Td_map_item>::iterator it =
|
||||
representatives.begin(); it != representatives.end(); ++it)
|
||||
{
|
||||
Td_active_edge e (boost::get<Td_active_edge>(*it));
|
||||
Td_active_edge e(boost::get<Td_active_edge>(*it));
|
||||
container.push_back(e.halfedge()); //it represents an active trapezoid
|
||||
++it;
|
||||
}
|
||||
}
|
||||
if(! container.empty()) {
|
||||
std::random_shuffle(container.begin(),container.end());
|
||||
if (! container.empty()) {
|
||||
CGAL::cpp98::random_shuffle(container.begin(),container.end());
|
||||
}
|
||||
return sz;
|
||||
}
|
||||
@@ -2009,7 +2011,6 @@ public:
|
||||
true, *m_dag_root, *m_dag_root);
|
||||
}
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
//Trapezoidal Decomposition data members
|
||||
@@ -2137,7 +2138,6 @@ private:
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
void print_cv_data(const X_monotone_curve_2& cv,
|
||||
std::ostream& out = std::cout) const
|
||||
{
|
||||
@@ -2205,7 +2205,6 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void print_dag_addresses(const Dag_node& curr) const
|
||||
{
|
||||
|
||||
|
||||
+723
-876
File diff suppressed because it is too large
Load Diff
@@ -163,6 +163,9 @@ public:
|
||||
/// \name Construction functors(based on the subcurve traits).
|
||||
//@{
|
||||
|
||||
#ifndef DOXYGEN_RUNNING
|
||||
class Push_back_2;
|
||||
#endif
|
||||
/*! \class
|
||||
* A functor that divides an arc into x-monotone arcs. That are, arcs that
|
||||
* do not cross the identification arc.
|
||||
|
||||
+9
-1
@@ -113,7 +113,11 @@ assign(const Self& arr)
|
||||
dup_c = m_curves_alloc.allocate (1);
|
||||
|
||||
p_cv = &(*ocit);
|
||||
m_curves_alloc.construct (dup_c, *p_cv);
|
||||
#ifdef CGAL_CXX11
|
||||
std::allocator_traits<Curves_alloc>::construct(m_curves_alloc, dup_c, *p_cv);
|
||||
#else
|
||||
m_curves_alloc.construct(dup_c, *p_cv);
|
||||
#endif
|
||||
m_curves.push_back (*dup_c);
|
||||
|
||||
// Assign a map entry.
|
||||
@@ -181,7 +185,11 @@ void Arrangement_on_surface_with_history_2<GeomTr,TopTr>::clear ()
|
||||
++cit;
|
||||
|
||||
m_curves.erase (p_cv);
|
||||
#ifdef CGAL_CXX11
|
||||
std::allocator_traits<Curves_alloc>::destroy(m_curves_alloc,p_cv);
|
||||
#else
|
||||
m_curves_alloc.destroy (p_cv);
|
||||
#endif
|
||||
m_curves_alloc.deallocate (p_cv, 1);
|
||||
}
|
||||
m_curves.destroy();
|
||||
|
||||
@@ -131,8 +131,12 @@ public:
|
||||
// and store it in the curves' list.
|
||||
typename Arrangement_with_history_2::Curve_halfedges *p_cv =
|
||||
p_arr->m_curves_alloc.allocate (1);
|
||||
|
||||
#ifdef CGAL_CXX11
|
||||
typedef decltype(p_arr->m_curves_alloc) M_Curves_alloc;
|
||||
std::allocator_traits<M_Curves_alloc>::construct(p_arr->m_curves_alloc, p_cv, cv);
|
||||
#else
|
||||
p_arr->m_curves_alloc.construct (p_cv, cv);
|
||||
#endif
|
||||
p_arr->m_curves.push_back (*p_cv);
|
||||
|
||||
// Return a handle to the inserted curve (the last in the list).
|
||||
|
||||
@@ -0,0 +1,539 @@
|
||||
// Copyright (c) 2005,2007,2009,2010,2011 Tel-Aviv University (Israel).
|
||||
// All rights reserved.
|
||||
//
|
||||
// This file is part of CGAL (www.cgal.org).
|
||||
// You can redistribute it and/or modify it under the terms of the GNU
|
||||
// General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
//
|
||||
// Licensees holding a valid commercial license may use this file in
|
||||
// accordance with the commercial license agreement provided with the software.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// $URL$
|
||||
// $Id$
|
||||
// SPDX-License-Identifier: GPL-3.0+
|
||||
//
|
||||
//
|
||||
// Author(s) : Ron Wein <wein@post.tau.ac.il>
|
||||
// Ophir Setter <ophirset@post.tau.ac.il>
|
||||
// Sebastien Loriot <sebastien.loriot@cgal.org>
|
||||
// Efi Fogel <efifogel@gmail.com>
|
||||
|
||||
// This file contains the follwoing three parts:
|
||||
// 1. The common base class template of the specialized
|
||||
// Dual<specialized-arrangement> class template.
|
||||
//
|
||||
// 2. The common base class template of the specialized
|
||||
// boost::graph_traits<Dual<specialized-arrangement> > class template.
|
||||
//
|
||||
// 3. Macro definitions of free Function templates required by
|
||||
// the various Boost Graph concepts. There is one macro per required function
|
||||
// template. Each macro accepts the name of a template class, an instance of
|
||||
// which represents an arrangement data structure, e.g., Arrangement_2. The
|
||||
// definitios of the free functions templates for a given arrangement data
|
||||
// strcture must be present when a dual of this data structure is defined.
|
||||
|
||||
#include <CGAL/license/Arrangement_on_surface_2.h>
|
||||
|
||||
#ifndef CGAL_GRAPH_TRAITS_DUAL_H
|
||||
#define CGAL_GRAPH_TRAITS_DUAL_H
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
// Forward declaration.
|
||||
template <class Type> class Dual;
|
||||
|
||||
/*! \class
|
||||
* Generic implementation of the common base class template of the specialized
|
||||
* Dual<specialized-arrangement> class template.
|
||||
*/
|
||||
template <typename Arrangement_>
|
||||
class Dual_arrangement_on_surface {
|
||||
public:
|
||||
typedef Arrangement_ Arrangement;
|
||||
typedef typename Arrangement::Geometry_traits_2 Geometry_traits_2;
|
||||
typedef typename Arrangement::Topology_traits Topology_traits;
|
||||
|
||||
typedef typename Arrangement::Size Size;
|
||||
typedef typename Arrangement::Face_handle Vertex_handle;
|
||||
typedef typename Arrangement::Halfedge_handle Edge_handle;
|
||||
|
||||
typedef typename Arrangement::Face_iterator Vertex_iterator;
|
||||
typedef typename Arrangement::Halfedge_iterator Edge_iterator;
|
||||
|
||||
protected:
|
||||
typedef typename Arrangement::Face_handle Face_handle;
|
||||
typedef typename Arrangement::Ccb_halfedge_circulator Ccb_halfedge_circulator;
|
||||
typedef typename Arrangement::Outer_ccb_iterator Outer_ccb_iterator;
|
||||
typedef typename Arrangement::Inner_ccb_iterator Inner_ccb_iterator;
|
||||
|
||||
/*! \class
|
||||
* Iterator over the neighbors of a dual vertex (a face in the primal
|
||||
* arrangement).
|
||||
* These neighbors are the adjacent faces along the outer boundaries of the
|
||||
* face and its inner boundaries.
|
||||
*/
|
||||
class Face_neighbor_iterator {
|
||||
typedef Face_neighbor_iterator Self;
|
||||
|
||||
public:
|
||||
typedef std::forward_iterator_tag iterator_category;
|
||||
typedef Edge_handle value_type;
|
||||
typedef value_type reference;
|
||||
typedef value_type* pointer;
|
||||
typedef int difference_type;
|
||||
|
||||
private:
|
||||
Outer_ccb_iterator _outer_ccb_iter;
|
||||
Inner_ccb_iterator _inner_ccb_iter;
|
||||
Ccb_halfedge_circulator _ccb_curr;
|
||||
Ccb_halfedge_circulator _ccb_first;
|
||||
Face_handle _face;
|
||||
bool _out;
|
||||
Edge_handle _hh;
|
||||
bool _end;
|
||||
|
||||
public:
|
||||
/*! Default constructor. */
|
||||
Face_neighbor_iterator() : _end (true) {}
|
||||
|
||||
/*! Constructor.
|
||||
* \param face The face (dual vertex).
|
||||
* \param out_edges Do we need the outgoing or the ingoing halfedges.
|
||||
* \param start Should we start traversing the edges.
|
||||
* If false, we construct a past-the-end iterator.
|
||||
*/
|
||||
Face_neighbor_iterator(Face_handle face, bool out_edges, bool start) :
|
||||
_face(face),
|
||||
_out(out_edges),
|
||||
_end(! start)
|
||||
{
|
||||
CGAL_precondition(! face->is_fictitious());
|
||||
|
||||
if (start) {
|
||||
_outer_ccb_iter = _face->outer_ccbs_begin();
|
||||
_inner_ccb_iter = _face->inner_ccbs_begin();
|
||||
|
||||
if (_outer_ccb_iter != _face->outer_ccbs_end()) {
|
||||
// Start from the first outer CCB, if one exists.
|
||||
_ccb_curr = _ccb_first = *_outer_ccb_iter;
|
||||
}
|
||||
else if (_inner_ccb_iter != face->inner_ccbs_end()) {
|
||||
// Otherwise, start from the first inner CCB.
|
||||
_ccb_curr = _ccb_first = *_inner_ccb_iter;
|
||||
}
|
||||
else {
|
||||
// In this case there are no CCBs to traverse:
|
||||
_end = true;
|
||||
return;
|
||||
}
|
||||
|
||||
_hh = this->_dereference();
|
||||
|
||||
// In case the incident face of the twin halfedge is fictitious,
|
||||
// skip it and proceed to the next edge.
|
||||
if (_hh->is_fictitious()) ++(*this);
|
||||
}
|
||||
else { // end iterator.
|
||||
_outer_ccb_iter = _face->outer_ccbs_end();
|
||||
_inner_ccb_iter = _face->inner_ccbs_end();
|
||||
}
|
||||
}
|
||||
|
||||
/*! Equality operators. */
|
||||
bool operator==(const Self& it) const { return (this->_equal(it)); }
|
||||
|
||||
bool operator!= (const Self& it) const { return (! this->_equal(it)); }
|
||||
|
||||
/*! Dereference operators. */
|
||||
reference operator*() const { return (_hh); }
|
||||
|
||||
pointer operator->() const { return (&_hh); }
|
||||
|
||||
/* Increment operators. */
|
||||
Self& operator++()
|
||||
{
|
||||
do {
|
||||
this->_increment();
|
||||
if (_end) return (*this);
|
||||
_hh = this->_dereference();
|
||||
} while (_hh->is_fictitious());
|
||||
return (*this);
|
||||
}
|
||||
|
||||
Self operator++(int )
|
||||
{
|
||||
Self tmp = *this;
|
||||
do {
|
||||
this->_increment();
|
||||
if (_end) return (tmp);
|
||||
_hh = this->_dereference();
|
||||
} while (_hh->is_fictitious());
|
||||
return (tmp);
|
||||
}
|
||||
|
||||
private:
|
||||
/*! Check two iterators for equality. */
|
||||
bool _equal(const Self& it) const
|
||||
{
|
||||
return (_out == it._out && _face == it._face && ((_end && it._end) ||
|
||||
(_outer_ccb_iter == it._outer_ccb_iter &&
|
||||
_inner_ccb_iter == it._inner_ccb_iter &&
|
||||
_ccb_curr == it._ccb_curr)));
|
||||
}
|
||||
|
||||
/*! Derefernce the current circulator. */
|
||||
Edge_handle _dereference() const
|
||||
{
|
||||
if (_out) return (_ccb_curr);
|
||||
else return (_ccb_curr->twin());
|
||||
}
|
||||
|
||||
// Increments of the iterator.
|
||||
void _increment()
|
||||
{
|
||||
CGAL_assertion(! _end);
|
||||
|
||||
// If we have not traversed the entire CCB in full, move to the next
|
||||
// halfedge along the current CCB.
|
||||
++_ccb_curr;
|
||||
|
||||
if (_ccb_curr != _ccb_first) return;
|
||||
|
||||
// In this case we have completed the current CCB and we have to move
|
||||
// to the next one.
|
||||
if (_outer_ccb_iter != _face->outer_ccbs_end()) {
|
||||
// Try to move to the next outer CCB.
|
||||
++_outer_ccb_iter;
|
||||
if (_outer_ccb_iter != _face->outer_ccbs_end()) {
|
||||
_ccb_curr = _ccb_first = *_outer_ccb_iter;
|
||||
return;
|
||||
}
|
||||
|
||||
// In this case we start traversing the inner CCBs.
|
||||
if (_inner_ccb_iter != _face->inner_ccbs_end()) {
|
||||
CGAL_assertion (_inner_ccb_iter == _face->inner_ccbs_begin());
|
||||
|
||||
// Otherwise, start from the first inner CCB.
|
||||
_ccb_curr = _ccb_first = *_inner_ccb_iter;
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (_inner_ccb_iter != _face->inner_ccbs_end()) {
|
||||
|
||||
// In this case we have already traversed all outer CCBs (and at least
|
||||
// one inner CCB), so we try to move to the next inner CCB.
|
||||
++_inner_ccb_iter;
|
||||
if (_inner_ccb_iter != _face->inner_ccbs_end()) {
|
||||
// Otherwise, start from the first inner CCB.
|
||||
_ccb_curr = _ccb_first = *_inner_ccb_iter;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// In this case we finished traversing all outer and inner CCBs:
|
||||
_end = true;
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
// Data members:
|
||||
mutable Arrangement* p_arr; // The primal arrangement.
|
||||
|
||||
public:
|
||||
typedef Face_neighbor_iterator Incident_edge_iterator;
|
||||
|
||||
/*! Default constructor. */
|
||||
Dual_arrangement_on_surface() : p_arr(NULL) {}
|
||||
|
||||
/*! Constructor from an arrangement. */
|
||||
Dual_arrangement_on_surface(const Arrangement& arr) :
|
||||
p_arr(const_cast<Arrangement*>(&arr))
|
||||
{}
|
||||
|
||||
/*! Obtain the primal arrangement (const version). */
|
||||
const Arrangement* arrangement() const { return (p_arr); }
|
||||
|
||||
/*! Obtain the primal arrangement (non-const version). */
|
||||
Arrangement* arrangement() { return (p_arr); }
|
||||
|
||||
/*! Obtain the number of vertices (face of the primal arrangement). */
|
||||
Size number_of_vertices() const { return (p_arr->number_of_faces()); }
|
||||
|
||||
/*! Obtain the begin iterator of the vertices of the dual arrangement
|
||||
* (faces of the primal arrangement).
|
||||
*/
|
||||
Vertex_iterator vertices_begin() const { return (p_arr->faces_begin()); }
|
||||
|
||||
/*! Obtain the pass-the-end iterator of the vertices of the dual arrangement
|
||||
* (faces of the primal arrangement).
|
||||
*/
|
||||
Vertex_iterator vertices_end() const { return (p_arr->faces_end()); }
|
||||
|
||||
/*! Obtain the number of edges. */
|
||||
Size number_of_edges () const { return (p_arr->number_of_halfedges()); }
|
||||
|
||||
/*! Obtain the begin iterator of the edges of the dual arrangement. */
|
||||
Edge_iterator edges_begin() const { return (p_arr->halfedges_begin()); }
|
||||
|
||||
/*! Obtain the pass-the-end iterator of the edges of the dual arrangement. */
|
||||
Edge_iterator edges_end() const { return (p_arr->halfedges_end()); }
|
||||
|
||||
/*! Obtain the dual vertex-degree (number of edges forming the face boundary).
|
||||
*/
|
||||
Size degree(Vertex_handle v) const
|
||||
{
|
||||
Incident_edge_iterator begin = Incident_edge_iterator(v, true, true);
|
||||
Incident_edge_iterator end = Incident_edge_iterator(v, false, true);
|
||||
Size deg = 0;
|
||||
|
||||
while (begin != end) {
|
||||
deg++;
|
||||
++begin;
|
||||
}
|
||||
|
||||
return (deg);
|
||||
}
|
||||
|
||||
/*! Traverse the outgoing edges of a given vertex. */
|
||||
Incident_edge_iterator out_edges_begin(Vertex_handle v) const
|
||||
{ return (Incident_edge_iterator (v, true, true)); }
|
||||
|
||||
Incident_edge_iterator out_edges_end(Vertex_handle v) const
|
||||
{ return (Incident_edge_iterator (v, true, false)); }
|
||||
|
||||
/*! Traverse the ingoing edges of a given vertex. */
|
||||
Incident_edge_iterator in_edges_begin(Vertex_handle v) const
|
||||
{ return (Incident_edge_iterator (v, false, true)); }
|
||||
|
||||
Incident_edge_iterator in_edges_end(Vertex_handle v) const
|
||||
{ return (Incident_edge_iterator (v, false, false)); }
|
||||
};
|
||||
|
||||
} //namespace CGAL
|
||||
|
||||
#include <boost/graph/graph_concepts.hpp>
|
||||
#include <CGAL/boost/iterator/counting_iterator.hpp>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
/*! \class
|
||||
* The common base class template of the specialized
|
||||
* boost::graph_traits<Dual<specialized-arrangement> > class template.
|
||||
* The latter serves as a dual adapter for the specialied arrangment, where the
|
||||
* valid arrangement faces correspond to graph verices, and two graph vertices
|
||||
* are connected if the two corrsponding faces are adjacent.
|
||||
* We consider the graph as directed. We also allow parallel edges, as two
|
||||
* faces may have more than one common edges.
|
||||
*/
|
||||
template <typename Arrangement_>
|
||||
class Graph_traits_dual_arr_on_surface_impl {
|
||||
public:
|
||||
typedef Arrangement_ Arrangement;
|
||||
typedef typename Arrangement::Geometry_traits_2 Geometry_traits_2;
|
||||
typedef typename Arrangement::Topology_traits Topology_traits;
|
||||
typedef Dual_arrangement_on_surface<Arrangement> Dual_arr_2;
|
||||
|
||||
private:
|
||||
typedef typename Dual_arr_2::Vertex_iterator Vertex_iterator;
|
||||
typedef typename Dual_arr_2::Edge_iterator Edge_iterator;
|
||||
typedef typename Dual_arr_2::Incident_edge_iterator Incident_edge_iterator;
|
||||
|
||||
/*! \struct
|
||||
* Define the arrangement traversal category, which indicates the arrangement
|
||||
* models the BidirectionalGraph concept and the VertexListGraph and
|
||||
* EdgeListGraph concepts.
|
||||
*/
|
||||
struct Dual_arr_traversal_category :
|
||||
public virtual boost::bidirectional_graph_tag, // This tag refines the
|
||||
// incidence_graph_tag.
|
||||
public virtual boost::vertex_list_graph_tag, // Can iterate over vertices.
|
||||
public virtual boost::edge_list_graph_tag // Can iterate over edges.
|
||||
{};
|
||||
|
||||
public:
|
||||
// Types required of the Graph concept:
|
||||
typedef typename Dual_arr_2::Vertex_handle vertex_descriptor;
|
||||
typedef boost::directed_tag directed_category;
|
||||
typedef boost::allow_parallel_edge_tag edge_parallel_category;
|
||||
|
||||
typedef Dual_arr_traversal_category traversal_category;
|
||||
|
||||
// Types required by the IncidenceGraph concept:
|
||||
typedef typename Dual_arr_2::Edge_handle edge_descriptor;
|
||||
typedef Incident_edge_iterator out_edge_iterator;
|
||||
typedef typename Dual_arr_2::Size degree_size_type;
|
||||
|
||||
// Types required by the BidirectionalGraph concept:
|
||||
typedef Incident_edge_iterator in_edge_iterator;
|
||||
|
||||
// Types required by the VertexListGraph concept:
|
||||
typedef boost::counting_iterator<Vertex_iterator> vertex_iterator;
|
||||
typedef typename Dual_arr_2::Size vertices_size_type;
|
||||
|
||||
// Types required by the EdgeListGraph concept:
|
||||
typedef boost::counting_iterator<Edge_iterator> edge_iterator;
|
||||
typedef typename Dual_arr_2::Size edges_size_type;
|
||||
|
||||
// Types not required by any of these concepts:
|
||||
typedef void adjacency_iterator;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
// Macro definitions of free Function templates required by the various Boost
|
||||
// Graph concepts. Each macro provides the required free function template with
|
||||
// the specific interface and its implementation.
|
||||
// We use macros (and not base functions similar to
|
||||
// Graph_traits_dual_arr_on_surface_impl) for simplicity. The implementation
|
||||
// is typically a one-liner. However, the interface is typically several lines
|
||||
// of code. The alternative implementation (with base common functions) while
|
||||
// being more safe (provided tight type checking) would consume many repeated
|
||||
// lines of code.
|
||||
|
||||
// Functions required by the IncidenceGraph concept:
|
||||
// -------------------------------------------------
|
||||
|
||||
/*! Obtain the out-degree of a vertex in a given dual arrangement.
|
||||
* \param v The vertex.
|
||||
* \param darr The dual arrangement.
|
||||
* \param Number of halfedges around the boundary of the primal face.
|
||||
*/
|
||||
#define CGAL_DUAL_ARRANGEMENT_2_OUT_DEGREE(T) \
|
||||
template <typename T1, typename T2> \
|
||||
typename boost::graph_traits<Dual<T<T1, T2> > >::degree_size_type \
|
||||
out_degree(typename boost::graph_traits<Dual<T<T1, T2> > >::vertex_descriptor v,\
|
||||
const Dual<T<T1, T2> >& darr) \
|
||||
{ return darr.degree(v); }
|
||||
|
||||
/*! Return a range of the out-edges of a vertex given by its descriptor and the
|
||||
* dual arrangement it belongs to.
|
||||
* \param v The vertex.
|
||||
* \param darr The dual arrangement.
|
||||
* \return A pair of out-edges iterators.
|
||||
*/
|
||||
#define CGAL_DUAL_ARRANGEMENT_2_OUT_EDGES(T) \
|
||||
template <typename T1, typename T2> \
|
||||
std::pair<typename boost::graph_traits<Dual<T<T1, T2> > >::out_edge_iterator, \
|
||||
typename boost::graph_traits<Dual<T<T1, T2> > >::out_edge_iterator> \
|
||||
out_edges(typename boost::graph_traits<Dual<T<T1, T2> > >::vertex_descriptor v,\
|
||||
const Dual<T<T1, T2> >& darr) \
|
||||
{ return std::make_pair(darr.out_edges_begin(v), darr.out_edges_end(v)); } \
|
||||
|
||||
/*! Obtain the source vertex of a dual arrangement edge.
|
||||
* \param e The edge.
|
||||
* \param darr The dual arrangement.
|
||||
* \return The incident face of e in the primal arrangement.
|
||||
*/
|
||||
#define CGAL_DUAL_ARRANGEMENT_2_SOURCE(T) \
|
||||
template <typename T1, typename T2> \
|
||||
typename boost::graph_traits<Dual<T<T1, T2> > >::vertex_descriptor \
|
||||
source(typename boost::graph_traits<Dual<T<T1, T2> > >::edge_descriptor e, \
|
||||
const Dual<T<T1, T2> >& /* darr */) \
|
||||
{ return e->face(); }
|
||||
|
||||
/*! Obtain the target vertex of a dual arrangement edge.
|
||||
* \param e The edge.
|
||||
* \param darr The dual arrangement.
|
||||
* \return The incident face of the twin of e in the primal arrangement.
|
||||
*/
|
||||
#define CGAL_DUAL_ARRANGEMENT_2_TARGET(T) \
|
||||
template <typename T1, typename T2> \
|
||||
typename boost::graph_traits<Dual<T<T1, T2> > >::vertex_descriptor \
|
||||
target(typename boost::graph_traits<Dual<T<T1, T2> > >::edge_descriptor e, \
|
||||
const Dual<T<T1, T2> >& /* darr */) \
|
||||
{ return e->twin()->face(); }
|
||||
|
||||
// Functions required by the BidirectionalGraph concept:
|
||||
// -----------------------------------------------------
|
||||
|
||||
/*! Obtain the in-degree of a vertex in a given dual arrangement.
|
||||
* \param v The vertex.
|
||||
* \param darr The dual arrangement.
|
||||
* \param Number of halfedges around the boundary of the primal face.
|
||||
*/
|
||||
#define CGAL_DUAL_ARRANGEMENT_2_IN_DEGREE(T) \
|
||||
template <typename T1, typename T2> \
|
||||
typename boost::graph_traits<Dual<T<T1, T2> > >::degree_size_type \
|
||||
in_degree(typename boost::graph_traits<Dual<T<T1, T2> > >::vertex_descriptor v,\
|
||||
const Dual<T<T1, T2> >& darr) \
|
||||
{ return darr.degree(v); }
|
||||
|
||||
/*! Return a range of the in-edges of a vertex given by its descriptor and the
|
||||
* dual arrangement it belongs to.
|
||||
* \param v The vertex.
|
||||
* \param darr The dual arrangement.
|
||||
* \return A pair of in-edges iterators.
|
||||
*/
|
||||
#define CGAL_DUAL_ARRANGEMENT_2_IN_EDGES(T) \
|
||||
template <typename T1, typename T2> \
|
||||
std::pair<typename boost::graph_traits<Dual<T<T1, T2> > >::in_edge_iterator, \
|
||||
typename boost::graph_traits<Dual<T<T1, T2> > >::in_edge_iterator> \
|
||||
in_edges(typename boost::graph_traits<Dual<T<T1, T2> > >::vertex_descriptor v,\
|
||||
const Dual<T<T1, T2> >& darr) \
|
||||
{ return std::make_pair(darr.in_edges_begin(v), darr.in_edges_end(v)); }
|
||||
|
||||
/*! Obtain the degree of a vertex in a given dual arrangement.
|
||||
* \param v The vertex.
|
||||
* \param darr The dual arrangement.
|
||||
* \param Number of ingoing and outgoing halfedges incident to v.
|
||||
*/
|
||||
#define CGAL_DUAL_ARRANGEMENT_2_DEGREE(T) \
|
||||
template <typename T1, typename T2> \
|
||||
typename boost::graph_traits<Dual<T<T1, T2> > >::degree_size_type \
|
||||
degree(typename boost::graph_traits<Dual<T<T1, T2> > >::vertex_descriptor v, \
|
||||
const Dual<T<T1, T2> >& darr) \
|
||||
{ return (2 * darr.degree(v)); }
|
||||
|
||||
// Functions required by the VertexListGraph concept:
|
||||
// --------------------------------------------------
|
||||
|
||||
/*! Obtain the number of vertices in the given dual arrangement.
|
||||
* \param darr The dual arrangement.
|
||||
* \return Number of faces in the primal arrangement.
|
||||
*/
|
||||
#define CGAL_DUAL_ARRANGEMENT_2_NUM_VERTICES(T) \
|
||||
template <typename T1, typename T2> \
|
||||
typename boost::graph_traits<Dual<T<T1, T2> > >::vertices_size_type \
|
||||
num_vertices(const Dual<T<T1, T2> >& darr) \
|
||||
{ return darr.number_of_vertices(); }
|
||||
|
||||
/*! Obtain the range of vertices of the given dual arrangement.
|
||||
* \param darr The dual arrangement.
|
||||
* \return A pair of vertex iterators.
|
||||
*/
|
||||
#define CGAL_DUAL_ARRANGEMENT_2_VERTICES(T) \
|
||||
template <typename T1, typename T2> \
|
||||
std::pair<typename boost::graph_traits<Dual<T<T1, T2> > >::vertex_iterator, \
|
||||
typename boost::graph_traits<Dual<T<T1, T2> > >::vertex_iterator> \
|
||||
vertices(const Dual<T<T1, T2> >& darr) \
|
||||
{ return std::make_pair(darr.vertices_begin(), darr.vertices_end()); }
|
||||
|
||||
// Functions required by the EdgeListGraph concept:
|
||||
// ------------------------------------------------
|
||||
|
||||
/*! Obtain the number of edges in the given dual arrangement.
|
||||
* \param darr The dual arrangement.
|
||||
* \return Number of halfedges in the primal arrangement.
|
||||
*/
|
||||
#define CGAL_DUAL_ARRANGEMENT_2_NUM_EDGES(T) \
|
||||
template <typename T1, typename T2> \
|
||||
typename boost::graph_traits<Dual<T<T1, T2> > >::edges_size_type \
|
||||
num_edges(const Dual<T<T1, T2> >& darr) \
|
||||
{ return darr.number_of_edges(); }
|
||||
|
||||
/*! Obtain the range of edges of the given dual arrangement.
|
||||
* \param darr The dual arrangement.
|
||||
* \return A pair of edge iterators.
|
||||
*/
|
||||
#define CGAL_DUAL_ARRANGEMENT_2_EDGES(T) \
|
||||
template <typename T1, typename T2> \
|
||||
std::pair<typename boost::graph_traits<Dual<T<T1, T2> > >::edge_iterator, \
|
||||
typename boost::graph_traits<Dual<T<T1, T2> > >::edge_iterator> \
|
||||
edges(const Dual<T<T1, T2> >& darr) \
|
||||
{ return std::make_pair(darr.edges_begin(), darr.edges_end()); }
|
||||
|
||||
#endif
|
||||
@@ -1556,8 +1556,11 @@ protected:
|
||||
Point_2*_new_point(const Point_2& pt)
|
||||
{
|
||||
Point_2* p_pt = m_points_alloc.allocate(1);
|
||||
|
||||
#ifdef CGAL_CXX11
|
||||
std::allocator_traits<Points_alloc>::construct(m_points_alloc, p_pt, pt);
|
||||
#else
|
||||
m_points_alloc.construct(p_pt, pt);
|
||||
#endif
|
||||
return (p_pt);
|
||||
}
|
||||
|
||||
@@ -1565,8 +1568,11 @@ protected:
|
||||
void _delete_point(Point_2& pt)
|
||||
{
|
||||
Point_2* p_pt = &pt;
|
||||
|
||||
#ifdef CGAL_CXX11
|
||||
std::allocator_traits<Points_alloc>::destroy(m_points_alloc, p_pt);
|
||||
#else
|
||||
m_points_alloc.destroy(p_pt);
|
||||
#endif
|
||||
m_points_alloc.deallocate(p_pt, 1);
|
||||
}
|
||||
|
||||
@@ -1574,7 +1580,11 @@ protected:
|
||||
X_monotone_curve_2* _new_curve(const X_monotone_curve_2& cv)
|
||||
{
|
||||
X_monotone_curve_2* p_cv = m_curves_alloc.allocate(1);
|
||||
#ifdef CGAL_CXX11
|
||||
std::allocator_traits<Curves_alloc>::construct(m_curves_alloc, p_cv, cv);
|
||||
#else
|
||||
m_curves_alloc.construct(p_cv, cv);
|
||||
#endif
|
||||
return (p_cv);
|
||||
}
|
||||
|
||||
@@ -1582,8 +1592,11 @@ protected:
|
||||
void _delete_curve(X_monotone_curve_2& cv)
|
||||
{
|
||||
X_monotone_curve_2* p_cv = &cv;
|
||||
|
||||
#ifdef CGAL_CXX11
|
||||
std::allocator_traits<Curves_alloc>::destroy(m_curves_alloc, p_cv);
|
||||
#else
|
||||
m_curves_alloc.destroy(p_cv);
|
||||
#endif
|
||||
m_curves_alloc.deallocate(p_cv, 1);
|
||||
}
|
||||
//@}
|
||||
|
||||
@@ -623,8 +623,11 @@ protected:
|
||||
// Allocate an extended curve (with an initially empty set of edges)
|
||||
// and store it in the curves' list.
|
||||
Curve_halfedges *p_cv = m_curves_alloc.allocate (1);
|
||||
|
||||
#ifdef CGAL_CXX11
|
||||
std::allocator_traits<Curves_alloc>::construct(m_curves_alloc, p_cv, cv);
|
||||
#else
|
||||
m_curves_alloc.construct (p_cv, cv);
|
||||
#endif
|
||||
m_curves.push_back (*p_cv);
|
||||
|
||||
// Create a data-traits Curve_2 object, which is comprised of cv and
|
||||
@@ -653,7 +656,11 @@ protected:
|
||||
// and store it in the curves' list.
|
||||
Curve_halfedges *p_cv = m_curves_alloc.allocate (1);
|
||||
|
||||
#ifdef CGAL_CXX11
|
||||
std::allocator_traits<Curves_alloc>::construct(m_curves_alloc, p_cv, cv);
|
||||
#else
|
||||
m_curves_alloc.construct (p_cv, cv);
|
||||
#endif
|
||||
m_curves.push_back (*p_cv);
|
||||
|
||||
// Create a data-traits Curve_2 object, which is comprised of cv and
|
||||
@@ -684,7 +691,11 @@ protected:
|
||||
while (begin != end) {
|
||||
Curve_halfedges *p_cv = m_curves_alloc.allocate (1);
|
||||
|
||||
#ifdef CGAL_CXX11
|
||||
std::allocator_traits<Curves_alloc>::construct(m_curves_alloc, p_cv, *begin);
|
||||
#else
|
||||
m_curves_alloc.construct (p_cv, *begin);
|
||||
#endif
|
||||
m_curves.push_back (*p_cv);
|
||||
|
||||
data_curves.push_back (Data_curve_2 (*begin, p_cv));
|
||||
@@ -732,7 +743,12 @@ protected:
|
||||
|
||||
// Remove the extended curve object from the list and de-allocate it.
|
||||
m_curves.erase (p_cv);
|
||||
|
||||
#ifdef CGAL_CXX11
|
||||
std::allocator_traits<Curves_alloc>::destroy(m_curves_alloc, p_cv);
|
||||
#else
|
||||
m_curves_alloc.destroy (p_cv);
|
||||
#endif
|
||||
m_curves_alloc.deallocate (p_cv, 1);
|
||||
|
||||
return (n_removed);
|
||||
@@ -794,7 +810,12 @@ public:
|
||||
dup_c = m_curves_alloc.allocate (1);
|
||||
|
||||
p_cv = &(*ocit1);
|
||||
|
||||
#ifdef CGAL_CXX11
|
||||
std::allocator_traits<Curves_alloc>::construct(m_curves_alloc, dup_c, *p_cv);
|
||||
#else
|
||||
m_curves_alloc.construct (dup_c, *p_cv);
|
||||
#endif
|
||||
m_curves.push_back (*dup_c);
|
||||
|
||||
// Assign a map entry.
|
||||
@@ -809,7 +830,11 @@ public:
|
||||
dup_c = m_curves_alloc.allocate (1);
|
||||
|
||||
p_cv = &(*ocit2);
|
||||
#ifdef CGAL_CXX11
|
||||
std::allocator_traits<Curves_alloc>::construct(m_curves_alloc, dup_c, *p_cv);
|
||||
#else
|
||||
m_curves_alloc.construct (dup_c, *p_cv);
|
||||
#endif
|
||||
m_curves.push_back (*dup_c);
|
||||
|
||||
// Assign a map entry.
|
||||
|
||||
@@ -2857,7 +2857,6 @@ protected:
|
||||
// run over all event points within the joint x-range of two arcs
|
||||
// looking whether a particular event is made of both curves, i.e.,
|
||||
// grabbing all 2-curve events
|
||||
std::pair<int, int> ipair;
|
||||
int arcno1, arcno2, mult;
|
||||
|
||||
typename CGAL::Polynomial_traits_d<
|
||||
|
||||
+4
-4
@@ -1432,7 +1432,7 @@ public:
|
||||
CGAL_CKvA_2_GRAB_BASE_FUNCTOR_TYPES
|
||||
|
||||
//! the result type
|
||||
typedef CGAL::iterator< std::output_iterator_tag, CGAL::Object >
|
||||
typedef CGAL::cpp98::iterator< std::output_iterator_tag, CGAL::Object >
|
||||
result_type;
|
||||
|
||||
//! the arity of the functor
|
||||
@@ -1888,7 +1888,7 @@ public:
|
||||
CGAL_CKvA_2_GRAB_BASE_FUNCTOR_TYPES
|
||||
|
||||
//! the result type
|
||||
typedef CGAL::iterator< std::output_iterator_tag, CGAL::Object >
|
||||
typedef CGAL::cpp98::iterator< std::output_iterator_tag, CGAL::Object >
|
||||
result_type;
|
||||
|
||||
//! the arity of the functor
|
||||
@@ -2511,7 +2511,7 @@ public:
|
||||
typedef typename Curve_analysis_2::Coordinate_2 Coordinate_2;
|
||||
|
||||
//! the result type
|
||||
typedef CGAL::iterator< std::output_iterator_tag, Coordinate_2 >
|
||||
typedef CGAL::cpp98::iterator< std::output_iterator_tag, Coordinate_2 >
|
||||
result_type;
|
||||
|
||||
//! the arity of the functor
|
||||
@@ -2576,7 +2576,7 @@ public:
|
||||
typedef typename Curve_analysis_2::Coordinate_2 Coordinate_2;
|
||||
|
||||
//! the result type
|
||||
typedef CGAL::iterator< std::output_iterator_tag, Coordinate_2 >
|
||||
typedef CGAL::cpp98::iterator< std::output_iterator_tag, Coordinate_2 >
|
||||
result_type;
|
||||
|
||||
//! the arity of the functor
|
||||
|
||||
+3
-3
@@ -57,9 +57,9 @@ template < class CurvedKernelViaAnalysis_2,
|
||||
class ConstructArc_2 =
|
||||
typename CurvedKernelViaAnalysis_2::Construct_arc_2 >
|
||||
struct Make_x_monotone_2 :
|
||||
public CGAL::binary_function< typename CurvedKernelViaAnalysis_2::Curve_2,
|
||||
CGAL::iterator<std::output_iterator_tag, CGAL::Object>,
|
||||
CGAL::iterator<std::output_iterator_tag, CGAL::Object> > {
|
||||
public CGAL::cpp98::binary_function< typename CurvedKernelViaAnalysis_2::Curve_2,
|
||||
CGAL::cpp98::iterator<std::output_iterator_tag, CGAL::Object>,
|
||||
CGAL::cpp98::iterator<std::output_iterator_tag, CGAL::Object> > {
|
||||
|
||||
//!\name Public types
|
||||
//!@{
|
||||
|
||||
+1
-1
@@ -693,7 +693,7 @@ class Make_x_monotone_2
|
||||
typedef typename SweepCurvesAdapter_2::Generic_arc_2 Generic_arc_2;
|
||||
|
||||
public:
|
||||
typedef CGAL::iterator<std::output_iterator_tag, Generic_arc_2>
|
||||
typedef CGAL::cpp98::iterator<std::output_iterator_tag, Generic_arc_2>
|
||||
result_type;
|
||||
|
||||
//! standard constructor
|
||||
|
||||
+14
-14
@@ -1041,7 +1041,7 @@ public:
|
||||
|
||||
//! \brief constructs \c Curve_analysis_2 object, uses caching if appropriate
|
||||
struct Construct_curve_2 :
|
||||
public CGAL::unary_function< Polynomial_2, Curve_analysis_2 >
|
||||
public CGAL::cpp98::unary_function< Polynomial_2, Curve_analysis_2 >
|
||||
{
|
||||
//! \brief constructs an object from \c Algebraic_curve_kernel_2 type
|
||||
//! no default constructor provided
|
||||
@@ -1060,7 +1060,7 @@ public:
|
||||
* caching is used when appropriate
|
||||
*/
|
||||
struct Construct_curve_pair_2 :
|
||||
public CGAL::binary_function<Curve_analysis_2, Curve_analysis_2,
|
||||
public CGAL::cpp98::binary_function<Curve_analysis_2, Curve_analysis_2,
|
||||
Curve_pair_analysis_2> {
|
||||
|
||||
Curve_pair_analysis_2 operator()
|
||||
@@ -1078,7 +1078,7 @@ public:
|
||||
|
||||
//! returns the first coordinate of \c Xy_coordinate_2
|
||||
struct Get_x_2 :
|
||||
public CGAL::unary_function<Xy_coordinate_2, Algebraic_real_1> {
|
||||
public CGAL::cpp98::unary_function<Xy_coordinate_2, Algebraic_real_1> {
|
||||
|
||||
Algebraic_real_1 operator()(const Xy_coordinate_2& xy) const {
|
||||
return xy.x();
|
||||
@@ -1088,7 +1088,7 @@ public:
|
||||
|
||||
//! returns the second coordinate of \c Xy_coordinate_2
|
||||
struct Get_y_2 :
|
||||
public CGAL::unary_function<Xy_coordinate_2, Algebraic_real_1> {
|
||||
public CGAL::cpp98::unary_function<Xy_coordinate_2, Algebraic_real_1> {
|
||||
|
||||
Algebraic_real_1 operator()(const Xy_coordinate_2& xy) const {
|
||||
return xy.y();
|
||||
@@ -1097,7 +1097,7 @@ public:
|
||||
CGAL_Algebraic_Kernel_cons(Get_y_2, Get_y_2_object);
|
||||
|
||||
struct Refine_x_2 :
|
||||
public CGAL::unary_function<Xy_coordinate_2, void> {
|
||||
public CGAL::cpp98::unary_function<Xy_coordinate_2, void> {
|
||||
|
||||
void operator()(const Xy_coordinate_2& r) const { }
|
||||
|
||||
@@ -1106,7 +1106,7 @@ public:
|
||||
CGAL_Algebraic_Kernel_pred(Refine_x_2, refine_x_2_object);
|
||||
|
||||
struct Refine_y_2 :
|
||||
public CGAL::unary_function<Xy_coordinate_2, void> {
|
||||
public CGAL::cpp98::unary_function<Xy_coordinate_2, void> {
|
||||
|
||||
void operator()(const Xy_coordinate_2& r) const { }
|
||||
|
||||
@@ -1196,7 +1196,7 @@ public:
|
||||
|
||||
//! \brief comparison of x-coordinates
|
||||
struct Compare_x_2 :
|
||||
public CGAL::binary_function<Algebraic_real_1, Algebraic_real_1,
|
||||
public CGAL::cpp98::binary_function<Algebraic_real_1, Algebraic_real_1,
|
||||
Comparison_result > {
|
||||
|
||||
Comparison_result operator()(const Algebraic_real_1& x1,
|
||||
@@ -1212,7 +1212,7 @@ public:
|
||||
|
||||
//! \brief comparison of y-coordinates of two points
|
||||
struct Compare_y_2 :
|
||||
public CGAL::binary_function< Xy_coordinate_2, Xy_coordinate_2,
|
||||
public CGAL::cpp98::binary_function< Xy_coordinate_2, Xy_coordinate_2,
|
||||
Comparison_result > {
|
||||
|
||||
Comparison_result operator()(const Xy_coordinate_2& xy1,
|
||||
@@ -1226,7 +1226,7 @@ public:
|
||||
//!
|
||||
//! \c equal_x specifies that only y-coordinates need to be compared
|
||||
struct Compare_xy_2 :
|
||||
public CGAL::binary_function<Xy_coordinate_2, Xy_coordinate_2,
|
||||
public CGAL::cpp98::binary_function<Xy_coordinate_2, Xy_coordinate_2,
|
||||
Comparison_result >
|
||||
{
|
||||
Comparison_result operator()(const Xy_coordinate_2& xy1,
|
||||
@@ -1243,7 +1243,7 @@ public:
|
||||
//! for algerbaic curves this means that supporting polynomial is
|
||||
//! square-free
|
||||
struct Has_finite_number_of_self_intersections_2 :
|
||||
public CGAL::unary_function< Polynomial_2, bool > {
|
||||
public CGAL::cpp98::unary_function< Polynomial_2, bool > {
|
||||
|
||||
bool operator()(const Polynomial_2& p) const {
|
||||
return true; //is_square_free(p);
|
||||
@@ -1258,7 +1258,7 @@ public:
|
||||
//! in case of algerbaic curves: checks whether supporting polynomials are
|
||||
//! coprime
|
||||
struct Has_finite_number_of_intersections_2 :
|
||||
public CGAL::binary_function< Curve_analysis_2, Curve_analysis_2, bool > {
|
||||
public CGAL::cpp98::binary_function< Curve_analysis_2, Curve_analysis_2, bool > {
|
||||
|
||||
bool operator()(const Curve_analysis_2& c1,
|
||||
const Curve_analysis_2& c2) const {
|
||||
@@ -1315,7 +1315,7 @@ public:
|
||||
|
||||
//! \brief computes the derivative w.r.t. the first (innermost) variable
|
||||
struct Derivative_x_2 :
|
||||
public CGAL::unary_function< Polynomial_2, Polynomial_2 > {
|
||||
public CGAL::cpp98::unary_function< Polynomial_2, Polynomial_2 > {
|
||||
|
||||
Polynomial_2 operator()(const Polynomial_2& p) const {
|
||||
return p;
|
||||
@@ -1325,7 +1325,7 @@ public:
|
||||
|
||||
//! \brief computes the derivative w.r.t. the first (outermost) variable
|
||||
struct Derivative_y_2 :
|
||||
public CGAL::unary_function< Polynomial_2, Polynomial_2 > {
|
||||
public CGAL::cpp98::unary_function< Polynomial_2, Polynomial_2 > {
|
||||
|
||||
Polynomial_2 operator()(const Polynomial_2& p) const {
|
||||
return p;
|
||||
@@ -1374,7 +1374,7 @@ public:
|
||||
* returns a value convertible to \c CGAL::Sign
|
||||
*/
|
||||
struct Sign_at_2 :
|
||||
public CGAL::binary_function< Polynomial_2, Xy_coordinate_2, Sign > {
|
||||
public CGAL::cpp98::binary_function< Polynomial_2, Xy_coordinate_2, Sign > {
|
||||
|
||||
Sign operator()(const Polynomial_2& p, const Xy_coordinate_2& r) const
|
||||
{
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user