Merge remote-tracking branch 'origin/master' into Weights-new_package-danston

This commit is contained in:
Dmitry Anisimov 2021-08-04 15:12:04 +02:00
commit 50157a7479
397 changed files with 31126 additions and 4618 deletions

2
.github/install.sh vendored
View File

@ -3,7 +3,7 @@ sudo add-apt-repository ppa:mikhailnov/pulseeffects -y
sudo apt-get update
sudo apt-get install -y libmpfr-dev \
libeigen3-dev qtbase5-dev libqt5sql5-sqlite libqt5opengl5-dev qtscript5-dev \
libqt5svg5-dev qttools5-dev qttools5-dev-tools libboost1.72-dev zsh
libqt5svg5-dev qttools5-dev qttools5-dev-tools libboost-dev libinsighttoolkit4-dev zsh
#update cmake to 3.18.4
sudo apt purge --auto-remove cmake
cd /tmp

View File

@ -18,10 +18,15 @@ jobs:
if(asso == 'OWNER' || asso == 'MEMBER') {
const body = context.payload.comment.body
if(body.includes("build:")) {
const re = /\/build:(\w+)\s*/;
const re = /\/(force-)?build:(\w+)\s*/;
if(re.test(body)){
const res = re.exec(body)
return res[1];
if(body.includes("force-")) {
return res[2]+":yes"
}
else{
return res[2]+":no"
}
}
}
}
@ -70,19 +75,22 @@ jobs:
run: |
set -ex
PR_NUMBER=${{ steps.get_pr_number.outputs.result }}
ROUND=${{ steps.get_round.outputs.result }}
TMP_ROUND=${{ steps.get_round.outputs.result }}
ROUND=$(echo $TMP_ROUND | cut -d ":" -f 1)
force=$(echo $TMP_ROUND | cut -d ":" -f 2)
wget --no-verbose cgal.github.io -O tmp.html
if ! egrep -q "\/$PR_NUMBER\/$ROUND" tmp.html; then
if ! egrep -q "\/$PR_NUMBER\/$ROUND" tmp.html || [ "$force" = "yes" ]; then
#list impacted packages
LIST_OF_PKGS=$(git diff --name-only HEAD^1 HEAD |cut -s -d/ -f1 |sort -u | xargs -I {} echo {} && ls -d {}/package_info 2>/dev/null |cut -d/ -f1 |egrep -v Installation||true)
if [ "$LIST_OF_PKGS" = "" ]; then
echo "::set-output name=DoxygenError::No package affected."
exit 1
fi
cd build_doc && make -j2 doc
make -j2 doc_with_postprocessing 2>tmp.log
if [ -s tmp.log ]; then
content=`cat ./build_doc/tmp.log`
echo ::set-output name=DoxygenError::$(cat tmp.log)
content=`cat ./tmp.log`
echo "::set-output name=DoxygenError::$(cat tmp.log)"
exit 1
fi
cd ..
@ -101,6 +109,7 @@ jobs:
mv tmp.html index.html
git add ${PR_NUMBER}/$ROUND index.html && git commit -q --amend -m "base commit" && git push -q -f -u origin master
else
echo "::set-output name=DoxygenError::This round already exists. Overwrite it with /force-build"
exit 1
fi
@ -109,7 +118,10 @@ jobs:
if: ${{ success() && steps.get_round.outputs.result != 'stop' }}
with:
script: |
const address = "The documentation is built. It will be available, after a few minutes, here : https://cgal.github.io/${{ steps.get_pr_number.outputs.result }}/${{ steps.get_round.outputs.result }}/Manual/index.html"
const tmp_round = "${{ steps.get_round.outputs.result }}";
const id = tmp_round.indexOf(":");
const round = tmp_round.substring(0,id);
const address = "The documentation is built. It will be available, after a few minutes, here : https://cgal.github.io/${{ steps.get_pr_number.outputs.result }}/"+round+"/Manual/index.html"
github.issues.createComment({
owner: "CGAL",
repo: "cgal",

View File

@ -25,8 +25,8 @@ jobs:
if [ -d ${PR_NUMBER} ]; then
git rm -r ${PR_NUMBER}
fi
#git diff exits with 1 if there is a diff
if ! git diff --quiet; then
#git diff exits with 1 if there is no diff
if git diff --quiet; then
git commit -a --amend -m"base commit" && git push -f -u origin master
fi

70
.github/workflows/filter_testsuite.yml vendored Normal file
View File

@ -0,0 +1,70 @@
name: Filter Testsuite
on:
issue_comment:
types: [created]
jobs:
build:
if: github.event.comment.user.login == 'maxGimeno' && contains(github.event.comment.body, '/testme')
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v3
id: get_label
with:
result-encoding: string
script: |
//get branch name and username
const pr_url = context.payload.issue.pull_request.url
const pr_content = await github.request(pr_url)
const label = pr_content.data.head.label
const base = pr_content.data.base.ref
console.log(label)
return label+":"+base
- name: Run Testsuite
run: |
mkdir -p ~/.ssh
#ssh key
(
cat <<EOF
${{ secrets.ssh_key }}
EOF
)>> ~/.ssh/id_rsa
chmod 600 /home/runner/.ssh/id_rsa
#ssh public key
(
cat <<EOF
${{ secrets.ssh_key_pub }}
EOF
)>> ~/.ssh/id_rsa.pub
chmod 644 /home/runner/.ssh/id_rsa.pub
#known hosts
wget --no-check-certificate https://cgal.geometryfactory.com/CGAL/ssh_known_hosts -O ~/.ssh/known_hosts
#config file
wget --no-check-certificate https://cgal.geometryfactory.com/CGAL/ssh_config -O ~/.ssh/config
#list of hosts
wget --no-check-certificate https://cgal.geometryfactory.com/CGAL/ssh_host_list -O ~/ssh_host_list
#ssh command
LABEL="${{ steps.get_label.outputs.result }}"
USER_NAME=$(echo $LABEL | cut -d':' -f 1)
BRANCH_NAME=$(echo $LABEL | cut -d':' -f 2)
BASE=$(echo $LABEL | cut -d':' -f 3)
PR_NUMBER=${{ github.event.issue.number }}
mapfile -t HOSTS < ~/ssh_host_list;
for i in ${!HOSTS[@]}; do
HOST=$(echo ${HOSTS[$i]}|cut -d' ' -f 1 )
PATH_TO_SCRIPT=$(echo ${HOSTS[$i]}|cut -d' ' -f 2 )
echo "ssh ${HOST} ${PATH_TO_SCRIPT}/run_testsuite_from_branch_name.sh $USER_NAME $BRANCH_NAME $BASE $PR_NUMBER"
ssh ${HOST} "${PATH_TO_SCRIPT}/run_testsuite_from_branch_name.sh $USER_NAME $BRANCH_NAME $BASE $PR_NUMBER"
done
- name: Post address
uses: actions/github-script@v3
with:
script: |
const address = "The testsuite is lauched. results will be found, after it is done, here : https://cgal.geometryfactory.com/~mgimeno/test_suite/TESTRESULTS/index.shtml "
github.issues.createComment({
owner: "CGAL",
repo: "cgal",
issue_number: ${{ github.event.issue.number }},
body: address
});

View File

@ -527,6 +527,36 @@ public:
}
}
template <class Query, class Traversal_traits>
void traversal_with_priority(const Query& query, Traversal_traits& traits) const
{
switch(size())
{
case 0:
break;
case 1:
traits.intersection(query, singleton_data());
break;
default: // if(size() >= 2)
root_node()->template traversal_with_priority<Traversal_traits,Query>(query, traits, m_primitives.size());
}
}
template <class Query, class Traversal_traits>
void traversal_with_priority_and_group_traversal(const Query& query, Traversal_traits& traits, const std::size_t group_traversal_bound) const
{
switch(size())
{
case 0:
break;
case 1:
traits.intersection(query, singleton_data());
break;
default: // if(size() >= 2)
root_node()->template traversal_with_priority_and_group_traversal(m_primitives, query, traits, m_primitives.size(), 0, group_traversal_bound);
}
}
private:
typedef AABB_node<AABBTraits> Node;

View File

@ -68,6 +68,20 @@ public:
Traversal_traits& traits,
const std::size_t nb_primitives) const;
template<class Traversal_traits, class Query>
void traversal_with_priority(const Query& query,
Traversal_traits& traits,
const std::size_t nb_primitives) const;
template<class Primitive_vector, class Traversal_traits, class Query>
void traversal_with_priority_and_group_traversal(const Primitive_vector& primitives,
const Query& query,
Traversal_traits& traits,
const std::size_t nb_primitives,
std::size_t first_primitive_index,
const std::size_t group_size_bound) const;
private:
typedef AABBTraits AABB_traits;
typedef AABB_node<AABB_traits> Node;
@ -152,6 +166,156 @@ AABB_node<Tr>::traversal(const Query& query,
}
}
template<typename Tr>
template<class Traversal_traits, class Query>
void
AABB_node<Tr>::traversal_with_priority(const Query& query,
Traversal_traits& traits,
const std::size_t nb_primitives) const
{
// Recursive traversal
switch(nb_primitives)
{
case 2:
traits.intersection(query, left_data());
if( traits.go_further() )
{
traits.intersection(query, right_data());
}
break;
case 3:
traits.intersection(query, left_data());
if( traits.go_further() && traits.do_intersect(query, right_child()) )
{
right_child().traversal_with_priority(query, traits, 2);
}
break;
default:
bool ileft, iright;
typename Traversal_traits::Priority pleft, pright;
std::tie(ileft, pleft) = traits.do_intersect_with_priority(query, left_child());
std::tie(iright, pright) = traits.do_intersect_with_priority(query, right_child());
CGAL_precondition( (ileft || iright) ? traits.do_intersect(query, *this) : true );
if(ileft)
{
if(iright)
{
// Both children have to be inspected.
if(pleft >= pright)
{
// Inspect the left child first, has higher priority.
left_child().traversal_with_priority(query, traits, nb_primitives/2);
if( traits.go_further() )
right_child().traversal_with_priority(query, traits, nb_primitives-nb_primitives/2);
}
else
{
// Inspect the right child first, has higher priority.
right_child().traversal_with_priority(query, traits, nb_primitives-nb_primitives/2);
if( traits.go_further() )
left_child().traversal_with_priority(query, traits, nb_primitives/2);
}
}
else
{
// Only the left child has to be inspected.
left_child().traversal_with_priority(query, traits, nb_primitives/2);
}
}
else
{
if(iright)
{
// Only the right child has to be inspected.
right_child().traversal_with_priority(query, traits, nb_primitives-nb_primitives/2);
}
}
}
}
// TODO: find a better name
template<typename Tr>
template<class Primitive_vector, class Traversal_traits, class Query>
void
AABB_node<Tr>::traversal_with_priority_and_group_traversal(const Primitive_vector& primitives,
const Query& query,
Traversal_traits& traits,
const std::size_t nb_primitives,
std::size_t first_primitive_index,
const std::size_t group_traversal_bound) const
{
// Group traversal
CGAL_assertion(group_traversal_bound >= 2);
if ( nb_primitives <= group_traversal_bound )
{
if ( !traits.do_intersect(query, *this) ) return;
CGAL_assertion(traits.do_intersect(query, *this));
traits.traverse_group(query, primitives.begin()+first_primitive_index, primitives.begin()+first_primitive_index+nb_primitives);
return;
}
// Recursive traversal
switch(nb_primitives)
{
case 2:
traits.intersection(query, left_data());
if( traits.go_further() )
{
traits.intersection(query, right_data());
}
break;
case 3:
traits.intersection(query, left_data());
if( traits.go_further() && traits.do_intersect(query, right_child()) )
{
right_child().traversal_with_priority_and_group_traversal(primitives, query, traits, 2, first_primitive_index+1, group_traversal_bound);
}
break;
default:
bool ileft, iright;
typename Traversal_traits::Priority pleft, pright;
std::tie(ileft, pleft) = traits.do_intersect_with_priority(query, left_child());
std::tie(iright, pright) = traits.do_intersect_with_priority(query, right_child());
CGAL_precondition( (ileft || iright) ? traits.do_intersect(query, *this) : true );
if(ileft)
{
if(iright)
{
// Both children have to be inspected.
if(pleft >= pright)
{
// Inspect the left child first, has higher priority.
left_child().traversal_with_priority_and_group_traversal(primitives, query, traits, nb_primitives/2, first_primitive_index, group_traversal_bound);
if( traits.go_further() )
right_child().traversal_with_priority_and_group_traversal(primitives, query, traits, nb_primitives-nb_primitives/2, first_primitive_index+nb_primitives/2, group_traversal_bound);
}
else
{
// Inspect the right child first, has higher priority.
right_child().traversal_with_priority_and_group_traversal(primitives, query, traits, nb_primitives-nb_primitives/2, first_primitive_index+nb_primitives/2, group_traversal_bound);
if( traits.go_further() )
left_child().traversal_with_priority_and_group_traversal(primitives, query, traits, nb_primitives/2, first_primitive_index, group_traversal_bound);
}
}
else
{
// Only the left child has to be inspected.
left_child().traversal_with_priority_and_group_traversal(primitives, query, traits, nb_primitives/2, first_primitive_index, group_traversal_bound);
}
}
else
{
if(iright)
{
// Only the right child has to be inspected.
right_child().traversal_with_priority_and_group_traversal(primitives, query, traits, nb_primitives-nb_primitives/2, first_primitive_index+nb_primitives/2, group_traversal_bound);
}
}
}
}
} // end namespace CGAL
#endif // CGAL_AABB_NODE_H

View File

@ -21,7 +21,6 @@
#include <boost/optional.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/variant/apply_visitor.hpp>
#if BOOST_VERSION >= 105000
# if defined(BOOST_MSVC)
# pragma warning(push)
# pragma warning(disable: 4996)
@ -30,9 +29,6 @@
# if defined(BOOST_MSVC)
# pragma warning(pop)
# endif
#else
# include <queue>
#endif
#include <CGAL/assertions.h>
@ -54,11 +50,7 @@ public:
// BVH_node::traversal this is done through the function parameter
// nb_primitives in the recursion.
typedef
#if BOOST_VERSION >= 105000
boost::heap::priority_queue< Node_ptr_with_ft, boost::heap::compare< std::greater<Node_ptr_with_ft> > >
#else
std::priority_queue< Node_ptr_with_ft>
#endif
Heap_type;
typename AABB_traits::Intersection
@ -167,14 +159,8 @@ private:
const Node* node;
size_type nb_primitives;
FT value;
#if BOOST_VERSION >= 105000
bool operator<(const Node_ptr_with_ft& other) const { return value < other.value; }
bool operator>(const Node_ptr_with_ft& other) const { return value > other.value; }
#else
bool operator>(const Node_ptr_with_ft& other) const { return value < other.value; }
bool operator<(const Node_ptr_with_ft& other) const { return value > other.value; }
#endif
};
struct as_ray_param_visitor {

View File

@ -14,7 +14,7 @@ for Cartesian kernels.
\cgalHasModel double
\cgalHasModel `CGAL::Gmpq`
\cgalHasModel `CGAL::Interval_nt`
\cgalHasModel \ref CGAL::Interval_nt_advanced
\cgalHasModel `CGAL::Interval_nt_advanced`
\cgalHasModel `CGAL::Lazy_exact_nt<FieldNumberType>`
\cgalHasModel `CGAL::Quotient<RingNumberType>`
\cgalHasModel `leda_rational`

View File

@ -14,8 +14,8 @@ for Homogeneous kernels.
\cgalHasModel \cpp built-in number types
\cgalHasModel `CGAL::Gmpq`
\cgalHasModel `CGAL::Gmpz`
\cgalHasModel` CGAL::Interval_nt`
\cgalHasModel \ref CGAL::Interval_nt_advanced
\cgalHasModel `CGAL::Interval_nt`
\cgalHasModel `CGAL::Interval_nt_advanced`
\cgalHasModel `CGAL::Lazy_exact_nt<RingNumberType>`
\cgalHasModel `CGAL::MP_Float`
\cgalHasModel `CGAL::Gmpzf`

View File

@ -338,6 +338,7 @@ void test_algebraic_structure_intern( const CGAL::Field_tag& ) {
test_algebraic_structure_intern< AS >( CGAL::Integral_domain_tag());
AS a(1);
AS b(3);
AS& b_ref = b; b = b_ref; // to exercise self-copy
AS c = a / b;
(void)c; // avoid warnings for unused variables

View File

@ -6,12 +6,8 @@
The concept `AlphaShapeTraits_2` describes the requirements for the geometric traits
class of the underlying Delaunay triangulation of a basic alpha shape.
\cgalRefines `DelaunayTriangulationTraits_2`
In addition to the requirements described in the concept
::DelaunayTriangulationTraits_2, the geometric traits class of a
Delaunay triangulation plugged in a basic alpha shapes provides the
following.
\cgalRefines `DelaunayTriangulationTraits_2`, if the underlying triangulation of the alpha shape is a Delaunay triangulation.
\cgalRefines `Periodic_2DelaunayTriangulationTraits_2`, if the underlying triangulation of the alpha shape is a periodic Delaunay triangulation.
\cgalHasModel All models of `Kernel`.
\cgalHasModel Projection traits such as `CGAL::Projection_traits_xy_3<K>`.

View File

@ -7,12 +7,7 @@ The concept `WeightedAlphaShapeTraits_2` describes the requirements
for the geometric traits class
of the underlying regular triangulation of a weighted alpha shape.
\cgalRefines `RegularTriangulationTraits_2`
In addition to the requirements described in the concept
`RegularTriangulationTraits_2`, the geometric traits class of a
regular triangulation plugged in a basic alpha shapes provides the
following.
\cgalRefines `RegularTriangulationTraits_2`, if the underlying triangulation of the alpha shape is a regular triangulation.
\cgalHasModel All models of `Kernel`.
\cgalHasModel Projection traits such as `CGAL::Projection_traits_xy_3<K>`.

View File

@ -7,12 +7,8 @@ The concept `AlphaShapeTraits_3` describes the requirements
for the geometric traits class
of the underlying Delaunay triangulation of a basic alpha shape.
\cgalRefines `DelaunayTriangulationTraits_3`
In addition to the requirements described in the concept
::DelaunayTriangulationTraits_3, the geometric traits class of a
Delaunay triangulation plugged in a basic alpha shapes provides the
following.
\cgalRefines `DelaunayTriangulationTraits_3`, if the underlying triangulation of the alpha shape is a Delaunay triangulation.
\cgalRefines `Periodic_3DelaunayTriangulationTraits_3`, if the underlying triangulation of the alpha shape is a periodic Delaunay triangulation.
\cgalHasModel All models of `Kernel`.

View File

@ -7,12 +7,8 @@ The concept `FixedAlphaShapeTraits_3` describes the requirements
for the geometric traits class
of the underlying Delaunay triangulation of a basic alpha shape with a fixed value alpha.
\cgalRefines `DelaunayTriangulationTraits_3`
In addition to the requirements described in the concept
`DelaunayTriangulationTraits_3`, the geometric traits class of a
Delaunay triangulation plugged in a basic alpha shape with fixed alpha
value provides the following.
\cgalRefines `DelaunayTriangulationTraits_3`, if the underlying triangulation of the alpha shape is a Delaunay triangulation.
\cgalRefines `Periodic_3DelaunayTriangulationTraits_3`, if the underlying triangulation of the alpha shape is a periodic Delaunay triangulation.
\cgalHasModel All models of `Kernel`.

View File

@ -6,12 +6,8 @@
The concept `FixedWeightedAlphaShapeTraits_3` describes the requirements
for the geometric traits class of the underlying regular triangulation of a weighted alpha shape with fixed alpha value.
\cgalRefines `RegularTriangulationTraits_3`
In addition to the requirements described in the concept
::RegularTriangulationTraits_3, the geometric traits class of a
regular triangulation plugged in a weighted alpha shape with fixed
alpha value provides the following.
\cgalRefines `RegularTriangulationTraits_3`, if the underlying triangulation of the alpha shape is a regular triangulation.
\cgalRefines `Periodic_3RegularTriangulationTraits_3`, if the underlying triangulation of the alpha shape is a periodic regular triangulation.
\cgalHasModel All models of `Kernel`.

View File

@ -7,12 +7,8 @@ The concept `WeightedAlphaShapeTraits_3` describes the requirements
for the geometric traits class
of the underlying regular triangulation of a weighted alpha shape.
\cgalRefines `RegularTriangulationTraits_3`
In addition to the requirements described in the concept
`RegularTriangulationTraits_3`, the geometric traits class of a
regular triangulation plugged in a basic alpha shapes provides the
following.
\cgalRefines `RegularTriangulationTraits_3`, if the underlying triangulation of the alpha shape is a regular triangulation.
\cgalRefines `Periodic_3RegularTriangulationTraits_3`, if the underlying triangulation of the alpha shape is a periodic regular triangulation.
\cgalHasModel All models of `Kernel`.

View File

@ -44,20 +44,12 @@ public:
using Base::f;
protected:
#if defined(__POWERPC__) && \
defined(__GNUC__) && (__GNUC__ == 3 ) && (__GNUC_MINOR__ == 4)
// hack to avoid nasty warning for G++ 3.4 on Darwin
static FT OFFSET()
{
return FT(10000);
}
#else
static const FT& OFFSET()
{
static const FT offset_(10000);
return offset_;
}
#endif
template< class Stream >
inline

View File

@ -267,24 +267,29 @@ public:
}
inline Line_2 line() const
inline const Line_2& line() const
{
return l;
}
inline Point_2 center() const
inline const Point_2& center() const
{
return c;
}
inline const Point_2& origin() const
{
return o;
}
template< class Stream >
void draw(Stream& W) const
{
std::vector< Point_2 > p;
std::vector< Point_2 > pleft, pright;
pleft.push_back(o);
pright.push_back(o);
pleft.push_back(origin());
pright.push_back(origin());
const FT STEP(2);
for (int i = 1; i <= 100; i++) {
p = compute_points(i * i * STEP);
@ -311,7 +316,7 @@ public:
W << Segment_2(pright[i], pright[i+1]);
}
W << o;
W << origin();
}
};

