Merge remote-tracking branch 'cgal/master' into Google-readability-casting-maxGimeno

This commit is contained in:
Maxime Gimeno 2021-08-31 10:39:27 +02:00
commit af1a69e193
1210 changed files with 140097 additions and 14035 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 ./tmp.log`
echo ::set-output name=DoxygenError::$(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 == 'sloriot' || github.event.comment.user.login == 'lrineau') && 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

@ -24,7 +24,7 @@
#define CGAL_DEPRECATED_HEADER "<CGAL/AABB_polyhedron_segment_primitive.h>"
#define CGAL_REPLACEMENT_HEADER "<CGAL/AABB_halfedge_graph_segment_primitive.h>"
#include <CGAL/internal/deprecation_warning.h>
#include <CGAL/Installation/internal/deprecation_warning.h>
#include <boost/utility/enable_if.hpp>
#include <boost/type_traits/is_same.hpp>

View File

@ -20,7 +20,7 @@
#define CGAL_DEPRECATED_HEADER "<CGAL/AABB_polyhedron_triangle_primitive.h>"
#define CGAL_REPLACEMENT_HEADER "<CGAL/AABB_face_graph_triangle_primitive.h>"
#include <CGAL/internal/deprecation_warning.h>
#include <CGAL/Installation/internal/deprecation_warning.h>
#include <boost/utility/enable_if.hpp>
#include <boost/type_traits/is_same.hpp>

View File

@ -18,7 +18,7 @@
#include <CGAL/disable_warnings.h>
#include <CGAL/internal/AABB_tree/Has_nested_type_Shared_data.h>
#include <CGAL/AABB_tree/internal/Has_nested_type_Shared_data.h>
#include <CGAL/property_map.h>
#include <CGAL/tags.h>

View File

@ -21,10 +21,10 @@
#include <CGAL/Bbox_3.h>
#include <CGAL/Default.h>
#include <CGAL/intersections.h>
#include <CGAL/internal/AABB_tree/Has_nested_type_Shared_data.h>
#include <CGAL/internal/AABB_tree/Is_ray_intersection_geomtraits.h>
#include <CGAL/internal/AABB_tree/Primitive_helper.h>
#include <CGAL/internal/Has_boolean_tags.h>
#include <CGAL/AABB_tree/internal/Has_nested_type_Shared_data.h>
#include <CGAL/AABB_tree/internal/Is_ray_intersection_geomtraits.h>
#include <CGAL/AABB_tree/internal/Primitive_helper.h>
#include <CGAL/Kernel_23/internal/Has_boolean_tags.h>
#include <boost/optional.hpp>

View File

@ -21,11 +21,11 @@
#include <vector>
#include <iterator>
#include <CGAL/internal/AABB_tree/AABB_traversal_traits.h>
#include <CGAL/internal/AABB_tree/AABB_node.h>
#include <CGAL/internal/AABB_tree/AABB_search_tree.h>
#include <CGAL/internal/AABB_tree/Has_nested_type_Shared_data.h>
#include <CGAL/internal/AABB_tree/Primitive_helper.h>
#include <CGAL/AABB_tree/internal/AABB_traversal_traits.h>
#include <CGAL/AABB_tree/internal/AABB_node.h>
#include <CGAL/AABB_tree/internal/AABB_search_tree.h>
#include <CGAL/AABB_tree/internal/Has_nested_type_Shared_data.h>
#include <CGAL/AABB_tree/internal/Primitive_helper.h>
#include <boost/optional.hpp>
#include <boost/lambda/lambda.hpp>
@ -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;
@ -1028,7 +1058,7 @@ public:
} // end namespace CGAL
#include <CGAL/internal/AABB_tree/AABB_ray_intersection.h>
#include <CGAL/AABB_tree/internal/AABB_ray_intersection.h>
#include <CGAL/enable_warnings.h>

View File

@ -0,0 +1,321 @@
// Copyright (c) 2008 INRIA Sophia-Antipolis (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org).
//
// $URL$
// $Id$
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
//
//
// Author(s) : Camille Wormser, Pierre Alliez, Stephane Tayeb
#ifndef CGAL_AABB_NODE_H
#define CGAL_AABB_NODE_H
#include <CGAL/license/AABB_tree.h>
#include <CGAL/Profile_counter.h>
#include <CGAL/Cartesian_converter.h>
#include <CGAL/intersections.h>
#include <CGAL/Bbox_3.h>
#include <vector>
namespace CGAL {
/**
* @class AABB_node
*
*
*/
template<typename AABBTraits>
class AABB_node
{
private:
typedef AABB_node<AABBTraits> Self;
public:
typedef typename AABBTraits::Bounding_box Bounding_box;
/// Constructor
AABB_node()
: m_bbox()
, m_p_left_child(nullptr)
, m_p_right_child(nullptr) { };
AABB_node(Self&& node) = default;
// Disabled copy constructor & assignment operator
AABB_node(const Self& src) = delete;
Self& operator=(const Self& src) = delete;
/// Returns the bounding box of the node
const Bounding_box& bbox() const { return m_bbox; }
/**
* @brief General traversal query
* @param query the query
* @param traits the traversal traits that define the traversal behaviour
* @param nb_primitives the number of primitive
*
* General traversal query. The traits class allows using it for the various
* traversal methods we need: listing, counting, detecting intersections,
* drawing the boxes.
*/
template<class Traversal_traits, class Query>
void traversal(const Query& query,
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;
typedef typename AABB_traits::Primitive Primitive;
public:
/// Helper functions
const Node& left_child() const
{ return *static_cast<Node*>(m_p_left_child); }
const Node& right_child() const
{ return *static_cast<Node*>(m_p_right_child); }
const Primitive& left_data() const
{ return *static_cast<Primitive*>(m_p_left_child); }
const Primitive& right_data() const
{ return *static_cast<Primitive*>(m_p_right_child); }
template <class Left, class Right>
void set_children(Left& l, Right& r)
{
m_p_left_child = static_cast<void*>(std::addressof(l));
m_p_right_child = static_cast<void*>(std::addressof(r));
}
void set_bbox(const Bounding_box& bbox)
{
m_bbox = bbox;
}
Node& left_child() { return *static_cast<Node*>(m_p_left_child); }
Node& right_child() { return *static_cast<Node*>(m_p_right_child); }
Primitive& left_data() { return *static_cast<Primitive*>(m_p_left_child); }
Primitive& right_data() { return *static_cast<Primitive*>(m_p_right_child); }
private:
/// node bounding box
Bounding_box m_bbox;
/// children nodes, either pointing towards children (if children are not leaves),
/// or pointing toward input primitives (if children are leaves).
void *m_p_left_child;
void *m_p_right_child;
}; // end class AABB_node
template<typename Tr>
template<class Traversal_traits, class Query>
void
AABB_node<Tr>::traversal(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(query, traits, 2);
}
break;
default:
if( traits.do_intersect(query, left_child()) )
{
left_child().traversal(query, traits, nb_primitives/2);
if( traits.go_further() && traits.do_intersect(query, right_child()) )
{
right_child().traversal(query, traits, nb_primitives-nb_primitives/2);
}
}
else if( traits.do_intersect(query, right_child()) )
{
right_child().traversal(query, traits, nb_primitives-nb_primitives/2);
}
}
}
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

@ -16,7 +16,7 @@
#include <CGAL/license/AABB_tree.h>
#include <CGAL/internal/AABB_tree/AABB_node.h>
#include <CGAL/AABB_tree/internal/AABB_node.h>
#include <boost/optional.hpp>
namespace CGAL {

View File

@ -15,7 +15,7 @@
#include <CGAL/license/AABB_tree.h>
#include <CGAL/internal/AABB_tree/Has_nested_type_Shared_data.h>
#include <CGAL/AABB_tree/internal/Has_nested_type_Shared_data.h>
#include <boost/mpl/has_xxx.hpp>
namespace CGAL{

View File

@ -1,157 +0,0 @@
// Copyright (c) 2008 INRIA Sophia-Antipolis (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org).
//
// $URL$
// $Id$
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
//
//
// Author(s) : Camille Wormser, Pierre Alliez, Stephane Tayeb
#ifndef CGAL_AABB_NODE_H
#define CGAL_AABB_NODE_H
#include <CGAL/license/AABB_tree.h>
#include <CGAL/Profile_counter.h>
#include <CGAL/Cartesian_converter.h>
#include <CGAL/intersections.h>
#include <CGAL/Bbox_3.h>
#include <vector>
namespace CGAL {
/**
* @class AABB_node
*
*
*/
template<typename AABBTraits>
class AABB_node
{
private:
typedef AABB_node<AABBTraits> Self;
public:
typedef typename AABBTraits::Bounding_box Bounding_box;
/// Constructor
AABB_node()
: m_bbox()
, m_p_left_child(nullptr)
, m_p_right_child(nullptr) { };
AABB_node(Self&& node) = default;
// Disabled copy constructor & assignment operator
AABB_node(const Self& src) = delete;
Self& operator=(const Self& src) = delete;
/// Returns the bounding box of the node
const Bounding_box& bbox() const { return m_bbox; }
/**
* @brief General traversal query
* @param query the query
* @param traits the traversal traits that define the traversal behaviour
* @param nb_primitives the number of primitive
*
* General traversal query. The traits class allows using it for the various
* traversal methods we need: listing, counting, detecting intersections,
* drawing the boxes.
*/
template<class Traversal_traits, class Query>
void traversal(const Query& query,
Traversal_traits& traits,
const std::size_t nb_primitives) const;
private:
typedef AABBTraits AABB_traits;
typedef AABB_node<AABB_traits> Node;
typedef typename AABB_traits::Primitive Primitive;
public:
/// Helper functions
const Node& left_child() const
{ return *static_cast<Node*>(m_p_left_child); }
const Node& right_child() const
{ return *static_cast<Node*>(m_p_right_child); }
const Primitive& left_data() const
{ return *static_cast<Primitive*>(m_p_left_child); }
const Primitive& right_data() const
{ return *static_cast<Primitive*>(m_p_right_child); }
template <class Left, class Right>
void set_children(Left& l, Right& r)
{
m_p_left_child = static_cast<void*>(std::addressof(l));
m_p_right_child = static_cast<void*>(std::addressof(r));
}
void set_bbox(const Bounding_box& bbox)
{
m_bbox = bbox;
}
Node& left_child() { return *static_cast<Node*>(m_p_left_child); }
Node& right_child() { return *static_cast<Node*>(m_p_right_child); }
Primitive& left_data() { return *static_cast<Primitive*>(m_p_left_child); }
Primitive& right_data() { return *static_cast<Primitive*>(m_p_right_child); }
private:
/// node bounding box
Bounding_box m_bbox;
/// children nodes, either pointing towards children (if children are not leaves),
/// or pointing toward input primitives (if children are leaves).
void *m_p_left_child;
void *m_p_right_child;
}; // end class AABB_node
template<typename Tr>
template<class Traversal_traits, class Query>
void
AABB_node<Tr>::traversal(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(query, traits, 2);
}
break;
default:
if( traits.do_intersect(query, left_child()) )
{
left_child().traversal(query, traits, nb_primitives/2);
if( traits.go_further() && traits.do_intersect(query, right_child()) )
{
right_child().traversal(query, traits, nb_primitives-nb_primitives/2);
}
}
else if( traits.do_intersect(query, right_child()) )
{
right_child().traversal(query, traits, nb_primitives-nb_primitives/2);
}
}
}
} // end namespace CGAL
#endif // CGAL_AABB_NODE_H

View File

@ -25,7 +25,7 @@
#include <CGAL/disable_warnings.h>
#include <CGAL/internal/AABB_tree/Primitive_helper.h>
#include <CGAL/AABB_tree/internal/Primitive_helper.h>
#include <CGAL/use.h>
#include <boost/mem_fn.hpp>

View File

@ -1,5 +1,5 @@
#include <CGAL/assertions.h>
#include <CGAL/internal/AABB_tree/Is_ray_intersection_geomtraits.h>
#include <CGAL/AABB_tree/internal/Is_ray_intersection_geomtraits.h>
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>

View File

@ -36,11 +36,11 @@
#include <CGAL/Advancing_front_surface_reconstruction_cell_base_3.h>
#include <CGAL/Timer.h>
#include <CGAL/Triangulation_data_structure_2.h>
#include <CGAL/internal/AFSR/Surface_vertex_base_2.h>
#include <CGAL/internal/AFSR/Surface_face_base_2.h>
#include <CGAL/internal/AFSR/construct_surface_2.h>
#include <CGAL/internal/AFSR/construct_polyhedron.h>
#include <CGAL/internal/AFSR/write_triple_indices.h>
#include <CGAL/Advancing_front_surface_reconstruction/internal/Surface_vertex_base_2.h>
#include <CGAL/Advancing_front_surface_reconstruction/internal/Surface_face_base_2.h>
#include <CGAL/Advancing_front_surface_reconstruction/internal/construct_surface_2.h>
#include <CGAL/Advancing_front_surface_reconstruction/internal/construct_polyhedron.h>
#include <CGAL/Advancing_front_surface_reconstruction/internal/write_triple_indices.h>
namespace CGAL {

View File

@ -1,135 +0,0 @@
// Copyright (c) 2015 INRIA Sophia-Antipolis (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org).
//
// $URL$
// $Id$
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
//
// Author(s) : Frank Da, David Cohen-Steiner, Andreas Fabri
#ifndef CGAL_AFSR_ORIENT_H
#define CGAL_AFSR_ORIENT_H
#include <CGAL/license/Advancing_front_surface_reconstruction.h>
namespace CGAL {
namespace AFSR {
template <class Triangulation, class TDS, class Filter>
typename TDS::Vertex_handle
orient(TDS& tds, const Advancing_front_surface_reconstruction<Triangulation,Filter>& surface)
{
typedef typename TDS::Vertex_handle Vertex_handle;
typedef std::pair<Vertex_handle,Vertex_handle> Vh_pair;
typedef typename TDS::Face_handle Face_handle;
typedef typename TDS::Edge Edge;
Triangulation& T = surface.triangulation_3();
// create an infinite-vertex and infinite faces with the
// boundary edges if any.
// return the infinite vertex if created
Vertex_handle vinf;
std::vector<Vertex_handle > vvh;
if(tds.number_of_vertices() != 0) tds.clear();
int dim = 2;
tds.set_dimension(dim);
CGAL::Unique_hash_map<typename Triangulation::Vertex_handle, int> vertex_index_map(-1, T.number_of_vertices());
int i=0;
for (typename Triangulation::Finite_vertices_iterator v_it = T.finite_vertices_begin();
v_it != T.finite_vertices_end();
v_it++){
typename CGAL::Unique_hash_map<typename Triangulation::Vertex_handle, int>::Data& d = vertex_index_map[v_it];
if ((!v_it->is_exterior()) && d == -1){
d = i;
Vertex_handle vh = tds.create_vertex();
vvh.push_back(vh);
vh->set_point(v_it->point());
i++;
}
}
std::map<Vh_pair, Edge> edge_map;
for(typename Triangulation::Finite_facets_iterator f_it = T.finite_facets_begin();
f_it != T.finite_facets_end();
f_it++)
{
typename Triangulation::Cell_handle n, c = (*f_it).first;
int ni, ci = (*f_it).second;
n = c->neighbor(ci);
ni = n->index(c);
int i1, i2 ,i3;
if (c->is_selected_facet(ci))
{
i1 = (ci+1) & 3;
i2 = (ci+2) & 3;
i3 = (ci+3) & 3;
Face_handle fh = tds.create_face(vvh[vertex_index_map[c->vertex(i1)]],
vvh[vertex_index_map[c->vertex(i2)]],
vvh[vertex_index_map[c->vertex(i3)]]);
vvh[vertex_index_map[c->vertex(i1)]]->set_face(fh);
vvh[vertex_index_map[c->vertex(i2)]]->set_face(fh);
vvh[vertex_index_map[c->vertex(i3)]]->set_face(fh);
for (int ih = 0; ih < 3; ++ih) {
tds.set_adjacency(fh, ih, edge_map);
}
}
if (n->is_selected_facet(ni))
{
i1 = (ni+1) & 3;
i2 = (ni+2) & 3;
i3 = (ni+3) & 3;
Face_handle fh = tds.create_face(vvh[vertex_index_map[n->vertex(i1)]],
vvh[vertex_index_map[n->vertex(i2)]],
vvh[vertex_index_map[n->vertex(i3)]]);
vvh[vertex_index_map[n->vertex(i1)]]->set_face(fh);
vvh[vertex_index_map[n->vertex(i2)]]->set_face(fh);
vvh[vertex_index_map[n->vertex(i3)]]->set_face(fh);
for (int ih = 0; ih < 3; ++ih) {
tds.set_adjacency(fh, ih, edge_map);
}
}
}
if ( !edge_map.empty()) {
vinf = tds.create_vertex();
std::map<Vh_pair, Edge> inf_edge_map;
while (!edge_map.empty()) {
Face_handle fh = edge_map.begin()->second.first;
int ih = edge_map.begin()->second.second;
Face_handle fn = tds.create_face( vinf,
fh->vertex(TDS::cw(ih)),
fh->vertex(TDS::ccw(ih)));
vinf->set_face(fn);
tds.set_adjacency(fn, 0, fh, ih);
tds.set_adjacency(fn, 1, inf_edge_map);
tds.set_adjacency(fn, 2, inf_edge_map);
edge_map.erase(edge_map.begin());
}
CGAL_assertion(inf_edge_map.empty());
}
tds.reorient_faces();
return vinf;
}
} // namespace AFSR
} // namespace CGAL
#endif //CGAL_AFSR_ORIENT_H

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

@ -15,7 +15,7 @@
#include <CGAL/license/Alpha_shapes_2.h>
#include <CGAL/internal/Lazy_alpha_nt_2.h>
#include <CGAL/Alpha_shapes_2/internal/Lazy_alpha_nt_2.h>
// for convenience only
#include <CGAL/Alpha_shape_vertex_base_2.h>

View File

@ -17,7 +17,7 @@
#include <CGAL/utility.h>
#include <CGAL/internal/Lazy_alpha_nt_2.h>
#include <CGAL/Alpha_shapes_2/internal/Lazy_alpha_nt_2.h>
#include <CGAL/Default.h>
#include <CGAL/Triangulation_face_base_2.h>

View File

@ -18,7 +18,7 @@
#include <utility>
#include <CGAL/Triangulation_vertex_base_2.h>
#include <CGAL/internal/Lazy_alpha_nt_2.h>
#include <CGAL/Alpha_shapes_2/internal/Lazy_alpha_nt_2.h>
//-------------------------------------------------------------------
namespace CGAL {

View File

@ -16,7 +16,7 @@
#include <CGAL/license/Alpha_shapes_2.h>
#include <CGAL/assertions.h>
#include <CGAL/internal/Exact_type_selector.h>
#include <CGAL/Number_types/internal/Exact_type_selector.h>
#include <CGAL/number_type_basic.h>
#include <CGAL/Cartesian_converter.h>
#include <CGAL/Has_conversion.h>

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

@ -16,7 +16,7 @@
#include <CGAL/license/Alpha_shapes_3.h>
#include <CGAL/internal/Lazy_alpha_nt_3.h>
#include <CGAL/Alpha_shapes_3/internal/Lazy_alpha_nt_3.h>
#include <CGAL/Alpha_shape_cell_base_3.h> // for Alpha_status
#include <CGAL/basic.h>

View File

@ -17,7 +17,7 @@
#include <vector>
#include <CGAL/Compact_container.h>
#include <CGAL/Delaunay_triangulation_cell_base_3.h>
#include <CGAL/internal/Lazy_alpha_nt_3.h>
#include <CGAL/Alpha_shapes_3/internal/Lazy_alpha_nt_3.h>
#include <CGAL/Default.h>
namespace CGAL {

View File

@ -17,7 +17,7 @@
#include <CGAL/assertions.h>
#include <CGAL/Cartesian_converter.h>
#include <CGAL/internal/Exact_type_selector.h>
#include <CGAL/Number_types/internal/Exact_type_selector.h>
#include <CGAL/Has_conversion.h>
#include <memory>

View File

@ -36,7 +36,7 @@
#include <CGAL/IO/Geomview_stream.h> // TBC
#endif
#include <CGAL/internal/Classification_type.h>
#include <CGAL/Alpha_shapes_3/internal/Classification_type.h>
#include <CGAL/Triangulation_3.h>

View File

@ -20,7 +20,7 @@
#include <vector>
#include <CGAL/Compact_container.h>
#include <CGAL/Delaunay_triangulation_cell_base_3.h>
#include <CGAL/internal/Classification_type.h>
#include <CGAL/Alpha_shapes_3/internal/Classification_type.h>
namespace CGAL {

View File

@ -19,7 +19,7 @@
#include <utility>
#include <CGAL/Triangulation_vertex_base_3.h>
#include <CGAL/internal/Classification_type.h>
#include <CGAL/Alpha_shapes_3/internal/Classification_type.h>
namespace CGAL {

View File

@ -37,7 +37,7 @@
#include <CGAL/Apollonius_graph_vertex_base_2.h>
#include <CGAL/in_place_edge_list.h>
#include <CGAL/internal/TDS_2/edge_list.h>
#include <CGAL/TDS_2/internal/edge_list.h>
#include <CGAL/Apollonius_graph_2/Traits_wrapper_2.h>
#include <CGAL/Apollonius_graph_2/Constructions_C2.h>

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

@ -15,7 +15,7 @@
#define CGAL_DEPRECATED_HEADER "<CGAL/Arr_rational_arc_traits_2.h>"
#define CGAL_REPLACEMENT_HEADER "<CGAL/Arr_rational_function_traits_2.h>"
#include <CGAL/internal/deprecation_warning.h>
#include <CGAL/Installation/internal/deprecation_warning.h>
/*! \file
* Definition of the Arr_rational_arc_traits_2 class.

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

@ -17,7 +17,7 @@
#define CGAL_DEPRECATED_HEADER "<CGAL/Arr_face_map.h>"
#define CGAL_REPLACEMENT_HEADER "<CGAL/Arr_face_index_map.h>"
#include <CGAL/internal/deprecation_warning.h>
#include <CGAL/Installation/internal/deprecation_warning.h>
#include <CGAL/Arr_face_index_map.h>

View File

@ -16,7 +16,7 @@
#define CGAL_DEPRECATED_HEADER "<CGAL/Arr_geometry_traits/Polyline_2.h>"
#define CGAL_REPLACEMENT_HEADER "<CGAL/Arr_geometry_traits/Polycurve_2.h>"
#include <CGAL/internal/deprecation_warning.h>
#include <CGAL/Installation/internal/deprecation_warning.h>
#include <CGAL/Arr_geometry_traits/Polycurve_2.h>

View File

@ -17,7 +17,7 @@
#define CGAL_DEPRECATED_HEADER "<CGAL/Arr_overlay.h>"
#define CGAL_REPLACEMENT_HEADER "<CGAL/Arr_overlay_2.h>"
#include <CGAL/internal/deprecation_warning.h>
#include <CGAL/Installation/internal/deprecation_warning.h>
#include <CGAL/Arr_overlay_2.h>

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

@ -131,7 +131,7 @@ private:
};
//-----------------------------------------------------------------------------
// Memeber-function definitions:
// Member-function definitions:
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------

View File

@ -223,7 +223,7 @@ public:
};
//-----------------------------------------------------------------------------
// Memeber-function definitions:
// Member-function definitions:
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------

View File

@ -97,7 +97,7 @@ public:
};
//-----------------------------------------------------------------------------
// Memeber-function definitions:
// Member-function definitions:
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------

View File

@ -100,7 +100,7 @@ public:
};
//-----------------------------------------------------------------------------
// Memeber-function definitions:
// Member-function definitions:
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------

View File

@ -176,7 +176,7 @@ public:
};
//-----------------------------------------------------------------------------
// Memeber-function definitions:
// Member-function definitions:
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------

View File

@ -89,7 +89,7 @@ public:
};
//-----------------------------------------------------------------------------
// Memeber-function definitions:
// Member-function definitions:
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------

View File

@ -107,7 +107,7 @@ public:
};
//-----------------------------------------------------------------------------
// Memeber-function definitions:
// Member-function definitions:
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------

View File

@ -87,7 +87,7 @@ public:
};
//-----------------------------------------------------------------------------
// Memeber-function definitions:
// Member-function definitions:
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------

View File

@ -18,7 +18,7 @@
#define CGAL_DEPRECATED_HEADER "<CGAL/Arr_vertex_map.h>"
#define CGAL_REPLACEMENT_HEADER "<CGAL/Arr_vertex_index_map.h>"
#include <CGAL/internal/deprecation_warning.h>
#include <CGAL/Installation/internal/deprecation_warning.h>
#include <CGAL/Arr_vertex_index_map.h>

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

@ -112,7 +112,7 @@ public:
};
//-----------------------------------------------------------------------------
// Memeber-function definitions:
// Member-function definitions:
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------

View File

@ -134,7 +134,7 @@ public:
/*! using the additional data that we store at the event, we compute
* how much we have to jump (he = he->next()->twin()) from the halfedge
* that is stored in the event, to the halefge that is previous to 'curve'
* that is stored in the event, to the halfedge that is previous to 'curve'
* that is about to be inserted into the arrangement.
*/
int compute_halfedge_jump_count(Subcurve* curve)

View File

@ -262,7 +262,7 @@ private:
};
//-----------------------------------------------------------------------------
// Memeber-function definitions:
// Member-function definitions:
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------

View File

@ -67,6 +67,21 @@ private:
X_monotone_curve_2 sub_cv1; // Auxiliary variables
X_monotone_curve_2 sub_cv2; // (used for splitting curves).
// update halfedge pointing to events, case with overlaps
template <class Subcurve_>
void update_incident_halfedge_after_split(Subcurve_* sc,
Halfedge_handle he,
Halfedge_handle new_he,
Tag_true);
// update halfedge pointing to events, case without overlaps
template <class Subcurve_>
void update_incident_halfedge_after_split(Subcurve_* sc,
Halfedge_handle he,
Halfedge_handle new_he,
Tag_false);
public:
/*! A notification invoked when a new subcurve is created. */
void add_subcurve(const X_monotone_curve_2& cv, Subcurve* sc);
@ -99,6 +114,43 @@ public:
// Member-function definitions:
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// update halfedge pointing to events, case with overlaps
//
template <typename Hlpr, typename Vis>
template <class Subcurve_>
void Arr_insertion_ss_visitor<Hlpr, Vis>::
update_incident_halfedge_after_split(Subcurve_* sc,
Halfedge_handle he,
Halfedge_handle new_he,
Tag_true)
{
std::vector<Subcurve*> leaves;
sc->all_leaves( std::back_inserter(leaves) );
for(Subcurve* ssc : leaves)
{
Event* last_event_on_ssc = ssc->last_event();
if (last_event_on_ssc->halfedge_handle() == he)
last_event_on_ssc->set_halfedge_handle(new_he->next());
}
}
//-----------------------------------------------------------------------------
// update halfedge pointing to events, case without overlaps
//
template <typename Hlpr, typename Vis>
template <class Subcurve_>
void Arr_insertion_ss_visitor<Hlpr, Vis>::
update_incident_halfedge_after_split(Subcurve_* sc,
Halfedge_handle he,
Halfedge_handle new_he,
Tag_false)
{
Event* last_event_on_sc = sc->last_event();
if (last_event_on_sc->halfedge_handle() == he)
last_event_on_sc->set_halfedge_handle(new_he->next());
}
//-----------------------------------------------------------------------------
// Check if the halfedge associated with the given subcurve will be split
// at the given event.
@ -132,9 +184,8 @@ Arr_insertion_ss_visitor<Hlpr, Vis>::split_edge(Halfedge_handle he, Subcurve* sc
Halfedge_handle new_he =
this->m_arr_access.split_edge_ex(he, pt.base(),
sub_cv1.base(), sub_cv2.base());
Event* last_event_on_sc = sc->last_event();
if (last_event_on_sc->halfedge_handle() == he)
last_event_on_sc->set_halfedge_handle(new_he->next());
// update the halfedge incident to events on the left of the split
update_incident_halfedge_after_split(sc, he, new_he, typename Subcurve::Handle_overlaps());
return new_he;
}

View File

@ -219,7 +219,7 @@ protected:
};
//-----------------------------------------------------------------------------
// Memeber-function definitions:
// Member-function definitions:
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------

View File

@ -401,7 +401,7 @@ protected:
};
//-----------------------------------------------------------------------------
// Memeber-function definitions:
// Member-function definitions:
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------

View File

@ -126,7 +126,7 @@ public:
};
//-----------------------------------------------------------------------------
// Memeber-function definitions:
// Member-function definitions:
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------

View File

@ -76,6 +76,20 @@ bool test_insert_at_vertices(){
return test_insert_at_vertices_1() && test_insert_at_vertices_2();
}
bool test_insert_on_overlap(){
Arrangement_2 arr;
std::vector<Segment_2> segs1, segs2;
segs1.emplace_back(Point_2(0, 0), Point_2(0, 4));
segs2.emplace_back(Point_2(0, 0), Point_2(4,4));
segs2.emplace_back(Point_2(0, 2), Point_2(0, 4));
segs2.emplace_back(Point_2(0, 2), Point_2(4,4));
CGAL::insert(arr, segs1.begin(), segs1.end());
CGAL::insert(arr, segs2.begin(), segs2.end());
return is_valid(arr);
}
int main ()
{
Arrangement_2 arr;
@ -136,6 +150,10 @@ int main ()
valid=test_insert_at_vertices();
std::cout << ( valid ? "valid." : "NOT valid!") << std::endl;
if (!valid) return 1;
std::cout << "Test insert on overlap\n";
valid=test_insert_on_overlap();
return valid?0:1;
}

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,10 @@ 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(maximum_number_t, maximum_number, maximum_number)
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)
@ -174,6 +180,7 @@ CGAL_add_named_parameter(pointmatcher_config_t, pointmatcher_config, pointmatche
CGAL_add_named_parameter(adjacencies_t, adjacencies, adjacencies)
CGAL_add_named_parameter(scan_angle_t, scan_angle_map, scan_angle_map)
CGAL_add_named_parameter(scanline_id_t, scanline_id_map, scanline_id_map)
CGAL_add_named_parameter(scalar_t, scalar_map, scalar_map)
// List of named parameters used in Surface_mesh_approximation package
CGAL_add_named_parameter(verbose_level_t, verbose_level, verbose_level)
@ -209,3 +216,16 @@ CGAL_add_named_parameter(accuracy_t, accuracy, accuracy)
CGAL_add_named_parameter(maximum_running_time_t, maximum_running_time, maximum_running_time)
CGAL_add_named_parameter(overlap_t, overlap, overlap)
CGAL_add_named_parameter(maximum_normal_deviation_t, maximum_normal_deviation, maximum_normal_deviation)
// List of named parameters used in Shape_regularization package
CGAL_add_named_parameter(minimum_length_t, minimum_length, minimum_length)
CGAL_add_named_parameter(maximum_angle_t, maximum_angle, maximum_angle)
CGAL_add_named_parameter(maximum_offset_t, maximum_offset, maximum_offset)
CGAL_add_named_parameter(regularize_parallelism_t, regularize_parallelism, regularize_parallelism)
CGAL_add_named_parameter(regularize_orthogonality_t, regularize_orthogonality, regularize_orthogonality)
CGAL_add_named_parameter(regularize_coplanarity_t, regularize_coplanarity, regularize_coplanarity)
CGAL_add_named_parameter(regularize_axis_symmetry_t, regularize_axis_symmetry, regularize_axis_symmetry)
CGAL_add_named_parameter(symmetry_direction_t, symmetry_direction, symmetry_direction)
CGAL_add_named_parameter(preserve_order_t, preserve_order, preserve_order)
CGAL_add_named_parameter(adjust_directions_t, adjust_directions, adjust_directions)
CGAL_add_named_parameter(segment_t, segment_map, segment_map)

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

@ -18,8 +18,8 @@ property uchar green
property uchar blue
property int label
element edge 6
property int v0
property int v1
property int vertex1
property int vertex2
property float confidence
end_header
0 0 0 -0.5 -0.5 -0.5 255 255 0 0

View File

@ -18,8 +18,8 @@ property uchar green
property uchar blue
property int label
element edge 6
property int v0
property int v1
property int vertex1
property int vertex2
property float confidence
end_header
0 0 0 -0.5 -0.5 -0.5 255 255 0 0

View File

@ -18,8 +18,8 @@ property uchar green
property uchar blue
property int label
element edge 6
property int v0
property int v1
property int vertex1
property int vertex2
property float confidence
end_header
0 0 0 -0.5 -0.5 -0.5 0

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));

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