Merge remote-tracking branch 'cgal/master' into HEAD

This commit is contained in:
Sébastien Loriot 2019-04-12 17:44:31 +02:00
commit 1398af1b0b
921 changed files with 10026 additions and 14108 deletions

2
.gitignore vendored
View File

@ -1063,7 +1063,7 @@ cmake_install.cmake
*~
.#*
# MacOS file http://en.wikipedia.org/wiki/.DS_Store(
# MacOS file https://en.wikipedia.org/wiki/.DS_Store
.DS_Store
# Binaries:

View File

@ -9,7 +9,7 @@ if [ ! -f "$2/package_info/$2/dependencies" ];then
echo "No dependencies found for $2"
exit 1
fi
LIST_OF_FILES=$(git diff --name-only origin/master |cut -d/ -f1 |uniq |sort)
LIST_OF_FILES=$(git diff --name-only origin/master... |cut -d/ -f1 |uniq |sort)
LIST_OF_DEPS=$(cat "$2/package_info/$2/dependencies")
echo "$LIST_OF_DEPS"
for flie in $LIST_OF_DEPS

View File

@ -64,7 +64,7 @@ void surface_mesh_cache_bbox(const char* fname)
t.start();
Bbox_pmap bb = tmesh.add_property_map<face_descriptor,Bbox_3>("f:bbox",Bbox_3()).first;
BOOST_FOREACH(face_descriptor fd, faces(tmesh)){
for(face_descriptor fd : faces(tmesh)){
put(bb, fd, bbox(fd,tmesh));
}
Traits traits(bb);

View File

@ -51,7 +51,7 @@ int main(int argc, char* argv[])
double d = CGAL::Polygon_mesh_processing::is_outward_oriented(mesh)?-1:1;
BOOST_FOREACH(face_descriptor fd, faces(mesh)){
for(face_descriptor fd : faces(mesh)){
halfedge_descriptor hd = halfedge(fd,mesh);
Point p = CGAL::centroid(mesh.point(source(hd,mesh)),
mesh.point(target(hd,mesh)),

View File

@ -60,41 +60,10 @@ template <class Primitive>
struct AABB_traits_base<Primitive,true>{
typename Primitive::Shared_data m_primitive_data;
#if !defined(CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES) && !defined(CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE)
template <typename ... T>
void set_shared_data(T&& ... t){
m_primitive_data=Primitive::construct_shared_data(std::forward<T>(t)...);
}
#else
void set_shared_data(){
m_primitive_data=Primitive::construct_shared_data();
}
template <class T1>
void set_shared_data(T1& t1){
m_primitive_data=Primitive::construct_shared_data(t1);
}
template <class T1,class T2>
void set_shared_data(T1& t1, T2& t2){
m_primitive_data=Primitive::construct_shared_data(t1,t2);
}
template <class T1,class T2,class T3>
void set_shared_data(T1& t1,T2& t2,T3& t3){
m_primitive_data=Primitive::construct_shared_data(t1,t2,t3);
}
template <class T1,class T2,class T3,class T4>
void set_shared_data(T1& t1,T2& t2,T3& t3,T4& t4){
m_primitive_data=Primitive::construct_shared_data(t1,t2,t3,t4);
}
template <class T1,class T2,class T3,class T4,class T5>
void set_shared_data(T1& t1,T2& t2,T3& t3,T4& t4,T5& t5){
m_primitive_data=Primitive::construct_shared_data(t1,t2,t3,t4,t5);
}
#endif
const typename Primitive::Shared_data& shared_data() const {return m_primitive_data;}
};
@ -396,20 +365,6 @@ public:
public:
Intersection(const AABB_traits<GeomTraits,AABBPrimitive,BboxMap>& traits)
:m_traits(traits) {}
#if CGAL_INTERSECTION_VERSION < 2
template<typename Query>
boost::optional<typename AT::Object_and_primitive_id>
operator()(const Query& query, const typename AT::Primitive& primitive) const
{
typedef boost::optional<Object_and_primitive_id> Intersection;
CGAL::Object object = GeomTraits().intersect_3_object()(internal::Primitive_helper<AT>::get_datum(primitive,m_traits),query);
if ( object.empty() )
return Intersection();
else
return Intersection(Object_and_primitive_id(object,primitive.id()));
}
#else
template<typename Query>
boost::optional< typename Intersection_and_primitive_id<Query>::Type >
operator()(const Query& query, const typename AT::Primitive& primitive) const {
@ -419,7 +374,6 @@ public:
return boost::none;
return boost::make_optional( std::make_pair(*inter_res, primitive.id()) );
}
#endif
};
Intersection intersection_object() const {return Intersection(*this);}

View File

@ -126,27 +126,10 @@ namespace CGAL {
* @param beyond past-the-end iterator
*
* It is equivalent to constructing an empty tree and calling `insert(first,last,t...)`.
* For compilers that do not support variadic templates, overloads up to
* 5 template arguments are provided.
* The tree stays empty if the memory allocation is not successful.
*/
#if !defined(CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES) && !defined(CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE)
template<typename InputIterator,typename ... T>
AABB_tree(InputIterator first, InputIterator beyond,T&& ...);
#else
template<typename InputIterator>
AABB_tree(InputIterator first, InputIterator beyond);
template<typename InputIterator, typename T1>
AABB_tree(InputIterator first, InputIterator beyond, T1&);
template<typename InputIterator, typename T1, typename T2>
AABB_tree(InputIterator first, InputIterator beyond,T1&,T2&);
template<typename InputIterator, typename T1, typename T2, typename T3>
AABB_tree(InputIterator first, InputIterator beyond,T1&,T2&,T3&);
template<typename InputIterator, typename T1, typename T2, typename T3, typename T4>
AABB_tree(InputIterator first, InputIterator beyond,T1&,T2&,T3&,T4&);
template<typename InputIterator, typename T1, typename T2, typename T3, typename T4, typename T5>
AABB_tree(InputIterator first, InputIterator beyond,T1&,T2&,T3&,T4&,T5&);
#endif
/// After one or more calls to `insert()` the internal data
/// structure of the tree must be reconstructed. This procedure
@ -158,26 +141,10 @@ namespace CGAL {
/// data structure.
/// A call to `AABBTraits::set_shared_data(t...)`
/// is made using the internally stored traits.
/// For compilers that do not support variadic templates,
/// overloads up to 5 template arguments are provided.
#if !defined(CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES) && !defined(CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE)
template<typename ... T>
void build(T&& ...);
#ifndef DOXYGEN_RUNNING
void build();
#endif
#else
void build();
template<typename T1>
void build(T1& t1);
template<typename T1, typename T2>
void build(T1& t1, T2& t2);
template<typename T1, typename T2,typename T3>
void build(T1& t1, T2& t2, T3& t3);
template<typename T1, typename T2,typename T3,typename T4>
void build(T1& t1, T2& t2, T3& t3, T4& t4);
template<typename T1, typename T2,typename T3,typename T4,typename T5>
void build(T1& t1, T2& t2, T3& t3, T4& t4, T5& t5);
#endif
///@}
@ -185,25 +152,8 @@ namespace CGAL {
///@{
/// Equivalent to calling `clear()` and then `insert(first,last,t...)`.
/// For compilers that do not support variadic templates, overloads up
/// to 5 template arguments are provided.
#if !defined(CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES) && !defined(CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE)
template<typename ConstPrimitiveIterator,typename ... T>
void rebuild(ConstPrimitiveIterator first, ConstPrimitiveIterator beyond,T&& ...);
#else
template<typename ConstPrimitiveIterator>
void rebuild(ConstPrimitiveIterator first, ConstPrimitiveIterator beyond);
template<typename ConstPrimitiveIterator, typename T1>
void rebuild(ConstPrimitiveIterator first, ConstPrimitiveIterator beyond, T1&);
template<typename ConstPrimitiveIterator, typename T1, typename T2>
void rebuild(ConstPrimitiveIterator first, ConstPrimitiveIterator beyond,T1&,T2&);
template<typename ConstPrimitiveIterator, typename T1, typename T2, typename T3>
void rebuild(ConstPrimitiveIterator first, ConstPrimitiveIterator beyond,T1&,T2&,T3&);
template<typename ConstPrimitiveIterator, typename T1, typename T2, typename T3, typename T4>
void rebuild(ConstPrimitiveIterator first, ConstPrimitiveIterator beyond,T1&,T2&,T3&,T4&);
template<typename ConstPrimitiveIterator, typename T1, typename T2, typename T3, typename T4, typename T5>
void rebuild(ConstPrimitiveIterator first, ConstPrimitiveIterator beyond,T1&,T2&,T3&,T4&,T5&);
#endif
/// Add a sequence of primitives to the set of primitives of the AABB tree.
@ -212,25 +162,8 @@ namespace CGAL {
/// `Primitive(%InputIterator, T...)`. If `Primitive` is a model of the concept
/// `AABBPrimitiveWithSharedData`, a call to `AABBTraits::set_shared_data(t...)`
/// is made using the internally stored traits.
/// For compilers that do not support variadic templates,
/// overloads up to 5 template arguments are provided.
#if !defined(CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES) && !defined(CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE)
template<typename InputIterator,typename ... T>
void insert(InputIterator first, InputIterator beyond,T&& ...);
#else
template<typename InputIterator>
void insert(InputIterator first, InputIterator beyond);
template<typename InputIterator, typename T1>
void insert(InputIterator first, InputIterator beyond,T1&);
template<typename InputIterator, typename T1, typename T2>
void insert(InputIterator first, InputIterator beyond,T1&, T2&);
template<typename InputIterator, typename T1, typename T2, typename T3>
void insert(InputIterator first, InputIterator beyond,T1&,T2&,T3&);
template<typename InputIterator, typename T1, typename T2, typename T3, typename T4>
void insert(InputIterator first, InputIterator beyond,T1&,T2&,T3&,T4&);
template<typename InputIterator, typename T1, typename T2, typename T3, typename T4, typename T5>
void insert(InputIterator first, InputIterator beyond,T1&,T2&,T3&,T4&,T5&);
#endif
/// Adds a primitive to the set of primitives of the tree.
inline void insert(const Primitive& p);
@ -274,7 +207,6 @@ namespace CGAL {
///@}
private:
#if !defined(CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES) && !defined(CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE)
template <typename ... T>
void set_primitive_data_impl(CGAL::Boolean_tag<false>,T ... ){}
template <typename ... T>
@ -285,64 +217,6 @@ namespace CGAL {
void set_shared_data(T&& ...t){
set_primitive_data_impl(CGAL::Boolean_tag<internal::Has_nested_type_Shared_data<Primitive>::value>(),std::forward<T>(t)...);
}
#else
void set_primitive_data_impl(CGAL::Boolean_tag<false>){}
void set_primitive_data_impl(CGAL::Boolean_tag<true>)
{m_traits.set_shared_data();}
void set_shared_data(){
set_primitive_data_impl(CGAL::Boolean_tag<internal::Has_nested_type_Shared_data<Primitive>::value>());
}
template <typename T1>
void set_primitive_data_impl(CGAL::Boolean_tag<false>,T1){}
template <typename T1>
void set_primitive_data_impl(CGAL::Boolean_tag<true>,T1& t1)
{m_traits.set_shared_data(t1);}
template <typename T1>
void set_shared_data(T1& t1){
set_primitive_data_impl(Boolean_tag<internal::Has_nested_type_Shared_data<Primitive>::value>(),t1);
}
template <typename T1, typename T2>
void set_primitive_data_impl(CGAL::Boolean_tag<false>,T1,T2){}
template <typename T1, typename T2>
void set_primitive_data_impl(CGAL::Boolean_tag<true>,T1& t1,T2& t2)
{m_traits.set_shared_data(t1,t2);}
template <typename T1, typename T2>
void set_shared_data(const T1& t1,const T2& t2){
set_primitive_data_impl(Boolean_tag<internal::Has_nested_type_Shared_data<Primitive>::value>(),t1,t2);
}
template <typename T1, typename T2, typename T3>
void set_primitive_data_impl(CGAL::Boolean_tag<false>,T1,T2,T3){}
template <typename T1, typename T2, typename T3>
void set_primitive_data_impl(CGAL::Boolean_tag<true>,T1& t1,T2& t2,T3& t3)
{m_traits.set_shared_data(t1,t2,t3);}
template <typename T1, typename T2, typename T3>
void set_shared_data(T1& t1,T2& t2,T3& t3){
set_primitive_data_impl(Boolean_tag<internal::Has_nested_type_Shared_data<Primitive>::value>(),t1,t2,t3);
}
template <typename T1, typename T2, typename T3, typename T4>
void set_primitive_data_impl(CGAL::Boolean_tag<false>,T1,T2,T3,T4){}
template <typename T1, typename T2, typename T3, typename T4>
void set_primitive_data_impl(CGAL::Boolean_tag<true>,T1& t1,T2& t2,T3& t3,T4& t4)
{m_traits.set_shared_data(t1,t2,t3,t4);}
template <typename T1, typename T2, typename T3, typename T4>
void set_shared_data(T1& t1,T2& t2,T3& t3,T4& t4){
set_primitive_data_impl(Boolean_tag<internal::Has_nested_type_Shared_data<Primitive>::value>(),t1,t2,t3,t4);
}
template <typename T1, typename T2, typename T3, typename T4, typename T5>
void set_primitive_data_impl(CGAL::Boolean_tag<false>,T1,T2,T3,T4,T5){}
template <typename T1, typename T2, typename T3, typename T4, typename T5>
void set_primitive_data_impl(CGAL::Boolean_tag<true>,T1& t1,T2& t2,T3& t3,T4& t4,T5& t5)
{m_traits.set_shared_data(t1,t2,t3,t4,t5);}
template <typename T1, typename T2, typename T3, typename T4, typename T5>
void set_shared_data(T1& t1,T2& t2,T3& t3,T4& t4,T5& t5){
set_primitive_data_impl(Boolean_tag<internal::Has_nested_type_Shared_data<Primitive>::value>(),t1,t2,t3,t4,t5);
}
#endif
bool build_kd_tree() const;
template<typename ConstPointIterator>
@ -410,11 +284,7 @@ public:
/// for which `do_intersect` predicates
/// and intersections are defined in the traits class AABBTraits.
template <typename Query>
#if CGAL_INTERSECTION_VERSION < 2 && !defined(DOXYGEN_RUNNING)
boost::optional<Object_and_primitive_id>
#else
boost::optional< typename Intersection_and_primitive_id<Query>::Type >
#endif
any_intersection(const Query& query) const;
@ -744,7 +614,6 @@ public:
, m_need_build(false)
{}
#if !defined(CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES) && !defined(CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE)
template<typename Tr>
template<typename ConstPrimitiveIterator, typename ... T>
AABB_tree<Tr>::AABB_tree(ConstPrimitiveIterator first,
@ -800,324 +669,6 @@ public:
set_shared_data(std::forward<T>(t)...);
build();
}
#else
//=============constructor======================
template<typename Tr>
template<typename ConstPrimitiveIterator>
AABB_tree<Tr>::AABB_tree(ConstPrimitiveIterator first,
ConstPrimitiveIterator beyond)
: m_traits()
, m_primitives()
, m_p_root_node(NULL)
, m_p_search_tree(NULL)
, m_search_tree_constructed(false)
, m_default_search_tree_constructed(false)
, m_need_build(false)
{
// Insert each primitive into tree
insert(first, beyond);
}
template<typename Tr>
template<typename ConstPrimitiveIterator, typename T1>
AABB_tree<Tr>::AABB_tree(ConstPrimitiveIterator first,
ConstPrimitiveIterator beyond,
T1& t1)
: m_traits()
, m_primitives()
, m_p_root_node(NULL)
, m_p_search_tree(NULL)
, m_search_tree_constructed(false)
, m_default_search_tree_constructed(false)
, m_need_build(false)
{
// Insert each primitive into tree
insert(first, beyond,t1);
}
template<typename Tr>
template<typename ConstPrimitiveIterator, typename T1, typename T2>
AABB_tree<Tr>::AABB_tree(ConstPrimitiveIterator first,
ConstPrimitiveIterator beyond,
T1& t1,T2& t2)
: m_traits()
, m_primitives()
, m_p_root_node(NULL)
, m_p_search_tree(NULL)
, m_search_tree_constructed(false)
, m_default_search_tree_constructed(false)
, m_need_build(false)
{
// Insert each primitive into tree
insert(first, beyond,t1,t2);
}
template<typename Tr>
template<typename ConstPrimitiveIterator, typename T1, typename T2, typename T3>
AABB_tree<Tr>::AABB_tree(ConstPrimitiveIterator first,
ConstPrimitiveIterator beyond,
T1& t1,T2& t2,T3& t3)
: m_traits()
, m_primitives()
, m_p_root_node(NULL)
, m_p_search_tree(NULL)
, m_search_tree_constructed(false)
, m_default_search_tree_constructed(false)
, m_need_build(false)
{
// Insert each primitive into tree
insert(first, beyond,t1,t2,t3);
}
template<typename Tr>
template<typename ConstPrimitiveIterator, typename T1, typename T2, typename T3, typename T4>
AABB_tree<Tr>::AABB_tree(ConstPrimitiveIterator first,
ConstPrimitiveIterator beyond,
T1& t1,T2& t2,T3& t3,T4& t4)
: m_traits()
, m_primitives()
, m_p_root_node(NULL)
, m_p_search_tree(NULL)
, m_search_tree_constructed(false)
, m_default_search_tree_constructed(false)
, m_need_build(false)
{
// Insert each primitive into tree
insert(first, beyond,t1,t2,t3,t4);
}
template<typename Tr>
template<typename ConstPrimitiveIterator, typename T1, typename T2, typename T3, typename T4, typename T5>
AABB_tree<Tr>::AABB_tree(ConstPrimitiveIterator first,
ConstPrimitiveIterator beyond,
T1& t1,T2& t2,T3& t3,T4& t4,T5& t5)
: m_traits()
, m_primitives()
, m_p_root_node(NULL)
, m_p_search_tree(NULL)
, m_search_tree_constructed(false)
, m_default_search_tree_constructed(false)
, m_need_build(false)
{
// Insert each primitive into tree
insert(first, beyond,t1,t2,t3,t4,t5);
}
//=============insert======================
template<typename Tr>
template<typename ConstPrimitiveIterator>
void AABB_tree<Tr>::insert(ConstPrimitiveIterator first,
ConstPrimitiveIterator beyond)
{
set_shared_data();
while(first != beyond)
{
m_primitives.push_back(Primitive(first));
++first;
}
m_need_build = true;
}
template<typename Tr>
template<typename ConstPrimitiveIterator, typename T1>
void AABB_tree<Tr>::insert(ConstPrimitiveIterator first,
ConstPrimitiveIterator beyond,
T1& t1)
{
set_shared_data(t1);
while(first != beyond)
{
m_primitives.push_back(Primitive(first,t1));
++first;
}
m_need_build = true;
}
template<typename Tr>
template<typename ConstPrimitiveIterator, typename T1, typename T2>
void AABB_tree<Tr>::insert(ConstPrimitiveIterator first,
ConstPrimitiveIterator beyond,
T1& t1, T2& t2)
{
set_shared_data(t1,t2);
while(first != beyond)
{
m_primitives.push_back(Primitive(first,t1,t2));
++first;
}
m_need_build = true;
}
template<typename Tr>
template<typename ConstPrimitiveIterator, typename T1, typename T2, typename T3>
void AABB_tree<Tr>::insert(ConstPrimitiveIterator first,
ConstPrimitiveIterator beyond,
T1& t1,T2& t2,T3& t3)
{
set_shared_data(t1,t2,t3);
while(first != beyond)
{
m_primitives.push_back(Primitive(first,t1,t2,t3));
++first;
}
m_need_build = true;
}
template<typename Tr>
template<typename ConstPrimitiveIterator, typename T1, typename T2, typename T3, typename T4>
void AABB_tree<Tr>::insert(ConstPrimitiveIterator first,
ConstPrimitiveIterator beyond,
T1& t1,T2& t2,T3& t3,T4& t4)
{
set_shared_data(t1,t2,t3,t4);
while(first != beyond)
{
m_primitives.push_back(Primitive(first,t1,t2,t3,t4));
++first;
}
m_need_build = true;
}
template<typename Tr>
template<typename ConstPrimitiveIterator, typename T1, typename T2, typename T3, typename T4, typename T5>
void AABB_tree<Tr>::insert(ConstPrimitiveIterator first,
ConstPrimitiveIterator beyond,
T1& t1,T2& t2,T3& t3,T4& t4,T5& t5)
{
set_shared_data(t1,t2,t3,t4,t5);
while(first != beyond)
{
m_primitives.push_back(Primitive(first,t1,t2,t3,t4,t5));
++first;
}
m_need_build = true;
}
//=============rebuild======================
template<typename Tr>
template<typename ConstPrimitiveIterator>
void AABB_tree<Tr>::rebuild(ConstPrimitiveIterator first,
ConstPrimitiveIterator beyond)
{
// cleanup current tree and internal KD tree
clear();
// inserts primitives
insert(first, beyond);
build();
}
template<typename Tr>
template<typename ConstPrimitiveIterator, typename T1>
void AABB_tree<Tr>::rebuild(ConstPrimitiveIterator first,
ConstPrimitiveIterator beyond,
T1& t1)
{
// cleanup current tree and internal KD tree
clear();
// inserts primitives
insert(first, beyond,t1);
build();
}
template<typename Tr>
template<typename ConstPrimitiveIterator, typename T1, typename T2>
void AABB_tree<Tr>::rebuild(ConstPrimitiveIterator first,
ConstPrimitiveIterator beyond,
T1& t1, T2& t2)
{
// cleanup current tree and internal KD tree
clear();
// inserts primitives
insert(first, beyond,t1,t2);
build();
}
template<typename Tr>
template<typename ConstPrimitiveIterator, typename T1, typename T2, typename T3>
void AABB_tree<Tr>::rebuild(ConstPrimitiveIterator first,
ConstPrimitiveIterator beyond,
T1& t1,T2& t2,T3& t3)
{
// cleanup current tree and internal KD tree
clear();
// inserts primitives
insert(first, beyond,t1,t2,t3);
build();
}
template<typename Tr>
template<typename ConstPrimitiveIterator, typename T1, typename T2, typename T3, typename T4>
void AABB_tree<Tr>::rebuild(ConstPrimitiveIterator first,
ConstPrimitiveIterator beyond,
T1& t1,T2& t2,T3& t3,T4& t4)
{
// cleanup current tree and internal KD tree
clear();
// inserts primitives
insert(first, beyond,t1,t2,t3,t4);
build();
}
template<typename Tr>
template<typename ConstPrimitiveIterator, typename T1, typename T2, typename T3, typename T4, typename T5>
void AABB_tree<Tr>::rebuild(ConstPrimitiveIterator first,
ConstPrimitiveIterator beyond,
T1& t1,T2& t2,T3& t3,T4& t4,T5& t5)
{
// cleanup current tree and internal KD tree
clear();
// inserts primitives
insert(first, beyond,t1,t2,t3,t4,t5);
build();
}
//overloads calling set_shared_data()
template<typename Tr>
template<typename T1>
void AABB_tree<Tr>::build(T1& t1)
{
set_shared_data(t1);
build();
}
template<typename Tr>
template<typename T1, typename T2>
void AABB_tree<Tr>::build(T1& t1, T2& t2)
{
set_shared_data(t1, t2);
build();
}
template<typename Tr>
template<typename T1, typename T2, typename T3>
void AABB_tree<Tr>::build(T1& t1, T2& t2, T3& t3)
{
set_shared_data(t1, t2, t3);
build();
}
template<typename Tr>
template<typename T1, typename T2, typename T3, typename T4>
void AABB_tree<Tr>::build(T1& t1, T2& t2, T3& t3, T4& t4)
{
set_shared_data(t1, t2, t3, t4);
build();
}
template<typename Tr>
template<typename T1, typename T2, typename T3, typename T4, typename T5>
void AABB_tree<Tr>::build(T1& t1, T2& t2, T3& t3, T4& t4, T5& t5)
{
set_shared_data(t1, t2, t3, t4, t5);
build();
}
#endif
template<typename Tr>
void AABB_tree<Tr>::insert(const Primitive& p)
@ -1291,11 +842,7 @@ public:
template <typename Tr>
template <typename Query>
#if CGAL_INTERSECTION_VERSION < 2
boost::optional<typename AABB_tree<Tr>::Object_and_primitive_id>
#else
boost::optional< typename AABB_tree<Tr>::template Intersection_and_primitive_id<Query>::Type >
#endif
AABB_tree<Tr>::any_intersection(const Query& query) const
{
using namespace CGAL::internal::AABB_tree;

View File

@ -65,9 +65,7 @@ namespace CGAL
m_id = rhs.m_id;
}
#ifndef CGAL_CFG_NO_CPP0X_DELETED_AND_DEFAULT_FUNCTIONS
Decorated_point& operator=(const Decorated_point&)=default;
#endif
private:
Id m_id;

View File

@ -78,11 +78,7 @@ class First_intersection_traits
public:
typedef
#if CGAL_INTERSECTION_VERSION < 2
boost::optional<Object_and_primitive_id>
#else
boost::optional< typename AABBTraits::template Intersection_and_primitive_id<Query>::Type >
#endif
Result;
public:
First_intersection_traits(const AABBTraits& traits)
@ -137,11 +133,7 @@ public:
void intersection(const Query& query, const Primitive& primitive)
{
#if CGAL_INTERSECTION_VERSION < 2
boost::optional<Object_and_primitive_id>
#else
boost::optional< typename AABBTraits::template Intersection_and_primitive_id<Query>::Type >
#endif
intersection = m_traits.intersection_object()(query, primitive);
if(intersection)

View File

@ -104,17 +104,9 @@ void test_all_intersection_query_types(Tree& tree)
tree.all_intersected_primitives(segment,std::back_inserter(primitives));
// any_intersection
#if CGAL_INTERSECTION_VERSION < 2
typedef typename Tree::Object_and_primitive_id Object_and_primitive_id;
boost::optional<Object_and_primitive_id> optional_object_and_primitive;
optional_object_and_primitive = tree.any_intersection(ray);
optional_object_and_primitive = tree.any_intersection(line);
optional_object_and_primitive = tree.any_intersection(segment);
#else
boost::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id<Ray>::Type > r = tree.any_intersection(ray);
boost::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id<Line>::Type > l = tree.any_intersection(line);
boost::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id<Segment>::Type > s = tree.any_intersection(segment);
#endif
// any_intersected_primitive
boost::optional<typename Primitive::Id> optional_primitive;
@ -123,19 +115,12 @@ void test_all_intersection_query_types(Tree& tree)
optional_primitive = tree.any_intersected_primitive(segment);
// all_intersections
#if CGAL_INTERSECTION_VERSION < 2
std::list<Object_and_primitive_id> intersections;
tree.all_intersections(ray,std::back_inserter(intersections));
tree.all_intersections(line,std::back_inserter(intersections));
tree.all_intersections(segment,std::back_inserter(intersections));
#else
std::list< boost::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id<Ray>::Type > > intersections_r;
std::list< boost::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id<Line>::Type > > intersections_l;
std::list< boost::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id<Segment>::Type > > intersections_s;
tree.all_intersections(ray,std::back_inserter(intersections_r));
tree.all_intersections(line,std::back_inserter(intersections_l));
tree.all_intersections(segment,std::back_inserter(intersections_s));
#endif
}
@ -404,13 +389,8 @@ public:
Polyhedron_primitive_iterator it = Pr_generator().begin(p);
for ( ; it != Pr_generator().end(p) ; ++it )
{
#if CGAL_INTERSECTION_VERSION < 2
Intersection_result
intersection = Traits().intersection_object()(query, Pr(it,p));
#else
boost::optional< typename Traits::template Intersection_and_primitive_id<Query>::Type >
intersection = m_traits.intersection_object()(query, Pr(it,p));
#endif
if ( intersection )
*out++ = *intersection;
}
@ -717,11 +697,7 @@ private:
const Naive_implementation& naive) const
{
typedef
#if CGAL_INTERSECTION_VERSION < 2
Object_and_primitive_id
#else
typename Tree::AABB_traits::template Intersection_and_primitive_id<Query>::Type
#endif
Obj_type;
typedef
@ -759,11 +735,7 @@ private:
}
// Any intersection test (do not count time here)
#if CGAL_INTERSECTION_VERSION < 2
boost::optional<Object_and_primitive_id>
#else
boost::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id<Query>::Type >
#endif
intersection = tree.any_intersection(query);
// Check: verify we do get the result by naive method

View File

@ -1,5 +1,3 @@
#define CGAL_INTERSECTION_VERSION 2
#include <iostream>
#include <fstream>
#include <algorithm>
@ -40,11 +38,7 @@ struct FilterP {
template<typename ForwardIterator, typename Tree>
std::size_t intersect(ForwardIterator b, ForwardIterator e, const Tree& tree, long& counter) {
typedef
#if CGAL_INTERSECTION_VERSION < 2
typename Tree::Object_and_primitive_id
#else
typename Tree::AABB_traits::template Intersection_and_primitive_id<typename ForwardIterator::value_type>::Type
#endif
Obj_type;
std::vector<Obj_type> v;
@ -84,7 +78,7 @@ boost::tuple<std::size_t, std::size_t, std::size_t, long> test(const char* name)
std::vector<Point> points;
points.reserve(elements * 2);
CGAL::cpp11::copy_n(g, elements * 2, std::back_inserter(points));
std::copy_n(g, elements * 2, std::back_inserter(points));
// generate a bunch of happy random primitives
std::vector<Line> lines;

View File

@ -24,8 +24,6 @@
//
//******************************************************************************
#define CGAL_INTERSECTION_VERSION 1
#include <fstream>
#include <iostream>

View File

@ -24,8 +24,6 @@
//
//******************************************************************************
#define CGAL_INTERSECTION_VERSION 2
#include <fstream>
#include <iostream>

View File

@ -109,8 +109,8 @@ int main()
const double r = max_extent / 2;
// Generate NB_RAYS*2 points that lie on a sphere of radius r, centered around bbox_center
CGAL::Random rand = CGAL::Random(23); // fix the seed to yield the same results each run
CGAL::cpp11::copy_n(CGAL::Random_points_on_sphere_3<Point>(r, rand), NB_RAYS, std::back_inserter(v1));
CGAL::cpp11::copy_n(CGAL::Random_points_on_sphere_3<Point>(r, rand), NB_RAYS, std::back_inserter(v2));
std::copy_n(CGAL::Random_points_on_sphere_3<Point>(r, rand), NB_RAYS, std::back_inserter(v1));
std::copy_n(CGAL::Random_points_on_sphere_3<Point>(r, rand), NB_RAYS, std::back_inserter(v2));
for(std::vector<Point>::iterator it = v1.begin(); it != v1.end(); ++it) {
*it = *it + bbox_center;

View File

@ -2,7 +2,6 @@
#include <iostream>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Advancing_front_surface_reconstruction.h>
#include <boost/foreach.hpp>
struct Perimeter {
@ -64,15 +63,15 @@ int main(int argc, char* argv[])
reconstruction.run();
std::cout << reconstruction.number_of_outliers() << " outliers:\n" << std::endl;
BOOST_FOREACH(const Point_3& p, reconstruction.outliers()){
for(const Point_3& p : reconstruction.outliers()){
std::cout << p << std::endl;
}
std::cout << "Boundaries:" << std::endl ;
BOOST_FOREACH(const Vertex_on_boundary_range & vobr, reconstruction.boundaries()){
for(const Vertex_on_boundary_range& vobr : reconstruction.boundaries()){
std::cout << "boundary\n";
// As we use BOOST_FOREACH we do not use the type Boundary_range
BOOST_FOREACH(Vertex_handle v, vobr){
// As we use range-base loop we do not use the type Boundary_range
for(Vertex_handle v : vobr){
std::cout << v->point() << std::endl;
}
}

View File

@ -9,7 +9,7 @@
typedef CGAL::Simple_cartesian<double> K;
typedef K::Point_3 Point_3;
typedef CGAL::cpp11::array<std::size_t,3> Facet;
typedef std::array<std::size_t,3> Facet;
namespace std {
std::ostream&

View File

@ -37,7 +37,7 @@ typedef CGAL::Triangulation_data_structure_3<LVb,LCb> Tds;
typedef CGAL::Delaunay_triangulation_3<Kernel,Tds> Triangulation_3;
typedef Triangulation_3::Vertex_handle Vertex_handle;
typedef CGAL::cpp11::array<std::size_t,3> Facet;
typedef std::array<std::size_t,3> Facet;
// Functor to init the advancing front algorithm with indexed points

View File

@ -7,7 +7,7 @@
#include <CGAL/array.h>
#include <CGAL/disable_warnings.h>
typedef CGAL::cpp11::array<std::size_t,3> Facet;
typedef std::array<std::size_t,3> Facet;
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
typedef Kernel::Point_3 Point_3;

View File

@ -2488,7 +2488,7 @@ namespace CGAL {
\tparam PointInputIterator must be an input iterator with 3D points as value type. This point type must
be convertible to `Exact_predicates_inexact_constructions_kernel::Point_3` with the `Cartesian_converter`.
\tparam IndicesOutputIterator must be an output iterator to which
`CGAL::cpp11::array<std::size_t, 3>` can be assigned.
`std::array<std::size_t, 3>` can be assigned.
\param b iterator on the first point of the sequence
\param e past the end iterator of the point sequence
@ -2540,7 +2540,7 @@ namespace CGAL {
\tparam PointInputIterator must be an input iterator with 3D points as value type. This point type must
be convertible to `Exact_predicates_inexact_constructions_kernel::Point_3` with the `Cartesian_converter`.
\tparam IndicesOutputIterator must be an output iterator to which
`CGAL::cpp11::array<std::size_t, 3>` can be assigned.
`std::array<std::size_t, 3>` can be assigned.
\tparam Priority must be a functor with `double operator()(AdvancingFront,Cell_handle,int)` returning the
priority of the facet `(Cell_handle,int)`.

View File

@ -9,7 +9,7 @@
typedef CGAL::Simple_cartesian<double> K;
typedef CGAL::cpp11::array<std::size_t,3> Facet;
typedef std::array<std::size_t,3> Facet;
namespace std {
std::ostream&

View File

@ -8,7 +8,7 @@
typedef CGAL::Simple_cartesian<double> K;
typedef K::Point_3 Point_3;
typedef CGAL::cpp11::array<std::size_t,3> Facet;
typedef std::array<std::size_t,3> Facet;
namespace std {
std::ostream&

View File

@ -12,7 +12,7 @@ typedef K::Point_3 Point_3;
typedef CGAL::Polyhedron_3<K> Polyhedron;
typedef CGAL::cpp11::array<std::size_t,3> Facet;
typedef std::array<std::size_t,3> Facet;
namespace std {
std::ostream&

View File

@ -23,7 +23,7 @@ public:
/*!
*/
typedef CGAL::cpp11::array<AlgebraicKernel_d_1::Bound, 4> result_type;
typedef std::array<AlgebraicKernel_d_1::Bound, 4> result_type;
/// @}
@ -31,7 +31,7 @@ typedef CGAL::cpp11::array<AlgebraicKernel_d_1::Bound, 4> result_type;
/// @{
/*!
The returned `CGAL::cpp11::array` \f$ [xl,xu,yl,yu]\f$ represents an open isolating box \f$ B=(xl,xu)\times(yl,yu)\f$
The returned `std::array` \f$ [xl,xu,yl,yu]\f$ represents an open isolating box \f$ B=(xl,xu)\times(yl,yu)\f$
for \f$ a\f$ with respect to \f$ f\f$.
\pre \f$ f(a)\neq0\f$
\post \f$ a \in B\f$.
@ -42,7 +42,7 @@ result_type
operator()( AlgebraicKernel_d_2::Algebraic_real_2 a, AlgebraicKernel_d_2::Polynomial_2 f);
/*!
The returned `CGAL::cpp11::array` \f$ [xl,xu,yl,yu]\f$ represents an open isolating box \f$ B=(xl,xu)\times(yl,yu)\f$
The returned `std::array` \f$ [xl,xu,yl,yu]\f$ represents an open isolating box \f$ B=(xl,xu)\times(yl,yu)\f$
for \f$ a\f$ with respect to the common solutions of \f$ f\f$ and \f$ g\f$.
It is not necessary that \f$ a\f$ is a common solution of \f$ f\f$ and \f$ g\f$.
\post \f$ a \in B\f$.

View File

@ -736,7 +736,7 @@ public:
public:
typedef CGAL::cpp11::array<Bound,4> result_type;
typedef std::array<Bound,4> result_type;
Isolate_2(const Algebraic_kernel_d_2* kernel)
: _m_kernel(kernel) {}

View File

@ -476,9 +476,7 @@ private:
log_C_eps_ = n.log_C_eps_;
}
#ifndef CGAL_CFG_NO_CPP0X_DELETED_AND_DEFAULT_FUNCTIONS
Self& operator= (const Self&) = delete;
#endif
}; // struct Bitstream_descartes_E08_node

View File

@ -567,9 +567,7 @@ private:
log_C_eps_ = n.log_C_eps_;
}
#ifndef CGAL_CFG_NO_CPP0X_DELETED_AND_DEFAULT_FUNCTIONS
Self& operator= (const Self&)=delete;
#endif
}; // struct Bitstream_descartes_rndl_node

View File

@ -62,7 +62,7 @@ struct Interval_evaluate_1 : public CGAL::cpp98::binary_function
}
result_type operator()(const Polynomial_1& p,
const CGAL::cpp11::array< Bound, 2 >& b) const {
const std::array< Bound, 2 >& b) const {
typename CT::Cast cast;
@ -79,7 +79,7 @@ struct Interval_evaluate_1 : public CGAL::cpp98::binary_function
Coefficient_const_iterator_range range =
typename PT_1::Construct_coefficient_const_iterator_range()(p);
Coefficient_const_iterator it = CGAL::cpp11::prev(range.second);
Coefficient_const_iterator it = std::prev(range.second);
Coercion_interval res(cast(*it));

View File

@ -41,7 +41,7 @@ namespace internal {
template<typename Polynomial_2, typename Bound>
struct Interval_evaluate_2 : public CGAL::cpp98::binary_function
<Polynomial_2,CGAL::cpp11::array<Bound,4>,
<Polynomial_2,std::array<Bound,4>,
std::pair<typename CGAL::Coercion_traits<typename CGAL::Polynomial_traits_d<Polynomial_2>::Innermost_coefficient_type,Bound>::Type,
typename CGAL::Coercion_traits<typename CGAL::Polynomial_traits_d<Polynomial_2>::Innermost_coefficient_type,Bound>::Type> > {
@ -58,7 +58,7 @@ public:
typedef std::pair< Coercion_type, Coercion_type > result_type;
result_type operator()(const Polynomial_2& p,
const CGAL::cpp11::array< Bound, 4 >& b) const {
const std::array< Bound, 4 >& b) const {
typename CT::Cast cast;
@ -87,7 +87,7 @@ public:
Coefficient_const_iterator_range range =
typename PT_2::Construct_coefficient_const_iterator_range()(p);
Coefficient_const_iterator it = CGAL::cpp11::prev(range.second);
Coefficient_const_iterator it = std::prev(range.second);
Interval_result_type initial_pair = interval_evaluate_1(*it,x_pair);
Coercion_interval res(initial_pair.first,initial_pair.second);

View File

@ -48,7 +48,7 @@ void test_algebraic_kernel_2(const AlgebraicKernel_2& ak_2) {
typedef typename AK_2::Coefficient Coefficient;
typedef typename AK_2::Bound Bound;
typedef std::pair<Bound,Bound> BInterval;
typedef CGAL::cpp11::array<Bound, 4> BArray;
typedef std::array<Bound, 4> BArray;
typedef typename AK_2::Polynomial_1 Polynomial_1;
typedef typename AK_2::Polynomial_2 Polynomial_2;
typedef typename AK_2::Algebraic_real_1 Algebraic_real_1;

View File

@ -107,7 +107,7 @@ bool file_input(OutputIterator out)
int n;
is >> n;
std::cout << "Reading " << n << " points from file" << std::endl;
CGAL::cpp11::copy_n(std::istream_iterator<Point>(is), n, out);
std::copy_n(std::istream_iterator<Point>(is), n, out);
return true;
}

View File

@ -50,7 +50,7 @@ bool file_input(OutputIterator out)
int n;
is >> n;
std::cout << "Reading " << n << " points from file" << std::endl;
CGAL::cpp11::copy_n(std::istream_iterator<Point>(is), n, out);
std::copy_n(std::istream_iterator<Point>(is), n, out);
return true;
}

View File

@ -52,7 +52,7 @@ bool file_input(OutputIterator out)
int n;
is >> n;
std::cout << "Reading " << n << " points from file" << std::endl;
CGAL::cpp11::copy_n(std::istream_iterator<Point>(is), n, out);
std::copy_n(std::istream_iterator<Point>(is), n, out);
return true;
}

View File

@ -97,7 +97,7 @@ file_input(OutputIterator out)
int n;
is >> n;
std::cout << "Reading " << n << " points from file" << std::endl;
CGAL::cpp11::copy_n(std::istream_iterator<Point>(is), n, out);
std::copy_n(std::istream_iterator<Point>(is), n, out);
return true;
}

View File

@ -19,7 +19,7 @@ int main(int argc, char** argv)
#endif
// Import resources from libCGALQt (Qt5).
// See http://doc.qt.io/qt-5/qdir.html#Q_INIT_RESOURCE
// See https://doc.qt.io/qt-5/qdir.html#Q_INIT_RESOURCE
CGAL_QT_INIT_RESOURCES;
Q_INIT_RESOURCE(Alpha_shape_3);

View File

@ -10,7 +10,6 @@
#include <boost/unordered_set.hpp>
#include <boost/unordered_map.hpp>
#include <boost/foreach.hpp>
typedef CGAL::Exact_predicates_inexact_constructions_kernel Gt;
@ -73,7 +72,7 @@ int main()
as.get_alpha_shape_facets(std::back_inserter( regular_facets ), Alpha_shape_3::REGULAR );
std::vector<Alpha_shape_3::Facet> filtered_regular_facets;
BOOST_FOREACH(Alpha_shape_3::Facet f, regular_facets)
for(Alpha_shape_3::Facet f : regular_facets)
{
if ( marked_cells.count(f.first)==1 )
filtered_regular_facets.push_back(f);
@ -90,7 +89,7 @@ int main()
boost::unordered_map< Alpha_shape_3::Vertex_handle, std::size_t> vids;
points.clear();
BOOST_FOREACH(Alpha_shape_3::Facet f, filtered_regular_facets)
for(Alpha_shape_3::Facet f : filtered_regular_facets)
{
for (int i=1;i<4; ++i)
{
@ -104,7 +103,7 @@ int main()
std::ofstream output("out.off");
output << "OFF\n " << points.size() << " " << filtered_regular_facets.size() << " 0\n";
std::copy(points.begin(), points.end(), std::ostream_iterator<Point>(output, "\n"));
BOOST_FOREACH(const Alpha_shape_3::Facet& f, filtered_regular_facets)
for(const Alpha_shape_3::Facet& f : filtered_regular_facets)
{
output << 3;

View File

@ -979,8 +979,8 @@ public:
template<class OutputIterator>
OutputIterator filtration(OutputIterator it) const
{
Dispatch_or_drop_output_iterator<cpp11::tuple<CGAL::Object>, cpp11::tuple<OutputIterator> > out(it);
return cpp11::template get<0>( filtration_with_alpha_values(out) );
Dispatch_or_drop_output_iterator<std::tuple<CGAL::Object>, std::tuple<OutputIterator> > out(it);
return std::template get<0>( filtration_with_alpha_values(out) );
}
private:

View File

@ -479,7 +479,7 @@ void xAlci_main_window::setup(int w, int h)
tab_widget->addTab(cad_tab,"cad");
tab_widget->addTab(arr_tab,"arrangement");
*widget << CGAL::LineWidth(2) << CGAL::BackgroundColor(CGAL::WHITE);
*widget << CGAL::LineWidth(2) << CGAL::BackgroundColor(CGAL::white());
resize(w,h);
double ratio = 1.0;//(double)h/w;
widget->set_window(-1, 1, -ratio, ratio, true);

View File

@ -277,11 +277,11 @@ inline std::ostream & operator<<(std::ostream & os, const Arr::Vertex & vertex)
inline Window_stream & operator<<(Window_stream & ws, Arr & arr)
{
Arr::Edge_iterator ei;
ws << CGAL::BLUE;
ws << CGAL::blue();
for (ei = arr.edges_begin(); ei != arr.edges_end(); ++ei)
ws << (*ei).curve();
Arr::Vertex_iterator vi;
ws << CGAL::RED;
ws << CGAL::red();
for (vi = arr.vertices_begin(); vi != arr.vertices_end(); ++vi)
ws << (*vi).point();
return ws;
@ -474,7 +474,7 @@ public:
m_window->flush();
#else
m_window->lock();
*m_window << CGAL::BackgroundColor(CGAL::WHITE) << CGAL::RED;
*m_window << CGAL::BackgroundColor(CGAL::white()) << CGAL::red();
(*m_window) << arr;
m_window->unlock();
App->flush();
@ -490,9 +490,9 @@ public:
ps_stream.set_line_width(1);
CGAL::Arr_drawer<Arr, CGAL::Postscript_file_stream> drawer(ps_stream);
// drawer.draw_faces(arr.faces_begin(), arr.faces_end());
ps_stream << CGAL::BLUE;
ps_stream << CGAL::blue();
drawer.draw_halfedges(arr.halfedges_begin(), arr.halfedges_end());
ps_stream << CGAL::RED;
ps_stream << CGAL::red();
drawer.draw_vertices(arr.vertices_begin(), arr.vertices_end());
// draw_arr(arr, drawer, ps_stream);

View File

@ -34,7 +34,7 @@ OverlayDialog::OverlayDialog( ArrangementDemoWindow* parent,
ui( new Ui::OverlayDialog )
{
// An extra parenthesis around QColor to avoid the
// http://en.wikipedia.org/wiki/Most_vexing_parse
// https://en.wikipedia.org/wiki/Most_vexing_parse
// on clang
QBrush segColor( ( QColor( ::Qt::red ) ) );
QBrush polyColor( ( QColor( ::Qt::darkGreen ) ) );

View File

@ -10,7 +10,7 @@ of both types
`CGAL::Line_arc_2<CircularKernel>` or
`CGAL::Circular_arc_2<CircularKernel>`.
It uses the <A HREF="http://www.boost.org/doc/html/variant.html">boost::variant</A>.
It uses the <A HREF="https://www.boost.org/doc/html/variant.html">boost::variant</A>.
\cgalModels `ArrangementTraits_2`

View File

@ -208,82 +208,6 @@ public:
// defining a type that inherits from the template we need to alias. However,
// the non-C++11 code requires the (re)definition of all constructors of the
// derived class.
#if defined(CGAL_CFG_NO_CPP0X_TEMPLATE_ALIASES)
// Type definition for the construction surface-sweep visitor.
template <typename Evt, typename Crv>
struct Construction_helper :
public Arr_bounded_planar_construction_helper<Gt2, Arr, Evt, Crv>
{
typedef Arr_bounded_planar_construction_helper<Gt2, Arr, Evt, Crv>
Base;
Construction_helper(Arr* arr) : Base(arr) {}
};
// Type definition for the no-intersection construction surface-sweep visitor.
template <typename Evt, typename Crv>
struct No_intersection_construction_helper :
public Arr_bounded_planar_construction_helper<Gt2, Arr, Evt, Crv>
{
typedef Arr_bounded_planar_construction_helper<Gt2, Arr, Evt, Crv>
Base;
No_intersection_construction_helper(Arr* arr) : Base(arr) {}
};
// Type definition for the insertion surface-sweep visitor.
typedef Arr_insertion_traits_2<Gt2, Arr> I_traits;
template <typename Evt, typename Crv>
struct Insertion_helper :
public Arr_bounded_planar_insertion_helper<I_traits, Arr, Evt, Crv>
{
typedef Arr_bounded_planar_insertion_helper<I_traits, Arr, Evt, Crv>
Base;
Insertion_helper(Arr* arr) : Base(arr) {}
};
// Type definition for the no-intersection insertion surface-sweep visitor.
typedef Arr_basic_insertion_traits_2<Gt2, Arr> Nxi_traits;
template <typename Evt, typename Crv>
struct No_intersection_insertion_helper :
public Arr_bounded_planar_insertion_helper<Nxi_traits, Arr, Evt, Crv>
{
typedef Arr_bounded_planar_insertion_helper<Nxi_traits, Arr, Evt, Crv>
Base;
No_intersection_insertion_helper(Arr* arr) : Base(arr) {}
};
// Type definition for the batched point-location surface-sweep visitor.
typedef Arr_batched_point_location_traits_2<Arr> Bpl_traits;
template <typename Evt, typename Crv>
struct Batched_point_location_helper :
public Arr_bounded_planar_batched_pl_helper<Bpl_traits, Arr, Evt, Crv>
{
typedef Arr_bounded_planar_batched_pl_helper<Bpl_traits, Arr, Evt, Crv>
Base;
Batched_point_location_helper(const Arr* arr) : Base(arr) {}
};
// Type definition for the vertical decomposition sweep-line visitor.
typedef Arr_batched_point_location_traits_2<Arr> Vd_traits;
template <typename Evt, typename Crv>
struct Vertical_decomposition_helper :
public Arr_bounded_planar_vert_decomp_helper<Vd_traits, Arr, Evt, Crv>
{
typedef Arr_bounded_planar_vert_decomp_helper<Vd_traits, Arr, Evt, Crv>
Base;
Vertical_decomposition_helper(const Arr* arr) : Base(arr) {}
};
// Type definition for the overlay surface-sweep visitor.
template <typename Gt, typename Evt, typename Crv,
typename ArrA, typename ArrB>
struct Overlay_helper :
public Arr_bounded_planar_overlay_helper<Gt, ArrA, ArrB, Arr, Evt, Crv>
{
typedef Arr_bounded_planar_overlay_helper<Gt, ArrA, ArrB, Arr, Evt, Crv>
Base;
Overlay_helper(const ArrA* arr_a, const ArrB* arr_b) : Base(arr_a, arr_b) {}
};
#else
// Type definition for the construction surface-sweep visitor.
template <typename Evt, typename Crv>
using Construction_helper =
@ -323,7 +247,6 @@ public:
typename ArrA, typename ArrB>
using Overlay_helper =
Arr_bounded_planar_overlay_helper<Gt, ArrA, ArrB, Arr, Evt, Crv>;
#endif
//@}
public:

View File

@ -109,9 +109,7 @@ public:
Point_handle (p)
{}
#ifndef CGAL_CFG_NO_CPP0X_DELETED_AND_DEFAULT_FUNCTIONS
_One_root_point_2& operator=(const _One_root_point_2&)=default;
#endif
/*! Constructor of a point with one-root coefficients.
This constructor of a point can also be used with rational coefficients

View File

@ -232,9 +232,7 @@ public:
Rational_function (const Self & r)
: Base(static_cast<const Base &> (r)) {}
#ifndef CGAL_CFG_NO_CPP0X_DELETED_AND_DEFAULT_FUNCTIONS
Self& operator=(const Self&)=default;
#endif
CGAL::Sign sign_at(const Algebraic_real_1& x,
CGAL::Sign epsilon = CGAL::ZERO) const

View File

@ -321,7 +321,6 @@ public:
// the non-C++11 code requires the (re)definition of all constructors of the
// derived class. The non-C++11 code follows the commented out C++11 code.
// When we move to C++11 we can use the more elgant code.
#if defined(CGAL_CFG_NO_CPP0X_TEMPLATE_ALIASES)
// Type definition for the construction surface-sweep visitor.
template <typename Evt, typename Crv>
struct Construction_helper :
@ -396,47 +395,6 @@ public:
Base;
Overlay_helper(const ArrA* arr_a, const ArrB* arr_b) : Base(arr_a, arr_b) {}
};
#else
// Type definition for the construction surface-sweep visitor.
template <typename Evt, typename Crv>
using Construction_helper =
Arr_spherical_construction_helper<Gt2, Arr, Evt, Crv>;
// Type definition for the no-intersection construction surface-sweep visitor.
template <typename Evt, typename Crv>
using No_intersection_construction_helper =
Arr_spherical_construction_helper<Gt2, Arr, Evt, Crv>;
// Type definition for the insertion surface-sweep visitor.
typedef Arr_insertion_traits_2<Gt2, Arr> I_traits;
template <typename Evt, typename Crv>
using Insertion_helper =
Arr_spherical_insertion_helper<I_traits, Arr, Evt, Crv>;
// Type definition for the no-intersection insertion surface-sweep visitor.
typedef Arr_basic_insertion_traits_2<Gt2, Arr> Nxi_traits;
template <typename Evt, typename Crv>
using No_intersection_insertion_helper =
Arr_spherical_insertion_helper<Nxi_traits, Arr, Evt, Crv>;
// Type definition for the batched point-location surface-sweep visitor.
typedef Arr_batched_point_location_traits_2<Arr> Bpl_traits;
template <typename Evt, typename Crv>
using Batched_point_location_helper =
Arr_spherical_batched_pl_helper<Bpl_traits, Arr, Evt, Crv>;
// Type definition for the vertical decomposition surface-sweep visitor.
typedef Arr_batched_point_location_traits_2<Arr> Vd_traits;
template <typename Evt, typename Crv>
using Vertical_decomposition_helper =
Arr_spherical_vert_decomp_helper<Vd_traits, Arr, Evt, Crv>;
// Type definition for the overlay surface-sweep visitor.
template <typename Gt, typename Evt, typename Crv,
typename ArrA, typename ArrB>
using Overlay_helper =
Arr_spherical_overlay_helper<Gt, ArrA, ArrB, Arr, Evt, Crv>;
#endif
//@}
public:

View File

@ -226,82 +226,6 @@ public:
// defining a type that inherits from the template we need to alias. However,
// the non-C++11 code requires the (re)definition of all constructors of the
// derived class.
#if defined(CGAL_CFG_NO_CPP0X_TEMPLATE_ALIASES)
// Type definition for the construction surface-sweep visitor.
template <typename Evt, typename Crv>
struct Construction_helper :
public Arr_unb_planar_construction_helper<Gt2, Arr, Evt, Crv>
{
typedef Arr_unb_planar_construction_helper<Gt2, Arr, Evt, Crv>
Base;
Construction_helper(Arr* arr) : Base(arr) {}
};
// Type definition for the no-intersection construction surface-sweep visitor.
template <typename Evt, typename Crv>
struct No_intersection_construction_helper :
public Arr_unb_planar_construction_helper<Gt2, Arr, Evt, Crv>
{
typedef Arr_unb_planar_construction_helper<Gt2, Arr, Evt, Crv>
Base;
No_intersection_construction_helper(Arr* arr) : Base(arr) {}
};
// Type definition for the insertion surface-sweep visitor.
typedef Arr_insertion_traits_2<Gt2, Arr> I_traits;
template <typename Evt, typename Crv>
struct Insertion_helper :
public Arr_unb_planar_insertion_helper<I_traits, Arr, Evt, Crv>
{
typedef Arr_unb_planar_insertion_helper<I_traits, Arr, Evt, Crv>
Base;
Insertion_helper(Arr* arr) : Base(arr) {}
};
// Type definition for the no-intersection insertion surface-sweep visitor.
typedef Arr_basic_insertion_traits_2<Gt2, Arr> Nxi_traits;
template <typename Evt, typename Crv>
struct No_intersection_insertion_helper :
public Arr_unb_planar_insertion_helper<Nxi_traits, Arr, Evt, Crv>
{
typedef Arr_unb_planar_insertion_helper<Nxi_traits, Arr, Evt, Crv>
Base;
No_intersection_insertion_helper(Arr* arr) : Base(arr) {}
};
// Type definition for the batched point-location surface-sweep visitor.
typedef Arr_batched_point_location_traits_2<Arr> Bpl_traits;
template <typename Evt, typename Crv>
struct Batched_point_location_helper :
public Arr_unb_planar_batched_pl_helper<Bpl_traits, Arr, Evt, Crv>
{
typedef Arr_unb_planar_batched_pl_helper<Bpl_traits, Arr, Evt, Crv>
Base;
Batched_point_location_helper(const Arr* arr) : Base(arr) {}
};
// Type definition for the vertical decomposition surface-sweep visitor.
typedef Arr_batched_point_location_traits_2<Arr> Vd_traits;
template <typename Evt, typename Crv>
struct Vertical_decomposition_helper :
public Arr_unb_planar_vert_decomp_helper<Vd_traits, Arr, Evt, Crv>
{
typedef Arr_unb_planar_vert_decomp_helper<Vd_traits, Arr, Evt, Crv>
Base;
Vertical_decomposition_helper(const Arr* arr) : Base(arr) {}
};
// Type definition for the overlay surface-sweep visitor.
template <typename Gt, typename Evt, typename Crv,
typename ArrA, typename ArrB>
struct Overlay_helper :
public Arr_unb_planar_overlay_helper<Gt, ArrA, ArrB, Arr, Evt, Crv>
{
typedef Arr_unb_planar_overlay_helper<Gt, ArrA, ArrB, Arr, Evt, Crv>
Base;
Overlay_helper(const ArrA* arr_a, const ArrB* arr_b) : Base(arr_a, arr_b) {}
};
#else
// Type definition for the construction surface-sweep visitor.
template <typename Evt, typename Crv>
using Construction_helper =
@ -341,7 +265,6 @@ public:
typename ArrA, typename ArrB>
using Overlay_helper =
Arr_unb_planar_overlay_helper<Gt, ArrA, ArrB, Arr, Evt, Crv>;
#endif
//@}
public:

View File

@ -641,20 +641,6 @@ private:
#define QUERY_PL_TRAPEZOID_RIC_NO_GUARANTEE(obj)
#endif
#if defined(CGAL_CFG_NO_CPP0X_LAMBDAS)
#define MEASURE_NAIVE_PL(timer, op) op
#define MEASURE_SIMPLE_PL(timer, op) op
#define MEASURE_WALK_PL(timer, op) op
#define MEASURE_LM_PL(timer, op) op
#define MEASURE_LM_RANDOM_PL(timer, op) op
#define MEASURE_LM_GRID_PL(timer, op) op
#define MEASURE_LM_HALTON_PL(timer, op) op
#define MEASURE_LM_MIDDLE_EDGES_PL(timer, op) op
#define MEASURE_LM_SPECIFIED_POINTS_PL(timer, op) op
#define MEASURE_TRIANGULATION_PL(timer, op) op
#define MEASURE_TRAPEZOID_RIC_PL(timer, op) op
#define MEASURE_TRAPEZOID_RIC_NO_GUARANTEE_PL(timer, op) op
#else
#define MEASURE_NAIVE_PL(timer, op) measure<NAIVE_PL>(timer, [&](){ op; });
#define MEASURE_SIMPLE_PL(timer, op) measure<SIMPLE_PL>(timer, [&](){ op; });
#define MEASURE_WALK_PL(timer, op) measure<WALK_PL>(timer, [&](){ op; });
@ -675,7 +661,6 @@ private:
measure<TRAPEZOID_RIC_PL>(timer, [&](){ op; });
#define MEASURE_TRAPEZOID_RIC_NO_GUARANTEE_PL(timer, op) \
measure<TRAPEZOID_RIC_NO_GUARANTEE_PL>(timer, [&](){ op; });
#endif
//! Constructor.
template <typename GeomTraits, typename TopolTraits>

View File

@ -19,7 +19,6 @@ int main()
#include <CGAL/Arr_rational_function_traits_2.h> //Traits
#include <CGAL/Arrangement_2.h> //Arrangement
#include <CGAL/Surface_sweep_2_algorithms.h>
#include <boost/foreach.hpp>
typedef CGAL::CORE_arithmetic_kernel::Integer Number_type;
typedef CGAL::Algebraic_kernel_d_1<Number_type> AK1;
@ -303,19 +302,19 @@ int main()
curves.push_back(construct_curve_2(x*x*x));
curves.push_back(construct_curve_2(x*x*x, x*x-2));
BOOST_FOREACH(const Curve_2& curve, curves){
for(const Curve_2& curve : curves){
assert(CGAL::degree(curve.numerator()) >= 0);
}
CGAL::compute_subcurves(curves.begin(),curves.end(),
std::back_inserter(xcurves),false,traits);
BOOST_FOREACH(const X_monotone_curve_2& xcurve, xcurves) {
for(const X_monotone_curve_2& xcurve : xcurves) {
assert(CGAL::degree(xcurve.numerator()) >= 0);
}
CGAL::compute_intersection_points(curves.begin(),curves.end(),
std::back_inserter(points), false,
traits);
BOOST_FOREACH(const Point_2& point, points) {
for(const Point_2& point : points) {
assert(CGAL::degree(point.numerator()) >= 0);
}
}
@ -333,18 +332,18 @@ int main()
curves.push_back(construct_curve_2(x*x*x, x*x-2));
traits.cleanup_cache();
BOOST_FOREACH(const Curve_2& curve, curves){
for(const Curve_2& curve : curves){
assert(CGAL::degree(curve.numerator()) >= 0);
}
CGAL::compute_subcurves(curves.begin(), curves.end(),
std::back_inserter(xcurves), false, traits);
BOOST_FOREACH(const X_monotone_curve_2& xcurve, xcurves) {
for(const X_monotone_curve_2& xcurve : xcurves) {
assert(CGAL::degree(xcurve.numerator()) >= 0);
}
CGAL::compute_intersection_points(curves.begin(), curves.end(),
std::back_inserter(points), false,
traits);
BOOST_FOREACH(const Point_2& point, points) {
for(const Point_2& point : points) {
assert(CGAL::degree(point.numerator()) >= 0);
}

View File

@ -85,7 +85,7 @@ bool test_one_file(std::ifstream& in_file, bool /* verbose */)
std::cout.flush();
CGAL::insert_non_intersecting_curves(arr, xcurves.begin(), xcurves.end());
std::cout << "inserted" << std::endl;
BOOST_FOREACH(Halfedge_handle hh, arr.halfedge_handles())
for(Halfedge_handle hh : arr.halfedge_handles())
halfedges.push_back(hh);
#endif
@ -108,7 +108,7 @@ bool test_one_file(std::ifstream& in_file, bool /* verbose */)
{
std::cout << "Faces:" << std::endl;
BOOST_FOREACH(Arrangement_2::Face_handle fh, arr.face_handles())
for(Arrangement_2::Face_handle fh : arr.face_handles())
{
std::cout << " Face: "
<< &(fh)

View File

@ -22,7 +22,7 @@ struct Linear_cell_complex_bgl_min_items
typedef CGAL::Tag_true Darts_with_id;
typedef CGAL::Cell_attribute_with_point_and_id<LCC> Vertex_attrib;
typedef CGAL::Cell_attribute_with_id<LCC> Face_attrib;
typedef CGAL::cpp11::tuple<Vertex_attrib, void, Face_attrib> Attributes;
typedef std::tuple<Vertex_attrib, void, Face_attrib> Attributes;
};
};

View File

@ -4,7 +4,7 @@
\ingroup PkgBGLRef
The \sc{Bgl} defines the class template
<A HREF="http://www.boost.org/libs/graph/doc/graph_traits.html">`boost::graph_traits`</A>
<A HREF="https://www.boost.org/libs/graph/doc/graph_traits.html">`boost::graph_traits`</A>
as a uniform interface to the properties and types of %graph types.
We provide specializations of this class template for several \cgal data structures.
@ -162,7 +162,7 @@ with the default property map of \sc{Bgl} algorithms (obtained with
`get(t, boost::edge_weight)`) is the length of the edge,
the edge weight is not well defined for infinite edges. For algorithms
that make use of the edge weight, the user must therefore
define a <A HREF="http://www.boost.org/libs/graph/doc/filtered_graph.html">`boost::filtered_graph`</A> or pass a property map to the
define a <A HREF="https://www.boost.org/libs/graph/doc/filtered_graph.html">`boost::filtered_graph`</A> or pass a property map to the
algorithm that returns "infinity" for infinite edges.
| Member | Value | Description |

View File

@ -2,7 +2,6 @@
#include <CGAL/Iterator_range.h>
#include <CGAL/boost/graph/graph_traits_Linear_cell_complex_for_combinatorial_map.h>
#include <boost/foreach.hpp>
#include <iostream>
#include <fstream>
@ -37,17 +36,10 @@ void fct(const LCC& lcc)
{
vertex_range vr(vertices(lcc));
#ifndef CGAL_CFG_NO_CPP0X_RANGE_BASED_FOR
std::cout << "new for loop" << std::endl;
for(vertex_descriptor vd : vr){
std::cout << vd->point() << std::endl;
}
#endif
std::cout << "BOOST_FOREACH" << std::endl;
BOOST_FOREACH(vertex_descriptor vd, vr){
std::cout << vd->point() << std::endl;
}
std::cout << "boost::tie + std::for_each" << std::endl;
vertex_iterator vb, ve;

View File

@ -13,7 +13,6 @@
#include <iostream>
#include <fstream>
#include <boost/foreach.hpp>
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
@ -31,8 +30,8 @@ int main(int argc, char** argv )
std::vector<vertex_descriptor> V;
std::ifstream in((argc>1)?argv[1]:"in.off");
CGAL::read_off(in, mesh);
BOOST_FOREACH(vertex_descriptor vd, vertices(mesh)){
BOOST_FOREACH(halfedge_descriptor hd, CGAL::halfedges_around_target(vd,mesh)){
for(vertex_descriptor vd : vertices(mesh)){
for(halfedge_descriptor hd : CGAL::halfedges_around_target(vd,mesh)){
if(! CGAL::is_border(edge(hd,mesh),mesh)){
CGAL::Euler::flip_edge(hd,mesh);
CGAL::write_off((argc>2)?argv[2]:"out.off", mesh);

View File

@ -2,7 +2,6 @@
#include <CGAL/Polyhedron_3.h>
#include <CGAL/Iterator_range.h>
#include <boost/foreach.hpp>
#include <iostream>
#include <fstream>
@ -36,18 +35,11 @@ void fct(const Polyhedron& p)
{
vertex_range vr(vertices(p));
#ifndef CGAL_CFG_NO_CPP0X_RANGE_BASED_FOR
std::cout << "new for loop" << std::endl;
for(vertex_descriptor vd : vr){
std::cout << vd->point() << std::endl;
}
#endif
std::cout << "BOOST_FOREACH" << std::endl;
BOOST_FOREACH(vertex_descriptor vd, vr){
std::cout << vd->point() << std::endl;
}
std::cout << "boost::tie + std::for_each" << std::endl;
vertex_iterator vb, ve;

View File

@ -5,7 +5,6 @@
#include <fstream>
#include <boost/graph/connected_components.hpp>
#include <boost/foreach.hpp>
typedef CGAL::Simple_cartesian<double> Kernel;
typedef Kernel::Point_3 Point;
@ -24,7 +23,7 @@ int main(int argc, char* argv[])
int num = connected_components(sm, ccmap);
std::cout << num << " connected components" << std::endl;
BOOST_FOREACH(vertex_descriptor v, vertices(sm)){
for(vertex_descriptor v : vertices(sm)){
std::cout << v << " is in component " << ccmap[v] << std::endl;
}

View File

@ -5,7 +5,6 @@
#include <fstream>
#include <boost/graph/prim_minimum_spanning_tree.hpp>
#include <boost/foreach.hpp>
typedef CGAL::Simple_cartesian<double> Kernel;
typedef Kernel::Point_3 Point;
@ -36,14 +35,14 @@ int main(int argc, char* argv[])
" coord Coordinate {\n"
" point [ \n";
BOOST_FOREACH(vertex_descriptor vd, vertices(P)){
for(vertex_descriptor vd : vertices(P)){
std::cout << " " << P.point(vd) << "\n";
}
std::cout << " ]\n"
" }\n"
" coordIndex [\n";
BOOST_FOREACH(vertex_descriptor vd, vertices(P)){
for(vertex_descriptor vd : vertices(P)){
if(predecessor[vd]!=vd){
std::cout << " " << std::size_t(vd) << ", " << std::size_t(predecessor[vd]) << ", -1\n";
}

View File

@ -11,7 +11,6 @@
#include <fstream>
#include <vector>
#include <boost/foreach.hpp>
typedef CGAL::Simple_cartesian<double> Kernel;
typedef Kernel::Point_3 Point;
@ -72,43 +71,43 @@ int main(int argc, char* argv[])
std::cout << "opposite of seam halfedge in seam mesh: " << opposite(bhd, mesh) << std::endl;
std::cout << "vertices on one of the seams" << std::endl;
BOOST_FOREACH(halfedge_descriptor hd,
for(halfedge_descriptor hd :
halfedges_around_face(opposite(bhd, mesh), mesh)){
std::cout << target(hd.tmhd, sm) << " ";
}
std::cout << std::endl;
std::cout << "vertices around " << target(smhd , sm) << " in (base) mesh" << std::endl;
BOOST_FOREACH(SM_halfedge_descriptor hd, halfedges_around_target(smhd, sm)){
for(SM_halfedge_descriptor hd : halfedges_around_target(smhd, sm)){
std::cout << source(hd, sm) << " ";
}
std::cout << std::endl;
std::cout << "vertices around " << target(bhd , mesh) << " in seam mesh" << std::endl;
BOOST_FOREACH(halfedge_descriptor hd, halfedges_around_target(bhd, mesh)){
for(halfedge_descriptor hd : halfedges_around_target(bhd, mesh)){
std::cout << source(hd.tmhd, sm) << " ";
}
std::cout << std::endl;
std::cout << "vertices around " << source(smhd , sm) << " in (base) mesh" << std::endl;
BOOST_FOREACH(SM_halfedge_descriptor hd,
for(SM_halfedge_descriptor hd :
halfedges_around_source(source(smhd, sm), sm)){
std::cout << target(hd, sm) << " ";
}
std::cout << std::endl;
std::cout << "vertices around " << source(bhd , mesh) << " in seam mesh" << std::endl;
BOOST_FOREACH(halfedge_descriptor hd,
for(halfedge_descriptor hd :
halfedges_around_source(source(bhd, mesh), mesh)){
std::cout << target(hd.tmhd, sm) << " ";
}
std::cout << std::endl;
std::cout << "vertices around vertices in seam mesh" << std::endl;
BOOST_FOREACH(vertex_descriptor vd, vertices(mesh)){
for(vertex_descriptor vd : vertices(mesh)){
halfedge_descriptor hd = halfedge(vd, mesh);
std::cout << " " << vd << " has incident vertices:" << std::endl;
BOOST_FOREACH(halfedge_descriptor hd2, halfedges_around_target(hd, mesh)){
for(halfedge_descriptor hd2 : halfedges_around_target(hd, mesh)){
std::cout << " " << hd2;
}
std::cout << std::endl;
@ -118,19 +117,19 @@ int main(int argc, char* argv[])
std::cout << "the (base) mesh has: " << num_halfedges(sm) << " halfedges" << std::endl;
std::cout << "the seam mesh has: " << num_halfedges(mesh) << " halfedges" << std::endl;
std::cout << "halfedges in (base) mesh" << std::endl;
BOOST_FOREACH(SM_halfedge_descriptor hd, halfedges(sm)){
for(SM_halfedge_descriptor hd : halfedges(sm)){
std::cout << hd << " ";
}
std::cout << std::endl;
std::cout << "halfedges in seam mesh" << std::endl;
BOOST_FOREACH(halfedge_descriptor hd, halfedges(mesh)){
for(halfedge_descriptor hd : halfedges(mesh)){
std::cout << hd << " ";
}
std::cout << std::endl;
std::cout << "faces of the base and seam meshes" << std::endl;
BOOST_FOREACH(face_descriptor fd, faces(mesh)){
for(face_descriptor fd : faces(mesh)){
std::cout << fd << " ";
}
std::cout << std::endl;

View File

@ -8,7 +8,6 @@
#include <boost/graph/filtered_graph.hpp>
#include <boost/graph/connected_components.hpp>
#include <boost/foreach.hpp>
typedef CGAL::Simple_cartesian<double> Kernel;
typedef Kernel::Point_3 Point;
@ -52,19 +51,19 @@ int main(int argc, char* argv[])
std::cout << "dual has " << num_vertices(dual) << " vertices" << std::endl;
std::cout << "The vertices of dual are faces in primal"<< std::endl;
BOOST_FOREACH(boost::graph_traits<Dual>::vertex_descriptor dvd , vertices(dual)) {
for(boost::graph_traits<Dual>::vertex_descriptor dvd : vertices(dual)) {
std::cout << dvd << std::endl;
}
std::cout << "The edges in primal and dual with source and target" << std::endl;
BOOST_FOREACH(edge_descriptor e , edges(dual)) {
for(edge_descriptor e : edges(dual)) {
std::cout << e << " in primal: " << source(e,primal) << " -- " << target(e,primal) << " "
<< " in dual : " << source(e,finite_dual) << " -- " << target(e,finite_dual) << std::endl;
}
std::cout << "edges of the finite dual graph" << std::endl;
BOOST_FOREACH(boost::graph_traits<FiniteDual>::edge_descriptor e , edges(finite_dual)) {
for(boost::graph_traits<FiniteDual>::edge_descriptor e : CGAL::make_range(edges(finite_dual))) {
std::cout << e << " " << source(e,primal) << " " << source(e,finite_dual) << std::endl;
}
@ -74,7 +73,7 @@ int main(int argc, char* argv[])
int num = connected_components(finite_dual, fccmap);
std::cout << "The graph has " << num << " connected components (face connectivity)" << std::endl;
BOOST_FOREACH(face_descriptor f , faces(primal)) {
for(face_descriptor f : faces(primal)) {
std::cout << f << " in connected component " << fccmap[f] << std::endl;
}
@ -83,7 +82,7 @@ int main(int argc, char* argv[])
num = connected_components(primal, vccmap);
std::cout << "The graph has " << num << " connected components (edge connectvity)" << std::endl;
BOOST_FOREACH(vertex_descriptor v , vertices(primal)) {
for(vertex_descriptor v : vertices(primal)) {
std::cout << v << " in connected component " << vccmap[v] << std::endl;
}
return 0;

View File

@ -6,7 +6,6 @@
#include <fstream>
#include <boost/graph/connected_components.hpp>
#include <boost/foreach.hpp>
typedef CGAL::Simple_cartesian<double> Kernel;
typedef Kernel::Point_3 Point;

View File

@ -5,7 +5,6 @@
#include <CGAL/boost/graph/iterator.h>
#include <boost/graph/filtered_graph.hpp>
#include <boost/foreach.hpp>
typedef CGAL::Exact_predicates_inexact_constructions_kernel Epic;
@ -104,7 +103,7 @@ main(int,char*[])
Ppmap ppmap = get(boost::vertex_point, t);
BOOST_FOREACH(vertex_descriptor vd, vertices_around_target(*vertices(t).first, t)){
for(vertex_descriptor vd : vertices_around_target(*vertices(t).first, t)){
std::cout << ppmap[vd] << std::endl;
}

View File

@ -785,7 +785,7 @@ void fill_hole(typename boost::graph_traits<Graph>::halfedge_descriptor h,
typedef typename Traits::halfedge_descriptor halfedge_descriptor;
face_descriptor f = add_face(g);
BOOST_FOREACH(halfedge_descriptor hd, halfedges_around_face(h,g)){
for(halfedge_descriptor hd : halfedges_around_face(h,g)){
set_face(hd, f,g);
}
set_halfedge(f,h,g);

View File

@ -28,11 +28,9 @@
#include <CGAL/boost/graph/helpers.h>
#include <CGAL/Dynamic_property_map.h>
#include <CGAL/assertions.h>
#include <boost/foreach.hpp>
#include <boost/unordered_set.hpp>
#include <boost/graph/graph_traits.hpp>
#include <CGAL/boost/iterator/transform_iterator.hpp>
#include <boost/foreach.hpp>
#include <boost/iterator/filter_iterator.hpp>
#include <boost/dynamic_bitset.hpp>
#include <boost/range/has_range_iterator.hpp>
@ -286,12 +284,12 @@ struct Face_filtered_graph
selected_faces.reset();
selected_vertices.reset();
selected_halfedges.reset();
BOOST_FOREACH(face_descriptor fd, faces(_graph) )
for(face_descriptor fd : faces(_graph) )
{
if(get(face_patch_index_map, fd) == face_patch_id)
{
selected_faces.set(get(fimap, fd));
BOOST_FOREACH(halfedge_descriptor hd, halfedges_around_face(halfedge(fd, _graph), _graph))
for(halfedge_descriptor hd : halfedges_around_face(halfedge(fd, _graph), _graph))
{
selected_halfedges.set(get(himap, hd));
selected_halfedges.set(get(himap, opposite(hd, _graph)));
@ -325,12 +323,12 @@ struct Face_filtered_graph
boost::unordered_set<Patch_index> pids(boost::begin(selected_face_patch_indices),
boost::end(selected_face_patch_indices));
BOOST_FOREACH(face_descriptor fd, faces(_graph) )
for(face_descriptor fd : faces(_graph) )
{
if(pids.count(get(face_patch_index_map, fd)) != 0)
{
selected_faces.set(get(fimap, fd));
BOOST_FOREACH(halfedge_descriptor hd, halfedges_around_face(halfedge(fd, _graph), _graph))
for(halfedge_descriptor hd : halfedges_around_face(halfedge(fd, _graph), _graph))
{
selected_halfedges.set(get(himap, hd));
selected_halfedges.set(get(himap, opposite(hd, _graph)));
@ -353,10 +351,10 @@ struct Face_filtered_graph
selected_faces.reset();
selected_vertices.reset();
selected_halfedges.reset();
BOOST_FOREACH(face_descriptor fd, selection)
for(face_descriptor fd : selection)
{
selected_faces.set(get(fimap, fd));
BOOST_FOREACH(halfedge_descriptor hd, halfedges_around_face(halfedge(fd, _graph), _graph))
for(halfedge_descriptor hd : halfedges_around_face(halfedge(fd, _graph), _graph))
{
selected_halfedges.set(get(himap, hd));
selected_halfedges.set(get(himap, opposite(hd, _graph)));
@ -467,7 +465,7 @@ struct Face_filtered_graph
/// there is at most one connected set of selected faces.
bool is_selection_valid()
{
BOOST_FOREACH(vertex_descriptor vd, vertices(*this) )
for(vertex_descriptor vd : vertices(*this) )
{
face_descriptor first_selected = boost::graph_traits<Graph>::null_face();
bool first_unselected_found(false),

View File

@ -29,7 +29,6 @@
#include <CGAL/circulator.h>
#include <CGAL/Unique_hash_map.h>
#include <boost/foreach.hpp>
#include <boost/iterator/iterator_facade.hpp>
#include <boost/unordered_set.hpp>

View File

@ -72,7 +72,7 @@ void copy_face_graph_impl(const SourceMesh& sm, TargetMesh& tm,
tm_face_descriptor tm_null_face = boost::graph_traits<TargetMesh>::null_face();
//insert halfedges and create each vertex when encountering its halfedge
BOOST_FOREACH(sm_edge_descriptor sm_e, edges(sm))
for(sm_edge_descriptor sm_e : edges(sm))
{
tm_edge_descriptor tm_e = add_edge(tm);
sm_halfedge_descriptor sm_h = halfedge(sm_e, sm), sm_h_opp = opposite(sm_h, sm);
@ -121,7 +121,7 @@ void copy_face_graph_impl(const SourceMesh& sm, TargetMesh& tm,
}
}
//create faces and connect halfedges
BOOST_FOREACH(sm_face_descriptor sm_f, faces(sm))
for(sm_face_descriptor sm_f : faces(sm))
{
tm_face_descriptor tm_f = add_face(tm);
*f2f++=std::make_pair(sm_f, tm_f);
@ -131,7 +131,7 @@ void copy_face_graph_impl(const SourceMesh& sm, TargetMesh& tm,
set_halfedge(tm_f, tm_h_prev, tm);
CGAL_precondition(*halfedges_around_face(sm_h_i, sm).first == sm_h_i);
BOOST_FOREACH(sm_halfedge_descriptor sm_h, halfedges_around_face(sm_h_i, sm))
for(sm_halfedge_descriptor sm_h : halfedges_around_face(sm_h_i, sm))
{
tm_halfedge_descriptor tm_h = get(hmap, sm_h);
set_next(tm_h_prev, tm_h, tm);
@ -151,7 +151,7 @@ void copy_face_graph_impl(const SourceMesh& sm, TargetMesh& tm,
tm_halfedge_descriptor tm_h_prev = tm_h;
CGAL_precondition(*halfedges_around_face(sm_border_halfedges[i], sm).first == sm_border_halfedges[i]);
BOOST_FOREACH(sm_halfedge_descriptor sm_h,
for(sm_halfedge_descriptor sm_h :
halfedges_around_face(next(sm_border_halfedges[i], sm), sm))
{
CGAL_assertion(next(tm_h_prev, tm) == tm_h_prev);

View File

@ -10,7 +10,7 @@
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// https://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
//
// $URL$

View File

@ -22,7 +22,6 @@
#define CGAL_BOOST_GRAPH_HELPERS_H
#include <boost/foreach.hpp>
#include <boost/range/empty.hpp>
#include <CGAL/boost/graph/iterator.h>
#include <CGAL/boost/graph/properties.h>
@ -104,7 +103,7 @@ template <typename FaceGraph>
bool is_closed(const FaceGraph& g)
{
typedef typename boost::graph_traits<FaceGraph>::halfedge_descriptor halfedge_descriptor;
BOOST_FOREACH(halfedge_descriptor hd, halfedges(g)){
for(halfedge_descriptor hd : halfedges(g)){
if(is_border(hd,g)){
return false;
}
@ -131,7 +130,7 @@ template <typename FaceGraph>
{
typedef typename boost::graph_traits<FaceGraph>::vertex_descriptor vertex_descriptor;
typedef typename boost::graph_traits<FaceGraph>::halfedge_descriptor halfedge_descriptor;
BOOST_FOREACH(vertex_descriptor vd, vertices(g)){
for(vertex_descriptor vd : vertices(g)){
halfedge_descriptor hd = halfedge(vd,g);
if((hd == boost::graph_traits<FaceGraph>::null_halfedge()) ||
(! is_bivalent(hd,g))){
@ -161,7 +160,7 @@ template <typename FaceGraph>
{
typedef typename boost::graph_traits<FaceGraph>::vertex_descriptor vertex_descriptor;
typedef typename boost::graph_traits<FaceGraph>::halfedge_descriptor halfedge_descriptor;
BOOST_FOREACH(vertex_descriptor vd, vertices(g)){
for(vertex_descriptor vd : vertices(g)){
halfedge_descriptor hd = halfedge(vd,g);
if((hd == boost::graph_traits<FaceGraph>::null_halfedge()) ||
(! is_trivalent(halfedge(hd,g),g))){
@ -207,7 +206,7 @@ template <typename FaceGraph>
bool is_triangle_mesh(const FaceGraph& g)
{
typedef typename boost::graph_traits<FaceGraph>::face_descriptor face_descriptor;
BOOST_FOREACH(face_descriptor fd, faces(g)){
for(face_descriptor fd : faces(g)){
if(! is_triangle(halfedge(fd,g),g)){
return false;
}
@ -251,7 +250,7 @@ template <typename FaceGraph>
bool is_quad_mesh(const FaceGraph& g)
{
typedef typename boost::graph_traits<FaceGraph>::face_descriptor face_descriptor;
BOOST_FOREACH(face_descriptor fd, faces(g)){
for(face_descriptor fd : faces(g)){
if(! is_quad(halfedge(fd,g),g)){
return false;
}
@ -388,7 +387,7 @@ bool is_valid_halfedge_graph(const Graph& g, bool verb = false)
// All halfedges.
halfedges_size_type n = 0;
BOOST_FOREACH(halfedge_descriptor begin, halfedges(g)) {
for(halfedge_descriptor begin : halfedges(g)) {
if(!valid)
break;
verr << "halfedge " << n << std::endl;
@ -440,7 +439,7 @@ bool is_valid_halfedge_graph(const Graph& g, bool verb = false)
// All vertices.
vertex_size_type v = 0;
n = 0;
BOOST_FOREACH(vertex_descriptor vbegin, vertices(g)){
for(vertex_descriptor vbegin : vertices(g)){
if(!valid)
break;
verr << "vertex " << v << std::endl;
@ -480,7 +479,7 @@ bool is_valid_halfedge_graph(const Graph& g, bool verb = false)
// All halfedges.
n = 0;
BOOST_FOREACH(halfedge_descriptor i, halfedges(g)){
for(halfedge_descriptor i : halfedges(g)){
verr << "halfedge " << n << std::endl;
// At least triangular facets and distinct geometry.
valid = valid && ( next(i, g) != i);
@ -538,7 +537,7 @@ bool is_valid_face_graph(const Graph& g, bool verb = false)
faces_size_type f = 0;
std::size_t n = 0;
halfedges_size_type nb = 0;
BOOST_FOREACH(face_descriptor fbegin, faces(g)){
for(face_descriptor fbegin : faces(g)){
if(!valid)
break;
verr << "face " << f << std::endl;
@ -571,7 +570,7 @@ bool is_valid_face_graph(const Graph& g, bool verb = false)
if ( valid && f != num_f)
verr << "counting faces failed." << std::endl;
BOOST_FOREACH(halfedge_descriptor i, halfedges(g)){
for(halfedge_descriptor i : halfedges(g)){
//counting borders
if ( is_border(i, g))
++nb;
@ -619,7 +618,7 @@ bool is_valid_polygon_mesh(const Mesh& g, bool verb = false)
bool valid=is_valid_face_graph(g, verb);
//test for 2-manifoldness
// Distinct facets on each side of an halfedge.
BOOST_FOREACH(halfedge_descriptor i, halfedges(g)){
for(halfedge_descriptor i : halfedges(g)){
valid = valid && (face(i, g) != face(opposite(i, g), g));
if ( ! valid) {
verr << " both incident facets are equal." << std::endl;
@ -1383,9 +1382,9 @@ void swap_vertices(
halfedge_descriptor hq=halfedge(q, g);
halfedge_descriptor hp=halfedge(p, g);
BOOST_FOREACH(halfedge_descriptor h, halfedges_around_target(hq, g))
for(halfedge_descriptor h : halfedges_around_target(hq, g))
set_target(h, p, g);
BOOST_FOREACH(halfedge_descriptor h, halfedges_around_target(hp, g))
for(halfedge_descriptor h : halfedges_around_target(hp, g))
set_target(h, q, g);
set_halfedge(p, hq, g);
set_halfedge(q, hp, g);

View File

@ -22,7 +22,6 @@
#define CGAL_BOOST_GRAPH_IO_H
#include <boost/container/flat_map.hpp>
#include <boost/foreach.hpp>
#include <iostream>
#include <algorithm>
@ -87,15 +86,15 @@ bool write_wrl(std::ostream& os,
"coord Coordinate {\n"
"point [\n";
BOOST_FOREACH(vertex_descriptor v, vertices(g)){
for(vertex_descriptor v : vertices(g)){
os << get(vpm,v) << ",\n";
reindex[v]=n++;
}
os << "] #point\n"
"} #coord Coordinate\n"
"coordIndex [\n";
BOOST_FOREACH(face_descriptor f, faces(g)){
BOOST_FOREACH(vertex_descriptor v, vertices_around_face(halfedge(f,g),g)){
for(face_descriptor f : faces(g)){
for(vertex_descriptor v : vertices_around_face(halfedge(f,g),g)){
os << reindex[v] << ",";
}
os << "-1,\n";
@ -152,14 +151,14 @@ bool write_off(std::ostream& os,
os << "OFF\n" << nv << " " << nf << " 0\n";
boost::container::flat_map<vertex_descriptor,vertices_size_type> reindex;
int n = 0;
BOOST_FOREACH(vertex_descriptor v, vertices(g)){
for(vertex_descriptor v : vertices(g)){
os << get(vpm,v) << '\n';
reindex[v]=n++;
}
BOOST_FOREACH(face_descriptor f, faces(g)){
for(face_descriptor f : faces(g)){
os << degree(f,g);
BOOST_FOREACH(vertex_descriptor v, vertices_around_face(halfedge(f,g),g)){
for(vertex_descriptor v : vertices_around_face(halfedge(f,g),g)){
os << " " << reindex[v];
}
os << '\n';
@ -376,16 +375,16 @@ bool write_inp(std::ostream& os,
os << "*Part, name=" << name << "\n*Node\n";
boost::container::flat_map<vertex_descriptor,vertices_size_type> reindex;
int n = 1;
BOOST_FOREACH(vertex_descriptor v, vertices(g)){
for(vertex_descriptor v : vertices(g)){
Point_3 p = get(vpm,v);
os << n << ", " << p.x() << ", " << p.y() << ", " << p.z() << '\n';
reindex[v]=n++;
}
n = 1;
os << "*Element, type=" << type << std::endl;
BOOST_FOREACH(face_descriptor f, faces(g)){
for(face_descriptor f : faces(g)){
os << n++;
BOOST_FOREACH(vertex_descriptor v, vertices_around_face(halfedge(f,g),g)){
for(vertex_descriptor v : vertices_around_face(halfedge(f,g),g)){
os << ", " << reindex[v];
}
os << '\n';
@ -431,7 +430,7 @@ write_polys(std::ostream& os,
{
off += 3;
offsets.push_back(off);
BOOST_FOREACH(vertex_descriptor v,
for(vertex_descriptor v :
vertices_around_face(halfedge(*fit, mesh), mesh))
connectivity_table.push_back(V[v]);
}
@ -481,7 +480,7 @@ write_polys_tag(std::ostream& os,
fit != faces(mesh).end() ;
++fit )
{
BOOST_FOREACH(vertex_descriptor v,
for(vertex_descriptor v :
vertices_around_face(halfedge(*fit, mesh), mesh))
os << V[v] << " ";
}

View File

@ -6,7 +6,7 @@
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// https://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
// Copyright (c) 2007 GeometryFactory (France). All rights reserved.
//

View File

@ -6,7 +6,7 @@
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// https://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
// Copyright (c) 2007-2015 GeometryFactory (France). All rights reserved.
//

View File

@ -25,7 +25,6 @@
#include <CGAL/property_map.h>
#include <boost/graph/properties.hpp>
#include <boost/graph/graph_traits.hpp>
#include <boost/foreach.hpp>
#include <boost/type_traits/is_const.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include <CGAL/Dynamic_property_map.h>
@ -132,7 +131,7 @@ void init_face_indices(PolygonMesh& pm,
Tag)
{
typename boost::property_traits<FaceIndexMap>::value_type i = 0;
BOOST_FOREACH(typename boost::graph_traits<PolygonMesh>::face_descriptor fd,
for(typename boost::graph_traits<PolygonMesh>::face_descriptor fd :
faces(pm))
{
put(fid, fd, i);
@ -146,7 +145,7 @@ void init_vertex_indices(PolygonMesh& pm,
Tag)
{
typename boost::property_traits<VertexIndexMap>::value_type i = 0;
BOOST_FOREACH(typename boost::graph_traits<PolygonMesh>::vertex_descriptor vd,
for(typename boost::graph_traits<PolygonMesh>::vertex_descriptor vd :
vertices(pm))
{
put(vid, vd, i);
@ -160,7 +159,7 @@ void init_halfedge_indices(PolygonMesh& pm,
Tag)
{
typename boost::property_traits<HalfedgeIndexMap>::value_type i = 0;
BOOST_FOREACH(typename boost::graph_traits<PolygonMesh>::halfedge_descriptor hd,
for(typename boost::graph_traits<PolygonMesh>::halfedge_descriptor hd :
halfedges(pm))
{
put(hid, hd, i);

View File

@ -22,7 +22,6 @@
#define CGAL_BOOST_GRAPH_SELECTION_H
#include <boost/graph/graph_traits.hpp>
#include <boost/foreach.hpp>
#include <CGAL/boost/graph/iterator.h>
#include <boost/unordered_set.hpp>
@ -45,10 +44,10 @@ extract_selection_boundary(
typedef typename GT::face_descriptor face_descriptor;
typedef typename GT::halfedge_descriptor halfedge_descriptor;
BOOST_FOREACH(face_descriptor fd, face_range)
for(face_descriptor fd : face_range)
{
BOOST_FOREACH( halfedge_descriptor h,
halfedges_around_face(halfedge(fd, fg), fg) )
for(halfedge_descriptor h :
halfedges_around_face(halfedge(fd, fg), fg) )
{
halfedge_descriptor opp_hd = opposite(h, fg);
face_descriptor opp_fd = face( opp_hd, fg );
@ -114,7 +113,7 @@ expand_face_selection(
//collect faces around the target vertex of the selection boundary halfedges
std::set<face_descriptor> new_selection_set;
BOOST_FOREACH(halfedge_descriptor hd, selection_boundary_halfedges)
for(halfedge_descriptor hd : selection_boundary_halfedges)
{
face_descriptor fd=face(hd, fg);
while( !get(is_selected,fd) )
@ -128,7 +127,7 @@ expand_face_selection(
// extract unique selection
std::vector<face_descriptor> new_selection;
BOOST_FOREACH(face_descriptor fd, new_selection_set)
for(face_descriptor fd : new_selection_set)
{
*out++=fd;
new_selection.push_back(fd);
@ -184,7 +183,7 @@ reduce_face_selection(
//collect faces around the target vertex of the selection boundary halfedges
std::set<face_descriptor> elements_to_remove;
BOOST_FOREACH(halfedge_descriptor hd, selection_boundary_halfedges)
for(halfedge_descriptor hd : selection_boundary_halfedges)
{
hd = opposite(hd, fg);
face_descriptor fd=face( hd, fg );
@ -197,7 +196,7 @@ reduce_face_selection(
}
/// update is-selected attribute and output iterator
BOOST_FOREACH(face_descriptor fd, elements_to_remove)
for(face_descriptor fd : elements_to_remove)
{
*out++=fd;
put( is_selected, fd, false );
@ -205,7 +204,7 @@ reduce_face_selection(
// update the set of currently selected faces
std::vector<face_descriptor> new_selection;
BOOST_FOREACH(face_descriptor fd, current_selection)
for(face_descriptor fd : current_selection)
if ( !elements_to_remove.count(fd) )
new_selection.push_back(fd);
current_selection.swap(new_selection);
@ -239,7 +238,7 @@ select_incident_faces(
//collect faces around the target vertex of the selection boundary halfedges
std::set<face_descriptor> selection_set;
BOOST_FOREACH(halfedge_descriptor hd, hedges)
for(halfedge_descriptor hd : hedges)
{
halfedge_descriptor first = hd;
face_descriptor fd=face(hd, fg);
@ -294,15 +293,15 @@ expand_edge_selection(
//collect adjacent edges not already selected
std::set<edge_descriptor> new_selection_set;
BOOST_FOREACH(edge_descriptor ed, current_selection)
for(edge_descriptor ed : current_selection)
{
halfedge_descriptor hdi=halfedge(ed,fg);
BOOST_FOREACH(halfedge_descriptor hd, halfedges_around_source( hdi, fg))
for(halfedge_descriptor hd : halfedges_around_source( hdi, fg))
{
edge_descriptor ned=edge(hd, fg);
if (!get(is_selected, ned)) new_selection_set.insert(ned);
}
BOOST_FOREACH(halfedge_descriptor hd, halfedges_around_target( hdi, fg))
for(halfedge_descriptor hd : halfedges_around_target( hdi, fg))
{
edge_descriptor ned=edge(hd, fg);
if (!get(is_selected, ned)) new_selection_set.insert(ned);
@ -311,7 +310,7 @@ expand_edge_selection(
// extract unique selection
std::vector<edge_descriptor> new_selection;
BOOST_FOREACH(edge_descriptor ed, new_selection_set)
for(edge_descriptor ed : new_selection_set)
{
*out++=ed;
new_selection.push_back(ed);
@ -357,10 +356,10 @@ reduce_edge_selection(
// extract the set of vertices on the border
std::set<vertex_descriptor> unique_vertex_set;
BOOST_FOREACH(edge_descriptor ed, selection)
for(edge_descriptor ed : selection)
{
halfedge_descriptor hd=halfedge(ed,fg);
BOOST_FOREACH(halfedge_descriptor nhd, halfedges_around_source( hd, fg))
for(halfedge_descriptor nhd : halfedges_around_source( hd, fg))
{
edge_descriptor ned=edge(nhd, fg);
if (!get(is_selected, ned)){
@ -368,7 +367,7 @@ reduce_edge_selection(
break;
}
}
BOOST_FOREACH(halfedge_descriptor nhd, halfedges_around_target( hd, fg))
for(halfedge_descriptor nhd : halfedges_around_target( hd, fg))
{
edge_descriptor ned=edge(nhd, fg);
if (!get(is_selected, ned)){
@ -386,8 +385,8 @@ reduce_edge_selection(
//collect incident edges selected
std::set<edge_descriptor> edges_to_deselect;
unique_vertex_set.clear();
BOOST_FOREACH(vertex_descriptor vd, current_selection_border)
BOOST_FOREACH(halfedge_descriptor hd, halfedges_around_target( halfedge(vd,fg), fg))
for(vertex_descriptor vd : current_selection_border)
for(halfedge_descriptor hd : halfedges_around_target( halfedge(vd,fg), fg))
{
edge_descriptor ed = edge(hd, fg);
if (get(is_selected, ed)){
@ -397,7 +396,7 @@ reduce_edge_selection(
}
// extract unique selection
BOOST_FOREACH(edge_descriptor ed, edges_to_deselect)
for(edge_descriptor ed : edges_to_deselect)
{
*out++=ed;
put( is_selected, ed, false );
@ -446,13 +445,13 @@ expand_vertex_selection(
//collect adjacent vertices not already selected
std::set<vertex_descriptor> new_selection_set;
BOOST_FOREACH(vertex_descriptor vd, current_selection)
BOOST_FOREACH(vertex_descriptor nvd, vertices_around_target( halfedge(vd,fg), fg))
for(vertex_descriptor vd : current_selection)
for(vertex_descriptor nvd : vertices_around_target( halfedge(vd,fg), fg))
if (!get(is_selected, nvd)) new_selection_set.insert(nvd);
// extract unique selection
std::vector<vertex_descriptor> new_selection;
BOOST_FOREACH(vertex_descriptor vd, new_selection_set)
for(vertex_descriptor vd : new_selection_set)
{
*out++=vd;
new_selection.push_back(vd);
@ -496,8 +495,8 @@ reduce_vertex_selection(
// collect vertices incident to a selected one
std::set<vertex_descriptor> unique_vertex_set;
BOOST_FOREACH(vertex_descriptor vd, selection)
BOOST_FOREACH(vertex_descriptor nvd, vertices_around_target( halfedge(vd,fg), fg))
for(vertex_descriptor vd : selection)
for(vertex_descriptor nvd : vertices_around_target( halfedge(vd,fg), fg))
if (!get(is_selected, nvd)) unique_vertex_set.insert(nvd);
std::vector<vertex_descriptor> current_selection_border(unique_vertex_set.begin(), unique_vertex_set.end());
@ -507,13 +506,13 @@ reduce_vertex_selection(
//collect adjacent vertices selected
std::set<vertex_descriptor> vertices_to_deselect;
BOOST_FOREACH(vertex_descriptor vd, current_selection_border)
BOOST_FOREACH(vertex_descriptor nvd, vertices_around_target( halfedge(vd,fg), fg))
for(vertex_descriptor vd : current_selection_border)
for(vertex_descriptor nvd : vertices_around_target( halfedge(vd,fg), fg))
if (get(is_selected, nvd)) vertices_to_deselect.insert(nvd);
// extract unique selection
std::vector<vertex_descriptor> new_selection_border;
BOOST_FOREACH(vertex_descriptor vd, vertices_to_deselect)
for(vertex_descriptor vd : vertices_to_deselect)
{
*out++=vd;
new_selection_border.push_back(vd);
@ -557,7 +556,7 @@ void expand_face_selection_for_removal(const FaceRange& faces_to_be_deleted,
boost::unordered_set<vertex_descriptor> vertices_queue;
// collect vertices belonging to at least a triangle that will be removed
BOOST_FOREACH(face_descriptor fd, faces_to_be_deleted)
for(face_descriptor fd : faces_to_be_deleted)
{
halfedge_descriptor h = halfedge(fd, tm);
vertices_queue.insert( target(h, tm) );
@ -615,7 +614,7 @@ void expand_face_selection_for_removal(const FaceRange& faces_to_be_deleted,
if (next_around_vertex==start)
break;
BOOST_FOREACH(halfedge_descriptor f_hd, faces_traversed)
for(halfedge_descriptor f_hd : faces_traversed)
{
assert(target(f_hd, tm) == vd);
put(is_selected, face(f_hd, tm), true);
@ -637,9 +636,9 @@ bool is_selection_a_topological_disk(const FaceRange& face_selection,
typedef typename boost::graph_traits<PolygonMesh>::edge_descriptor edge_descriptor;
boost::unordered_set<vertex_descriptor> sel_vertices;
boost::unordered_set<edge_descriptor> sel_edges;
BOOST_FOREACH(face_descriptor f, face_selection)
for(face_descriptor f : face_selection)
{
BOOST_FOREACH(halfedge_descriptor h, halfedges_around_face(halfedge(f, pm), pm))
for(halfedge_descriptor h : halfedges_around_face(halfedge(f, pm), pm))
{
sel_vertices.insert(target(h, pm));
sel_edges.insert(edge(h,pm));

View File

@ -26,10 +26,10 @@
#include <map>
#include <vector>
#include <utility>
#include <boost/foreach.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <CGAL/assertions.h>
#include <CGAL/tags.h>
#include <CGAL/Iterator_range.h>
namespace CGAL {
@ -158,7 +158,7 @@ void duplicate_terminal_vertices(Graph& graph,
vertex_iterator b,e;
boost::tie(b,e) = vertices(graph);
std::vector<vertex_descriptor> V(b,e);
BOOST_FOREACH(vertex_descriptor v, V)
for(vertex_descriptor v : V)
{
typename boost::graph_traits<OrigGraph>::vertex_descriptor orig_v = graph[v];
typename boost::graph_traits<Graph>::degree_size_type deg = degree(v, graph);
@ -186,12 +186,12 @@ void duplicate_terminal_vertices(Graph& graph,
// check all vertices are of degree 1 or 2 and that the source
// and target of each edge are different vertices with different ids
CGAL_assertion_code(
BOOST_FOREACH(vertex_descriptor v, vertices(graph)){
for(vertex_descriptor v : make_range(vertices(graph))){
typename boost::graph_traits<Graph>::degree_size_type
n = degree(v, graph);
CGAL_assertion( n == 0 || n == 1 || n == 2);
}
BOOST_FOREACH(edge_descriptor e, edges(graph)){
for(edge_descriptor e : make_range(edges(graph))){
vertex_descriptor v = target(e, graph);
vertex_descriptor w = source(e, graph);
CGAL_assertion(v != w);
@ -267,13 +267,13 @@ split_graph_into_polylines(const Graph& graph,
typename graph_traits<G_copy>::vertex_descriptor> V2vmap;
V2vmap v2vmap;
BOOST_FOREACH(Graph_vertex_descriptor v, vertices(graph)){
for(Graph_vertex_descriptor v : make_range(vertices(graph))){
vertex_descriptor vc = add_vertex(g_copy);
g_copy[vc] = v;
v2vmap[v] = vc;
}
BOOST_FOREACH(Graph_edge_descriptor e, edges(graph)){
for(Graph_edge_descriptor e : make_range(edges(graph))){
Graph_vertex_descriptor vs = source(e,graph);
Graph_vertex_descriptor vt = target(e,graph);
CGAL_warning_msg(vs != vt, "ignore self loops");
@ -294,7 +294,7 @@ split_graph_into_polylines(const Graph& graph,
G_copy_less g_copy_less(g_copy, less);
std::set<vertex_descriptor, G_copy_less> terminal(g_copy_less);
BOOST_FOREACH(vertex_descriptor v, vertices(g_copy)){
for(vertex_descriptor v : make_range(vertices(g_copy))){
typename graph_traits<G_copy>::degree_size_type n = degree(v, g_copy);
if ( n == 1 ) terminal.insert(v);
if ( n ==0 ){

View File

@ -14,7 +14,7 @@ halfedge_descriptor find_halfedge(double x1, double y1,
typedef typename boost::graph_traits<Mesh>::halfedge_descriptor halfedge_descriptor;
VPMAP vpmap = get(CGAL::vertex_point, m);
BOOST_FOREACH(halfedge_descriptor h, halfedges(m))
for(halfedge_descriptor h : halfedges(m))
{
if(get(vpmap, source(h, m)) == Point(x1,y1,0)
&& get(vpmap, target(h, m)) == Point(x2,y2,0))
@ -61,7 +61,7 @@ collapse_edge_test()
bool ok = CGAL::Euler::collapse_edge(edge(he, test_mesh), test_mesh) == v1;
assert(ok);
char found = 0;
BOOST_FOREACH(halfedge_descriptor it, CGAL::halfedges_around_target(v1,test_mesh))
for(halfedge_descriptor it : CGAL::halfedges_around_target(v1,test_mesh))
{
if(it == eno
|| it == eno_prime){
@ -90,7 +90,7 @@ collapse_edge_test()
bool ok = CGAL::Euler::collapse_edge(edge(he, test_mesh), test_mesh) == v1;
assert(ok);
char found = 0;
BOOST_FOREACH(halfedge_descriptor it, CGAL::halfedges_around_target(v1,test_mesh))
for(halfedge_descriptor it : CGAL::halfedges_around_target(v1,test_mesh))
{
if(it == eno
|| it == eno_prime){
@ -118,7 +118,7 @@ collapse_edge_test()
bool ok = CGAL::Euler::collapse_edge(edge(he, test_mesh), test_mesh) == v1;
assert(ok);
char found = 0;
BOOST_FOREACH(halfedge_descriptor it, CGAL::halfedges_around_target(v1,test_mesh))
for(halfedge_descriptor it : CGAL::halfedges_around_target(v1,test_mesh))
{
if(it == eno
|| it == eno_prime){
@ -156,7 +156,7 @@ collapse_edge_test()
bool ok = CGAL::Euler::collapse_edge(edge(he, test_mesh), test_mesh) == v1;
assert(ok);
char found = 0;
BOOST_FOREACH(halfedge_descriptor it, CGAL::halfedges_around_target(v1,test_mesh))
for(halfedge_descriptor it : CGAL::halfedges_around_target(v1,test_mesh))
{
if(it == eno
|| it == eno_prime
@ -197,7 +197,7 @@ collapse_edge_test()
bool ok = CGAL::Euler::collapse_edge(edge(he, test_mesh), test_mesh) == v1;
assert(ok);
char found = 0;
BOOST_FOREACH(halfedge_descriptor it, CGAL::halfedges_around_target(v1,test_mesh))
for(halfedge_descriptor it : CGAL::halfedges_around_target(v1,test_mesh))
{
if(it == ep)
++found;

View File

@ -152,7 +152,7 @@ add_vertex_and_face_to_border_test()
assert(dist == 2);
int blength = 0;
BOOST_FOREACH(halfedge_descriptor hd, CGAL::halfedges_around_face(h1,m)){
for(halfedge_descriptor hd : CGAL::halfedges_around_face(h1,m)){
CGAL_USE(hd);
blength++;
}
@ -163,7 +163,7 @@ add_vertex_and_face_to_border_test()
assert(! CGAL::is_border(res,m));
assert(CGAL::is_border(opposite(res,m),m));
res = opposite(res,m);
BOOST_FOREACH(halfedge_descriptor hd, CGAL::halfedges_around_face(res,m)){
for(halfedge_descriptor hd : CGAL::halfedges_around_face(res,m)){
CGAL_USE(hd);
blength--;
}
@ -394,8 +394,8 @@ test_swap_edges()
{
Graph g;
CGAL::make_tetrahedron(pt,pt,pt,pt,g);
halfedge_descriptor h1 = *CGAL::cpp11::next(boost::begin(halfedges(g)), i);
halfedge_descriptor h2 = *CGAL::cpp11::next(boost::begin(halfedges(g)), j);
halfedge_descriptor h1 = *std::next(boost::begin(halfedges(g)), i);
halfedge_descriptor h2 = *std::next(boost::begin(halfedges(g)), j);
CGAL::internal::swap_edges(h1, h2, g);
CGAL_assertion(CGAL::is_valid_polygon_mesh(g));
}

View File

@ -3,7 +3,6 @@
#include <CGAL/boost/graph/copy_face_graph.h>
#include "test_Prefix.h"
#include <boost/numeric/conversion/cast.hpp>
#include <boost/foreach.hpp>
#include <boost/unordered_set.hpp>
#include <boost/unordered_map.hpp>
#include <CGAL/use.h>
@ -279,7 +278,7 @@ template <typename Graph>
void
test(const std::vector<Graph>& graphs)
{
BOOST_FOREACH(Graph p, graphs){
for(Graph p : graphs){
test_read(p);
test_vertex_iterators(p);
test_out_edges(p);

View File

@ -28,7 +28,7 @@ int main()
std::vector<face_descriptor> faces_to_remove;
int index = 0;
BOOST_FOREACH(face_descriptor fh, faces(sm))
for(face_descriptor fh : faces(sm))
{
if(index_set.count(index)==0)
is_selected_map[fh]=false;
@ -47,7 +47,7 @@ int main()
boost::make_assoc_property_map(is_selected_map));
index=0;
BOOST_FOREACH(face_descriptor fh, faces(sm))
for(face_descriptor fh : faces(sm))
{
if (is_selected_map[fh])
{

View File

@ -1,7 +1,6 @@
#include "test_Prefix.h"
#include <boost/unordered_set.hpp>
#include <boost/foreach.hpp>
template< typename G,
typename ForwardRange,
@ -80,26 +79,26 @@ main()
{
std::vector<Polyhedron> polys = poly_data();
BOOST_FOREACH(Polyhedron p, polys){
for(Polyhedron p : polys){
index_uniqueness_poly(p);
}
std::vector<LCC> lccs = lcc_data();
BOOST_FOREACH(LCC p, lccs){
for(LCC p : lccs){
index_uniqueness_lcc(p);
}
#if defined(CGAL_USE_SURFACE_MESH)
std::vector<SM> sms = sm_data();
BOOST_FOREACH(SM p, sms){
for(SM p : sms){
index_uniqueness_sm(p);
}
#endif
#if defined(CGAL_USE_OPENMESH)
std::vector<OMesh> omeshs = omesh_data();
BOOST_FOREACH(OMesh p, omeshs){
for(OMesh p : omeshs){
index_uniqueness_omesh(p);
}
#endif

View File

@ -4,7 +4,6 @@
#include <iostream>
#include <fstream>
#include <boost/foreach.hpp>
typedef CGAL::Simple_cartesian<double> Kernel;
typedef Kernel::Point_3 Point;
@ -30,14 +29,14 @@ int main()
assert(hd != nhd);
assert(hd == prev(nhd,dual));
assert(face(nhd,dual) == fd);
BOOST_FOREACH(halfedge_descriptor lhd, halfedges_around_face(hd,dual)){
for(halfedge_descriptor lhd : halfedges_around_face(hd,dual)){
assert(face(lhd,dual) == fd);
}
vertex_descriptor vd = *vertices(dual).first;
assert(target(halfedge(vd,dual),dual) == vd);
BOOST_FOREACH(halfedge_descriptor lhd, halfedges_around_target(halfedge(vd,dual),dual)){
for(halfedge_descriptor lhd : halfedges_around_target(halfedge(vd,dual),dual)){
assert(target(lhd,dual) == vd);
}

View File

@ -2,7 +2,6 @@
#include <CGAL/Polyhedron_3.h>
#include <CGAL/boost/graph/iterator.h>
#include <boost/foreach.hpp>
#include <boost/concept/assert.hpp>
#include <CGAL/Circulator/Circulator_concepts.h>
@ -134,7 +133,7 @@ int main(int argc, char* argv[])
}
{
BOOST_FOREACH(edge_descriptor ed,out_edges(target(hd,P),P)){
for(edge_descriptor ed : out_edges(target(hd,P),P)){
halfedge_descriptor hd2 = halfedge(ed,P);
std::cout << get(CGAL::vertex_point, P, target(hd2,P)) << std::endl;
}

View File

@ -2,7 +2,6 @@
#include "test_Prefix.h"
#include <boost/numeric/conversion/cast.hpp>
#include <boost/foreach.hpp>
#include <boost/unordered_set.hpp>
#include <CGAL/use.h>
@ -262,7 +261,7 @@ template <typename Graph>
void
test(const std::vector<Graph>& graphs)
{
BOOST_FOREACH(const Graph& p, graphs){
for(const Graph& p : graphs){
test_edge_iterators(p);
test_read(p);
test_vertex_iterators(p);

View File

@ -43,7 +43,7 @@ Example's point pattern.
\cgalExample{Barycentric_coordinates_2/Segment_coordinates_example.cpp}
\subsection tri_example Triangle Coordinates
In this example we show how to use the class `CGAL::Barycentric_coordinates::Triangle_coordinates_2` with the `Simple_cartesian` kernel for double type. We compute coordinates for three sets of points: interior (green), boundary (red), and exterior (blue). Note that some of the coordinate values for the exterior points are negative. We use a standard container of the type <a href="http://en.cppreference.com/w/cpp/container/vector">`std::vector`</a> and <a href="http://en.cppreference.com/w/cpp/iterator/insert_iterator">`std::insert_iterator`</a> to access and store the resulting coordinate values.
In this example we show how to use the class `CGAL::Barycentric_coordinates::Triangle_coordinates_2` with the `Simple_cartesian` kernel for double type. We compute coordinates for three sets of points: interior (green), boundary (red), and exterior (blue). Note that some of the coordinate values for the exterior points are negative. We use a standard container of the type <a href="https://en.cppreference.com/w/cpp/container/vector">`std::vector`</a> and <a href="https://en.cppreference.com/w/cpp/iterator/insert_iterator">`std::insert_iterator`</a> to access and store the resulting coordinate values.
\anchor tri_coord_example
\cgalFigureBegin{tri__example,triangle_coordinates_example.png}
@ -53,12 +53,12 @@ Example's point pattern.
\cgalExample{Barycentric_coordinates_2/Triangle_coordinates_example.cpp}
\subsection wp_example Wachspress Coordinates
In the following example we create 1000 random points, then we take the convex hull of this set of points as our polygon, and compute Wachspress coordinates at all the defined points. We use the `Simple_cartesian` kernel with double type as a traits class and store obtained coordinate values in a container of the type <a href="http://en.cppreference.com/w/cpp/container/vector">`std::vector`</a>. The output iterator is <a href="http://en.cppreference.com/w/cpp/iterator/back_insert_iterator">`std::back_insert_iterator`</a>.
In the following example we create 1000 random points, then we take the convex hull of this set of points as our polygon, and compute Wachspress coordinates at all the defined points. We use the `Simple_cartesian` kernel with double type as a traits class and store obtained coordinate values in a container of the type <a href="https://en.cppreference.com/w/cpp/container/vector">`std::vector`</a>. The output iterator is <a href="https://en.cppreference.com/w/cpp/iterator/back_insert_iterator">`std::back_insert_iterator`</a>.
\cgalExample{Barycentric_coordinates_2/Wachspress_coordinates_example.cpp}
\subsection dh_example Discrete Harmonic Coordinates
In this example we compute discrete harmonic coordinates for a set of green (interior), red (boundary), and blue (exterior) points with respect to a unit square. We also show how to specify the location of a query point using additional function parameters. The used kernel is exact, and we use an output container of the type <a href="http://en.cppreference.com/w/cpp/container/vector">`std::vector`</a>. Since all the points are symmetric, it is easy to debug the correctness of the obtained coordinate values. The output iterator is <a href="http://en.cppreference.com/w/cpp/iterator/back_insert_iterator">`std::back_insert_iterator`</a>.
In this example we compute discrete harmonic coordinates for a set of green (interior), red (boundary), and blue (exterior) points with respect to a unit square. We also show how to specify the location of a query point using additional function parameters. The used kernel is exact, and we use an output container of the type <a href="https://en.cppreference.com/w/cpp/container/vector">`std::vector`</a>. Since all the points are symmetric, it is easy to debug the correctness of the obtained coordinate values. The output iterator is <a href="https://en.cppreference.com/w/cpp/iterator/back_insert_iterator">`std::back_insert_iterator`</a>.
\anchor dh_coord_example
\cgalFigureBegin{dh__example,discrete_harmonic_coordinates_example.png}
@ -68,7 +68,7 @@ Example's point pattern.
\cgalExample{Barycentric_coordinates_2/Discrete_harmonic_coordinates_example.cpp}
\subsection mv_example Mean Value Coordinates
This is an example that shows how to compute mean value coordinates for a set of green points in a star-shaped polygon. We note that this type of coordinates is well-defined for such a concave polygon while Wachspress and discrete harmonic coordinates are not. However, it may give negative coordinate values for points outside <a href="https://en.wikipedia.org/wiki/Star-shaped_polygon">the polygon's kernel</a> (shown in red). We use an inexact data type, an output container of the type <a href="http://en.cppreference.com/w/cpp/container/vector">`std::vector`</a>, and an output iterator of the type <a href="http://en.cppreference.com/w/cpp/iterator/back_insert_iterator">std::back_insert_iterator</a> to compute, access, and store the resulting coordinate values. We also show how to choose different algorithms to compute generalized barycentric coordinates (one is more precise while the other is faster).
This is an example that shows how to compute mean value coordinates for a set of green points in a star-shaped polygon. We note that this type of coordinates is well-defined for such a concave polygon while Wachspress and discrete harmonic coordinates are not. However, it may give negative coordinate values for points outside <a href="https://en.wikipedia.org/wiki/Star-shaped_polygon">the polygon's kernel</a> (shown in red). We use an inexact data type, an output container of the type <a href="https://en.cppreference.com/w/cpp/container/vector">`std::vector`</a>, and an output iterator of the type <a href="https://en.cppreference.com/w/cpp/iterator/back_insert_iterator">std::back_insert_iterator</a> to compute, access, and store the resulting coordinate values. We also show how to choose different algorithms to compute generalized barycentric coordinates (one is more precise while the other is faster).
\anchor mv_coord_example
\cgalFigureBegin{mv__example,mean_value_coordinates_example.png}
@ -193,7 +193,7 @@ After the normalization of these weights as before
<center>\f$b_i = \frac{w_i}{W^{mv}}\qquad\f$ with \f$\qquad W^{mv} = \sum_{j=1}^n w_j\f$</center>
we obtain the precise \f$O(n^2)\f$ algorithm. The fast O(n) algorithm computes the weights \f$w_i\f$ using the pseudocode from <a href="http://www.inf.usi.ch/hormann/nsfworkshop/presentations/Hormann.pdf">here</a>. These weights
we obtain the precise \f$O(n^2)\f$ algorithm. The fast O(n) algorithm computes the weights \f$w_i\f$ using the pseudocode from <a href="https://www.inf.usi.ch/hormann/nsfworkshop/presentations/Hormann.pdf">here</a>. These weights
<center>\f$w_i = \frac{t_{i-1} + t_i}{r_i}\qquad\f$ with \f$\qquad t_i = \frac{\text{det}(d_i, d_{i+1})}{r_ir_{i+1} + d_id_{i+1}}\f$</center>
@ -231,7 +231,7 @@ The package is implemented in a way that later, if needed, other two-dimensional
\section gbc_theory Theory of 2D Generalized Barycentric Coordinates
In 1827, the German mathematician and theoretical astronomer <a href="http://en.wikipedia.org/wiki/August_Ferdinand_Möbius">August Ferdinand Möbius</a> (1790--1868) proposed a method \cite cgal:bc:m-dbc-27 to find coordinates of a point in the plane with respect to the vertices of a triangle. These coordinates are called <a href="http://mathworld.wolfram.com/BarycentricCoordinates.html">triangle barycentric coordinates</a> (sometimes <a href="http://en.wikipedia.org/wiki/Barycentric_coordinate_system">area coordinates</a>), and they are widely used in a variety of applications. Some of these applications are linear interpolation over a triangle and a triangle inclusion test. The first one is used for so-called <a href="http://en.wikipedia.org/wiki/Shading">shading</a>, and the second one arises in the <a href="http://en.wikipedia.org/wiki/Rasterization">rasterization</a> step when an image in vector graphics format needs to be converted into a raster image.
In 1827, the German mathematician and theoretical astronomer <a href="https://en.wikipedia.org/wiki/August_Ferdinand_Möbius">August Ferdinand Möbius</a> (1790--1868) proposed a method \cite cgal:bc:m-dbc-27 to find coordinates of a point in the plane with respect to the vertices of a triangle. These coordinates are called <a href="http://mathworld.wolfram.com/BarycentricCoordinates.html">triangle barycentric coordinates</a> (sometimes <a href="https://en.wikipedia.org/wiki/Barycentric_coordinate_system">area coordinates</a>), and they are widely used in a variety of applications. Some of these applications are linear interpolation over a triangle and a triangle inclusion test. The first one is used for so-called <a href="https://en.wikipedia.org/wiki/Shading">shading</a>, and the second one arises in the <a href="https://en.wikipedia.org/wiki/Rasterization">rasterization</a> step when an image in vector graphics format needs to be converted into a raster image.
Triangle barycentric coordinates have many important properties, including \em constant and <em>linear precision</em>, <em> the Lagrange property</em>, and <em>positivity inside a triangle</em>. These properties make these coordinates a unique tool in many scientific fields. If we restrict triangle coordinates to one of the edges of a triangle and its supporting line, we get barycentric coordinates with respect to a segment and call them \ref compute_seg_coord "segment coordinates".
@ -265,7 +265,7 @@ To plot discrete harmonic coordinates we take \ref wp_plot "the same polygon" as
The discrete harmonic coordinate function with respect to the indicated vertex with values from zero to one as the colour bar indicates.
\cgalFigureEnd
The last type of generalized barycentric coordinates that we discuss are mean value coordinates \cite cgal:f-mvc-03 proposed by M. Floater in 2003. Based on the <a href="http://en.wikipedia.org/wiki/Mean_value_theorem">mean value theorem</a>, \ref gbc_deg_mean_value_coordinates "these coordinates", unlike Wachspress and discrete harmonic coordinates, are well-defined for arbitrary <em>simple polygons</em>, inherit all the properties of triangle coordinates for any convex polygon, and <em>lack only the positivity property for general concave polygons</em>. Hormann and Floater prove in \cite cgal:bc:hf-mvcapp-06 that these coordinates are positive inside the kernel of a <a href="https://en.wikipedia.org/wiki/Star-shaped_polygon">star-shaped polygon</a>. They are also positive in the closure of any quadrilateral. Like discrete harmonic weights, mean value weights are often used in the context of \ref PkgSurfaceMeshParameterization "triangle mesh parameterization."
The last type of generalized barycentric coordinates that we discuss are mean value coordinates \cite cgal:f-mvc-03 proposed by M. Floater in 2003. Based on the <a href="https://en.wikipedia.org/wiki/Mean_value_theorem">mean value theorem</a>, \ref gbc_deg_mean_value_coordinates "these coordinates", unlike Wachspress and discrete harmonic coordinates, are well-defined for arbitrary <em>simple polygons</em>, inherit all the properties of triangle coordinates for any convex polygon, and <em>lack only the positivity property for general concave polygons</em>. Hormann and Floater prove in \cite cgal:bc:hf-mvcapp-06 that these coordinates are positive inside the kernel of a <a href="https://en.wikipedia.org/wiki/Star-shaped_polygon">star-shaped polygon</a>. They are also positive in the closure of any quadrilateral. Like discrete harmonic weights, mean value weights are often used in the context of \ref PkgSurfaceMeshParameterization "triangle mesh parameterization."
In order to show the particular behaviour of mean value coordinates with an application to concave polygons, we take \ref fig__mv__example "a star-shaped polygon" with ten vertices \f$[v_0, \dots, v_9]\f$, sample its interior and boundary, and plot the coordinate function with respect to the fourth vertex \f$v_3\f$. As the colour bar indicates, the obtained function grows from a slightly negative value to one at the chosen vertex. It is also smooth inside the polygon and linear along all edges.
@ -276,7 +276,7 @@ Mean value coordinates with respect to \f$v_3\f$. The colour bar indicates the r
<b>Interesting fact</b>: all the coordinates discussed in this section and implemented in the package come from one and the same family of generalized barycentric coordinates named <em>3-point family of coordinates</em> \cite cgal:bc:fhk-gcbcocp-06.
\section gbc_acknowledgments Acknowledgments
The authors wish to thank <a href="http://www.inf.usi.ch/phd/schneider/">Teseo Schneider</a> and <a href="http://search.usi.ch/people/5ae37d3d990b431a02b95b0b606da2e6/Schaerfig-Randolf">Randolf Schaerfig</a> for helpful comments and discussions. We also appreciate the great effort invested in this package by our reviewers <a href="http://geometryfactory.com/who-we-are/">Andreas Fabri and Sébastien Loriot</a>. Finally, to create pictures for this manual, we used two programs: <a href="http://www.geogebra.org/cms/en/">Geogebra</a> and <a href="http://www.mathworks.com/products/matlab/">Matlab</a>.
The authors wish to thank <a href="https://www.inf.usi.ch/phd/schneider/">Teseo Schneider</a> and <a href="https://search.usi.ch/people/5ae37d3d990b431a02b95b0b606da2e6/Schaerfig-Randolf">Randolf Schaerfig</a> for helpful comments and discussions. We also appreciate the great effort invested in this package by our reviewers <a href="https://geometryfactory.com/who-we-are/">Andreas Fabri and Sébastien Loriot</a>. Finally, to create pictures for this manual, we used two programs: <a href="https://www.geogebra.org">Geogebra</a> and <a href="https://www.mathworks.com/products/matlab.html">Matlab</a>.
*/

View File

@ -10,7 +10,7 @@ typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel;
typedef Kernel::FT Scalar;
typedef Kernel::Point_2 Point;
typedef CGAL::cpp11::array<Scalar,2> Pair;
typedef std::array<Scalar,2> Pair;
using std::cout; using std::endl; using std::string;
@ -29,7 +29,7 @@ int main()
};
// Compute segment coordinates for all the defined points.
// We use a global function and return the segment coordinates stored in an array of the type CGAL::cpp11::array<FT,2>.
// We use a global function and return the segment coordinates stored in an array of the type std::array<FT,2>.
cout << endl << "Computed segment coordinates: " << endl << endl;
for(int i = 0; i < 5; ++i) {
const Pair pair = BC::compute_segment_coordinates_2(first_vertex, second_vertex, query_points[i], Kernel());

View File

@ -30,7 +30,7 @@ int main()
// Generate a set of random points.
CGAL::Random_points_in_square_2<Point,Creator> point_generator(1.0);
CGAL::cpp11::copy_n(point_generator, number_of_points, std::back_inserter(points));
std::copy_n(point_generator, number_of_points, std::back_inserter(points));
// Find the convex hull of the generated set of points.
// This convex hull gives the vertices of a convex polygon that contains all the generated points.

View File

@ -217,7 +217,7 @@ private:
*/
template<class Traits>
inline CGAL::cpp11::array<typename Traits::FT,2> compute_segment_coordinates_2(const typename Traits::Point_2 &first_vertex, const typename Traits::Point_2 &second_vertex, const typename Traits::Point_2 &query_point, const Traits &barycentric_traits = Traits())
inline std::array<typename Traits::FT,2> compute_segment_coordinates_2(const typename Traits::Point_2 &first_vertex, const typename Traits::Point_2 &second_vertex, const typename Traits::Point_2 &query_point, const Traits &barycentric_traits = Traits())
{
// Some predefined functions.
typename Traits::Compute_scalar_product_2 scalar_product_2 = barycentric_traits.compute_scalar_product_2_object();
@ -230,7 +230,7 @@ template<class Traits>
const FT opposite_scalar_product = scalar_product_2(query_point - second_vertex, first_vertex - second_vertex);
const FT b_first = opposite_scalar_product / squared_distance_2(first_vertex, second_vertex);
// Return the CGAL::cpp11::array<FT,2> type of coordinates.
// Return the std::array<FT,2> type of coordinates.
return CGAL::make_array(b_first, FT(1) - b_first);
}

View File

@ -51,7 +51,7 @@ namespace Barycentric_coordinates {
/*!
* \ingroup PkgBarycentricCoordinates2Ref
* The class `Triangle_coordinates_2` implements barycentric coordinates ( <a href="http://mathworld.wolfram.com/BarycentricCoordinates.html" target=blanc>[1]</a>,
* <a href="http://en.wikipedia.org/wiki/Barycentric_coordinate_system" target=blanc>[2]</a> ) with respect to an arbitrary non-degenerate triangle in the plane.
* <a href="https://en.wikipedia.org/wiki/Barycentric_coordinate_system" target=blanc>[2]</a> ) with respect to an arbitrary non-degenerate triangle in the plane.
* This class is parameterized by a traits class `Traits`.
\tparam Traits must be a model of the concept `BarycentricTraits_2`.
@ -237,7 +237,7 @@ private:
*/
template<class Traits>
inline CGAL::cpp11::array<typename Traits::FT,3> compute_triangle_coordinates_2(const typename Traits::Point_2 &first_vertex, const typename Traits::Point_2 &second_vertex, const typename Traits::Point_2 &third_vertex, const typename Traits::Point_2 &query_point, const Traits &barycentric_traits = Traits())
inline std::array<typename Traits::FT,3> compute_triangle_coordinates_2(const typename Traits::Point_2 &first_vertex, const typename Traits::Point_2 &second_vertex, const typename Traits::Point_2 &third_vertex, const typename Traits::Point_2 &query_point, const Traits &barycentric_traits = Traits())
{
// Some predefined functions.
typename Traits::Compute_area_2 area_2 = barycentric_traits.compute_area_2_object();
@ -256,7 +256,7 @@ template<class Traits>
const FT b_first = area_second * inverted_total_area;
const FT b_second = area_third * inverted_total_area;
// Return the CGAL::cpp11::array<FT,3> type of coordinates.
// Return the std::array<FT,3> type of coordinates.
return CGAL::make_array(b_first, b_second, FT(1) - b_first - b_second);
}

View File

@ -1,7 +1,7 @@
// Author: Dmitry Anisimov.
// We use a simple segment of length 2 and inexact data type
// in order to test coordinates computed for the center point of the segment.
// We test the function compute_segment_coordinates_2() and return CGAL::cpp11::array set of coordinates.
// We test the function compute_segment_coordinates_2() and return std::array set of coordinates.
// It also works with exact kernel.
@ -14,7 +14,7 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
typedef Kernel::FT Scalar;
typedef Kernel::Point_2 Point;
typedef CGAL::cpp11::array<Scalar,2> Pair;
typedef std::array<Scalar,2> Pair;
using std::cout; using std::endl; using std::string;

View File

@ -1,7 +1,7 @@
// Author: Dmitry Anisimov.
// We use a simple triangle and inexact data type
// in order to test coordinates computed for the center point of the triangle.
// We test the function compute_triangle_coordinates_2() and return CGAL::cpp11::array set of coordinates.
// We test the function compute_triangle_coordinates_2() and return std::array set of coordinates.
// It also works with exact kernel.
@ -14,7 +14,7 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
typedef Kernel::FT Scalar;
typedef Kernel::Point_2 Point;
typedef CGAL::cpp11::array<Scalar,3> Triple;
typedef std::array<Scalar,3> Triple;
using std::cout; using std::endl; using std::string;

View File

@ -946,7 +946,7 @@ bool read_bezier ( QString aFileName, Bezier_polygon_set& rSet, Bezier_region_so
if ( bezier_polygons.size() > 1 )
{
for ( Bezier_polygon_vector::const_iterator it = CGAL::cpp11::next(bezier_polygons.begin())
for ( Bezier_polygon_vector::const_iterator it = std::next(bezier_polygons.begin())
; it != bezier_polygons.end()
; ++ it
)

View File

@ -7,7 +7,6 @@
#include <CGAL/random_polygon_2.h>
#include <iostream>
#include <boost/foreach.hpp>
typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel;
typedef Kernel::Segment_2 Segment_2;
@ -96,7 +95,7 @@ void print_polygons(std::ostream& out, const Polygon_set_2& polygon_set)
{
std::vector<Polygon_with_holes_2> polygons_wh(polygon_set.number_of_polygons_with_holes());
polygon_set.polygons_with_holes(&polygons_wh[0]);
BOOST_FOREACH(Polygon_with_holes_2& polygon_wh, polygons_wh)
for(Polygon_with_holes_2& polygon_wh : polygons_wh)
{
print_polygon(out, polygon_wh.outer_boundary());
for(Polygon_with_holes_2::Hole_const_iterator it=polygon_wh.holes_begin();
@ -125,7 +124,7 @@ int main( int argc , char ** argv )
build_segments(all_segments);
std::ofstream out("polygons_grid.cgal");
BOOST_FOREACH(const Segment_2& s, all_segments)
for(const Segment_2& s : all_segments)
{
out << "2 " << s.source() << " 0"
<< " " << s.target() << " 0\n";

View File

@ -147,7 +147,7 @@ bool read_bezier(char const* aFileName, Bezier_polygon_set& rSet)
if (polygons.size() > 1) {
Bezier_polygon_vector::const_iterator it;
for (it = CGAL::cpp11::next(polygons.begin());
for (it = std::next(polygons.begin());
it != polygons.end(); ++it)
pwh.add_hole(*it);
}

View File

@ -46,7 +46,6 @@
#include <CGAL/Boolean_set_operations_2/Ccb_curve_iterator.h>
#include <CGAL/Union_find.h>
#include <boost/foreach.hpp>
/*!
\file Gps_on_surface_base_2.h
@ -1093,7 +1092,7 @@ protected:
// update halfedge flag according to the flag of the twin halfedge
// or if the outer ccb of the cc was set
BOOST_FOREACH(Halfedge_handle h, halfedges_that_was_on_an_outer_ccb)
for(Halfedge_handle h : halfedges_that_was_on_an_outer_ccb)
{
if (h->flag()!=NOT_VISITED) continue;
std::size_t face_master_id=(*uf_faces.find(face_handles[h->face()->id()]))->id();
@ -1114,7 +1113,7 @@ protected:
while(something_was_updated);
// last loop, if some tags are not set it means that they are the only ccb
// of the face and that they have to be the outer ccb
BOOST_FOREACH(Halfedge_handle h, halfedges_that_was_on_an_outer_ccb)
for(Halfedge_handle h : halfedges_that_was_on_an_outer_ccb)
{
if (h->flag()!=NOT_VISITED) continue;
std::size_t face_master_id=(*uf_faces.find(face_handles[h->face()->id()]))->id();
@ -1191,9 +1190,9 @@ protected:
}
//collect for reuse/removal all inner and outer ccbs
BOOST_FOREACH(void* ptr, (*it)->_outer_ccbs())
for(void* ptr : (*it)->_outer_ccbs())
outer_ccbs_to_remove.push_back( static_cast<typename Aos_2::Dcel::Halfedge*>(ptr)->outer_ccb() );
BOOST_FOREACH(void* ptr, (*it)->_inner_ccbs())
for(void* ptr : (*it)->_inner_ccbs())
inner_ccbs_to_remove.push_back( static_cast<typename Aos_2::Dcel::Halfedge*>(ptr)->inner_ccb() );
(*it)->_outer_ccbs().clear();
(*it)->_inner_ccbs().clear();
@ -1268,9 +1267,9 @@ protected:
}
// now set the new face for all ccbs
BOOST_FOREACH(Outer_ccb_and_face& ccb_and_face, outer_ccb_and_new_face_pairs)
for(Outer_ccb_and_face& ccb_and_face : outer_ccb_and_new_face_pairs)
ccb_and_face.first->set_face(ccb_and_face.second);
BOOST_FOREACH(Inner_ccb_and_face& ccb_and_face, inner_ccb_and_new_face_pairs)
for(Inner_ccb_and_face& ccb_and_face : inner_ccb_and_new_face_pairs)
ccb_and_face.first->set_face(ccb_and_face.second);
//remove no longer used edges, vertices and faces

View File

@ -21,7 +21,7 @@ void print_polygons(std::ostream& out, const Polygon_set_2& polygon_set)
{
std::vector<Polygon_with_holes_2> polygons_wh(polygon_set.number_of_polygons_with_holes());
polygon_set.polygons_with_holes(&polygons_wh[0]);
BOOST_FOREACH(Polygon_with_holes_2& polygon_wh, polygons_wh)
for(Polygon_with_holes_2& polygon_wh : polygons_wh)
{
print_polygon(out, polygon_wh.outer_boundary());
for(Polygon_with_holes_2::Hole_const_iterator it=polygon_wh.holes_begin();

View File

@ -24,7 +24,7 @@ int main()
CGAL::set_pretty_mode(std::cout);
Cont points;
CGAL::cpp11::copy_n(Generator(1), n, std::back_inserter(points));
std::copy_n(Generator(1), n, std::back_inserter(points));
std::cout << "Generated Point Set:\n";
std::copy(points.begin(), points.end(), cout_ip);

View File

@ -152,11 +152,11 @@ namespace CGAL {
CGAL_APPEL_ASSERT(d==2);
// write matrix M' as [ a, b; b, c ]:
const CGAL::cpp11::array<double, 3> matrix = {{ E->matrix(0, 0), // a
const std::array<double, 3> matrix = {{ E->matrix(0, 0), // a
E->matrix(0, 1), // b
E->matrix(1, 1) }}; // c
CGAL::cpp11::array<double, 4> eigenvectors; // Note: not neces. normalized.
CGAL::cpp11::array<double, 2> eigenvalues; // Note: sorted ascendent.
std::array<double, 4> eigenvectors; // Note: not neces. normalized.
std::array<double, 2> eigenvalues; // Note: sorted ascendent.
CGAL::Default_diagonalize_traits<double, 2>::diagonalize_selfadjoint_covariance_matrix
(matrix, eigenvalues, eigenvectors);
@ -191,15 +191,15 @@ namespace CGAL {
// M' = [ b d e ]
// [ c e f ]
//
const CGAL::cpp11::array<double, 6> matrix = {{ E->matrix(0, 0), // a
const std::array<double, 6> matrix = {{ E->matrix(0, 0), // a
E->matrix(0, 1), // b
E->matrix(0, 2), // c
E->matrix(1, 1), // d
E->matrix(1, 2), // e
E->matrix(2, 2) }}; // f
CGAL::cpp11::array<double, 9> eigenvectors; // Note: not necessarily normalized.
CGAL::cpp11::array<double, 3> eigenvalues; // Note: sorted ascendent.
std::array<double, 9> eigenvectors; // Note: not necessarily normalized.
std::array<double, 3> eigenvalues; // Note: sorted ascendent.
CGAL::Default_diagonalize_traits<double, 3>::diagonalize_selfadjoint_covariance_matrix
(matrix, eigenvalues, eigenvectors);

View File

@ -250,7 +250,7 @@ namespace CGAL {
// Complexity: O((n-start) d^2)
//
// Todo: maybe use something like Kahan Summation here? See
// <http://en.wikipedia.org/wiki/Kahan_Summation_Algorithm>.
// <https://en.wikipedia.org/wiki/Kahan_Summation_Algorithm>.
{
for (int k=start; k<n; ++k) {
C_it pi = tco.cartesian_begin(*P[k]);

View File

@ -175,7 +175,7 @@ main(int argc, char* argv[])
cerr << "random seed is " << random_seed << endl;
#endif // CGAL_PCENTER_NO_OUTPUT
PCont input_points;
CGAL::cpp11::copy_n(Point_generator(1, rnd),
std::copy_n(Point_generator(1, rnd),
number_of_points,
back_inserter(input_points));

View File

@ -198,7 +198,7 @@ main(int argc, char* argv[])
// generate a random cluster of size number_of_points:
PCont input_points;
CGAL::cpp11::copy_n(ptgen,
std::copy_n(ptgen,
number_of_points,
back_inserter(input_points));

View File

@ -45,16 +45,8 @@
#include <cmath>
#include <limits>
#if !defined CGAL_CFG_NO_CPP0X_ISFINITE
#define CGAL_CORE_finite(x) std::isfinite(x)
#define CGAL_CORE_ilogb(x) ilogb(x)
#elif defined (_MSC_VER) || defined (__MINGW32__) // add support for MinGW
#define CGAL_CORE_finite(x) _finite(x)
#define CGAL_CORE_ilogb(x) (int)_logb(x)
#else
#define CGAL_CORE_finite(x) finite(x)
#define CGAL_CORE_ilogb(x) ilogb(x)
#endif
#define CGAL_CORE_finite(x) std::isfinite(x)
#define CGAL_CORE_ilogb(x) ilogb(x)
#if defined(sun) || defined(__sun)
#include <ieeefp.h>

View File

@ -479,7 +479,7 @@ Image_3::labellized_trilinear_interpolation
const int i2 = i1 + 1;
const int j2 = j1 + 1;
CGAL::cpp11::array<std::size_t,8> index;
std::array<std::size_t,8> index;
index[0] = (i1 * dimy + j1) * dimx + k1;
index[1] = index[0] + 1;
index[2] = (i1 * dimy + j2) * dimx + k1;
@ -489,7 +489,7 @@ Image_3::labellized_trilinear_interpolation
index[6] = (i2 * dimy + j2) * dimx + k1;
index[7] = index[6] + 1;
CGAL::cpp11::array<Image_word_type,8> labels;
std::array<Image_word_type,8> labels;
labels[0] = ((Image_word_type*)image()->data)[index[0]];
int lc = 1;

View File

@ -96,11 +96,11 @@ void ArrPolyIpelet::protected_run(int fn){
for (std::list<Circular_arc_2>::iterator it=arc_list.begin();it!=arc_list.end();++it)
input_curves.push_back(
Curve_2( CGAL::cpp11::get<0>(*it).center(),
sqrt(CGAL::to_double(CGAL::cpp11::get<0>(*it).squared_radius())),
CGAL::cpp11::get<3>(*it),
Traits::Point_2(CGAL::cpp11::get<1>(*it).x(),CGAL::cpp11::get<1>(*it).y()),
Traits::Point_2(CGAL::cpp11::get<2>(*it).x(),CGAL::cpp11::get<2>(*it).y())
Curve_2( std::get<0>(*it).center(),
sqrt(CGAL::to_double(std::get<0>(*it).squared_radius())),
std::get<3>(*it),
Traits::Point_2(std::get<1>(*it).x(),std::get<1>(*it).y()),
Traits::Point_2(std::get<2>(*it).x(),std::get<2>(*it).y())
)
);

View File

@ -38,7 +38,7 @@ typedef Kernel::Direction_2 Direction
/* Note: due to a bug in the boost library, using a directed graph
* will cause a compilation error with g++ and clang++ when using c++11 standard.
* See http://lists.boost.org/Archives/boost/2016/05/229458.php.
* See https://lists.boost.org/Archives/boost/2016/05/229458.php.
*/
typedef boost::adjacency_list<boost::listS,
boost::vecS,

View File

@ -128,7 +128,7 @@ void generator::protected_run(int fn)
switch(fn){
case 0:{//random point in a circle
CGAL::Random_points_in_disc_2<Point_2,Creator> gs( size);
CGAL::cpp11::copy_n( gs, nbelements, std::back_inserter(points));
std::copy_n( gs, nbelements, std::back_inserter(points));
}
break;
@ -139,7 +139,7 @@ void generator::protected_run(int fn)
case 6:
case 2://points in a square : side =
{CGAL::Random_points_in_square_2<Point_2, Creator> gc (size);
CGAL::cpp11::copy_n( gc, nbelements, std::back_inserter(points));
std::copy_n( gc, nbelements, std::back_inserter(points));
}
break;
@ -166,7 +166,7 @@ void generator::protected_run(int fn)
typedef CGAL::Creator_uniform_2< Point_2, Segment_2> Seg_creator;
typedef CGAL::Join_input_iterator_2< P1, P2, Seg_creator> Seg_iterator;
Seg_iterator g( p1, p2);
CGAL::cpp11::copy_n( g, nbelements, std::back_inserter(segments) );
std::copy_n( g, nbelements, std::back_inserter(segments) );
break;
};

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