View File

@ -3475,7 +3475,7 @@ This package provides an <I>inserter</I> (the `<<` operator) and an
`Arrangement_2<Traits,Dcel>` class that inserts and an arrangement
object into an output stream and extracts an arrangement object from an
input stream respectively. The arrangement is written using a simple
predefined ASCII format that encodes the arrangement topology, as well
predefined \ascii format that encodes the arrangement topology, as well
as all geometric entities associated with vertices and edges.
The ability to use the input/output operators, requires that the
@ -3560,7 +3560,7 @@ with the basic arrangement structure.
The arrangement package supplies an inserter and an extractor for the
`Arrangement_with_history_2<Traits,Dcel>` class. The arrangement is
represented using a simple predefined ASCII format. An object of the
represented using a simple predefined \ascii format. An object of the
`Arrangement_with_history_2<Traits,Dcel>` type can be saved and
restored, as long as the `Curve_2` type defined by the traits
class - as well as the `Point_2` type and the `X_monotone_curve_2`

View File

@ -122,15 +122,10 @@ public:
#if defined(__SUNPRO_CC) || defined(__PGI) || defined(__INTEL_COMPILER)
friend class Trapezoidal_decomposition_2<Traits>::Around_point_circulator;
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
#elif defined(__GNUC__)
#elif (__GNUC__ > 0)
#if ((__GNUC__ < 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ <= 2)))
friend typename Trapezoidal_decomposition_2<Traits>::Around_point_circulator;
friend typename Trapezoidal_decomposition_2<Traits>::In_face_iterator;
#else
friend class Trapezoidal_decomposition_2<Traits>::Around_point_circulator;
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
#endif
#else
friend class Around_point_circulator;

View File

@ -94,14 +94,8 @@ public:
#ifdef CGAL_PM_FRIEND_CLASS
#if defined(__SUNPRO_CC) || defined(__PGI) || defined(__INTEL_COMPILER)
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
#elif defined(__GNUC__)
#if ((__GNUC__ < 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ <= 2)))
friend typename Trapezoidal_decomposition_2<Traits>::In_face_iterator;
#else
#elif (__GNUC__ > 0)
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
#endif
#else
friend class In_face_iterator;
#endif

View File

@ -94,14 +94,8 @@ public:
#ifdef CGAL_PM_FRIEND_CLASS
#if defined(__SUNPRO_CC) || defined(__PGI) || defined(__INTEL_COMPILER)
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
#elif defined(__GNUC__)
#if ((__GNUC__ < 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ <= 2)))
friend typename Trapezoidal_decomposition_2<Traits>::In_face_iterator;
#else
#elif (__GNUC__ > 0)
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
#endif
#else
friend class In_face_iterator;
#endif

View File

@ -91,14 +91,8 @@ public:
#ifdef CGAL_PM_FRIEND_CLASS
#if defined(__SUNPRO_CC) || defined(__PGI) || defined(__INTEL_COMPILER)
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
#elif defined(__GNUC__)
#if ((__GNUC__ < 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ <= 2)))
friend typename Trapezoidal_decomposition_2<Traits>::In_face_iterator;
#else
#elif (__GNUC__ > 0)
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
#endif
#else
friend class In_face_iterator;
#endif

View File

@ -96,14 +96,8 @@ public:
#ifdef CGAL_PM_FRIEND_CLASS
#if defined(__SUNPRO_CC) || defined(__PGI) || defined(__INTEL_COMPILER)
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
#elif defined(__GNUC__)
#if ((__GNUC__ < 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ <= 2)))
friend typename Trapezoidal_decomposition_2<Traits>::In_face_iterator;
#else
#elif (__GNUC__ > 0)
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
#endif
#else
friend class In_face_iterator;
#endif

View File

@ -93,14 +93,8 @@ public:
#ifdef CGAL_PM_FRIEND_CLASS
#if defined(__SUNPRO_CC) || defined(__PGI) || defined(__INTEL_COMPILER)
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
#elif defined(__GNUC__)
#if ((__GNUC__ < 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ <= 2)))
friend typename Trapezoidal_decomposition_2<Traits>::In_face_iterator;
#else
#elif (__GNUC__ > 0)
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
#endif
#else
friend class In_face_iterator;
#endif

View File

@ -96,14 +96,8 @@ public:
#ifdef CGAL_PM_FRIEND_CLASS
#if defined(__SUNPRO_CC) || defined(__PGI) || defined(__INTEL_COMPILER)
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
#elif defined(__GNUC__)
#if ((__GNUC__ < 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ <= 2)))
friend typename Trapezoidal_decomposition_2<Traits>::In_face_iterator;
#else
#elif (__GNUC__ > 0)
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
#endif
#else
friend class In_face_iterator;
#endif

View File

@ -92,14 +92,8 @@ public:
#ifdef CGAL_PM_FRIEND_CLASS
#if defined(__SUNPRO_CC) || defined(__PGI) || defined(__INTEL_COMPILER)
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
#elif defined(__GNUC__)
#if ((__GNUC__ < 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ <= 2)))
friend typename Trapezoidal_decomposition_2<Traits>::In_face_iterator;
#else
#elif (__GNUC__ > 0)
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
#endif
#else
friend class In_face_iterator;
#endif

View File

@ -46,9 +46,7 @@
#define CGAL_TD_DEFAULT_SIZE_THRESHOLD 12
#ifndef _MSC_VER
#if !defined __GNUC__ || __GNUC__> 3 || ((__GNUC__== 3) && (__GNUC_MINOR__> 4))
#define CGAL_PM_FRIEND_CLASS
#endif
#endif
#endif

View File

@ -738,35 +738,12 @@ public:
// read values
is >> rep._m_xy;
#if BOOST_VERSION < 104300
// EBEB: This fixes a bug in optional_io.hpp, reported to Fernando on
// April 27, 2010, don't know whether the fix makes it into
// boost 1_43.
if (!rep._m_xy) {
swallow(is, '-');
}
#endif
swallow(is, ',');
is >> rep._m_x;
#if BOOST_VERSION < 104300
if (!rep._m_x) {
swallow(is, '-');
}
#endif
swallow(is, ',');
is >> rep._m_curve;
#if BOOST_VERSION < 104300
if (!rep._m_curve) {
swallow(is, '-');
}
#endif
swallow(is, ',');
is >> rep._m_arcno;
#if BOOST_VERSION < 104300
if (!rep._m_arcno) {
swallow(is, '-');
}
#endif
swallow(is, ',');
is >> rep._m_location;

View File

@ -27,7 +27,7 @@
namespace CGAL {
/*! \class
* A class defining a textual (ASCII) input/output format for arrangements
* A class defining a textual (\ascii) input/output format for arrangements
* and supports reading and writing an arrangement from or to input/output
* streams.
*/
@ -489,7 +489,7 @@ protected:
};
/*! \class
* A class defining a textual (ASCII) input/output format for arrangements
* A class defining a textual (\ascii) input/output format for arrangements
* that store auxiliary dat with their face records, as they are templated
* by a face-extended DCEL class.
*/
@ -546,7 +546,7 @@ public:
};
/*! \class
* A class defining a textual (ASCII) input/output format for arrangements
* A class defining a textual (\ascii) input/output format for arrangements
* that store auxiliary dat with all their DCEL records, as they are templated
* by a extended DCEL class.
*/

View File

