Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AABB_tree/examples/AABB_tree/AABB_cached_bbox_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)){
CGAL_FOREACH(face_descriptor fd, faces(tmesh)){
put(bb, fd, bbox(fd,tmesh));
}
Traits traits(bb);
Expand Down
2 changes: 1 addition & 1 deletion AABB_tree/examples/AABB_tree/AABB_ray_shooting_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)){
CGAL_FOREACH(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)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include <iostream>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Advancing_front_surface_reconstruction.h>
#include <boost/foreach.hpp>
#include <CGAL/foreach.h>

struct Perimeter {

Expand Down Expand Up @@ -64,15 +64,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()){
CGAL_FOREACH(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()){
CGAL_FOREACH(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 CGAL_FOREACH we do not use the type Boundary_range
CGAL_FOREACH(Vertex_handle v, vobr){
std::cout << v->point() << std::endl;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ 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>
#include <CGAL/foreach.h>

typedef CGAL::CORE_arithmetic_kernel::Integer Number_type;
typedef CGAL::Algebraic_kernel_d_1<Number_type> AK1;
Expand Down Expand Up @@ -302,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){
CGAL_FOREACH(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) {
CGAL_FOREACH(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) {
CGAL_FOREACH(const Point_2& point, points) {
assert(CGAL::degree(point.numerator()) >= 0);
}
}
Expand All @@ -332,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){
CGAL_FOREACH(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) {
CGAL_FOREACH(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) {
CGAL_FOREACH(const Point_2& point, points) {
assert(CGAL::degree(point.numerator()) >= 0);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <CGAL/Arrangement_on_surface_2.h>
#include <CGAL/Arr_geodesic_arc_on_sphere_traits_2.h>
#include <CGAL/Arr_spherical_topology_traits_2.h>
#include <CGAL/foreach.h>

typedef CGAL::Exact_rational Number_type;
typedef CGAL::Cartesian<Number_type> Kernel;
Expand Down Expand Up @@ -85,7 +86,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())
CGAL_FOREACH(Halfedge_handle hh, arr.halfedge_handles())
halfedges.push_back(hh);
#endif

Expand All @@ -108,7 +109,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())
CGAL_FOREACH(Arrangement_2::Face_handle fh, arr.face_handles())
{
std::cout << " Face: "
<< &(fh)
Expand Down
6 changes: 3 additions & 3 deletions BGL/examples/BGL_LCC/range_lcc.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Iterator_range.h>
#include <CGAL/boost/graph/graph_traits_Linear_cell_complex_for_combinatorial_map.h>
#include <boost/foreach.hpp>
#include <CGAL/foreach.h>

#include <iostream>
#include <fstream>
Expand Down Expand Up @@ -43,8 +43,8 @@ void fct(const LCC& lcc)
}
#endif

std::cout << "BOOST_FOREACH" << std::endl;
BOOST_FOREACH(vertex_descriptor vd, vr){
std::cout << "CGAL_FOREACH" << std::endl;
CGAL_FOREACH(vertex_descriptor vd, vr){
std::cout << vd->point() << std::endl;
}

Expand Down
6 changes: 3 additions & 3 deletions BGL/examples/BGL_OpenMesh/TriMesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <iostream>
#include <fstream>

#include <boost/foreach.hpp>
#include <CGAL/foreach.h>

typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;

Expand All @@ -33,8 +33,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)){
CGAL_FOREACH(vertex_descriptor vd, vertices(mesh)){
CGAL_FOREACH(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);
Expand Down
6 changes: 3 additions & 3 deletions BGL/examples/BGL_polyhedron_3/range.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/Iterator_range.h>
#include <boost/foreach.hpp>
#include <CGAL/foreach.h>


#include <iostream>
Expand Down Expand Up @@ -43,8 +43,8 @@ void fct(const Polyhedron& p)
}
#endif

std::cout << "BOOST_FOREACH" << std::endl;
BOOST_FOREACH(vertex_descriptor vd, vr){
std::cout << "CGAL_FOREACH" << std::endl;
CGAL_FOREACH(vertex_descriptor vd, vr){
std::cout << vd->point() << std::endl;
}

Expand Down
4 changes: 2 additions & 2 deletions BGL/examples/BGL_surface_mesh/connected_components.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <fstream>

#include <boost/graph/connected_components.hpp>
#include <boost/foreach.hpp>
#include <CGAL/foreach.h>

typedef CGAL::Simple_cartesian<double> Kernel;
typedef Kernel::Point_3 Point;
Expand All @@ -23,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)){
CGAL_FOREACH(vertex_descriptor v, vertices(sm)){
std::cout << v << " is in component " << ccmap[v] << std::endl;
}

Expand Down
6 changes: 3 additions & 3 deletions BGL/examples/BGL_surface_mesh/prim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <fstream>

#include <boost/graph/prim_minimum_spanning_tree.hpp>
#include <boost/foreach.hpp>
#include <CGAL/foreach.h>

typedef CGAL::Simple_cartesian<double> Kernel;
typedef Kernel::Point_3 Point;
Expand Down Expand Up @@ -36,14 +36,14 @@ int main(int, char* argv[])
" coord Coordinate {\n"
" point [ \n";

BOOST_FOREACH(vertex_descriptor vd, vertices(P)){
CGAL_FOREACH(vertex_descriptor vd, vertices(P)){
std::cout << " " << P.point(vd) << "\n";
}

std::cout << " ]\n"
" }\n"
" coordIndex [\n";
BOOST_FOREACH(vertex_descriptor vd, vertices(P)){
CGAL_FOREACH(vertex_descriptor vd, vertices(P)){
if(predecessor[vd]!=vd){
std::cout << " " << std::size_t(vd) << ", " << std::size_t(predecessor[vd]) << ", -1\n";
}
Expand Down
22 changes: 11 additions & 11 deletions BGL/examples/BGL_surface_mesh/seam_mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <fstream>
#include <vector>

#include <boost/foreach.hpp>
#include <CGAL/foreach.h>

typedef CGAL::Simple_cartesian<double> Kernel;
typedef Kernel::Point_3 Point;
Expand Down Expand Up @@ -72,43 +72,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,
CGAL_FOREACH(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)){
CGAL_FOREACH(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)){
CGAL_FOREACH(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,
CGAL_FOREACH(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,
CGAL_FOREACH(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)){
CGAL_FOREACH(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)){
CGAL_FOREACH(halfedge_descriptor hd2, halfedges_around_target(hd, mesh)){
std::cout << " " << hd2;
}
std::cout << std::endl;
Expand All @@ -118,19 +118,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)){
CGAL_FOREACH(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)){
CGAL_FOREACH(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)){
CGAL_FOREACH(face_descriptor fd, faces(mesh)){
std::cout << fd << " ";
}
std::cout << std::endl;
Expand Down
12 changes: 6 additions & 6 deletions BGL/examples/BGL_surface_mesh/surface_mesh_dual.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include <boost/graph/filtered_graph.hpp>
#include <boost/graph/connected_components.hpp>
#include <boost/foreach.hpp>
#include <CGAL/foreach.h>

typedef CGAL::Simple_cartesian<double> Kernel;
typedef Kernel::Point_3 Point;
Expand Down Expand Up @@ -51,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)) {
CGAL_FOREACH(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)) {
CGAL_FOREACH(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)) {
CGAL_FOREACH(boost::graph_traits<FiniteDual>::edge_descriptor e , edges(finite_dual)) {
std::cout << e << " " << source(e,primal) << " " << source(e,finite_dual) << std::endl;
}

Expand All @@ -73,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)) {
CGAL_FOREACH(face_descriptor f , faces(primal)) {
std::cout << f << " in connected component " << fccmap[f] << std::endl;
}

Expand All @@ -82,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)) {
CGAL_FOREACH(vertex_descriptor v , vertices(primal)) {
std::cout << v << " in connected component " << vccmap[v] << std::endl;
}
return 0;
Expand Down
2 changes: 1 addition & 1 deletion BGL/examples/BGL_surface_mesh/write_inp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <fstream>

#include <boost/graph/connected_components.hpp>
#include <boost/foreach.hpp>
#include <CGAL/foreach.h>

typedef CGAL::Simple_cartesian<double> Kernel;
typedef Kernel::Point_3 Point;
Expand Down
4 changes: 2 additions & 2 deletions BGL/examples/BGL_triangulation_2/face_graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <CGAL/boost/graph/iterator.h>

#include <boost/graph/filtered_graph.hpp>
#include <boost/foreach.hpp>
#include <CGAL/foreach.h>


typedef CGAL::Exact_predicates_inexact_constructions_kernel Epic;
Expand Down Expand Up @@ -104,7 +104,7 @@ main(int,char*[])
Ppmap ppmap = get(boost::vertex_point, t);


BOOST_FOREACH(vertex_descriptor vd, vertices_around_target(*vertices(t).first, t)){
CGAL_FOREACH(vertex_descriptor vd, vertices_around_target(*vertices(t).first, t)){
std::cout << ppmap[vd] << std::endl;
}

Expand Down
2 changes: 1 addition & 1 deletion BGL/include/CGAL/boost/graph/Euler_operations.h
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,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)){
CGAL_FOREACH(halfedge_descriptor hd, halfedges_around_face(h,g)){
set_face(hd, f,g);
}
set_halfedge(f,h,g);
Expand Down
Loading