Merge remote-tracking branch 'cgal/master' into CGAL-Improve_NP_doc_presentation-GF

This commit is contained in:
Mael Rouxel-Labbé 2020-06-03 19:01:46 +02:00
commit 071565467d
313 changed files with 18315 additions and 7633 deletions

2
.gitattributes vendored
View File

@ -18,7 +18,6 @@
*.js text *.js text
*.hmtl text *.hmtl text
*.bib text *.bib text
*.sh text
*.css text *.css text
*.ui text *.ui text
*.qrc text *.qrc text
@ -36,6 +35,7 @@
*.pdb text *.pdb text
# Declare files that will always have LF line endings on checkout. # Declare files that will always have LF line endings on checkout.
*.sh text eol=lf
Documentation/Doxyfile text eol=lf Documentation/Doxyfile text eol=lf
Documentation/pkglist_filter text eol=lf Documentation/pkglist_filter text eol=lf
Installation/update_CHANGES text eol=lf Installation/update_CHANGES text eol=lf

View File

@ -4,6 +4,34 @@ sudo: required
git: git:
depth: 3 depth: 3
env: env:
matrix:
PACKAGES_MATRIX
compiler: clang
install:
- echo "$PWD"
- if [ -n "$TRAVIS_PULL_REQUEST_BRANCH" ] && [ "$PACKAGE" != CHECK ]; then DO_IGNORE=FALSE; for ARG in $(echo "$PACKAGE");do if [ "$ARG" = "Maintenance" ]; then continue; fi; . $PWD/.travis/test_package.sh "$PWD" "$ARG"; echo "DO_IGNORE is $DO_IGNORE"; if [ "$DO_IGNORE" = "FALSE" ]; then break; fi; done; if [ "$DO_IGNORE" = "TRUE" ]; then travis_terminate 0; fi;fi
- /usr/bin/time -f 'Spend time of %C -- %E (real)' bash .travis/install.sh
- export CXX=clang++ CC=clang;
before_script:
- wget -O doxygen_exe https://cgal.geometryfactory.com/~mgimeno/doxygen_exe
- sudo mv doxygen_exe /usr/bin/doxygen
- sudo chmod +x /usr/bin/doxygen
- mkdir -p build
- cd build
- /usr/bin/time -f 'Spend time of %C -- %E (real)' cmake -DCMAKE_CXX_FLAGS="-std=c++1y" -DCGAL_HEADER_ONLY=ON -DCMAKE_CXX_FLAGS_RELEASE=-DCGAL_NDEBUG -DWITH_examples=ON -DWITH_demos=ON -DWITH_tests=ON ..
- /usr/bin/time -f 'Spend time of %C -- %E (real)' make
- /usr/bin/time -f 'Spend time of %C -- %E (real)' sudo make install &>/dev/null
- cd ..
script:
- cd ./.travis
- /usr/bin/time -f 'Spend time of %C -- %E (real)' bash ./build_package.sh $PACKAGE
notifications:
email:
on_success: change
# default: always
on_failure: always
# default: always
matrix: matrix:
- PACKAGE='CHECK' - PACKAGE='CHECK'
- PACKAGE='AABB_tree Advancing_front_surface_reconstruction Algebraic_foundations ' - PACKAGE='AABB_tree Advancing_front_surface_reconstruction Algebraic_foundations '
@ -49,32 +77,7 @@ env:
- PACKAGE='Surface_mesh_parameterization Surface_mesh_segmentation Surface_mesh_shortest_path ' - PACKAGE='Surface_mesh_parameterization Surface_mesh_segmentation Surface_mesh_shortest_path '
- PACKAGE='Surface_mesh_simplification Surface_mesh_skeletonization Surface_mesh_topology ' - PACKAGE='Surface_mesh_simplification Surface_mesh_skeletonization Surface_mesh_topology '
- PACKAGE='Surface_mesher Surface_sweep_2 TDS_2 ' - PACKAGE='Surface_mesher Surface_sweep_2 TDS_2 '
- PACKAGE='TDS_3 Testsuite Three ' - PACKAGE='TDS_3 Testsuite Tetrahedral_remeshing '
- PACKAGE='Triangulation Triangulation_2 Triangulation_3 ' - PACKAGE='Three Triangulation Triangulation_2 '
- PACKAGE='Union_find Visibility_2 Voronoi_diagram_2 ' - PACKAGE='Triangulation_3 Union_find Visibility_2 '
- PACKAGE='wininst ' - PACKAGE='Voronoi_diagram_2 wininst '
compiler: clang
install:
- echo "$PWD"
- if [ -n "$TRAVIS_PULL_REQUEST_BRANCH" ] && [ "$PACKAGE" != CHECK ]; then DO_IGNORE=FALSE; for ARG in $(echo "$PACKAGE");do if [ "$ARG" = "Maintenance" ]; then continue; fi; . $PWD/.travis/test_package.sh "$PWD" "$ARG"; echo "DO_IGNORE is $DO_IGNORE"; if [ "$DO_IGNORE" = "FALSE" ]; then break; fi; done; if [ "$DO_IGNORE" = "TRUE" ]; then travis_terminate 0; fi;fi
- /usr/bin/time -f 'Spend time of %C -- %E (real)' bash .travis/install.sh
- export CXX=clang++ CC=clang;
before_script:
- wget -O doxygen_exe https://cgal.geometryfactory.com/~mgimeno/doxygen_exe
- sudo mv doxygen_exe /usr/bin/doxygen
- sudo chmod +x /usr/bin/doxygen
- mkdir -p build
- cd build
- /usr/bin/time -f 'Spend time of %C -- %E (real)' cmake -DCMAKE_CXX_FLAGS="-std=c++1y" -DCGAL_HEADER_ONLY=ON -DCMAKE_CXX_FLAGS_RELEASE=-DCGAL_NDEBUG -DWITH_examples=ON -DWITH_demos=ON -DWITH_tests=ON ..
- /usr/bin/time -f 'Spend time of %C -- %E (real)' make
- /usr/bin/time -f 'Spend time of %C -- %E (real)' sudo make install &>/dev/null
- cd ..
script:
- cd ./.travis
- /usr/bin/time -f 'Spend time of %C -- %E (real)' bash ./build_package.sh $PACKAGE
notifications:
email:
on_success: change
# default: always
on_failure: always
# default: always

View File

@ -28,7 +28,7 @@ function build_demo {
EXTRA_CXX_FLAGS="-Werror=inconsistent-missing-override" EXTRA_CXX_FLAGS="-Werror=inconsistent-missing-override"
;; ;;
esac esac
mytime cmake -DCGAL_DIR="/usr/local/lib/cmake/CGAL" -DCGAL_DONT_OVERRIDE_CMAKE_FLAGS:BOOL=ON -DCMAKE_CXX_FLAGS="${CXX_FLAGS} ${EXTRA_CXX_FLAGS}" .. mytime cmake -DCGAL_DIR="/usr/local/lib/cmake/CGAL" -DCGAL_DONT_OVERRIDE_CMAKE_FLAGS:BOOL=ON -DCMAKE_CXX_FLAGS="${CXX_FLAGS} ${EXTRA_CXX_FLAGS}" ..
mytime make -j2 VERBOSE=1 mytime make -j2 VERBOSE=1
} }
old_IFS=$IFS old_IFS=$IFS
@ -57,41 +57,41 @@ cd $ROOT
cd .. cd ..
IFS=$old_IFS IFS=$old_IFS
mytime zsh $ROOT/Scripts/developer_scripts/test_merge_of_branch HEAD mytime zsh $ROOT/Scripts/developer_scripts/test_merge_of_branch HEAD
#test dependencies #test dependencies
cd $ROOT cd $ROOT
mytime bash Scripts/developer_scripts/cgal_check_dependencies.sh --check_headers /usr/bin/doxygen mytime bash Scripts/developer_scripts/cgal_check_dependencies.sh --check_headers /usr/bin/doxygen
cd .travis cd .travis
#parse current matrix and check that no package has been forgotten #parse current matrix and check that no package has been forgotten
IFS=$'\n' IFS=$'\n'
COPY=0 COPY=0
MATRIX=() MATRIX=()
for LINE in $(cat "$PWD/packages.txt") for LINE in $(cat "$PWD/packages.txt")
do do
MATRIX+="$LINE " MATRIX+="$LINE "
done done
PACKAGES=() PACKAGES=()
cd .. cd ..
for f in * for f in *
do do
if [ -d "$f/package_info/$f" ] if [ -d "$f/package_info/$f" ]
then then
PACKAGES+="$f " PACKAGES+="$f "
fi fi
done done
DIFFERENCE=$(echo ${MATRIX[@]} ${PACKAGES[@]} | tr ' ' '\n' | sort | uniq -u) DIFFERENCE=$(echo ${MATRIX[@]} ${PACKAGES[@]} | tr ' ' '\n' | sort | uniq -u)
IFS=$' ' IFS=$' '
if [ "${DIFFERENCE[0]}" != "" ] if [ "${DIFFERENCE[0]}" != "" ]
then then
echo "The matrix and the actual package list differ : ." echo "The matrix and the actual package list differ : ."
echo ${DIFFERENCE[*]} echo ${DIFFERENCE[*]}
echo "You should run generate_travis.sh." echo "You should run generate_travis.sh."
exit 1 exit 1
fi fi
echo "Matrix is up to date." echo "Matrix is up to date."
#check if non standard cgal installation works #check if non standard cgal installation works
cd $ROOT cd $ROOT
mkdir build_test mkdir build_test
@ -126,7 +126,7 @@ cd $ROOT
fi fi
IFS=$' ' IFS=$' '
EXAMPLES="$ARG/examples/$ARG" EXAMPLES="$ARG/examples/$ARG"
TEST="$ARG/test/$ARG" TEST="$ARG/test/$ARG"
DEMOS=$ROOT/$ARG/demo/* DEMOS=$ROOT/$ARG/demo/*
if [ -d "$ROOT/$EXAMPLES" ] if [ -d "$ROOT/$EXAMPLES" ]
@ -168,17 +168,17 @@ cd $ROOT
for DEMO in $DEMOS; do for DEMO in $DEMOS; do
DEMO=${DEMO#"$ROOT"} DEMO=${DEMO#"$ROOT"}
echo $DEMO echo $DEMO
#If there is no demo subdir, try in GraphicsView #If there is no demo subdir, try in GraphicsView
if [ ! -d "$ROOT/$DEMO" ] || [ ! -f "$ROOT/$DEMO/CMakeLists.txt" ]; then if [ ! -d "$ROOT/$DEMO" ] || [ ! -f "$ROOT/$DEMO/CMakeLists.txt" ]; then
DEMO="GraphicsView/demo/$ARG" DEMO="GraphicsView/demo/$ARG"
fi fi
if [ "$ARG" != Polyhedron ] && [ -d "$ROOT/$DEMO" ] if [ "$ARG" != Polyhedron ] && [ -d "$ROOT/$DEMO" ]
then then
cd $ROOT/$DEMO cd $ROOT/$DEMO
build_demo build_demo
elif [ "$ARG" != Polyhedron_demo ]; then elif [ "$ARG" != Polyhedron_demo ]; then
echo "No demo found for $ARG" echo "No demo found for $ARG"
fi fi
done done
if [ "$ARG" = Polyhedron_demo ]; then if [ "$ARG" = Polyhedron_demo ]; then
DEMO=Polyhedron/demo/Polyhedron DEMO=Polyhedron/demo/Polyhedron

View File

@ -129,6 +129,7 @@ Surface_sweep_2
TDS_2 TDS_2
TDS_3 TDS_3
Testsuite Testsuite
Tetrahedral_remeshing
Three Three
Triangulation Triangulation
Triangulation_2 Triangulation_2

12
.travis/windows.h Normal file
View File

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

View File

@ -127,7 +127,11 @@ protected:
void highlightPointLocation( QGraphicsSceneMouseEvent *event ); void highlightPointLocation( QGraphicsSceneMouseEvent *event );
Face_const_handle getFace( const CGAL::Object& o ); Face_const_handle getFace( const CGAL::Object& o );
CGAL::Object rayShootUp( const Kernel_point_2& point ); CGAL::Object rayShootUp( const Kernel_point_2& point );
CGAL::Object rayShootUp( const Kernel_point_2& point, CGAL::Tag_true );
CGAL::Object rayShootUp( const Kernel_point_2& point, CGAL::Tag_false );
CGAL::Object rayShootDown( const Kernel_point_2& point ); CGAL::Object rayShootDown( const Kernel_point_2& point );
CGAL::Object rayShootDown( const Kernel_point_2& point, CGAL::Tag_true );
CGAL::Object rayShootDown( const Kernel_point_2& point, CGAL::Tag_false );
using Superclass::scene; using Superclass::scene;
using Superclass::shootingUp; using Superclass::shootingUp;
@ -304,6 +308,14 @@ VerticalRayShootCallback< Arr_ >::getFace( const CGAL::Object& obj )
template < typename Arr_ > template < typename Arr_ >
CGAL::Object CGAL::Object
VerticalRayShootCallback< Arr_ >::rayShootUp( const Kernel_point_2& pt ) VerticalRayShootCallback< Arr_ >::rayShootUp( const Kernel_point_2& pt )
{
typename Supports_landmarks< Arrangement >::Tag supportsLandmarks;
return this->rayShootUp( pt, supportsLandmarks );
}
template < typename Arr_ >
CGAL::Object VerticalRayShootCallback< Arr_ >::rayShootUp( const Kernel_point_2& pt,
CGAL::Tag_true )
{ {
CGAL::Object pointLocationResult; CGAL::Object pointLocationResult;
Walk_pl_strategy* walkStrategy; Walk_pl_strategy* walkStrategy;
@ -334,9 +346,48 @@ VerticalRayShootCallback< Arr_ >::rayShootUp( const Kernel_point_2& pt )
return pointLocationResult; return pointLocationResult;
} }
template < typename Arr_ >
CGAL::Object VerticalRayShootCallback< Arr_ >::rayShootUp( const Kernel_point_2& pt,
CGAL::Tag_false )
{
CGAL::Object pointLocationResult;
Walk_pl_strategy* walkStrategy;
TrapezoidPointLocationStrategy* trapezoidStrategy;
SimplePointLocationStrategy* simpleStrategy;
Point_2 point = this->toArrPoint( pt );
if ( CGAL::assign( walkStrategy, this->pointLocationStrategy ) )
{
pointLocationResult = walkStrategy->ray_shoot_up( point );
}
else if ( CGAL::assign( trapezoidStrategy, this->pointLocationStrategy ) )
{
pointLocationResult = trapezoidStrategy->ray_shoot_up( point );
}
else if ( CGAL::assign( simpleStrategy, this->pointLocationStrategy ) )
{
pointLocationResult = simpleStrategy->ray_shoot_up( point );
}
else
{
std::cout<<"Didn't find the right strategy\n";
}
return pointLocationResult;
}
template < typename Arr_ > template < typename Arr_ >
CGAL::Object CGAL::Object
VerticalRayShootCallback< Arr_ >::rayShootDown( const Kernel_point_2& pt ) VerticalRayShootCallback< Arr_ >::rayShootDown( const Kernel_point_2& pt )
{
typename Supports_landmarks< Arrangement >::Tag supportsLandmarks;
return this->rayShootDown( pt, supportsLandmarks );
}
template < typename Arr_ >
CGAL::Object
VerticalRayShootCallback< Arr_ >::rayShootDown( const Kernel_point_2& pt, CGAL::Tag_true )
{ {
CGAL::Object pointLocationResult; CGAL::Object pointLocationResult;
Walk_pl_strategy* walkStrategy; Walk_pl_strategy* walkStrategy;
@ -367,4 +418,30 @@ VerticalRayShootCallback< Arr_ >::rayShootDown( const Kernel_point_2& pt )
return pointLocationResult; return pointLocationResult;
} }
template < typename Arr_ >
CGAL::Object
VerticalRayShootCallback< Arr_ >::rayShootDown( const Kernel_point_2& pt, CGAL::Tag_false )
{
CGAL::Object pointLocationResult;
Walk_pl_strategy* walkStrategy;
TrapezoidPointLocationStrategy* trapezoidStrategy;
SimplePointLocationStrategy* simpleStrategy;
Point_2 point = this->toArrPoint( pt );
if ( CGAL::assign( walkStrategy, this->pointLocationStrategy ) )
{
pointLocationResult = walkStrategy->ray_shoot_down( point );
}
else if ( CGAL::assign( trapezoidStrategy, this->pointLocationStrategy ) )
{
pointLocationResult = trapezoidStrategy->ray_shoot_down( point );
}
else if ( CGAL::assign( simpleStrategy, this->pointLocationStrategy ) )
{
pointLocationResult = simpleStrategy->ray_shoot_down( point );
}
return pointLocationResult;
}
#endif // VERTICAL_RAY_SHOOT_CALLBACK_H #endif // VERTICAL_RAY_SHOOT_CALLBACK_H

View File

@ -16,21 +16,19 @@ public:
/// A model of this concept must provide: /// A model of this concept must provide:
/// @{ /// @{
/*! /*! computes the intersections of `xc1` and `xc2` and inserts them <I>in an
computes the intersections of `xc1` and `xc2` and * ascending lexicographic \f$ xy\f$-order</I> into a range begining at
inserts them <I>in an ascending lexicographic \f$ xy\f$-order</I> into the * `oi`. The type `OutputIterator` dereferences a `boost::variant` of either the
output iterator `oi`. The value-type of `Output_iterator` is * type `pair<ArrTraits::Point_2,ArrTraits::Multiplicity>` or the type
`CGAL::Object`, where each `Object` wraps either a * `ArrTraits::X_monotone_curve_2`. An object of the former type represents an
`pair<ArrTraits::Point_2,ArrTraits::Multiplicity>` object, which * intersection point with its multiplicity (in case the multiplicity is
represents an intersection point with its multiplicity (in case the * undefined or unknown, it should be set to \f$ 0\f$). An object of the latter
multiplicity is undefined or unknown, it should be set to \f$ 0\f$) or an * type representing an overlapping subcurve of `xc1` and `xc2`. The operator
`ArrTraits::X_monotone_curve_2` object, representing an * returns a past-the-end iterator of the destination range.
overlapping subcurve of `xc1` and `xc2`. The operator */
returns a past-the-end iterator for the output sequence. OutputIterator operator()(ArrTraits::X_monotone_curve_2 xc1,
*/ ArrTraits::X_monotone_curve_2 xc2,
Output_iterator operator()(ArrTraits::X_monotone_curve_2 xc1, Output_iterator& oi);
ArrTraits::X_monotone_curve_2 xc2,
Output_iterator& oi);
/// @} /// @}

View File

@ -7,9 +7,10 @@
// $Id$ // $Id$
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
// //
// Author(s) : Ron Wein <wein@post.tau.ac.il> // Author(s): Ron Wein <wein@post.tau.ac.il>
// Baruch Zukerman <baruchzu@post.tau.ac.il> // Baruch Zukerman <baruchzu@post.tau.ac.il>
// Waqar Khan <wkhan@mpi-inf.mpg.de> // Waqar Khan <wkhan@mpi-inf.mpg.de>
// Efi Fogel <efifogel@gmail.com>
#ifndef CGAL_ARR_CIRCLE_SEGMENT_TRAITS_2_H #ifndef CGAL_ARR_CIRCLE_SEGMENT_TRAITS_2_H
#define CGAL_ARR_CIRCLE_SEGMENT_TRAITS_2_H #define CGAL_ARR_CIRCLE_SEGMENT_TRAITS_2_H
@ -546,21 +547,15 @@ public:
return Split_2(); return Split_2();
} }
class Intersect_2 class Intersect_2 {
{
private: private:
Intersection_map& _inter_map; // The map of intersection points.
Intersection_map& _inter_map; // The map of intersection points.
public: public:
/*! Constructor. */ /*! Constructor. */
Intersect_2 (Intersection_map& map) : Intersect_2(Intersection_map& map) : _inter_map(map) {}
_inter_map (map)
{}
/*! /*! Find the intersections of the two given curves and insert them to the
* Find the intersections of the two given curves and insert them to the
* given output iterator. As two segments may itersect only once, only a * given output iterator. As two segments may itersect only once, only a
* single will be contained in the iterator. * single will be contained in the iterator.
* \param cv1 The first curve. * \param cv1 The first curve.
@ -568,20 +563,15 @@ public:
* \param oi The output iterator. * \param oi The output iterator.
* \return The past-the-end iterator. * \return The past-the-end iterator.
*/ */
template<class OutputIterator> template <typename OutputIterator>
OutputIterator operator() (const X_monotone_curve_2& cv1, OutputIterator operator()(const X_monotone_curve_2& cv1,
const X_monotone_curve_2& cv2, const X_monotone_curve_2& cv2,
OutputIterator oi) const OutputIterator oi) const
{ { return (cv1.intersect(cv2, oi, &_inter_map)); }
return (cv1.intersect (cv2, oi, &_inter_map));
}
}; };
/*! Get an Intersect_2 functor object. */ /*! Get an Intersect_2 functor object. */
Intersect_2 intersect_2_object () const Intersect_2 intersect_2_object() const { return (Intersect_2(inter_map)); }
{
return (Intersect_2 (inter_map));
}
class Are_mergeable_2 class Are_mergeable_2
{ {
@ -706,14 +696,11 @@ public:
friend class Arr_circle_segment_traits_2<Kernel, Filter>; friend class Arr_circle_segment_traits_2<Kernel, Filter>;
public: public:
/*!\brief /*! Obtain a trimmed version of an arc
* Returns a trimmed version of an arc
*
* \param xcv The arc * \param xcv The arc
* \param src the new first endpoint * \param src the new first endpoint
* \param tgt the new second endpoint * \param tgt the new second endpoint
* \return The trimmed arc * \return The trimmed arc
*
* \pre src != tgt * \pre src != tgt
* \pre both points must be interior and must lie on \c cv * \pre both points must be interior and must lie on \c cv
*/ */

View File

@ -22,7 +22,6 @@
#include <CGAL/disable_warnings.h> #include <CGAL/disable_warnings.h>
/*! \file /*! \file
* This file was developed at Inria, France, and copied over to the * This file was developed at Inria, France, and copied over to the
* Arrangement_2 package, which it is now part of. It contains a traits * Arrangement_2 package, which it is now part of. It contains a traits
@ -30,12 +29,13 @@
* It is based on the circular kernel. * It is based on the circular kernel.
*/ */
#include <CGAL/basic.h>
#include <boost/variant.hpp>
#include <CGAL/Arr_tags.h>
#include <vector> #include <vector>
#include <boost/variant.hpp>
#include <CGAL/basic.h>
#include <CGAL/Arr_tags.h>
namespace CGAL { namespace CGAL {
namespace VariantFunctors{ namespace VariantFunctors{
@ -47,9 +47,9 @@ namespace CGAL {
object_to_object_variant(const std::vector<CGAL::Object>& res1, object_to_object_variant(const std::vector<CGAL::Object>& res1,
OutputIterator res2) OutputIterator res2)
{ {
for(std::vector<CGAL::Object>::const_iterator it = res1.begin(); for (std::vector<CGAL::Object>::const_iterator it = res1.begin();
it != res1.end(); ++it ){ it != res1.end(); ++it ) {
if(const Arc1 *arc = CGAL::object_cast< Arc1 >(&*it)){ if (const Arc1 *arc = CGAL::object_cast< Arc1 >(&*it)){
boost::variant< Arc1, Arc2 > v = *arc; boost::variant< Arc1, Arc2 > v = *arc;
*res2++ = make_object(v); *res2++ = make_object(v);
} }
@ -64,29 +64,27 @@ namespace CGAL {
return res2; return res2;
} }
template <class CK, class Arc,
template <class CircularKernel, class Arc1, class Arc2> class IntersectionPoint, class XMonotoneCurve,
class In_x_range_2 class InternaType, class OutputIterator>
OutputIterator
object_to_object_variant1(const std::vector<InternaType>& res,
OutputIterator oi)
{ {
public: typedef IntersectionPoint Intersection_point;
typedef typename CircularKernel::Circular_arc_point_2 typedef XMonotoneCurve X_monotone_curve_2;
Circular_arc_point_2; typedef boost::variant<Intersection_point, X_monotone_curve_2>
typedef bool result_type; Intersection_result;
result_type for (auto it = res.begin(); it != res.end(); ++it) {
operator()(const boost::variant< Arc1, Arc2 > &a, if (const Arc* arc = boost::get<Arc>(&*it)) {
const Circular_arc_point_2 &p) const X_monotone_curve_2 cv = *arc;
{ *oi++ = Intersection_result(cv);
if ( const Arc1* arc1 = boost::get<Arc1>( &a ) ){
return CircularKernel().in_x_range_2_object()(*arc1, p);
}
else {
const Arc2* arc2 = boost::get<Arc2>( &a );
return CircularKernel().in_x_range_2_object()(*arc2, p);
} }
else *oi++ = Intersection_result(*it);
} }
}; return oi;
}
template <class CircularKernel, class Arc1, class Arc2> template <class CircularKernel, class Arc1, class Arc2>
class Compare_y_to_right_2 class Compare_y_to_right_2
@ -277,7 +275,7 @@ namespace CGAL {
CircularKernel() CircularKernel()
.make_x_monotone_2_object()(*arc1,std::back_inserter(container)); .make_x_monotone_2_object()(*arc1,std::back_inserter(container));
return object_to_object_variant<CircularKernel, Arc1, Arc2> return object_to_object_variant<CircularKernel, Arc1, Arc2>
(container, res); (container, res);
} }
else { else {
const Arc2* arc2 = boost::get<Arc2>( &A ); const Arc2* arc2 = boost::get<Arc2>( &A );
@ -285,65 +283,42 @@ namespace CGAL {
CircularKernel() CircularKernel()
.make_x_monotone_2_object()(*arc2,std::back_inserter(container)); .make_x_monotone_2_object()(*arc2,std::back_inserter(container));
return object_to_object_variant<CircularKernel, Arc1, Arc2> return object_to_object_variant<CircularKernel, Arc1, Arc2>
(container, res); (container, res);
} }
} }
}; };
template <class CircularKernel, class Arc1, class Arc2> template <class CircularKernel, class Arc1, class Arc2>
class Intersect_2 class Intersect_2
{ {
public: public:
typedef typename CircularKernel::Circular_arc_point_2 typedef typename CircularKernel::Circular_arc_point_2
Circular_arc_point_2; Circular_arc_point_2;
template < class OutputIterator > template < class OutputIterator >
OutputIterator OutputIterator
operator()(const boost::variant< Arc1, Arc2 > &c1, operator()(const boost::variant< Arc1, Arc2 > &c1,
const boost::variant< Arc1, Arc2 > &c2, const boost::variant< Arc1, Arc2 > &c2,
OutputIterator res) const OutputIterator oi) const
{ {
if ( const Arc1* arc1 = boost::get<Arc1>( &c1 ) ){ if ( const Arc1* arc1 = boost::get<Arc1>( &c1 ) ){
if ( const Arc1* arc2 = boost::get<Arc1>( &c2 ) ){ if ( const Arc1* arc2 = boost::get<Arc1>( &c2 ) ){
std::vector<CGAL::Object> container; return CircularKernel().intersect_2_object()(*arc1, *arc2, oi);
CircularKernel()
.intersect_2_object()(*arc1,*arc2,std::back_inserter(container));
return object_to_object_variant<CircularKernel, Arc1, Arc2>
(container, res);
}
else if ( const Arc2* arc2 = boost::get<Arc2>( &c2 ) ){
std::vector<CGAL::Object> container;
CircularKernel()
.intersect_2_object()(*arc1,*arc2,std::back_inserter(container));
return object_to_object_variant<CircularKernel, Arc1, Arc2>
(container, res);
}
}
else {
const Arc2* arc1e = boost::get<Arc2>( &c1 );
if ( const Arc1* arc2 = boost::get<Arc1>( &c2 ) ){
std::vector<CGAL::Object> container;
CircularKernel()
.intersect_2_object()(*arc1e,*arc2,std::back_inserter(container));
return object_to_object_variant<CircularKernel, Arc1, Arc2>
(container, res);
} }
const Arc2* arc2 = boost::get<Arc2>( &c2 ); const Arc2* arc2 = boost::get<Arc2>( &c2 );
std::vector<CGAL::Object> container; return CircularKernel().intersect_2_object()(*arc1, *arc2, oi);
CircularKernel()
.intersect_2_object()(*arc1e,*arc2,std::back_inserter(container));
return object_to_object_variant<CircularKernel, Arc1, Arc2>
(container, res);
} }
CGAL_error();
return res;//for no warning const Arc2* arc1e = boost::get<Arc2>( &c1 );
if ( const Arc1* arc2 = boost::get<Arc1>( &c2 ) ){
return CircularKernel().intersect_2_object()(*arc1e, *arc2, oi);
}
const Arc2* arc2 = boost::get<Arc2>( &c2 );
return CircularKernel().intersect_2_object()(*arc1e, *arc2, oi);
} }
}; };
template <class CircularKernel, class Arc1, class Arc2> template <class CircularKernel, class Arc1, class Arc2>
class Split_2 class Split_2
{ {
@ -533,7 +508,7 @@ namespace CGAL {
typedef unsigned int Multiplicity; typedef unsigned int Multiplicity;
typedef CGAL::Tag_false Has_left_category; typedef CGAL::Tag_false Has_left_category;
typedef CGAL::Tag_false Has_merge_category; typedef CGAL::Tag_false Has_merge_category;
typedef CGAL::Tag_false Has_do_intersect_category; typedef CGAL::Tag_false Has_do_intersect_category;
typedef Arr_oblivious_side_tag Left_side_category; typedef Arr_oblivious_side_tag Left_side_category;

View File

@ -8,8 +8,8 @@
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
// //
// //
// Author(s) : Ron Wein <wein@post.tau.ac.il> // Author(s): Ron Wein <wein@post.tau.ac.il>
// Waqar Khan <wkhan@mpi-inf.mpg.de> // Waqar Khan <wkhan@mpi-inf.mpg.de>
#ifndef CGAL_ARR_CONIC_TRAITS_2_H #ifndef CGAL_ARR_CONIC_TRAITS_2_H
#define CGAL_ARR_CONIC_TRAITS_2_H #define CGAL_ARR_CONIC_TRAITS_2_H
@ -22,6 +22,8 @@
* The conic traits-class for the arrangement package. * The conic traits-class for the arrangement package.
*/ */
#include <fstream>
#include <CGAL/atomic.h> #include <CGAL/atomic.h>
#include <CGAL/tags.h> #include <CGAL/tags.h>
#include <CGAL/Arr_tags.h> #include <CGAL/Arr_tags.h>
@ -29,8 +31,6 @@
#include <CGAL/Arr_geometry_traits/Conic_x_monotone_arc_2.h> #include <CGAL/Arr_geometry_traits/Conic_x_monotone_arc_2.h>
#include <CGAL/Arr_geometry_traits/Conic_point_2.h> #include <CGAL/Arr_geometry_traits/Conic_point_2.h>
#include <fstream>
namespace CGAL { namespace CGAL {
/*! /*!
@ -88,8 +88,7 @@ private:
// Type definition for the intersection points mapping. // Type definition for the intersection points mapping.
typedef typename X_monotone_curve_2::Conic_id Conic_id; typedef typename X_monotone_curve_2::Conic_id Conic_id;
typedef typename X_monotone_curve_2::Intersection_point_2 typedef typename X_monotone_curve_2::Intersection_point Intersection_point;
Intersection_point_2;
typedef typename X_monotone_curve_2::Intersection_map Intersection_map; typedef typename X_monotone_curve_2::Intersection_map Intersection_map;
mutable Intersection_map inter_map; // Mapping conic pairs to their mutable Intersection_map inter_map; // Mapping conic pairs to their
@ -604,21 +603,15 @@ public:
return Split_2(); return Split_2();
} }
class Intersect_2 class Intersect_2 {
{
private: private:
Intersection_map& _inter_map; // The map of intersection points.
Intersection_map& _inter_map; // The map of intersection points.
public: public:
/*! Constructor. */ /*! Constructor. */
Intersect_2 (Intersection_map& map) : Intersect_2(Intersection_map& map) : _inter_map(map) {}
_inter_map (map)
{}
/*! /*! Find the intersections of the two given curves and insert them to the
* Find the intersections of the two given curves and insert them to the
* given output iterator. As two segments may itersect only once, only a * given output iterator. As two segments may itersect only once, only a
* single will be contained in the iterator. * single will be contained in the iterator.
* \param cv1 The first curve. * \param cv1 The first curve.
@ -626,20 +619,15 @@ public:
* \param oi The output iterator. * \param oi The output iterator.
* \return The past-the-end iterator. * \return The past-the-end iterator.
*/ */
template<class OutputIterator> template <typename OutputIterator>
OutputIterator operator() (const X_monotone_curve_2& cv1, OutputIterator operator()(const X_monotone_curve_2& cv1,
const X_monotone_curve_2& cv2, const X_monotone_curve_2& cv2,
OutputIterator oi) const OutputIterator oi) const
{ { return (cv1.intersect(cv2, _inter_map, oi)); }
return (cv1.intersect (cv2, _inter_map, oi));
}
}; };
/*! Get an Intersect_2 functor object. */ /*! Get an Intersect_2 functor object. */
Intersect_2 intersect_2_object () const Intersect_2 intersect_2_object () const { return (Intersect_2(inter_map)); }
{
return (Intersect_2 (inter_map));
}
class Are_mergeable_2 class Are_mergeable_2
{ {

View File

@ -7,8 +7,8 @@
// $Id$ // $Id$
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
// //
// Author(s) : Ron Wein <wein@post.tau.ac.il> // Author(s): Ron Wein <wein@post.tau.ac.il>
// Efi Fogel <efifogel@gmail.com> // Efi Fogel <efifogel@gmail.com>
#ifndef CGAL_ARR_CURVE_DATA_TRAITS_2_H #ifndef CGAL_ARR_CURVE_DATA_TRAITS_2_H
#define CGAL_ARR_CURVE_DATA_TRAITS_2_H #define CGAL_ARR_CURVE_DATA_TRAITS_2_H
@ -22,6 +22,8 @@
*/ */
#include <list> #include <list>
#include <boost/variant.hpp>
#include <boost/utility/enable_if.hpp> #include <boost/utility/enable_if.hpp>
#include <boost/mpl/has_xxx.hpp> #include <boost/mpl/has_xxx.hpp>
@ -193,35 +195,40 @@ public:
* \param oi The output iterator. * \param oi The output iterator.
* \return The past-the-end iterator. * \return The past-the-end iterator.
*/ */
template<typename OutputIterator> template <typename OutputIterator>
OutputIterator operator()(const X_monotone_curve_2& cv1, OutputIterator operator()(const X_monotone_curve_2& cv1,
const X_monotone_curve_2& cv2, const X_monotone_curve_2& cv2,
OutputIterator oi) const OutputIterator oi) const
{ {
typedef std::pair<Point_2, Multiplicity> Intersection_point;
typedef boost::variant<Intersection_point, X_monotone_curve_2>
Intersection_result;
typedef boost::variant<Intersection_point, Base_x_monotone_curve_2>
Intersection_base_result;
// Use the base functor to obtain all intersection objects. // Use the base functor to obtain all intersection objects.
std::list<CGAL::Object> base_objects; std::list<Intersection_base_result> base_objects;
m_base.intersect_2_object()(cv1, cv2, std::back_inserter(base_objects)); m_base.intersect_2_object()(cv1, cv2, std::back_inserter(base_objects));
// Stop if the list is empty: // Stop if the list is empty:
if (base_objects.empty()) return oi; if (base_objects.empty()) return oi;
// Go over all intersection objects and prepare the output. // Go over all intersection objects and prepare the output.
const Base_x_monotone_curve_2* base_cv; for (const auto& item : base_objects) {
for (typename std::list<CGAL::Object>::const_iterator it = const Base_x_monotone_curve_2* base_cv =
base_objects.begin(); it != base_objects.end(); ++it) boost::get<Base_x_monotone_curve_2>(&item);
{ if (base_cv != nullptr) {
if ((base_cv = object_cast<Base_x_monotone_curve_2>(&(*it))) != nullptr) {
// The current intersection object is an overlapping x-monotone // The current intersection object is an overlapping x-monotone
// curve: Merge the data fields of both intersecting curves and // curve: Merge the data fields of both intersecting curves and
// associate the result with the overlapping curve. // associate the result with the overlapping curve.
X_monotone_curve_2 cv(*base_cv, Merge() (cv1.data(), cv2.data())); X_monotone_curve_2 cv(*base_cv, Merge()(cv1.data(), cv2.data()));
*oi++ = make_object(cv); *oi++ = Intersection_result(cv);
} continue;
else {
// The current intersection object is an intersection point:
// Copy it as is.
*oi++ = *it;
} }
// The current intersection object is an intersection point:
// Copy it as is.
const Intersection_point* ip = boost::get<Intersection_point>(&item);
*oi++ = Intersection_result(*ip);
} }
return oi; return oi;

View File

@ -7,7 +7,7 @@
// $Id$ // $Id$
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
// //
// Author(s) : Efi Fogel <efif@post.tau.ac.il> // Author(s) : Efi Fogel <efif@post.tau.ac.il>
#ifndef CGAL_ARR_GEODESIC_ARC_ON_SPHERE_TRAITS_2_H #ifndef CGAL_ARR_GEODESIC_ARC_ON_SPHERE_TRAITS_2_H
#define CGAL_ARR_GEODESIC_ARC_ON_SPHERE_TRAITS_2_H #define CGAL_ARR_GEODESIC_ARC_ON_SPHERE_TRAITS_2_H
@ -25,6 +25,8 @@
#include <fstream> #include <fstream>
#include <boost/variant.hpp>
#include <CGAL/config.h> #include <CGAL/config.h>
#include <CGAL/tags.h> #include <CGAL/tags.h>
#include <CGAL/tss.h> #include <CGAL/tss.h>
@ -1646,7 +1648,10 @@ public:
Project project, Project project,
OutputIterator oi) const OutputIterator oi) const
{ {
typedef std::pair<Point_2, Multiplicity> Point_2_pair; typedef std::pair<Point_2, Multiplicity> Intersection_point;
typedef boost::variant<Intersection_point, X_monotone_curve_2>
Intersection_result;
const Kernel* kernel = m_traits; const Kernel* kernel = m_traits;
typename Kernel::Equal_2 equal = kernel->equal_2_object(); typename Kernel::Equal_2 equal = kernel->equal_2_object();
@ -1658,7 +1663,7 @@ public:
if (equal(l1, l2)) { if (equal(l1, l2)) {
const Point_2& trg = (in_between(r1, l2, r2)) ? r1_3 : r2_3; const Point_2& trg = (in_between(r1, l2, r2)) ? r1_3 : r2_3;
X_monotone_curve_2 xc(l1_3, trg, normal, vertical, true); X_monotone_curve_2 xc(l1_3, trg, normal, vertical, true);
*oi++ = make_object(xc); *oi++ = Intersection_result(xc);
return oi; return oi;
} }
@ -1668,29 +1673,29 @@ public:
if (l1_eq_start || (!l2_eq_start && in_between(l1, start, l2))) { if (l1_eq_start || (!l2_eq_start && in_between(l1, start, l2))) {
// The following applies only to full circles: // The following applies only to full circles:
if (l1_eq_start && equal(r2, start)) if (l1_eq_start && equal(r2, start))
*oi++ = make_object(Point_2_pair(r2_3, 1)); *oi++ = Intersection_result(Intersection_point(r2_3, 1));
if (in_between(r1, l1, l2)) return oi; // no intersection if (in_between(r1, l1, l2)) return oi; // no intersection
if (equal(r1, l2)) { if (equal(r1, l2)) {
*oi++ = make_object(Point_2_pair(r1_3, 1)); *oi++ = Intersection_result(Intersection_point(r1_3, 1));
return oi; return oi;
} }
const Point_2& trg = (in_between(r1, l2, r2)) ? r1_3 : r2_3; const Point_2& trg = (in_between(r1, l2, r2)) ? r1_3 : r2_3;
X_monotone_curve_2 xc(l2_3, trg, normal, vertical, true); X_monotone_curve_2 xc(l2_3, trg, normal, vertical, true);
*oi++ = make_object(xc); *oi++ = Intersection_result(xc);
return oi; return oi;
} }
CGAL_assertion(l2_eq_start || in_between(l2, start, l1)); CGAL_assertion(l2_eq_start || in_between(l2, start, l1));
// The following applies only to full circles: // The following applies only to full circles:
if (l2_eq_start && equal(r1, start)) if (l2_eq_start && equal(r1, start))
*oi++ = make_object(Point_2_pair(r1_3, 1)); *oi++ = Intersection_result(Intersection_point(r1_3, 1));
if (in_between(r2, l2, l1)) return oi; // no intersection if (in_between(r2, l2, l1)) return oi; // no intersection
if (equal(r2, l1)) { if (equal(r2, l1)) {
*oi++ = make_object(Point_2_pair(r2_3, 1)); *oi++ = Intersection_result(Intersection_point(r2_3, 1));
return oi; return oi;
} }
const Point_2& trg = (in_between(r1, l2, r2)) ? r1_3 : r2_3; const Point_2& trg = (in_between(r1, l2, r2)) ? r1_3 : r2_3;
X_monotone_curve_2 xc(l1_3, trg, normal, vertical, true); X_monotone_curve_2 xc(l1_3, trg, normal, vertical, true);
*oi++ = make_object(xc); *oi++ = Intersection_result(xc);
return oi; return oi;
} }
@ -1784,9 +1789,12 @@ public:
typedef Arr_geodesic_arc_on_sphere_traits_2<Kernel> Traits; typedef Arr_geodesic_arc_on_sphere_traits_2<Kernel> Traits;
typedef typename Kernel::Counterclockwise_in_between_2 typedef typename Kernel::Counterclockwise_in_between_2
Counterclockwise_in_between_2; Counterclockwise_in_between_2;
typedef typename Kernel::Equal_3 Equal_3; typedef typename Kernel::Equal_3 Equal_3;
typedef std::pair<Point_2, Multiplicity> Intersection_point;
typedef boost::variant<Intersection_point, X_monotone_curve_2>
Intersection_result;
typedef std::pair<Point_2, Multiplicity> Point_2_pair;
const Kernel* kernel = m_traits; const Kernel* kernel = m_traits;
Equal_3 equal_3 = kernel->equal_3_object(); Equal_3 equal_3 = kernel->equal_3_object();
@ -1810,9 +1818,9 @@ public:
(res && (xc1.is_directed_right() != xc2.is_directed_right()))) (res && (xc1.is_directed_right() != xc2.is_directed_right())))
{ {
if (xc1.left().is_min_boundary() && xc2.left().is_min_boundary()) if (xc1.left().is_min_boundary() && xc2.left().is_min_boundary())
*oi++ = make_object(Point_2_pair(xc1.left(), 1)); *oi++ = Intersection_result(Intersection_point(xc1.left(), 1));
if (xc1.right().is_max_boundary() && xc2.right().is_max_boundary()) if (xc1.right().is_max_boundary() && xc2.right().is_max_boundary())
*oi++ = make_object(Point_2_pair(xc1.right(), 1)); *oi++ = Intersection_result(Intersection_point(xc1.right(), 1));
return oi; return oi;
} }
@ -1820,11 +1828,11 @@ public:
* the other arc is completely overlapping. * the other arc is completely overlapping.
*/ */
if (xc1.left().is_min_boundary() && xc1.right().is_max_boundary()) { if (xc1.left().is_min_boundary() && xc1.right().is_max_boundary()) {
*oi++ = make_object(xc2); *oi++ = Intersection_result(xc2);
return oi; return oi;
} }
if (xc2.left().is_min_boundary() && xc2.right().is_max_boundary()) { if (xc2.left().is_min_boundary() && xc2.right().is_max_boundary()) {
*oi++ = make_object(xc1); *oi++ = Intersection_result(xc1);
return oi; return oi;
} }
/*! Find an endpoint that does not coincide with a pole, and project /*! Find an endpoint that does not coincide with a pole, and project
@ -1877,14 +1885,14 @@ public:
// Determine which one of the two directions: // Determine which one of the two directions:
Point_2 ed(v.direction()); Point_2 ed(v.direction());
if (is_in_between(ed, xc1) && is_in_between(ed, xc2)) { if (is_in_between(ed, xc1) && is_in_between(ed, xc2)) {
*oi++ = make_object(Point_2_pair(ed, 1)); *oi++ = Intersection_result(Intersection_point(ed, 1));
return oi; return oi;
} }
Vector_3 vo(kernel->construct_opposite_vector_3_object()(v)); Vector_3 vo(kernel->construct_opposite_vector_3_object()(v));
Point_2 edo(vo.direction()); Point_2 edo(vo.direction());
if (is_in_between(edo, xc1) && is_in_between(edo, xc2)) { if (is_in_between(edo, xc1) && is_in_between(edo, xc2)) {
*oi++ = make_object(Point_2_pair(edo, 1)); *oi++ = Intersection_result(Intersection_point(edo, 1));
return oi; return oi;
} }
return oi; return oi;

View File

@ -52,11 +52,11 @@ public:
/// \name Type definitions for the intersection-point mapping. /// \name Type definitions for the intersection-point mapping.
//@{ //@{
/*! \struct Intersection_point_2 /*! \struct Intersection_point
* Representation of an intersection point (in both parameter and physical * Representation of an intersection point (in both parameter and physical
* spaces). * spaces).
*/ */
struct Intersection_point_2 struct Intersection_point
{ {
Algebraic s; // The parameter for the first curve. Algebraic s; // The parameter for the first curve.
Algebraic t; // The parameter for the second curve. Algebraic t; // The parameter for the second curve.
@ -64,7 +64,7 @@ public:
Algebraic y; // The y-coordinate. Algebraic y; // The y-coordinate.
/*! Constructor. */ /*! Constructor. */
Intersection_point_2 (const Algebraic& _s, const Algebraic& _t, Intersection_point (const Algebraic& _s, const Algebraic& _t,
const Algebraic& _x, const Algebraic& _y) : const Algebraic& _x, const Algebraic& _y) :
s(_s), t(_t), s(_s), t(_t),
x(_x), y(_y) x(_x), y(_y)
@ -73,7 +73,7 @@ public:
typedef std::pair<Curve_id, Curve_id> Curve_pair; typedef std::pair<Curve_id, Curve_id> Curve_pair;
typedef std::pair<Algebraic, Algebraic> Parameter_pair; typedef std::pair<Algebraic, Algebraic> Parameter_pair;
typedef std::list<Intersection_point_2> Intersection_list; typedef std::list<Intersection_point> Intersection_list;
typedef typedef
typename Intersection_list::const_iterator Intersection_iter; typename Intersection_list::const_iterator Intersection_iter;
@ -378,7 +378,7 @@ _Bezier_cache<NtTraits>::get_intersections
CGAL::compare (nt_traits.evaluate_at (polyY_1, *t_it), CGAL::compare (nt_traits.evaluate_at (polyY_1, *t_it),
y) == EQUAL) y) == EQUAL)
{ {
info.first.push_back (Intersection_point_2 (*s_it, *t_it, info.first.push_back (Intersection_point (*s_it, *t_it,
x / denX, y / denY)); x / denX, y / denY));
} }
} }
@ -535,10 +535,8 @@ _Bezier_cache<NtTraits>::get_intersections
CGAL_assertion(CGAL::sign (s) != NEGATIVE && CGAL::compare (s, one) != LARGER && CGAL_assertion(CGAL::sign (s) != NEGATIVE && CGAL::compare (s, one) != LARGER &&
CGAL::sign (t) != NEGATIVE && CGAL::compare (t, one) != LARGER); CGAL::sign (t) != NEGATIVE && CGAL::compare (t, one) != LARGER);
if (!swapt) if (!swapt) info.first.push_back(Intersection_point(s, t,pit1->x, pit1->y));
info.first.push_back (Intersection_point_2 (s, t,pit1->x, pit1->y)); else info.first.push_back(Intersection_point(t, s,pit1->x, pit1->y));
else
info.first.push_back (Intersection_point_2 (t, s,pit1->x, pit1->y));
} }
info.second = false; info.second = false;

View File

@ -1830,7 +1830,7 @@ public:
typedef typename Base::Rat_vector Rat_vector; typedef typename Base::Rat_vector Rat_vector;
typedef typename Base::Polynomial Polynomial; typedef typename Base::Polynomial Polynomial;
typedef std::pair<Point_2,Multiplicity> Intersection_point_2; typedef std::pair<Point_2,Multiplicity> Intersection_point;
/// \name Constrcution methods. /// \name Constrcution methods.
@ -1967,138 +1967,118 @@ public:
CGAL_precondition (this->is_valid() && this->is_continuous()); CGAL_precondition (this->is_valid() && this->is_continuous());
CGAL_precondition (arc.is_valid() && arc.is_continuous()); CGAL_precondition (arc.is_valid() && arc.is_continuous());
if (this->_has_same_base (arc)) if (this->_has_same_base (arc)) {
{ Alg_kernel ker;
Alg_kernel ker;
// Get the left and right endpoints of (*this) and their information // Get the left and right endpoints of (*this) and their information
// bits. // bits.
const Point_2& left1 = (this->is_directed_right() ? const Point_2& left1 =
this->_ps : this->_pt); (this->is_directed_right() ? this->_ps : this->_pt);
const Point_2& right1 = (this->is_directed_right() ? const Point_2& right1 =
this->_pt : this->_ps); (this->is_directed_right() ? this->_pt : this->_ps);
int info_left1, info_right1; int info_left1, info_right1;
if (this->is_directed_right()) if (this->is_directed_right()) {
{
info_left1 = (this->_info & this->SRC_INFO_BITS); info_left1 = (this->_info & this->SRC_INFO_BITS);
info_right1 = ((this->_info & this->TRG_INFO_BITS) >> 4); info_right1 = ((this->_info & this->TRG_INFO_BITS) >> 4);
} }
else else {
{
info_right1 = (this->_info & this->SRC_INFO_BITS); info_right1 = (this->_info & this->SRC_INFO_BITS);
info_left1 = ((this->_info & this->TRG_INFO_BITS) >> 4); info_left1 = ((this->_info & this->TRG_INFO_BITS) >> 4);
} }
// Get the left and right endpoints of the other arc and their // Get the left and right endpoints of the other arc and their
// information bits. // information bits.
const Point_2& left2 = (arc.is_directed_right() ? arc._ps : arc._pt); const Point_2& left2 = (arc.is_directed_right() ? arc._ps : arc._pt);
const Point_2& right2 = (arc.is_directed_right() ? arc._pt : arc._ps); const Point_2& right2 = (arc.is_directed_right() ? arc._pt : arc._ps);
int info_left2, info_right2; int info_left2, info_right2;
if (arc.is_directed_right()) if (arc.is_directed_right()) {
{
info_left2 = (arc._info & this->SRC_INFO_BITS); info_left2 = (arc._info & this->SRC_INFO_BITS);
info_right2 = ((arc._info & this->TRG_INFO_BITS) >> 4); info_right2 = ((arc._info & this->TRG_INFO_BITS) >> 4);
} }
else else {
{
info_right2 = (arc._info & this->SRC_INFO_BITS); info_right2 = (arc._info & this->SRC_INFO_BITS);
info_left2 = ((arc._info & this->TRG_INFO_BITS) >> 4); info_left2 = ((arc._info & this->TRG_INFO_BITS) >> 4);
} }
// Locate the left curve-end with larger x-coordinate. // Locate the left curve-end with larger x-coordinate.
bool at_minus_infinity = false; bool at_minus_infinity = false;
Arr_parameter_space inf_l1 = this->left_infinite_in_x(); Arr_parameter_space inf_l1 = this->left_infinite_in_x();
Arr_parameter_space inf_l2 = arc.left_infinite_in_x(); Arr_parameter_space inf_l2 = arc.left_infinite_in_x();
Point_2 p_left; Point_2 p_left;
int info_left; int info_left;
if (inf_l1 == ARR_INTERIOR && inf_l2 == ARR_INTERIOR) if (inf_l1 == ARR_INTERIOR && inf_l2 == ARR_INTERIOR) {
{
// Let p_left be the rightmost of the two left endpoints. // Let p_left be the rightmost of the two left endpoints.
if (ker.compare_x_2_object() (left1, left2) == LARGER) if (ker.compare_x_2_object() (left1, left2) == LARGER) {
{
p_left = left1; p_left = left1;
info_left = info_left1; info_left = info_left1;
} }
else else {
{
p_left = left2; p_left = left2;
info_left = info_left2; info_left = info_left2;
} }
} }
else if (inf_l1 == ARR_INTERIOR) else if (inf_l1 == ARR_INTERIOR) {
{
// Let p_left be the left endpoint of (*this). // Let p_left be the left endpoint of (*this).
p_left = left1; p_left = left1;
info_left = info_left1; info_left = info_left1;
} }
else if (inf_l2 == ARR_INTERIOR) else if (inf_l2 == ARR_INTERIOR) {
{
// Let p_left be the left endpoint of the other arc. // Let p_left be the left endpoint of the other arc.
p_left = left2; p_left = left2;
info_left = info_left2; info_left = info_left2;
} }
else else {
{
// Both arcs are defined at x = -oo. // Both arcs are defined at x = -oo.
at_minus_infinity = true; at_minus_infinity = true;
info_left = info_left1; info_left = info_left1;
} }
// Locate the right curve-end with smaller x-coordinate. // Locate the right curve-end with smaller x-coordinate.
bool at_plus_infinity = false; bool at_plus_infinity = false;
Arr_parameter_space inf_r1 = this->right_infinite_in_x(); Arr_parameter_space inf_r1 = this->right_infinite_in_x();
Arr_parameter_space inf_r2 = arc.right_infinite_in_x(); Arr_parameter_space inf_r2 = arc.right_infinite_in_x();
Point_2 p_right; Point_2 p_right;
int info_right; int info_right;
if (inf_r1 == ARR_INTERIOR && inf_r2 == ARR_INTERIOR) if (inf_r1 == ARR_INTERIOR && inf_r2 == ARR_INTERIOR) {
{
// Let p_right be the rightmost of the two right endpoints. // Let p_right be the rightmost of the two right endpoints.
if (ker.compare_x_2_object() (right1, right2) == SMALLER) if (ker.compare_x_2_object() (right1, right2) == SMALLER) {
{
p_right = right1; p_right = right1;
info_right = info_right1; info_right = info_right1;
} }
else else {
{
p_right = right2; p_right = right2;
info_right = info_right2; info_right = info_right2;
} }
} }
else if (inf_r1 == ARR_INTERIOR) else if (inf_r1 == ARR_INTERIOR) {
{
// Let p_right be the right endpoint of (*this). // Let p_right be the right endpoint of (*this).
p_right = right1; p_right = right1;
info_right = info_right1; info_right = info_right1;
} }
else if (inf_r2 == ARR_INTERIOR) else if (inf_r2 == ARR_INTERIOR) {
{
// Let p_right be the right endpoint of the other arc. // Let p_right be the right endpoint of the other arc.
p_right = right2; p_right = right2;
info_right = info_right2; info_right = info_right2;
} }
else else {
{
// Both arcs are defined at x = +oo. // Both arcs are defined at x = +oo.
at_plus_infinity = true; at_plus_infinity = true;
info_right = info_right2; info_right = info_right2;
} }
// Check the case of two bounded (in x) ends. // Check the case of two bounded (in x) ends.
if (! at_minus_infinity && ! at_plus_infinity) if (! at_minus_infinity && ! at_plus_infinity) {
{
Comparison_result res = ker.compare_x_2_object() (p_left, p_right); Comparison_result res = ker.compare_x_2_object() (p_left, p_right);
if (res == LARGER) if (res == LARGER) {
{
// The x-range of the overlap is empty, so there is no overlap. // The x-range of the overlap is empty, so there is no overlap.
return (oi); return oi;
} }
else if (res == EQUAL) if (res == EQUAL) {
{
// We have a single overlapping point. Just make sure this point // We have a single overlapping point. Just make sure this point
// is not at y = -/+ oo. // is not at y = -/+ oo.
if (info_left && if (info_left &&
@ -2106,20 +2086,19 @@ public:
info_right && info_right &&
(this->SRC_AT_Y_MINUS_INFTY | this->SRC_AT_Y_PLUS_INFTY) == 0) (this->SRC_AT_Y_MINUS_INFTY | this->SRC_AT_Y_PLUS_INFTY) == 0)
{ {
Intersection_point_2 ip (p_left, 0); Intersection_point ip (p_left, 0);
*oi = make_object (ip); *oi++ = make_object (ip);
++oi;
} }
return (oi); return oi;
} }
} }
// Create the overlapping portion of the rational arc by properly setting // Create the overlapping portion of the rational arc by properly setting
// the source (left) and target (right) endpoints and their information // the source (left) and target (right) endpoints and their information
// bits. // bits.
Self overlap_arc (*this); Self overlap_arc(*this);
overlap_arc._ps = p_left; overlap_arc._ps = p_left;
overlap_arc._pt = p_right; overlap_arc._pt = p_right;
@ -2128,10 +2107,9 @@ public:
this->IS_DIRECTED_RIGHT | this->IS_CONTINUOUS | this->IS_DIRECTED_RIGHT | this->IS_CONTINUOUS |
this->IS_VALID); this->IS_VALID);
*oi = make_object (overlap_arc); *oi++ = make_object(overlap_arc);
++oi;
return (oi); return oi;
} }
// We wish to find the intersection points between: // We wish to find the intersection points between:
@ -2140,39 +2118,34 @@ public:
// //
// It is clear that the x-coordinates of the intersection points are // It is clear that the x-coordinates of the intersection points are
// the roots of the polynomial: ip(x) = p1(x)*q2(x) - p2(x)*q1(x). // the roots of the polynomial: ip(x) = p1(x)*q2(x) - p2(x)*q1(x).
Nt_traits nt_traits; Nt_traits nt_traits;
Polynomial ipoly = this->_numer * arc._denom - Polynomial ipoly = this->_numer * arc._denom - arc._numer* this->_denom;
arc._numer * this->_denom; std::list<Algebraic> xs;
std::list<Algebraic> xs;
typename std::list<Algebraic>::const_iterator x_iter; typename std::list<Algebraic>::const_iterator x_iter;
nt_traits.compute_polynomial_roots (ipoly, nt_traits.compute_polynomial_roots(ipoly, std::back_inserter(xs));
std::back_inserter(xs));
// Go over the x-values we obtained. For each value produce an // Go over the x-values we obtained. For each value produce an
// intersection point if it is contained in the x-range of both curves. // intersection point if it is contained in the x-range of both curves.
unsigned int mult; unsigned int mult;
for (x_iter = xs.begin(); x_iter != xs.end(); ++x_iter) for (x_iter = xs.begin(); x_iter != xs.end(); ++x_iter) {
{
if (this->_is_in_true_x_range (*x_iter) && if (this->_is_in_true_x_range (*x_iter) &&
arc._is_in_true_x_range (*x_iter)) arc._is_in_true_x_range (*x_iter))
{ {
// Compute the intersection point and obtain its multiplicity. // Compute the intersection point and obtain its multiplicity.
Point_2 p (*x_iter, nt_traits.evaluate_at (this->_numer, *x_iter) / Point_2 p(*x_iter, nt_traits.evaluate_at (this->_numer, *x_iter) /
nt_traits.evaluate_at (this->_denom, *x_iter)); nt_traits.evaluate_at (this->_denom, *x_iter));
this->compare_slopes (arc, p, mult); this->compare_slopes(arc, p, mult);
// Output the intersection point: // Output the intersection point:
Intersection_point_2 ip (p, mult); Intersection_point ip(p, mult);
*oi++ = make_object(ip);
*oi = make_object (ip);
++oi;
} }
} }
return (oi); return oi;
} }
/*! /*!

File diff suppressed because it is too large Load Diff

View File

@ -7,9 +7,9 @@
// $Id$ // $Id$
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
// //
// Author(s) : Efi Fogel <efif@post.tau.ac.il> // Author(s): Efi Fogel <efif@post.tau.ac.il>
// Ron Wein <wein@post.tau.ac.il> // Ron Wein <wein@post.tau.ac.il>
// (base on old version by: Iddo Hanniel) // (base on old version by: Iddo Hanniel)
#ifndef CGAL_ARR_NON_CACHING_SEGMENT_TRAITS_H #ifndef CGAL_ARR_NON_CACHING_SEGMENT_TRAITS_H
#define CGAL_ARR_NON_CACHING_SEGMENT_TRAITS_H #define CGAL_ARR_NON_CACHING_SEGMENT_TRAITS_H
@ -27,6 +27,8 @@
* functors required by the concept it models. * functors required by the concept it models.
*/ */
#include <boost/variant.hpp>
#include <CGAL/Exact_predicates_exact_constructions_kernel.h> #include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/tags.h> #include <CGAL/tags.h>
#include <CGAL/Arr_tags.h> #include <CGAL/Arr_tags.h>
@ -39,7 +41,7 @@ namespace CGAL {
* A model of the ArrangementTraits_2 concept that handles general * A model of the ArrangementTraits_2 concept that handles general
* line segments. * line segments.
*/ */
template <class Kernel_T = Exact_predicates_exact_constructions_kernel> template <typename Kernel_T = Exact_predicates_exact_constructions_kernel>
class Arr_non_caching_segment_traits_2 : class Arr_non_caching_segment_traits_2 :
public Arr_non_caching_segment_basic_traits_2<Kernel_T> public Arr_non_caching_segment_basic_traits_2<Kernel_T>
{ {
@ -114,12 +116,10 @@ public:
/*! \class /*! \class
* A functor for splitting curves into x-monotone pieces. * A functor for splitting curves into x-monotone pieces.
*/ */
class Make_x_monotone_2 class Make_x_monotone_2 {
{
public: public:
/*! /*! Cut the given segment into x-monotone subcurves and insert them into
* Cut the given segment into x-monotone subcurves and insert them into
* the given output iterator. As segments are always x_monotone, only one * the given output iterator. As segments are always x_monotone, only one
* x-monotone curve is inserted into the output iterator. * x-monotone curve is inserted into the output iterator.
* \param cv The segment. * \param cv The segment.
@ -127,54 +127,47 @@ public:
* object is a wrapper of an X_monotone_curve_2 object. * object is a wrapper of an X_monotone_curve_2 object.
* \return The past-the-end iterator. * \return The past-the-end iterator.
*/ */
template<class OutputIterator> template <typename OutputIterator>
OutputIterator operator()(const Curve_2 & cv, OutputIterator oi) const OutputIterator operator()(const Curve_2& cv, OutputIterator oi) const
{ {
*oi = make_object (cv); *oi++ = make_object(cv);
++oi; return oi;
return (oi);
} }
}; };
/*! Get a Make_x_monotone_2 functor object. */ /*! Obtain a Make_x_monotone_2 functor object. */
Make_x_monotone_2 make_x_monotone_2_object() const Make_x_monotone_2 make_x_monotone_2_object() const
{ { return Make_x_monotone_2(); }
return Make_x_monotone_2();
}
/*! \class /*! \class
* A functor for splitting a segment into two segements. * A functor for splitting a segment into two segements.
*/ */
class Split_2 class Split_2 {
{
typedef Arr_non_caching_segment_traits_2<Kernel_T> Self; typedef Arr_non_caching_segment_traits_2<Kernel_T> Self;
public:
/*! public:
* Split a given x-monotone curve at a given point into two sub-curves. /*! Split a given x-monotone curve at a given point into two sub-curves.
* \param cv The curve to split * \param cv The curve to split
* \param p The split point. * \param p The split point.
* \param c1 Output: The left resulting subcurve (p is its right endpoint). * \param c1 Output: The left resulting subcurve (p is its right endpoint).
* \param c2 Output: The right resulting subcurve (p is its left endpoint). * \param c2 Output: The right resulting subcurve (p is its left endpoint).
* \pre p lies on cv but is not one of its end-points. * \pre p lies on cv but is not one of its end-points.
*/ */
void operator()(const X_monotone_curve_2 & cv, const Point_2 & p, void operator()(const X_monotone_curve_2& cv, const Point_2& p,
X_monotone_curve_2 & c1, X_monotone_curve_2 & c2) const X_monotone_curve_2& c1, X_monotone_curve_2& c2) const
{ {
Base base; Base base;
// Make sure that p lies on the interior of the curve. // Make sure that p lies on the interior of the curve.
CGAL_precondition_code ( CGAL_precondition_code(auto compare_xy = base.compare_xy_2_object());
Compare_xy_2 compare_xy = base.compare_xy_2_object();
);
Construct_min_vertex_2 min_vertex = base.construct_min_vertex_2_object(); Construct_min_vertex_2 min_vertex = base.construct_min_vertex_2_object();
Construct_max_vertex_2 max_vertex = base.construct_max_vertex_2_object(); Construct_max_vertex_2 max_vertex = base.construct_max_vertex_2_object();
const Point_2 & left = min_vertex(cv); const Point_2& left = min_vertex(cv);
const Point_2 & right = max_vertex(cv); const Point_2& right = max_vertex(cv);
CGAL_precondition CGAL_precondition
(Segment_assertions::_assert_is_point_on(p, cv, Has_exact_division())&& (Segment_assertions::_assert_is_point_on(p, cv, Has_exact_division()) &&
compare_xy(left, p) == SMALLER && compare_xy(left, p) == SMALLER &&
compare_xy(right, p) == LARGER); compare_xy(right, p) == LARGER);
@ -182,31 +175,36 @@ public:
base.construct_segment_2_object(); base.construct_segment_2_object();
Self self; Self self;
if(self.compare_endpoints_xy_2_object()(cv) == SMALLER) if (self.compare_endpoints_xy_2_object()(cv) == SMALLER) {
{
c1 = construct_segment(left, p); c1 = construct_segment(left, p);
c2 = construct_segment(p, right); c2 = construct_segment(p, right);
} }
else else {
{
c1 = construct_segment(p, left); c1 = construct_segment(p, left);
c2 = construct_segment(right, p); c2 = construct_segment(right, p);
} }
} }
}; };
/*! Get a Split_2 functor object. */ /*! Obtain a Split_2 functor object. */
Split_2 split_2_object() const Split_2 split_2_object() const { return Split_2(); }
{
return Split_2();
}
/*! \class /*! \class
* A functor for computing intersections. * A functor for computing intersections.
*/ */
class Intersect_2 class Intersect_2 {
{ protected:
typedef Arr_non_caching_segment_traits_2<Kernel_T> Self; typedef Arr_non_caching_segment_traits_2<Kernel> Traits;
/*! The traits (in case it has state) */
const Traits& m_traits;
/*! Constructor
* \param traits the traits (in case it has state)
*/
Intersect_2(const Traits& traits) : m_traits(traits) {}
friend class Arr_non_caching_segment_traits_2<Kernel>;
public: public:
/*! Find the intersections of the two given segments and insert them into /*! Find the intersections of the two given segments and insert them into
@ -217,67 +215,56 @@ public:
* \param oi The output iterator. * \param oi The output iterator.
* \return The past-the-end iterator. * \return The past-the-end iterator.
*/ */
template<class OutputIterator> template <typename OutputIterator>
OutputIterator operator()(const X_monotone_curve_2 & cv1, OutputIterator operator()(const X_monotone_curve_2& cv1,
const X_monotone_curve_2 & cv2, const X_monotone_curve_2& cv2,
OutputIterator oi) const OutputIterator oi) const
{ {
Base base; typedef std::pair<Point_2, Multiplicity> Intersection_point;
Object res = base.intersect_2_object()(cv1, cv2); typedef boost::variant<Intersection_point, X_monotone_curve_2>
Intersection_result;
const Kernel& kernel = m_traits;
auto res = kernel.intersect_2_object()(cv1, cv2);
// There is no intersection: // There is no intersection:
if (res.is_empty()) if (! res) return oi;
return (oi);
// Chack if the intersection is a point: // Chack if the intersection is a point:
const Point_2 *ip; const Point_2* p_p = boost::get<Point_2>(&*res);
if (p_p != nullptr) {
if ((ip = object_cast<Point_2> (&res)) != nullptr)
{
// Create a pair representing the point with its multiplicity, // Create a pair representing the point with its multiplicity,
// which is always 1 for line segments for all practical purposes. // which is always 1 for line segments for all practical purposes.
// If the two segments intersect at their endpoints, then the // If the two segments intersect at their endpoints, then the
// multiplicity is undefined, but we deliberately ignore it for // multiplicity is undefined, but we deliberately ignore it for
// efficieny reasons. // efficieny reasons.
std::pair<Point_2,Multiplicity> ip_mult(*ip, 1); *oi++ = Intersection_result(Intersection_point(*p_p, 1));
*oi = make_object (ip_mult); return oi;
++oi;
} }
else
{
// The intersection is a segment.
const X_monotone_curve_2 *ov = object_cast<X_monotone_curve_2>(&res); // The intersection is a segment.
CGAL_assertion (ov != nullptr); const X_monotone_curve_2* cv_p = boost::get<X_monotone_curve_2>(&*res);
CGAL_assertion(cv_p != nullptr);
Self self; Comparison_result cmp1 = m_traits.compare_endpoints_xy_2_object()(cv1);
Comparison_result cmp1 = self.compare_endpoints_xy_2_object()(cv1); Comparison_result cmp2 = m_traits.compare_endpoints_xy_2_object()(cv2);
Comparison_result cmp2 = self.compare_endpoints_xy_2_object()(cv2);
if(cmp1 == cmp2) if (cmp1 == cmp2) {
{ // cv1 and cv2 have the same directions, maintain this direction
// cv1 and cv2 have the same directions, maintain this direction // in the overlap segment
// in the overlap segment if (m_traits.compare_endpoints_xy_2_object()(*cv_p) != cmp1) {
if(self.compare_endpoints_xy_2_object()(*ov) != cmp1) auto ctr_opposite = kernel.construct_opposite_segment_2_object();
{ *oi++ = Intersection_result(ctr_opposite(*cv_p));
Kernel k; return oi;
res = make_object(k.construct_opposite_segment_2_object()(*ov));
}
} }
*oi = res;
++oi;
} }
*oi++ = Intersection_result(*cv_p);
return (oi); return oi;
} }
}; };
/*! Get an Intersect_2 functor object. */ /*! Obtain an Intersect_2 functor object. */
Intersect_2 intersect_2_object() const Intersect_2 intersect_2_object() const { return Intersect_2(*this); }
{
return Intersect_2();
}
/*! \class /*! \class
* A functor for testing whether two segments are mergeable. * A functor for testing whether two segments are mergeable.
@ -297,24 +284,22 @@ public:
friend class Arr_non_caching_segment_traits_2<Kernel>; friend class Arr_non_caching_segment_traits_2<Kernel>;
public: public:
/*! Check whether it is possible to merge two given x-monotone curves.
/*!
* Check whether it is possible to merge two given x-monotone curves.
* \param cv1 The first curve. * \param cv1 The first curve.
* \param cv2 The second curve. * \param cv2 The second curve.
* \return (true) if the two curves are mergeable, that is, if they are * \return (true) if the two curves are mergeable, that is, if they are
* supported by the same line; (false) otherwise. * supported by the same line; (false) otherwise.
* \pre cv1 and cv2 share a common endpoint. * \pre cv1 and cv2 share a common endpoint.
*/ */
bool operator()(const X_monotone_curve_2 & cv1, bool operator()(const X_monotone_curve_2& cv1,
const X_monotone_curve_2 & cv2) const const X_monotone_curve_2& cv2) const
{ {
const Base* base = m_traits; const Base* base = m_traits;
Equal_2 equal = base->equal_2_object(); Equal_2 equal = base->equal_2_object();
Construct_min_vertex_2 min_vertex = base->construct_min_vertex_2_object(); Construct_min_vertex_2 min_vertex = base->construct_min_vertex_2_object();
Construct_max_vertex_2 max_vertex = base->construct_max_vertex_2_object(); Construct_max_vertex_2 max_vertex = base->construct_max_vertex_2_object();
if (!equal(max_vertex(cv1), min_vertex(cv2)) && if (! equal(max_vertex(cv1), min_vertex(cv2)) &&
!equal(max_vertex(cv2), min_vertex(cv1))) ! equal(max_vertex(cv2), min_vertex(cv1)))
return false; return false;
// Check if the two curves have the same supporting line. // Check if the two curves have the same supporting line.
@ -344,16 +329,15 @@ public:
friend class Arr_non_caching_segment_traits_2<Kernel>; friend class Arr_non_caching_segment_traits_2<Kernel>;
public: public:
/*! /*! Merge two given segments into a single segment.
* Merge two given segments into a single segment.
* \param cv1 The first curve. * \param cv1 The first curve.
* \param cv2 The second curve. * \param cv2 The second curve.
* \param c Output: The merged curve. * \param c Output: The merged curve.
* \pre The two curves are mergeable. * \pre The two curves are mergeable.
*/ */
void operator()(const X_monotone_curve_2 & cv1, void operator()(const X_monotone_curve_2& cv1,
const X_monotone_curve_2 & cv2, const X_monotone_curve_2& cv2,
X_monotone_curve_2 & c) const X_monotone_curve_2& c) const
{ {
CGAL_precondition(m_traits->are_mergeable_2_object()(cv2, cv1)); CGAL_precondition(m_traits->are_mergeable_2_object()(cv2, cv1));
@ -390,12 +374,9 @@ public:
/*! Obtain a Construct_opposite_2 functor object */ /*! Obtain a Construct_opposite_2 functor object */
Construct_opposite_2 construct_opposite_2_object() const Construct_opposite_2 construct_opposite_2_object() const
{ { return Construct_opposite_2(); }
return Construct_opposite_2();
}
class Compare_endpoints_xy_2 class Compare_endpoints_xy_2 {
{
public: public:
/*! /*!
* Compare the two endpoints of a given curve lexigoraphically. * Compare the two endpoints of a given curve lexigoraphically.
@ -417,9 +398,7 @@ public:
/*! Obtain a Compare_endpoints_xy_2 functor object */ /*! Obtain a Compare_endpoints_xy_2 functor object */
Compare_endpoints_xy_2 compare_endpoints_xy_2_object() const Compare_endpoints_xy_2 compare_endpoints_xy_2_object() const
{ { return Compare_endpoints_xy_2(); }
return Compare_endpoints_xy_2();
}
//@} //@}
}; };

View File

@ -142,7 +142,7 @@ public:
private: private:
Trpz_parameter_space* ptr() const { return (Trpz_parameter_space*)(PTR.p); } Trpz_parameter_space* ptr() const { return (Trpz_parameter_space*)(PTR); }
#ifndef CGAL_TD_DEBUG #ifndef CGAL_TD_DEBUG
@ -323,7 +323,7 @@ public:
{ {
//define the initial trapezoid: left, right, btm, top are at infinity. //define the initial trapezoid: left, right, btm, top are at infinity.
// its type is TD_TRAPEZOID ,it is on all boundaries, and has no neighbours // its type is TD_TRAPEZOID ,it is on all boundaries, and has no neighbours
PTR.p = new Trpz_parameter_space PTR = new Trpz_parameter_space
(Traits::vtx_at_left_infinity(), (Traits::vtx_at_left_infinity(),
Traits::vtx_at_right_infinity(), Traits::vtx_at_right_infinity(),
Traits::he_at_bottom_infinity(), Traits::he_at_bottom_infinity(),
@ -353,7 +353,7 @@ public:
else //tp == TD_VERTEX else //tp == TD_VERTEX
type_flag |= CGAL_TD_VERTEX; type_flag |= CGAL_TD_VERTEX;
PTR.p = new Trpz_parameter_space PTR = new Trpz_parameter_space
(l, r, b, t, type_flag | boundness_flag, lb, lt, rb, rt); (l, r, b, t, type_flag | boundness_flag, lb, lt, rb, rt);
m_dag_node = node; m_dag_node = node;
} }
@ -370,7 +370,7 @@ public:
Self* rb = 0, Self* rt = 0, Self* rb = 0, Self* rt = 0,
Dag_node* node = 0) Dag_node* node = 0)
{ {
PTR.p = new Trpz_parameter_space PTR = new Trpz_parameter_space
(l ? *l : Traits::vtx_at_left_infinity(), (l ? *l : Traits::vtx_at_left_infinity(),
r ? *r : Traits::vtx_at_right_infinity(), r ? *r : Traits::vtx_at_right_infinity(),
b ? *b : Traits::he_at_bottom_infinity(), b ? *b : Traits::he_at_bottom_infinity(),
@ -436,7 +436,7 @@ public:
/*! Access the trapezoid id (PTR). */ /*! Access the trapezoid id (PTR). */
CGAL_TD_INLINE unsigned long id() const CGAL_TD_INLINE unsigned long id() const
{ {
return (unsigned long) PTR.p; return (unsigned long) PTR;
} }
/*! Access trapezoid left. */ /*! Access trapezoid left. */

View File

@ -135,7 +135,7 @@ public:
private: private:
Data* ptr() const { return (Data*)(PTR.p); } Data* ptr() const { return (Data*)(PTR); }
#ifndef CGAL_TD_DEBUG #ifndef CGAL_TD_DEBUG
@ -194,7 +194,7 @@ public:
Td_active_edge () Td_active_edge ()
{ {
PTR.p = new Data PTR = new Data
(Traits::empty_he_handle(), Td_map_item(0), nullptr); (Traits::empty_he_handle(), Td_map_item(0), nullptr);
//m_dag_node = nullptr; //m_dag_node = nullptr;
} }
@ -204,7 +204,7 @@ public:
boost::optional<Td_map_item&> next = boost::none) boost::optional<Td_map_item&> next = boost::none)
{ {
PTR.p = new Data(he, (next) ? *next : Td_map_item(0), node); PTR = new Data(he, (next) ? *next : Td_map_item(0), node);
//m_dag_node = node; //m_dag_node = node;
} }
@ -261,7 +261,7 @@ public:
/*! Access the trapezoid id (PTR). */ /*! Access the trapezoid id (PTR). */
CGAL_TD_INLINE unsigned long id() const CGAL_TD_INLINE unsigned long id() const
{ {
return (unsigned long) PTR.p; return (unsigned long) PTR;
} }

View File

@ -129,7 +129,7 @@ public:
}; };
private: private:
Data* ptr() const { return (Data*)(PTR.p); } Data* ptr() const { return (Data*)(PTR); }
Curve_end vtx_to_ce(Vertex_const_handle v) const Curve_end vtx_to_ce(Vertex_const_handle v) const
{ {
@ -180,14 +180,14 @@ public:
Td_active_fictitious_vertex() Td_active_fictitious_vertex()
{ {
PTR.p = new Data(Traits::empty_vtx_handle(), Traits::empty_he_handle(), nullptr); PTR = new Data(Traits::empty_vtx_handle(), Traits::empty_he_handle(), nullptr);
} }
/*! Constructor given Vertex & Halfedge handles. */ /*! Constructor given Vertex & Halfedge handles. */
Td_active_fictitious_vertex(Vertex_const_handle v, Td_active_fictitious_vertex(Vertex_const_handle v,
Halfedge_const_handle cw_he, Halfedge_const_handle cw_he,
Dag_node* node = 0) Dag_node* node = 0)
{ PTR.p = new Data(v, cw_he, node); } { PTR = new Data(v, cw_he, node); }
/*! Copy constructor. */ /*! Copy constructor. */
@ -224,7 +224,7 @@ public:
inline const Self& self() const { return *this; } inline const Self& self() const { return *this; }
/*! Access the trapezoid id (PTR). */ /*! Access the trapezoid id (PTR). */
inline unsigned long id() const { return (unsigned long) PTR.p; } inline unsigned long id() const { return (unsigned long) PTR; }
/*! Access trapezoid left. /*! Access trapezoid left.
* filters out the infinite case which returns predefined dummy values * filters out the infinite case which returns predefined dummy values

View File

@ -144,7 +144,7 @@ public:
private: private:
Data* ptr() const { return (Data*)(PTR.p); } Data* ptr() const { return (Data*)(PTR); }
public: public:
@ -255,7 +255,7 @@ private:
{ {
//define the initial trapezoid: left, right, btm, top are at infinity. //define the initial trapezoid: left, right, btm, top are at infinity.
// has no neighbours // has no neighbours
PTR.p = new Data PTR = new Data
(Traits::empty_vtx_handle(), (Traits::empty_vtx_handle(),
Traits::empty_vtx_handle(), Traits::empty_vtx_handle(),
Traits::empty_he_handle(), Traits::empty_he_handle(),
@ -274,7 +274,7 @@ private:
boost::optional<Td_map_item&> rt = boost::none, boost::optional<Td_map_item&> rt = boost::none,
Dag_node* node = 0) Dag_node* node = 0)
{ {
PTR.p = new Data (l, r, b, t, (lb) ? *lb : Td_map_item(0), (lt) ? *lt : Td_map_item(0), PTR = new Data (l, r, b, t, (lb) ? *lb : Td_map_item(0), (lt) ? *lt : Td_map_item(0),
(rb) ? *rb : Td_map_item(0), (rt) ? *rt : Td_map_item(0), node); (rb) ? *rb : Td_map_item(0), (rt) ? *rt : Td_map_item(0), node);
//m_dag_node = node; //m_dag_node = node;
} }
@ -332,7 +332,7 @@ private:
/*! Access the trapezoid id (PTR). */ /*! Access the trapezoid id (PTR). */
inline unsigned long id() const inline unsigned long id() const
{ {
return (unsigned long) PTR.p; return (unsigned long) PTR;
} }
/*! Access trapezoid left. /*! Access trapezoid left.

View File

@ -134,7 +134,7 @@ public:
}; };
private: private:
Data* ptr() const { return (Data*)(PTR.p); } Data* ptr() const { return (Data*)(PTR); }
Curve_end vtx_to_ce(Vertex_const_handle v) const Curve_end vtx_to_ce(Vertex_const_handle v) const
{ {
@ -184,14 +184,14 @@ public:
Td_active_vertex() Td_active_vertex()
{ {
PTR.p = new Data(Traits::empty_vtx_handle(), Traits::empty_he_handle(), nullptr); PTR = new Data(Traits::empty_vtx_handle(), Traits::empty_he_handle(), nullptr);
} }
/*! Constructor given Vertex & Halfedge handles. */ /*! 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) Dag_node* node = 0)
{ PTR.p = new Data(v, cw_he, node); } { PTR = new Data(v, cw_he, node); }
/*! Copy constructor. */ /*! Copy constructor. */
@ -228,7 +228,7 @@ public:
inline const Self& self() const { return *this; } inline const Self& self() const { return *this; }
/*! Access the trapezoid id (PTR). */ /*! Access the trapezoid id (PTR). */
inline unsigned long id() const { return (unsigned long) PTR.p; } 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; }

View File

@ -41,14 +41,14 @@ public: //iddo (for CC-7.2) maybe protected?
typedef const T & const_reference; typedef const T & const_reference;
protected: protected:
void init() { PTR.p = 0; } void init() { PTR = 0; }
public: public:
Td_dag_base() {init();} Td_dag_base() {init();}
Td_dag_base(const Td_dag_base<T> & x) : Handle(x) {} Td_dag_base(const Td_dag_base<T> & x) : Handle(x) {}
Td_dag_base & operator=(const Td_dag_base<T> & x) Td_dag_base & operator=(const Td_dag_base<T> & x)
{Handle::operator=(x); return *this; } {Handle::operator=(x); return *this; }
bool operator!() const { return PTR.p == 0; } bool operator!() const { return PTR == 0; }
}; };
template<class T> template<class T>
@ -96,9 +96,9 @@ public:
Td_dag(){} Td_dag(){}
Td_dag(const Td_dag_handle& dag):Td_dag_handle(dag){} Td_dag(const Td_dag_handle& dag):Td_dag_handle(dag){}
Td_dag(const Self& dag):Td_dag_handle(dag){} Td_dag(const Self& dag):Td_dag_handle(dag){}
Td_dag(const T& rootValue){PTR.p = new node(rootValue);} Td_dag(const T& rootValue){PTR = new node(rootValue);}
Td_dag(const T& rootValue, const Self& left, const Self& right) Td_dag(const T& rootValue, const Self& left, const Self& right)
{PTR.p = new node(rootValue, left, right); rebalance_depth();} {PTR = new node(rootValue, left, right); rebalance_depth();}
~Td_dag(){} ~Td_dag(){}
/* --------information retrieval -------*/ /* --------information retrieval -------*/
@ -145,7 +145,7 @@ public:
} }
bool operator==(const Self& b) const bool operator==(const Self& b) const
{ {
return PTR.p==b.PTR.p; return PTR==b.PTR;
} }
bool operator!=(const Self& b) const bool operator!=(const Self& b) const
{ {
@ -189,7 +189,7 @@ public:
// detach left son,redirect to dummy // detach left son,redirect to dummy
set_left(dummy); set_left(dummy);
// set left son pointer to 0 // set left son pointer to 0
ptr()->leftPtr.PTR.p=0; ptr()->leftPtr.PTR=0;
// delete dummy Td_dag // delete dummy Td_dag
delete dummy.ptr(); delete dummy.ptr();
} }
@ -204,7 +204,7 @@ public:
// detach right son,redirect to dummy // detach right son,redirect to dummy
set_right(dummy); set_right(dummy);
// set right son pointer to 0 // set right son pointer to 0
ptr()->rightPtr.PTR.p=0; ptr()->rightPtr.PTR=0;
// delete dummy Td_dag // delete dummy Td_dag
delete dummy.ptr(); delete dummy.ptr();
} }
@ -371,7 +371,7 @@ protected:
} }
#endif #endif
private: private:
node* ptr() const {return (node*)PTR.p;} node* ptr() const {return (node*)PTR;}
}; };
template<class T,class Traits> template<class T,class Traits>
@ -441,7 +441,7 @@ template<class T> std::ostream& operator<<(std::ostream& out,
tech notes: tech notes:
The code is Handle designed. The code is Handle designed.
left(),right() are designed to cope with Handle(Handle& x) left(),right() are designed to cope with Handle(Handle& x)
precondition x.PTR.p!=0 precondition x.PTR!=0
operator=() performs shallow copy operator=() performs shallow copy
operator*() returns data type operator*() returns data type
output is done as a binary tree. output is done as a binary tree.

View File

@ -39,7 +39,7 @@ template<class Traits>
class Td_dag_node_base : public Handle class Td_dag_node_base : public Handle
{ {
protected: protected:
void init() { PTR.p = 0; } //MICHAL: I think it is not used - so need to be removed void init() { PTR = 0; } //MICHAL: I think it is not used - so need to be removed
public: public:
//c'tors //c'tors
@ -57,12 +57,12 @@ public:
return *this; return *this;
} }
//bool operator!() const { return PTR.p == 0; } //MICHAL: maybe use ptr(), and also can change to is_null or something similar //bool operator!() const { return PTR == 0; } //MICHAL: maybe use ptr(), and also can change to is_null or something similar
bool is_null() const { return PTR.p == 0; } bool is_null() const { return PTR == 0; }
Rep * ptr() const { return (Rep*) PTR.p; } Rep * ptr() const { return (Rep*) PTR; }
protected: protected:
//Rep *& ptr() { return (Rep*) PTR.p; } //Rep *& ptr() { return (Rep*) PTR; }
void set_ptr(Rep* rep) { PTR.p = rep; } void set_ptr(Rep* rep) { PTR = rep; }
}; };
@ -94,7 +94,7 @@ public:
#ifndef CGAL_CFG_USING_BASE_MEMBER_BUG_2 #ifndef CGAL_CFG_USING_BASE_MEMBER_BUG_2
public: public:
//using Td_dag_node_handle::PTR.p; //using Td_dag_node_handle::PTR;
//using Td_dag_node_handle::operator!; //using Td_dag_node_handle::operator!;
#endif //CGAL_CFG_USING_BASE_MEMBER_BUG_2 #endif //CGAL_CFG_USING_BASE_MEMBER_BUG_2
@ -549,7 +549,7 @@ protected:
private: private:
Node* node() const { return (Node*)Base::PTR.p; } Node* node() const { return (Node*)Base::PTR; }
}; };
@ -629,7 +629,7 @@ std::ostream& operator<< (std::ostream& out,
tech notes: tech notes:
The code is Handle designed. The code is Handle designed.
left_child(),right_child() are designed to cope with Handle(Handle& x) left_child(),right_child() are designed to cope with Handle(Handle& x)
precondition x.PTR.p!=0 precondition x.PTR!=0
operator=() performs shallow copy operator=() performs shallow copy
operator*() returns data type operator*() returns data type
output is done as a binary tree. output is done as a binary tree.

View File

@ -128,7 +128,7 @@ public:
private: private:
Data* ptr() const { return (Data*)(PTR.p); } Data* ptr() const { return (Data*)(PTR); }
#ifndef CGAL_TD_DEBUG #ifndef CGAL_TD_DEBUG
@ -161,7 +161,7 @@ public:
/*! Constructor given Vertex & Halfedge handles. */ /*! Constructor given Vertex & Halfedge handles. */
Td_inactive_edge (boost::shared_ptr<X_monotone_curve_2>& cv, Dag_node* node = nullptr) Td_inactive_edge (boost::shared_ptr<X_monotone_curve_2>& cv, Dag_node* node = nullptr)
{ {
PTR.p = new Data(cv,node); PTR = new Data(cv,node);
} }
/*! Copy constructor. */ /*! Copy constructor. */
@ -215,7 +215,7 @@ public:
/*! Access the trapezoid id (PTR). */ /*! Access the trapezoid id (PTR). */
inline unsigned long id() const inline unsigned long id() const
{ {
return (unsigned long) PTR.p; return (unsigned long) PTR;
} }
inline X_monotone_curve_2& curve() const inline X_monotone_curve_2& curve() const

View File

@ -133,7 +133,7 @@ public:
private: private:
Data* ptr() const { return (Data*)(PTR.p); } Data* ptr() const { return (Data*)(PTR); }
Curve_end vtx_to_ce(Vertex_const_handle v) const Curve_end vtx_to_ce(Vertex_const_handle v) const
{ {
@ -185,7 +185,7 @@ public:
{ {
Curve_end v_ce(vtx_to_ce(v_before_rem)); Curve_end v_ce(vtx_to_ce(v_before_rem));
PTR.p = new Data( v_ce.cv(), v_ce.ce(), node); PTR = new Data( v_ce.cv(), v_ce.ce(), node);
} }
@ -241,7 +241,7 @@ public:
/*! Access the trapezoid id (PTR). */ /*! Access the trapezoid id (PTR). */
inline unsigned long id() const inline unsigned long id() const
{ {
return (unsigned long) PTR.p; return (unsigned long) PTR;
} }

View File

@ -127,7 +127,7 @@ public:
private: private:
Data* ptr() const { return (Data*)(PTR.p); } Data* ptr() const { return (Data*)(PTR); }
#ifndef CGAL_TD_DEBUG #ifndef CGAL_TD_DEBUG
@ -162,7 +162,7 @@ public:
/*! Constructor given Vertex & Halfedge handles. */ /*! Constructor given Vertex & Halfedge handles. */
Td_inactive_vertex (Vertex_const_handle v_before_rem, Dag_node* node = nullptr) Td_inactive_vertex (Vertex_const_handle v_before_rem, Dag_node* node = nullptr)
{ {
PTR.p = new Data(v_before_rem->point(), node); PTR = new Data(v_before_rem->point(), node);
} }
@ -217,7 +217,7 @@ public:
/*! Access the trapezoid id (PTR). */ /*! Access the trapezoid id (PTR). */
inline unsigned long id() const inline unsigned long id() const
{ {
return (unsigned long) PTR.p; return (unsigned long) PTR;
} }
inline Point& point() const inline Point& point() const

View File

@ -25,6 +25,8 @@
*/ */
#include <iterator> #include <iterator>
#include <boost/variant.hpp>
#include <boost/type_traits/is_same.hpp> #include <boost/type_traits/is_same.hpp>
#include <boost/utility/enable_if.hpp> #include <boost/utility/enable_if.hpp>
@ -193,13 +195,12 @@ public:
// If the polycurve is empty, return. // If the polycurve is empty, return.
if (cv.number_of_subcurves() == 0) return oi; if (cv.number_of_subcurves() == 0) return oi;
Construct_x_monotone_curve_2 ctr_x_curve = auto ctr_x_curve = m_poly_traits.construct_x_monotone_curve_2_object();
m_poly_traits.construct_x_monotone_curve_2_object();
typename Subcurve_traits_2::Make_x_monotone_2 make_seg_x_monotone = auto make_seg_x_monotone =
m_poly_traits.subcurve_traits_2()->make_x_monotone_2_object(); m_poly_traits.subcurve_traits_2()->make_x_monotone_2_object();
typename Subcurve_traits_2::Compare_endpoints_xy_2 cmp_seg_endpts = auto cmp_seg_endpts =
m_poly_traits.subcurve_traits_2()->compare_endpoints_xy_2_object(); m_poly_traits.subcurve_traits_2()->compare_endpoints_xy_2_object();
#ifdef CGAL_ALWAYS_LEFT_TO_RIGHT #ifdef CGAL_ALWAYS_LEFT_TO_RIGHT
@ -238,12 +239,11 @@ public:
( (
// To be used in order to verify continuity and well-orientedness // To be used in order to verify continuity and well-orientedness
// of the input curve cv. // of the input curve cv.
typename Subcurve_traits_2::Construct_min_vertex_2 min_seg_v = auto min_seg_v =
m_poly_traits.subcurve_traits_2()->construct_min_vertex_2_object(); m_poly_traits.subcurve_traits_2()->construct_min_vertex_2_object();
typename Subcurve_traits_2::Construct_max_vertex_2 max_seg_v = auto max_seg_v =
m_poly_traits.subcurve_traits_2()->construct_max_vertex_2_object(); m_poly_traits.subcurve_traits_2()->construct_max_vertex_2_object();
typename Subcurve_traits_2::Equal_2 equal = auto equal = m_poly_traits.subcurve_traits_2()->equal_2_object();
m_poly_traits.subcurve_traits_2()->equal_2_object();
Point_2 last_target = (cmp_seg_endpts(x_seg) == SMALLER) ? Point_2 last_target = (cmp_seg_endpts(x_seg) == SMALLER) ?
max_seg_v(x_seg) : min_seg_v(x_seg); max_seg_v(x_seg) : min_seg_v(x_seg);
Point_2 next_src; Point_2 next_src;
@ -329,19 +329,18 @@ public:
// If the polycurve is empty, return. // If the polycurve is empty, return.
if (cv.number_of_subcurves() == 0) return oi; if (cv.number_of_subcurves() == 0) return oi;
Construct_x_monotone_curve_2 ctr_x_curve = auto ctr_x_curve = m_poly_traits.construct_x_monotone_curve_2_object();
m_poly_traits.construct_x_monotone_curve_2_object();
typename Subcurve_traits_2::Make_x_monotone_2 make_seg_x_monotone = auto make_seg_x_monotone =
m_poly_traits.subcurve_traits_2()->make_x_monotone_2_object(); m_poly_traits.subcurve_traits_2()->make_x_monotone_2_object();
typename Subcurve_traits_2::Compare_endpoints_xy_2 cmp_seg_endpts = auto cmp_seg_endpts =
m_poly_traits.subcurve_traits_2()->compare_endpoints_xy_2_object(); m_poly_traits.subcurve_traits_2()->compare_endpoints_xy_2_object();
typename Subcurve_traits_2::Parameter_space_in_x_2 ps_x = auto ps_x =
m_poly_traits.subcurve_traits_2()->parameter_space_in_x_2_object(); m_poly_traits.subcurve_traits_2()->parameter_space_in_x_2_object();
typename Subcurve_traits_2::Parameter_space_in_y_2 ps_y = auto ps_y =
m_poly_traits.subcurve_traits_2()->parameter_space_in_y_2_object(); m_poly_traits.subcurve_traits_2()->parameter_space_in_y_2_object();
#ifdef CGAL_ALWAYS_LEFT_TO_RIGHT #ifdef CGAL_ALWAYS_LEFT_TO_RIGHT
typename Subcurve_traits_2::Construct_opposite_2 ctr_seg_opposite = typename Subcurve_traits_2::Construct_opposite_2 ctr_seg_opposite =
@ -379,12 +378,11 @@ public:
( (
// To be used in order to verify continuity and well-orientedness // To be used in order to verify continuity and well-orientedness
// of the input curve cv. // of the input curve cv.
typename Subcurve_traits_2::Construct_min_vertex_2 min_seg_v = auto min_seg_v =
m_poly_traits.subcurve_traits_2()->construct_min_vertex_2_object(); m_poly_traits.subcurve_traits_2()->construct_min_vertex_2_object();
typename Subcurve_traits_2::Construct_max_vertex_2 max_seg_v = auto max_seg_v =
m_poly_traits.subcurve_traits_2()->construct_max_vertex_2_object(); m_poly_traits.subcurve_traits_2()->construct_max_vertex_2_object();
typename Subcurve_traits_2::Equal_2 equal = auto equal = m_poly_traits.subcurve_traits_2()->equal_2_object();
m_poly_traits.subcurve_traits_2()->equal_2_object();
Point_2 last_target = (cmp_seg_endpts(x_seg) == SMALLER) ? Point_2 last_target = (cmp_seg_endpts(x_seg) == SMALLER) ?
max_seg_v(x_seg) : min_seg_v(x_seg); max_seg_v(x_seg) : min_seg_v(x_seg);
Point_2 next_src; Point_2 next_src;
@ -498,9 +496,7 @@ public:
public: public:
/*! Constructor. */ /*! Constructor. */
Push_back_2(const Polycurve_traits_2& traits) : Push_back_2(const Polycurve_traits_2& traits) : Base::Push_back_2(traits) {}
Base::Push_back_2(traits)
{}
// Normally, the moment the compiler finds a name, it stops looking. In // Normally, the moment the compiler finds a name, it stops looking. In
// other words, the compiler first finds the operator() in the current // other words, the compiler first finds the operator() in the current
@ -584,20 +580,16 @@ public:
X_monotone_curve_2& xcv1, X_monotone_curve_2& xcv2) const X_monotone_curve_2& xcv1, X_monotone_curve_2& xcv2) const
{ {
const Subcurve_traits_2* geom_traits = m_poly_traits.subcurve_traits_2(); const Subcurve_traits_2* geom_traits = m_poly_traits.subcurve_traits_2();
typename Subcurve_traits_2::Construct_min_vertex_2 min_vertex = auto min_vertex = geom_traits->construct_min_vertex_2_object();
geom_traits->construct_min_vertex_2_object(); auto max_vertex = geom_traits->construct_max_vertex_2_object();
typename Subcurve_traits_2::Construct_max_vertex_2 max_vertex = auto equal = geom_traits->equal_2_object();
geom_traits->construct_max_vertex_2_object(); auto cmp_seg_endpts = geom_traits->compare_endpoints_xy_2_object();
typename Subcurve_traits_2::Equal_2 equal =
geom_traits->equal_2_object();
typename Subcurve_traits_2::Compare_endpoints_xy_2 cmp_seg_endpts =
geom_traits->compare_endpoints_xy_2_object();
// Make sure the split point is not one of the curve endpoints. // Make sure the split point is not one of the curve endpoints.
CGAL_precondition((!equal(m_poly_traits. CGAL_precondition((! equal(m_poly_traits.
construct_min_vertex_2_object()(xcv), p))); construct_min_vertex_2_object()(xcv), p)));
CGAL_precondition((!equal(m_poly_traits. CGAL_precondition((! equal(m_poly_traits.
construct_max_vertex_2_object()(xcv), p))); construct_max_vertex_2_object()(xcv), p)));
CGAL_precondition_msg(xcv.number_of_subcurves() > 0, CGAL_precondition_msg(xcv.number_of_subcurves() > 0,
"Cannot split a polycurve of length zero."); "Cannot split a polycurve of length zero.");
@ -709,22 +701,20 @@ public:
const X_monotone_curve_2& cv2, const X_monotone_curve_2& cv2,
OutputIterator oi) const OutputIterator oi) const
{ {
const Subcurve_traits_2* geom_traits = m_poly_traits.subcurve_traits_2(); typedef std::pair<Point_2, Multiplicity> Intersection_point;
Compare_y_at_x_2 cmp_y_at_x = m_poly_traits.compare_y_at_x_2_object(); typedef boost::variant<Intersection_point, X_monotone_subcurve_2>
typename Subcurve_traits_2::Equal_2 equal = Intersection_base_result;
geom_traits->equal_2_object(); typedef boost::variant<Intersection_point, X_monotone_curve_2>
typename Subcurve_traits_2::Construct_min_vertex_2 min_vertex = Intersection_result;
geom_traits->construct_min_vertex_2_object();
typename Subcurve_traits_2::Construct_max_vertex_2 max_vertex =
geom_traits->construct_max_vertex_2_object();
typename Subcurve_traits_2::Intersect_2 intersect =
geom_traits->intersect_2_object();
typename Subcurve_traits_2::Compare_endpoints_xy_2 cmp_seg_endpts =
geom_traits->compare_endpoints_xy_2_object();
typename Subcurve_traits_2::Construct_opposite_2 construct_opposite =
geom_traits->construct_opposite_2_object();
typedef std::pair<Point_2,Multiplicity> Point_2_pair; const Subcurve_traits_2* geom_traits = m_poly_traits.subcurve_traits_2();
auto cmp_y_at_x = m_poly_traits.compare_y_at_x_2_object();
auto equal = geom_traits->equal_2_object();
auto min_vertex = geom_traits->construct_min_vertex_2_object();
auto max_vertex = geom_traits->construct_max_vertex_2_object();
auto intersect = geom_traits->intersect_2_object();
auto cmp_seg_endpts = geom_traits->compare_endpoints_xy_2_object();
auto construct_opposite = geom_traits->construct_opposite_2_object();
Comparison_result dir1 = cmp_seg_endpts(cv1[0]); Comparison_result dir1 = cmp_seg_endpts(cv1[0]);
Comparison_result dir2 = cmp_seg_endpts(cv2[0]); Comparison_result dir2 = cmp_seg_endpts(cv2[0]);
@ -737,7 +727,7 @@ public:
X_monotone_curve_2 ocv; // Used to represent overlaps. X_monotone_curve_2 ocv; // Used to represent overlaps.
Compare_xy_2 compare_xy = m_poly_traits.compare_xy_2_object(); auto compare_xy = m_poly_traits.compare_xy_2_object();
Comparison_result left_res = Comparison_result left_res =
compare_xy(cv1[i1], ARR_MIN_END, cv2[i2], ARR_MIN_END); compare_xy(cv1[i1], ARR_MIN_END, cv2[i2], ARR_MIN_END);
@ -754,12 +744,13 @@ public:
((dir1 == LARGER) && (i1 == 0))){ ((dir1 == LARGER) && (i1 == 0))){
// cv1's right endpoint equals cv2's left endpoint // cv1's right endpoint equals cv2's left endpoint
// Thus we can return this single(!) intersection point // Thus we can return this single(!) intersection point
std::pair<Point_2, Multiplicity> p(max_vertex(cv1[i1]), 0); Intersection_point p(max_vertex(cv1[i1]), 0);
*oi++ = make_object(p); *oi++ = Intersection_result(p);
return oi; return oi;
} }
dir1 == SMALLER ? dir1 == SMALLER ?
++i1 : (i1 != 0) ? --i1 : (std::size_t) Polycurve_traits_2::INVALID_INDEX; ++i1 :
(i1 != 0) ? --i1 : (std::size_t) Polycurve_traits_2::INVALID_INDEX;
left_res = EQUAL; left_res = EQUAL;
} }
} }
@ -776,13 +767,14 @@ public:
((dir2 == LARGER) && (i2 == 0))){ ((dir2 == LARGER) && (i2 == 0))){
// cv2's right endpoint equals cv1's left endpoint // cv2's right endpoint equals cv1's left endpoint
// Thus we can return this single(!) intersection point // Thus we can return this single(!) intersection point
std::pair<Point_2, Multiplicity> p(max_vertex(cv2[i2]), 0); Intersection_point p(max_vertex(cv2[i2]), 0);
*oi++ = make_object(p); *oi++ = Intersection_result(p);
return oi; return oi;
} }
dir2 == SMALLER ? dir2 == SMALLER ?
++i2 : (i2 != 0) ? --i2 : (std::size_t) Polycurve_traits_2::INVALID_INDEX; ++i2 :
(i2 != 0) ? --i2 : (std::size_t) Polycurve_traits_2::INVALID_INDEX;
left_res = EQUAL; left_res = EQUAL;
} }
} }
@ -823,48 +815,64 @@ public:
right_overlap = false; right_overlap = false;
if (!right_coincides && !left_coincides) { //! EF: the following code is abit suspicious. It may erroneously
// assume that the subcurves cannot overlap more than once.
if (! right_coincides && ! left_coincides) {
// Non of the endpoints of the current subcurve of one polycurve // Non of the endpoints of the current subcurve of one polycurve
// coincides with the curent subcurve of the other polycurve: // coincides with the curent subcurve of the other polycurve:
// Output the intersection if exists. // Output the intersection if exists.
oi = intersect(cv1[i1], cv2[i2], oi); std::vector<Intersection_base_result> xections;
intersect(cv1[i1], cv2[i2], std::back_inserter(xections));
for (const auto& xection : xections) {
const X_monotone_subcurve_2* subcv_p =
boost::get<X_monotone_subcurve_2>(&xection);
if (subcv_p != nullptr) {
ocv.push_back(*subcv_p);
*oi++ = Intersection_result(ocv);
ocv.clear();
continue;
}
const Intersection_point* p_p =
boost::get<Intersection_point>(&xection);
if (p_p != nullptr) *oi++ = Intersection_result(*p_p);
}
} }
else if (right_coincides && left_coincides) { else if (right_coincides && left_coincides) {
// An overlap exists between the current subcurves of the // An overlap exists between the current subcurves of the
// polycurves: Output the overlapping subcurve. // polycurves: Output the overlapping subcurve.
right_overlap = true; right_overlap = true;
std::vector<CGAL::Object> int_seg; std::vector<Intersection_base_result> sub_xections;
intersect(cv1[i1], cv2[i2], std::back_inserter(int_seg)); intersect(cv1[i1], cv2[i2], std::back_inserter(sub_xections));
for (size_t i = 0; i < int_seg.size(); ++i) { for (const auto& item : sub_xections) {
const X_monotone_subcurve_2* x_seg = const X_monotone_subcurve_2* x_seg =
CGAL::object_cast<X_monotone_subcurve_2> (&(int_seg[i])); boost::get<X_monotone_subcurve_2>(&item);
if (x_seg != nullptr) { if (x_seg != nullptr) {
X_monotone_subcurve_2 seg = *x_seg; X_monotone_subcurve_2 seg = *x_seg;
// If for some reason the subcurve intersection // If for some reason the subcurve intersection
// results in left oriented curve. // results in left oriented curve.
if ( cmp_seg_endpts(seg) == LARGER) if (cmp_seg_endpts(seg) == LARGER) seg = construct_opposite(seg);
seg = construct_opposite(seg);
ocv.push_back(seg); ocv.push_back(seg);
} }
const Point_2_pair* p_ptr = const Intersection_point* p_ptr =
CGAL::object_cast<Point_2_pair>(&(int_seg[i])); boost::get<Intersection_point>(&item);
if (p_ptr != nullptr) { if (p_ptr != nullptr) {
// Any point that is not equal to the max_vertex of the // Any point that is not equal to the max_vertex of the
// subcurve should be inserted into oi. // subcurve should be inserted into oi.
// The max_vertex of the current subcurve (if intersecting) // The max_vertex of the current subcurve (if intersecting)
// will be taken care of as the min_vertex of in the next // will be taken care of as the min_vertex of in the next
// iteration. // iteration.
if (!equal(p_ptr->first, max_vertex(cv1[i1]))) if (! equal(p_ptr->first, max_vertex(cv1[i1])))
*oi++ = make_object(*p_ptr); *oi++ = Intersection_result(*p_ptr);
} }
} }
} }
else if (left_coincides && !right_coincides) { else if (left_coincides && ! right_coincides) {
// std::cout << "Left is coinciding but right is not." << std::endl; // std::cout << "Left is coinciding but right is not." << std::endl;
// The left point of the current subcurve of one polycurve // The left point of the current subcurve of one polycurve
// coincides with the current subcurve of the other polycurve. // coincides with the current subcurve of the other polycurve.
@ -872,7 +880,7 @@ public:
// An overlap occurred at the previous iteration: // An overlap occurred at the previous iteration:
// Output the overlapping polycurve. // Output the overlapping polycurve.
CGAL_assertion(ocv.number_of_subcurves() > 0); CGAL_assertion(ocv.number_of_subcurves() > 0);
*oi++ = make_object(ocv); *oi++ = Intersection_result(ocv);
ocv.clear(); ocv.clear();
} }
else { else {
@ -884,12 +892,12 @@ public:
// polycurves is not defined at this point, so we give // polycurves is not defined at this point, so we give
// it multiplicity 0. // it multiplicity 0.
if (left_res == SMALLER) { if (left_res == SMALLER) {
std::pair<Point_2, Multiplicity> p(min_vertex(cv2[i2]), 0); Intersection_point p(min_vertex(cv2[i2]), 0);
*oi++ = make_object(p); *oi++ = Intersection_result(p);
} }
else { else {
std::pair<Point_2, Multiplicity> p(min_vertex(cv1[i1]), 0); Intersection_point p(min_vertex(cv1[i1]), 0);
*oi++ = make_object(p); *oi++ = Intersection_result(p);
} }
} }
} }
@ -919,7 +927,7 @@ public:
// Output the remaining overlapping polycurve, if necessary. // Output the remaining overlapping polycurve, if necessary.
if (ocv.number_of_subcurves() > 0) { if (ocv.number_of_subcurves() > 0) {
*oi++ = make_object(ocv); *oi++ = Intersection_result(ocv);
} }
else if (right_coincides) { else if (right_coincides) {
typedef std::pair<Point_2,Multiplicity> return_point; typedef std::pair<Point_2,Multiplicity> return_point;
@ -930,7 +938,7 @@ public:
(i1 != Polycurve_traits_2::INVALID_INDEX) ? (i1 != Polycurve_traits_2::INVALID_INDEX) ?
return_point(max_vertex(cv1[i1+1]), 0) : return_point(max_vertex(cv1[i1+1]), 0) :
return_point(max_vertex(cv1[0]), 0); return_point(max_vertex(cv1[0]), 0);
*oi++ = make_object(ip); *oi++ = Intersection_result(ip);
} }
else if (right_res == LARGER) { else if (right_res == LARGER) {
ip = (dir2 == SMALLER) ? ip = (dir2 == SMALLER) ?
@ -938,7 +946,7 @@ public:
(i2 != Polycurve_traits_2::INVALID_INDEX) ? (i2 != Polycurve_traits_2::INVALID_INDEX) ?
return_point(max_vertex(cv2[i2+1]), 0) : return_point(max_vertex(cv2[i2+1]), 0) :
return_point(max_vertex(cv2[0]), 0); return_point(max_vertex(cv2[0]), 0);
*oi++ = make_object(ip); *oi++ = Intersection_result(ip);
} }
else if (((i1 > 0) && (dir1 == SMALLER)) || else if (((i1 > 0) && (dir1 == SMALLER)) ||
((i1 < n1) && (dir1 != SMALLER)) || ((i1 < n1) && (dir1 != SMALLER)) ||
@ -950,7 +958,7 @@ public:
(i1 != Polycurve_traits_2::INVALID_INDEX) ? (i1 != Polycurve_traits_2::INVALID_INDEX) ?
return_point(max_vertex(cv1[i1+1]), 0) : return_point(max_vertex(cv1[i1+1]), 0) :
return_point(max_vertex(cv1[0]), 0); return_point(max_vertex(cv1[0]), 0);
*oi++ = make_object(ip); *oi++ = Intersection_result(ip);
} }
else { else {
CGAL_assertion_msg((dir2 == SMALLER && i2 > 0) || CGAL_assertion_msg((dir2 == SMALLER && i2 > 0) ||
@ -965,7 +973,7 @@ public:
(i2 != Polycurve_traits_2::INVALID_INDEX) ? (i2 != Polycurve_traits_2::INVALID_INDEX) ?
return_point(max_vertex(cv2[i2+1]), 0) : return_point(max_vertex(cv2[i2+1]), 0) :
return_point(max_vertex(cv2[0]), 0); return_point(max_vertex(cv2[0]), 0);
*oi++ = make_object(ip); *oi++ = Intersection_result(ip);
} }
} }

View File

@ -1848,8 +1848,8 @@ public:
typedef typename Base::Cache Cache; typedef typename Base::Cache Cache;
typedef std::pair<Algebraic_point_2, Multiplicity> Intersection_point_2; typedef std::pair<Algebraic_point_2, Multiplicity> Intersection_point;
//typedef std::pair<Algebraic_point_2, unsigned int> Intersection_point_2; //typedef std::pair<Algebraic_point_2, unsigned int> Intersection_point;
/// \name Constrcution methods. /// \name Constrcution methods.
@ -2029,8 +2029,7 @@ public:
/// \name Constructions of points and curves. /// \name Constructions of points and curves.
//@{ //@{
/*! /*! Compute the intersections with the given arc.
* Compute the intersections with the given arc.
* \param arc The given intersecting arc. * \param arc The given intersecting arc.
* \param oi The output iterator. * \param oi The output iterator.
* \return The past-the-end iterator. * \return The past-the-end iterator.
@ -2039,33 +2038,31 @@ public:
OutputIterator intersect(const Self& arc, OutputIterator oi, OutputIterator intersect(const Self& arc, OutputIterator oi,
const Cache& cache) const const Cache& cache) const
{ {
typedef boost::variant<Intersection_point, Self> Intersection_result;
CGAL_precondition(this->is_valid() && this->is_continuous()); CGAL_precondition(this->is_valid() && this->is_continuous());
CGAL_precondition(arc.is_valid() && arc.is_continuous()); CGAL_precondition(arc.is_valid() && arc.is_continuous());
if (this->equals(arc)) if (this->equals(arc)) {
{ Self overlap_arc(*this);
Self overlap_arc(*this); *oi++ = Intersection_result(overlap_arc);
*oi++ = make_object(overlap_arc); return oi;
return (oi);
} }
if (this->_has_same_base(arc)) if (this->_has_same_base(arc)) {
{
// Get the left and right endpoints of (*this) and their information // Get the left and right endpoints of (*this) and their information
// bits. // bits.
const Algebraic_point_2& left1 = (this->is_directed_right() ? const Algebraic_point_2& left1 =
this->_ps : this->_pt); (this->is_directed_right() ? this->_ps : this->_pt);
const Algebraic_point_2& right1 = (this->is_directed_right() ? const Algebraic_point_2& right1 =
this->_pt : this->_ps); (this->is_directed_right() ? this->_pt : this->_ps);
int info_left1, info_right1; int info_left1, info_right1;
if (this->is_directed_right()) if (this->is_directed_right()) {
{
info_left1 = (this->_info & this->SRC_INFO_BITS); info_left1 = (this->_info & this->SRC_INFO_BITS);
info_right1 = ((this->_info & this->TRG_INFO_BITS) >> 4); info_right1 = ((this->_info & this->TRG_INFO_BITS) >> 4);
} }
else else {
{
info_right1 = (this->_info & this->SRC_INFO_BITS); info_right1 = (this->_info & this->SRC_INFO_BITS);
info_left1 = ((this->_info & this->TRG_INFO_BITS) >> 4); info_left1 = ((this->_info & this->TRG_INFO_BITS) >> 4);
} }
@ -2076,110 +2073,93 @@ public:
(arc.is_directed_right() ? arc._ps : arc._pt); (arc.is_directed_right() ? arc._ps : arc._pt);
const Algebraic_point_2& right2 = const Algebraic_point_2& right2 =
(arc.is_directed_right() ? arc._pt : arc._ps); (arc.is_directed_right() ? arc._pt : arc._ps);
int info_left2, info_right2; int info_left2, info_right2;
if (arc.is_directed_right()) if (arc.is_directed_right()) {
{
info_left2 = (arc._info & this->SRC_INFO_BITS); info_left2 = (arc._info & this->SRC_INFO_BITS);
info_right2 = ((arc._info & this->TRG_INFO_BITS) >> 4); info_right2 = ((arc._info & this->TRG_INFO_BITS) >> 4);
} }
else else {
{
info_right2 = (arc._info & this->SRC_INFO_BITS); info_right2 = (arc._info & this->SRC_INFO_BITS);
info_left2 = ((arc._info & this->TRG_INFO_BITS) >> 4); info_left2 = ((arc._info & this->TRG_INFO_BITS) >> 4);
} }
// Locate the left curve-end with larger x-coordinate. // Locate the left curve-end with larger x-coordinate.
bool at_minus_infinity = false; bool at_minus_infinity = false;
Arr_parameter_space inf_l1 = this->left_parameter_space_in_x(); Arr_parameter_space inf_l1 = this->left_parameter_space_in_x();
Arr_parameter_space inf_l2 = arc.left_parameter_space_in_x(); Arr_parameter_space inf_l2 = arc.left_parameter_space_in_x();
Algebraic_point_2 p_left; Algebraic_point_2 p_left;
int info_left; int info_left;
if (inf_l1 == ARR_INTERIOR && inf_l2 == ARR_INTERIOR) if (inf_l1 == ARR_INTERIOR && inf_l2 == ARR_INTERIOR) {
{
// Let p_left be the rightmost of the two left endpoints. // Let p_left be the rightmost of the two left endpoints.
if (left1.x() > left2.x()) if (left1.x() > left2.x()) {
{
p_left = left1; p_left = left1;
info_left = info_left1; info_left = info_left1;
} }
else else {
{
p_left = left2; p_left = left2;
info_left = info_left2; info_left = info_left2;
} }
} }
else if (inf_l1 == ARR_INTERIOR) else if (inf_l1 == ARR_INTERIOR) {
{
// Let p_left be the left endpoint of (*this). // Let p_left be the left endpoint of (*this).
p_left = left1; p_left = left1;
info_left = info_left1; info_left = info_left1;
} }
else if (inf_l2 == ARR_INTERIOR) else if (inf_l2 == ARR_INTERIOR) {
{
// Let p_left be the left endpoint of the other arc. // Let p_left be the left endpoint of the other arc.
p_left = left2; p_left = left2;
info_left = info_left2; info_left = info_left2;
} }
else else {
{
// Both arcs are defined at x = -oo. // Both arcs are defined at x = -oo.
at_minus_infinity = true; at_minus_infinity = true;
info_left = info_left1; info_left = info_left1;
} }
// Locate the right curve-end with smaller x-coordinate. // Locate the right curve-end with smaller x-coordinate.
bool at_plus_infinity = false; bool at_plus_infinity = false;
Arr_parameter_space inf_r1 = this->right_parameter_space_in_x(); Arr_parameter_space inf_r1 = this->right_parameter_space_in_x();
Arr_parameter_space inf_r2 = arc.right_parameter_space_in_x(); Arr_parameter_space inf_r2 = arc.right_parameter_space_in_x();
Algebraic_point_2 p_right; Algebraic_point_2 p_right;
int info_right; int info_right;
if (inf_r1 == ARR_INTERIOR && inf_r2 == ARR_INTERIOR) if (inf_r1 == ARR_INTERIOR && inf_r2 == ARR_INTERIOR) {
{
// Let p_right be the rightmost of the two right endpoints. // Let p_right be the rightmost of the two right endpoints.
if (right1.x() < right2.x()) if (right1.x() < right2.x()) {
{
p_right = right1; p_right = right1;
info_right = info_right1; info_right = info_right1;
} }
else else {
{
p_right = right2; p_right = right2;
info_right = info_right2; info_right = info_right2;
} }
} }
else if (inf_r1 == ARR_INTERIOR) else if (inf_r1 == ARR_INTERIOR) {
{
// Let p_right be the right endpoint of (*this). // Let p_right be the right endpoint of (*this).
p_right = right1; p_right = right1;
info_right = info_right1; info_right = info_right1;
} }
else if (inf_r2 == ARR_INTERIOR) else if (inf_r2 == ARR_INTERIOR) {
{
// Let p_right be the right endpoint of the other arc. // Let p_right be the right endpoint of the other arc.
p_right = right2; p_right = right2;
info_right = info_right2; info_right = info_right2;
} }
else else {
{
// Both arcs are defined at x = +oo. // Both arcs are defined at x = +oo.
at_plus_infinity = true; at_plus_infinity = true;
info_right = info_right2; info_right = info_right2;
} }
// Check the case of two bounded (in x) ends. // Check the case of two bounded (in x) ends.
if (! at_minus_infinity && ! at_plus_infinity) if (! at_minus_infinity && ! at_plus_infinity) {
{
Comparison_result res = CGAL::compare(p_left.x(), p_right.x()); Comparison_result res = CGAL::compare(p_left.x(), p_right.x());
if (res == LARGER)
{ // The x-range of the overlap is empty, so there is no overlap.
// The x-range of the overlap is empty, so there is no overlap. if (res == LARGER) return oi;
return (oi);
} if (res == EQUAL) {
else if (res == EQUAL)
{
// We have a single overlapping point. Just make sure this point // We have a single overlapping point. Just make sure this point
// is not at y = -/+ oo. // is not at y = -/+ oo.
if (info_left && if (info_left &&
@ -2187,19 +2167,18 @@ public:
info_right && info_right &&
(this->SRC_AT_Y_MINUS_INFTY | this->SRC_AT_Y_PLUS_INFTY) == 0) (this->SRC_AT_Y_MINUS_INFTY | this->SRC_AT_Y_PLUS_INFTY) == 0)
{ {
Intersection_point_2 ip(p_left, 0); Intersection_point ip(p_left, 0);
*oi++ = Intersection_result(ip);
*oi++ = make_object(ip);
} }
return (oi); return oi;
} }
} }
// Create the overlapping portion of the rational arc by properly setting // Create the overlapping portion of the rational arc by properly setting
// the source (left) and target (right) endpoints and their information // the source (left) and target (right) endpoints and their information
// bits. // bits.
Self overlap_arc(*this); Self overlap_arc(*this);
overlap_arc._ps = p_left; overlap_arc._ps = p_left;
overlap_arc._pt = p_right; overlap_arc._pt = p_right;
@ -2208,8 +2187,8 @@ public:
this->IS_DIRECTED_RIGHT | this->IS_CONTINUOUS | this->IS_DIRECTED_RIGHT | this->IS_CONTINUOUS |
this->IS_VALID); this->IS_VALID);
*oi++ = make_object(overlap_arc); *oi++ = Intersection_result(overlap_arc);
return (oi); return oi;
} }
// We wish to find the intersection points between: // We wish to find the intersection points between:
@ -2237,15 +2216,14 @@ public:
if (this->_is_in_true_x_range(*x_iter) && arc._is_in_true_x_range(*x_iter)) if (this->_is_in_true_x_range(*x_iter) && arc._is_in_true_x_range(*x_iter))
{ {
// Compute the intersection point and obtain its multiplicity. // Compute the intersection point and obtain its multiplicity.
Algebraic_point_2 p(this->_f, *x_iter); Algebraic_point_2 p(this->_f, *x_iter);
// Output the intersection point: // Output the intersection point:
Intersection_point_2 ip(p, *m_iter); Intersection_point ip(p, *m_iter);
*oi++ = Intersection_result(ip);
*oi++ = make_object(ip);
} }
} }
return (oi); return oi;
} }
/*! /*!
@ -2255,7 +2233,8 @@ public:
* \param c2 Output: The first resulting arc, lying to the right of p. * \param c2 Output: The first resulting arc, lying to the right of p.
* \pre p lies in the interior of the arc (not one of its endpoints). * \pre p lies in the interior of the arc (not one of its endpoints).
*/ */
void split(const Algebraic_point_2& p, Self& c1, Self& c2, const Cache& CGAL_assertion_code(cache)) const void split(const Algebraic_point_2& p, Self& c1, Self& c2,
const Cache& CGAL_assertion_code(cache)) const
{ {
CGAL_precondition(this->is_valid() && this->is_continuous()); CGAL_precondition(this->is_valid() && this->is_continuous());
@ -2598,4 +2577,3 @@ public:
} //namespace CGAL { } //namespace CGAL {
#endif //CGAL_RATIONAL_ARC_D_1_H #endif //CGAL_RATIONAL_ARC_D_1_H

File diff suppressed because it is too large Load Diff

View File

@ -7,7 +7,7 @@
// $Id$ // $Id$
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
// //
// Author(s) : Efi Fogel <efif@post.tau.ac.il> // Author(s): Efi Fogel <efif@post.tau.ac.il>
#ifndef CGAL_ARR_TRACING_TRAITS_H #ifndef CGAL_ARR_TRACING_TRAITS_H
#define CGAL_ARR_TRACING_TRAITS_H #define CGAL_ARR_TRACING_TRAITS_H
@ -26,6 +26,8 @@
#include <iostream> #include <iostream>
#include <list> #include <list>
#include <boost/variant.hpp>
#include <CGAL/basic.h> #include <CGAL/basic.h>
#include <CGAL/Arr_enums.h> #include <CGAL/Arr_enums.h>
#include <CGAL/Arr_tags.h> #include <CGAL/Arr_tags.h>
@ -592,7 +594,7 @@ public:
public: public:
/*! Construct */ /*! Construct */
Intersect_2(const Base * base, bool enabled = true) : Intersect_2(const Base* base, bool enabled = true) :
m_object(base->intersect_2_object()), m_enabled(enabled) {} m_object(base->intersect_2_object()), m_enabled(enabled) {}
/*! Operate /*! Operate
@ -604,37 +606,41 @@ public:
* multiplicity * multiplicity
* \return the output iterator * \return the output iterator
*/ */
template<typename OutputIterator> template <typename OutputIterator>
OutputIterator operator()(const X_monotone_curve_2 & xcv1, OutputIterator operator()(const X_monotone_curve_2 & xcv1,
const X_monotone_curve_2 & xcv2, const X_monotone_curve_2 & xcv2,
OutputIterator oi) const OutputIterator oi) const
{ {
if (!m_enabled) return m_object(xcv1, xcv2, oi); typedef std::pair<Point_2, Multiplicity> Intersection_point;
typedef boost::variant<Intersection_point, X_monotone_curve_2>
Intersection_result;
if (! m_enabled) return m_object(xcv1, xcv2, oi);
std::cout << "intersect" << std::endl std::cout << "intersect" << std::endl
<< " xcv1: " << xcv1 << std::endl << " xcv1: " << xcv1 << std::endl
<< " xcv2: " << xcv2 << std::endl; << " xcv2: " << xcv2 << std::endl;
std::list<CGAL::Object> container; std::list<Intersection_result> container;
m_object(xcv1, xcv2, std::back_inserter(container)); m_object(xcv1, xcv2, std::back_inserter(container));
if (container.empty()) return oi; if (container.empty()) return oi;
std::list<CGAL::Object>::iterator it;
unsigned int i = 0; unsigned int i = 0;
for (it = container.begin(); it != container.end(); ++it) { for (const auto& item : container) {
X_monotone_curve_2 xcv; const X_monotone_curve_2* xcv = boost::get<X_monotone_curve_2>(&item);
if (assign (xcv, *it)) { if (xcv != nullptr) {
std::cout << " result[" << i++ << "]: xcv: " << xcv << std::endl; std::cout << " result[" << i++ << "]: xcv: " << *xcv << std::endl;
continue; continue;
} }
std::pair<Point_2,Multiplicity> point_pair; const Intersection_point* ip = boost::get<Intersection_point>(&item);
if (assign (point_pair, *it)) { if (ip != nullptr) {
std::cout << " result[" << i++ << "]: p: " << point_pair.first std::cout << " result[" << i++ << "]: p: " << ip->first
<< ", multiplicity: " << point_pair.second << std::endl; << ", multiplicity: " << ip->second << std::endl;
continue; continue;
} }
} }
for (it = container.begin(); it != container.end(); ++it) *oi++ = *it; for (auto it = container.begin(); it != container.end(); ++it) *oi++ = *it;
container.clear(); container.clear();
return oi; return oi;
} }

View File

@ -132,8 +132,8 @@ void Arrangement_zone_2<Arrangement, ZoneVisitor>::compute_zone()
// In this case m_cv overlaps the curve associated with m_intersect_he. // In this case m_cv overlaps the curve associated with m_intersect_he.
// Compute the overlapping subcurve. // Compute the overlapping subcurve.
bool dummy; bool dummy;
m_obj = _compute_next_intersection(m_intersect_he, false, dummy); auto obj = _compute_next_intersection(m_intersect_he, false, dummy);
m_overlap_cv = object_cast<X_monotone_curve_2>(m_obj); m_overlap_cv = boost::get<X_monotone_curve_2>(*obj);
// Remove the overlap from the map. // Remove the overlap from the map.
_remove_next_intersection(m_intersect_he); _remove_next_intersection(m_intersect_he);
@ -148,8 +148,8 @@ void Arrangement_zone_2<Arrangement, ZoneVisitor>::compute_zone()
m_intersect_he = m_arr.non_const_handle(*hh); m_intersect_he = m_arr.non_const_handle(*hh);
bool dummy; bool dummy;
m_obj = _compute_next_intersection(m_intersect_he, false, dummy); auto obj = _compute_next_intersection(m_intersect_he, false, dummy);
m_overlap_cv = object_cast<X_monotone_curve_2>(m_obj); m_overlap_cv = boost::get<X_monotone_curve_2>(*obj);
// Remove the overlap from the map. // Remove the overlap from the map.
_remove_next_intersection(m_intersect_he); _remove_next_intersection(m_intersect_he);
@ -207,8 +207,8 @@ void Arrangement_zone_2<Arrangement, ZoneVisitor>::compute_zone()
// In this case m_cv overlaps the curve associated with m_intersect_he. // In this case m_cv overlaps the curve associated with m_intersect_he.
// Compute the overlapping subcurve to the right of curr_v. // Compute the overlapping subcurve to the right of curr_v.
bool dummy; bool dummy;
m_obj = _compute_next_intersection(m_intersect_he, false, dummy); auto obj = _compute_next_intersection(m_intersect_he, false, dummy);
m_overlap_cv = object_cast<X_monotone_curve_2>(m_obj); m_overlap_cv = boost::get<X_monotone_curve_2>(*obj);
// Remove the overlap from the map. // Remove the overlap from the map.
_remove_next_intersection(m_intersect_he); _remove_next_intersection(m_intersect_he);
@ -800,7 +800,7 @@ _direct_intersecting_edge_to_left(const X_monotone_curve_2& cv_ins,
// Get the next intersection of cv with the given halfedge. // Get the next intersection of cv with the given halfedge.
// //
template <typename Arrangement, typename ZoneVisitor> template <typename Arrangement, typename ZoneVisitor>
CGAL::Object typename Arrangement_zone_2<Arrangement, ZoneVisitor>::Optional_intersection
Arrangement_zone_2<Arrangement, ZoneVisitor>:: Arrangement_zone_2<Arrangement, ZoneVisitor>::
_compute_next_intersection(Halfedge_handle he, _compute_next_intersection(Halfedge_handle he,
bool skip_first_point, bool skip_first_point,
@ -811,7 +811,7 @@ _compute_next_intersection(Halfedge_handle he,
// Try to locate the intersections with this curve in the intersections map. // Try to locate the intersections with this curve in the intersections map.
Intersect_map_iterator iter = m_inter_map.find(p_curve); Intersect_map_iterator iter = m_inter_map.find(p_curve);
const Intersect_point_2* ip; const Intersection_point* ip;
const X_monotone_curve_2* icv; const X_monotone_curve_2* icv;
bool valid_intersection; bool valid_intersection;
@ -821,13 +821,13 @@ _compute_next_intersection(Halfedge_handle he,
// Retrieve the intersections list from the map. // Retrieve the intersections list from the map.
Intersect_list& inter_list = iter->second; Intersect_list& inter_list = iter->second;
if (inter_list.empty()) return CGAL::Object(); if (inter_list.empty()) return Optional_intersection();
// Locate the first intersection that lies to the right of m_left_pt // Locate the first intersection that lies to the right of m_left_pt
// (if the left point exists). // (if the left point exists).
while (! inter_list.empty()) { while (! inter_list.empty()) {
// Compare that current object with m_left_pt (if exists). // Compare that current object with m_left_pt (if exists).
ip = object_cast<Intersect_point_2>(&(inter_list.front())); ip = boost::get<Intersection_point>(&(inter_list.front()));
if (m_left_on_boundary) { if (m_left_on_boundary) {
// The left end lie on the left boundary, so all intersections are // The left end lie on the left boundary, so all intersections are
@ -851,7 +851,7 @@ _compute_next_intersection(Halfedge_handle he,
} }
else { else {
// We have an overlapping subcurve. // We have an overlapping subcurve.
icv = object_cast<X_monotone_curve_2>(&(inter_list.front())); icv = boost::get<X_monotone_curve_2>(&(inter_list.front()));
CGAL_assertion(icv != nullptr); CGAL_assertion(icv != nullptr);
if (m_geom_traits->is_closed_2_object()(*icv, ARR_MIN_END)) { if (m_geom_traits->is_closed_2_object()(*icv, ARR_MIN_END)) {
@ -869,14 +869,14 @@ _compute_next_intersection(Halfedge_handle he,
} }
// Found an intersection to m_left_pt's right. // Found an intersection to m_left_pt's right.
if (valid_intersection) return (inter_list.front()); if (valid_intersection) return Optional_intersection(inter_list.front());
// Discard the current intersection, which lies to m_left_pt's left. // Discard the current intersection, which lies to m_left_pt's left.
inter_list.pop_front(); inter_list.pop_front();
} }
// If we reached here, the list of intersections is empty: // If we reached here, the list of intersections is empty:
return CGAL::Object(); return Optional_intersection();
} }
// The intersections with the curve have not been computed yet, so we // The intersections with the curve have not been computed yet, so we
@ -894,7 +894,7 @@ _compute_next_intersection(Halfedge_handle he,
// Discard all intersection lying to the left of m_left_pt (if exists). // Discard all intersection lying to the left of m_left_pt (if exists).
while (! inter_list.empty()) { while (! inter_list.empty()) {
// Compare that current object with m_left_pt (if exists). // Compare that current object with m_left_pt (if exists).
ip = object_cast<Intersect_point_2>(&(inter_list.front())); ip = boost::get<Intersection_point>(&(inter_list.front()));
if (ip != nullptr) { if (ip != nullptr) {
// We have a simple intersection point - if we don't have to skip it, // We have a simple intersection point - if we don't have to skip it,
@ -920,7 +920,7 @@ _compute_next_intersection(Halfedge_handle he,
} }
else { else {
// We have an overlapping subcurve. // We have an overlapping subcurve.
icv = object_cast<X_monotone_curve_2>(&(inter_list.front())); icv = boost::get<X_monotone_curve_2>(&(inter_list.front()));
CGAL_assertion(icv != nullptr); CGAL_assertion(icv != nullptr);
if (m_geom_traits->is_closed_2_object()(*icv, ARR_MIN_END)) { if (m_geom_traits->is_closed_2_object()(*icv, ARR_MIN_END)) {
@ -947,8 +947,8 @@ _compute_next_intersection(Halfedge_handle he,
m_inter_map[p_curve] = inter_list; m_inter_map[p_curve] = inter_list;
// Return the first intersection object computed (may be empty). // Return the first intersection object computed (may be empty).
if (inter_list.empty()) return CGAL::Object(); if (inter_list.empty()) return Optional_intersection();
else return (inter_list.front()); else return Optional_intersection(inter_list.front());
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -1105,14 +1105,14 @@ _leftmost_intersection(Ccb_halfedge_circulator he_curr, bool on_boundary,
// Compute the next intersection of m_cv and the current halfedge. // Compute the next intersection of m_cv and the current halfedge.
bool intersection_on_right_boundary; bool intersection_on_right_boundary;
CGAL::Object iobj = Optional_intersection iobj =
_compute_next_intersection(he_curr, left_equals_curr_endpoint, _compute_next_intersection(he_curr, left_equals_curr_endpoint,
intersection_on_right_boundary); intersection_on_right_boundary);
if (! iobj.is_empty()) { if (iobj) {
// We have found an intersection (either a simple point or an // We have found an intersection (either a simple point or an
// overlapping x-monotone curve). // overlapping x-monotone curve).
const Intersect_point_2* int_p = object_cast<Intersect_point_2>(&iobj); const Intersection_point* int_p = boost::get<Intersection_point>(&*iobj);
if (int_p != nullptr) { if (int_p != nullptr) {
Point_2 ip = int_p->first; Point_2 ip = int_p->first;
@ -1134,7 +1134,7 @@ _leftmost_intersection(Ccb_halfedge_circulator he_curr, bool on_boundary,
else { else {
// We have located an overlapping curve. Assign ip as its left // We have located an overlapping curve. Assign ip as its left
// endpoint. // endpoint.
const X_monotone_curve_2* icv = object_cast<X_monotone_curve_2>(&iobj); const X_monotone_curve_2* icv = boost::get<X_monotone_curve_2>(&*iobj);
CGAL_assertion(icv != nullptr); CGAL_assertion(icv != nullptr);
Point_2 ip = min_vertex(*icv); Point_2 ip = min_vertex(*icv);

View File

@ -93,22 +93,25 @@ protected:
Right_side_category>::result Right_side_category>::result
Are_all_sides_oblivious_category; Are_all_sides_oblivious_category;
typedef typename Arrangement_2::Vertex_const_handle Vertex_const_handle; typedef typename Arrangement_2::Vertex_const_handle Vertex_const_handle;
typedef typename Arrangement_2::Halfedge_const_handle Halfedge_const_handle; typedef typename Arrangement_2::Halfedge_const_handle Halfedge_const_handle;
typedef typename Arrangement_2::Face_const_handle Face_const_handle; typedef typename Arrangement_2::Face_const_handle Face_const_handle;
typedef typename Arrangement_2::Ccb_halfedge_circulator typedef typename Arrangement_2::Ccb_halfedge_circulator
Ccb_halfedge_circulator; Ccb_halfedge_circulator;
// Types used for caching intersection points: // Types used for caching intersection points:
typedef std::pair<Point_2, Multiplicity> Intersect_point_2; typedef std::pair<Point_2, Multiplicity> Intersection_point;
typedef std::list<CGAL::Object> Intersect_list; typedef boost::variant<Intersection_point, X_monotone_curve_2>
Intersection_result;
typedef boost::optional<Intersection_result> Optional_intersection;
typedef std::list<Intersection_result> Intersect_list;
typedef std::map<const X_monotone_curve_2*, Intersect_list> typedef std::map<const X_monotone_curve_2*, Intersect_list>
Intersect_map; Intersect_map;
typedef typename Intersect_map::iterator Intersect_map_iterator; typedef typename Intersect_map::iterator Intersect_map_iterator;
typedef std::set<const X_monotone_curve_2*> Curves_set; typedef std::set<const X_monotone_curve_2*> Curves_set;
typedef typename Curves_set::iterator Curves_set_iterator; typedef typename Curves_set::iterator Curves_set_iterator;
// Data members: // Data members:
Arrangement_2& m_arr; // The associated arrangement. Arrangement_2& m_arr; // The associated arrangement.
@ -378,14 +381,15 @@ private:
* point coincides with the right * point coincides with the right
* curve-end, which lies on the * curve-end, which lies on the
* surface boundary. * surface boundary.
* \return An object representing the next intersection: Intersect_point_2 * \return An object representing the next intersection: Intersection_point
* in case of a simple intersection point, X_monotone_curve_2 in * in case of a simple intersection point, X_monotone_curve_2 in
* case of an overlap, and an empty object if there is no * case of an overlap, and an empty object if there is no
* intersection. * intersection.
*/ */
CGAL::Object _compute_next_intersection(Halfedge_handle he, Optional_intersection
bool skip_first_point, _compute_next_intersection(Halfedge_handle he,
bool& intersect_on_right_boundary); bool skip_first_point,
bool& intersect_on_right_boundary);
/*! Remove the next intersection of m_cv with the given halfedge from the map. /*! Remove the next intersection of m_cv with the given halfedge from the map.
* \param he A handle to the halfedge. * \param he A handle to the halfedge.

View File

@ -1459,29 +1459,24 @@ public:
OutputIterator operator()(const Arc_2& cv1, const Arc_2& cv2, OutputIterator operator()(const Arc_2& cv1, const Arc_2& cv2,
OutputIterator oi) const { OutputIterator oi) const {
typedef unsigned int Multiplicity;
typedef std::pair<Point_2, Multiplicity> Intersection_point;
typedef boost::variant<Intersection_point, Arc_2> Intersection_result;
CERR("\nintersect; cv1: " << cv1 CERR("\nintersect; cv1: " << cv1
<< ";\n cv2:" << cv2 << ""); << ";\n cv2:" << cv2 << "");
// if arcs overlap, just store their common part, otherwise compute // if arcs overlap, just store their common part, otherwise compute
// point-wise intersections // point-wise intersections
std::vector< Arc_2 > common_arcs; std::vector<Arc_2> arcs;
if (cv1._trim_if_overlapped(cv2, std::back_inserter(common_arcs))) { if (cv1._trim_if_overlapped(cv2, std::back_inserter(arcs))) {
typename std::vector< Arc_2 >::const_iterator it; for (const auto& item : arcs) *oi++ = Intersection_result(item);
for(it = common_arcs.begin(); it < common_arcs.end(); it++) {
*oi++ = CGAL::make_object(*it);
}
return oi; return oi;
} }
// process non-ov erlapping case // process non-ov erlapping case
typedef std::pair< Point_2, unsigned int > Point_and_mult; std::vector<Intersection_point> vec;
typedef std::vector< Point_and_mult > Point_vector;
Point_vector vec;
typename Point_vector::const_iterator it;
Arc_2::_intersection_points(cv1, cv2, std::back_inserter(vec)); Arc_2::_intersection_points(cv1, cv2, std::back_inserter(vec));
for (const auto& item : vec) *oi++ = Intersection_result(item);
for (it = vec.begin(); it != vec.end(); it++) {
*oi++ = CGAL::make_object(*it);
}
return oi; return oi;
} }

View File

@ -80,17 +80,13 @@ public:
protected: protected:
//! The base operators. //! The base operators.
Base_intersect_2 m_base_intersect; Base_intersect_2 m_base_intersect;
Halfedge_handle invalid_he;
/*! Constructor. /*! Constructor.
* The constructor is declared private to allow only the functor * The constructor is declared private to allow only the functor
* obtaining function, which is a member of the nesting class, * obtaining function, which is a member of the nesting class,
* constructing it. * constructing it.
*/ */
Intersect_2(const Base_intersect_2& base) : Intersect_2(const Base_intersect_2& base) : m_base_intersect (base) {}
m_base_intersect (base),
invalid_he()
{}
//! Allow its functor obtaining function calling the private constructor. //! Allow its functor obtaining function calling the private constructor.
friend class Arr_insertion_traits_2<Gt2, Arrangement_2>; friend class Arr_insertion_traits_2<Gt2, Arrangement_2>;
@ -101,6 +97,14 @@ public:
const X_monotone_curve_2& cv2, const X_monotone_curve_2& cv2,
OutputIterator oi) OutputIterator oi)
{ {
typedef std::pair<Point_2, Multiplicity> Intersection_point;
typedef boost::variant<Intersection_point, X_monotone_curve_2>
Intersection_result;
typedef boost::variant<Intersection_point, Base_x_monotone_curve_2>
Intersection_base_result;
Halfedge_handle invalid_he;
if ((cv1.halfedge_handle() != invalid_he) && if ((cv1.halfedge_handle() != invalid_he) &&
(cv2.halfedge_handle() != invalid_he) && (cv2.halfedge_handle() != invalid_he) &&
(cv1.halfedge_handle() != cv2.halfedge_handle())) (cv1.halfedge_handle() != cv2.halfedge_handle()))
@ -110,40 +114,32 @@ public:
return oi; return oi;
} }
OutputIterator oi_end = m_base_intersect(cv1.base(), cv2.base(), oi); std::vector<Intersection_base_result> xections;
const Base_x_monotone_curve_2* base_overlap_cv; m_base_intersect(cv1.base(), cv2.base(), std::back_inserter(xections));
const std::pair<Base_point_2, unsigned int>* intersect_p;
// convert objects that are associated with Base_x_monotone_curve_2 to // convert objects that are associated with Base_x_monotone_curve_2 to
// X_monotone_curve_2 // X_monotone_curve_2
for(; oi != oi_end; ++oi) { for (const auto& xection : xections) {
base_overlap_cv = object_cast<Base_x_monotone_curve_2>(&(*oi)); const Intersection_point*
if (base_overlap_cv != nullptr) { p_p = boost::get<Intersection_point>(&xection);
// Add halfedge handles to the resulting curve. if (p_p != nullptr) {
Halfedge_handle he; *oi++ = Intersection_result(xection);
continue;
if (cv1.halfedge_handle() != invalid_he) he = cv1.halfedge_handle();
else if (cv2.halfedge_handle() != invalid_he)
he = cv2.halfedge_handle();
X_monotone_curve_2 overlap_cv (*base_overlap_cv, he);
overlap_cv.set_overlapping();
*oi = make_object (overlap_cv);
} }
else { const Base_x_monotone_curve_2* base_cv_p =
intersect_p = boost::get<Base_x_monotone_curve_2>(&xection);
object_cast<std::pair<Base_point_2, unsigned int> >(&(*oi)); CGAL_assertion(base_cv_p);
CGAL_assertion (intersect_p != nullptr); // Add halfedge handles to the resulting curve.
Halfedge_handle he;
*oi = make_object(std::make_pair(Point_2(intersect_p->first), if (cv1.halfedge_handle() != invalid_he) he = cv1.halfedge_handle();
intersect_p->second)); else if (cv2.halfedge_handle() != invalid_he)
} he = cv2.halfedge_handle();
X_monotone_curve_2 cv(*base_cv_p, he);
cv.set_overlapping();
*oi++ = Intersection_result(cv);
} }
xections.clear();
// Return a past-the-end iterator. return oi;
return oi_end;
} }
}; };

View File

@ -345,24 +345,31 @@ public:
class Intersect_2 { class Intersect_2 {
protected: protected:
//! The base traits. //! The base traits.
const Arr_overlay_traits_2* m_traits; const Arr_overlay_traits_2& m_traits;
/*! Constructor. /*! Constructor.
* The constructor is declared protected to allow only the functor * The constructor is declared protected to allow only the functor
* obtaining function, which is a member of the nesting class, * obtaining function, which is a member of the nesting class,
* constructing it. * constructing it.
*/ */
Intersect_2(const Arr_overlay_traits_2* traits) : m_traits(traits) {} Intersect_2(const Arr_overlay_traits_2& traits) : m_traits(traits) {}
//! Allow its functor obtaining function calling the protected constructor. //! Allow its functor obtaining function calling the protected constructor.
friend class Arr_overlay_traits_2<Gt2, Ar2, Ab2>; friend class Arr_overlay_traits_2<Gt2, Ar2, Ab2>;
public: public:
template<class OutputIterator> template <typename OutputIterator>
OutputIterator operator()(const X_monotone_curve_2& xcv1, OutputIterator operator()(const X_monotone_curve_2& xcv1,
const X_monotone_curve_2& xcv2, const X_monotone_curve_2& xcv2,
OutputIterator oi) OutputIterator oi)
{ {
typedef std::pair<Point_2, Multiplicity> Intersection_point;
typedef boost::variant<Intersection_point, X_monotone_curve_2>
Intersection_result;
typedef std::pair<Base_point_2, Multiplicity> Intersection_base_point;
typedef boost::variant<Intersection_base_point, Base_x_monotone_curve_2>
Intersection_base_result;
// In case the curves originate from the same arrangement, they are // In case the curves originate from the same arrangement, they are
// obviously interior-disjoint. // obviously interior-disjoint.
if (xcv1.color() == xcv2.color()) return oi; if (xcv1.color() == xcv2.color()) return oi;
@ -396,19 +403,16 @@ public:
// Note that we do not bother with curves whose left ends are open, // Note that we do not bother with curves whose left ends are open,
// since such curved did not intersect before. // since such curved did not intersect before.
const std::pair<Base_point_2, unsigned int>* base_ipt;
const Base_x_monotone_curve_2* overlap_xcv;
bool send_xcv1_first = true; bool send_xcv1_first = true;
OutputIterator oi_end;
Parameter_space_in_x_2 ps_x_op = m_traits->parameter_space_in_x_2_object(); auto ps_x_op = m_traits.parameter_space_in_x_2_object();
Parameter_space_in_y_2 ps_y_op = m_traits->parameter_space_in_y_2_object(); auto ps_y_op = m_traits.parameter_space_in_y_2_object();
const Arr_parameter_space bx1 = ps_x_op(xcv1, ARR_MIN_END); Arr_parameter_space bx1 = ps_x_op(xcv1, ARR_MIN_END);
const Arr_parameter_space by1 = ps_y_op(xcv1, ARR_MIN_END); Arr_parameter_space by1 = ps_y_op(xcv1, ARR_MIN_END);
const Arr_parameter_space bx2 = ps_x_op(xcv2, ARR_MIN_END); Arr_parameter_space bx2 = ps_x_op(xcv2, ARR_MIN_END);
const Arr_parameter_space by2 = ps_y_op(xcv2, ARR_MIN_END); Arr_parameter_space by2 = ps_y_op(xcv2, ARR_MIN_END);
const Gt2* m_base_tr = m_traits->base_traits(); const Gt2* m_base_tr = m_traits.base_traits();
if ((bx1 == ARR_INTERIOR) && (by1 == ARR_INTERIOR) && if ((bx1 == ARR_INTERIOR) && (by1 == ARR_INTERIOR) &&
(bx2 == ARR_INTERIOR) && (by2 == ARR_INTERIOR)) (bx2 == ARR_INTERIOR) && (by2 == ARR_INTERIOR))
@ -419,15 +423,17 @@ public:
m_base_tr->construct_min_vertex_2_object()(xcv2.base())) == LARGER); m_base_tr->construct_min_vertex_2_object()(xcv2.base())) == LARGER);
} }
oi_end = (send_xcv1_first) ? auto intersector = m_base_tr->intersect_2_object();
m_base_tr->intersect_2_object()(xcv1.base(), xcv2.base(), oi) : std::vector<Intersection_base_result> xections;
m_base_tr->intersect_2_object()(xcv2.base(), xcv1.base(), oi); (send_xcv1_first) ?
intersector(xcv1.base(), xcv2.base(), std::back_inserter(xections)) :
intersector(xcv2.base(), xcv1.base(), std::back_inserter(xections));
// Convert objects that are associated with Base_x_monotone_curve_2 to // Convert objects that are associated with Base_x_monotone_curve_2 to
// the exteneded X_monotone_curve_2. // the exteneded X_monotone_curve_2.
while (oi != oi_end) { for (const auto& xection : xections) {
base_ipt = object_cast<std::pair<Base_point_2, unsigned int> >(&(*oi)); const Intersection_base_point* base_ipt =
boost::get<Intersection_base_point>(&xection);
if (base_ipt != nullptr) { if (base_ipt != nullptr) {
// We have a red-blue intersection point, so we attach the // We have a red-blue intersection point, so we attach the
// intersecting red and blue halfedges to it. // intersecting red and blue halfedges to it.
@ -451,42 +457,44 @@ public:
// Create the extended point and add the multiplicity. // Create the extended point and add the multiplicity.
Point_2 ex_point(base_ipt->first, red_cell, blue_cell); Point_2 ex_point(base_ipt->first, red_cell, blue_cell);
*oi++ = CGAL::make_object(std::make_pair(ex_point, base_ipt->second)); *oi++ =
Intersection_result(std::make_pair(ex_point, base_ipt->second));
continue;
}
const Base_x_monotone_curve_2* overlap_xcv =
boost::get<Base_x_monotone_curve_2>(&xection);
CGAL_assertion(overlap_xcv != nullptr);
// We have a red-blue overlap, so we mark the curve accordingly.
Halfedge_handle_red red_he;
Halfedge_handle_blue blue_he;
if (xcv1.color() == RED) {
red_he = xcv1.red_halfedge_handle();
// Overlap can occur only between curves from a different color.
CGAL_assertion(xcv2.color() == BLUE);
blue_he = xcv2.blue_halfedge_handle();
} }
else { else {
overlap_xcv = object_cast<Base_x_monotone_curve_2>(&(*oi)); CGAL_assertion((xcv1.color() == BLUE) && (xcv2.color() == RED));
CGAL_assertion(overlap_xcv != nullptr);
// We have a red-blue overlap, so we mark the curve accordingly. red_he = xcv2.red_halfedge_handle();
Halfedge_handle_red red_he; blue_he = xcv1.blue_halfedge_handle();
Halfedge_handle_blue blue_he;
if (xcv1.color() == RED) {
red_he = xcv1.red_halfedge_handle();
// Overlap can occur only between curves from a different color.
CGAL_assertion(xcv2.color() == BLUE);
blue_he = xcv2.blue_halfedge_handle();
}
else {
CGAL_assertion((xcv1.color() == BLUE) && (xcv2.color() == RED));
red_he = xcv2.red_halfedge_handle();
blue_he = xcv1.blue_halfedge_handle();
}
*oi++ = CGAL::make_object(X_monotone_curve_2(*overlap_xcv,
red_he, blue_he));
} }
X_monotone_curve_2 cv(*overlap_xcv, red_he, blue_he);
*oi++ = Intersection_result(cv);
} }
// Return the past-the-end iterator. // Return the past-the-end iterator.
return oi_end; return oi;
} }
}; };
/*! Obtain an Intersect_2 functor object. */ /*! Obtain an Intersect_2 functor object. */
Intersect_2 intersect_2_object() const { return Intersect_2(this); } Intersect_2 intersect_2_object() const { return Intersect_2(*this); }
/*! A functor that splits an arc at a point. */ /*! A functor that splits an arc at a point. */
class Split_2 { class Split_2 {

View File

@ -17,6 +17,7 @@
#include <CGAL/Arr_tags.h> #include <CGAL/Arr_tags.h>
#include <CGAL/Arrangement_2/Arr_traits_adaptor_2_dispatching.h> #include <CGAL/Arrangement_2/Arr_traits_adaptor_2_dispatching.h>
#include <CGAL/use.h> #include <CGAL/use.h>
#include "Traits_base_test.h" #include "Traits_base_test.h"
/*! Traits test */ /*! Traits test */
@ -989,18 +990,22 @@ intersect_wrapper(std::istringstream& str_stream)
typedef typename Traits::X_monotone_curve_2 X_monotone_curve_2; typedef typename Traits::X_monotone_curve_2 X_monotone_curve_2;
typedef typename Traits::Multiplicity Multiplicity; typedef typename Traits::Multiplicity Multiplicity;
typedef std::pair<Point_2, Multiplicity> Intersection_point;
typedef boost::variant<Intersection_point, X_monotone_curve_2>
Intersection_result;
unsigned int id1, id2; unsigned int id1, id2;
str_stream >> id1 >> id2; str_stream >> id1 >> id2;
std::vector<CGAL::Object> object_vec; std::vector<Intersection_result> xections;
this->m_geom_traits.intersect_2_object()(this->m_xcurves[id1], this->m_geom_traits.intersect_2_object()(this->m_xcurves[id1],
this->m_xcurves[id2], this->m_xcurves[id2],
std::back_inserter(object_vec)); std::back_inserter(xections));
std::cout << "Test: intersect( " << this->m_xcurves[id1] << "," std::cout << "Test: intersect( " << this->m_xcurves[id1] << ","
<< this->m_xcurves[id2] << " ) ? "; << this->m_xcurves[id2] << " ) ? ";
size_t num; size_t num;
str_stream >> num; str_stream >> num;
if (!this->compare(num, object_vec.size(), "size")) return false; if (! this->compare(num, xections.size(), "size")) return false;
for (size_t i = 0; i < num; ++i) { for (size_t i = 0; i < num; ++i) {
unsigned int type; // 0 - point, 1 - x-monotone curve unsigned int type; // 0 - point, 1 - x-monotone curve
@ -1011,30 +1016,25 @@ intersect_wrapper(std::istringstream& str_stream)
if (type == 0) str_stream >> multiplicity; if (type == 0) str_stream >> multiplicity;
unsigned int exp_type = 1; unsigned int exp_type = 1;
const X_monotone_curve_2 * xcv_ptr = const X_monotone_curve_2* cv_p =
CGAL::object_cast<X_monotone_curve_2> (&(object_vec[i])); boost::get<X_monotone_curve_2>(&(xections[i]));
if (xcv_ptr != NULL) { if (cv_p != nullptr) {
if (!this->compare(type, exp_type, "type")) return false; if (! this->compare(type, exp_type, "type")) return false;
if (! this->compare_curves(this->m_xcurves[id], *cv_p)) return false;
if (!this->compare_curves(this->m_xcurves[id], *xcv_ptr)) return false;
continue; continue;
} }
exp_type = 0; exp_type = 0;
typedef std::pair<Point_2,Multiplicity> Point_2_pair; const Intersection_point* p_p =
const Point_2_pair * pt_pair_ptr = boost::get<Intersection_point>(&(xections[i]));
CGAL::object_cast<Point_2_pair> (&(object_vec[i])); assert(p_p != nullptr);
assert(pt_pair_ptr != NULL); if (! this->compare(type, exp_type, "type")) return false;
if (!this->compare(type, exp_type, "type")) return false; if (! this->compare_points(this->m_points[id], p_p->first)) return false;
if (!this->compare_points(this->m_points[id], (*pt_pair_ptr).first)) if (! this->compare(multiplicity, p_p->second, "multiplicity")) return false;
return false; }
if (!this->compare(multiplicity, (*pt_pair_ptr).second, "multiplicity"))
return false;
} //forloop
object_vec.clear();
xections.clear();
return true; return true;
} }

View File

@ -25,6 +25,8 @@
#include <CGAL/Dynamic_property_map.h> #include <CGAL/Dynamic_property_map.h>
#include <CGAL/Kernel_traits.h> #include <CGAL/Kernel_traits.h>
#include <CGAL/Origin.h> #include <CGAL/Origin.h>
#include <CGAL/iterator.h>
#include <CGAL/property_map.h> #include <CGAL/property_map.h>
#include <boost/mpl/if.hpp> #include <boost/mpl/if.hpp>
@ -500,6 +502,18 @@ CGAL_DEF_GET_INITIALIZED_INDEX_MAP(face, typename boost::graph_traits<Graph>::fa
> ::type type; > ::type type;
}; };
template<typename PointRange, typename NamedParameters>
class GetAdjacencies
{
public:
typedef Emptyset_iterator Empty;
typedef typename internal_np::Lookup_named_param_def <
internal_np::adjacencies_t,
NamedParameters,
Empty//default
> ::type type;
};
} // namespace Point_set_processing_3 } // namespace Point_set_processing_3
template<typename NamedParameters, typename DefaultSolver> template<typename NamedParameters, typename DefaultSolver>

View File

@ -98,6 +98,7 @@ CGAL_add_named_parameter(i_used_as_a_predicate_t, i_used_as_a_predicate, i_used_
CGAL_add_named_parameter(nesting_levels_t, nesting_levels, nesting_levels); CGAL_add_named_parameter(nesting_levels_t, nesting_levels, nesting_levels);
CGAL_add_named_parameter(i_used_for_volume_orientation_t, i_used_for_volume_orientation, i_used_for_volume_orientation); CGAL_add_named_parameter(i_used_for_volume_orientation_t, i_used_for_volume_orientation, i_used_for_volume_orientation);
CGAL_add_named_parameter(area_threshold_t, area_threshold, area_threshold) CGAL_add_named_parameter(area_threshold_t, area_threshold, area_threshold)
CGAL_add_named_parameter(halfedges_keeper_t, halfedges_keeper, halfedges_keeper)
CGAL_add_named_parameter(volume_threshold_t, volume_threshold, volume_threshold) CGAL_add_named_parameter(volume_threshold_t, volume_threshold, volume_threshold)
CGAL_add_named_parameter(dry_run_t, dry_run, dry_run) CGAL_add_named_parameter(dry_run_t, dry_run, dry_run)
@ -147,6 +148,7 @@ CGAL_add_named_parameter(transformation_checkers_t, transformation_checkers, tra
CGAL_add_named_parameter(inspector_t, inspector, inspector) CGAL_add_named_parameter(inspector_t, inspector, inspector)
CGAL_add_named_parameter(logger_t, logger, logger) CGAL_add_named_parameter(logger_t, logger, logger)
CGAL_add_named_parameter(pointmatcher_config_t, pointmatcher_config, pointmatcher_config) CGAL_add_named_parameter(pointmatcher_config_t, pointmatcher_config, pointmatcher_config)
CGAL_add_named_parameter(adjacencies_t, adjacencies, adjacencies)
// List of named parameters used in Surface_mesh_approximation package // List of named parameters used in Surface_mesh_approximation package
CGAL_add_named_parameter(verbose_level_t, verbose_level, verbose_level) CGAL_add_named_parameter(verbose_level_t, verbose_level, verbose_level)
@ -165,6 +167,12 @@ CGAL_add_named_parameter(with_dihedral_angle_t, with_dihedral_angle, with_dihedr
CGAL_add_named_parameter(optimize_anchor_location_t, optimize_anchor_location, optimize_anchor_location) CGAL_add_named_parameter(optimize_anchor_location_t, optimize_anchor_location, optimize_anchor_location)
CGAL_add_named_parameter(pca_plane_t, pca_plane, pca_plane) CGAL_add_named_parameter(pca_plane_t, pca_plane, pca_plane)
// tetrahedral remeshing parameters
CGAL_add_named_parameter(remesh_boundaries_t, remesh_boundaries, remesh_boundaries)
CGAL_add_named_parameter(cell_selector_t, cell_selector, cell_selector)
CGAL_add_named_parameter(facet_is_constrained_t, facet_is_constrained, facet_is_constrained_map)
CGAL_add_named_parameter(remeshing_visitor_t, remeshing_visitor, remeshing_visitor)
// output parameters // output parameters
CGAL_add_named_parameter(face_proxy_map_t, face_proxy_map, face_proxy_map) CGAL_add_named_parameter(face_proxy_map_t, face_proxy_map, face_proxy_map)
CGAL_add_named_parameter(proxies_t, proxies, proxies) CGAL_add_named_parameter(proxies_t, proxies, proxies)
@ -176,4 +184,3 @@ CGAL_add_named_parameter(accuracy_t, accuracy, accuracy)
CGAL_add_named_parameter(maximum_running_time_t, maximum_running_time, maximum_running_time) CGAL_add_named_parameter(maximum_running_time_t, maximum_running_time, maximum_running_time)
CGAL_add_named_parameter(overlap_t, overlap, overlap) CGAL_add_named_parameter(overlap_t, overlap, overlap)
CGAL_add_named_parameter(maximum_normal_deviation_t, maximum_normal_deviation, maximum_normal_deviation) CGAL_add_named_parameter(maximum_normal_deviation_t, maximum_normal_deviation, maximum_normal_deviation)

View File

@ -95,8 +95,9 @@ void test(const NamedParameters& np)
assert(get_parameter(np, CGAL::internal_np::snapping_tolerance).v == 59); assert(get_parameter(np, CGAL::internal_np::snapping_tolerance).v == 59);
assert(get_parameter(np, CGAL::internal_np::dry_run).v == 60); assert(get_parameter(np, CGAL::internal_np::dry_run).v == 60);
assert(get_parameter(np, CGAL::internal_np::do_lock_mesh).v == 61); assert(get_parameter(np, CGAL::internal_np::do_lock_mesh).v == 61);
assert(get_parameter(np, CGAL::internal_np::halfedges_keeper).v == 62);
assert(get_parameter(np, CGAL::internal_np::do_simplify_border).v == 64);
assert(get_parameter(np, CGAL::internal_np::maximum_number_of_faces).v == 78910); assert(get_parameter(np, CGAL::internal_np::maximum_number_of_faces).v == 78910);
assert(get_parameter(np, CGAL::internal_np::do_simplify_border).v == 62);
// Named parameters that we use in the package 'Surface Mesh Simplification' // Named parameters that we use in the package 'Surface Mesh Simplification'
assert(get_parameter(np, CGAL::internal_np::get_cost_policy).v == 34); assert(get_parameter(np, CGAL::internal_np::get_cost_policy).v == 34);
@ -201,7 +202,8 @@ void test(const NamedParameters& np)
check_same_type<59>(get_parameter(np, CGAL::internal_np::snapping_tolerance)); check_same_type<59>(get_parameter(np, CGAL::internal_np::snapping_tolerance));
check_same_type<60>(get_parameter(np, CGAL::internal_np::dry_run)); check_same_type<60>(get_parameter(np, CGAL::internal_np::dry_run));
check_same_type<61>(get_parameter(np, CGAL::internal_np::do_lock_mesh)); check_same_type<61>(get_parameter(np, CGAL::internal_np::do_lock_mesh));
check_same_type<62>(get_parameter(np, CGAL::internal_np::do_simplify_border)); check_same_type<62>(get_parameter(np, CGAL::internal_np::halfedges_keeper));
check_same_type<64>(get_parameter(np, CGAL::internal_np::do_simplify_border));
check_same_type<78910>(get_parameter(np, CGAL::internal_np::maximum_number_of_faces)); check_same_type<78910>(get_parameter(np, CGAL::internal_np::maximum_number_of_faces));
// Named parameters that we use in the package 'Surface Mesh Simplification' // Named parameters that we use in the package 'Surface Mesh Simplification'
@ -348,8 +350,9 @@ int main()
.snapping_tolerance(A<59>(59)) .snapping_tolerance(A<59>(59))
.dry_run(A<60>(60)) .dry_run(A<60>(60))
.do_lock_mesh(A<61>(61)) .do_lock_mesh(A<61>(61))
.do_simplify_border(A<62>(62)) .halfedges_keeper(A<62>(62))
.use_convex_hull(A<63>(63)) .use_convex_hull(A<63>(63))
.do_simplify_border(A<64>(64))
.point_map(A<9000>(9000)) .point_map(A<9000>(9000))
.query_point_map(A<9001>(9001)) .query_point_map(A<9001>(9001))
.normal_map(A<9002>(9002)) .normal_map(A<9002>(9002))

View File

@ -16,24 +16,23 @@ public:
/// A model of this concept must provide: /// A model of this concept must provide:
/// @{ /// @{
/*! /*! computes the intersections of `xc1` and `xc2` and inserts them <I>in an
computes the intersections of `xc1` and `xc2` and * ascending lexicographic \f$ xy\f$-order</I> into a range begining at
inserts them <I>in an ascending lexicographic \f$ xy\f$-order</I> into the * `oi`. The type `OutputIterator` dereferences a `boost::variant` of either the
output iterator `oi`. The value-type of `Output_iterator` is * type `pair<ArrDirectionalTraits::Point_2,
`CGAL::Object`, where each `Object` wraps either a * ArrDirectionalTraits::Multiplicity>` or the type
`pair<ArrDirectionalTraits::Point_2, ArrDirectionalTraits::Multiplicity>` object, which * `ArrDirectionalTraits::X_monotone_curve_2`. An object of the former type
represents an intersection point with its multiplicity (in case the * represents an intersection point with its multiplicity (in case the
multiplicity is undefined or unknown, it is set to \f$ 0\f$) or an * multiplicity is undefined or unknown, it is set to \f$ 0\f$). An object of
`ArrDirectionalTraits::X_monotone_curve_2` object, representing an * the latter type representing an overlapping subcurve of `xc1` and `xc2`. The
overlapping subcurve of `xc1` and `xc2`. In the latter case, * overlapping subcurves are given the direction of `xc1` and `xc2` if their
the overlapping subcurves are given the direction of `xc1` and * directions are identical. Otherwise, the overlapping subcurves are given an
`xc2` if their directions are identical. Otherwise, the overlapping * arbitrary direction. The operator returns a past-the-end iterator of the
subcurves are given an arbitrary direction. The operator returns a * destination range.
past-the-end iterator for the output sequence. */
*/ OutputIterator operator()(ArrDirectionalTraits::X_monotone_curve_2 xc1,
Output_iterator operator()(ArrDirectionalTraits::X_monotone_curve_2 xc1, ArrDirectionalTraits::X_monotone_curve_2 xc2,
ArrDirectionalTraits::X_monotone_curve_2 xc2, Output_iterator& oi);
Output_iterator& oi);
/// @} /// @}

View File

@ -8,7 +8,8 @@
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
// //
// //
// Author(s) : Baruch Zukerman <baruchzu@post.tau.ac.il> // Author(s): Baruch Zukerman <baruchzu@post.tau.ac.il>
// Efi Fogel <efifogel@gmail.com>
#ifndef CGAL_BSO_2_GPS_AGG_META_TRAITS_H #ifndef CGAL_BSO_2_GPS_AGG_META_TRAITS_H
#define CGAL_BSO_2_GPS_AGG_META_TRAITS_H #define CGAL_BSO_2_GPS_AGG_META_TRAITS_H
@ -81,8 +82,8 @@ class Gps_agg_meta_traits :
typedef typename Arr::Traits_adaptor_2 Traits; typedef typename Arr::Traits_adaptor_2 Traits;
typedef Traits Gt2; typedef Traits Gt2;
typedef typename Gt2::X_monotone_curve_2 Base_X_monotone_curve_2; typedef typename Gt2::X_monotone_curve_2 Base_x_monotone_curve_2;
typedef typename Gt2::Point_2 Base_Point_2; typedef typename Gt2::Point_2 Base_point_2;
typedef typename Gt2::Construct_min_vertex_2 Base_Construct_min_vertex_2; typedef typename Gt2::Construct_min_vertex_2 Base_Construct_min_vertex_2;
typedef typename Gt2::Construct_max_vertex_2 Base_Construct_max_vertex_2; typedef typename Gt2::Construct_max_vertex_2 Base_Construct_max_vertex_2;
typedef typename Gt2::Compare_endpoints_xy_2 Base_Compare_endpoints_xy_2; typedef typename Gt2::Compare_endpoints_xy_2 Base_Compare_endpoints_xy_2;
@ -106,8 +107,8 @@ public:
typedef Point_with_vertex<Arr> Point_data; typedef Point_with_vertex<Arr> Point_data;
private: private:
typedef Gps_traits_decorator<Gt2, Curve_data, Point_data> typedef Gps_agg_meta_traits<Arrangement> Self;
Base; typedef Gps_traits_decorator<Gt2, Curve_data, Point_data> Base;
public: public:
typedef typename Base::X_monotone_curve_2 X_monotone_curve_2; typedef typename Base::X_monotone_curve_2 X_monotone_curve_2;
@ -145,93 +146,88 @@ public:
class Intersect_2 { class Intersect_2 {
private: private:
Base_Intersect_2 m_base; const Self& m_traits;
Base_Compare_endpoints_xy_2 m_base_cmp_endpoints;
Base_Compare_xy_2 m_base_cmp_xy; /*! Constructor. */
Base_Construct_min_vertex_2 m_base_ctr_min_v; Intersect_2(const Self& traits) : m_traits(traits) {}
friend Self;
public: public:
/*! Construct. */
Intersect_2(const Base_Intersect_2& base,
const Base_Compare_endpoints_xy_2& base_cmp_endpoints,
const Base_Compare_xy_2& base_cmp_xy,
const Base_Construct_min_vertex_2& base_ctr_min_v) :
m_base(base),
m_base_cmp_endpoints(base_cmp_endpoints),
m_base_cmp_xy(base_cmp_xy),
m_base_ctr_min_v(base_ctr_min_v)
{}
template <typename OutputIterator> template <typename OutputIterator>
OutputIterator operator()(const X_monotone_curve_2& cv1, OutputIterator operator()(const X_monotone_curve_2& cv1,
const X_monotone_curve_2& cv2, const X_monotone_curve_2& cv2,
OutputIterator oi) const OutputIterator oi) const
{ {
if (cv1.data().arr() == cv2.data().arr()) { // Check whether the curves are already in the same arrangement, and thus
return oi; // the curves are disjoint-interior because they // must be interior-disjoint
// are already at the same arrangement. if (cv1.data().arr() == cv2.data().arr()) return oi;
}
const std::pair<Base_Point_2, Multiplicity>* base_pt; typedef const std::pair<Base_point_2, Multiplicity>
const Base_X_monotone_curve_2* overlap_cv; Intersection_base_point;
OutputIterator oi_end; typedef boost::variant<Intersection_base_point, Base_x_monotone_curve_2>
if(m_base_cmp_xy(m_base_ctr_min_v(cv1.base()), Intersection_base_result;
m_base_ctr_min_v(cv2.base())) == LARGER) typedef const std::pair<Point_2, Multiplicity> Intersection_point;
oi_end = m_base(cv1.base(), cv2.base(), oi); typedef boost::variant<Intersection_point, X_monotone_curve_2>
Intersection_result;
const auto* base_traits = m_traits.m_base_traits;
auto base_cmp_xy = base_traits->compare_xy_2_object();
auto base_cmp_endpoints = base_traits->compare_endpoints_xy_2_object();
auto base_ctr_min_vertex = base_traits->construct_min_vertex_2_object();
auto base_intersect = base_traits->intersect_2_object();
std::vector<Intersection_base_result> xections;
if (base_cmp_xy(base_ctr_min_vertex(cv1.base()),
base_ctr_min_vertex(cv2.base())) == LARGER)
base_intersect(cv1.base(), cv2.base(), back_inserter(xections));
else else
oi_end = m_base(cv2.base(), cv1.base(), oi); base_intersect(cv2.base(), cv1.base(), back_inserter(xections));
// convert objects that are associated with Base_X_monotone_curve_2 to // convert objects that are associated with Base_x_monotone_curve_2 to
// the extenede X_monotone_curve_2 // the extenede X_monotone_curve_2
for (; oi != oi_end; ++oi) { for (const auto& xection : xections) {
base_pt = object_cast<std::pair<Base_Point_2, Multiplicity> >(&(*oi)); const Intersection_base_point* base_pt =
boost::get<Intersection_base_point>(&xection);
if (base_pt != nullptr) { if (base_pt != nullptr) {
Point_2 point_plus(base_pt->first); // the extended point Point_2 point_plus(base_pt->first); // the extended point
*oi = CGAL::make_object(std::make_pair(point_plus, *oi++ =
base_pt->second)); Intersection_result(std::make_pair(point_plus, base_pt->second));
continue;
}
const Base_x_monotone_curve_2* overlap_cv =
boost::get<Base_x_monotone_curve_2>(&xection);
CGAL_assertion(overlap_cv != nullptr);
unsigned int ov_bc;
unsigned int ov_twin_bc;
if (base_cmp_endpoints(cv1) == base_cmp_endpoints(cv2)) {
// cv1 and cv2 have the same directions
ov_bc = cv1.data().bc() + cv2.data().bc();
ov_twin_bc = cv1.data().twin_bc() + cv2.data().twin_bc();
} }
else { else {
overlap_cv = object_cast<Base_X_monotone_curve_2>(&(*oi)); // cv1 and cv2 have opposite directions
ov_bc = cv1.data().bc() + cv2.data().twin_bc();
if (overlap_cv != nullptr) { ov_twin_bc = cv1.data().twin_bc() + cv2.data().bc();
unsigned int ov_bc;
unsigned int ov_twin_bc;
if (m_base_cmp_endpoints(cv1) == m_base_cmp_endpoints(cv2)) {
// cv1 and cv2 have the same directions
ov_bc = cv1.data().bc() + cv2.data().bc();
ov_twin_bc = cv1.data().twin_bc() + cv2.data().twin_bc();
}
else {
// cv1 and cv2 have opposite directions
ov_bc = cv1.data().bc() + cv2.data().twin_bc();
ov_twin_bc = cv1.data().twin_bc() + cv2.data().bc();
}
if(m_base_cmp_endpoints(*overlap_cv) != m_base_cmp_endpoints(cv1)) {
// overlap_cv, cv1 have opposite directions
std::swap(ov_bc, ov_twin_bc);
}
Curve_data cv_data(cv1.data().arr(), Halfedge_handle(),
ov_bc, ov_twin_bc);
*oi = CGAL::make_object(X_monotone_curve_2(*overlap_cv, cv_data));
}
} }
if (base_cmp_endpoints(*overlap_cv) != base_cmp_endpoints(cv1)) {
// overlap_cv, cv1 have opposite directions
std::swap(ov_bc, ov_twin_bc);
}
Curve_data cv_data(cv1.data().arr(), Halfedge_handle(),
ov_bc, ov_twin_bc);
*oi++ = Intersection_result(X_monotone_curve_2(*overlap_cv, cv_data));
} }
//return past-end iterator
return oi_end; return oi;
} }
}; };
/*! Obtain an Intersect_2 functor object. */ /*! Obtain an Intersect_2 functor object. */
Intersect_2 intersect_2_object() const Intersect_2 intersect_2_object() const { return Intersect_2(*this); }
{
return Intersect_2(this->m_base_tr->intersect_2_object(),
this->m_base_tr->compare_endpoints_xy_2_object(),
this->m_base_tr->compare_xy_2_object(),
this->m_base_tr->construct_min_vertex_2_object());
}
class Split_2 { class Split_2 {
private: private:
@ -256,7 +252,7 @@ public:
/*! Obtain a Split_2 functor object. */ /*! Obtain a Split_2 functor object. */
Split_2 split_2_object() const Split_2 split_2_object() const
{ return Split_2(this->m_base_tr->split_2_object()); } { return Split_2(this->m_base_traits->split_2_object()); }
class Construct_min_vertex_2 { class Construct_min_vertex_2 {
private: private:
@ -286,7 +282,7 @@ public:
/*! Get a Construct_min_vertex_2 functor object. */ /*! Get a Construct_min_vertex_2 functor object. */
Construct_min_vertex_2 construct_min_vertex_2_object() const Construct_min_vertex_2 construct_min_vertex_2_object() const
{ {
return Construct_min_vertex_2(this->m_base_tr-> return Construct_min_vertex_2(this->m_base_traits->
construct_min_vertex_2_object()); construct_min_vertex_2_object());
} }
@ -318,7 +314,7 @@ public:
/*! Get a Construct_min_vertex_2 functor object. */ /*! Get a Construct_min_vertex_2 functor object. */
Construct_max_vertex_2 construct_max_vertex_2_object() const Construct_max_vertex_2 construct_max_vertex_2_object() const
{ {
return Construct_max_vertex_2(this->m_base_tr-> return Construct_max_vertex_2(this->m_base_traits->
construct_max_vertex_2_object()); construct_max_vertex_2_object());
} }
@ -348,7 +344,7 @@ public:
/*! Obtain a Construct_min_vertex_2 functor object. */ /*! Obtain a Construct_min_vertex_2 functor object. */
Compare_xy_2 compare_xy_2_object() const Compare_xy_2 compare_xy_2_object() const
{ return Compare_xy_2(this->m_base_tr->compare_xy_2_object()); } { return Compare_xy_2(this->m_base_traits->compare_xy_2_object()); }
// left-right // left-right
class Parameter_space_in_x_2 { class Parameter_space_in_x_2 {
@ -380,7 +376,7 @@ public:
/*! Obtain a Construct_min_vertex_2 functor object. */ /*! Obtain a Construct_min_vertex_2 functor object. */
Parameter_space_in_x_2 parameter_space_in_x_2_object() const Parameter_space_in_x_2 parameter_space_in_x_2_object() const
{ {
return Parameter_space_in_x_2(this->m_base_tr-> return Parameter_space_in_x_2(this->m_base_traits->
parameter_space_in_x_2_object()); parameter_space_in_x_2_object());
} }
@ -404,7 +400,7 @@ public:
/*! Obtain a Construct_min_vertex_2 functor object. */ /*! Obtain a Construct_min_vertex_2 functor object. */
Compare_y_near_boundary_2 compare_y_near_boundary_2_object() const Compare_y_near_boundary_2 compare_y_near_boundary_2_object() const
{ {
return Compare_y_near_boundary_2(this->m_base_tr-> return Compare_y_near_boundary_2(this->m_base_traits->
compare_y_near_boundary_2_object() compare_y_near_boundary_2_object()
); );
} }
@ -443,7 +439,7 @@ public:
/*! Obtain a Construct_min_vertex_2 functor object. */ /*! Obtain a Construct_min_vertex_2 functor object. */
Parameter_space_in_y_2 parameter_space_in_y_2_object() const Parameter_space_in_y_2 parameter_space_in_y_2_object() const
{ {
return Parameter_space_in_y_2(this->m_base_tr-> return Parameter_space_in_y_2(this->m_base_traits->
parameter_space_in_y_2_object()); parameter_space_in_y_2_object());
} }
@ -476,7 +472,7 @@ public:
/*! Obtain a Construct_min_vertex_2 functor object. */ /*! Obtain a Construct_min_vertex_2 functor object. */
Compare_x_near_boundary_2 compare_x_near_boundary_2_object() const Compare_x_near_boundary_2 compare_x_near_boundary_2_object() const
{ {
return Compare_x_near_boundary_2(this->m_base_tr-> return Compare_x_near_boundary_2(this->m_base_traits->
compare_x_near_boundary_2_object()); compare_x_near_boundary_2_object());
} }

View File

@ -75,7 +75,7 @@ public:
Construct_min_vertex_2 construct_min_vertex_2_object () const Construct_min_vertex_2 construct_min_vertex_2_object () const
{ {
return Construct_min_vertex_2 return Construct_min_vertex_2
(this->m_base_tr->construct_min_vertex_2_object()); (this->m_base_traits->construct_min_vertex_2_object());
} }
@ -100,7 +100,7 @@ public:
Construct_max_vertex_2 construct_max_vertex_2_object () const Construct_max_vertex_2 construct_max_vertex_2_object () const
{ {
return Construct_max_vertex_2 return Construct_max_vertex_2
(this->m_base_tr->construct_max_vertex_2_object()); (this->m_base_traits->construct_max_vertex_2_object());
} }
class Compare_xy_2 class Compare_xy_2
@ -123,7 +123,7 @@ public:
/*! Get a Compare_xy_2 functor object. */ /*! Get a Compare_xy_2 functor object. */
Compare_xy_2 compare_xy_2_object () const Compare_xy_2 compare_xy_2_object () const
{ {
return Compare_xy_2(m_base_tr->compare_xy_2_object()); return Compare_xy_2(m_base_traits->compare_xy_2_object());
} }
}; };

View File

@ -8,7 +8,8 @@
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
// //
// //
// Author(s) : Baruch Zukerman <baruchzu@post.tau.ac.il> // Author(s): Baruch Zukerman <baruchzu@post.tau.ac.il>
// Efi Fogel <efifogel@gmail.com>
#ifndef CGAL_GPS_SIMPLIFIER_TRAITS_H #ifndef CGAL_GPS_SIMPLIFIER_TRAITS_H
#define CGAL_GPS_SIMPLIFIER_TRAITS_H #define CGAL_GPS_SIMPLIFIER_TRAITS_H
@ -20,103 +21,67 @@
namespace CGAL { namespace CGAL {
class Gps_simplifier_curve_data class Gps_simplifier_curve_data {
{
protected: protected:
unsigned int m_bc; unsigned int m_bc;
unsigned int m_twin_bc; unsigned int m_twin_bc;
unsigned int m_index; unsigned int m_index;
public: public:
Gps_simplifier_curve_data() Gps_simplifier_curve_data() {}
{}
Gps_simplifier_curve_data(unsigned int bc, Gps_simplifier_curve_data(unsigned int bc, unsigned int twin_bc,
unsigned int twin_bc,
unsigned int index): unsigned int index):
m_bc(bc), m_bc(bc),
m_twin_bc(twin_bc), m_twin_bc(twin_bc),
m_index(index) m_index(index)
{} {}
unsigned int bc() const unsigned int bc() const { return m_bc; }
{
return m_bc;
}
unsigned int twin_bc() const unsigned int twin_bc() const { return m_twin_bc; }
{
return m_twin_bc;
}
unsigned int index() const unsigned int index() const { return m_index; }
{
return m_index;
}
unsigned int& index() unsigned int& index() { return m_index; }
{
return m_index;
}
unsigned int& twin_bc() unsigned int& twin_bc() { return m_twin_bc; }
{
return m_twin_bc;
}
void set_bc(unsigned int bc) void set_bc(unsigned int bc) { m_bc = bc; }
{
m_bc = bc;
}
void set_twin_bc(unsigned int twin_bc) void set_twin_bc(unsigned int twin_bc) { m_twin_bc = twin_bc; }
{
m_twin_bc = twin_bc;
}
void set_index(unsigned int index) void set_index(unsigned int index) { m_index = index; }
{
m_index = index;
}
}; };
struct Gps_simplifier_point_data struct Gps_simplifier_point_data {
{
protected: protected:
unsigned int m_index; unsigned int m_index;
public: public:
Gps_simplifier_point_data() Gps_simplifier_point_data() {}
{}
Gps_simplifier_point_data(unsigned int index) : m_index(index) Gps_simplifier_point_data(unsigned int index) : m_index(index) {}
{}
unsigned int index() const unsigned int index() const { return m_index; }
{
return m_index;
}
void set_index(unsigned int index) void set_index(unsigned int index) { m_index = index; }
{
m_index = index;
}
}; };
template <class Traits_> template <typename Traits_>
class Gps_simplifier_traits : class Gps_simplifier_traits :
public Gps_traits_decorator<Traits_, public Gps_traits_decorator<Traits_,
Gps_simplifier_curve_data, Gps_simplifier_curve_data,
Gps_simplifier_point_data> Gps_simplifier_point_data>
{ {
public: public:
typedef Traits_ Traits; typedef Traits_ Traits;
typedef Gps_traits_decorator<Traits_, typedef Gps_traits_decorator<Traits_,
Gps_simplifier_curve_data, Gps_simplifier_curve_data,
Gps_simplifier_point_data> Base; Gps_simplifier_point_data> Base;
typedef Gps_simplifier_traits<Traits> Self; typedef Gps_simplifier_traits<Traits> Self;
typedef typename Traits::X_monotone_curve_2 Base_X_monotone_curve_2; typedef typename Traits::X_monotone_curve_2 Base_x_monotone_curve_2;
typedef typename Traits::Point_2 Base_Point_2; typedef typename Traits::Point_2 Base_point_2;
typedef typename Traits::Construct_min_vertex_2 Base_Construct_min_vertex_2; typedef typename Traits::Construct_min_vertex_2 Base_Construct_min_vertex_2;
typedef typename Traits::Construct_max_vertex_2 Base_Construct_max_vertex_2; typedef typename Traits::Construct_max_vertex_2 Base_Construct_max_vertex_2;
typedef typename Traits::Compare_endpoints_xy_2 Base_Compare_endpoints_xy_2; typedef typename Traits::Compare_endpoints_xy_2 Base_Compare_endpoints_xy_2;
@ -129,9 +94,7 @@ public:
protected: protected:
mutable unsigned int m_pgn_size; mutable unsigned int m_pgn_size;
public: public:
typedef typename Base::X_monotone_curve_2 X_monotone_curve_2; typedef typename Base::X_monotone_curve_2 X_monotone_curve_2;
typedef typename Base::Point_2 Point_2; typedef typename Base::Point_2 Point_2;
typedef typename Base::Multiplicity Multiplicity; typedef typename Base::Multiplicity Multiplicity;
@ -139,333 +102,256 @@ public:
typedef typename Base::Curve_data Curve_data; typedef typename Base::Curve_data Curve_data;
typedef typename Base::Point_data Point_data; typedef typename Base::Point_data Point_data;
Gps_simplifier_traits() Gps_simplifier_traits() {}
{}
Gps_simplifier_traits(const Traits & tr) : Base(tr) Gps_simplifier_traits(const Traits& tr) : Base(tr) {}
{}
unsigned int polygon_size() const unsigned int polygon_size() const { return m_pgn_size; }
{
return m_pgn_size;
}
void set_polygon_size(unsigned int pgn_size) const void set_polygon_size(unsigned int pgn_size) const { m_pgn_size = pgn_size; }
{
m_pgn_size = pgn_size;
}
bool is_valid_index(unsigned int index) const bool is_valid_index(unsigned int index) const
{ { return (index < m_pgn_size); }
return (index < m_pgn_size);
}
unsigned int invalid_index() const unsigned int invalid_index() const { return (m_pgn_size); }
{
return (m_pgn_size);
}
class Intersect_2 {
class Intersect_2
{
private: private:
/*! The traits (in case it has state) */
Base_Intersect_2 m_base; const Self& m_traits;
Base_Compare_endpoints_xy_2 m_base_cmp_endpoints;
Base_Compare_xy_2 m_base_cmp_xy;
Base_Construct_min_vertex_2 m_ctr_min_v;
const Self * m_self_tr;
public:
/*! Constructor. */ /*! Constructor. */
Intersect_2 (const Base_Intersect_2& base, Intersect_2(const Self& tr) : m_traits(tr) {}
const Base_Compare_endpoints_xy_2& base_cmp_endpoints,
const Base_Compare_xy_2& base_cmp_xy,
const Base_Construct_min_vertex_2& ,
const Self* tr) :
m_base(base),
m_base_cmp_endpoints(base_cmp_endpoints),
m_base_cmp_xy(base_cmp_xy),
m_self_tr(tr)
{}
template<class OutputIterator> friend Self;
OutputIterator operator() (const X_monotone_curve_2& cv1,
const X_monotone_curve_2& cv2, public:
OutputIterator oi) const template <typename OutputIterator>
OutputIterator operator()(const X_monotone_curve_2& cv1,
const X_monotone_curve_2& cv2,
OutputIterator oi) const
{ {
typedef const std::pair<Base_point_2, Multiplicity>
Intersection_base_point;
typedef boost::variant<Intersection_base_point, Base_x_monotone_curve_2>
Intersection_base_result;
typedef const std::pair<Point_2, Multiplicity> Intersection_point;
typedef boost::variant<Intersection_point, X_monotone_curve_2>
Intersection_result;
const auto* base_traits = m_traits.m_base_traits;
auto base_cmp_xy = base_traits->compare_xy_2_object();
auto base_cmp_endpoints = base_traits->compare_endpoints_xy_2_object();
auto base_ctr_min_vertex = base_traits->construct_min_vertex_2_object();
auto base_intersect = base_traits->intersect_2_object();
//// if the two curves are incident, do not intersect them //// if the two curves are incident, do not intersect them
//if(m_self_tr->is_valid_index(cv1.data().index()) && //if (m_traits.is_valid_index(cv1.data().index()) &&
// m_self_tr->is_valid_index(cv2.data().index())) // m_traits.is_valid_index(cv2.data().index()))
//{ //{
// unsigned int index_diff = // unsigned int index_diff =
// (cv1.data().index() > cv2.data().index()) ? // (cv1.data().index() > cv2.data().index()) ?
// (cv1.data().index() - cv2.data().index()): // (cv1.data().index() - cv2.data().index()):
// (cv2.data().index() - cv1.data().index()); // (cv2.data().index() - cv1.data().index());
// if(index_diff == 1 ||index_diff == m_self_tr->polygon_size() -1) // if(index_diff == 1 ||index_diff == m_traits.polygon_size() -1)
// { // {
// return (oi); // return (oi);
// } // }
//} //}
const std::pair<Base_Point_2, Multiplicity> *base_pt; std::vector<Intersection_base_result> xections;
const Base_X_monotone_curve_2 *overlap_cv; if (base_cmp_xy(base_ctr_min_vertex(cv1.base()),
OutputIterator oi_end; base_ctr_min_vertex(cv2.base())) == LARGER)
if(m_base_cmp_xy(m_ctr_min_v(cv1.base()), base_intersect(cv1.base(), cv2.base(), back_inserter(xections));
m_ctr_min_v(cv2.base())) == LARGER)
oi_end = m_base(cv1.base(), cv2.base(), oi);
else else
oi_end = m_base(cv2.base(), cv1.base(), oi); base_intersect(cv2.base(), cv1.base(), back_inserter(xections));
// convert objects that are associated with Base_X_monotone_curve_2 to // convert objects that are associated with Base_x_monotone_curve_2 to
// the extenede X_monotone_curve_2 // the extenede X_monotone_curve_2
for(; oi != oi_end; ++oi) for (const auto& xection : xections) {
{ const Intersection_base_point* base_pt =
base_pt = object_cast<std::pair<Base_Point_2, Multiplicity> >(&(*oi)); boost::get<Intersection_base_point>(&xection);
if (base_pt != nullptr) {
if (base_pt != nullptr) Point_data pt_data(m_traits.invalid_index());
{ Point_2 point_plus(base_pt->first, pt_data); // the extended point
Point_data pt_data(m_self_tr->invalid_index()); *oi++ =
Point_2 point_plus (base_pt->first, pt_data); // the extended point Intersection_result(std::make_pair(point_plus, base_pt->second));
*oi = CGAL::make_object(std::make_pair(point_plus, continue;
base_pt->second));
} }
else
{
overlap_cv = object_cast<Base_X_monotone_curve_2> (&(*oi));
if (overlap_cv != nullptr) const Base_x_monotone_curve_2* overlap_cv =
{ boost::get<Base_x_monotone_curve_2>(&xection);
unsigned int ov_bc;
unsigned int ov_twin_bc;
if(m_base_cmp_endpoints(cv1) == m_base_cmp_endpoints(cv2))
{
// cv1 and cv2 have the same directions
ov_bc = cv1.data().bc() + cv2.data().bc();
ov_twin_bc = cv1.data().twin_bc() + cv2.data().twin_bc();
}
else
{
// cv1 and cv2 have opposite directions
ov_bc = cv1.data().bc() + cv2.data().twin_bc();
ov_twin_bc = cv1.data().twin_bc() + cv2.data().bc();
}
if(m_base_cmp_endpoints(*overlap_cv) != m_base_cmp_endpoints(cv1)) CGAL_assertion(overlap_cv != nullptr);
{ unsigned int ov_bc;
// overlap_cv, cv1 have opposite directions unsigned int ov_twin_bc;
std::swap(ov_bc, ov_twin_bc); if (base_cmp_endpoints(cv1) == base_cmp_endpoints(cv2)) {
} // cv1 and cv2 have the same directions
ov_bc = cv1.data().bc() + cv2.data().bc();
Curve_data cv_data(ov_bc, ov_twin_bc, m_self_tr->invalid_index()); ov_twin_bc = cv1.data().twin_bc() + cv2.data().twin_bc();
*oi = CGAL::make_object (X_monotone_curve_2 (*overlap_cv, cv_data));
}
} }
else {
// cv1 and cv2 have opposite directions
ov_bc = cv1.data().bc() + cv2.data().twin_bc();
ov_twin_bc = cv1.data().twin_bc() + cv2.data().bc();
}
if (base_cmp_endpoints(*overlap_cv) != base_cmp_endpoints(cv1)) {
// overlap_cv, cv1 have opposite directions
std::swap(ov_bc, ov_twin_bc);
}
Curve_data cv_data(ov_bc, ov_twin_bc, m_traits.invalid_index());
*oi++ = Intersection_result(X_monotone_curve_2(*overlap_cv, cv_data));
} }
//return past-end iterator
return oi_end; return oi;
} }
}; };
/*! Get an Intersect_2 functor object. */ /*! Obtain an Intersect_2 functor object. */
Intersect_2 intersect_2_object () const Intersect_2 intersect_2_object () const { return Intersect_2(*this); }
{
return Intersect_2(this->m_base_tr->intersect_2_object(),
this->m_base_tr->compare_endpoints_xy_2_object(),
this->m_base_tr->compare_xy_2_object(),
this->m_base_tr->construct_min_vertex_2_object(),
this);
}
class Split_2 class Split_2 {
{
private: private:
Base_Split_2 m_base_split; const Self& m_traits;
const Self * m_self_tr;
public:
/*! Constructor. */ /*! Constructor. */
Split_2 (const Base_Split_2& base, const Self* tr) : Split_2(const Self& tr) : m_traits(tr) {}
m_base_split(base),
m_self_tr(tr)
{}
void operator() (const X_monotone_curve_2& cv, const Point_2 & p, friend Self;
X_monotone_curve_2& c1, X_monotone_curve_2& c2) const
public:
void operator()(const X_monotone_curve_2& cv, const Point_2 & p,
X_monotone_curve_2& c1, X_monotone_curve_2& c2) const
{ {
m_base_split(cv.base(), const auto* base_traits = m_traits.m_base_traits;
p.base(), auto base_split = base_traits->split_2_object();
c1.base(), base_split(cv.base(), p.base(), c1.base(), c2.base());
c2.base());
const Curve_data& cv_data = cv.data(); const Curve_data& cv_data = cv.data();
c1.set_data(Curve_data(cv_data.bc(), c1.set_data(Curve_data(cv_data.bc(), cv_data.twin_bc(),
cv_data.twin_bc(), m_traits.invalid_index()));
m_self_tr->invalid_index()));
c2.set_data(Curve_data(cv_data.bc(), c2.set_data(Curve_data(cv_data.bc(), cv_data.twin_bc(),
cv_data.twin_bc(), m_traits.invalid_index()));
m_self_tr->invalid_index()));
} }
}; };
/*! Get a Split_2 functor object. */ /*! Get a Split_2 functor object. */
Split_2 split_2_object () const Split_2 split_2_object () const { return Split_2(*this); }
{
return Split_2(this->m_base_tr->split_2_object(), this);
}
class Construct_min_vertex_2 class Construct_min_vertex_2 {
{
private: private:
Base_Construct_min_vertex_2 m_base; const Self& m_traits;
Base_Compare_endpoints_xy_2 m_base_cmp_endpoints;
const Self * m_self_tr; Construct_min_vertex_2(const Self& tr) : m_traits(tr) {}
friend Self;
public: public:
/*! Obtain the left endpoint of the x-monotone curve (segment).
Construct_min_vertex_2(const Base_Construct_min_vertex_2& base,
const Base_Compare_endpoints_xy_2& base_cmp_endpoints,
const Self * tr):
m_base(base),
m_base_cmp_endpoints(base_cmp_endpoints),
m_self_tr(tr)
{}
/*!
* Get the left endpoint of the x-monotone curve (segment).
* \param cv The curve. * \param cv The curve.
* \return The left endpoint. * \return The left endpoint.
*/ */
Point_2 operator() (const X_monotone_curve_2 & cv) const Point_2 operator()(const X_monotone_curve_2 & cv) const
{ {
if(!m_self_tr->is_valid_index(cv.data().index())) const auto* base_traits = m_traits.m_base_traits;
{ auto base_ctr_min_vertex = base_traits->construct_min_vertex_2_object();
return Point_2 (m_base(cv.base()), m_self_tr->invalid_index());
}
Comparison_result res = m_base_cmp_endpoints(cv); if (! m_traits.is_valid_index(cv.data().index()))
return Point_2(base_ctr_min_vertex(cv.base()), m_traits.invalid_index());
auto base_cmp_endpoints = base_traits->compare_endpoints_xy_2_object();
Comparison_result res = base_cmp_endpoints(cv);
Point_data pt_data; Point_data pt_data;
if(res == SMALLER) if (res == SMALLER) {
{
// min vertex is the source // min vertex is the source
pt_data.set_index(cv.data().index()); pt_data.set_index(cv.data().index());
} }
else else {
{
// min vertex is the target // min vertex is the target
pt_data.set_index((cv.data().index() + 1) % m_self_tr->polygon_size()); pt_data.set_index((cv.data().index() + 1) % m_traits.polygon_size());
} }
return Point_2 (m_base(cv.base()), pt_data); return Point_2(base_ctr_min_vertex(cv.base()), pt_data);
} }
}; };
/*! Get a Construct_min_vertex_2 functor object. */ /*! Get a Construct_min_vertex_2 functor object. */
Construct_min_vertex_2 construct_min_vertex_2_object () const Construct_min_vertex_2 construct_min_vertex_2_object () const
{ { return Construct_min_vertex_2(*this); }
return Construct_min_vertex_2
(this->m_base_tr->construct_min_vertex_2_object(),
this->m_base_tr->compare_endpoints_xy_2_object(),
this);
}
class Construct_max_vertex_2 {
class Construct_max_vertex_2
{
private: private:
Base_Construct_max_vertex_2 m_base; const Self& m_traits;
Base_Compare_endpoints_xy_2 m_base_cmp_endpoints;
const Self * m_self_tr; Construct_max_vertex_2(const Self& tr) : m_traits(tr) {}
friend Self;
public: public:
/*! Obtain the right endpoint of the x-monotone curve (segment).
Construct_max_vertex_2(const Base_Construct_max_vertex_2& base,
const Base_Compare_endpoints_xy_2& base_cmp_endpoints,
const Self * tr):
m_base(base),
m_base_cmp_endpoints(base_cmp_endpoints),
m_self_tr(tr)
{}
/*!
* Get the right endpoint of the x-monotone curve (segment).
* \param cv The curve. * \param cv The curve.
* \return The left endpoint. * \return The left endpoint.
*/ */
Point_2 operator() (const X_monotone_curve_2 & cv) const Point_2 operator() (const X_monotone_curve_2 & cv) const
{ {
if(!m_self_tr->is_valid_index(cv.data().index())) const auto* base_traits = m_traits.m_base_traits;
{ auto base_ctr_max_vertex = base_traits->construct_max_vertex_2_object();
return Point_2 (m_base(cv.base()), m_self_tr->invalid_index()); if (! m_traits.is_valid_index(cv.data().index()))
} return Point_2(base_ctr_max_vertex(cv.base()), m_traits.invalid_index());
Comparison_result res = m_base_cmp_endpoints(cv);
auto base_cmp_endpoints = base_traits->compare_endpoints_xy_2_object();
Comparison_result res = base_cmp_endpoints(cv);
Point_data pt_data; Point_data pt_data;
if(res == SMALLER) if (res == SMALLER) {
{
// min vertex is the target // min vertex is the target
pt_data.set_index((cv.data().index() + 1) % m_self_tr->polygon_size()); pt_data.set_index((cv.data().index() + 1) % m_traits.polygon_size());
} }
else else {
{
// min vertex is the source // min vertex is the source
pt_data.set_index(cv.data().index()); pt_data.set_index(cv.data().index());
} }
return Point_2 (m_base(cv.base()), pt_data); return Point_2(base_ctr_max_vertex(cv.base()), pt_data);
} }
}; };
/*! Get a Construct_min_vertex_2 functor object. */ /*! Get a Construct_min_vertex_2 functor object. */
Construct_max_vertex_2 construct_max_vertex_2_object () const Construct_max_vertex_2 construct_max_vertex_2_object () const
{ { return Construct_max_vertex_2(*this); }
return Construct_max_vertex_2
(this->m_base_tr->construct_max_vertex_2_object(),
this->m_base_tr->compare_endpoints_xy_2_object(),
this);
}
class Compare_xy_2 class Compare_xy_2 {
{
private: private:
Base_Compare_xy_2 m_base; const Self& m_traits;
const Self * m_self_tr;
Compare_xy_2(const Self& tr) : m_traits(tr) {}
friend Self;
public: public:
Compare_xy_2(const Base_Compare_xy_2& base, /*! Obtain the left endpoint of the x-monotone curve (segment).
const Self * tr):
m_base(base),
m_self_tr(tr)
{}
/*!
* Get the left endpoint of the x-monotone curve (segment).
* \param cv The curve. * \param cv The curve.
* \return The left endpoint. * \return The left endpoint.
*/ */
Comparison_result operator() (const Point_2& p1, const Point_2& p2) const Comparison_result operator()(const Point_2& p1, const Point_2& p2) const
{ {
const auto* base_traits = m_traits.m_base_traits;
auto base_cmp_xy = base_traits->compare_xy_2_object();
//if one of the indexes is invalid, compare p1 and p2 //if one of the indexes is invalid, compare p1 and p2
if(! m_self_tr->is_valid_index(p1.data().index()) || if (! m_traits.is_valid_index(p1.data().index()) ||
! m_self_tr->is_valid_index(p2.data().index())) ! m_traits.is_valid_index(p2.data().index()))
return (m_base(p1.base(), p2.base())); return (base_cmp_xy(p1.base(), p2.base()));
// if the two point has the same index, return EQUAL // if the two point has the same index, return EQUAL
if(p1.data().index() == p2.data().index()) if (p1.data().index() == p2.data().index()) return EQUAL;
{
return EQUAL;
}
return (m_base(p1.base(), p2.base())); return (base_cmp_xy(p1.base(), p2.base()));
} }
}; };
/*! Get a Construct_min_vertex_2 functor object. */ /*! Get a Construct_min_vertex_2 functor object. */
Compare_xy_2 compare_xy_2_object () const Compare_xy_2 compare_xy_2_object () const { return Compare_xy_2(*this); }
{
return Compare_xy_2(this->m_base_tr->compare_xy_2_object(), this);
}
}; };
} //namespace CGAL } //namespace CGAL

View File

@ -202,25 +202,27 @@ public:
protected: protected:
//Data members //Data members
const Base * m_base_tr; const Base* m_base_traits;
bool m_traits_owner; bool m_traits_owner;
public: public:
Gps_traits_decorator() : Gps_traits_decorator() :
m_base_tr(new Base()), m_base_traits(new Base()),
m_traits_owner(true) m_traits_owner(true)
{} {}
Gps_traits_decorator(const Base & base_traits) : Gps_traits_decorator(const Base& base_traits) :
m_base_tr(&base_traits), m_base_traits(&base_traits),
m_traits_owner(false) m_traits_owner(false)
{} {}
~Gps_traits_decorator() ~Gps_traits_decorator()
{ {
if (m_traits_owner) if (m_traits_owner) {
delete m_base_tr; delete m_base_traits;
m_base_traits = nullptr;
}
} }
class Compare_x_2 class Compare_x_2
@ -242,7 +244,7 @@ public:
/*! Get a Compare_x_2 functor object. */ /*! Get a Compare_x_2 functor object. */
Compare_x_2 compare_x_2_object () const Compare_x_2 compare_x_2_object () const
{ {
return Compare_x_2(m_base_tr->compare_x_2_object()); return Compare_x_2(m_base_traits->compare_x_2_object());
} }
@ -265,7 +267,7 @@ public:
/*! Get a Compare_xy_2 functor object. */ /*! Get a Compare_xy_2 functor object. */
Compare_xy_2 compare_xy_2_object () const Compare_xy_2 compare_xy_2_object () const
{ {
return Compare_xy_2(m_base_tr->compare_xy_2_object()); return Compare_xy_2(m_base_traits->compare_xy_2_object());
} }
class Construct_min_vertex_2 class Construct_min_vertex_2
@ -288,7 +290,7 @@ public:
/*! Get a Construct_min_vertex_2 functor object. */ /*! Get a Construct_min_vertex_2 functor object. */
Construct_min_vertex_2 construct_min_vertex_2_object () const Construct_min_vertex_2 construct_min_vertex_2_object () const
{ {
return Construct_min_vertex_2(m_base_tr->construct_min_vertex_2_object()); return Construct_min_vertex_2(m_base_traits->construct_min_vertex_2_object());
} }
class Construct_max_vertex_2 class Construct_max_vertex_2
@ -311,7 +313,7 @@ public:
/*! Get a Construct_max_vertex_2 functor object. */ /*! Get a Construct_max_vertex_2 functor object. */
Construct_max_vertex_2 construct_max_vertex_2_object () const Construct_max_vertex_2 construct_max_vertex_2_object () const
{ {
return Construct_max_vertex_2(m_base_tr->construct_max_vertex_2_object()); return Construct_max_vertex_2(m_base_traits->construct_max_vertex_2_object());
} }
@ -334,7 +336,7 @@ public:
/*! Get a Is_vertical_2 functor object. */ /*! Get a Is_vertical_2 functor object. */
Is_vertical_2 is_vertical_2_object() const Is_vertical_2 is_vertical_2_object() const
{ {
return Is_vertical_2(m_base_tr->is_vertical_2_object()); return Is_vertical_2(m_base_traits->is_vertical_2_object());
} }
@ -358,7 +360,7 @@ public:
/*! Get a compare_y_at_x_2_object functor object. */ /*! Get a compare_y_at_x_2_object functor object. */
Compare_y_at_x_2 compare_y_at_x_2_object() const Compare_y_at_x_2 compare_y_at_x_2_object() const
{ {
return Compare_y_at_x_2(m_base_tr->compare_y_at_x_2_object()); return Compare_y_at_x_2(m_base_traits->compare_y_at_x_2_object());
} }
@ -384,7 +386,7 @@ public:
/*! Get a Compare_y_at_x_right_2 functor object. */ /*! Get a Compare_y_at_x_right_2 functor object. */
Compare_y_at_x_right_2 compare_y_at_x_right_2_object() const Compare_y_at_x_right_2 compare_y_at_x_right_2_object() const
{ {
return Compare_y_at_x_right_2(m_base_tr->compare_y_at_x_right_2_object()); return Compare_y_at_x_right_2(m_base_traits->compare_y_at_x_right_2_object());
} }
@ -407,7 +409,7 @@ public:
/*! Get a Equal_2 functor object. */ /*! Get a Equal_2 functor object. */
Equal_2 equal_2_object() const Equal_2 equal_2_object() const
{ {
return Equal_2(m_base_tr->equal_2_object()); return Equal_2(m_base_traits->equal_2_object());
} }
@ -432,7 +434,7 @@ public:
/*! Get a Split_2 functor object. */ /*! Get a Split_2 functor object. */
Split_2 split_2_object() const Split_2 split_2_object() const
{ {
return Split_2(m_base_tr->split_2_object()); return Split_2(m_base_traits->split_2_object());
} }
@ -495,9 +497,9 @@ public:
/*! Get a Intersect_2 functor object. */ /*! Get a Intersect_2 functor object. */
Intersect_2 intersect_2_object() const Intersect_2 intersect_2_object() const
{ {
return Intersect_2(m_base_tr->intersect_2_object(), return Intersect_2(m_base_traits->intersect_2_object(),
m_base_tr->compare_xy_2_object(), m_base_traits->compare_xy_2_object(),
m_base_tr->construct_min_vertex_2_object()); m_base_traits->construct_min_vertex_2_object());
} }
@ -522,7 +524,7 @@ public:
/*! Get a Compare_endpoints_xy_2 functor object. */ /*! Get a Compare_endpoints_xy_2 functor object. */
Compare_endpoints_xy_2 compare_endpoints_xy_2_object() const Compare_endpoints_xy_2 compare_endpoints_xy_2_object() const
{ {
return Compare_endpoints_xy_2(m_base_tr->compare_endpoints_xy_2_object()); return Compare_endpoints_xy_2(m_base_traits->compare_endpoints_xy_2_object());
} }
@ -545,7 +547,7 @@ public:
/*! Get a Construct_opposite_2 functor object. */ /*! Get a Construct_opposite_2 functor object. */
Construct_opposite_2 construct_opposite_2_object() const Construct_opposite_2 construct_opposite_2_object() const
{ {
return Construct_opposite_2(m_base_tr->construct_opposite_2_object()); return Construct_opposite_2(m_base_traits->construct_opposite_2_object());
} }
}; };

View File

@ -60,9 +60,9 @@ public:
Edge_const_iterator m_curr_edge; // points to the current edge iterator Edge_const_iterator m_curr_edge; // points to the current edge iterator
public: public:
Polygon_2_curve_iterator< X_monotone_curve_2_, Polygon_ >(){} Polygon_2_curve_iterator(){}
Polygon_2_curve_iterator< X_monotone_curve_2_, Polygon_ > Polygon_2_curve_iterator
(const Polygon* pgn, Edge_const_iterator ci) : m_pgn(pgn), (const Polygon* pgn, Edge_const_iterator ci) : m_pgn(pgn),
m_curr_edge(ci) {} m_curr_edge(ci) {}

View File

@ -27,7 +27,7 @@ class Gps_circle_segment_traits_2 :
public Gps_traits_2<Arr_circle_segment_traits_2<Kernel_, Filer_> > public Gps_traits_2<Arr_circle_segment_traits_2<Kernel_, Filer_> >
{ {
public: public:
Gps_circle_segment_traits_2<Kernel_, Filer_>(bool use_cache = false) : Gps_circle_segment_traits_2(bool use_cache = false) :
Gps_traits_2<Arr_circle_segment_traits_2<Kernel_, Filer_> >() Gps_traits_2<Arr_circle_segment_traits_2<Kernel_, Filer_> >()
{ {
this->m_use_cache = use_cache; this->m_use_cache = use_cache;

View File

@ -35,6 +35,8 @@ public:
typedef typename Base::Point_2 Point_2; typedef typename Base::Point_2 Point_2;
typedef typename Base::X_monotone_curve_2 X_monotone_curve_2; typedef typename Base::X_monotone_curve_2 X_monotone_curve_2;
typedef typename Base::Multiplicity Multiplicity;
//Polygon_2 type is required by GeneralPolygonSetTraits Concept //Polygon_2 type is required by GeneralPolygonSetTraits Concept
typedef General_polygon_t Polygon_2; typedef General_polygon_t Polygon_2;
//Polygon_2 is a model of the GeneralPolygon2 concept //Polygon_2 is a model of the GeneralPolygon2 concept

1
CGALConfigVersion.cmake Normal file
View File

@ -0,0 +1 @@
include(${CMAKE_CURRENT_LIST_DIR}/Installation/lib/cmake/CGAL/CGALConfigVersion.cmake)

View File

@ -10,6 +10,7 @@ export(PACKAGE CGAL)
set( CGAL_BRANCH_BUILD ON CACHE INTERNAL "Create CGAL from a Git branch" FORCE) set( CGAL_BRANCH_BUILD ON CACHE INTERNAL "Create CGAL from a Git branch" FORCE)
include(${CMAKE_SOURCE_DIR}/CGALConfigVersion.cmake)
include(${CMAKE_SOURCE_DIR}/Installation/cmake/modules/CGAL_SCM.cmake) include(${CMAKE_SOURCE_DIR}/Installation/cmake/modules/CGAL_SCM.cmake)
CGAL_detect_git(${CMAKE_SOURCE_DIR}) CGAL_detect_git(${CMAKE_SOURCE_DIR})

View File

@ -169,6 +169,9 @@ public:
Aff_transformation_3 operator*(const Aff_transformationC3 &t) const Aff_transformation_3 operator*(const Aff_transformationC3 &t) const
{ return (*this->Ptr()) * (*t.Ptr()); } { return (*this->Ptr()) * (*t.Ptr()); }
std::ostream &
print(std::ostream &os) const;
bool operator==(const Aff_transformationC3 &t)const bool operator==(const Aff_transformationC3 &t)const
{ {
for(int i=0; i<3; ++i) for(int i=0; i<3; ++i)
@ -188,13 +191,21 @@ protected:
}; };
template < class R >
std::ostream&
Aff_transformationC3<R>::print(std::ostream &os) const
{
this->Ptr()->print(os);
return os;
}
#ifndef CGAL_NO_OSTREAM_INSERT_AFF_TRANSFORMATIONC3 #ifndef CGAL_NO_OSTREAM_INSERT_AFF_TRANSFORMATIONC3
template < class R > template < class R >
std::ostream &operator<<(std::ostream &os, std::ostream&
const Aff_transformationC3<R> &t) operator<<(std::ostream &os, const Aff_transformationC3<R> &t)
{ {
t.print(os); t.print(os);
return os; return os;
} }
#endif // CGAL_NO_OSTREAM_INSERT_AFF_TRANSFORMATIONC3 #endif // CGAL_NO_OSTREAM_INSERT_AFF_TRANSFORMATIONC3

View File

@ -183,8 +183,8 @@ public:
virtual std::ostream &print(std::ostream &os) const virtual std::ostream &print(std::ostream &os) const
{ {
os <<"Aff_transformationC3("<<t11<<' '<<t12<<' '<<t13<<' '<<t14<<std::endl; os <<"Aff_transformationC3("<<t11<<' '<<t12<<' '<<t13<<' '<<t14<<std::endl;
os <<" "<< t21<<' '<<t22<<' '<<t23<<' '<<t24<<std::endl; os <<" "<<t21<<' '<<t22<<' '<<t23<<' '<<t24<<std::endl;
os <<" "<< t31<<' '<<t32<<' '<<t33<<' '<<t34<<")"; os <<" "<<t31<<' '<<t32<<' '<<t33<<' '<<t34<<")";
return os; return os;
} }

View File

@ -197,8 +197,8 @@ namespace CGAL {
void * for_compact_container() const void * for_compact_container() const
{ return vp; } { return vp; }
void * & for_compact_container() void for_compact_container(void *p)
{ return vp; } { vp = p; }
private: private:
/// Reference counting: the number of darts linked to this cell. /// Reference counting: the number of darts linked to this cell.
@ -310,8 +310,8 @@ namespace CGAL {
void * for_compact_container() const void * for_compact_container() const
{ return mdart.for_compact_container(); } { return mdart.for_compact_container(); }
void * & for_compact_container() void for_compact_container(void *p)
{ return mdart.for_compact_container(); } { mdart.for_compact_container(p); }
private: private:
/// The dart handle associated with the cell. /// The dart handle associated with the cell.

View File

@ -105,8 +105,8 @@ namespace CGAL {
void * for_compact_container() const void * for_compact_container() const
{ return mf[0].for_compact_container(); } { return mf[0].for_compact_container(); }
void * & for_compact_container() void for_compact_container(void *p)
{ return mf[0].for_compact_container(); } { mf[0].for_compact_container(p); }
Dart_handle get_f(unsigned int i) const Dart_handle get_f(unsigned int i) const
{ {

View File

@ -39,7 +39,7 @@ class Tee_for_output_iterator
public: public:
Tee_for_output_iterator(const OutputIterator& o) : o_it(o) Tee_for_output_iterator(const OutputIterator& o) : o_it(o)
{ PTR.p = (Rep*) new _Tee_for_output_iterator_rep<T>(); } { PTR = (Rep*) new _Tee_for_output_iterator_rep<T>(); }
Tee_for_output_iterator<OutputIterator,T>& Tee_for_output_iterator<OutputIterator,T>&
operator=(const T& value) operator=(const T& value)
@ -82,7 +82,7 @@ public:
_Tee_for_output_iterator_rep<T>* _Tee_for_output_iterator_rep<T>*
ptr() ptr()
{ return (_Tee_for_output_iterator_rep<T>*)(PTR.p); } { return (_Tee_for_output_iterator_rep<T>*)PTR; }
protected: protected:
OutputIterator o_it; OutputIterator o_it;

View File

@ -87,7 +87,7 @@ public:
void* pp; void* pp;
void* for_compact_container() const { return pp; } void* for_compact_container() const { return pp; }
void* & for_compact_container() { return pp; } void for_compact_container(void *p) { pp = p; }
#ifdef CGAL_USE_LEDA #ifdef CGAL_USE_LEDA
LEDA_MEMORY(RC_vertex_d) LEDA_MEMORY(RC_vertex_d)
@ -153,7 +153,7 @@ public:
void* pp; void* pp;
void* for_compact_container() const { return pp; } void* for_compact_container() const { return pp; }
void* & for_compact_container() { return pp; } void for_compact_container(void *p) { pp = p; }
#if 0 #if 0
struct Point_const_iterator { struct Point_const_iterator {

View File

@ -252,9 +252,7 @@ endif()
if (NOT CGAL_CREATED_VERSION_NUM) if (NOT CGAL_CREATED_VERSION_NUM)
if (CGAL_BRANCH_BUILD) if (CGAL_BRANCH_BUILD)
file(STRINGS "${CGAL_ROOT}/Maintenance/release_building/MAJOR_NUMBER" CGAL_MAJOR_VERSION REGEX "[0-9]*") include(${CGAL_ROOT}/CGALConfigVersion.cmake)
file(STRINGS "${CGAL_ROOT}/Maintenance/release_building/MINOR_NUMBER" CGAL_MINOR_VERSION REGEX "[0-9]*")
file(STRINGS "${CGAL_ROOT}/Maintenance/release_building/BUGFIX_NUMBER" CGAL_BUGFIX_VERSION REGEX "[0-9]*")
if (CGAL_BUGFIX_VERSION AND CGAL_BUGFIX_VERSION GREATER 0) if (CGAL_BUGFIX_VERSION AND CGAL_BUGFIX_VERSION GREATER 0)
set(CGAL_CREATED_VERSION_NUM "${CGAL_MAJOR_VERSION}.${CGAL_MINOR_VERSION}.${CGAL_BUGFIX_VERSION}") set(CGAL_CREATED_VERSION_NUM "${CGAL_MAJOR_VERSION}.${CGAL_MINOR_VERSION}.${CGAL_BUGFIX_VERSION}")

View File

@ -90,6 +90,7 @@
\package_listing{Surface_mesher} \package_listing{Surface_mesher}
\package_listing{Skin_surface_3} \package_listing{Skin_surface_3}
\package_listing{Mesh_3} \package_listing{Mesh_3}
\package_listing{Tetrahedral_remeshing}
\package_listing{Periodic_3_mesh_3} \package_listing{Periodic_3_mesh_3}
\cgalPackageSection{PartReconstruction,Shape Reconstruction} \cgalPackageSection{PartReconstruction,Shape Reconstruction}

View File

@ -3127,6 +3127,14 @@ pages = "207--221"
year={2012}, year={2012},
organization={Wiley Online Library} organization={Wiley Online Library}
} }
@article{faraj2016mvr,
author = {Noura Faraj and Jean-Marc Thiery and Tamy Boubekeur},
title = {Multi-Material Adaptive Volume Remesher},
journal = {Compurer and Graphics Journal (proc. Shape Modeling International 2016)},
year = {2016},
}
% ---------------------------------------------------------------------------- % ----------------------------------------------------------------------------
% END OF BIBFILE % END OF BIBFILE
% ---------------------------------------------------------------------------- % ----------------------------------------------------------------------------

View File

@ -718,17 +718,17 @@ public :
Lazy(Self_rep *r) Lazy(Self_rep *r)
{ {
PTR.p = r; PTR = r;
} }
Lazy(const ET& e) Lazy(const ET& e)
{ {
PTR.p = new Lazy_rep_0<AT,ET,E2A>(e); PTR = new Lazy_rep_0<AT,ET,E2A>(e);
} }
Lazy(ET&& e) Lazy(ET&& e)
{ {
PTR.p = new Lazy_rep_0<AT,ET,E2A>(std::move(e)); PTR = new Lazy_rep_0<AT,ET,E2A>(std::move(e));
} }
friend void swap(Lazy& a, Lazy& b) noexcept friend void swap(Lazy& a, Lazy& b) noexcept
@ -768,7 +768,7 @@ public :
return z; return z;
} }
Self_rep * ptr() const { return (Self_rep*) PTR.p; } Self_rep * ptr() const { return (Self_rep*) PTR; }
}; };
// The magic functor for Construct_bbox_[2,3], as there is no Lazy<Bbox> // The magic functor for Construct_bbox_[2,3], as there is no Lazy<Bbox>

View File

@ -771,6 +771,17 @@ operator*(const Aff_transformationH2<R>& right_argument) const
right_argument.Ptr()->general_form() ); right_argument.Ptr()->general_form() );
} }
template <class R>
std::ostream&
operator<<(std::ostream& out, const Aff_transformationH2<R>& t)
{
typename R::RT RT0(0);
Aff_transformation_repH2<R> r = t.Ptr()->general_form();
return out << "| "<< r.a << ' ' << r.b << ' ' << r.c << " |\n"
<< "| "<< r.d << ' ' << r.e << ' ' << r.f << " |\n"
<< "| "<< RT0 << ' ' << RT0 << ' ' << r.g << " |\n";
}
template <class R> template <class R>
Aff_transformationH2<R> Aff_transformationH2<R>
_general_transformation_composition( Aff_transformation_repH2<R> l, _general_transformation_composition( Aff_transformation_repH2<R> l,

View File

@ -233,12 +233,11 @@ public:
~Largest_empty_iso_rectangle_2(); ~Largest_empty_iso_rectangle_2();
//! An operator= //! An operator=
Largest_empty_iso_rectangle_2<T>& Largest_empty_iso_rectangle_2&
operator =(const Largest_empty_iso_rectangle_2<T>& ler); operator =(const Largest_empty_iso_rectangle_2& ler);
//! A copy constructor //! A copy constructor
Largest_empty_iso_rectangle_2<T>( Largest_empty_iso_rectangle_2(const Largest_empty_iso_rectangle_2& ler);
const Largest_empty_iso_rectangle_2<T>& ler);
struct Internal_point { struct Internal_point {
Point_2 x_part;// the x coordinate of the point Point_2 x_part;// the x coordinate of the point

View File

@ -0,0 +1 @@
include(${CMAKE_CURRENT_LIST_DIR}/lib/cmake/CGAL/CGALConfigVersion.cmake)

View File

@ -21,6 +21,15 @@ Release History
the signed distance of two points to a line, or the line passing through two given points. the signed distance of two points to a line, or the line passing through two given points.
Corresponding functors in the model (`Compare_signed_distance_to_line_2`) are also added. Corresponding functors in the model (`Compare_signed_distance_to_line_2`) are also added.
### Point Set Processing
- Add a function `CGAL::cluster_point_set()` that segments a point
cloud into connected components based on a distance threshold.
- **Breaking change:** `CGAL::remove_outliers()` has been
parallelized and thus has a new template parameter
`ConcurrencyTag`. To update your code simply add as first template
parameter `CGAL::Sequential_tag` or `CGAL::Parallel_tag` when
calling this function.
### 2D Triangulations ### 2D Triangulations
- Add function `split_subconstraint_graph_into_constraints()` to - Add function `split_subconstraint_graph_into_constraints()` to
`Constrained_triangulation_plus_2` to initialize the constraints `Constrained_triangulation_plus_2` to initialize the constraints
@ -37,11 +46,31 @@ Release History
is given an optional template parameter `ConcurrencyTag` (default is given an optional template parameter `ConcurrencyTag` (default
value remains `CGAL::Sequential_tag` for backward compatibility). value remains `CGAL::Sequential_tag` for backward compatibility).
### Surface Mesh
- **Breaking change**: The function `CGAL::Surface_mesh::clear()` now removes all non-default properties instead of just emptying them.
Release 5.0 Release 5.0
----------- -----------
Release date: June 2020 Release date: June 2020
### 2D Arrangement on Surface
- Changed intersection return type from legacy `CGAL::Object` to modern
`boost::variant` in all traits concepts and models.
As there is an implicit conversion from `boost::variant` to `CGAL::Object`, the
new code is backward compatible. However, it is recommended that all calls
to the intersection functions are fixed to use the new return type.
### 2D Regularized Boolean Operations
- Changed intersection return type from legacy `CGAL::Object` to modern
`boost::variant` in the concept `ArrDirectionalTraits::Intersect_2` and
its models..
### 2D Minkowski sums
- Changed intersection return type from legacy `CGAL::Object` to modern
`boost::variant` in the (internally used) model `Arr_labeled_traits_2`.
### Surface Mesh Topology (new package) ### Surface Mesh Topology (new package)
- This package allows to compute some topological invariants of - This package allows to compute some topological invariants of

View File

@ -20,7 +20,7 @@ if(POLICY CMP0056)
cmake_policy(SET CMP0056 NEW) cmake_policy(SET CMP0056 NEW)
endif() endif()
# Use GNUInstallDirst to get canonical paths # Use GNUInstallDirs to get canonical paths
include(GNUInstallDirs) include(GNUInstallDirs)
#-------------------------------------------------------------------------------------------------- #--------------------------------------------------------------------------------------------------
@ -135,10 +135,6 @@ if ( CGAL_BRANCH_BUILD )
# Create version files # Create version files
# #
file(STRINGS "${CGAL_MAINTENANCE_PACKAGE_DIR}/release_building/MAJOR_NUMBER" CGAL_MAJOR_VERSION REGEX "[0-9]*")
file(STRINGS "${CGAL_MAINTENANCE_PACKAGE_DIR}/release_building/MINOR_NUMBER" CGAL_MINOR_VERSION REGEX "[0-9]*")
file(STRINGS "${CGAL_MAINTENANCE_PACKAGE_DIR}/release_building/BUGFIX_NUMBER" CGAL_BUGFIX_VERSION REGEX "[0-9]*")
file(REMOVE ${CMAKE_BINARY_DIR}/VERSION) file(REMOVE ${CMAKE_BINARY_DIR}/VERSION)
if (CGAL_BUGFIX_VERSION AND CGAL_BUGFIX_VERSION GREATER 0) if (CGAL_BUGFIX_VERSION AND CGAL_BUGFIX_VERSION GREATER 0)
set(CGAL_CREATED_VERSION_NUM "${CGAL_MAJOR_VERSION}.${CGAL_MINOR_VERSION}.${CGAL_BUGFIX_VERSION}") set(CGAL_CREATED_VERSION_NUM "${CGAL_MAJOR_VERSION}.${CGAL_MINOR_VERSION}.${CGAL_BUGFIX_VERSION}")
@ -765,11 +761,11 @@ set ( CGAL_INSTALL_CMAKE_DIR "${CGAL_INSTALL_LIB_DIR}/cmake/CGAL"
CACHE STRING "The folder where CGAL CMake modules will be installed, relative to CMAKE_INSTALL_PREFIX" CACHE STRING "The folder where CGAL CMake modules will be installed, relative to CMAKE_INSTALL_PREFIX"
) )
set ( CGAL_INSTALL_DOC_DIR "${CMAKE_INSTALL_DATAROOTDIR}/doc/${CGAL_VERSION_DIR}" set ( CGAL_INSTALL_DOC_DIR "${CMAKE_INSTALL_DOCDIR}"
CACHE STRING "The folder where CGAL documentation and license files will be installed, relative to CMAKE_INSTALL_PREFIX" CACHE STRING "The folder where CGAL documentation and license files will be installed, relative to CMAKE_INSTALL_PREFIX"
) )
set ( CGAL_INSTALL_MAN_DIR "${CMAKE_INSTALL_DATAROOTDIR}/man/man1" set ( CGAL_INSTALL_MAN_DIR "${CMAKE_INSTALL_MANDIR}/man1"
CACHE STRING "The folder where manual pages for CGAL scripts will be installed, relative to CMAKE_INSTALL_PREFIX" CACHE STRING "The folder where manual pages for CGAL scripts will be installed, relative to CMAKE_INSTALL_PREFIX"
) )
@ -863,6 +859,8 @@ if(NOT CGAL_HEADER_ONLY)
else() else()
configure_file("${CGAL_MODULES_DIR}/CGALConfig_binary_header_only.cmake.in" configure_file("${CGAL_MODULES_DIR}/CGALConfig_binary_header_only.cmake.in"
"${CMAKE_BINARY_DIR}/CGALConfig.cmake" @ONLY) "${CMAKE_BINARY_DIR}/CGALConfig.cmake" @ONLY)
configure_file("${CGAL_MODULES_DIR}/CGALConfigVersion_binary_header_only.cmake.in"
"${CMAKE_BINARY_DIR}/CGALConfigVersion.cmake" @ONLY)
endif() endif()
#-------------------------------------------------------------------------------------------------- #--------------------------------------------------------------------------------------------------
@ -916,12 +914,17 @@ if(NOT CGAL_HEADER_ONLY)
${CMAKE_BINARY_DIR}/config/CGALConfig.cmake ${CMAKE_BINARY_DIR}/config/CGALConfig.cmake
DESTINATION ${CGAL_INSTALL_CMAKE_DIR} ) DESTINATION ${CGAL_INSTALL_CMAKE_DIR} )
else() else()
configure_file(${CMAKE_CURRENT_LIST_DIR}/lib/cmake/CGAL/CGALConfig-installation-dirs.cmake.in
${CMAKE_BINARY_DIR}/config/CGALConfig-installation-dirs.cmake)
install(FILES install(FILES
${CMAKE_BINARY_DIR}/config/CGALConfig-installation-dirs.cmake
${CMAKE_CURRENT_LIST_DIR}/lib/cmake/CGAL/CGALConfig.cmake ${CMAKE_CURRENT_LIST_DIR}/lib/cmake/CGAL/CGALConfig.cmake
DESTINATION ${CGAL_INSTALL_CMAKE_DIR} ) ${CMAKE_CURRENT_LIST_DIR}/lib/cmake/CGAL/CGALConfigVersion.cmake
DESTINATION ${CGAL_INSTALL_CMAKE_DIR})
if(NOT CGAL_INSTALL_CMAKE_DIR STREQUAL "${CGAL_INSTALL_LIB_DIR}/cmake/CGAL")
configure_file(${CMAKE_CURRENT_LIST_DIR}/lib/cmake/CGAL/CGALConfig-installation-dirs.cmake.in
${CMAKE_BINARY_DIR}/config/CGALConfig-installation-dirs.cmake)
install(FILES
${CMAKE_BINARY_DIR}/config/CGALConfig-installation-dirs.cmake
DESTINATION ${CGAL_INSTALL_CMAKE_DIR})
endif()
endif() endif()
if(CGAL_INSTALL_MAN_DIR) if(CGAL_INSTALL_MAN_DIR)
@ -1369,4 +1372,3 @@ if(NOT CGAL_BRANCH_BUILD AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/doc")
# in a non-branch build this is the top-level CMakeLists.txt # in a non-branch build this is the top-level CMakeLists.txt
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/doc") add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/doc")
endif() endif()

View File

@ -0,0 +1,5 @@
#
# This file points to the CGALConfigVersion.cmake for header-only CGAL.
#
include(@CGAL_INSTALLATION_PACKAGE_DIR@/lib/cmake/CGAL/CGALConfigVersion.cmake)

View File

@ -397,7 +397,7 @@ if( NOT CGAL_MACROS_FILE_INCLUDED )
# CGALConfig.cmake is platform specific so it is generated and stored in the binary folder. # CGALConfig.cmake is platform specific so it is generated and stored in the binary folder.
configure_file("${CGAL_MODULES_DIR}/CGALConfig_binary.cmake.in" "${CMAKE_BINARY_DIR}/CGALConfig.cmake" @ONLY) configure_file("${CGAL_MODULES_DIR}/CGALConfig_binary.cmake.in" "${CMAKE_BINARY_DIR}/CGALConfig.cmake" @ONLY)
write_basic_package_version_file("${CMAKE_BINARY_DIR}/CGALConfigVersion.cmake" write_basic_package_version_file("${CMAKE_BINARY_DIR}/CGALConfigVersion.cmake"
VERSION "${CGAL_MAJOR_VERSION}.${CGAL_MINOR_VERSION}.${CGAL_BUILD_VERSION}" VERSION "${CGAL_MAJOR_VERSION}.${CGAL_MINOR_VERSION}.${CGAL_BUGFIX_VERSION}"
COMPATIBILITY SameMajorVersion) COMPATIBILITY SameMajorVersion)
# There is also a version of CGALConfig.cmake that is prepared in case CGAL in installed in CMAKE_INSTALL_PREFIX. # There is also a version of CGALConfig.cmake that is prepared in case CGAL in installed in CMAKE_INSTALL_PREFIX.

View File

@ -85,7 +85,7 @@ function(CGAL_setup_CGAL_dependencies target)
set(keyword PUBLIC) set(keyword PUBLIC)
endif() endif()
if(CGAL_DISABLE_GMP) if(CGAL_DISABLE_GMP)
target_compile_definitions(${target} ${keyword} CGAL_DISABLE_GMP=1) target_compile_definitions(${target} ${keyword} CGAL_DISABLE_GMP=1)
else() else()
use_CGAL_GMP_support(${target} ${keyword}) use_CGAL_GMP_support(${target} ${keyword})
set(CGAL_USE_GMP TRUE CACHE INTERNAL "CGAL library is configured to use GMP") set(CGAL_USE_GMP TRUE CACHE INTERNAL "CGAL library is configured to use GMP")
@ -95,7 +95,7 @@ function(CGAL_setup_CGAL_dependencies target)
if(WITH_LEDA) if(WITH_LEDA)
use_CGAL_LEDA_support(${target} ${keyword}) use_CGAL_LEDA_support(${target} ${keyword})
endif() endif()
if (NOT CGAL_HEADER_ONLY) if (NOT CGAL_HEADER_ONLY)
target_compile_definitions(${target} ${keyword} CGAL_NOT_HEADER_ONLY=1) target_compile_definitions(${target} ${keyword} CGAL_NOT_HEADER_ONLY=1)
endif() endif()
@ -136,6 +136,12 @@ function(CGAL_setup_CGAL_dependencies target)
$<$<COMPILE_LANGUAGE:CXX>:/bigobj> # Use /bigobj by default $<$<COMPILE_LANGUAGE:CXX>:/bigobj> # Use /bigobj by default
) )
endif() endif()
elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "AppleClang")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 11.0.3)
message(STATUS "Apple Clang version ${CMAKE_CXX_COMPILER_VERSION} compiler detected")
message(STATUS "Boost MP is turned off for all Apple Clang versions below 11.0.3!")
target_compile_options(${target} ${keyword} "-DCGAL_DO_NOT_USE_BOOST_MP")
endif()
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel") elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
message( STATUS "Using Intel Compiler. Adding -fp-model strict" ) message( STATUS "Using Intel Compiler. Adding -fp-model strict" )
if(WIN32) if(WIN32)
@ -166,7 +172,7 @@ function(CGAL_setup_CGAL_dependencies target)
endif() endif()
if ( "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "alpha" ) if ( "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "alpha" )
message( STATUS "Using gcc on alpha. Adding -mieee -mfp-rounding-mode=d" ) message( STATUS "Using gcc on alpha. Adding -mieee -mfp-rounding-mode=d" )
target_compile_options(${target} ${keyword} "-mieee -mfp-rounding-mode=d" ) target_compile_options(${target} ${keyword} "-mieee" "-mfp-rounding-mode=d" )
endif() endif()
endif() endif()
endfunction() endfunction()

View File

@ -104,12 +104,10 @@ function(cgal_add_compilation_test exe_name)
if(NOT TARGET cgal_check_build_system) if(NOT TARGET cgal_check_build_system)
add_custom_target(cgal_check_build_system) add_custom_target(cgal_check_build_system)
add_dependencies( ALL_CGAL_TARGETS cgal_check_build_system ) add_dependencies( ALL_CGAL_TARGETS cgal_check_build_system )
endif()
if(NOT TEST check_build_system)
add_test(NAME "check_build_system" add_test(NAME "check_build_system"
COMMAND "${CMAKE_COMMAND}" --build "${CMAKE_BINARY_DIR}" --target "cgal_check_build_system" --config "$<CONFIG>") COMMAND "${CMAKE_COMMAND}" --build "${CMAKE_BINARY_DIR}" --target "cgal_check_build_system" --config "$<CONFIG>")
set_property(TEST "check_build_system" set_property(TEST "check_build_system"
APPEND PROPERTY LABELS "Installation") APPEND PROPERTY LABELS "${PROJECT_NAME}")
if(POLICY CMP0066) # cmake 3.7 or later if(POLICY CMP0066) # cmake 3.7 or later
set_property(TEST "check_build_system" set_property(TEST "check_build_system"
PROPERTY FIXTURES_SETUP "check_build_system_SetupFixture") PROPERTY FIXTURES_SETUP "check_build_system_SetupFixture")

View File

@ -11,7 +11,8 @@ function(cgal_parse_version_h version_h_file name)
# CMAKE_MATCH_3 and CMAKE_MATCH_4 corresponds to the two sub-expressions # CMAKE_MATCH_3 and CMAKE_MATCH_4 corresponds to the two sub-expressions
# of the alternative, and cannot be non-empty at the same time. # of the alternative, and cannot be non-empty at the same time.
set(${ARGV2} "${CMAKE_MATCH_3}${CMAKE_MATCH_4}" PARENT_SCOPE) # major version set(${ARGV2} "${CMAKE_MATCH_3}${CMAKE_MATCH_4}" PARENT_SCOPE) # major version
set(${ARGV3} "${CMAKE_MATCH_5}" PARENT_SCOPE) # minor version MATH(EXPR ${ARGV3} "${CMAKE_MATCH_5}") # minor version without leading 0
set(${ARGV3} "${${ARGV3}}" PARENT_SCOPE)
set(${ARGV4} "${CMAKE_MATCH_6}" PARENT_SCOPE) # patch number set(${ARGV4} "${CMAKE_MATCH_6}" PARENT_SCOPE) # patch number
set(${ARGV5} "${CMAKE_MATCH_7}" PARENT_SCOPE) # build number set(${ARGV5} "${CMAKE_MATCH_7}" PARENT_SCOPE) # build number
endfunction() endfunction()

View File

@ -36,6 +36,10 @@
# define WIN64 # define WIN64
#endif #endif
#ifdef BOOST_MSVC
#define _SILENCE_CXX17_ALLOCATOR_VOID_DEPRECATION_WARNING 1
#endif
#ifdef CGAL_INCLUDE_WINDOWS_DOT_H #ifdef CGAL_INCLUDE_WINDOWS_DOT_H
// Mimic users including this file which defines min max macros // Mimic users including this file which defines min max macros
// and other names leading to name clashes // and other names leading to name clashes
@ -546,13 +550,9 @@ using std::max;
#endif #endif
// Macro to specify a 'noreturn' attribute. // Macro to specify a 'noreturn' attribute.
#if defined(__GNUG__) || __has_attribute(__noreturn__) // (This macro existed in CGAL before we switched to C++11. Let's keep
# define CGAL_NORETURN __attribute__ ((__noreturn__)) // the macro defined for backward-compatibility. That cannot harm.)
#elif defined (_MSC_VER) #define CGAL_NORETURN [[noreturn]]
# define CGAL_NORETURN __declspec(noreturn)
#else
# define CGAL_NORETURN
#endif
// Macro to specify [[no_unique_address]] if supported // Macro to specify [[no_unique_address]] if supported
#if __has_cpp_attribute(no_unique_address) #if __has_cpp_attribute(no_unique_address)
@ -740,5 +740,4 @@ typedef const void * Nullptr_t; // Anticipate C++0x's std::nullptr_t
/// @} /// @}
#include <CGAL/license/lgpl.h> #include <CGAL/license/lgpl.h>
#endif // CGAL_CONFIG_H #endif // CGAL_CONFIG_H

View File

@ -0,0 +1,54 @@
// Copyright (c) 2016 GeometryFactory SARL (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org)
//
// $URL$
// $Id$
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial
//
// Author(s) : Andreas Fabri
//
// Warning: this file is generated, see include/CGAL/licence/README.md
#ifndef CGAL_LICENSE_TETRAHEDRAL_REMESHING_H
#define CGAL_LICENSE_TETRAHEDRAL_REMESHING_H
#include <CGAL/config.h>
#include <CGAL/license.h>
#ifdef CGAL_TETRAHEDRAL_REMESHING_COMMERCIAL_LICENSE
# if CGAL_TETRAHEDRAL_REMESHING_COMMERCIAL_LICENSE < CGAL_RELEASE_DATE
# if defined(CGAL_LICENSE_WARNING)
CGAL_pragma_warning("Your commercial license for CGAL does not cover "
"this release of the Tetrahedral Remeshing package.")
# endif
# ifdef CGAL_LICENSE_ERROR
# error "Your commercial license for CGAL does not cover this release \
of the Tetrahedral Remeshing package. \
You get this error, as you defined CGAL_LICENSE_ERROR."
# endif // CGAL_LICENSE_ERROR
# endif // CGAL_TETRAHEDRAL_REMESHING_COMMERCIAL_LICENSE < CGAL_RELEASE_DATE
#else // no CGAL_TETRAHEDRAL_REMESHING_COMMERCIAL_LICENSE
# if defined(CGAL_LICENSE_WARNING)
CGAL_pragma_warning("\nThe macro CGAL_TETRAHEDRAL_REMESHING_COMMERCIAL_LICENSE is not defined."
"\nYou use the CGAL Tetrahedral Remeshing package under "
"the terms of the GPLv3+.")
# endif // CGAL_LICENSE_WARNING
# ifdef CGAL_LICENSE_ERROR
# error "The macro CGAL_TETRAHEDRAL_REMESHING_COMMERCIAL_LICENSE is not defined.\
You use the CGAL Tetrahedral Remeshing package under the terms of \
the GPLv3+. You get this error, as you defined CGAL_LICENSE_ERROR."
# endif // CGAL_LICENSE_ERROR
#endif // no CGAL_TETRAHEDRAL_REMESHING_COMMERCIAL_LICENSE
#endif // CGAL_LICENSE_TETRAHEDRAL_REMESHING_H

View File

@ -93,3 +93,4 @@ Triangulation_3 3D Triangulations
Triangulation dD Triangulations Triangulation dD Triangulations
Visibility_2 2D Visibility Computation Visibility_2 2D Visibility Computation
Voronoi_diagram_2 2D Voronoi Diagram Adaptor Voronoi_diagram_2 2D Voronoi Diagram Adaptor
Tetrahedral_remeshing Tetrahedral Remeshing

View File

@ -1,4 +1,4 @@
# #
# This file is the CGALConfig.cmake for a header-only CGAL installation # This file is the CGALConfig.cmake for a header-only CGAL installation
# #
@ -53,6 +53,9 @@ else()
if(NOT EXISTS ${CGAL_ROOT}/include/CGAL/config.h) if(NOT EXISTS ${CGAL_ROOT}/include/CGAL/config.h)
get_filename_component(CGAL_ROOT "${CGAL_ROOT}" DIRECTORY) get_filename_component(CGAL_ROOT "${CGAL_ROOT}" DIRECTORY)
endif() endif()
if(NOT EXISTS ${CGAL_ROOT}/include/CGAL/config.h)
get_filename_component(CGAL_ROOT "${CGAL_ROOT}" DIRECTORY)
endif()
endif() endif()
# not BRANCH_BUILD: it can be an installed CGAL, or the tarball layout # not BRANCH_BUILD: it can be an installed CGAL, or the tarball layout
if(EXISTS ${CGAL_CONFIG_DIR}/CGAL_add_test.cmake) if(EXISTS ${CGAL_CONFIG_DIR}/CGAL_add_test.cmake)
@ -156,7 +159,17 @@ endforeach()
cgal_setup_module_path() cgal_setup_module_path()
set(CGAL_USE_FILE ${CGAL_MODULES_DIR}/UseCGAL.cmake) set(CGAL_USE_FILE ${CGAL_MODULES_DIR}/UseCGAL.cmake)
include(${CGAL_MODULES_DIR}/CGAL_target_use_Boost_IOStreams.cmake)
include(${CGAL_MODULES_DIR}/CGAL_target_use_Boost_Serialization.cmake)
include(${CGAL_MODULES_DIR}/CGAL_target_use_Eigen.cmake)
include(${CGAL_MODULES_DIR}/CGAL_target_use_GLPK.cmake)
include(${CGAL_MODULES_DIR}/CGAL_target_use_LASLIB.cmake)
include(${CGAL_MODULES_DIR}/CGAL_target_use_OpenCV.cmake)
include(${CGAL_MODULES_DIR}/CGAL_target_use_OpenGR.cmake)
include(${CGAL_MODULES_DIR}/CGAL_target_use_SCIP.cmake)
include(${CGAL_MODULES_DIR}/CGAL_target_use_TBB.cmake) include(${CGAL_MODULES_DIR}/CGAL_target_use_TBB.cmake)
include(${CGAL_MODULES_DIR}/CGAL_target_use_TensorFlow.cmake)
include(${CGAL_MODULES_DIR}/CGAL_target_use_pointmatcher.cmake)
include("${CGAL_MODULES_DIR}/CGAL_parse_version_h.cmake") include("${CGAL_MODULES_DIR}/CGAL_parse_version_h.cmake")
cgal_parse_version_h( "${CGAL_INSTALLATION_PACKAGE_DIR}/include/CGAL/version.h" cgal_parse_version_h( "${CGAL_INSTALLATION_PACKAGE_DIR}/include/CGAL/version.h"

View File

@ -0,0 +1,26 @@
set(CGAL_MAJOR_VERSION 5)
set(CGAL_MINOR_VERSION 1)
set(CGAL_BUGFIX_VERSION 0)
set(CGAL_VERSION_PUBLIC_RELEASE_VERSION "5.1-dev")
set(CGAL_VERSION_PUBLIC_RELEASE_NAME "CGAL-${CGAL_VERSION_PUBLIC_RELEASE_VERSION}")
if (CGAL_BUGFIX_VERSION AND CGAL_BUGFIX_VERSION GREATER 0)
set(CGAL_CREATED_VERSION_NUM "${CGAL_MAJOR_VERSION}.${CGAL_MINOR_VERSION}.${CGAL_BUGFIX_VERSION}")
else()
set(CGAL_CREATED_VERSION_NUM "${CGAL_MAJOR_VERSION}.${CGAL_MINOR_VERSION}")
endif()
set(PACKAGE_VERSION ${CGAL_CREATED_VERSION_NUM})
if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
set(PACKAGE_VERSION_COMPATIBLE FALSE)
else()
if(PACKAGE_FIND_VERSION_MAJOR STREQUAL CGAL_MAJOR_VERSION)
set(PACKAGE_VERSION_COMPATIBLE TRUE)
else()
set(PACKAGE_VERSION_COMPATIBLE FALSE)
endif()
if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
set(PACKAGE_VERSION_EXACT TRUE)
endif()
endif()

View File

@ -99,3 +99,43 @@ else()
message(STATUS "NOTICE: This program requires the CGAL library, and will not be compiled.") message(STATUS "NOTICE: This program requires the CGAL library, and will not be compiled.")
endif() endif()
function(CGAL_installation_test_find_package_version mode)
set(EXACT)
if(mode STREQUAL "less")
set(CGAL_MINOR_VERSION 0)
endif()
if(mode STREQUAL "less_major")
set(CGAL_MAJOR_VERSION 0)
endif()
if(mode STREQUAL "greater" OR mode STREQUAL "fail-exact")
MATH(EXPR CGAL_MINOR_VERSION "${CGAL_MINOR_VERSION} + 1")
endif()
if(mode STREQUAL "exact" OR mode STREQUAL "fail-exact")
set(EXACT "EXACT ")
endif()
if (CGAL_BUGFIX_VERSION AND CGAL_BUGFIX_VERSION GREATER 0)
set(VERSION "${CGAL_MAJOR_VERSION}.${CGAL_MINOR_VERSION}.${CGAL_BUGFIX_VERSION}")
else()
set(VERSION "${CGAL_MAJOR_VERSION}.${CGAL_MINOR_VERSION}")
endif()
file(REMOVE_RECURSE "${CMAKE_CURRENT_BINARY_DIR}/build-test_find_package_version_${mode}")
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/build-test_find_package_version_${mode})
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/test_find_package_version_${mode})
configure_file(test_find_package.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/test_find_package_version_${mode}/CMakeLists.txt)
add_test(NAME test_find_package_version_${mode}
COMMAND ${CMAKE_COMMAND} -S ${CMAKE_CURRENT_BINARY_DIR}/test_find_package_version_${mode} -B ${CMAKE_CURRENT_BINARY_DIR}/build-test_find_package_version_${mode} -DCGAL_DO_NOT_WARN_ABOUT_CMAKE_BUILD_TYPE=ON)
cgal_setup_test_properties(test_find_package_version_${mode})
endfunction()
CGAL_installation_test_find_package_version(less)
CGAL_installation_test_find_package_version(less_major)
CGAL_installation_test_find_package_version(equal)
CGAL_installation_test_find_package_version(greater)
CGAL_installation_test_find_package_version(exact)
CGAL_installation_test_find_package_version(fail-exact)
set_tests_properties(
test_find_package_version_greater
test_find_package_version_less_major
test_find_package_version_fail-exact
PROPERTIES WILL_FAIL TRUE)

View File

@ -0,0 +1,14 @@
cmake_minimum_required(VERSION ${CMAKE_VERSION})
project( test_find_package_${mode} )
find_package(CGAL ${VERSION} ${EXACT}REQUIRED
PATHS ${CGAL_DIR}
NO_DEFAULT_PATH
NO_PACKAGE_ROOT_PATH
NO_CMAKE_PATH
NO_CMAKE_ENVIRONMENT_PATH
NO_SYSTEM_ENVIRONMENT_PATH
NO_CMAKE_PACKAGE_REGISTRY
NO_CMAKE_BUILDS_PATH
NO_CMAKE_SYSTEM_PATH
NO_CMAKE_SYSTEM_PACKAGE_REGISTRY
)

View File

@ -34,7 +34,7 @@ struct Data_access
typedef typename Map::mapped_type Data_type; typedef typename Map::mapped_type Data_type;
typedef typename Map::key_type Key_type; typedef typename Map::key_type Key_type;
Data_access<Map>(const Map& m): map(m){} Data_access(const Map& m): map(m){}
std::pair< Data_type, bool> std::pair< Data_type, bool>
operator()(const Key_type& p) const operator()(const Key_type& p) const

View File

@ -115,7 +115,7 @@ class Interval_for_container : public Interval_
{} {}
void * for_compact_container() const { return p; } void * for_compact_container() const { return p; }
void * & for_compact_container() { return p; } void for_compact_container(void *ptr) { p = ptr; }
}; };
@ -457,7 +457,7 @@ class Interval_for_container : public Interval_
public: public:
#ifdef CGAL_ISL_USE_CCC #ifdef CGAL_ISL_USE_CCC
void * for_compact_container() const { return p; } void * for_compact_container() const { return p; }
void * & for_compact_container() { return p; } void for_compact_container(void *ptr) { p = ptr; }
#endif #endif
bool operator==(const IntervalListElt& e) bool operator==(const IntervalListElt& e)

View File

@ -202,6 +202,204 @@ determinant(
return m012345; return m012345;
} }
template <class RT>
RT
determinant(
const RT& a00, const RT& a01, const RT& a02, const RT& a03, const RT& a04, const RT& a05, const RT& a06,
const RT& a10, const RT& a11, const RT& a12, const RT& a13, const RT& a14, const RT& a15, const RT& a16,
const RT& a20, const RT& a21, const RT& a22, const RT& a23, const RT& a24, const RT& a25, const RT& a26,
const RT& a30, const RT& a31, const RT& a32, const RT& a33, const RT& a34, const RT& a35, const RT& a36,
const RT& a40, const RT& a41, const RT& a42, const RT& a43, const RT& a44, const RT& a45, const RT& a46,
const RT& a50, const RT& a51, const RT& a52, const RT& a53, const RT& a54, const RT& a55, const RT& a56,
const RT& a60, const RT& a61, const RT& a62, const RT& a63, const RT& a64, const RT& a65, const RT& a66)
{
// First compute the det2x2
const RT m01 = a00*a11 - a10*a01;
const RT m02 = a00*a21 - a20*a01;
const RT m03 = a00*a31 - a30*a01;
const RT m04 = a00*a41 - a40*a01;
const RT m05 = a00*a51 - a50*a01;
const RT m06 = a00*a61 - a60*a01;
const RT m12 = a10*a21 - a20*a11;
const RT m13 = a10*a31 - a30*a11;
const RT m14 = a10*a41 - a40*a11;
const RT m15 = a10*a51 - a50*a11;
const RT m16 = a10*a61 - a60*a11;
const RT m23 = a20*a31 - a30*a21;
const RT m24 = a20*a41 - a40*a21;
const RT m25 = a20*a51 - a50*a21;
const RT m26 = a20*a61 - a60*a21;
const RT m34 = a30*a41 - a40*a31;
const RT m35 = a30*a51 - a50*a31;
const RT m36 = a30*a61 - a60*a31;
const RT m45 = a40*a51 - a50*a41;
const RT m46 = a40*a61 - a60*a41;
const RT m56 = a50*a61 - a60*a51;
// Now compute the minors of rank 3
const RT m012 = m01*a22 - m02*a12 + m12*a02;
const RT m013 = m01*a32 - m03*a12 + m13*a02;
const RT m014 = m01*a42 - m04*a12 + m14*a02;
const RT m015 = m01*a52 - m05*a12 + m15*a02;
const RT m016 = m01*a62 - m06*a12 + m16*a02;
const RT m023 = m02*a32 - m03*a22 + m23*a02;
const RT m024 = m02*a42 - m04*a22 + m24*a02;
const RT m025 = m02*a52 - m05*a22 + m25*a02;
const RT m026 = m02*a62 - m06*a22 + m26*a02;
const RT m034 = m03*a42 - m04*a32 + m34*a02;
const RT m035 = m03*a52 - m05*a32 + m35*a02;
const RT m036 = m03*a62 - m06*a32 + m36*a02;
const RT m045 = m04*a52 - m05*a42 + m45*a02;
const RT m046 = m04*a62 - m06*a42 + m46*a02;
const RT m056 = m05*a62 - m06*a52 + m56*a02;
const RT m123 = m12*a32 - m13*a22 + m23*a12;
const RT m124 = m12*a42 - m14*a22 + m24*a12;
const RT m125 = m12*a52 - m15*a22 + m25*a12;
const RT m126 = m12*a62 - m16*a22 + m26*a12;
const RT m134 = m13*a42 - m14*a32 + m34*a12;
const RT m135 = m13*a52 - m15*a32 + m35*a12;
const RT m136 = m13*a62 - m16*a32 + m36*a12;
const RT m145 = m14*a52 - m15*a42 + m45*a12;
const RT m146 = m14*a62 - m16*a42 + m46*a12;
const RT m156 = m15*a62 - m16*a52 + m56*a12;
const RT m234 = m23*a42 - m24*a32 + m34*a22;
const RT m235 = m23*a52 - m25*a32 + m35*a22;
const RT m236 = m23*a62 - m26*a32 + m36*a22;
const RT m245 = m24*a52 - m25*a42 + m45*a22;
const RT m246 = m24*a62 - m26*a42 + m46*a22;
const RT m256 = m25*a62 - m26*a52 + m56*a22;
const RT m345 = m34*a52 - m35*a42 + m45*a32;
const RT m346 = m34*a62 - m36*a42 + m46*a32;
const RT m356 = m35*a62 - m36*a52 + m56*a32;
const RT m456 = m45*a62 - m46*a52 + m56*a42;
// Now compute the minors of rank 4
const RT m0123 = m012*a33 - m013*a23 + m023*a13 - m123*a03;
const RT m0124 = m012*a43 - m014*a23 + m024*a13 - m124*a03;
const RT m0125 = m012*a53 - m015*a23 + m025*a13 - m125*a03;
const RT m0126 = m012*a63 - m016*a23 + m026*a13 - m126*a03;
const RT m0134 = m013*a43 - m014*a33 + m034*a13 - m134*a03;
const RT m0135 = m013*a53 - m015*a33 + m035*a13 - m135*a03;
const RT m0136 = m013*a63 - m016*a33 + m036*a13 - m136*a03;
const RT m0145 = m014*a53 - m015*a43 + m045*a13 - m145*a03;
const RT m0146 = m014*a63 - m016*a43 + m046*a13 - m146*a03;
const RT m0156 = m015*a63 - m016*a53 + m056*a13 - m156*a03;
const RT m0234 = m023*a43 - m024*a33 + m034*a23 - m234*a03;
const RT m0235 = m023*a53 - m025*a33 + m035*a23 - m235*a03;
const RT m0236 = m023*a63 - m026*a33 + m036*a23 - m236*a03;
const RT m0245 = m024*a53 - m025*a43 + m045*a23 - m245*a03;
const RT m0246 = m024*a63 - m026*a43 + m046*a23 - m246*a03;
const RT m0256 = m025*a63 - m026*a53 + m056*a23 - m256*a03;
const RT m0345 = m034*a53 - m035*a43 + m045*a33 - m345*a03;
const RT m0346 = m034*a63 - m036*a43 + m046*a33 - m346*a03;
const RT m0356 = m035*a63 - m036*a53 + m056*a33 - m356*a03;
const RT m0456 = m045*a63 - m046*a53 + m056*a43 - m456*a03;
const RT m1234 = m123*a43 - m124*a33 + m134*a23 - m234*a13;
const RT m1235 = m123*a53 - m125*a33 + m135*a23 - m235*a13;
const RT m1236 = m123*a63 - m126*a33 + m136*a23 - m236*a13;
const RT m1245 = m124*a53 - m125*a43 + m145*a23 - m245*a13;
const RT m1246 = m124*a63 - m126*a43 + m146*a23 - m246*a13;
const RT m1256 = m125*a63 - m126*a53 + m156*a23 - m256*a13;
const RT m1345 = m134*a53 - m135*a43 + m145*a33 - m345*a13;
const RT m1346 = m134*a63 - m136*a43 + m146*a33 - m346*a13;
const RT m1356 = m135*a63 - m136*a53 + m156*a33 - m356*a13;
const RT m1456 = m145*a63 - m146*a53 + m156*a43 - m456*a13;
const RT m2345 = m234*a53 - m235*a43 + m245*a33 - m345*a23;
const RT m2346 = m234*a63 - m236*a43 + m246*a33 - m346*a23;
const RT m2356 = m235*a63 - m236*a53 + m256*a33 - m356*a23;
const RT m2456 = m245*a63 - m246*a53 + m256*a43 - m456*a23;
const RT m3456 = m345*a63 - m346*a53 + m356*a43 - m456*a33;
// Now compute the minors of rank 5
const RT m01234 = m0123*a44 - m0124*a34 + m0134*a24 - m0234*a14 + m1234*a04;
const RT m01235 = m0123*a54 - m0125*a34 + m0135*a24 - m0235*a14 + m1235*a04;
const RT m01236 = m0123*a64 - m0126*a34 + m0136*a24 - m0236*a14 + m1236*a04;
const RT m01245 = m0124*a54 - m0125*a44 + m0145*a24 - m0245*a14 + m1245*a04;
const RT m01246 = m0124*a64 - m0126*a44 + m0146*a24 - m0246*a14 + m1246*a04;
const RT m01256 = m0125*a64 - m0126*a54 + m0156*a24 - m0256*a14 + m1256*a04;
const RT m01345 = m0134*a54 - m0135*a44 + m0145*a34 - m0345*a14 + m1345*a04;
const RT m01346 = m0134*a64 - m0136*a44 + m0146*a34 - m0346*a14 + m1346*a04;
const RT m01356 = m0135*a64 - m0136*a54 + m0156*a34 - m0356*a14 + m1356*a04;
const RT m01456 = m0145*a64 - m0146*a54 + m0156*a44 - m0456*a14 + m1456*a04;
const RT m02345 = m0234*a54 - m0235*a44 + m0245*a34 - m0345*a24 + m2345*a04;
const RT m02346 = m0234*a64 - m0236*a44 + m0246*a34 - m0346*a24 + m2346*a04;
const RT m02356 = m0235*a64 - m0236*a54 + m0256*a34 - m0356*a24 + m2356*a04;
const RT m02456 = m0245*a64 - m0246*a54 + m0256*a44 - m0456*a24 + m2456*a04;
const RT m03456 = m0345*a64 - m0346*a54 + m0356*a44 - m0456*a34 + m3456*a04;
const RT m12345 = m1234*a54 - m1235*a44 + m1245*a34 - m1345*a24 + m2345*a14;
const RT m12346 = m1234*a64 - m1236*a44 + m1246*a34 - m1346*a24 + m2346*a14;
const RT m12356 = m1235*a64 - m1236*a54 + m1256*a34 - m1356*a24 + m2356*a14;
const RT m12456 = m1245*a64 - m1246*a54 + m1256*a44 - m1456*a24 + m2456*a14;
const RT m13456 = m1345*a64 - m1346*a54 + m1356*a44 - m1456*a34 + m3456*a14;
const RT m23456 = m2345*a64 - m2346*a54 + m2356*a44 - m2456*a34 + m3456*a24;
// Now compute the minors of rank 6
const RT m012345 = m01234*a55 - m01235*a45 + m01245*a35 - m01345*a25 + m02345*a15 - m12345*a05;
const RT m012346 = m01234*a65 - m01236*a45 + m01246*a35 - m01346*a25 + m02346*a15 - m12346*a05;
const RT m012356 = m01235*a65 - m01236*a55 + m01256*a35 - m01356*a25 + m02356*a15 - m12356*a05;
const RT m012456 = m01245*a65 - m01246*a55 + m01256*a45 - m01456*a25 + m02456*a15 - m12456*a05;
const RT m013456 = m01345*a65 - m01346*a55 + m01356*a45 - m01456*a35 + m03456*a15 - m13456*a05;
const RT m023456 = m02345*a65 - m02346*a55 + m02356*a45 - m02456*a35 + m03456*a25 - m23456*a05;
const RT m123456 = m12345*a65 - m12346*a55 + m12356*a45 - m12456*a35 + m13456*a25 - m23456*a15;
// Now compute the minors of rank 7
const RT m0123456 = m012345 * a66 - m012346 * a56 + m012356 * a46 - m012456 * a36 + m013456 * a26 - m023456 * a16 + m123456 * a06;
return m0123456;
}
} //namespace CGAL } //namespace CGAL
#endif // CGAL_DETERMINANT_H #endif // CGAL_DETERMINANT_H

View File

@ -0,0 +1,121 @@
#include <CGAL/determinant.h>
#include <CGAL/Random.h>
#include <boost/lexical_cast.hpp>
#include <iostream>
using CGAL::determinant;
template <typename RT>
RT det_77_alt(const RT& a00, const RT& a01, const RT& a02, const RT& a03, const RT& a04, const RT& a05, const RT& a06,
const RT& a10, const RT& a11, const RT& a12, const RT& a13, const RT& a14, const RT& a15, const RT& a16,
const RT& a20, const RT& a21, const RT& a22, const RT& a23, const RT& a24, const RT& a25, const RT& a26,
const RT& a30, const RT& a31, const RT& a32, const RT& a33, const RT& a34, const RT& a35, const RT& a36,
const RT& a40, const RT& a41, const RT& a42, const RT& a43, const RT& a44, const RT& a45, const RT& a46,
const RT& a50, const RT& a51, const RT& a52, const RT& a53, const RT& a54, const RT& a55, const RT& a56,
const RT& a60, const RT& a61, const RT& a62, const RT& a63, const RT& a64, const RT& a65, const RT& a66)
{
const RT r1 = a06 * determinant(
a10, a11, a12, a13, a14, a15,
a20, a21, a22, a23, a24, a25,
a30, a31, a32, a33, a34, a35,
a40, a41, a42, a43, a44, a45,
a50, a51, a52, a53, a54, a55,
a60, a61, a62, a63, a64, a65);
const RT r2 = - a16 * determinant(a00, a01, a02, a03, a04, a05,
a20, a21, a22, a23, a24, a25,
a30, a31, a32, a33, a34, a35,
a40, a41, a42, a43, a44, a45,
a50, a51, a52, a53, a54, a55,
a60, a61, a62, a63, a64, a65);
const RT r3 = a26 * determinant(a00, a01, a02, a03, a04, a05,
a10, a11, a12, a13, a14, a15,
a30, a31, a32, a33, a34, a35,
a40, a41, a42, a43, a44, a45,
a50, a51, a52, a53, a54, a55,
a60, a61, a62, a63, a64, a65);
const RT r4 = - a36 * determinant(a00, a01, a02, a03, a04, a05,
a10, a11, a12, a13, a14, a15,
a20, a21, a22, a23, a24, a25,
a40, a41, a42, a43, a44, a45,
a50, a51, a52, a53, a54, a55,
a60, a61, a62, a63, a64, a65);
const RT r5 = a46 * determinant(a00, a01, a02, a03, a04, a05,
a10, a11, a12, a13, a14, a15,
a20, a21, a22, a23, a24, a25,
a30, a31, a32, a33, a34, a35,
a50, a51, a52, a53, a54, a55,
a60, a61, a62, a63, a64, a65);
const RT r6 = - a56 * determinant(a00, a01, a02, a03, a04, a05,
a10, a11, a12, a13, a14, a15,
a20, a21, a22, a23, a24, a25,
a30, a31, a32, a33, a34, a35,
a40, a41, a42, a43, a44, a45,
a60, a61, a62, a63, a64, a65);
const RT r7 = a66 * determinant(a00, a01, a02, a03, a04, a05,
a10, a11, a12, a13, a14, a15,
a20, a21, a22, a23, a24, a25,
a30, a31, a32, a33, a34, a35,
a40, a41, a42, a43, a44, a45,
a50, a51, a52, a53, a54, a55
);
return r1 + r2 + r3 + r4 + r5 + r6 + r7;
}
int main(int, char**)
{
assert(determinant<int>(4, 5, 1, 4, 6, 3, 1,
4, 3, 6, 4, 2, 7, 3,
6, 3, 3, 6, 2, 4, 5,
1, 4, 3, 5, 5, 6 ,1,
1, 3, 2, 7, 9, 6, 1,
7, 6, 5, 4, 6, 2, 2,
2, 3, 5, 7, 4, 3, 3) == 763);
CGAL::Random rnd;
std::cout << "Seed: " << rnd.get_seed() << std::endl;
for(int k=0; k<100; ++k)
{
std::array<std::array<int, 7>, 7> mat;
for(int i=0; i<7; ++i)
for(int j=0; j<7; ++j)
mat[i][j] = rnd.get_int(-18, 18);
const int det_1 = determinant<int>(mat[0][0], mat[0][1], mat[0][2], mat[0][3], mat[0][4], mat[0][5], mat[0][6],
mat[1][0], mat[1][1], mat[1][2], mat[1][3], mat[1][4], mat[1][5], mat[1][6],
mat[2][0], mat[2][1], mat[2][2], mat[2][3], mat[2][4], mat[2][5], mat[2][6],
mat[3][0], mat[3][1], mat[3][2], mat[3][3], mat[3][4], mat[3][5], mat[3][6],
mat[4][0], mat[4][1], mat[4][2], mat[4][3], mat[4][4], mat[4][5], mat[4][6],
mat[0][0], mat[5][1], mat[5][2], mat[5][3], mat[5][4], mat[5][5], mat[5][6],
mat[6][0], mat[6][1], mat[6][2], mat[6][3], mat[6][4], mat[6][5], mat[6][6]);
const int det_2 = det_77_alt<int>(mat[0][0], mat[0][1], mat[0][2], mat[0][3], mat[0][4], mat[0][5], mat[0][6],
mat[1][0], mat[1][1], mat[1][2], mat[1][3], mat[1][4], mat[1][5], mat[1][6],
mat[2][0], mat[2][1], mat[2][2], mat[2][3], mat[2][4], mat[2][5], mat[2][6],
mat[3][0], mat[3][1], mat[3][2], mat[3][3], mat[3][4], mat[3][5], mat[3][6],
mat[4][0], mat[4][1], mat[4][2], mat[4][3], mat[4][4], mat[4][5], mat[4][6],
mat[0][0], mat[5][1], mat[5][2], mat[5][3], mat[5][4], mat[5][5], mat[5][6],
mat[6][0], mat[6][1], mat[6][2], mat[6][3], mat[6][4], mat[6][5], mat[6][6]);
std::cout << "dets: " << det_1 << " " << det_2 << std::endl;
assert(det_1 == det_2);
}
std::cout << "Done!" << std::endl;
return EXIT_SUCCESS;
}

View File

@ -1,761 +0,0 @@
# This is the CMakeCache file.
# For build in directory: c:/CGAL/reference_platforms/x64_Cygwin-Windows10_MSVC2017-Debug-64bits
# It was generated by CMake: C:/dev/CMake/bin/cmake.exe
# You can edit this file to change values found and used by cmake.
# If you do not want to change any of the values, simply exit the editor.
# If you do want to change a value, simply edit, save, and exit the editor.
# The syntax for the file is as follows:
# KEY:TYPE=VALUE
# KEY is the name of a variable in the cache.
# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!.
# VALUE is the current value for the KEY.
########################
# EXTERNAL cache entries
########################
//Build shared libraries
BUILD_SHARED_LIBS:BOOL=ON
//Build the testing tree.
BUILD_TESTING:BOOL=OFF
//Activate the debug messages of the script FindBoost
Boost_DEBUG:BOOL=OFF
//Path to a file.
Boost_INCLUDE_DIR:PATH=C:/3rdPartyLibs/boost/boost_1_67_0
//Value Computed by CMake
CGAL_BINARY_DIR:STATIC=C:/CGAL/reference_platforms/x64_Cygwin-Windows10_MSVC2017-Debug-64bits
//Link with static Boost libraries
CGAL_Boost_USE_STATIC_LIBS:BOOL=OFF
//User-defined flags
CGAL_CXX_FLAGS:STRING= -D_CRT_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS /fp:strict /fp:except- /wd4503 /bigobj
//Dependencies for the target
CGAL_Core_LIB_DEPENDS:STATIC=general;C:/3rdPartyLibs/VC-64/gmp-5.0.1_and_mpfr-3.0.0/lib/libmpfr-4.lib;general;C:/3rdPartyLibs/VC-64/gmp-5.0.1_and_mpfr-3.0.0/lib/libgmp-10.lib;general;CGAL;
//Set this to TRUE if you want to define or modify any of CMAKE_*_FLAGS.
// When this is FALSE, all the CMAKE_*_FLAGS flags are overriden
// with the values used when building the CGAL libs. For CGAL_*_flags
// (used for ADDITIONAL flags) , there is no need to set this to
// TRUE.
CGAL_DONT_OVERRIDE_CMAKE_FLAGS:BOOL=TRUE
//Select to allow to preconfiguration of external libraries
CGAL_ENABLE_PRECONFIG:BOOL=ON
//Enable the header only version of CGAL
CGAL_HEADER_ONLY:BOOL=OFF
//The folder where CGAL user-side scripts will be installed, relative
// to CMAKE_INSTALL_PREFIX
CGAL_INSTALL_BIN_DIR:STRING=bin
//The folder where CGAL CMake modules will be installed, relative
// to CMAKE_INSTALL_PREFIX
CGAL_INSTALL_CMAKE_DIR:STRING=lib/CGAL
//The folder where CGAL documentation and license files will be
// installed, relative to CMAKE_INSTALL_PREFIX
CGAL_INSTALL_DOC_DIR:STRING=C:/Program Files (x86)/CGAL/share/doc/CGAL-4.9
//The folder where CGAL header files will be installed, relative
// to CMAKE_INSTALL_PREFIX
CGAL_INSTALL_INC_DIR:STRING=include
//The folder where CGAL libraries will be installed, relative to
// CMAKE_INSTALL_PREFIX
CGAL_INSTALL_LIB_DIR:STRING=lib
//The folder where manual pages for CGAL scripts will be installed,
// relative to CMAKE_INSTALL_PREFIX
CGAL_INSTALL_MAN_DIR:STRING=C:/Program Files (x86)/CGAL/share/man/man1
//Dependencies for the target
CGAL_ImageIO_LIB_DEPENDS:STATIC=general;C:/3rdPartyLibs/VC-64/gmp-5.0.1_and_mpfr-3.0.0/lib/libmpfr-4.lib;general;C:/3rdPartyLibs/VC-64/gmp-5.0.1_and_mpfr-3.0.0/lib/libgmp-10.lib;general;CGAL;general;C:/3rdPartyLibs/zlib-1.2.11/build_msvc2013/lib/zlib.lib;
//Dependencies for the target
CGAL_LIB_DEPENDS:STATIC=general;C:/3rdPartyLibs/VC-64/gmp-5.0.1_and_mpfr-3.0.0/lib/libmpfr-4.lib;general;C:/3rdPartyLibs/VC-64/gmp-5.0.1_and_mpfr-3.0.0/lib/libgmp-10.lib;
//Dependencies for the target
CGAL_Qt5_LIB_DEPENDS:STATIC=general;C:/3rdPartyLibs/VC-64/gmp-5.0.1_and_mpfr-3.0.0/lib/libmpfr-4.lib;general;C:/3rdPartyLibs/VC-64/gmp-5.0.1_and_mpfr-3.0.0/lib/libgmp-10.lib;general;Qt5::OpenGL;general;Qt5::Svg;general;CGAL;general;glu32;general;opengl32;
//Value Computed by CMake
CGAL_SOURCE_DIR:STATIC=C:/CGAL/CGAL-4.9
//Path to a program.
CMAKE_AR:FILEPATH=CMAKE_AR-NOTFOUND
//Build type: Release or Debug
CMAKE_BUILD_TYPE:STRING=Debug
//Enable/Disable color output during build.
CMAKE_COLOR_MAKEFILE:BOOL=ON
//Semicolon separated list of supported configuration types, only
// supports Debug, Release, MinSizeRel, and RelWithDebInfo, anything
// else will be ignored.
CMAKE_CONFIGURATION_TYPES:STRING=Debug;Release;MinSizeRel;RelWithDebInfo
//User-defined flags
CMAKE_CXX_FLAGS:STRING=/DWIN32 /D_WINDOWS /W3 /GR /EHsc -D_CRT_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS /fp:strict /fp:except- /wd4503 /bigobj /permissive- /std:c++latest
//Flags used by the compiler during debug builds.
CMAKE_CXX_FLAGS_DEBUG:STRING=/D_DEBUG /MDd /Ob0 /Od /RTC1
//Flags used by the compiler during release builds for minimum
// size.
CMAKE_CXX_FLAGS_MINSIZEREL:STRING=/MD /O1 /Ob1 /DNDEBUG
//Flags used by the compiler during release builds.
CMAKE_CXX_FLAGS_RELEASE:STRING=/MD /O2 /Ob2 /DCGAL_NDEBUG
//Flags used by the compiler during release builds with debug info.
CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=/MD /O2 /Ob1 /DNDEBUG
//Libraries linked by default with all C++ applications.
CMAKE_CXX_STANDARD_LIBRARIES:STRING=kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib
//Flags used by the compiler during all build types.
CMAKE_C_FLAGS:STRING=/DWIN32 /D_WINDOWS /W3
//Flags used by the compiler during debug builds.
CMAKE_C_FLAGS_DEBUG:STRING=/D_DEBUG /MDd /Ob0 /Od /RTC1
//Flags used by the compiler during release builds for minimum
// size.
CMAKE_C_FLAGS_MINSIZEREL:STRING=/MD /O1 /Ob1 /DNDEBUG
//Flags used by the compiler during release builds.
CMAKE_C_FLAGS_RELEASE:STRING=/MD /O2 /Ob2 /DCGAL_NDEBUG
//Flags used by the compiler during release builds with debug info.
CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=/MD /O2 /Ob1 /DNDEBUG
//Libraries linked by default with all C applications.
CMAKE_C_STANDARD_LIBRARIES:STRING=kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib
//Flags used by the linker.
CMAKE_EXE_LINKER_FLAGS:STRING=/machine:x64 /INCREMENTAL:NO /DEBUG:NONE
//Flags used by the linker during debug builds.
CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING=/INCREMENTAL:NO /DEBUG:NONE
//Flags used by the linker during release minsize builds.
CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO /DEBUG:NONE
//Flags used by the linker during release builds.
CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING=/INCREMENTAL:NO /DEBUG:NONE
//Flags used by the linker during Release with Debug Info builds.
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=/INCREMENTAL:NO /DEBUG:NONE
//user executables (bin)
CMAKE_INSTALL_BINDIR:PATH=bin
//read-only architecture-independent data (DATAROOTDIR)
CMAKE_INSTALL_DATADIR:PATH=
//read-only architecture-independent data root (share)
CMAKE_INSTALL_DATAROOTDIR:PATH=share
//documentation root (DATAROOTDIR/doc/PROJECT_NAME)
CMAKE_INSTALL_DOCDIR:PATH=
//C header files (include)
CMAKE_INSTALL_INCLUDEDIR:PATH=include
//info documentation (DATAROOTDIR/info)
CMAKE_INSTALL_INFODIR:PATH=
//object code libraries (lib)
CMAKE_INSTALL_LIBDIR:PATH=lib
//program executables (libexec)
CMAKE_INSTALL_LIBEXECDIR:PATH=libexec
//locale-dependent data (DATAROOTDIR/locale)
CMAKE_INSTALL_LOCALEDIR:PATH=
//modifiable single-machine data (var)
CMAKE_INSTALL_LOCALSTATEDIR:PATH=var
//man documentation (DATAROOTDIR/man)
CMAKE_INSTALL_MANDIR:PATH=
//C header files for non-gcc (/usr/include)
CMAKE_INSTALL_OLDINCLUDEDIR:PATH=/usr/include
//Install path prefix, prepended onto install directories.
CMAKE_INSTALL_PREFIX:PATH=C:/Program Files (x86)/CGAL
//Run-time variable data (LOCALSTATEDIR/run)
CMAKE_INSTALL_RUNSTATEDIR:PATH=
//system admin executables (sbin)
CMAKE_INSTALL_SBINDIR:PATH=sbin
//modifiable architecture-independent data (com)
CMAKE_INSTALL_SHAREDSTATEDIR:PATH=com
//read-only single-machine data (etc)
CMAKE_INSTALL_SYSCONFDIR:PATH=etc
//Path to a program.
CMAKE_LINKER:FILEPATH=C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.11.25503/bin/HostX86/x64/link.exe
//Flags used by the linker during the creation of modules.
CMAKE_MODULE_LINKER_FLAGS:STRING=/machine:x64 /DEBUG:NONE /INCREMENTAL:NO
//Flags used by the linker during debug builds.
CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING=
//Flags used by the linker during release minsize builds.
CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING=
//Flags used by the linker during release builds.
CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING=
//Flags used by the linker during Release with Debug Info builds.
CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
//Value Computed by CMake
CMAKE_PROJECT_NAME:STATIC=CGAL
//RC compiler
CMAKE_RC_COMPILER:FILEPATH=rc
//Flags for Windows Resource Compiler.
CMAKE_RC_FLAGS:STRING=/DWIN32
//Flags for Windows Resource Compiler during debug builds.
CMAKE_RC_FLAGS_DEBUG:STRING=/D_DEBUG
//Flags for Windows Resource Compiler during release builds for
// minimum size.
CMAKE_RC_FLAGS_MINSIZEREL:STRING=
//Flags for Windows Resource Compiler during release builds.
CMAKE_RC_FLAGS_RELEASE:STRING=
//Flags for Windows Resource Compiler during release builds with
// debug info.
CMAKE_RC_FLAGS_RELWITHDEBINFO:STRING=
//Flags used by the linker during the creation of dll's.
CMAKE_SHARED_LINKER_FLAGS:STRING=/machine:x64 /debug:NONE /INCREMENTAL:NO
//Flags used by the linker during debug builds.
CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING=
//Flags used by the linker during release minsize builds.
CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING=
//Flags used by the linker during release builds.
CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING=
//Flags used by the linker during Release with Debug Info builds.
CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING=
//If set, runtime paths are not added when installing shared libraries,
// but are added when building.
CMAKE_SKIP_INSTALL_RPATH:BOOL=OFF
//If set, runtime paths are not added when using shared libraries.
CMAKE_SKIP_RPATH:BOOL=OFF
//Flags used by the linker during the creation of static libraries.
CMAKE_STATIC_LINKER_FLAGS:STRING=/machine:x64 /debug:NONE /INCREMENTAL:NO
//Flags used by the linker during debug builds.
CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING=
//Flags used by the linker during release minsize builds.
CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING=
//Flags used by the linker during release builds.
CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING=
//Flags used by the linker during Release with Debug Info builds.
CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING=
//If this value is on, makefiles will be generated without the
// .SILENT directive, and all commands will be echoed to the console
// during the make. This is useful for debugging only. With Visual
// Studio IDE projects all commands are done without /nologo.
CMAKE_VERBOSE_MAKEFILE:BOOL=OFF
//The directory containing the ESBTL header files WITHOUT the ESBTL
// prefix
ESBTL_INCLUDE_DIR:PATH=C:/3rdPartyLibs/esbtl/include
//The directory containing the GMP header files
GMP_INCLUDE_DIR:PATH=C:/3rdPartyLibs/VC-64/gmp-5.0.1_and_mpfr-3.0.0/include
//Path to the GMP library
GMP_LIBRARIES:FILEPATH=C:/3rdPartyLibs/VC-64/gmp-5.0.1_and_mpfr-3.0.0/lib/libgmp-10.lib
GMP_LIBRARIES_DIR:FILEPATH=C:/3rdPartyLibs/VC-64/gmp-5.0.1_and_mpfr-3.0.0/lib
//The directory containing the MPFR header files
MPFR_INCLUDE_DIR:PATH=C:/3rdPartyLibs/VC-64/gmp-5.0.1_and_mpfr-3.0.0/include
//Path to the MPFR library
MPFR_LIBRARIES:FILEPATH=C:/3rdPartyLibs/VC-64/gmp-5.0.1_and_mpfr-3.0.0/lib/libmpfr-4.lib
MPFR_LIBRARIES_DIR:FILEPATH=C:/3rdPartyLibs/VC-64/gmp-5.0.1_and_mpfr-3.0.0/lib
//OpenGL library for win32
OPENGL_gl_LIBRARY:STRING=opengl32
//GLU library for win32
OPENGL_glu_LIBRARY:STRING=glu32
//The directory containing a CMake configuration file for Qt5Core.
Qt5Core_DIR:PATH=C:/3rdPartyLibs/Qt/5.9.1/msvc2017_64/lib/cmake/Qt5Core
//The directory containing a CMake configuration file for Qt5Gui.
Qt5Gui_DIR:PATH=C:/3rdPartyLibs/Qt/5.9.1/msvc2017_64/lib/cmake/Qt5Gui
//The directory containing a CMake configuration file for Qt5OpenGL.
Qt5OpenGL_DIR:PATH=C:/3rdPartyLibs/Qt/5.9.1/msvc2017_64/lib/cmake/Qt5OpenGL
//The directory containing a CMake configuration file for Qt5Svg.
Qt5Svg_DIR:PATH=C:/3rdPartyLibs/Qt/5.9.1/msvc2017_64/lib/cmake/Qt5Svg
//The directory containing a CMake configuration file for Qt5Widgets.
Qt5Widgets_DIR:PATH=C:/3rdPartyLibs/Qt/5.9.1/msvc2017_64/lib/cmake/Qt5Widgets
//The directory containing a CMake configuration file for Qt5.
Qt5_DIR:PATH=C:/3rdPartyLibs/Qt/5.9.1/msvc2017_64/lib/cmake/Qt5
//Select external library BLAS
WITH_BLAS:BOOL=OFF
//Enable CGAL component CGAL_Core
WITH_CGAL_Core:BOOL=ON
//Enable CGAL component CGAL_ImageIO
WITH_CGAL_ImageIO:BOOL=ON
//Enable CGAL component CGAL_Qt5
WITH_CGAL_Qt5:BOOL=ON
//Select external library Coin3D
WITH_Coin3D:BOOL=OFF
//Select external library ESBTL
WITH_ESBTL:BOOL=ON
//Select external library Eigen3
WITH_Eigen3:BOOL=OFF
//Select external library GMP
WITH_GMP:BOOL=ON
//Select external library IPE
WITH_IPE:BOOL=OFF
//Select external library LAPACK
WITH_LAPACK:BOOL=OFF
//Select external library LEDA
WITH_LEDA:BOOL=OFF
//Select external library MPFI
WITH_MPFI:BOOL=OFF
//Select external library MPFR
WITH_MPFR:BOOL=ON
//Select external library NTL
WITH_NTL:BOOL=OFF
//Select external library OpenGL
WITH_OpenGL:BOOL=OFF
//Select external library OpenNL
WITH_OpenNL:BOOL=OFF
//Select external library QGLViewer
WITH_QGLViewer:BOOL=OFF
//Select external library RS
WITH_RS:BOOL=OFF
//Select external library RS3
WITH_RS3:BOOL=OFF
//Select external library ZLIB
WITH_ZLIB:BOOL=ON
//Select demos
WITH_demos:BOOL=OFF
//Select examples
WITH_examples:BOOL=OFF
//Path to a file.
ZLIB_INCLUDE_DIR:PATH=C:/3rdPartyLibs/zlib-1.2.11/build_msvc2013/include
//Path to a library.
ZLIB_LIBRARY_DEBUG:FILEPATH=C:/3rdPartyLibs/zlib-1.2.11/build_msvc2013/lib/zlib.lib
//Path to a library.
ZLIB_LIBRARY_RELEASE:FILEPATH=C:/3rdPartyLibs/zlib-1.2.11/build_msvc2013/lib/zlib.lib
########################
# INTERNAL cache entries
########################
//ADVANCED property for variable: Boost_DEBUG
Boost_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: Boost_INCLUDE_DIR
Boost_INCLUDE_DIR-ADVANCED:INTERNAL=1
//Avoid future search of boost-cmake
Boost_NO_BOOST_CMAKE:INTERNAL=TRUE
CGAL_3RD_PARTY_DEFINITIONS:INTERNAL=-DBOOST_ALL_DYN_LINK
CGAL_3RD_PARTY_INCLUDE_DIRS:INTERNAL=C:/3rdPartyLibs/boost/boost_1_67_0
CGAL_3RD_PARTY_LIBRARIES:INTERNAL=
CGAL_3RD_PARTY_LIBRARIES_DIRS:INTERNAL=
CGAL_3RD_PARTY_PRECONFIGURED:INTERNAL=
//ADVANCED property for variable: CGAL_Boost_USE_STATIC_LIBS
CGAL_Boost_USE_STATIC_LIBS-ADVANCED:INTERNAL=1
//Test CGAL_CFG_DENORMALS_COMPILE_BUG
CGAL_CFG_DENORMALS_COMPILE_BUG:INTERNAL=1
//Result of TRY_COMPILE
CGAL_CFG_DENORMALS_COMPILE_BUG_COMPILED:INTERNAL=TRUE
//Test CGAL_CFG_FPU_ROUNDING_MODE_UNWINDING_VC_BUG
CGAL_CFG_FPU_ROUNDING_MODE_UNWINDING_VC_BUG:INTERNAL=
//Result of TRY_COMPILE
CGAL_CFG_FPU_ROUNDING_MODE_UNWINDING_VC_BUG_COMPILED:INTERNAL=TRUE
//Test CGAL_CFG_IEEE_754_BUG
CGAL_CFG_IEEE_754_BUG:INTERNAL=1
//Result of TRY_COMPILE
CGAL_CFG_IEEE_754_BUG_COMPILED:INTERNAL=TRUE
//Test CGAL_CFG_ISTREAM_INT_BUG
CGAL_CFG_ISTREAM_INT_BUG:INTERNAL=1
//Result of TRY_COMPILE
CGAL_CFG_ISTREAM_INT_BUG_COMPILED:INTERNAL=TRUE
//Test CGAL_CFG_MATCHING_BUG_5
CGAL_CFG_MATCHING_BUG_5:INTERNAL=1
//Result of TRY_COMPILE
CGAL_CFG_MATCHING_BUG_5_COMPILED:INTERNAL=TRUE
//Test CGAL_CFG_MATCHING_BUG_6
CGAL_CFG_MATCHING_BUG_6:INTERNAL=
//Result of TRY_COMPILE
CGAL_CFG_MATCHING_BUG_6_COMPILED:INTERNAL=FALSE
//Test CGAL_CFG_MATCHING_BUG_7
CGAL_CFG_MATCHING_BUG_7:INTERNAL=1
//Result of TRY_COMPILE
CGAL_CFG_MATCHING_BUG_7_COMPILED:INTERNAL=TRUE
//Test CGAL_CFG_MATCHING_BUG_8
CGAL_CFG_MATCHING_BUG_8:INTERNAL=1
//Result of TRY_COMPILE
CGAL_CFG_MATCHING_BUG_8_COMPILED:INTERNAL=TRUE
//Test CGAL_CFG_NESTED_CLASS_FRIEND_DECLARATION_BUG
CGAL_CFG_NESTED_CLASS_FRIEND_DECLARATION_BUG:INTERNAL=1
//Result of TRY_COMPILE
CGAL_CFG_NESTED_CLASS_FRIEND_DECLARATION_BUG_COMPILED:INTERNAL=TRUE
//Test CGAL_CFG_NO_LIMITS
CGAL_CFG_NO_LIMITS:INTERNAL=1
//Result of TRY_COMPILE
CGAL_CFG_NO_LIMITS_COMPILED:INTERNAL=TRUE
//Test CGAL_CFG_NO_NEXTAFTER
CGAL_CFG_NO_NEXTAFTER:INTERNAL=1
//Result of TRY_COMPILE
CGAL_CFG_NO_NEXTAFTER_COMPILED:INTERNAL=TRUE
//Test CGAL_CFG_NO_STL
CGAL_CFG_NO_STL:INTERNAL=1
//Result of TRY_COMPILE
CGAL_CFG_NO_STL_COMPILED:INTERNAL=TRUE
//Test CGAL_CFG_NUMERIC_LIMITS_BUG
CGAL_CFG_NUMERIC_LIMITS_BUG:INTERNAL=1
//Result of TRY_COMPILE
CGAL_CFG_NUMERIC_LIMITS_BUG_COMPILED:INTERNAL=TRUE
//Test CGAL_CFG_OUTOFLINE_MEMBER_DEFINITION_BUG
CGAL_CFG_OUTOFLINE_MEMBER_DEFINITION_BUG:INTERNAL=1
//Result of TRY_COMPILE
CGAL_CFG_OUTOFLINE_MEMBER_DEFINITION_BUG_COMPILED:INTERNAL=TRUE
//Test CGAL_CFG_TEMPLATE_IN_DEFAULT_PARAMETER_BUG
CGAL_CFG_TEMPLATE_IN_DEFAULT_PARAMETER_BUG:INTERNAL=1
//Result of TRY_COMPILE
CGAL_CFG_TEMPLATE_IN_DEFAULT_PARAMETER_BUG_COMPILED:INTERNAL=TRUE
//Test CGAL_CFG_TYPENAME_BEFORE_DEFAULT_ARGUMENT_BUG
CGAL_CFG_TYPENAME_BEFORE_DEFAULT_ARGUMENT_BUG:INTERNAL=1
//Result of TRY_COMPILE
CGAL_CFG_TYPENAME_BEFORE_DEFAULT_ARGUMENT_BUG_COMPILED:INTERNAL=TRUE
//Test CGAL_CFG_USING_BASE_MEMBER_BUG_2
CGAL_CFG_USING_BASE_MEMBER_BUG_2:INTERNAL=1
//Result of TRY_COMPILE
CGAL_CFG_USING_BASE_MEMBER_BUG_2_COMPILED:INTERNAL=TRUE
CGAL_CONFIGURED_LIBRARIES:INTERNAL=CGAL_Core;CGAL_ImageIO;CGAL_Qt5
//Directory containing the Core package
CGAL_CORE_PACKAGE_DIR:INTERNAL=C:/CGAL/CGAL-4.9
CGAL_Core_3RD_PARTY_DEFINITIONS:INTERNAL=
CGAL_Core_3RD_PARTY_INCLUDE_DIRS:INTERNAL=
CGAL_Core_3RD_PARTY_LIBRARIES:INTERNAL=
CGAL_Core_3RD_PARTY_LIBRARIES_DIRS:INTERNAL=
CGAL_Core_LIBRARY:INTERNAL=
//Variable hidden from user
CGAL_ESSENTIAL_3RD_PARTY_LIBRARIES:INTERNAL=GMP;MPFR
CGAL_EXECUTABLE_TARGETS:INTERNAL=
//Variable hidden from user
CGAL_EXT_LIB_BLAS_PREFIX:INTERNAL=BLAS
//Variable hidden from user
CGAL_EXT_LIB_Coin3D_PREFIX:INTERNAL=COIN3D
//Variable hidden from user
CGAL_EXT_LIB_ESBTL_PREFIX:INTERNAL=ESBTL
//Variable hidden from user
CGAL_EXT_LIB_Eigen3_PREFIX:INTERNAL=EIGEN3
//Variable hidden from user
CGAL_EXT_LIB_GMP_PREFIX:INTERNAL=GMP
//Variable hidden from user
CGAL_EXT_LIB_IPE_PREFIX:INTERNAL=IPE
//Variable hidden from user
CGAL_EXT_LIB_LAPACK_PREFIX:INTERNAL=LAPACK
//Variable hidden from user
CGAL_EXT_LIB_LEDA_PREFIX:INTERNAL=LEDA
//Variable hidden from user
CGAL_EXT_LIB_MPFI_PREFIX:INTERNAL=MPFI
//Variable hidden from user
CGAL_EXT_LIB_MPFR_PREFIX:INTERNAL=MPFR
//Variable hidden from user
CGAL_EXT_LIB_NTL_PREFIX:INTERNAL=NTL
//Variable hidden from user
CGAL_EXT_LIB_OpenGL_PREFIX:INTERNAL=OpenGL
//Variable hidden from user
CGAL_EXT_LIB_OpenNL_PREFIX:INTERNAL=OpenNL
//Variable hidden from user
CGAL_EXT_LIB_QGLViewer_PREFIX:INTERNAL=QGLVIEWER
//Variable hidden from user
CGAL_EXT_LIB_RS3_PREFIX:INTERNAL=RS3
//Variable hidden from user
CGAL_EXT_LIB_RS_PREFIX:INTERNAL=RS
//Variable hidden from user
CGAL_EXT_LIB_ZLIB_PREFIX:INTERNAL=ZLIB
//Directory containing the GraphicsView package
CGAL_GRAPHICSVIEW_PACKAGE_DIR:INTERNAL=C:/CGAL/CGAL-4.9
//Directory containing the Installation package
CGAL_INSTALLATION_PACKAGE_DIR:INTERNAL=C:/CGAL/CGAL-4.9
CGAL_ImageIO_3RD_PARTY_DEFINITIONS:INTERNAL=-DCGAL_USE_ZLIB
CGAL_ImageIO_3RD_PARTY_INCLUDE_DIRS:INTERNAL=C:/3rdPartyLibs/zlib-1.2.11/build_msvc2013/include
CGAL_ImageIO_3RD_PARTY_LIBRARIES:INTERNAL=C:/3rdPartyLibs/zlib-1.2.11/build_msvc2013/lib/zlib.lib
CGAL_ImageIO_3RD_PARTY_LIBRARIES_DIRS:INTERNAL=
CGAL_ImageIO_LIBRARY:INTERNAL=
CGAL_ImageIO_USE_ZLIB:INTERNAL=ON
//Directory containing the Maintenance package
CGAL_MAINTENANCE_PACKAGE_DIR:INTERNAL=C:/CGAL/CGAL-4.9
CGAL_Qt5_3RD_PARTY_DEFINITIONS:INTERNAL=
CGAL_Qt5_3RD_PARTY_INCLUDE_DIRS:INTERNAL=
CGAL_Qt5_3RD_PARTY_LIBRARIES:INTERNAL=glu32;opengl32
CGAL_Qt5_3RD_PARTY_LIBRARIES_DIRS:INTERNAL=
CGAL_Qt5_LIBRARY:INTERNAL=
//Variable hidden from user
CGAL_SUPPORTING_3RD_PARTY_LIBRARIES:INTERNAL=GMP;MPFR;ZLIB;OpenGL;LEDA;MPFI;RS;RS3;OpenNL;Eigen3;BLAS;LAPACK;QGLViewer;ESBTL;Coin3D;NTL;IPE
//This is the cygwin platform.
CGAL_WIN32_CMAKE_ON_CYGWIN:INTERNAL=TRUE
//This is the directory where this CMakeCache.txt was created
CMAKE_CACHEFILE_DIR:INTERNAL=c:/CGAL/reference_platforms/x64_Cygwin-Windows10_MSVC2017-Debug-64bits
//Major version of cmake used to create the current loaded cache
CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3
//Minor version of cmake used to create the current loaded cache
CMAKE_CACHE_MINOR_VERSION:INTERNAL=9
//Patch version of cmake used to create the current loaded cache
CMAKE_CACHE_PATCH_VERSION:INTERNAL=3
//Path to CMake executable.
CMAKE_COMMAND:INTERNAL=C:/dev/CMake/bin/cmake.exe
//Path to cpack program executable.
CMAKE_CPACK_COMMAND:INTERNAL=C:/dev/CMake/bin/cpack.exe
//Path to ctest program executable.
CMAKE_CTEST_COMMAND:INTERNAL=C:/dev/CMake/bin/ctest.exe
//ADVANCED property for variable: CMAKE_CXX_FLAGS
CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_CXX_FLAGS_DEBUG
CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_CXX_FLAGS_MINSIZEREL
CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO
CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_CXX_STANDARD_LIBRARIES
CMAKE_CXX_STANDARD_LIBRARIES-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_FLAGS
CMAKE_C_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_FLAGS_DEBUG
CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_FLAGS_MINSIZEREL
CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_FLAGS_RELEASE
CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_FLAGS_RELWITHDEBINFO
CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_STANDARD_LIBRARIES
CMAKE_C_STANDARD_LIBRARIES-ADVANCED:INTERNAL=1
//Executable file format
CMAKE_EXECUTABLE_FORMAT:INTERNAL=Unknown
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS
CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG
CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL
CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE
CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//Name of external makefile project generator.
CMAKE_EXTRA_GENERATOR:INTERNAL=
//Name of generator.
CMAKE_GENERATOR:INTERNAL=Visual Studio 15 2017 Win64
//Name of generator platform.
CMAKE_GENERATOR_PLATFORM:INTERNAL=
//Name of generator toolset.
CMAKE_GENERATOR_TOOLSET:INTERNAL=
//Source directory with the top level CMakeLists.txt file for this
// project
CMAKE_HOME_DIRECTORY:INTERNAL=C:/CGAL/CGAL-4.9
//ADVANCED property for variable: CMAKE_INSTALL_BINDIR
CMAKE_INSTALL_BINDIR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_INSTALL_DATADIR
CMAKE_INSTALL_DATADIR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_INSTALL_DATAROOTDIR
CMAKE_INSTALL_DATAROOTDIR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_INSTALL_DOCDIR
CMAKE_INSTALL_DOCDIR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_INSTALL_INCLUDEDIR
CMAKE_INSTALL_INCLUDEDIR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_INSTALL_INFODIR
CMAKE_INSTALL_INFODIR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_INSTALL_LIBDIR
CMAKE_INSTALL_LIBDIR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_INSTALL_LIBEXECDIR
CMAKE_INSTALL_LIBEXECDIR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_INSTALL_LOCALEDIR
CMAKE_INSTALL_LOCALEDIR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_INSTALL_LOCALSTATEDIR
CMAKE_INSTALL_LOCALSTATEDIR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_INSTALL_MANDIR
CMAKE_INSTALL_MANDIR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_INSTALL_OLDINCLUDEDIR
CMAKE_INSTALL_OLDINCLUDEDIR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_INSTALL_RUNSTATEDIR
CMAKE_INSTALL_RUNSTATEDIR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_INSTALL_SBINDIR
CMAKE_INSTALL_SBINDIR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_INSTALL_SHAREDSTATEDIR
CMAKE_INSTALL_SHAREDSTATEDIR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_INSTALL_SYSCONFDIR
CMAKE_INSTALL_SYSCONFDIR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_LINKER
CMAKE_LINKER-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS
CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG
CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL
CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE
CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO
CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//number of local generators
CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=6
//Platform information initialized
CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1
//ADVANCED property for variable: CMAKE_RC_COMPILER
CMAKE_RC_COMPILER-ADVANCED:INTERNAL=1
CMAKE_RC_COMPILER_WORKS:INTERNAL=1
//ADVANCED property for variable: CMAKE_RC_FLAGS
CMAKE_RC_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_RC_FLAGS_DEBUG
CMAKE_RC_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_RC_FLAGS_MINSIZEREL
CMAKE_RC_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_RC_FLAGS_RELEASE
CMAKE_RC_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_RC_FLAGS_RELWITHDEBINFO
CMAKE_RC_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//Path to CMake installation.
CMAKE_ROOT:INTERNAL=C:/dev/CMake/share/cmake-3.9
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS
CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG
CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL
CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE
CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO
CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH
CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SKIP_RPATH
CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS
CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG
CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL
CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE
CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO
CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//Variable hidden from user
CMAKE_UNAME:INTERNAL=C:/cygwin/bin/uname.exe
//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE
CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1
//Details about finding GMP
FIND_PACKAGE_MESSAGE_DETAILS_GMP:INTERNAL=[C:/3rdPartyLibs/VC-64/gmp-5.0.1_and_mpfr-3.0.0/lib/libgmp-10.lib][C:/3rdPartyLibs/VC-64/gmp-5.0.1_and_mpfr-3.0.0/include][v()]
//Details about finding MPFR
FIND_PACKAGE_MESSAGE_DETAILS_MPFR:INTERNAL=[C:/3rdPartyLibs/VC-64/gmp-5.0.1_and_mpfr-3.0.0/lib/libmpfr-4.lib][C:/3rdPartyLibs/VC-64/gmp-5.0.1_and_mpfr-3.0.0/include][v()]
//Details about finding ZLIB
FIND_PACKAGE_MESSAGE_DETAILS_ZLIB:INTERNAL=[C:/3rdPartyLibs/zlib-1.2.11/build_msvc2013/lib/zlib.lib][C:/3rdPartyLibs/zlib-1.2.11/build_msvc2013/include][v1.2.11()]
//Result of TRY_COMPILE
GMP_COMPILE_RES:INTERNAL=TRUE
GMP_IN_CGAL_AUXILIARY:INTERNAL=TRUE
//Result of TRY_RUN
GMP_RUN_RES:INTERNAL=0
//Generator uses intermediate configuration directory
HAS_CFG_INTDIR:INTERNAL=TRUE
//Result of TRY_COMPILE
MPFR_COMPILE_RES:INTERNAL=TRUE
MPFR_IN_CGAL_AUXILIARY:INTERNAL=TRUE
//Result of TRY_RUN
MPFR_RUN_RES:INTERNAL=0
//ADVANCED property for variable: OPENGL_gl_LIBRARY
OPENGL_gl_LIBRARY-ADVANCED:INTERNAL=1
//ADVANCED property for variable: OPENGL_glu_LIBRARY
OPENGL_glu_LIBRARY-ADVANCED:INTERNAL=1
//Result of TRY_COMPILE
ZLIB_COMPILE_RES:INTERNAL=TRUE
//ADVANCED property for variable: ZLIB_INCLUDE_DIR
ZLIB_INCLUDE_DIR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: ZLIB_LIBRARY_DEBUG
ZLIB_LIBRARY_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: ZLIB_LIBRARY_RELEASE
ZLIB_LIBRARY_RELEASE-ADVANCED:INTERNAL=1
//Result of TRY_RUN
ZLIB_RUN_RES:INTERNAL=0
//Last used Boost_ADDITIONAL_VERSIONS value.
_Boost_ADDITIONAL_VERSIONS_LAST:INTERNAL=1.69.1;1.69.0;1.69;1.68.1;1.68.0;1.68;1.67.1;1.67.0;1.67;1.66.1;1.66.0;1.66;1.65.1;1.65.0;1.65;1.64.1;1.64.0;1.64;1.63.1;1.63.0;1.63;1.62.1;1.62.0;1.62;1.61.1;1.61.0;1.61;1.60.1;1.60.0;1.60;1.59.1;1.59.0;1.59;1.58.1;1.58.0;1.58;1.57.1;1.57.0;1.57;1.56.1;1.56.0;1.56;1.55.1;1.55.0;1.55;1.54.1;1.54.0;1.54;1.53.1;1.53.0;1.53;1.52.1;1.52.0;1.52;1.51.1;1.51.0;1.51;1.50.1;1.50.0;1.50;1.49.1;1.49.0;1.49;1.48.1;1.48.0;1.48;1.47.1;1.47.0;1.47;1.46.1;1.46.0;1.46;1.45.1;1.45.0;1.45;1.44.1;1.44.0;1.44;1.43.1;1.43.0;1.43;1.42.1;1.42.0;1.42;1.41.1;1.41.0;1.41;1.40.1;1.40.0;1.40;1.39.1;1.39.0;1.39;1.38.1;1.38.0;1.38;1.37.1;1.37.0;1.37
//Components requested for this build tree.
_Boost_COMPONENTS_SEARCHED:INTERNAL=
//Last used Boost_INCLUDE_DIR value.
_Boost_INCLUDE_DIR_LAST:INTERNAL=C:/3rdPartyLibs/boost/boost_1_67_0
//Last used Boost_NAMESPACE value.
_Boost_NAMESPACE_LAST:INTERNAL=boost
//Last used Boost_USE_MULTITHREADED value.
_Boost_USE_MULTITHREADED_LAST:INTERNAL=TRUE
//Last used Boost_USE_STATIC_LIBS value.
_Boost_USE_STATIC_LIBS_LAST:INTERNAL=OFF
//CMAKE_INSTALL_PREFIX during last run
_GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX:INTERNAL=C:/Program Files (x86)/CGAL

View File

@ -0,0 +1,27 @@
#SET( Ceres_DIR "C:\\3rdPartyLibs\\ceres-solver\\install-dir\\CMake" CACHE STRING "")
SET(CMAKE_BUILD_TYPE "Debug" CACHE STRING "")
SET(CMAKE_CXX_FLAGS "/DWIN32 /D_WINDOWS /W3 /GR /EHsc -D_CRT_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS -D_SILENCE_CXX17_ADAPTOR_TYPEDEFS_DEPRECATION_WARNING /fp:strict /fp:except- /wd4503 /bigobj /permissive- /std:c++17" CACHE STRING "")
SET(CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /MDd /Ob0 /Od /RTC1" CACHE STRING "")
SET(CMAKE_CXX_FLAGS_RELEASE "/MD /O2 /Ob2 /DCGAL_NDEBUG" CACHE STRING "")
SET(TBBROOT "C:/3rdPartyLibs/tbb2018_20170919oss" CACHE STRING "")
SET(WITH_GMP ON CACHE BOOL "")
SET(WITH_GMPXX OFF CACHE BOOL "")
SET(WITH_MPFR ON CACHE BOOL "")
SET(WITH_NTL OFF CACHE BOOL "")
SET(WITH_demos ON CACHE BOOL "")
SET(CGAL_HEADER_ONLY ON CACHE BOOL "")
SET(Boost_DIR "C:\\3rdPartyLibs\\boost_master\\install_dir\\lib\\cmake\\Boost-1.71.0" CACHE PATH "")
SET(CGAL_Boost_USE_STATIC_LIBS ON CACHE BOOL "")

View File

@ -3,9 +3,11 @@ export VC_VERSION="14.1"
export VC_VERSION_YEAR="2017" export VC_VERSION_YEAR="2017"
export ARCH="64" export ARCH="64"
export QT_VERSION="5.9.1" export QT_VERSION="5.9.1"
BOOST_VERSION="1.71"
export PLATFORM_REFERENCE="/cygdrive/c/CGAL/reference_platforms" export PLATFORM_REFERENCE="/cygdrive/c/CGAL/reference_platforms"
export BOOST_VERSION=1_67_0
export TBB_ARCH="intel64" export TBB_ARCH="intel64"
export EIGEN3_DIR="C:/3rdPartyLibs/eigen-master" export EIGEN3_DIR="C:/3rdPartyLibs/eigen-master"
export INIT_FILE="C:\\CGAL\\reference_platforms\\x64_Cygwin-Windows10_MSVC2017-Debug-64bits\\init.cmake"
export OPENMESH_DIR="C:\3rdPartyLibs\OpenMesh_7_1" export OPENMESH_DIR="C:\3rdPartyLibs\OpenMesh_7_1"
source "${PLATFORM_REFERENCE}/setup_common" source "${PLATFORM_REFERENCE}/setup_common"
export PATH="/cygdrive/c/3rdPartyLibs/boost_master/install_dir/lib:${PATH}"

View File

@ -1 +0,0 @@
0

View File

@ -1 +0,0 @@
5

View File

@ -1 +0,0 @@
1

View File

@ -1 +0,0 @@
CGAL-5.1-dev

View File

@ -17,6 +17,7 @@
#include <CGAL/Constrained_Delaunay_triangulation_face_base_2.h> #include <CGAL/Constrained_Delaunay_triangulation_face_base_2.h>
#include <CGAL/Has_timestamp.h>
namespace CGAL { namespace CGAL {
@ -67,6 +68,14 @@ public:
/** compatibility with CGAL-3.2 */ /** compatibility with CGAL-3.2 */
inline inline
void set_marked(const bool b) { in_domain=b; } void set_marked(const bool b) { in_domain=b; }
typedef Tag_true Has_timestamp;
std::size_t time_stamp() const { return time_stamp_; }
void set_time_stamp(const std::size_t& ts) { time_stamp_ = ts; }
std::size_t time_stamp_;
}; };
} // namespace CGAL } // namespace CGAL

View File

@ -0,0 +1,90 @@
//#define CGAL_MESH_2_DEBUG_BAD_FACES
//#define CGAL_MESH_2_DEBUG_CLUSTERS
#include <CGAL/Constrained_Delaunay_triangulation_2.h>
#include <CGAL/Delaunay_mesh_size_criteria_2.h>
#include <CGAL/Delaunay_mesh_face_base_2.h>
#include <CGAL/Delaunay_mesher_2.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <fstream>
#include <sstream>
#include <iostream>
#include <string>
using K = CGAL::Exact_predicates_inexact_constructions_kernel;
using Vb = CGAL::Triangulation_vertex_base_2<K>;
using Fb = CGAL::Delaunay_mesh_face_base_2<K>;
using Tds = CGAL::Triangulation_data_structure_2<Vb, Fb>;
using CDT = CGAL::Constrained_Delaunay_triangulation_2<K, Tds, CGAL::Exact_predicates_tag>;
using Criteria = CGAL::Delaunay_mesh_size_criteria_2<CDT>;
using Mesher = CGAL::Delaunay_mesher_2<CDT, Criteria>;
using Vertex_handle = CDT::Vertex_handle;
using Point = CDT::Point;
int main(int, char**)
{
auto triangulate = [](int index)
{
CDT cdt;
Vertex_handle va = cdt.insert(Point(-0.74397572, -0.54545455));
Vertex_handle vb = cdt.insert(Point(-0.13526831, -1));
Vertex_handle vc = cdt.insert(Point(0.067634156, -1));
Vertex_handle vd = cdt.insert(Point(0.33817078, -0.54545455));
Vertex_handle ve = cdt.insert(Point(0.74397572, 0.27272727));
Vertex_handle vf = cdt.insert(Point(0.74397572, 0.54545455));
Vertex_handle vg = cdt.insert(Point(0.067634156, 1));
Vertex_handle vh = cdt.insert(Point(-0.13526831, 1));
Vertex_handle vi = cdt.insert(Point(-0.74397572, -0.18181818));
cdt.insert_constraint(va, vb);
cdt.insert_constraint(vb, vc);
cdt.insert_constraint(vc, vd);
cdt.insert_constraint(vd, ve);
cdt.insert_constraint(ve, vf);
cdt.insert_constraint(vf, vg);
cdt.insert_constraint(vg, vh);
cdt.insert_constraint(vh, vi);
cdt.insert_constraint(vi, va);
const std::vector<Point> points{
Point(0.65605132, 0.43821259),
Point(0.23073753, -0.4476739),
Point(-0.037496007, -0.93636364),
Point(-0.00095596601, 0.88181818),
Point(-0.62452925, -0.30720903),
Point(-0.69663181, -0.45045525),
};
cdt.insert(points.cbegin(), points.cend());
std::cout << "Meshing: " << index << std::endl;
std::cout << "Number of vertices before: " << cdt.number_of_vertices() << std::endl;
Mesher mesher(cdt);
mesher.set_criteria(Criteria(0.125, 0.05*std::sqrt(2)));
mesher.refine_mesh();
std::cout << "Number of vertices after: " << cdt.number_of_vertices() << std::endl;
std::stringstream ss;
ss << cdt;
return ss.str();
};
const std::string ref_cdts = triangulate(0);
for (int i = 1; i < 20; ++i)
{
const std::string cdts = triangulate(i);
if (ref_cdts != cdts)
return 1;
}
return 0;
}

View File

@ -458,7 +458,7 @@ public:
void set_neighbor(int i, Cell_handle n) void set_neighbor(int i, Cell_handle n)
{ {
CGAL_triangulation_precondition( i >= 0 && i <= 3); CGAL_triangulation_precondition( i >= 0 && i <= 3);
CGAL_triangulation_precondition( this != &*n ); CGAL_triangulation_precondition( this != n.operator->() );
N[i] = n; N[i] = n;
} }
@ -471,10 +471,10 @@ public:
void set_neighbors(Cell_handle n0, Cell_handle n1, void set_neighbors(Cell_handle n0, Cell_handle n1,
Cell_handle n2, Cell_handle n3) Cell_handle n2, Cell_handle n3)
{ {
CGAL_triangulation_precondition( this != &*n0 ); CGAL_triangulation_precondition( this != n0.operator->() );
CGAL_triangulation_precondition( this != &*n1 ); CGAL_triangulation_precondition( this != n1.operator->() );
CGAL_triangulation_precondition( this != &*n2 ); CGAL_triangulation_precondition( this != n2.operator->() );
CGAL_triangulation_precondition( this != &*n3 ); CGAL_triangulation_precondition( this != n3.operator->() );
N[0] = n0; N[0] = n0;
N[1] = n1; N[1] = n1;
N[2] = n2; N[2] = n2;
@ -491,7 +491,7 @@ public:
// For use by Compact_container. // For use by Compact_container.
void * for_compact_container() const { return N[0].for_compact_container(); } void * for_compact_container() const { return N[0].for_compact_container(); }
void * & for_compact_container() { return N[0].for_compact_container(); } void for_compact_container(void *p) { N[0].for_compact_container(p); }
// TDS internal data access functions. // TDS internal data access functions.
TDS_data& tds_data() { return _tds_data; } TDS_data& tds_data() { return _tds_data; }

View File

@ -13,7 +13,7 @@
#ifndef CGAL_IO_FILE_BINARY_MESH_3_H #ifndef CGAL_IO_FILE_BINARY_MESH_3_H
#define CGAL_IO_FILE_BINARY_MESH_3_H #define CGAL_IO_FILE_BINARY_MESH_3_H
#include <CGAL/license/Mesh_3.h> #include <CGAL/license/Triangulation_3.h>
#include <iostream> #include <iostream>

View File

@ -12,7 +12,7 @@
#ifndef CGAL_IO_FILE_MAYA_H #ifndef CGAL_IO_FILE_MAYA_H
#define CGAL_IO_FILE_MAYA_H #define CGAL_IO_FILE_MAYA_H
#include <CGAL/license/Mesh_3.h> #include <CGAL/license/Triangulation_3.h>
#include <CGAL/Time_stamper.h> #include <CGAL/Time_stamper.h>
#include <CGAL/utility.h> #include <CGAL/utility.h>

View File

@ -14,7 +14,7 @@
#ifndef CGAL_IO_FILE_MEDIT_H #ifndef CGAL_IO_FILE_MEDIT_H
#define CGAL_IO_FILE_MEDIT_H #define CGAL_IO_FILE_MEDIT_H
#include <CGAL/license/Mesh_3.h> #include <CGAL/license/Triangulation_3.h>
#include <CGAL/Mesh_3/config.h> #include <CGAL/Mesh_3/config.h>
@ -754,7 +754,7 @@ output_to_medit(std::ostream& os,
typedef typename Tr::Finite_vertices_iterator Finite_vertices_iterator; typedef typename Tr::Finite_vertices_iterator Finite_vertices_iterator;
typedef typename Tr::Vertex_handle Vertex_handle; typedef typename Tr::Vertex_handle Vertex_handle;
typedef typename Tr::Weighted_point Weighted_point; typedef typename Tr::Point Point; //can be weighted or not
const Tr& tr = c3t3.triangulation(); const Tr& tr = c3t3.triangulation();
@ -783,7 +783,7 @@ output_to_medit(std::ostream& os,
++vit) ++vit)
{ {
V[vit] = inum++; V[vit] = inum++;
Weighted_point p = tr.point(vit); Point p = tr.point(vit);
os << CGAL::to_double(p.x()) << ' ' os << CGAL::to_double(p.x()) << ' '
<< CGAL::to_double(p.y()) << ' ' << CGAL::to_double(p.y()) << ' '
<< CGAL::to_double(p.z()) << ' ' << CGAL::to_double(p.z()) << ' '

View File

@ -14,7 +14,7 @@
#ifndef CGAL_FACETS_IN_COMPLEX_3_TO_TRIANGLE_MESH_H #ifndef CGAL_FACETS_IN_COMPLEX_3_TO_TRIANGLE_MESH_H
#define CGAL_FACETS_IN_COMPLEX_3_TO_TRIANGLE_MESH_H #define CGAL_FACETS_IN_COMPLEX_3_TO_TRIANGLE_MESH_H
#include <CGAL/license/Mesh_3.h> #include <CGAL/license/Triangulation_3.h>
#include <CGAL/array.h> #include <CGAL/array.h>
#include <CGAL/boost/graph/Euler_operations.h> #include <CGAL/boost/graph/Euler_operations.h>

View File

@ -13,7 +13,7 @@
#ifndef CGAL_MESH_3_HAS_FEATURES_H #ifndef CGAL_MESH_3_HAS_FEATURES_H
#define CGAL_MESH_3_HAS_FEATURES_H #define CGAL_MESH_3_HAS_FEATURES_H
#include <CGAL/license/Mesh_3.h> #include <CGAL/license/Triangulation_3.h>
#include <boost/mpl/has_xxx.hpp> #include <boost/mpl/has_xxx.hpp>

View File

@ -18,7 +18,7 @@
#ifndef CGAL_MESH_3_MESH_COMPLEX_3_IN_TRIANGULATION_3_BASE_H #ifndef CGAL_MESH_3_MESH_COMPLEX_3_IN_TRIANGULATION_3_BASE_H
#define CGAL_MESH_3_MESH_COMPLEX_3_IN_TRIANGULATION_3_BASE_H #define CGAL_MESH_3_MESH_COMPLEX_3_IN_TRIANGULATION_3_BASE_H
#include <CGAL/license/Mesh_3.h> #include <CGAL/license/Triangulation_3.h>
#include <CGAL/disable_warnings.h> #include <CGAL/disable_warnings.h>

View File

@ -18,7 +18,7 @@
#ifndef CGAL_MESH_3_MESH_SURFACE_CELL_BASE_3_H #ifndef CGAL_MESH_3_MESH_SURFACE_CELL_BASE_3_H
#define CGAL_MESH_3_MESH_SURFACE_CELL_BASE_3_H #define CGAL_MESH_3_MESH_SURFACE_CELL_BASE_3_H
#include <CGAL/license/Mesh_3.h> #include <CGAL/license/Triangulation_3.h>
#include <CGAL/Mesh_3/config.h> #include <CGAL/Mesh_3/config.h>

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