@ -26,7 +26,7 @@
namespace CGAL {
/*! \class
* A class defining a textual (ASCII) input/output format for arrangements
* A class defining a textual (\ascii) input/output format for arrangements
* with history and supports reading and writing an arrangement from or to
* input/output streams.
*/

View File

@ -28,6 +28,10 @@
#include <boost/range/has_range_iterator.hpp>
#include <boost/unordered_set.hpp>
#include <bitset>
#include <utility>
#include <vector>
#ifdef DOXYGEN_RUNNING
#define CGAL_BGL_NP_TEMPLATE_PARAMETERS NamedParameters
#define CGAL_BGL_NP_CLASS NamedParameters
@ -393,21 +397,68 @@ struct Face_filtered_graph
///returns a reference to the underlying graph.
Graph& graph(){ return _graph; }
///change the set of selected faces using a patch id
template<class FacePatchIndexMap>
void set_selected_faces(typename boost::property_traits<FacePatchIndexMap>::value_type face_patch_id,
FacePatchIndexMap face_patch_index_map)
// Handling of internal correspondency for index maps.
// The indices must be kept valid when the selection changes.
void initialize_face_indices() const
{
if(face_indices.empty())
{
face_index_type index = 0;
face_indices.resize(num_faces(_graph));
for(std::size_t i=selected_faces.find_first(); i<selected_faces.npos; i=selected_faces.find_next(i))
face_indices[i] = index++;
}
}
void initialize_vertex_indices() const
{
if(vertex_indices.empty())
{
vertex_index_type index = 0;
vertex_indices.resize(num_vertices(_graph));
for(std::size_t i=selected_vertices.find_first(); i<selected_vertices.npos; i=selected_vertices.find_next(i))
vertex_indices[i] = index++;
}
}
void initialize_halfedge_indices() const
{
if(halfedge_indices.empty())
{
halfedge_index_type index = 0;
halfedge_indices.resize(num_halfedges(_graph));
for(std::size_t i=selected_halfedges.find_first(); i<selected_halfedges.npos; i=selected_halfedges.find_next(i))
halfedge_indices[i] = index++;
}
}
void reset_indices()
{
face_indices.clear();
vertex_indices.clear();
halfedge_indices.clear();
if(is_imap_in_use.test(0))
initialize_face_indices();
if(is_imap_in_use.test(1))
initialize_vertex_indices();
if(is_imap_in_use.test(2))
initialize_halfedge_indices();
}
///change the set of selected faces using a patch id
template<class FacePatchIndexMap>
void set_selected_faces(typename boost::property_traits<FacePatchIndexMap>::value_type face_patch_id,
FacePatchIndexMap face_patch_index_map)
{
selected_faces.resize(num_faces(_graph));
selected_vertices.resize(num_vertices(_graph));
selected_halfedges.resize(num_halfedges(_graph));
selected_faces.reset();
selected_vertices.reset();
selected_halfedges.reset();
for(face_descriptor fd : faces(_graph) )
{
if(get(face_patch_index_map, fd) == face_patch_id)
@ -421,6 +472,8 @@ struct Face_filtered_graph
}
}
}
reset_indices();
}
/// change the set of selected faces using a range of patch ids
template<class FacePatchIndexRange, class FacePatchIndexMap>
@ -433,16 +486,14 @@ struct Face_filtered_graph
#endif
)
{
face_indices.clear();
vertex_indices.clear();
halfedge_indices.clear();
selected_faces.resize(num_faces(_graph));
selected_vertices.resize(num_vertices(_graph));
selected_halfedges.resize(num_halfedges(_graph));
selected_faces.reset();
selected_vertices.reset();
selected_halfedges.reset();
typedef typename boost::property_traits<FacePatchIndexMap>::value_type Patch_index;
boost::unordered_set<Patch_index> pids(boost::begin(selected_face_patch_indices),
boost::end(selected_face_patch_indices));
@ -460,21 +511,22 @@ struct Face_filtered_graph
}
}
}
reset_indices();
}
/// change the set of selected faces using a range of face descriptors
template<class FaceRange>
void set_selected_faces(const FaceRange& selection)
{
face_indices.clear();
vertex_indices.clear();
halfedge_indices.clear();
selected_faces.resize(num_faces(_graph));
selected_vertices.resize(num_vertices(_graph));
selected_halfedges.resize(num_halfedges(_graph));
selected_faces.reset();
selected_vertices.reset();
selected_halfedges.reset();
for(face_descriptor fd : selection)
{
selected_faces.set(get(fimap, fd));
@ -485,6 +537,8 @@ struct Face_filtered_graph
selected_vertices.set(get(vimap, target(hd, _graph)));
}
}
reset_indices();
}
struct Is_simplex_valid
@ -543,45 +597,27 @@ struct Face_filtered_graph
Property_map_binder<FIM, typename Pointer_property_map<typename boost::property_traits<FIM>::value_type>::type>
get_face_index_map() const
{
if (face_indices.empty())
{
face_index_type index = 0;
face_indices.resize(num_faces(_graph));
for (std::size_t i=selected_faces.find_first(); i < selected_faces.npos; i = selected_faces.find_next(i))
{
face_indices[i] = index++;
}
}
return bind_property_maps(fimap, make_property_map(face_indices) );
is_imap_in_use.set(0);
initialize_face_indices();
return bind_property_maps(fimap, make_property_map(face_indices));
}
Property_map_binder<VIM, typename Pointer_property_map<typename boost::property_traits<VIM>::value_type>::type>
get_vertex_index_map() const
{
if (vertex_indices.empty())
{
vertex_index_type index = 0;
vertex_indices.resize(num_vertices(_graph));
for (std::size_t i=selected_vertices.find_first(); i < selected_vertices.npos; i = selected_vertices.find_next(i))
{
vertex_indices[i] = index++;
}
}
is_imap_in_use.set(1);
initialize_vertex_indices();
return bind_property_maps(vimap, make_property_map(vertex_indices) );
}
Property_map_binder<HIM, typename Pointer_property_map<typename boost::property_traits<HIM>::value_type >::type>
get_halfedge_index_map() const
{
if (halfedge_indices.empty())
{
halfedge_index_type index = 0;
halfedge_indices.resize(num_halfedges(_graph));
for (std::size_t i=selected_halfedges.find_first(); i < selected_halfedges.npos; i = selected_halfedges.find_next(i))
{
halfedge_indices[i] = index++;
}
}
is_imap_in_use.set(2);
initialize_halfedge_indices();
return bind_property_maps(himap, make_property_map(halfedge_indices) );
}
@ -649,9 +685,11 @@ private:
boost::dynamic_bitset<> selected_faces;
boost::dynamic_bitset<> selected_vertices;
boost::dynamic_bitset<> selected_halfedges;
mutable std::vector<face_index_type> face_indices;
mutable std::vector<vertex_index_type> vertex_indices;
mutable std::vector<halfedge_index_type> halfedge_indices;
mutable std::bitset<3> is_imap_in_use; // one per descriptor type (face, vertex, halfedge)
};
} // namespace CGAL
@ -1206,40 +1244,6 @@ CGAL_FFG_DYNAMIC_PMAP_SPEC(dynamic_face_property_t)
#undef CGAL_FFG_DYNAMIC_PMAP_SPEC
//specializations for indices
template <class Graph,
typename FIMap,
typename VIMap,
typename HIMap>
typename boost::property_map<Face_filtered_graph<Graph, FIMap, VIMap, HIMap>, CGAL::face_index_t >::type
get(CGAL::face_index_t, const Face_filtered_graph<Graph, FIMap, VIMap, HIMap>& w)
{
return w.get_face_index_map();
}
template <class Graph,
typename FIMap,
typename VIMap,
typename HIMap>
typename boost::property_map<Face_filtered_graph<Graph, FIMap, VIMap, HIMap>, boost::vertex_index_t >::type
get(boost::vertex_index_t, const Face_filtered_graph<Graph, FIMap, VIMap, HIMap>& w)
{
return w.get_vertex_index_map();
}
template <class Graph,
typename FIMap,
typename VIMap,
typename HIMap>
typename boost::property_map<Face_filtered_graph<Graph, FIMap, VIMap, HIMap>, CGAL::halfedge_index_t >::type
get(CGAL::halfedge_index_t, const Face_filtered_graph<Graph, FIMap, VIMap, HIMap>& w)
{
return w.get_halfedge_index_map();
}
template <class Graph,
typename FIMap,
typename VIMap,
@ -1307,9 +1311,11 @@ CGAL_FILTERED_FACE_GRAPH_DYNAMIC_PMAP_SPECIALIZATION(dynamic_face_property_t)
//specializations for indices
template<typename Graph, typename FIMap, typename VIMap, typename HIMap>
struct property_map<CGAL::Face_filtered_graph<Graph, FIMap, VIMap, HIMap>, CGAL::face_index_t>
struct property_map<CGAL::Face_filtered_graph<Graph, FIMap, VIMap, HIMap>, boost::face_index_t>
{
typedef typename CGAL::Face_filtered_graph<Graph, FIMap, VIMap, HIMap>::FIM FIM;
typedef CGAL::Face_filtered_graph<Graph, FIMap, VIMap, HIMap> FFG;
typedef typename FFG::FIM FIM;
typedef typename CGAL::Property_map_binder<FIM,
typename CGAL::Pointer_property_map<
typename boost::property_traits<FIM>::value_type>::type> type;
@ -1319,20 +1325,21 @@ struct property_map<CGAL::Face_filtered_graph<Graph, FIMap, VIMap, HIMap>, CGAL:
template<typename Graph, typename FIMap, typename VIMap, typename HIMap>
struct property_map<CGAL::Face_filtered_graph<Graph, FIMap, VIMap, HIMap>, boost::vertex_index_t>
{
typedef typename CGAL::Face_filtered_graph<Graph, FIMap, VIMap, HIMap>::VIM VIM;
typedef CGAL::Face_filtered_graph<Graph, FIMap, VIMap, HIMap> FFG;
typedef typename FFG::VIM VIM;
typedef typename CGAL::Property_map_binder<VIM,
typename CGAL::Pointer_property_map<
typename boost::property_traits<VIM>::value_type>::type> type;
typedef type const_type;
};
template<typename Graph,
typename FIMap,
typename VIMap,
typename HIMap>
struct property_map<CGAL::Face_filtered_graph<Graph, FIMap, VIMap, HIMap>, CGAL::halfedge_index_t>
template<typename Graph, typename FIMap, typename VIMap, typename HIMap>
struct property_map<CGAL::Face_filtered_graph<Graph, FIMap, VIMap, HIMap>, boost::halfedge_index_t>
{
typedef typename CGAL::Face_filtered_graph<Graph, FIMap, VIMap, HIMap>::HIM HIM;
typedef CGAL::Face_filtered_graph<Graph, FIMap, VIMap, HIMap> FFG;
typedef typename FFG::HIM HIM;
typedef typename CGAL::Property_map_binder<HIM,
typename CGAL::Pointer_property_map<
typename boost::property_traits<HIM>::value_type>::type> type;
@ -1341,4 +1348,52 @@ struct property_map<CGAL::Face_filtered_graph<Graph, FIMap, VIMap, HIMap>, CGAL:
} // namespace boost
namespace CGAL {
//specializations for indices
template <class Graph, typename FIMap, typename VIMap, typename HIMap>
typename boost::property_map<Face_filtered_graph<Graph, FIMap, VIMap, HIMap>, boost::face_index_t >::const_type
get(boost::face_index_t, const Face_filtered_graph<Graph, FIMap, VIMap, HIMap>& w)
{
return w.get_face_index_map();
}
template <class Graph, typename FIMap, typename VIMap, typename HIMap>
typename boost::property_map<Face_filtered_graph<Graph, FIMap, VIMap, HIMap>, boost::vertex_index_t >::const_type
get(boost::vertex_index_t, const Face_filtered_graph<Graph, FIMap, VIMap, HIMap>& w)
{
return w.get_vertex_index_map();
}
template <class Graph, typename FIMap, typename VIMap, typename HIMap>
typename boost::property_map<Face_filtered_graph<Graph, FIMap, VIMap, HIMap>, boost::halfedge_index_t >::const_type
get(boost::halfedge_index_t, const Face_filtered_graph<Graph, FIMap, VIMap, HIMap>& w)
{
return w.get_halfedge_index_map();
}
// non-const
template <class Graph, typename FIMap, typename VIMap, typename HIMap>
typename boost::property_map<Face_filtered_graph<Graph, FIMap, VIMap, HIMap>, boost::face_index_t >::type
get(boost::face_index_t, Face_filtered_graph<Graph, FIMap, VIMap, HIMap>& w)
{
return w.get_face_index_map();
}
template <class Graph, typename FIMap, typename VIMap, typename HIMap>
typename boost::property_map<Face_filtered_graph<Graph, FIMap, VIMap, HIMap>, boost::vertex_index_t >::type
get(boost::vertex_index_t, Face_filtered_graph<Graph, FIMap, VIMap, HIMap>& w)
{
return w.get_vertex_index_map();
}
template <class Graph, typename FIMap, typename VIMap, typename HIMap>
typename boost::property_map<Face_filtered_graph<Graph, FIMap, VIMap, HIMap>, boost::halfedge_index_t >::type
get(boost::halfedge_index_t, Face_filtered_graph<Graph, FIMap, VIMap, HIMap>& w)
{
return w.get_halfedge_index_map();
}
} // namespace CGAL
#endif // CGAL_BOOST_GRAPH_FACE_FILTERED_GRAPH_H

View File

@ -270,7 +270,7 @@ bool read_GOCAD(const std::string& fname, Graph& g,
/// \cgalParamNBegin{stream_precision}
/// \cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
/// \cgalParamType{int}
/// \cgalParamDefault{`the precision of the stream `os``}
/// \cgalParamDefault{the precision of the stream `os`}
/// \cgalParamNEnd
/// \cgalNamedParamsEnd
///
@ -378,7 +378,7 @@ bool write_GOCAD(std::ostream& os, const char* name, const Graph& g,
/// \cgalParamNBegin{stream_precision}
/// \cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
/// \cgalParamType{int}
/// \cgalParamDefault{`the precision of the stream `os``}
/// \cgalParamDefault{the precision of the stream `os`}
/// \cgalParamNEnd
/// \cgalNamedParamsEnd
///

View File

@ -230,7 +230,7 @@ bool read_OBJ(const std::string& fname, Graph& g,
\cgalParamNBegin{stream_precision}
\cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
\cgalParamType{int}
\cgalParamDefault{`the precision of the stream `os``}
\cgalParamDefault{the precision of the stream `os`}
\cgalParamNEnd
\cgalNamedParamsEnd

View File

@ -392,7 +392,7 @@ bool write_OFF_BGL(std::ostream& os,
\cgalParamNBegin{stream_precision}
\cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
\cgalParamType{int}
\cgalParamDefault{`the precision of the stream `os``}
\cgalParamDefault{the precision of the stream `os`}
\cgalParamNEnd
\cgalNamedParamsEnd

View File

@ -175,7 +175,7 @@ bool read_PLY(std::istream& is, Graph& g,
\cgalNamedParamsBegin
\cgalParamNBegin{use_binary_mode}
\cgalParamDescription{indicates whether data should be read in binary (`true`) or in ASCII (`false`)}
\cgalParamDescription{indicates whether data should be read in binary (`true`) or in \ascii (`false`)}
\cgalParamType{Boolean}
\cgalParamDefault{`true`}
\cgalParamNEnd
@ -310,8 +310,8 @@ bool read_PLY(const std::string& fname, Graph& g,
\cgalParamNBegin{stream_precision}
\cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
\cgalParamType{int}
\cgalParamDefault{`the precision of the stream `os``}
\cgalParamExtra{This parameter is only meaningful while using ASCII encoding.}
\cgalParamDefault{the precision of the stream `os`}
\cgalParamExtra{This parameter is only meaningful while using \ascii encoding.}
\cgalParamNEnd
\cgalNamedParamsEnd
@ -482,7 +482,7 @@ bool write_PLY(std::ostream& os, const Graph& g,
\cgalNamedParamsBegin
\cgalParamNBegin{use_binary_mode}
\cgalParamDescription{indicates whether data should be written in binary (`true`) or in ASCII (`false`)}
\cgalParamDescription{indicates whether data should be written in binary (`true`) or in \ascii (`false`)}
\cgalParamType{Boolean}
\cgalParamDefault{`true`}
\cgalParamNEnd
@ -521,7 +521,7 @@ bool write_PLY(std::ostream& os, const Graph& g,
\cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
\cgalParamType{int}
\cgalParamDefault{`6`}
\cgalParamExtra{This parameter is only meaningful while using ASCII encoding.}
\cgalParamExtra{This parameter is only meaningful while using \ascii encoding.}
\cgalParamNEnd
\cgalNamedParamsEnd

View File

@ -135,7 +135,7 @@ bool read_STL(std::istream& is,
\cgalNamedParamsBegin
\cgalParamNBegin{use_binary_mode}
\cgalParamDescription{indicates whether data should be read in binary (`true`) or in ASCII (`false`)}
\cgalParamDescription{indicates whether data should be read in binary (`true`) or in \ascii (`false`)}
\cgalParamType{Boolean}
\cgalParamDefault{`true`}
\cgalParamNEnd
@ -230,8 +230,8 @@ bool read_STL(const std::string& fname, Graph& g) { return read_STL(fname, g, pa
\cgalParamNBegin{stream_precision}
\cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
\cgalParamType{int}
\cgalParamDefault{`the precision of the stream `os``}
\cgalParamExtra{This parameter is only meaningful while using ASCII encoding.}
\cgalParamDefault{the precision of the stream `os`}
\cgalParamExtra{This parameter is only meaningful while using \ascii encoding.}
\cgalParamNEnd
\cgalNamedParamsEnd
@ -328,7 +328,7 @@ bool write_STL(std::ostream& os,
\cgalNamedParamsBegin
\cgalParamNBegin{use_binary_mode}
\cgalParamDescription{indicates whether data should be written in binary (`true`) or in ASCII (`false`)}
\cgalParamDescription{indicates whether data should be written in binary (`true`) or in \ascii (`false`)}
\cgalParamType{Boolean}
\cgalParamDefault{`true`}
\cgalParamNEnd
@ -346,7 +346,7 @@ bool write_STL(std::ostream& os,
\cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
\cgalParamType{int}
\cgalParamDefault{`6`}
\cgalParamExtra{This parameter is only meaningful while using ASCII encoding.}
\cgalParamExtra{This parameter is only meaningful while using \ascii encoding.}
\cgalParamNEnd
\cgalNamedParamsEnd

View File

@ -393,7 +393,7 @@ void write_polys_points(std::ostream& os,
*
* \cgalNamedParamsBegin
* \cgalParamNBegin{use_binary_mode}
* \cgalParamDescription{indicates whether data should be written in binary (`true`) or in ASCII (`false`)}
* \cgalParamDescription{indicates whether data should be written in binary (`true`) or in \ascii (`false`)}
* \cgalParamType{Boolean}
* \cgalParamDefault{`true`}
* \cgalParamNEnd
@ -417,7 +417,7 @@ void write_polys_points(std::ostream& os,
* \cgalParamNBegin{stream_precision}
* \cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
* \cgalParamType{int}
* \cgalParamDefault{`the precision of the stream `os``}
* \cgalParamDefault{the precision of the stream `os`}
* \cgalParamNEnd
* \cgalNamedParamsEnd
*
@ -492,7 +492,7 @@ bool write_VTP(std::ostream& os,
*
* \cgalNamedParamsBegin
* \cgalParamNBegin{use_binary_mode}
* \cgalParamDescription{indicates whether data should be written in binary (`true`) or in ASCII (`false`)}
* \cgalParamDescription{indicates whether data should be written in binary (`true`) or in \ascii (`false`)}
* \cgalParamType{Boolean}
* \cgalParamDefault{`true`}
* \cgalParamNEnd

View File

@ -61,7 +61,7 @@ namespace IO {
\cgalParamNBegin{stream_precision}
\cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
\cgalParamType{int}
\cgalParamDefault{`the precision of the stream `os``}
\cgalParamDefault{the precision of the stream `os`}
\cgalParamNEnd
\cgalNamedParamsEnd

View File

@ -214,7 +214,7 @@ bool read_polygon_mesh(const std::string& fname, Graph& g)
* \cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
* \cgalParamType{int}
* \cgalParamDefault{`6`}
* \cgalParamExtra{This parameter is only meaningful while using ASCII encoding.}
* \cgalParamExtra{This parameter is only meaningful while using \ascii encoding.}
* \cgalParamNEnd
*
* \cgalParamNBegin{verbose}

View File

@ -27,12 +27,7 @@
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/compressed_sparse_row_graph.hpp>
#if BOOST_VERSION >= 104400 // at this version kolmogorov_max_flow become depricated.
# include <boost/graph/boykov_kolmogorov_max_flow.hpp>
#else
# include <boost/graph/kolmogorov_max_flow.hpp>
#endif
#include <boost/graph/boykov_kolmogorov_max_flow.hpp>
#include <vector>
@ -242,12 +237,8 @@ public:
double max_flow()
{
#if BOOST_VERSION >= 104400
return boost::boykov_kolmogorov_max_flow(graph, cluster_source,
cluster_sink);
#else
return boost::kolmogorov_max_flow(graph, cluster_source, cluster_sink);
#endif
}
template <typename VertexLabelMap, typename InputVertexDescriptor>
@ -352,13 +343,8 @@ public:
void init_vertices()
{
#if BOOST_VERSION >= 104000
graph = Graph(boost::edges_are_unsorted, edge_map.begin(), edge_map.end(),
edge_map_weights.begin(), nb_vertices);
#else
graph= Graph(edge_map.begin(), edge_map.end(),
edge_map_weights.begin(), nb_vertices);
#endif
// PERFORMANCE PROBLEM
// need to set reverse edge map, I guess there is no way to do that before creating the graph
@ -379,7 +365,6 @@ public:
double max_flow()
{
#if BOOST_VERSION >= 104400
// since properties are bundled, defaults does not work need to specify them
return boost::boykov_kolmogorov_max_flow
(graph,
@ -392,19 +377,6 @@ public:
boost::get(boost::vertex_index,
graph), // this is not bundled, get it from graph (CRS provides one)
0, 1);
#else
return boost::kolmogorov_max_flow
(graph,
boost::get(&EdgeP::edge_capacity, graph),
boost::get(&EdgeP::edge_residual_capacity, graph),
boost::get(&EdgeP::edge_reverse, graph),
boost::get(&VertexP::vertex_predecessor, graph),
boost::get(&VertexP::vertex_color, graph),
boost::get(&VertexP::vertex_distance_t, graph),
boost::get(boost::vertex_index,
graph), // this is not bundled, get it from graph
0, 1);
#endif
}
template <typename VertexLabelMap, typename InputVertexDescriptor>

View File

@ -102,6 +102,9 @@ CGAL_add_named_parameter(use_angle_smoothing_t, use_angle_smoothing, use_angle_s
CGAL_add_named_parameter(use_area_smoothing_t, use_area_smoothing, use_area_smoothing)
CGAL_add_named_parameter(use_Delaunay_flips_t, use_Delaunay_flips, use_Delaunay_flips)
CGAL_add_named_parameter(do_project_t, do_project, do_project)
CGAL_add_named_parameter(do_split_t, do_split, do_split)
CGAL_add_named_parameter(do_collapse_t, do_collapse, do_collapse)
CGAL_add_named_parameter(do_flip_t, do_flip, do_flip)
CGAL_add_named_parameter(do_orientation_tests_t, do_orientation_tests, do_orientation_tests)
CGAL_add_named_parameter(do_self_intersection_tests_t, do_self_intersection_tests, do_self_intersection_tests)
CGAL_add_named_parameter(error_codes_t, error_codes, error_codes)
@ -121,7 +124,9 @@ CGAL_add_named_parameter(do_not_modify_t, do_not_modify, do_not_modify)
CGAL_add_named_parameter(allow_self_intersections_t, allow_self_intersections, allow_self_intersections)
CGAL_add_named_parameter(non_manifold_feature_map_t, non_manifold_feature_map, non_manifold_feature_map)
CGAL_add_named_parameter(polyhedral_envelope_epsilon_t, polyhedral_envelope_epsilon, polyhedral_envelope_epsilon)
CGAL_add_named_parameter(match_faces_t, match_faces, match_faces)
CGAL_add_named_parameter(face_epsilon_map_t, face_epsilon_map, face_epsilon_map)
CGAL_add_named_parameter(use_one_sided_hausdorff_t, use_one_sided_hausdorff, use_one_sided_hausdorff)
// List of named parameters that we use in the package 'Surface Mesh Simplification'
CGAL_add_named_parameter(get_cost_policy_t, get_cost_policy, get_cost)

View File

@ -25,7 +25,7 @@
#include <boost/parameter/name.hpp>
#if defined(__clang__) || (BOOST_GCC >= 40600)
#if defined(__clang__) || defined(BOOST_GCC)
# define CGAL_IGNORE_UNUSED_VARIABLES \
_Pragma("GCC diagnostic ignored \"-Wunused-variable\"") \
_Pragma("GCC diagnostic ignored \"-Wunused-parameter\"")

View File

@ -1,15 +1,23 @@
#include <CGAL/boost/graph/Face_filtered_graph.h>
#include <CGAL/Polygon_mesh_processing/connected_components.h>
#include <CGAL/boost/graph/copy_face_graph.h>
#include <CGAL/boost/graph/Face_filtered_graph.h>
#include <CGAL/boost/graph/named_params_helper.h>
#include <CGAL/Polygon_mesh_processing/connected_components.h>
#include <CGAL/use.h>
#include "test_Prefix.h"
#include <boost/numeric/conversion/cast.hpp>
#include <boost/unordered_set.hpp>
#include <boost/unordered_map.hpp>
#include <CGAL/use.h>
#include <fstream>
#include <map>
#include <memory>
#include <utility>
typedef boost::unordered_set<std::size_t> id_map;
namespace PMP = CGAL::Polygon_mesh_processing;
template <typename Graph>
void test_halfedge_around_vertex_iterator(const Graph& g)
{
@ -17,8 +25,7 @@ void test_halfedge_around_vertex_iterator(const Graph& g)
typedef CGAL::Face_filtered_graph<Graph> Adapter;
CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
boost::unordered_map<g_face_descriptor, std::size_t> map(num_faces(g));
CGAL::Polygon_mesh_processing::connected_components(g, boost::make_assoc_property_map(map), CGAL::Polygon_mesh_processing::parameters::all_default());
PMP::connected_components(g, boost::make_assoc_property_map(map), CGAL::parameters::all_default());
Adapter fg(g, 0, boost::make_assoc_property_map(map));
typename boost::graph_traits<Adapter >::vertex_iterator vit, vend;
@ -45,8 +52,9 @@ void test_halfedge_around_face_iterator(const Graph& g)
typedef CGAL::Face_filtered_graph<Graph> Adapter;
CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
std::map<g_face_descriptor, std::size_t> map;
CGAL::Polygon_mesh_processing::connected_components(g, boost::make_assoc_property_map(map), CGAL::Polygon_mesh_processing::parameters::all_default());
PMP::connected_components(g, boost::make_assoc_property_map(map), CGAL::parameters::all_default());
Adapter fg(g, 0, boost::make_assoc_property_map(map));
face_iterator fit, fend;
for(boost::tie(fit, fend) = faces(fg); fit != fend; ++fit) {
halfedge_around_face_iterator hafit, hafend;
@ -65,7 +73,7 @@ void test_edge_iterators(const Graph& g)
typedef CGAL::Face_filtered_graph<Graph> Adapter;
CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
std::map<g_face_descriptor, std::size_t> map;
CGAL::Polygon_mesh_processing::connected_components(g, boost::make_assoc_property_map(map), CGAL::Polygon_mesh_processing::parameters::all_default());
PMP::connected_components(g, boost::make_assoc_property_map(map), CGAL::parameters::all_default());
Adapter fg(g, 0, boost::make_assoc_property_map(map));
// do we iterate as many as that?
@ -91,7 +99,7 @@ void test_vertex_iterators(Graph& g)
typedef CGAL::Face_filtered_graph<Graph> Adapter;
CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
std::map<g_face_descriptor, std::size_t> map;
CGAL::Polygon_mesh_processing::connected_components(g, boost::make_assoc_property_map(map), CGAL::Polygon_mesh_processing::parameters::all_default());
PMP::connected_components(g, boost::make_assoc_property_map(map), CGAL::parameters::all_default());
Adapter fg(g, 0, boost::make_assoc_property_map(map));
vertex_iterator vb, ve;
std::size_t count = 0;
@ -121,7 +129,7 @@ void test_out_edges(const Graph& g)
typedef CGAL::Face_filtered_graph<Graph> Adapter;
CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
std::map<g_face_descriptor, std::size_t> map;
CGAL::Polygon_mesh_processing::connected_components(g, boost::make_assoc_property_map(map), CGAL::Polygon_mesh_processing::parameters::all_default());
PMP::connected_components(g, boost::make_assoc_property_map(map), CGAL::parameters::all_default());
Adapter fg(g, 0, boost::make_assoc_property_map(map));
vertex_iterator vb, ve;
@ -150,7 +158,7 @@ void test_in_edges(const Graph& g)
typedef CGAL::Face_filtered_graph<Graph> Adapter;
CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
std::map<g_face_descriptor, std::size_t> map;
CGAL::Polygon_mesh_processing::connected_components(g, boost::make_assoc_property_map(map), CGAL::Polygon_mesh_processing::parameters::all_default());
PMP::connected_components(g, boost::make_assoc_property_map(map), CGAL::parameters::all_default());
Adapter fg(g, 0, boost::make_assoc_property_map(map));
vertex_iterator vb, ve;
@ -177,7 +185,7 @@ void test_in_out_edges(const Graph& g)
typedef CGAL::Face_filtered_graph<Graph> Adapter;
CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
std::map<g_face_descriptor, std::size_t> map;
CGAL::Polygon_mesh_processing::connected_components(g, boost::make_assoc_property_map(map), CGAL::Polygon_mesh_processing::parameters::all_default());
PMP::connected_components(g, boost::make_assoc_property_map(map), CGAL::parameters::all_default());
Adapter fg(g, 0, boost::make_assoc_property_map(map));
// check that the sets of in out edges are the same
@ -219,7 +227,7 @@ void test_edge_find(const Graph& g)
typedef CGAL::Face_filtered_graph<Graph> Adapter;
CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
std::map<g_face_descriptor, std::size_t> map;
CGAL::Polygon_mesh_processing::connected_components(g, boost::make_assoc_property_map(map), CGAL::Polygon_mesh_processing::parameters::all_default());
PMP::connected_components(g, boost::make_assoc_property_map(map), CGAL::parameters::all_default());
Adapter fg(g, 0, boost::make_assoc_property_map(map));
typedef std::pair<edge_descriptor, bool> ret;
@ -243,7 +251,7 @@ void test_faces(const Graph& g)
typedef CGAL::Face_filtered_graph<Graph> Adapter;
CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
std::map<g_face_descriptor, std::size_t> map;
CGAL::Polygon_mesh_processing::connected_components(g, boost::make_assoc_property_map(map), CGAL::Polygon_mesh_processing::parameters::all_default());
PMP::connected_components(g, boost::make_assoc_property_map(map), CGAL::parameters::all_default());
Adapter fg(g, 0, boost::make_assoc_property_map(map));
unsigned int count = 0;
@ -262,6 +270,53 @@ void test_faces(const Graph& g)
assert(count == num_faces(fg));
}
template<typename Graph>
void test_index_property_maps(const Graph& g)
{
typedef CGAL::Face_filtered_graph<Graph> Adapter;
CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
typedef typename boost::graph_traits<Graph>::face_descriptor g_face_descriptor;
std::map<g_face_descriptor, std::size_t> map;
PMP::connected_components(g, boost::make_assoc_property_map(map), CGAL::parameters::all_default());
Adapter fg(g, -1, boost::make_assoc_property_map(map));
assert(is_empty(fg));
// Non const
typedef typename CGAL::GetInitializedVertexIndexMap<Adapter>::type VIMap;
VIMap vim = CGAL::get_initialized_vertex_index_map(fg);
assert(CGAL::BGL::internal::is_index_map_valid(vim, num_vertices(fg), vertices(fg)));
typedef typename CGAL::GetInitializedHalfedgeIndexMap<Adapter>::type HIMap;
HIMap him = CGAL::get_initialized_halfedge_index_map(fg);
assert(CGAL::BGL::internal::is_index_map_valid(him, num_halfedges(fg), halfedges(fg)));
typedef typename CGAL::GetInitializedFaceIndexMap<Adapter>::type FIMap;
FIMap fim = CGAL::get_initialized_face_index_map(fg);
assert(CGAL::BGL::internal::is_index_map_valid(fim, num_faces(fg), faces(fg)));
fg.set_selected_faces(0, boost::make_assoc_property_map(map));
assert(!is_empty(fg));
assert(CGAL::BGL::internal::is_index_map_valid(vim, num_vertices(fg), vertices(fg)));
assert(CGAL::BGL::internal::is_index_map_valid(him, num_halfedges(fg), halfedges(fg)));
assert(CGAL::BGL::internal::is_index_map_valid(fim, num_faces(fg), faces(fg)));
// Const
const Adapter cfg(g, 0, boost::make_assoc_property_map(map));
typedef typename CGAL::GetInitializedVertexIndexMap<Adapter>::const_type CVIMap;
CVIMap cvim = CGAL::get_initialized_vertex_index_map(cfg);
assert(CGAL::BGL::internal::is_index_map_valid(cvim, num_vertices(cfg), vertices(cfg)));
typedef typename CGAL::GetInitializedHalfedgeIndexMap<Adapter>::const_type CHIMap;
CHIMap chim = CGAL::get_initialized_halfedge_index_map(cfg);
assert(CGAL::BGL::internal::is_index_map_valid(chim, num_halfedges(cfg), halfedges(cfg)));
typedef typename CGAL::GetInitializedFaceIndexMap<Adapter>::const_type CFIMap;
CFIMap cfim = CGAL::get_initialized_face_index_map(cfg);
assert(CGAL::BGL::internal::is_index_map_valid(cfim, num_faces(cfg), faces(cfg)));
}
template<typename Graph>
void test_read(const Graph& g)
{
@ -270,7 +325,7 @@ void test_read(const Graph& g)
CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
std::map<g_face_descriptor, std::size_t> map;
CGAL::Polygon_mesh_processing::connected_components(g, boost::make_assoc_property_map(map), CGAL::Polygon_mesh_processing::parameters::all_default());
PMP::connected_components(g, boost::make_assoc_property_map(map), CGAL::parameters::all_default());
Adapter fg(g, 0, boost::make_assoc_property_map(map));
assert(fg.is_selection_valid());
assert(CGAL::is_valid_polygon_mesh(fg));
@ -292,6 +347,7 @@ test_graph_range(const std::vector<Graph>& graphs)
test_edge_iterators(p);
test_halfedge_around_face_iterator(p);
test_halfedge_around_vertex_iterator(p);
test_index_property_maps(p);
}
}
@ -356,7 +412,6 @@ struct Constraint : public boost::put_get_helper<bool,Constraint<Mesh, VertexPoi
template<class Mesh, class FCCMAP, class Adapter>
void test_mesh(Adapter fga)
{
CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
//check that there is the right number of simplices in fga
CGAL_assertion(CGAL::is_valid_polygon_mesh(fga));
@ -365,31 +420,23 @@ void test_mesh(Adapter fga)
CGAL_assertion(num_halfedges(fga) == 10);
CGAL_assertion(num_vertices(fga) == 4);
halfedge_descriptor h = halfedge(*faces(fga).first, fga);
CGAL_assertion_code( vertex_descriptor v = source(h, fga) );
CGAL_assertion_code( vertex_descriptor v = source(h, fga));
//check that next() works inside the patch
CGAL_assertion(
next(next(next(h, fga), fga), fga) == h
);
CGAL_assertion(next(next(next(h, fga), fga), fga) == h);
//check that next() works on bordure of the patch
h = opposite(h, fga);
CGAL_assertion(
next(next(next(next(h, fga), fga), fga), fga) == h
);
CGAL_assertion(next(next(next(next(h, fga), fga), fga), fga) == h);
//check that prev() works inside the patch
h = halfedge(*faces(fga).first, fga);
CGAL_assertion(
prev(prev(prev(h, fga), fga), fga) == h
);
CGAL_assertion(prev(prev(prev(h, fga), fga), fga) == h);
//check that prev() works on bordure of the patch
h = opposite(h, fga);
CGAL_assertion(
prev(prev(prev(prev(h, fga), fga), fga), fga) == h
);
CGAL_assertion(prev(prev(prev(prev(h, fga), fga), fga), fga) == h);
//check degree
CGAL_assertion(degree(v, fga) == 3);
//check in_edges and out_edges
CGAL_assertion(std::distance(in_edges(v, fga).first ,in_edges(v, fga).second) == 3 );
CGAL_assertion(std::distance(out_edges(v, fga).first ,out_edges(v, fga).second) == 3 );
CGAL_assertion(std::distance(in_edges(v, fga).first ,in_edges(v, fga).second) == 3);
CGAL_assertion(std::distance(out_edges(v, fga).first ,out_edges(v, fga).second) == 3);
Mesh copy;
CGAL::copy_face_graph(fga, copy);
@ -454,7 +501,7 @@ int main()
{
test_graph_range(poly_data());
#if defined(CGAL_USE_SURFACE_MESH)
#ifdef CGAL_USE_SURFACE_MESH
test_graph_range(sm_data());
#endif
@ -464,64 +511,47 @@ int main()
test_invalid_selections();
//Make a tetrahedron and test the adapter for a patch that only contains 2 faces
// Make a tetrahedron and test the adapter for a patch that only contains 2 faces
typedef CGAL::Face_filtered_graph<SM> SM_Adapter;
typedef SM::Property_map<boost::graph_traits<SM>::face_descriptor , std::size_t> SM_FCCMap;
auto sm = std::make_unique<SM>();
CGAL::make_tetrahedron(
Point_3(1,1,1),
Point_3(0,0,0),
Point_3(0,0,1),
Point_3(1,0,1),
*sm);
SM_FCCMap fccmap =
sm->add_property_map<boost::graph_traits<SM>::face_descriptor, std::size_t>("f:CC").first;
SM::Property_map<boost::graph_traits<SM>::vertex_descriptor, SM::Point> positions =
sm->points();
CGAL::Polygon_mesh_processing::connected_components(*sm, fccmap, CGAL::Polygon_mesh_processing::parameters::
edge_is_constrained_map(Constraint<SM, SM::Property_map<boost::graph_traits<SM>::vertex_descriptor,
SM::Point> >(*sm, positions)));
CGAL::make_tetrahedron(Point_3(1,1,1), Point_3(0,0,0), Point_3(0,0,1), Point_3(1,0,1), *sm);
SM_FCCMap fccmap = sm->add_property_map<boost::graph_traits<SM>::face_descriptor, std::size_t>("f:CC").first;
SM::Property_map<boost::graph_traits<SM>::vertex_descriptor, SM::Point> positions = sm->points();
CGAL::Polygon_mesh_processing::connected_components(
*sm, fccmap, CGAL::parameters::edge_is_constrained_map(Constraint<SM, SM::Property_map<boost::graph_traits<SM>::vertex_descriptor,
SM::Point> >(*sm, positions)));
boost::unordered_set<long unsigned int> pids;
pids.insert(0);
pids.insert(2);
SM_Adapter sm_adapter(*sm, pids, fccmap);
test_mesh<SM,SM_FCCMap, SM_Adapter>(sm_adapter);
typedef boost::graph_traits<Polyhedron> PolyTraits;
typedef boost::property_map<Polyhedron, boost::vertex_point_t>::const_type VPMap;
typedef PolyTraits::face_descriptor poly_face_descriptor;
typedef boost::associative_property_map< std::map<poly_face_descriptor,
PolyTraits::faces_size_type> > FCMap;
typedef boost::associative_property_map<std::map<poly_face_descriptor, PolyTraits::faces_size_type> > FCMap;
typedef boost::property_map<Polyhedron, CGAL::face_external_index_t>::const_type FIMap;
typedef boost::property_map<Polyhedron, CGAL::vertex_external_index_t>::const_type VIMap;
typedef boost::property_map<Polyhedron, CGAL::halfedge_external_index_t>::const_type HIMap;
typedef CGAL::Face_filtered_graph<Polyhedron, FIMap, VIMap, HIMap> Poly_Adapter;
auto poly = std::make_unique<Polyhedron>();
CGAL::make_tetrahedron(
Point_3(1,1,1),
Point_3(0,0,0),
Point_3(0,0,1),
Point_3(1,0,1),
*poly);
auto poly = std::make_unique<Polyhedron>();
CGAL::make_tetrahedron(Point_3(1,1,1), Point_3(0,0,0), Point_3(0,0,1), Point_3(1,0,1), *poly);
FIMap poly_fimap = get(CGAL::face_external_index, *poly);
VIMap poly_vimap = get(CGAL::vertex_external_index, *poly);
HIMap poly_himap = get(CGAL::halfedge_external_index, *poly);
std::map<poly_face_descriptor,
PolyTraits::faces_size_type> fc_map;
std::map<poly_face_descriptor, PolyTraits::faces_size_type> fc_map;
FCMap poly_fccmap(fc_map);
VPMap vpmap = get(boost::vertex_point, *poly);
CGAL::Polygon_mesh_processing::connected_components(*poly, poly_fccmap,
CGAL::Polygon_mesh_processing::parameters::edge_is_constrained_map(Constraint<Polyhedron, VPMap >(*poly, vpmap))
.face_index_map(poly_fimap));
Poly_Adapter poly_adapter(*poly,
pids,
poly_fccmap,
PMP::connected_components(*poly, poly_fccmap,
CGAL::parameters::edge_is_constrained_map(Constraint<Polyhedron, VPMap >(*poly, vpmap))
.face_index_map(poly_fimap));
Poly_Adapter poly_adapter(*poly, pids, poly_fccmap,
CGAL::parameters::face_index_map(poly_fimap)
.vertex_index_map(poly_vimap)
.halfedge_index_map(poly_himap));

View File

@ -84,7 +84,7 @@ Orientation orientation();
/*!
This operator imports a general polygon from the input stream `in`.
Both ASCII and binary formats are supported, and the format is automatically detected.
Both \ascii and binary formats are supported, and the format is automatically detected.
The format consists of the number of points of the outer boundary followed
by the points themselves in counterclockwise order, followed by the number of holes,
@ -100,11 +100,11 @@ std::istream& operator>>(std::istream& in, CGAL::General_polygon_2<ArrTraits>& P
/*!
This operator exports a general polygon to the output stream `out`.
An ASCII and a binary format exist. The format can be selected with
An \ascii and a binary format exist. The format can be selected with
the \cgal modifiers for streams, `set_ascii_mode` and `set_binary_mode`
respectively. The modifier `set_pretty_mode` can be used to allow for (a
few) structuring comments in the output. Otherwise, the output would
be free of comments. The default for writing is ASCII without
be free of comments. The default for writing is \ascii without
comments.
The number of curves of the outer boundary is exported followed by the

View File

@ -474,10 +474,9 @@ is_crossover_outer_boundary(const typename Traits_2::Polygon_with_holes_2& pgn,
return is_crossover_outer_boundary(pgn, traits, pl);
}
// previously known as Simple
template <typename Traits_2>
bool is_relatively_simple_polygon_with_holes
(const typename Traits_2::Polygon_with_holes_2& pgn, const Traits_2& traits)
bool is_relatively_simple_polygon
(const typename Traits_2::Polygon_2& pgn, const Traits_2& traits)
{
typedef typename Traits_2::Curve_const_iterator Curve_const_iterator;
typedef std::pair<Curve_const_iterator,Curve_const_iterator>
@ -487,11 +486,10 @@ bool is_relatively_simple_polygon_with_holes
typedef typename Traits_2::X_monotone_curve_2 X_monotone_curve_2;
typedef Gps_polygon_validation_visitor<Traits_2> Visitor;
typedef Ss2::Surface_sweep_2<Visitor> Surface_sweep;
typedef typename Traits_2::Polygon_with_holes_2 Polygon_with_holes_2;
Construct_curves_2 construct_curves_func = traits.construct_curves_2_object();
// Construct a container of all outer boundary curves.
Cci_pair itr_pair = construct_curves_func (pgn.outer_boundary());
Cci_pair itr_pair = construct_curves_func (pgn);
std::list<X_monotone_curve_2> outer_curves;
std::copy(itr_pair.first, itr_pair.second, std::back_inserter(outer_curves));
// Create visitor and sweep to verify outer boundary is relatively simple
@ -502,31 +500,51 @@ bool is_relatively_simple_polygon_with_holes
switch (relative_visitor.error_code()) {
case Visitor::ERROR_NONE: break;
case Visitor::ERROR_EDGE_INTERSECTION:
CGAL_warning_msg(false, "The outer boundary self intersects at edges.");
CGAL_warning_msg(false, "Polygon self intersects at edges.");
break;
case Visitor::ERROR_EDGE_VERTEX_INTERSECTION:
CGAL_warning_msg(false, "The outer boundary self (weakly) intersects.");
CGAL_warning_msg(false, "Polygon self (weakly) intersects.");
break;
case Visitor::ERROR_EDGE_OVERLAP:
CGAL_warning_msg(false, "The outer boundary self overlaps.");
CGAL_warning_msg(false, "Polygon self overlaps.");
break;
case Visitor::ERROR_VERTEX_INTERSECTION:
CGAL_warning_msg(false, "The outer boundary self intersects at vertices.");
CGAL_warning_msg(false, "Polygon self intersects at vertices.");
break;
}
return false;
}
return true;
}
// previously known as Simple
template <typename Traits_2>
bool is_relatively_simple_polygon_with_holes
(const typename Traits_2::Polygon_with_holes_2& pgn, const Traits_2& traits)
{
bool outer_is_relatively_simple = is_relatively_simple_polygon(pgn.outer_boundary(), traits);
if (!outer_is_relatively_simple)
{
CGAL_warning_msg(false, "Outer boundary is not relatively simple.");
return false;
}
// Verify every hole is simple
typedef typename Traits_2::X_monotone_curve_2 X_monotone_curve_2;
typedef typename Traits_2::Polygon_with_holes_2 Polygon_with_holes_2;
typename Polygon_with_holes_2::Hole_const_iterator hoit;
std::list<X_monotone_curve_2> hole_curves;
for (hoit = pgn.holes_begin(); hoit != pgn.holes_end(); ++hoit) {
bool simple_hole = is_simple_polygon(*hoit, traits);
if (!simple_hole)
bool relatively_simple_hole = is_relatively_simple_polygon(*hoit, traits);
if (!relatively_simple_hole)
{
CGAL_warning_msg(false, "A hole is not relatively simple.");
return false;
}
}
return true;
}

View File

@ -21,8 +21,7 @@ typedef Traits_2::Polygon_2 Polygon_2;
typedef Traits_2::Polygon_with_holes_2 Polygon_with_holes_2;
/* test files:
* 1. test1.dat---invalid polygon with holes. The hole is relatively simple
* instead of strictly simple.
* 1. test1.dat---valid polygon with holes. The hole is relatively simple.
* 2. test2.dat---invalid polygon with holes. The hole overlaps the outer
* boundary (the intersection results in a polygon).
* 3. test3.dat---invalid polygon with holes. Two holes intersect (the

View File

@ -847,7 +847,7 @@ operator >> ( std::istream& is, CGAL::Min_annulus_d<Traits_>& min_annulus)
case CGAL::IO::PRETTY:
cerr << endl;
cerr << "Stream must be in ascii or binary mode" << endl;
cerr << "Stream must be in ASCII or binary mode" << endl;
break;
case CGAL::IO::ASCII:

View File

@ -309,7 +309,7 @@ operator >> ( std::istream& is,
case CGAL::IO::PRETTY:
std::cerr << std::endl;
std::cerr << "Stream must be in ascii or binary mode" << std::endl;
std::cerr << "Stream must be in ASCII or binary mode" << std::endl;
break;
case CGAL::IO::ASCII:

View File

@ -348,7 +348,7 @@ operator >> ( std::istream& is,
case CGAL::IO::PRETTY:
std::cerr << std::endl;
std::cerr << "Stream must be in ascii or binary mode" << std::endl;
std::cerr << "Stream must be in ASCII or binary mode" << std::endl;
break;
case CGAL::IO::ASCII:

View File

@ -77,7 +77,7 @@ operator >> ( std::istream& is, CGAL::Min_circle_2<Traits_>& min_circle)
case CGAL::IO::PRETTY:
cerr << endl;
cerr << "Stream must be in ascii or binary mode" << endl;
cerr << "Stream must be in ASCII or binary mode" << endl;
break;
case CGAL::IO::ASCII:

View File

@ -60,7 +60,7 @@ operator >> ( std::istream& is, CGAL::Optimisation_circle_2<K_>& c)
case CGAL::IO::PRETTY:
std::cerr << std::endl;
std::cerr << "Stream must be in ascii or binary mode" << std::endl;
std::cerr << "Stream must be in ASCII or binary mode" << std::endl;
break;
case CGAL::IO::ASCII: {

View File

@ -378,7 +378,7 @@ operator >> ( std::istream& is,
case CGAL::IO::PRETTY:
std::cerr << std::endl;
std::cerr << "Stream must be in ascii or binary mode" << std::endl;
std::cerr << "Stream must be in ASCII or binary mode" << std::endl;
break;
case CGAL::IO::ASCII:

View File

@ -386,7 +386,7 @@ operator >> ( std::istream& is,
case CGAL::IO::PRETTY:
std::cerr << std::endl;
std::cerr << "Stream must be in ascii or binary mode" << std::endl;
std::cerr << "Stream must be in ASCII or binary mode" << std::endl;
break;
case CGAL::IO::ASCII:

View File

@ -77,7 +77,7 @@ operator >> ( std::istream& is, CGAL::Min_ellipse_2<Traits_>& min_ellipse)
case CGAL::IO::PRETTY:
cerr << endl;
cerr << "Stream must be in ascii or binary mode" << endl;
cerr << "Stream must be in ASCII or binary mode" << endl;
break;
case CGAL::IO::ASCII:

View File

@ -79,7 +79,7 @@ operator >> ( std::istream& is, CGAL::Optimisation_ellipse_2<K_>& e)
case CGAL::IO::PRETTY:
std::cerr << std::endl;
std::cerr << "Stream must be in ascii or binary mode" << std::endl;
std::cerr << "Stream must be in ASCII or binary mode" << std::endl;
break;
case CGAL::IO::ASCII:

View File

@ -77,7 +77,7 @@ operator >> ( std::istream& is, Min_sphere_d<Traits>& min_sphere)
case IO::PRETTY:
std::cerr << std::endl;
std::cerr << "Stream must be in ascii or binary mode" << std::endl;
std::cerr << "Stream must be in ASCII or binary mode" << std::endl;
break;
case IO::ASCII:

View File

@ -93,7 +93,7 @@ typedef enum {
typedef enum {
/** data are binary */
DM_BINARY,
/** data are ascii */
/** data are \ascii */
DM_ASCII
} DATA_MODE;

View File

@ -88,7 +88,7 @@ exemple :
-a age (entier)
-s sexe (1/2)
-l lateralite
-txt texte libre (ascii)
-txt texte libre (ASCII)
-endtxt (fin du texte)

View File

@ -109,19 +109,19 @@ int writeGis( char *name, _image* im) {
switch( im->wordKind ) {
default :
fprintf(stderr, "writeGis: such word kind not handled in ascii mode for file \'%s\'\n", outputName);
fprintf(stderr, "writeGis: such word kind not handled in ASCII mode for file \'%s\'\n", outputName);
if ( outputName != nullptr ) ImageIO_free( outputName );
return( -3 );
case WK_FIXED :
switch ( im->wdim ) {
default :
fprintf(stderr, "writeGis: such word dim not handled in ascii mode for file \'%s\'\n", outputName);
fprintf(stderr, "writeGis: such word dim not handled in ASCII mode for file \'%s\'\n", outputName);
if ( outputName != nullptr ) ImageIO_free( outputName );
return( -3 );
case 1 :
switch ( im->sign ) {
default :
fprintf(stderr, "writeGis: such sign not handled in ascii mode for file \'%s\'\n", outputName);
fprintf(stderr, "writeGis: such sign not handled in ASCII mode for file \'%s\'\n", outputName);
if ( outputName != nullptr ) ImageIO_free( outputName );
return( -3 );
case SGN_UNSIGNED :
@ -169,7 +169,7 @@ int writeGis( char *name, _image* im) {
case 2 :
switch ( im->sign ) {
default :
fprintf(stderr, "writeGis: such sign not handled in ascii mode for file \'%s\'\n", outputName);
fprintf(stderr, "writeGis: such sign not handled in ASCII mode for file \'%s\'\n", outputName);
if ( outputName != nullptr ) ImageIO_free( outputName );
return( -3 );
case SGN_UNSIGNED :
@ -502,7 +502,7 @@ int readGisHeader( const char* name,_image* im)
/* read data if ascii
/* read data if ASCII
only U8 and S8
*/
if ( im->dataMode == DM_ASCII ) {
@ -512,7 +512,7 @@ int readGisHeader( const char* name,_image* im)
int ret, iv=0;
if ( im->wdim != 1 || im->wordKind != WK_FIXED ) {
fprintf(stderr, "readGisHeader: error: unable to read such ascii type\n" );
fprintf(stderr, "readGisHeader: error: unable to read such ASCII type\n" );
return -1;
}
@ -550,7 +550,7 @@ int readGisHeader( const char* name,_image* im)
}
if ( ret != 1 ) {
fprintf( stderr, "readGisHeader: error in reading ascii data\n" );
fprintf( stderr, "readGisHeader: error in reading ASCII data\n" );
ImageIO_free( im->data ); im->data = nullptr;
ImageIO_free( str );
return -1;

View File

@ -366,7 +366,7 @@ int readPgmAsciiImage(const char *name,_image *im)
switch ( im->wordKind ) {
case WK_FIXED :
if ( sscanf( tmp, "%d", &iv ) != 1 ) {
fprintf( stderr, "readAsciiPgmImage: error in reading ascii data\n" );
fprintf( stderr, "readAsciiPgmImage: error in reading ASCII data\n" );
ImageIO_free( im->data ); im->data = nullptr;
return 0;
}

View File

@ -84,6 +84,7 @@ struct VTK_type_generator<boost::uint32_t> {
typedef vtkUnsignedIntArray ArrayType;
};
inline
::vtkImageData* vtk_image_sharing_same_data_pointer(Image_3& image)
{
vtkImageData* vtk_image = vtkImageData::New();

View File

@ -2741,6 +2741,7 @@ namespace CartesianKernelFunctors {
{
typedef typename K::FT FT;
typedef typename K::Point_2 Point_2;
typedef typename K::Segment_2 Segment_2;
public:
typedef Point_2 result_type;
@ -2752,6 +2753,17 @@ namespace CartesianKernelFunctors {
midpointC2(p.x(), p.y(), q.x(), q.y(), x, y);
return construct_point_2(x, y);
}
Point_2
operator()(const Segment_2& s) const
{
typename K::Construct_point_2 construct_point_2;
FT x, y;
const Point_2& p = s.source();
const Point_2& q = s.target();
midpointC2(p.x(), p.y(), q.x(), q.y(), x, y);
return construct_point_2(x, y);
}
};
template <typename K>
@ -2759,6 +2771,7 @@ namespace CartesianKernelFunctors {
{
typedef typename K::FT FT;
typedef typename K::Point_3 Point_3;
typedef typename K::Segment_3 Segment_3;
public:
typedef Point_3 result_type;
@ -2770,6 +2783,17 @@ namespace CartesianKernelFunctors {
midpointC3(p.x(), p.y(), p.z(), q.x(), q.y(), q.z(), x, y, z);
return construct_point_3(x, y, z);
}
Point_3
operator()(const Segment_3& s) const
{
const Point_3& p = s.source();
const Point_3& q = s.target();
typename K::Construct_point_3 construct_point_3;
FT x, y, z;
midpointC3(p.x(), p.y(), p.z(), q.x(), q.y(), q.z(), x, y, z);
return construct_point_3(x, y, z);
}
};
template <typename K>

View File

@ -232,7 +232,7 @@ union yyalloc
/* Copy COUNT objects from FROM to TO. The source and destination do
not overlap. */
# ifndef YYCOPY
# if defined (__GNUC__) && 1 < __GNUC__
# if (__GNUC__ > 0)
# define YYCOPY(To, From, Count) \
__builtin_memcpy (To, From, (Count) * sizeof (*(From)))
# else

View File

@ -227,7 +227,7 @@ cases where many labels are used (more than five).
An [example](\ref Classification_example_ethz_random_forest) shows how to
use this classifier. For more details about the algorithm, please refer
to README provided in the [ETH Zurich's code archive](https://www.ethz.ch/content/dam/ethz/special-interest/baug/igp/photogrammetry-remote-sensing-dam/documents/sourcecode-and-datasets/Random%20Forest/rforest.zip).
to README provided in the [ETH Zurich's code archive](https://ethz.ch/content/dam/ethz/special-interest/baug/igp/photogrammetry-remote-sensing-dam/documents/sourcecode-and-datasets/Random%20Forest/rforest.zip).
\subsubsection Classification_ETHZ_random_forest_deprecated Deprecated IO

View File

@ -324,7 +324,7 @@ public:
/// @{
/*!
\brief converts a deprecated configuration (in compressed ASCII
\brief converts a deprecated configuration (in compressed \ascii
format) to a new configuration (in binary format).
The input file should be a GZIP container written by the

View File

@ -333,7 +333,7 @@ public:
/// @{
/*!
\brief outputs the evaluation in a simple ASCII format to the stream `os`.
\brief outputs the evaluation in a simple \ascii format to the stream `os`.
*/
friend std::ostream& operator<< (std::ostream& os, const Evaluation& evaluation)
{

View File

@ -692,11 +692,7 @@ public:
}
// Write property tree to XML file
boost::property_tree::write_xml(output, tree,
#if BOOST_VERSION >= 105600
boost::property_tree::xml_writer_make_settings<std::string>(' ', 3));
#else
boost::property_tree::xml_writer_make_settings<char>(' ', 3));
#endif
}
/*!

View File

@ -55,7 +55,7 @@
#endif
#include <boost/config.hpp>
#if (BOOST_GCC >= 40900)
#if defined(BOOST_GCC)
_Pragma("GCC diagnostic push")
_Pragma("GCC diagnostic ignored \"-Warray-bounds\"")
#endif
@ -4824,7 +4824,7 @@ namespace CGAL {
} // namespace CGAL
#if (BOOST_GCC >= 40900)
#if defined(BOOST_GCC)
_Pragma("GCC diagnostic pop")
#endif

View File

@ -19,7 +19,7 @@
#include <bitset>
#include <boost/config.hpp>
#if (BOOST_GCC >= 40900)
#if defined(BOOST_GCC)
_Pragma("GCC diagnostic push")
_Pragma("GCC diagnostic ignored \"-Warray-bounds\"")
#endif
@ -439,7 +439,7 @@ namespace CGAL {
} // namespace CGAL
#if (BOOST_GCC >= 40900)
#if defined(BOOST_GCC)
_Pragma("GCC diagnostic pop")
#endif

View File

@ -109,42 +109,25 @@ class Reflex_vertex_searcher : public Modifier_base<typename Nef_::SNC_structure
int is_reflex_vertex(Vertex_handle vi) {
int result = 0;
SM_point_locator PL(&*vi);
Object_handle op(PL.locate(dir));
Object_handle on(PL.locate(dir.antipode()));
Object_handle o[2] = {PL.locate(dir), PL.locate(dir.antipode())};
bool markedsf[2];
SFace_handle sfp, sfn;
markedsf[0] = assign(sfp, op) && sfp->mark();
markedsf[1] = assign(sfn, on) && sfn->mark();
for(int i=0; i<2; ++i) {
SFace_handle sf;
bool markedsf = assign(sf, o[i]) && sf->mark();
CGAL_NEF_TRACEN("markedsf " << markedsf[0] << " " << markedsf[1]);
CGAL_NEF_TRACEN("sf " << &*sfp << "==" << &*sfn);
CGAL_NEF_TRACEN("markedsf " << markedsf);
CGAL_NEF_TRACEN("sf " << &*sf);
if(markedsf[0]) {
SFace_cycle_iterator sfci(sfp->sface_cycles_begin());
for(; sfci != sfp->sface_cycles_end(); ++sfci) {
SHalfedge_around_sface_circulator
sfc(sfci), send(sfc);
CGAL_For_all(sfc, send) {
int isrse = is_reflex_sedge<SNC_structure>(sfc, dir, false);
if(isrse==0) continue;
// if(!markedsf[1] || sfp!=sfn)
isrse&=1;
result |= isrse;
}
}
}
if(/*sfp!=sfn &&*/ markedsf[1]) {
SFace_cycle_iterator sfci(sfn->sface_cycles_begin());
for(; sfci != sfn->sface_cycles_end(); ++sfci) {
SHalfedge_around_sface_circulator
sfc(sfci), send(sfc);
CGAL_For_all(sfc, send) {
int isrse = is_reflex_sedge<SNC_structure>(sfc, dir, false);
if(isrse==0) continue;
isrse&=2;
result |= isrse;
if(markedsf) {
SFace_cycle_iterator sfci(sf->sface_cycles_begin());
for(; sfci != sf->sface_cycles_end(); ++sfci) {
SHalfedge_around_sface_circulator sfc(sfci), send(sfc);
CGAL_For_all(sfc, send) {
int isrse = is_reflex_sedge<SNC_structure>(sfc, dir, false);
if(isrse == 0) continue;
isrse &= (i + 1);
result |= isrse;
}
}
}
}

View File

@ -322,7 +322,7 @@ employing the authors) of this work, a pointer to the file containing its text i
<LI>\$URL\$ : canonical path to the file on github,
<LI>\$Id\$ : the release version the file is from.
</UL>
<LI> Then [SPDX license identifier](https://spdx.org/). For GPL-3+ it should be `SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial`,
<LI> Then [SPDX license identifier](https://spdx.dev/). For GPL-3+ it should be `SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial`,
and `SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial` for LGPL-3+.
<LI>Then the authors of (non-negligible parts of) this file are listed, with
optional affiliation or e-mail address.

View File

@ -16,7 +16,7 @@ The following pages cover advanced installation options:
- \subpage configurationvariables gives information about which CMake variables can be used to help
resolve missing dependencies while using the cmake command line tool.
- \subpage installation describes the deprecated process of configuring and building \cgal.
- \subpage installation describes the process of configuring and installing \cgal.
The following pages cover the structure of the manual and general information about \cgal:

View File

@ -33,8 +33,11 @@ are:
If the macro `CGAL_HAS_THREADS` is not defined, then \cgal assumes it can use
any thread-unsafe code (such as static variables). By default, this macro is not
defined, unless `BOOST_HAS_THREADS` or `_OPENMP` is defined. It is possible
to force its definition on the command line, and it is possible to prevent its default
definition by setting `CGAL_HAS_NO_THREADS` from the command line.
to force its definition in the compiler options, and it is possible to prevent its
default definition by defining the macro `CGAL_HAS_NO_THREADS`.
If you are using CMake, then you can set the CMake option `CGAL_HAS_NO_THREADS` to
`TRUE`. In addition to defining the preprocessor macro CGAL_HAS_NO_THREADS`, it will
also avoid CMake to link with the native threads support library on your system.
\section Preliminaries_cc0x C++14 Support

View File

@ -10,25 +10,25 @@ supporting <a href="https://isocpp.org/wiki/faq/cpp14">C++14</a> or later.
\cgal \cgalReleaseNumber is supported (continuously tested) for the following compilers/operating systems:
| Operating System | Compiler |
| :------- | :--------------- |
| Linux | \gnu `g++` 6.3 or later\cgalFootnote{<A HREF="http://gcc.gnu.org/">`http://gcc.gnu.org/`</A>} |
| | `Clang` \cgalFootnote{<A HREF="http://clang.llvm.org/">`http://clang.llvm.org/`</A>} compiler version 8.0.0 |
| \ms Windows | \gnu `g++` 6.3 or later\cgalFootnote{<A HREF="http://gcc.gnu.org/">`http://gcc.gnu.org/`</A>} |
| | \ms Visual `C++` 14.0, 15.9, 16.0 (\visualstudio 2015, 2017, and 2019)\cgalFootnote{<A HREF="https://visualstudio.microsoft.com/">`https://visualstudio.microsoft.com/`</A>} |
| MacOS X | \gnu `g++` 6.3 or later\cgalFootnote{<A HREF="http://gcc.gnu.org/">`http://gcc.gnu.org/`</A>} |
| | Apple `Clang` compiler versions 7.0.2 and 10.0.1 |
| :---------- | :--------------- |
| Linux | \gnu `g++` 8.3 or later\cgalFootnote{<A HREF="http://gcc.gnu.org/">`http://gcc.gnu.org/`</A>} |
| | `Clang` \cgalFootnote{<A HREF="http://clang.llvm.org/">`http://clang.llvm.org/`</A>} compiler version 11.1.0 |
| \ms Windows | \gnu `g++` 8.3 or later\cgalFootnote{<A HREF="http://gcc.gnu.org/">`http://gcc.gnu.org/`</A>} |
| | \ms Visual `C++` 14.0, 15.9, 16.10 (\visualstudio 2015, 2017, and 2019)\cgalFootnote{<A HREF="https://visualstudio.microsoft.com/">`https://visualstudio.microsoft.com/`</A>} |
| MacOS X | \gnu `g++` 8.3 or later\cgalFootnote{<A HREF="http://gcc.gnu.org/">`http://gcc.gnu.org/`</A>} |
| | Apple `Clang` compiler versions 10.0.1 and 12.0.0 |
<!-- Windows supported version are also listed on windows.html (must change both) -->
Older versions of the above listed compilers might work, but no guarantee is provided.
\section seccmake CMake
<b>Version 3.12 or later</b>
<b>Version 3.14 or later</b>
In order to configure and build the \cgal examples, demos, or libraries,
you need <a href="https://cmake.org/">CMake</a>, a cross-platform "makefile generator".
This manual explains only the features of CMake which are needed in order to build \cgal.
This manual explains only the features of CMake which are needed in order to use \cgal.
Please refer to the <a href="https://cmake.org/documentation/">CMake documentation</a>
for further details.
@ -84,13 +84,13 @@ and for multi precision floating point numbers.
\cgal combines floating point arithmetic with exact arithmetic
in order to be efficient and reliable. \cgal has a built-in
number type for that, but \gmp and \mpfr provide a faster
solution, and we recommend to use them.
solution, and we recommend using them.
These libraries can be obtained from <A HREF="https://gmplib.org/">`https://gmplib.org/`</A>
and <A HREF="https://www.mpfr.org/">`https://www.mpfr.org/`</A>.
Since Visual \cpp is not properly supported by the \gmp and \mpfr projects,
we provide precompiled versions of \gmp and \mpfr, which can be downloaded with the installer
<a href="https://github.com/CGAL/cgal/releases">`CGAL-\cgalReleaseNumber``-Setup.exe`</a>.
we provide precompiled versions of \gmp and \mpfr, which can be downloaded
from the <a href="https://github.com/CGAL/cgal/releases">assets of a release</a>.
\section secoptional3rdpartysoftware Optional Third Party Libraries
@ -204,7 +204,7 @@ length integers, and for vectors, matrices, and polynomials over the
integers and over finite fields. The optional library \ntl is used by \cgal
to speed up operations of the Polynomial package, such as GCDs. It is recommended to install \ntl with support from \gmp.
\ntl can be downloaded from <A HREF="https://www.shoup.net/ntl/">`https://www.shoup.net/ntl/`</A>.
\ntl can be downloaded from <A HREF="https://libntl.org">`https://libntl.org`</A>.
\subsection thirdpartyESBTL ESBTL
@ -225,7 +225,7 @@ code. In order to use \tbb in \cgal programs, the executables
should be linked with the CMake imported target `CGAL::TBB_support`
provided in `CGAL_TBB_support.cmake`.
The \tbb web site is <A HREF="https://www.threadingbuildingblocks.org">`https://www.threadingbuildingblocks.org`</A>.
The \tbb web site is <A HREF="https://github.com/oneapi-src/oneTBB">`https://github.com/oneapi-src/oneTBB`</A>.
\subsection thirdpartyLASlib LASlib
@ -297,11 +297,8 @@ If you experience such an issue, we recommand to compile \ceres without `glog` s
\glpk (GNU Linear Programming Kit) is a library for solving linear programming (LP), mixed integer programming (MIP), and other related problems.
In \cgal, \glpk provides an optional linear integer program solver
in the \ref PkgPolygonalSurfaceReconstruction package. In order to use
\glpk in \cgal programs, the executables should be linked with the
CMake imported target `CGAL::GLPK_support` provided in
`CGAL_GLPK_support.cmake`.
In \cgal, \glpk provides an optional linear integer program solver in the \ref PkgPolygonalSurfaceReconstruction package.
In order to use \glpk in \cgal programs, the executables should be linked with the CMake imported target `CGAL::GLPK_support` provided in `CGAL_GLPK_support.cmake`.
The \glpk web site is <A HREF="https://www.gnu.org/software/glpk/">`https://www.gnu.org/software/glpk/`</A>.
@ -309,12 +306,18 @@ The \glpk web site is <A HREF="https://www.gnu.org/software/glpk/">`https://www.
\scip (Solving Constraint Integer Programs) is currently one of the fastest open source solvers for mixed integer programming (MIP) and mixed integer nonlinear programming (MINLP).
In \cgal, \scip provides an optional linear integer program solver
in the \ref PkgPolygonalSurfaceReconstruction package. In order to use
\scip in \cgal programs, the executables should be linked with the
CMake imported target `CGAL::SCIP_support` provided in
`CGAL_SCIP_support.cmake`.
In \cgal, \scip provides an optional linear integer program solver in the \ref PkgPolygonalSurfaceReconstruction package.
In order to use \scip in \cgal programs, the executables should be linked with the CMake imported target `CGAL::SCIP_support` provided in `CGAL_SCIP_support.cmake`.
The \scip web site is <A HREF="http://scip.zib.de/">`http://scip.zib.de/`</A>.
\subsection thirdpartyOSQP OSQP
\osqp (Operator Splitting Quadratic Program) is currently one of the fastest open source solvers for convex Quadratic Programs (QP).
In \cgal, \osqp provides an optional solver for the QP problems often arising in various computational geometry algorithms.
In order to use \osqp in \cgal programs, the executables should be linked with the CMake imported target `CGAL::OSQP_support` provided in `CGAL_OSQP_support.cmake`.
The \osqp web site is <A HREF="https://osqp.org">`https://osqp.org`</A>.
*/

View File

@ -308,7 +308,7 @@ there must be a global function `halfedges(const G&)`, etc.
An example for a concept with a required traits class is `InputIterator`.
For a model of an `InputIterator` a specialization of the class
<a href="http://en.cppreference.com/w/cpp/iterator/iterator_traits"> `std::iterator_traits`</a>
<a href="https://en.cppreference.com/w/cpp/iterator/iterator_traits"> `std::iterator_traits`</a>
must exist (or the generic template must be applicable).
\section intro_further Further Reading

View File

@ -166,12 +166,17 @@ if no debugging is intended. Users should thus run:
cd CGAL-\cgalReleaseNumber/examples/Triangulation_2
cmake -DCGAL_DIR=$HOME/CGAL-\cgalReleaseNumber -DCMAKE_BUILD_TYPE=Release . # we are here using a release tarball
Note that the package Qt on brew is "keg-only", which means it cannot be "linked" with brew.
You will have to specify the Qt5_DIR by hand to cmake, using something like
The package Qt5 on brew is "keg-only", which means it is not "linked" with brew.
In order to link against Qt5, you need to run:
-DQt5_DIR=/usr/local/opt/qt/lib/cmake/Qt5
brew link qt@5
where '/usr/local/` is actually your current brew installation directory.
After that, you will have to specify the Qt5_DIR by hand to cmake, using something like
-DQt5_DIR=/usr/local/opt/qt5/lib/cmake/Qt5
where '/usr/local/` is actually your current brew installation directory. Check this directory
to be sure where the Qt5 is placed on your machine.
\subsection usage_configuring_cmake_gui Specifying Missing Dependencies

View File

@ -19,7 +19,7 @@ summarized below are CMake variables.
\subsection installation_component_selection Component Selection
The following boolean variables indicate which \cgal components to
configure and build. Their values can be ON or OFF.
configure and/or build. Their values can be ON or OFF.
| Variable | %Default Value |

View File

@ -1,29 +1,29 @@
/*!
\page installation Building %CGAL libraries (non header-only mode)
\page installation Installing %CGAL libraries
\cgalAutoToc
\cgalAdvancedBegin
Since \cgal version 5.0, \cgal is header-only be default, which means
Since \cgal version 5.0, \cgal is header-only, which means
that there is no need to compile \cgal or its libraries before it can be used.
This page is for advanced users that have a good reason to still use the old way.
This page is for advanced users that either want to install CGAL on their system, or want to build the examples,
tests and demos that are shipped in a git branch, for example.
If this is not your case, head over back to the page \ref general_intro.
\cgalAdvancedEnd
This page is a step-by-step description of how to configure, build, and (optionally) install \cgal
in case you do not wish to use the - now enabled by default - header-only mode of \cgal.
This page is a step-by-step description of how to configure and install \cgal, and (optionally)
build examples, tests and demos.
It is assumed that you have downloaded a source archive of \cgal, and are using Linux or macOS.
\section installation_idealworld Quick Installation
Ideally, compiling and installing \cgal, as well as compiling some examples shipped by \cgal is as simple as:
Ideally, installing \cgal, as well as compiling some examples shipped by \cgal is as simple as:
cd $HOME/CGAL-\cgalReleaseNumber
mkdir build
cd build
cmake -DCGAL_HEADER_ONLY=OFF -DCMAKE_BUILD_TYPE=Release .. # configure CGAL
make # build CGAL
cmake .. # configure CGAL
make install # install CGAL
cd examples/Triangulation_2 # go to an example directory
cmake -DCGAL_DIR=$CMAKE_INSTALLED_PREFIX/lib/CGAL -DCMAKE_BUILD_TYPE=Release . # configure the examples
@ -34,12 +34,11 @@ This is what this page is about.
\section installation_configwithcmake Configuring CGAL with CMake
Before building \cgal, or anything using \cgal, you have to choose the compiler/linker,
set compiler and linker flags, specify which
third-party libraries you want to use and where they can be found, and
which \cgal libraries you want to build. Gathering
Before building anything using \cgal, you have to choose the compiler/linker,
set compiler and linker flags and specify which
third-party libraries you want to use and where they can be found. Gathering
all this information is called <I>configuration</I>.
The end of the process is marked by the generation of a makefile that you can use to build \cgal.
The end of the process is marked by the generation of a makefile that you can use to install \cgal.
CMake maintains configuration parameters in so-called <I>cmake variables</I>. Some of the CMake
variables represent user choices, such as `CMAKE_BUILD_TYPE`, while others
@ -51,25 +50,19 @@ and finally the configuration and build processes.
\subsection seclibraries CGAL Libraries
\cgal is split into four libraries. During configuration, you can select the libraries that
you would like to build by setting a CMake variable of the form <TT>WITH_<library></TT>. By default all
are switched `ON`. All activated libraries are to be built after configuration.
Note that some libraries have specific dependencies in addition to the essential ones. See the page
\cgal has some optional components. During configuration, you can select the components that
you would like to use by setting a CMake variable of the form <TT>WITH_<library></TT>. By default all
are switched `ON`, but some have specific dependencies in addition to the essential ones, so if you don't
need those, don't hesitate to switch them `OFF`.
See the page
\ref secessential3rdpartysoftware for more information.
| Library | CMake Variable | Functionality | Dependencies |
| Component | CMake Variable | Functionality | Dependencies |
| :-------- | :------------- | :------------ | :----------- |
| \cgal | none | Main library | \gmp, \mpfr, \boost (headers) |
| `CGAL_Core` | `WITH_CGAL_Core` | The %CORE library for algebraic numbers.\cgalFootnote{CGAL_Core is not part of \cgal, but a custom version of the \core library distributed by \cgal for the user convenience and it has it's own license.} | \gmp and \mpfr |
| `CGAL_ImageIO` | `WITH_CGAL_ImageIO` | Utilities to read and write image files | \zlib, \vtk (optional) |
| `CGAL_Qt5` | `WITH_CGAL_Qt5` | `QGraphicsView` support for \qt5-based demos | \qt5 |
Shared libraries, also called <I>dynamic-link libraries</I>, are built by default
(`.so` on Linux, `.dylib` on macOS). You
can choose to produce static libraries instead, by setting the CMake
variable `BUILD_SHARED_LIBS` to `FALSE`.
\subsection installation_examples CGAL Examples and Demos
\cgal is distributed with a large collection of examples and demos. By default, these are <B>not</B> configured along with
@ -84,7 +77,7 @@ might need these \cgal-libraries and thus their dependencies. See the page
\subsection installation_debugrelease Debug vs. Release
The CMake variable `CMAKE_BUILD_TYPE` indicates how to build the libraries.
The CMake variable `CMAKE_BUILD_TYPE` indicates how to build the executables.
It accepts the values `Debug` or `Release`. Note that the default value is `Debug`, since it is
default value in `CMake`. If you do not plan on debugging, it is important to set the variable
to `Release` for performance reasons.
@ -96,9 +89,8 @@ from within the IDE in this environment.
There are many more variables that can be used during configuration. The most important ones are:
<ul>
<li> `CMAKE_INSTALL_PREFIX=<dir>` installation directory [/usr/local]</li>
<li> `CMAKE_INSTALL_PREFIX=<dir>` installation directory [/usr/local]</li>
<li>`CMAKE_BUILD_TYPE=<Debug|Release>` build type [Release]</li>
<li>`BUILD_SHARED_LIBS=<TRUE|FALSE>` shared or static libraries [TRUE]</li>
<li>`CMAKE_C_COMPILER=<program>` C compiler [gcc]</li>
<li>`CMAKE_CXX_COMPILER=<program>` C++ compiler [g++]</li>
</ul>
@ -145,9 +137,6 @@ Providing information and pressing *Configure* goes on until
all entries are grayed. You are now ready to press *Generate*. Once this is
done, you can quit `cmake-gui`.
Since you intend to build CGAL libraries, you should also ensure that the variable
`CGAL_HEADER_ONLY` has not been set.
If you do not need to debug, you should set the variable `CMAKE_BUILD_TYPE` to `Release`.
\subsection installation_configuring_cmd Configuring CGAL with the cmake Command-Line Tool
@ -184,7 +173,7 @@ building of a program using \cgal, see Section \ref installation_buildprogram.
\section seccmakeoutofsource Multiple Builds
While you can choose between release or debug builds, and shared or static libraries,
While you can choose between release or debug builds,
it is not possible to generate different variants during a single configuration. You need to run CMake in a
different directory for each variant you are interested in, each with its own selection of configuration parameters.
@ -208,38 +197,23 @@ You can, for example, generate subdirectories `CGAL-\cgalReleaseNumber``/build/d
cd CGAL-\cgalReleaseNumber/build/release
cmake -DCMAKE_BUILD_TYPE=Release ../..
\section secbuilding Building CGAL
\subsection ssec_installation_build_ex_demos Building Examples and Demos
Let's assume that you have turned on the configuration of examples
(`-DWITH_examples=ON`) and/or demos (`-DWITH_demos=ON`).
The results of a successful configuration are build files that control the build step.
The nature of the build files depends on the generator used during configuration, but in all cases they
contain several <I>targets</I>, one per library, and a default global target corresponding
to all the libraries.
contain several <I>targets</I>, one per executable, and a default global target corresponding
to all of them (called `examples` and/or `demos`).
For example, in a \unix-like environment the default generator produces makefiles.
You can use the `make` command-line tool for the succeeding build step as follows:
# build all the selected libraries at once
make
# build all the selected examples at once
make examples
The resulting libraries are placed in the subdirectory `lib` under `<CMAKE_BINARY_DIR>`
(which is `CGAL-\cgalReleaseNumber` in case you run an in-source-configuration).
\cgalAdvancedBegin
The build files produced by CMake are autoconfigured. That
is, if you change any of the dependencies, the build step
automatically goes all the way back to the configuration step. This
way, once the target has been configured the very first time by
invoking cmake, you don't necessarily need to invoke `cmake`
again. Rebuilding will call itself `cmake` and re-generate the
build file whenever needed.
\cgalAdvancedEnd
\subsection ssec_installation_build_ex_demos Building Examples and Demos
If you have turned on the configuration of examples
(`-DWITH_examples=ON`) and/or demos (`-DWITH_demos=ON`), there will be additional
targets named `examples` and `demos`, plus one target for
each example and each demo in the build files.
None of these targets are included by default, so you need to build them explicitly
<I>after</I> the \cgal libraries have been successfully built.
The targets `examples` and `demos` include themselves all the targets
@ -259,6 +233,15 @@ If you are interested in the demos or examples of just a particular module, you
When using `UNIX Makefiles`, you can find out the exact name of the example or demo target
of a particular package by typing `make help | grep <package>`.
\cgalAdvancedBegin
The build files produced by CMake are autoconfigured. That
is, if you change any of the dependencies, the build step
automatically goes all the way back to the configuration step. This
way, once the target has been configured the very first time by
invoking cmake, you don't necessarily need to invoke `cmake`
again. Rebuilding will call itself `cmake` and re-generate the
build file whenever needed.
\cgalAdvancedEnd
\section secinstalling Installing CGAL
On many platforms, library pieces such as headers, docs and binaries
@ -266,10 +249,10 @@ are expected to be placed in specific locations. A typical example
being `/usr/include` and `/usr/lib`. The process
of placing or copying the library elements into its standard location
is sometimes referred to as <I>Installation</I> and it is a
postprocessing step after the build step.
postprocessing step after the configuration step.
CMake carries out the installation by producing a build target named <I>install</I>.
Assuming you have successfully configured and built \cgal as demonstrated in the previous sections,
Assuming you have successfully configured \cgal as demonstrated in the previous sections,
the installation simply amounts to:
# install CGAL
@ -283,7 +266,7 @@ variable explicitly <I>at the configuration time</I> and not when executing the
\cgalAdvancedEnd
The file `CGALConfig.cmake` is installed by default in
`$CMAKE_INSTALLED_PREFIX/lib/``CGAL-\cgalReleaseNumber`.
`$CMAKE_INSTALLED_PREFIX/lib/cmake/CGAL`.
\section installation_buildprogram Building a Program using CGAL
@ -305,7 +288,7 @@ the process of configuring a user's program called `your_program.cpp` amounts to
In order to configure a program, you need to indicate the location of the \cgal configuration file
in the CMake variable `CGAL_DIR` (as shown in the example above).
If you have installed \cgal, `CGAL_DIR` must afterwards be set to `$CMAKE_INSTALLED_PREFIX/lib/CGAL`.
If you have installed \cgal, `CGAL_DIR` must afterwards be set to `$CMAKE_INSTALLED_PREFIX/lib/cmake/CGAL`.
The variable `CGAL_DIR` can also be an environment variable, but setting it manually makes particular sense
if you have multiple out-of-source builds of \cgal as in Section \ref seccmakeoutofsource.

View File

@ -190,17 +190,6 @@ as this will help `cmake` to find Boost.</li>
<li>Add the path to the Boost `dlls` (`C:\dev\libboost_1_71_0\lib64-msvc-XX.Y`) files to the `PATH` environment variable.</li>
</ul>
\subsection ssect-installer-install-cgal Installing CGAL Itself
Download and run `CGAL-\cgalReleaseNumber``-Setup.exe` from
<a href="https://www.cgal.org/download/windows.html">https://www.cgal.org/download/windows.html</a>.
It is a self extracting executable that downloads the \cgal header files, and optionally the source code of the
examples and demos. Additionally, it can download the precompiled versions of \gmp and \mpfr. You must
specify if you want the 32 or the 64 bit versions of these two libraries.
Setting the environment variable `CGAL_DIR` to `C:\dev\CGAL-\cgalReleaseNumber` is a good idea
to help `cmake` to find \cgal during the configuration process, detailed in the next section.
\subsection ssect-installer-compile-example Compiling an Example
We assume that you have downloaded the examples with the \cgal Installer.
@ -245,8 +234,8 @@ A typical `Qt` installation would consist of the following steps:
<ul>
<li>
Download and install the Qt library for open source development package for your Visual Studio version at
<a href="https://www.qt.io/download/">https://www.qt.io/download/</a>
(here is the direct link to the <a href="https://www1.qt.io/offline-installers/">offline installers</a>).</li>
<a href="https://www.qt.io/download">https://www.qt.io/download</a>
(here is the direct link to the <a href="https://www.qt.io/offline-installers">offline installers</a>).</li>
<li>Add the environment variable `QTDIR` pointing to the place you installed Qt, e.g., `C:\dev\Qt\Qt5.13.1`,
as this will help `cmake` to find Qt.</li>
<li>Add the bin directory of Qt, e.g. add `C:\dev\Qt\Qt5.13.1\msvcXXXX_YY\bin` to `PATH`, where `XXXX_YY` is something like `vc2017_64`.

View File

@ -1339,7 +1339,6 @@ Teillaud"
,number = {ECG-TR-122201-01}
,address = {Sophia-Antipolis}
,month = may
,url = {ftp://ftp-sop.inria.fr/prisme/ECG/Reports/Month12/ECG-TR-122201-01.ps.gz}
}
@inproceedings{ cgal:ke-rctac-03
@ -2142,7 +2141,7 @@ ABSTRACT = {We present the first complete, exact and efficient C++ implementatio
,month = dec
,year = {2000}
,issn = {0946-011X}
,url = {https://www.mpi-sb.mpg.de/~mehlhorn/ftp/InfiFrames.ps}
,url = {https://people.mpi-inf.mpg.de/~mehlhorn/ftp/InfiFrames.ps}
}
@InProceedings{cgal:sp-mrbee-05
@ -2373,7 +2372,7 @@ location = {Salt Lake City, Utah, USA}
howpublished = {Stefan Walk (ETH Zurich, Department of Civil,
Environmental and Geomatic Engineering, Institute of
Geodesy and Photogrammetry)},
url = {http://www.prs.igp.ethz.ch/research/Source_code_and_datasets.html},
url = {https://prs.igp.ethz.ch/research/Source_code_and_datasets.html},
year = 2014
}

View File

@ -85653,7 +85653,7 @@ fitting method."
, title = "The {CORE} Library Project"
, edition = "1.2"
, year = 1999
, url = "https://cs.nyu.edu/exact/core/"
, url = "https://www.cs.nyu.edu/exact/doc/core.pdf"
, update = "00.03 devillers"
}
@ -152039,7 +152039,7 @@ pages = {179--189}
Booktitle = {53rd Annual IEEE Symposium on Foundations of Computer Science (FOCS)},
Year = {2012},
Pages = {440-449},
Url = {http://arxiv.org/abs/1110.4573}
Url = {https://arxiv.org/abs/1110.4573}
}
@article{cvl-ew-12,
@ -152050,4 +152050,14 @@ pages = {179--189}
Pages = {215--224},
Year = {2012},
Url = {http://monge.univ-mlv.fr/~colinde/pub/09edgewidth.pdf}
@inproceedings{tang2009interactive,
title={Interactive Hausdorff distance computation for general polygonal models},
author={Tang, Min and Lee, Minkyoung and Kim, Young J},
booktitle={ACM Transactions on Graphics (TOG)},
volume={28},
number={3},
pages={74},
year={2009},
organization={ACM}
}

View File

@ -237,6 +237,7 @@ ALIASES = "cgal=%CGAL" \
"iso=ISO" \
"lisp=Lisp" \
"ieee=IEEE" \
"ascii=ASCII" \
"exacus=Exacus" \
"mpir=MPIR" \
"mpfr=MPFR" \
@ -266,6 +267,7 @@ ALIASES = "cgal=%CGAL" \
"ceres=Ceres" \
"glpk=GLPK" \
"scip=SCIP" \
"osqp=OSQP" \
"rs=RS" \
"rs3=RS3" \
"unix=Unix" \

View File

@ -3,12 +3,13 @@
var url_re = /(cgal\.geometryfactory\.com\/CGAL\/doc\/|doc\.cgal\.org\/)(master|latest|(\d\.\d+|\d\.\d+\.\d+)(-beta\d)?)\//;
var url_local = /.*\/doc_output\//;
var current_version_local = '5.2'
var current_version_local = '5.3-beta1'
var all_versions = [
'master',
'5.2',
'5.3',
'latest',
'5.1.2',
'5.2.3',
'5.1.5',
'5.0.4',
'4.14.3',
'4.13.2',

View File

@ -235,10 +235,11 @@ ALIASES = "cgal=%CGAL" \
"stl=STL" \
"gmp=GMP" \
"gmpxx=GMPXX" \
"exacus=Exacus" \
"iso=ISO" \
"lisp=Lisp" \
"ieee=IEEE" \
"ascii=ASCII" \
"exacus=Exacus" \
"mpir=MPIR" \
"mpfr=MPFR" \
"leda=LEDA" \
@ -267,6 +268,7 @@ ALIASES = "cgal=%CGAL" \
"ceres=Ceres" \
"glpk=GLPK" \
"scip=SCIP" \
"osqp=OSQP" \
"rs=RS" \
"rs3=RS3" \
"unix=Unix" \

View File

@ -3,12 +3,13 @@
var url_re = /(cgal\.geometryfactory\.com\/CGAL\/doc\/|doc\.cgal\.org\/)(master|latest|(\d\.\d+|\d\.\d+\.\d+)(-beta\d)?)\//;
var url_local = /.*\/doc_output\//;
var current_version_local = '5.2'
var current_version_local = '5.3-beta1'
var all_versions = [
'master',
'5.2',
'5.3',
'latest',
'5.1.2',
'5.2.3',
'5.1.5',
'5.0.4',
'4.14.3',
'4.13.2',

View File

@ -257,10 +257,11 @@ ALIASES = "cgal=%CGAL" \
"stl=STL" \
"gmp=GMP" \
"gmpxx=GMPXX" \
"exacus=Exacus" \
"iso=ISO" \
"lisp=Lisp" \
"ieee=IEEE" \
"ascii=ASCII" \
"exacus=Exacus" \
"mpir=MPIR" \
"mpfr=MPFR" \
"leda=LEDA" \
@ -289,6 +290,7 @@ ALIASES = "cgal=%CGAL" \
"ceres=Ceres" \
"glpk=GLPK" \
"scip=SCIP" \
"osqp=OSQP" \
"rs=RS" \
"rs3=RS3" \
"unix=Unix" \

View File

@ -3,12 +3,13 @@
var url_re = /(cgal\.geometryfactory\.com\/CGAL\/doc\/|doc\.cgal\.org\/)(master|latest|(\d\.\d+|\d\.\d+\.\d+)(-beta\d)?)\//;
var url_local = /.*\/doc_output\//;
var current_version_local = '5.2'
var current_version_local = '5.3-beta1'
var all_versions = [
'master',
'5.2',
'5.3',
'latest',
'5.1.2',
'5.2.3',
'5.1.5',
'5.0.4',
'4.14.3',
'4.13.2',

View File

@ -206,6 +206,7 @@ ALIASES += "gmpxx=GMPXX"
ALIASES += "mpir=MPIR"
ALIASES += "mpfr=MPFR"
ALIASES += "exacus=Exacus"
ALIASES += "ascii=ASCII"
ALIASES += "iso=ISO"
ALIASES += "lisp=Lisp"
ALIASES += "ieee=IEEE"
@ -235,6 +236,7 @@ ALIASES += "zlib=zlib"
ALIASES += "ceres=Ceres"
ALIASES += "glpk=GLPK"
ALIASES += "scip=SCIP"
ALIASES += "osqp=OSQP"
ALIASES += "rs=RS"
ALIASES += "rs3=RS3"
ALIASES += "unix=Unix"

View File

@ -3,12 +3,13 @@
var url_re = /(cgal\.geometryfactory\.com\/CGAL\/doc\/|doc\.cgal\.org\/)(master|latest|(\d\.\d+|\d\.\d+\.\d+)(-beta\d)?)\//;
var url_local = /.*\/doc_output\//;
var current_version_local = '5.2'
var current_version_local = '5.3-beta1'
var all_versions = [
'master',
'5.2',
'5.3',
'latest',
'5.1.2',
'5.2.3',
'5.1.5',
'5.0.4',
'4.14.3',
'4.13.2',

View File

@ -161,7 +161,7 @@ def protect_accentuated_letters(authors):
try:
res.encode('ascii')
except UnicodeEncodeError:
stderr.write("WARNING: a non ascii character has been found in author string for bibtex (probably a non-handled accentuated letter)."
stderr.write("WARNING: a non-ASCII character has been found in author string for bibtex (probably a non-handled accentuated letter)."
"Check the new package added and update the function protect_accentuated_letters in Documentation/scripts/generate_how_to_cite.py\n\n")
return res

View File

@ -75,11 +75,7 @@ Filtered_predicate_with_state<EP,AP,C2E,C2A,O1,Protection>::
CGAL_BRANCH_PROFILER_BRANCH(tmp);
Protect_FPU_rounding<!Protection> p(CGAL_FE_TONEAREST);
if(! oep){
#if BOOST_VERSION < 105600
oep = EP(c2e(o1));
#else
oep.emplace(c2e(o1));
#endif
}
return (*oep)(c2e(args)...);
}

View File

@ -52,6 +52,9 @@
#include <type_traits>
#include <utility>
#include <vector>
#include <atomic>
#include <thread>
#include <mutex>
namespace CGAL {
@ -68,22 +71,12 @@ class Lazy_exact_nt;
template <typename AT, typename ET, typename E2A>
inline
const AT&
decltype(auto)
approx(const Lazy<AT,ET,E2A>& l)
{
return l.approx();
}
// Where is this one (non-const) needed ? Is it ?
template <typename AT, typename ET, typename E2A>
inline
AT&
approx(Lazy<AT,ET,E2A>& l)
{
return l.approx();
}
template <typename AT, typename ET, typename E2A>
inline
const ET&
@ -230,57 +223,245 @@ struct Depth_base {
#endif
};
template<class T, bool=std::is_base_of<Handle, T>::value> struct Lazy_reset_member_1 {
void operator()(T& t)const{ t = T(); }
};
template<class T> struct Lazy_reset_member_1<T, true> {
void operator()(T& t)const{ t.reset(); }
};
template<class T>void lazy_reset_member(T&t) {
Lazy_reset_member_1<T>()(t);
}
template<class...T, std::size_t...i>void lazy_reset_member_tuple(std::tuple<T...>&t, std::index_sequence<i...>) {
auto ignore = [](auto&&...){};
ignore ( (lazy_reset_member(std::get<i>(t)), 0) ... );
}
template<class...T>void lazy_reset_member(std::tuple<T...>&t) {
lazy_reset_member_tuple(t, std::make_index_sequence<sizeof...(T)>());
}
// 0: safe default, AT is behind a pointer that can be atomically changed, and it doesn't disappear during update_exact
// 1: use plain AT without protection
// 2: split an interval as 2 atomic_double
// FIXME: CGAL_USE_SSE2 is clearly not the right condition
#ifdef CGAL_HAS_THREADS
template<class AT>struct Lazy_rep_selector { static constexpr int value = 0; };
# if defined CGAL_USE_SSE2 && !defined __SANITIZE_THREAD__ && !__has_feature(thread_sanitizer)
template<bool b>struct Lazy_rep_selector<Interval_nt<b>> { static constexpr int value = 1; };
template<bool b, int N>struct Lazy_rep_selector<std::array<Interval_nt<b>,N>> { static constexpr int value = 1; };
// Need some declarations, including Simple_cartesian.h would also be possible.
template<class>struct Simple_cartesian;
template<class>class Point_2;
template<class>class Point_3;
template<bool b>struct Lazy_rep_selector<CGAL::Point_2<CGAL::Simple_cartesian<CGAL::Interval_nt<b>>>> { static constexpr int value = 1; };
template<bool b>struct Lazy_rep_selector<CGAL::Point_3<CGAL::Simple_cartesian<CGAL::Interval_nt<b>>>> { static constexpr int value = 1; };
# else
template<bool b>struct Lazy_rep_selector<Interval_nt<b>> { static constexpr int value = 2; };
# endif
#else
template<class AT>struct Lazy_rep_selector { static constexpr int value = 1; };
#endif
template<class AT>
struct AT_wrap {
AT at_;
AT_wrap():at_(){}
AT_wrap(AT const& a):at_(a){}
AT_wrap(AT&& a):at_(std::move(a)){}
AT const& at()const{return at_;}
};
// TODO: avoid initializing AT for nothing
template<class AT, class ET>
struct AT_ET_wrap : AT_wrap<AT> {
ET et_;
AT_ET_wrap():et_(){}
AT_ET_wrap(ET const& e):et_(e){}
AT_ET_wrap(ET&& e):et_(std::move(e)){}
template<class A, class E>AT_ET_wrap(A&&a, E&&e):AT_wrap<AT>(std::forward<A>(a)),et_(std::forward<E>(e)){}
ET const& et()const{return et_;}
};
// Abstract base class for lazy numbers and lazy objects
template <typename AT_, typename ET, typename E2A>
template <typename AT_, typename ET, typename E2A, int=Lazy_rep_selector<AT_>::value /* 0 */>
class Lazy_rep : public Rep, public Depth_base
{
Lazy_rep (const Lazy_rep&) = delete; // cannot be copied.
Lazy_rep& operator= (const Lazy_rep&) = delete; // cannot be copied.
public:
typedef AT_ AT;
typedef AT_ET_wrap<AT,ET> Indirect;
mutable AT at;
mutable ET *et;
AT_wrap<AT> at_orig{};
mutable std::atomic<AT_wrap<AT>*> ptr_ { &at_orig };
mutable std::once_flag once;
Lazy_rep ()
: at(), et(nullptr){}
Lazy_rep () {}
template<class A>
Lazy_rep (A&& a)
: at(std::forward<A>(a)), et(nullptr){}
: at_orig(std::forward<A>(a)){}
template<class A>
Lazy_rep (int count, A&& a)
: Rep(count), at(std::forward<A>(a)), et(nullptr){}
: Rep(count), at_orig(std::forward<A>(a)){}
template<class A, class E>
Lazy_rep (A&& a, E&& e)
: at(std::forward<A>(a)), et(new ET(std::forward<E>(e))) {}
: ptr_(new AT_ET_wrap<AT,ET>(std::forward<A>(a), std::forward<E>(e))) {}
const AT& approx() const
AT const& approx() const
{
return at;
return ptr_.load(std::memory_order_consume)->at();
}
AT& approx()
const ET & exact_unsafe() const
{
return at;
CGAL_assertion(!is_lazy());
return static_cast<AT_ET_wrap<AT,ET>*>(ptr_.load(std::memory_order_relaxed))->et();
}
const ET & exact() const
{
if (et==nullptr)
update_exact();
return *et;
// The test is unnecessary, only use it if benchmark says so, or in order to avoid calling Lazy_exact_Ex_Cst::update_exact() (which used to contain an assertion)
//if (is_lazy())
std::call_once(once, [this](){this->update_exact();});
return exact_unsafe(); // call_once already synchronized memory
}
ET & exact()
template<class A>
void set_at(AT_ET_wrap<AT,ET>* p, A&& a) const {
p->at_ = std::forward<A>(a);
}
void set_at(AT_ET_wrap<AT,ET>* p) const {
p->at_ = E2A()(p->et());
}
void keep_at(AT_ET_wrap<AT,ET>* p) const {
p->at_ = at_orig.at(); // do not move!
}
void set_ptr(AT_ET_wrap<AT,ET>* p) const {
ptr_.store(p, std::memory_order_release);
}
// I think we should have different code for cases where there is some cleanup to do (say, a sum of 2 Lazy_exact_nt) and for cases where there isn't (a Lazy_exact_nt constructed from a double), but it may require making exact() virtual. Objects can be hidden in a tuple in Lazy_rep_n, so checking if there is something to clean requires some code. It isn't clear if we also need to restrict that to cases where update_exact doesn't touch AT. The special version would be basically: if(et==0){pet=new ET(...);if(!et.exchange(0,pet))delete pet; update at?}
#ifdef CGAL_LAZY_KERNEL_DEBUG
void print_at_et(std::ostream& os, int level) const
{
if (et==nullptr)
update_exact();
return *et;
for(int i = 0; i < level; i++){
os << " ";
}
os << "Approximation: ";
print_at(os, approx());
os << std::endl;
if(! is_lazy()){
for(int i = 0; i < level; i++){
os << " ";
}
os << "Exact: ";
print_at(os, exact_unsafe());
os << std::endl;
#ifdef CGAL_LAZY_KERNEL_DEBUG_SHOW_TYPEID
for(int i = 0; i < level; i++){
os << " ";
}
os << " (type: " << typeid(exact_unsafe()).name() << ")" << std::endl;
#endif // CGAL_LAZY_KERNEL_DEBUG_SHOW_TYPEID
}
}
virtual void print_dag(std::ostream& os, int level) const {}
#endif
bool is_lazy() const { return ptr_.load(std::memory_order_relaxed) == &at_orig; }
virtual void update_exact() const = 0;
virtual ~Lazy_rep() {
#if !defined __SANITIZE_THREAD__ && !__has_feature(thread_sanitizer)
auto* p = ptr_.load(std::memory_order_relaxed);
if (p != &at_orig) {
std::atomic_thread_fence(std::memory_order_acquire);
delete static_cast<Indirect*>(p);
}
#else
auto* p = ptr_.load(std::memory_order_consume);
if (p != &at_orig) delete static_cast<Indirect*>(p);
#endif
}
};
/* How (un)safe is this? The goal is to minimize the overhead compared to a single-thread version by making the fast path almost identical.
* For scalars on x86_64, the interval is aligned, so load/store instructions will not slice any double (although Intel does not explicitly guarantee it). On recent hardware, they should even be atomic, although without an official guarantee, and we don't need 128-bit atomicity anyway. The main danger is the unpredictable optimizations a compiler could apply (volatile would disable most of them, but it doesn't seem great), including replacing load/store with memcpy, where I fear some implementation/hardware combinations might slice sometimes. Making Interval_nt a pair of atomic_double would avoid this problem, but would likely incur a penalty since compilers don't optimize atomics much, and we shouldn't need to store/load all the time (TODO: benchmark).
* For aggregate-like types (Simple_cartesian::Point_3), it should be ok for the same reason.
* This is definitely NOT safe for a std::vector like a Point_d with Dynamic_dimension_tag, so it should only be enabled on a case by case basis, if at all. Storing a Point_3 piecewise with 6 atomic_double would be doable, but painful, and I didn't benchmark to check the performance. */
template <typename AT_, typename ET, typename E2A>
class Lazy_rep<AT_, ET, E2A, 1> : public Rep, public Depth_base
{
Lazy_rep (const Lazy_rep&) = delete; // cannot be copied.
Lazy_rep& operator= (const Lazy_rep&) = delete; // cannot be copied.
public:
typedef AT_ AT;
typedef ET Indirect;
mutable AT at;
mutable std::atomic<ET*> ptr_ { nullptr };
#ifdef CGAL_HAS_THREADS
mutable std::once_flag once;
#endif
Lazy_rep () {}
template<class A>
Lazy_rep (A&& a)
: at(std::forward<A>(a)) {}
template<class A>
Lazy_rep (int count, A&& a)
: Rep(count), at(std::forward<A>(a)){}
template<class A, class E>
Lazy_rep (A&& a, E&& e)
: at(std::forward<A>(a)), ptr_(new ET(std::forward<E>(e))) {}
AT const& approx() const
{
return at;
}
template<class A>
void set_at(ET*, A&& a) const {
at = std::forward<A>(a);
}
void set_at(ET* p) const {
set_at(p, E2A()(*p));
}
void keep_at(ET*) const { }
const ET & exact_unsafe() const
{
return *ptr_.load(std::memory_order_relaxed);
}
const ET & exact() const
{
#ifdef CGAL_HAS_THREADS
// The test is unnecessary, only use it if benchmark says so, or in order to avoid calling Lazy_exact_Ex_Cst::update_exact() (which used to contain an assertion)
//if (is_lazy())
std::call_once(once, [this](){this->update_exact();});
#else
if (is_lazy())
this->update_exact();
#endif
return exact_unsafe(); // call_once already synchronized memory
}
void set_ptr(ET* p) const {
ptr_.store(p, std::memory_order_release);
}
#ifdef CGAL_LAZY_KERNEL_DEBUG
@ -290,20 +471,20 @@ public:
os << " ";
}
os << "Approximation: ";
print_at(os, at);
print_at(os, approx());
os << std::endl;
if(! is_lazy()){
for(int i = 0; i < level; i++){
os << " ";
}
os << "Exact: ";
print_at(os, *et);
print_at(os, exact_unsafe());
os << std::endl;
#ifdef CGAL_LAZY_KERNEL_DEBUG_SHOW_TYPEID
for(int i = 0; i < level; i++){
os << " ";
}
os << " (type: " << typeid(*et).name() << ")" << std::endl;
os << " (type: " << typeid(exact_unsafe()).name() << ")" << std::endl;
#endif // CGAL_LAZY_KERNEL_DEBUG_SHOW_TYPEID
}
}
@ -311,16 +492,131 @@ public:
virtual void print_dag(std::ostream& os, int level) const {}
#endif
bool is_lazy() const { return et == nullptr; }
bool is_lazy() const { return ptr_.load(std::memory_order_relaxed) == nullptr; }
virtual void update_exact() const = 0;
virtual ~Lazy_rep() { delete et; }
virtual ~Lazy_rep() {
#if !defined __SANITIZE_THREAD__ && !__has_feature(thread_sanitizer)
auto* p = ptr_.load(std::memory_order_relaxed);
if (p != nullptr) {
std::atomic_thread_fence(std::memory_order_acquire);
delete p;
}
#else
auto* p = ptr_.load(std::memory_order_consume);
if (p != nullptr) delete p;
#endif
}
};
// do we need to (forward) declare Interval_nt?
template <bool b, typename ET, typename E2A>
class Lazy_rep<Interval_nt<b>, ET, E2A, 2> : public Rep, public Depth_base
{
Lazy_rep (const Lazy_rep&) = delete; // cannot be copied.
Lazy_rep& operator= (const Lazy_rep&) = delete; // cannot be copied.
public:
typedef Interval_nt<b> AT;
typedef ET Indirect;
mutable std::atomic<double> x, y; // -inf, +sup
mutable std::atomic<ET*> ptr_ { nullptr };
mutable std::once_flag once;
Lazy_rep () {}
Lazy_rep (AT a)
: x(-a.inf()), y(a.sup()) {}
template<class E>
Lazy_rep (AT a, E&& e)
: x(-a.inf()), y(a.sup()), ptr_(new ET(std::forward<E>(e))) {}
AT approx() const
{
return AT(-x.load(std::memory_order_relaxed), y.load(std::memory_order_relaxed));
}
void set_at(ET*, AT a) const {
x.store(-a.inf(), std::memory_order_relaxed);
y.store(a.sup(), std::memory_order_relaxed);
}
void set_at(ET* p) const {
set_at(p, E2A()(*p));
}
void keep_at(ET*) const { }
const ET & exact_unsafe() const
{
return *ptr_.load(std::memory_order_relaxed);
}
const ET & exact() const
{
// The test is unnecessary, only use it if benchmark says so, or in order to avoid calling Lazy_exact_Ex_Cst::update_exact() (which used to contain an assertion)
//if (is_lazy())
std::call_once(once, [this](){this->update_exact();});
return exact_unsafe(); // call_once already synchronized memory
}
void set_ptr(ET* p) const {
ptr_.store(p, std::memory_order_release);
}
// I think we should have different code for cases where there is some cleanup to do (say, a sum of 2 Lazy_exact_nt) and for cases where there isn't (a Lazy_exact_nt constructed from a double). Objects can be hidden in a tuple in Lazy_rep_n, so checking if there is something to clean requires some code. It isn't clear if we also need to restrict that to cases where update_exact doesn't touch AT. The special version would be basically: if(et==0){pet=new ET(...);if(!et.exchange(0,pet))delete pet; update at?}
#ifdef CGAL_LAZY_KERNEL_DEBUG
void print_at_et(std::ostream& os, int level) const
{
for(int i = 0; i < level; i++){
os << " ";
}
os << "Approximation: ";
print_at(os, approx());
os << std::endl;
if(! is_lazy()){
for(int i = 0; i < level; i++){
os << " ";
}
os << "Exact: ";
print_at(os, exact_unsafe());
os << std::endl;
#ifdef CGAL_LAZY_KERNEL_DEBUG_SHOW_TYPEID
for(int i = 0; i < level; i++){
os << " ";
}
os << " (type: " << typeid(exact_unsafe()).name() << ")" << std::endl;
#endif // CGAL_LAZY_KERNEL_DEBUG_SHOW_TYPEID
}
}
virtual void print_dag(std::ostream& os, int level) const {}
#endif
bool is_lazy() const { return ptr_.load(std::memory_order_relaxed) == nullptr; }
virtual void update_exact() const = 0;
virtual ~Lazy_rep() {
#if !defined __SANITIZE_THREAD__ && !__has_feature(thread_sanitizer)
auto* p = ptr_.load(std::memory_order_relaxed);
if (p != nullptr) {
std::atomic_thread_fence(std::memory_order_acquire);
delete p;
}
#else
auto* p = ptr_.load(std::memory_order_consume);
if (p != nullptr) delete p;
#endif
}
};
template<typename AT, typename ET, typename AC, typename EC, typename E2A, typename...L>
class Lazy_rep_n :
template<typename AT, typename ET, typename AC, typename EC, typename E2A, bool noprune, typename...L>
class Lazy_rep_n final :
public Lazy_rep< AT, ET, E2A >, private EC
{
typedef Lazy_rep< AT, ET, E2A > Base;
// Lazy_rep_0 does not inherit from EC or take a parameter AC. It has different constructors.
static_assert(sizeof...(L)>0, "Use Lazy_rep_0 instead");
template <class Ei, class Ai, class E2Ai, class Ki> friend class Lazy_kernel_base;
@ -328,9 +624,11 @@ class Lazy_rep_n :
const EC& ec() const { return *this; }
template<std::size_t...I>
void update_exact_helper(std::index_sequence<I...>) const {
this->et = new ET(ec()( CGAL::exact( std::get<I>(l) ) ... ) );
this->at = E2A()(*(this->et));
l = std::tuple<L...>{};
auto* p = new typename Base::Indirect(ec()( CGAL::exact( std::get<I>(l) ) ... ) );
this->set_at(p);
this->set_ptr(p);
if(!noprune || is_currently_single_threaded())
lazy_reset_member(l);
}
public:
void update_exact() const {
@ -358,7 +656,7 @@ class Lazy_rep_n :
}
public:
void print_dag(std::ostream& os, int level) const {
print_dag_helper(os, level, std::make_index_sequence<sizeof...L>{});
print_dag_helper(os, level, std::make_index_sequence<sizeof...(L)>{});
}
#endif
};
@ -377,9 +675,11 @@ class Lazy_rep_optional_n :
template<std::size_t...I>
void update_exact_helper(std::index_sequence<I...>) const {
this->et = new ET( * ec()( CGAL::exact( std::get<I>(l) ) ... ) );
this->at = E2A()(*(this->et));
l = std::tuple<L...>{};
typedef Lazy_rep< AT, ET, E2A > Base;
auto* p = new typename Base::Indirect( * ec()( CGAL::exact( std::get<I>(l) ) ... ) );
this->set_at(p);
this->set_ptr(p);
lazy_reset_member(l);
}
public:
@ -420,7 +720,7 @@ class Lazy_rep_optional_n :
public:
void print_dag(std::ostream& os, int level) const {
print_dag_helper(os, level, std::make_index_sequence<sizeof...L>{});
print_dag_helper(os, level, std::make_index_sequence<sizeof...(L)>{});
}
#endif
};
@ -429,7 +729,7 @@ class Lazy_rep_optional_n :
// The rep for the leaf node
template <typename AT, typename ET, typename E2A>
class Lazy_rep_0 : public Lazy_rep<AT, ET, E2A>
class Lazy_rep_0 final : public Lazy_rep<AT, ET, E2A>
{
typedef Lazy_rep<AT, ET, E2A> Base;
@ -438,12 +738,23 @@ public:
void
update_exact() const
{
this->et = new ET();
#ifdef CGAL_HAS_THREADS
// Unless we add is_lazy before call_once in Lazy_rep. This test is
// necessary because this class can be used either for default
// construction, or to store a non-lazy exact value, and only the first one
// should have a non-empty update_exact.
// An alternative would be to add in the constructors taking an ET: std::call_once(this->once, [](){});
if(!this->is_lazy()) return;
#endif
auto* p = new typename Base::Indirect();
this->set_ptr(p);
}
Lazy_rep_0()
: Lazy_rep<AT,ET, E2A>() {}
// TODO: the case where the exact value is provided at construction should
// actually use a different class from the lazy default construction.
template<class A, class E>
Lazy_rep_0(A&& a, E&& e)
: Lazy_rep<AT,ET,E2A>(std::forward<A>(a), std::forward<E>(e)) {}
@ -486,7 +797,7 @@ struct Approx_converter
//typedef Converter Number_type_converter;
template < typename T >
const typename T::AT&
decltype(auto)
operator()(const T&t) const
{ return t.approx(); }
@ -511,7 +822,7 @@ struct Exact_converter
//typedef Converter Number_type_converter;
template < typename T >
const typename T::ET&
decltype(auto)
operator()(const T&t) const
{ return t.exact(); }
@ -533,7 +844,7 @@ struct Exact_converter
template <typename AC, typename EC, typename E2A, typename L1>
class Lazy_rep_with_vector_1
class Lazy_rep_with_vector_1 final
: public Lazy_rep<std::vector<Object>, std::vector<Object>, E2A>
, private EC
{
@ -550,22 +861,21 @@ public:
void
update_exact() const
{
// TODO : This looks really unfinished...
auto* p = new typename Base::Indirect();
// TODO : This looks really unfinished...
std::vector<Object> vec;
this->et = new ET();
//this->et->reserve(this->at.size());
ec()(CGAL::exact(l1_), std::back_inserter(*(this->et)));
if(this->et==nullptr)
E2A()(*(this->et));
this->at = E2A()(*(this->et));
ec()(CGAL::exact(l1_), std::back_inserter(p->et_));
this->set_at(p);
this->set_ptr(p);
// Prune lazy tree
l1_ = L1();
lazy_reset_member(l1_);
}
Lazy_rep_with_vector_1(const AC& ac, const EC& /*ec*/, const L1& l1)
: l1_(l1)
{
ac(CGAL::approx(l1), std::back_inserter(this->at));
ac(CGAL::approx(l1), std::back_inserter(this->at_orig.at_));
}
#ifdef CGAL_LAZY_KERNEL_DEBUG
@ -573,7 +883,7 @@ public:
print_dag(std::ostream& os, int level) const
{
this->print_at_et(os, level);
os << "A Lazy_rep_with_vector_1 of size " << this->at.size() << std::endl;
os << "A Lazy_rep_with_vector_1 of size " << this->approx().size() << std::endl;
if(this->is_lazy()){
CGAL::msg(os, level, "DAG with one child node:");
CGAL::print_dag(l1_, os, level+1);
@ -585,7 +895,7 @@ public:
template <typename AC, typename EC, typename E2A, typename L1, typename L2>
class Lazy_rep_with_vector_2
class Lazy_rep_with_vector_2 final
: public Lazy_rep<std::vector<Object>, std::vector<Object>, E2A>
, private EC
{
@ -603,19 +913,20 @@ public:
void
update_exact() const
{
this->et = new ET();
this->et->reserve(this->at.size());
ec()(CGAL::exact(l1_), CGAL::exact(l2_), std::back_inserter(*(this->et)));
this->at = E2A()(*(this->et));
auto* p = new typename Base::Indirect();
p->et_.reserve(this->at_orig.at().size());
ec()(CGAL::exact(l1_), CGAL::exact(l2_), std::back_inserter(p->et_));
this->set_at(p);
this->set_ptr(p);
// Prune lazy tree
l1_ = L1();
l2_ = L2();
lazy_reset_member(l1_);
lazy_reset_member(l2_);
}
Lazy_rep_with_vector_2(const AC& ac, const EC& /*ec*/, const L1& l1, const L2& l2)
: l1_(l1), l2_(l2)
{
ac(CGAL::approx(l1), CGAL::approx(l2), std::back_inserter(this->at));
ac(CGAL::approx(l1), CGAL::approx(l2), std::back_inserter(this->at_orig.at_));
}
#ifdef CGAL_LAZY_KERNEL_DEBUG
@ -623,7 +934,7 @@ public:
print_dag(std::ostream& os, int level) const
{
this->print_at_et(os, level);
os << "A Lazy_rep_with_vector_2 of size " << this->at.size() << std::endl;
os << "A Lazy_rep_with_vector_2 of size " << this->approx().size() << std::endl;
if(this->is_lazy()){
CGAL::msg(os, level, "DAG with two child nodes:");
CGAL::print_dag(l1_, os, level+1);
@ -635,7 +946,7 @@ public:
template <typename AC, typename EC, typename E2A, typename L1, typename L2, typename R1>
class Lazy_rep_2_1
class Lazy_rep_2_1 final
: public Lazy_rep<typename R1::AT, typename R1::ET, E2A>
, private EC
{
@ -653,18 +964,19 @@ public:
void
update_exact() const
{
this->et = new ET();
ec()(CGAL::exact(l1_), CGAL::exact(l2_), *(this->et));
this->at = E2A()(*(this->et));
auto* p = new typename Base::Indirect();
ec()(CGAL::exact(l1_), CGAL::exact(l2_), p->et_);
this->set_at(p);
this->set_ptr(p);
// Prune lazy tree
l1_ = L1();
l2_ = L2();
lazy_reset_member(l1_);
lazy_reset_member(l2_);
}
Lazy_rep_2_1(const AC& ac, const EC& /*ec*/, const L1& l1, const L2& l2)
: Lazy_rep<AT,ET,E2A>(), l1_(l1), l2_(l2)
{
ac(CGAL::approx(l1), CGAL::approx(l2), this->at);
ac(CGAL::approx(l1), CGAL::approx(l2), this->at_orig.at_);
}
#ifdef CGAL_LAZY_KERNEL_DEBUG
@ -687,7 +999,7 @@ public:
// The following rep class stores two non-const reference parameters of type R1 and R2
template <typename AC, typename EC, typename E2A, typename L1, typename L2, typename R1, typename R2>
class Lazy_rep_2_2
class Lazy_rep_2_2 final
: public Lazy_rep<std::pair<typename R1::AT,typename R2::AT>, std::pair<typename R1::ET, typename R2::ET>, E2A>
, private EC
{
@ -705,18 +1017,19 @@ public:
void
update_exact() const
{
this->et = new ET();
ec()(CGAL::exact(l1_), CGAL::exact(l2_), this->et->first, this->et->second );
this->at = E2A()(*(this->et));
auto* p = new typename Base::Indirect();
ec()(CGAL::exact(l1_), CGAL::exact(l2_), p->et_.first, p->et_.second );
this->set_at(p);
this->set_ptr(p);
// Prune lazy tree
l1_ = L1();
l2_ = L2();
lazy_reset_member(l1_);
lazy_reset_member(l2_);
}
Lazy_rep_2_2(const AC& ac, const EC& /*ec*/, const L1& l1, const L2& l2)
: Lazy_rep<AT,ET,E2A>(), l1_(l1), l2_(l2)
{
ac(CGAL::approx(l1), CGAL::approx(l2), this->at.first, this->at.second);
ac(CGAL::approx(l1), CGAL::approx(l2), this->at_orig.at_.first, this->at_orig.at_.second);
}
#ifdef CGAL_LAZY_KERNEL_DEBUG
@ -807,18 +1120,12 @@ public :
friend void swap(Lazy& a, Lazy& b) noexcept
{ swap(static_cast<Handle&>(a), static_cast<Handle&>(b)); }
const AT& approx() const
decltype(auto) approx() const
{ return ptr()->approx(); }
const ET& exact() const
{ return ptr()->exact(); }
AT& approx()
{ return ptr()->approx(); }
ET& exact()
{ return ptr()->exact(); }
unsigned depth() const
{
return ptr()->depth();
@ -904,7 +1211,8 @@ struct Lazy_construction_optional_for_polygonal_envelope
CGAL_STATIC_THREAD_LOCAL_VARIABLE_0(LazyPointRep, rep);
const typename AK::Point_3 ap = *oap;
rep = LazyPointRep(2,ap, ec, l1, l2, l3);
// rep = LazyPointRep(2,ap, ec, l1, l2, l3);
rep.~LazyPointRep(); new (&rep) LazyPointRep(2, ap, ec, l1, l2, l3);
typename LK::Point_3 lp(&rep);
return boost::make_optional(lp);
@ -942,7 +1250,8 @@ struct Lazy_construction_optional_for_polygonal_envelope
CGAL_STATIC_THREAD_LOCAL_VARIABLE_0(LazyPointRep, rep);
const typename AK::Point_3 ap = *oap;
rep = LazyPointRep(2, ap, ec, l1, l2);
// rep = LazyPointRep(2, ap, ec, l1, l2);
rep.~LazyPointRep(); new (&rep) LazyPointRep(2, ap, ec, l1, l2);
typename LK::Point_3 lp(&rep);
return boost::make_optional(lp);
@ -988,7 +1297,7 @@ struct Lazy_construction_nt {
CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp);
Protect_FPU_rounding<Protection> P;
try {
return new Lazy_rep_n<AT, ET, AC, EC, To_interval<ET>, L... >(ac, ec, l...);
return new Lazy_rep_n<AT, ET, AC, EC, To_interval<ET>, false, L... >(ac, ec, l...);
} catch (Uncertain_conversion_exception&) {
CGAL_BRANCH_PROFILER_BRANCH(tmp);
Protect_FPU_rounding<!Protection> P2(CGAL_FE_TONEAREST);
@ -1277,8 +1586,8 @@ public:
typedef Lazy<std::pair<typename R1::AT, typename R2::AT>, std::pair<typename R1::ET, typename R2::ET>, E2A> Lazy_pair;
Lazy_pair lv(new Lazy_rep_2_2<AC, EC, E2A, L1, L2, R1, R2>(ac, ec, l1, l2));
// lv->approx() is a std::pair<R1::AT, R2::AT>;
r1 = R1(Handle_1(new Lazy_rep_n<void, void, First<std::pair<typename R1::AT, typename R2::AT> >, First<std::pair<typename R1::ET, typename R2::ET> >, E2A, Lazy_pair>(First<std::pair<typename R1::AT, typename R2::AT> >(), First<std::pair<typename R1::ET, typename R2::ET> >(), lv)));
r2 = R2(Handle_2(new Lazy_rep_n<void, void, Second<std::pair<typename R1::AT, typename R2::AT> >, Second<std::pair<typename R1::ET, typename R2::ET> >, E2A, Lazy_pair>(Second<std::pair<typename R1::AT, typename R2::AT> >(), Second<std::pair<typename R1::ET, typename R2::ET> >(), lv)));
r1 = R1(Handle_1(new Lazy_rep_n<void, void, First<std::pair<typename R1::AT, typename R2::AT> >, First<std::pair<typename R1::ET, typename R2::ET> >, E2A, false, Lazy_pair>(First<std::pair<typename R1::AT, typename R2::AT> >(), First<std::pair<typename R1::ET, typename R2::ET> >(), lv)));
r2 = R2(Handle_2(new Lazy_rep_n<void, void, Second<std::pair<typename R1::AT, typename R2::AT> >, Second<std::pair<typename R1::ET, typename R2::ET> >, E2A, false, Lazy_pair>(Second<std::pair<typename R1::AT, typename R2::AT> >(), Second<std::pair<typename R1::ET, typename R2::ET> >(), lv)));
} catch (Uncertain_conversion_exception&) {
CGAL_BRANCH_PROFILER_BRANCH(tmp);
Protect_FPU_rounding<!Protection> P2(CGAL_FE_TONEAREST);
@ -1325,7 +1634,7 @@ public:
// FIXME : I'm not sure how this work...
#define CGAL_Kernel_obj(X) if (object_cast<typename AK::X>(& (lv.approx()[i]))) { \
*it++ = make_object(typename LK::X(new Lazy_rep_n<typename AK::X, typename EK::X, Ith<typename AK::X>, \
Ith<typename EK::X>, E2A, Lazy_vector> \
Ith<typename EK::X>, E2A, false, Lazy_vector> \
(Ith<typename AK::X>(i), Ith<typename EK::X>(i), lv))); \
continue; \
}
@ -1396,14 +1705,14 @@ public:
CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp);
Protect_FPU_rounding<Protection> P;
try {
Lazy_object lo(new Lazy_rep_n<result_type, result_type, AC, EC, E2A, L1>(ac, ec, l1));
Lazy_object lo(new Lazy_rep_n<result_type, result_type, AC, EC, E2A, false, L1>(ac, ec, l1));
if(lo.approx().is_empty())
return Object();
#define CGAL_Kernel_obj(X) \
if (object_cast<typename AK::X>(& (lo.approx()))) { \
typedef Lazy_rep_n< typename AK::X, typename EK::X, Object_cast<typename AK::X>, Object_cast<typename EK::X>, E2A, Lazy_object> Lcr; \
typedef Lazy_rep_n< typename AK::X, typename EK::X, Object_cast<typename AK::X>, Object_cast<typename EK::X>, E2A, false, Lazy_object> Lcr; \
Lcr * lcr = new Lcr(Object_cast<typename AK::X>(), Object_cast<typename EK::X>(), lo); \
return make_object(typename LK::X(lcr)); \
}
@ -1429,14 +1738,14 @@ public:
CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp);
Protect_FPU_rounding<Protection> P;
try {
Lazy_object lo(new Lazy_rep_n<result_type, result_type, AC, EC, E2A, L1, L2>(ac, ec, l1, l2));
Lazy_object lo(new Lazy_rep_n<result_type, result_type, AC, EC, E2A, false, L1, L2>(ac, ec, l1, l2));
if(lo.approx().is_empty())
return Object();
#define CGAL_Kernel_obj(X) \
if (object_cast<typename AK::X>(& (lo.approx()))) { \
typedef Lazy_rep_n<typename AK::X, typename EK::X, Object_cast<typename AK::X>, Object_cast<typename EK::X>, E2A, Lazy_object> Lcr; \
typedef Lazy_rep_n<typename AK::X, typename EK::X, Object_cast<typename AK::X>, Object_cast<typename EK::X>, E2A, false, Lazy_object> Lcr; \
Lcr * lcr = new Lcr(Object_cast<typename AK::X>(), Object_cast<typename EK::X>(), lo); \
return make_object(typename LK::X(lcr)); \
}
@ -1453,7 +1762,7 @@ public:
V.resize(v_ptr->size()); \
for (unsigned int i = 0; i < v_ptr->size(); i++) { \
V[i] = typename LK::X(new Lazy_rep_n<typename AK::X, typename EK::X, Ith_for_intersection<typename AK::X>, \
Ith_for_intersection<typename EK::X>, E2A, Lazy_object> \
Ith_for_intersection<typename EK::X>, E2A, false, Lazy_object> \
(Ith_for_intersection<typename AK::X>(i), Ith_for_intersection<typename EK::X>(i), lo)); \
} \
return make_object(V); \
@ -1483,14 +1792,14 @@ CGAL_Kernel_obj(Point_3)
CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp);
Protect_FPU_rounding<Protection> P;
try {
Lazy_object lo(new Lazy_rep_n<result_type, result_type, AC, EC, E2A, L1, L2, L3>(ac, ec, l1, l2, l3));
Lazy_object lo(new Lazy_rep_n<result_type, result_type, AC, EC, E2A, false, L1, L2, L3>(ac, ec, l1, l2, l3));
if(lo.approx().is_empty())
return Object();
#define CGAL_Kernel_obj(X) \
if (object_cast<typename AK::X>(& (lo.approx()))) { \
typedef Lazy_rep_n<typename AK::X, typename EK::X, Object_cast<typename AK::X>, Object_cast<typename EK::X>, E2A, Lazy_object> Lcr; \
typedef Lazy_rep_n<typename AK::X, typename EK::X, Object_cast<typename AK::X>, Object_cast<typename EK::X>, E2A, false, Lazy_object> Lcr; \
Lcr * lcr = new Lcr(Object_cast<typename AK::X>(), Object_cast<typename EK::X>(), lo); \
return make_object(typename LK::X(lcr)); \
}
@ -1561,7 +1870,7 @@ struct Fill_lazy_variant_visitor_2 : boost::static_visitor<> {
typedef typename Type_mapper<AKT, AK, EK>::type EKT;
typedef typename Type_mapper<AKT, AK, LK>::type LKT;
typedef Lazy_rep_n<AKT, EKT, Variant_cast<AKT>, Variant_cast<EKT>, typename LK::E2A, Origin> Lcr;
typedef Lazy_rep_n<AKT, EKT, Variant_cast<AKT>, Variant_cast<EKT>, typename LK::E2A, false, Origin> Lcr;
Lcr * lcr = new Lcr(Variant_cast<AKT>(), Variant_cast<EKT>(), *o);
*r = LKT(lcr);
@ -1577,7 +1886,7 @@ struct Fill_lazy_variant_visitor_2 : boost::static_visitor<> {
V.resize(t.size());
for (unsigned int i = 0; i < t.size(); i++) {
V[i] = LKT(new Lazy_rep_n<AKT, EKT, Ith_for_intersection<AKT>,
Ith_for_intersection<EKT>, typename LK::E2A, Origin>
Ith_for_intersection<EKT>, typename LK::E2A, false, Origin>
(Ith_for_intersection<AKT>(i), Ith_for_intersection<EKT>(i), *o));
}
@ -1660,7 +1969,7 @@ struct Lazy_construction_variant {
Protect_FPU_rounding<Protection> P;
try {
Lazy<AT, ET, E2A> lazy(new Lazy_rep_n<AT, ET, AC, EC, E2A, L1, L2>(AC(), EC(), l1, l2));
Lazy<AT, ET, E2A> lazy(new Lazy_rep_n<AT, ET, AC, EC, E2A, false, L1, L2>(AC(), EC(), l1, l2));
// the approximate result requires the trait with types from the AK
AT approx_v = lazy.approx();
@ -1713,7 +2022,7 @@ struct Lazy_construction_variant {
Protect_FPU_rounding<Protection> P;
try {
Lazy<AT, ET, E2A> lazy(new Lazy_rep_n<AT, ET, AC, EC, E2A, L1, L2, L3>(AC(), EC(), l1, l2, l3));
Lazy<AT, ET, E2A> lazy(new Lazy_rep_n<AT, ET, AC, EC, E2A, false, L1, L2, L3>(AC(), EC(), l1, l2, l3));
// the approximate result requires the trait with types from the AK
AT approx_v = lazy.approx();
@ -1752,6 +2061,9 @@ template<typename LK, typename AC, typename EC, typename E2A = Default,
bool has_result_type = internal::has_result_type<AC>::value && internal::has_result_type<EC>::value >
struct Lazy_construction;
template<class AK, class AC> struct Disable_lazy_pruning { static const bool value = false; };
template<class AK> struct Disable_lazy_pruning<AK, typename AK::Construct_weighted_point_2> { static const bool value = true; };
template<class AK> struct Disable_lazy_pruning<AK, typename AK::Construct_weighted_point_3> { static const bool value = true; };
// we have a result type, low effort
template<typename LK, typename AC, typename EC, typename E2A_>
@ -1769,6 +2081,8 @@ struct Lazy_construction<LK, AC, EC, E2A_, true> {
typedef typename Type_mapper<AT, AK, LK>::type result_type;
static const bool noprune = Disable_lazy_pruning<AK, AC>::value;
CGAL_NO_UNIQUE_ADDRESS AC ac;
CGAL_NO_UNIQUE_ADDRESS EC ec;
@ -1780,7 +2094,7 @@ struct Lazy_construction<LK, AC, EC, E2A_, true> {
CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); \
Protect_FPU_rounding<Protection> P; \
try { \
return result_type( Handle(new Lazy_rep_n<AT, ET, AC, EC, E2A, BOOST_PP_ENUM_PARAMS(n, L)>(ac, ec, BOOST_PP_ENUM_PARAMS(n, l)))); \
return result_type( Handle(new Lazy_rep_n<AT, ET, AC, EC, E2A, noprune, BOOST_PP_ENUM_PARAMS(n, L)>(ac, ec, BOOST_PP_ENUM_PARAMS(n, l)))); \
} catch (Uncertain_conversion_exception&) { \
CGAL_BRANCH_PROFILER_BRANCH(tmp); \
Protect_FPU_rounding<!Protection> P2(CGAL_FE_TONEAREST); \
@ -1796,7 +2110,7 @@ struct Lazy_construction<LK, AC, EC, E2A_, true> {
operator()() const
{
typedef Lazy<AT, ET, E2A> Handle;
return result_type( Handle(new Lazy_rep_0<AT,ET,E2A>()) );
return result_type( Handle() );
}
#undef CGAL_CONSTRUCTION_OPERATOR
@ -1819,6 +2133,8 @@ struct Lazy_construction<LK, AC, EC, E2A_, false>
// you are on your own
};
static const bool noprune = Disable_lazy_pruning<AK, AC>::value;
CGAL_NO_UNIQUE_ADDRESS AC ac;
CGAL_NO_UNIQUE_ADDRESS EC ec;
@ -1838,7 +2154,7 @@ struct Lazy_construction<LK, AC, EC, E2A_, false>
CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); \
Protect_FPU_rounding<Protection> P; \
try { \
return result_type( Handle(new Lazy_rep_n<AT, ET, AC, EC, E2A, BOOST_PP_ENUM_PARAMS(n, L)>(ac, ec, BOOST_PP_ENUM_PARAMS(n, l)))); \
return result_type( Handle(new Lazy_rep_n<AT, ET, AC, EC, E2A, noprune, BOOST_PP_ENUM_PARAMS(n, L)>(ac, ec, BOOST_PP_ENUM_PARAMS(n, l)))); \
} catch (Uncertain_conversion_exception&) { \
CGAL_BRANCH_PROFILER_BRANCH(tmp); \
Protect_FPU_rounding<!Protection> P2(CGAL_FE_TONEAREST); \
@ -1858,7 +2174,7 @@ struct Lazy_construction<LK, AC, EC, E2A_, false>
typedef Lazy<AT, ET, E2A> Handle;
typedef typename Type_mapper<AT, AK, LK>::type result_type;
return result_type( Handle(new Lazy_rep_0<AT,ET,E2A>()) );
return result_type( Handle() );
}
};

View File

@ -331,16 +331,42 @@ public:
typename Approximate_kernel::Construct_weighted_point_2,
typename Exact_kernel::Construct_weighted_point_2,
E2A_,
true,
Return_base_tag,
Point_2,
FT
> LR;
typedef Lazy_rep_n<typename Approximate_kernel::Weighted_point_2,
typename Exact_kernel::Weighted_point_2,
typename Approximate_kernel::Construct_weighted_point_2,
typename Exact_kernel::Construct_weighted_point_2,
E2A_,
true,
Return_base_tag,
Point_2,
int
> LRint;
LR * lr = dynamic_cast<LR*>(p.ptr());
if(lr && (! lr->et)){
return std::get<2>(lr->l);
auto& obj = *p.ptr();
const char* tn = typeid(obj).name();
if(tn == typeid(LR).name()){
LR * lr = static_cast<LR*>(p.ptr());
if(lr->is_lazy()){
// Another thread could reset lr->l before this line, so we disable reset for Construct_weighted_point_2 in MT-mode.
// We could also always disable reset for Construct_weighted_point_2 and return lr->l here even if update_exact has run.
return std::get<2>(lr->l);
}
}else{
if(tn == typeid(LRint).name()){
LRint* lrint = static_cast<LRint*>(p.ptr());
if(lrint->is_lazy()){
return std::get<2>(lrint->l);
}
}
}
return BaseClass().compute_weight_2_object()(p);
}
@ -361,16 +387,40 @@ public:
typename Approximate_kernel::Construct_weighted_point_3,
typename Exact_kernel::Construct_weighted_point_3,
E2A_,
true,
Return_base_tag,
Point_3,
FT
> LR;
typedef Lazy_rep_n<typename Approximate_kernel::Weighted_point_3,
typename Exact_kernel::Weighted_point_3,
typename Approximate_kernel::Construct_weighted_point_3,
typename Exact_kernel::Construct_weighted_point_3,
E2A_,
true,
Return_base_tag,
Point_3,
int
> LRint;
LR * lr = dynamic_cast<LR*>(p.ptr());
if(lr && (! lr->et)){
return std::get<2>(lr->l);
auto& obj = *p.ptr();
const char* tn = typeid(obj).name();
if(tn == typeid(LR).name()){
LR * lr = static_cast<LR*>(p.ptr());
if(lr->is_lazy()){
return std::get<2>(lr->l);
}
}else{
if(tn == typeid(LRint).name()){
LRint* lrint = static_cast<LRint*>(p.ptr());
if(lrint->is_lazy()){
return std::get<2>(lrint->l);
}
}
}
return BaseClass().compute_weight_3_object()(p);
}
@ -398,6 +448,7 @@ public:
typename Approximate_kernel::Construct_weighted_point_2,
typename Exact_kernel::Construct_weighted_point_2,
E2A_,
true,
Return_base_tag,
Point_2,
FT
@ -408,18 +459,26 @@ public:
typename Approximate_kernel::Construct_weighted_point_2,
typename Exact_kernel::Construct_weighted_point_2,
E2A_,
true,
Return_base_tag,
Point_2,
int
> LRint;
LR * lr = dynamic_cast<LR*>(p.ptr());
if(lr && (! lr->et)){
return std::get<1>(lr->l);
} else {
LRint* lrint = dynamic_cast<LRint*>(p.ptr());
if(lrint && (! lrint->et)){
return std::get<1>(lrint->l);
auto& obj = *p.ptr();
const char* tn = typeid(obj).name();
if(tn == typeid(LR).name()){
LR * lr = static_cast<LR*>(p.ptr());
if(lr->is_lazy()){
return std::get<1>(lr->l);
}
}else{
if(tn == typeid(LRint).name()){
LRint* lrint = static_cast<LRint*>(p.ptr());
if(lrint->is_lazy()){
return std::get<1>(lrint->l);
}
}
}
@ -450,6 +509,7 @@ public:
typename Approximate_kernel::Construct_weighted_point_3,
typename Exact_kernel::Construct_weighted_point_3,
E2A_,
true,
Return_base_tag,
Point_3,
FT
@ -460,26 +520,35 @@ public:
typename Approximate_kernel::Construct_weighted_point_3,
typename Exact_kernel::Construct_weighted_point_3,
E2A_,
true,
Return_base_tag,
Point_3,
int
> LRint;
auto& obj = *p.ptr();
const char* tn = typeid(obj).name();
LR * lr = dynamic_cast<LR*>(p.ptr());
if(lr && (! lr->et)){
return std::get<1>(lr->l);
if(tn == typeid(LR).name()){
LR * lr = static_cast<LR*>(p.ptr());
if(lr->is_lazy()){
return std::get<1>(lr->l);
}
}else{
LRint* lrint = dynamic_cast<LRint*>(p.ptr());
if(lrint && (! lrint->et)){
return std::get<1>(lrint->l);
if(tn == typeid(LRint).name()){
LRint* lrint = static_cast<LRint*>(p.ptr());
if(lrint->is_lazy()){
return std::get<1>(lrint->l);
}
}
}
return BaseClass().construct_point_3_object()(p);
}
};
struct Less_xyz_3 : public BaseClass::Less_xyz_3
{
typedef typename Kernel_::Point_3 Point_3;

View File

@ -42,7 +42,7 @@
#endif
#include <boost/config.hpp>
#if (BOOST_GCC >= 40900)
#if defined(BOOST_GCC)
_Pragma("GCC diagnostic push")
_Pragma("GCC diagnostic ignored \"-Warray-bounds\"")
#endif
@ -3890,7 +3890,7 @@ namespace CGAL {
} // namespace CGAL
#if (BOOST_GCC >= 40900)
#if defined(BOOST_GCC)
_Pragma("GCC diagnostic pop")
#endif

View File

@ -19,7 +19,7 @@
#include <bitset>
#include <boost/config.hpp>
#if (BOOST_GCC >= 40900)
#if defined(BOOST_GCC)
_Pragma("GCC diagnostic push")
_Pragma("GCC diagnostic ignored \"-Warray-bounds\"")
#endif
@ -426,7 +426,7 @@ namespace CGAL {
} // namespace CGAL
#if (BOOST_GCC >= 40900)
#if defined(BOOST_GCC)
_Pragma("GCC diagnostic pop")
#endif
#endif // CGAL_GENERALIZED_MAP_STORAGES_H //

View File

@ -68,19 +68,6 @@ void generate_points_annulus(long n, double a, double b, double small_radius,
}
if (n == 1) // generation of a point
{
#if BOOST_VERSION < 104700
boost::uniform_real<double> random_squared_radius_distribution(
small_radius * small_radius / (big_radius * big_radius), 1);
boost::uniform_real<double> random_angle_distribution(a, b);
boost::variate_generator<
GEN&, boost::uniform_real<double> > random_angle(gen, random_angle_distribution);
boost::variate_generator<
GEN&, boost::uniform_real<double> > random_squared_radius(gen, random_squared_radius_distribution);
#else
boost::random::uniform_real_distribution<double> random_squared_radius_distribution(
small_radius * small_radius / (big_radius * big_radius), 1);
@ -90,8 +77,6 @@ void generate_points_annulus(long n, double a, double b, double small_radius,
boost::random::variate_generator<
GEN&, boost::random::uniform_real_distribution<double> > random_squared_radius(gen, random_squared_radius_distribution);
#endif
double alpha = random_angle();
double r = big_radius * std::sqrt(random_squared_radius());
typedef Creator_uniform_2<double, P> Creator;

View File

@ -152,33 +152,33 @@ public:
/*!
Inserts `i` into the stream. Puts whitespace around if the
stream is in ascii mode.
stream is in \ascii mode.
*/
Geomview_stream& operator<<(int i);
/*!
Inserts `i` into the stream. Puts whitespace around if the
stream is in ascii mode.
stream is in \ascii mode.
*/
Geomview_stream& operator<<(unsigned int i);
/*!
Inserts `i` into the stream. Puts whitespace around if the
stream is in ascii mode. Currently implemented by converting to int, so it
stream is in \ascii mode. Currently implemented by converting to int, so it
can be truncated on 64 bit platforms.
*/
Geomview_stream& operator<<(long i);
/*!
Inserts `i` into the stream. Puts whitespace around if the
stream is in ascii mode. Currently implemented by converting to unsigned int,
stream is in \ascii mode. Currently implemented by converting to unsigned int,
so it can be truncated on 64 bit platforms.
*/
Geomview_stream& operator<<(unsigned long i);
/*!
Inserts double `d` into the stream. Puts whitespace around if the
stream is in ascii mode.
stream is in \ascii mode.
*/
Geomview_stream& operator<<(double d);
@ -196,7 +196,7 @@ public:
/*!
Sets raw mode. In raw mode, kernel points are output without headers and
footers, just the coordinates (in binary or ascii mode). This allows the
footers, just the coordinates (in binary or \ascii mode). This allows the
implementation of the stream functions for other objects to re-use the
code for points internally, by temporary saving the raw mode to true, and
restoring it after.
@ -227,7 +227,7 @@ public:
bool set_binary_mode(bool b = true);
/*!
Sets whether we are in ascii mode.
Sets whether we are in \ascii mode.
*/
bool set_ascii_mode(bool b = true);
@ -237,7 +237,7 @@ public:
bool get_binary_mode();
/*!
Returns `true` iff `gs` is in ascii mode.
Returns `true` iff `gs` is in \ascii mode.
*/
bool get_ascii_mode();

View File

@ -7,9 +7,7 @@
#include <CGAL/Alpha_shape_2.h>
#include <CGAL/Alpha_shape_face_base_2.h>
#include <CGAL/Alpha_shape_vertex_base_2.h>
#if BOOST_VERSION >= 105600 && (! defined(BOOST_GCC) || BOOST_GCC >= 40500)
#include <CGAL/IO/WKT.h>
#endif
#include <CGAL/point_generators_2.h>
// Qt headers
@ -253,9 +251,7 @@ MainWindow::on_actionLoadPoints_triggered()
tr("Open Points file"),
".",
tr("CGAL files (*.pts.cgal);;"
#if BOOST_VERSION >= 105600 && (! defined(BOOST_GCC) || BOOST_GCC >= 40500)
"WKT files (*.wktk *.WKT);;"
#endif
"All files (*)"));
if(! fileName.isEmpty()){
open(fileName);
@ -274,9 +270,7 @@ MainWindow::open(QString fileName)
std::ifstream ifs(qPrintable(fileName));
if(fileName.endsWith(".wkt",Qt::CaseInsensitive))
{
#if BOOST_VERSION >= 105600 && (! defined(BOOST_GCC) || BOOST_GCC >= 40500)
CGAL::IO::read_multi_point_WKT(ifs, points);
#endif
}
else
{

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