remove BOOST_FOREACH added by recent PRs

This commit is contained in:
Sébastien Loriot 2019-11-04 10:59:15 +01:00
parent 4f97bd5102
commit 9a0bff4008
26 changed files with 45 additions and 60 deletions

View File

@ -244,7 +244,7 @@ MainWindow::open(QString fileName)
#if BOOST_VERSION >= 105600 && (! defined(BOOST_GCC) || BOOST_GCC >= 40500)
std::vector<K::Point_3> point_3_s;
CGAL::read_multi_point_WKT(ifs, point_3_s);
BOOST_FOREACH(const K::Point_3& point_3, point_3_s)
for(const K::Point_3& point_3 : point_3_s)
{
points.push_back(Apollonius_site_2(K::Point_2(point_3.x(), point_3.y()), point_3.z()));
}

View File

@ -499,7 +499,7 @@ MainWindow::open(QString fileName)
{
#if BOOST_VERSION >= 105600 && (! defined(BOOST_GCC) || BOOST_GCC >= 40500)
CGAL::read_multi_point_WKT(ifs, points);
BOOST_FOREACH(K::Point_2 p, points)
for(K::Point_2 p : points)
{
mc.insert(p);
me.insert(p);

View File

@ -358,7 +358,7 @@ MainWindow::loadWKTConstraints(QString
do{
std::vector<Polygon> polygons;
CGAL::read_multi_polygon_WKT(ifs, polygons);
BOOST_FOREACH(const Polygon& poly, polygons)
for(const Polygon& poly : polygons)
{
if(poly.outer_boundary().is_empty())
continue;
@ -388,7 +388,7 @@ MainWindow::loadWKTConstraints(QString
do{
std::vector<LineString > linestrings;
CGAL::read_multi_linestring_WKT(ifs, linestrings);
BOOST_FOREACH(const LineString& ls, linestrings)
for(const LineString& ls : linestrings)
{
bool first_pass=true;
LineString::const_iterator it = ls.begin();

View File

@ -401,7 +401,7 @@ MainWindow::loadWKT(QString
{
std::vector<K::Point_2> mpts;
CGAL::read_multi_point_WKT(ifs, mpts);
BOOST_FOREACH(const K::Point_2& p, mpts)
for(const K::Point_2& p : mpts)
svd.insert(p);
}while(ifs.good() && !ifs.eof());
//Lines
@ -412,7 +412,7 @@ MainWindow::loadWKT(QString
typedef std::vector<K::Point_2> LineString;
std::vector<LineString> mls;
CGAL::read_multi_linestring_WKT(ifs, mls);
BOOST_FOREACH(const LineString& ls, mls)
for(const LineString& ls : mls)
{
if(ls.empty())
continue;
@ -450,7 +450,7 @@ MainWindow::loadWKT(QString
typedef CGAL::Polygon_with_holes_2<K> Polygon;
std::vector<Polygon> mps;
CGAL::read_multi_polygon_WKT(ifs, mps);
BOOST_FOREACH(const Polygon& poly, mps)
for(const Polygon& poly : mps)
{
if(poly.outer_boundary().is_empty())
continue;

View File

@ -273,7 +273,7 @@ MainWindow::open(QString fileName)
#if BOOST_VERSION >= 105600 && (! defined(BOOST_GCC) || BOOST_GCC >= 40500)
std::vector<std::vector<Point_2> > mls;
CGAL::read_multi_linestring_WKT(ifs, mls);
BOOST_FOREACH(const std::vector<Point_2>& ls, mls)
for(const std::vector<Point_2>& ls : mls)
{
if(ls.size() > 2)
continue;
@ -315,7 +315,7 @@ MainWindow::on_actionSaveSegments_triggered()
{
#if BOOST_VERSION >= 105600 && (! defined(BOOST_GCC) || BOOST_GCC >= 40500)
std::vector<std::vector<Point_2> >mls;
BOOST_FOREACH(const Segment_2& seg, input)
for(const Segment_2& seg : input)
{
std::vector<Point_2> ls(2);
ls[0] = seg.source();

View File

@ -572,12 +572,12 @@ MainWindow::loadWKT(QString
typedef CGAL::Point_2<K> Point;
std::vector<Polygon> mps;
CGAL::read_multi_polygon_WKT(ifs, mps);
BOOST_FOREACH(const Polygon& p, mps)
for(const Polygon& p : mps)
{
if(p.outer_boundary().is_empty())
continue;
BOOST_FOREACH(Point point, p.outer_boundary().container())
for(Point point : p.outer_boundary().container())
cdt.insert(point);
for(Polygon::General_polygon_2::Edge_const_iterator
e_it=p.outer_boundary().edges_begin(); e_it != p.outer_boundary().edges_end(); ++e_it)
@ -586,7 +586,7 @@ MainWindow::loadWKT(QString
for(Polygon::Hole_const_iterator h_it =
p.holes_begin(); h_it != p.holes_end(); ++h_it)
{
BOOST_FOREACH(Point point, h_it->container())
for(Point point : h_it->container())
cdt.insert(point);
for(Polygon::General_polygon_2::Edge_const_iterator
e_it=h_it->edges_begin(); e_it != h_it->edges_end(); ++e_it)
@ -604,7 +604,7 @@ MainWindow::loadWKT(QString
typedef std::vector<K::Point_2> LineString;
std::vector<LineString> mls;
CGAL::read_multi_linestring_WKT(ifs, mls);
BOOST_FOREACH(const LineString& ls, mls)
for(const LineString& ls : mls)
{
if(ls.empty())
continue;
@ -642,7 +642,7 @@ MainWindow::loadWKT(QString
{
std::vector<K::Point_2> mpts;
CGAL::read_multi_point_WKT(ifs, mpts);
BOOST_FOREACH(const K::Point_2& p, mpts)
for(const K::Point_2& p : mpts)
{
cdt.insert(p);
}

View File

@ -260,7 +260,7 @@ MainWindow::on_actionLoadPoints_triggered()
#if BOOST_VERSION >= 105600 && (! defined(BOOST_GCC) || BOOST_GCC >= 40500)
std::vector<K::Point_3> points_3;
CGAL::read_multi_point_WKT(ifs, points_3);
BOOST_FOREACH(const K::Point_3& p, points_3)
for(const K::Point_3& p : points_3)
{
points.push_back(Weighted_point_2(K::Point_2(p.x(), p.y()), p.z()));
}

View File

@ -70,7 +70,7 @@ int main (int, char**)
parameters.normal_threshold = 0.9;
ransac.detect(parameters);
BOOST_FOREACH(boost::shared_ptr<Efficient_ransac::Shape> shape, ransac.shapes())
for(boost::shared_ptr<Efficient_ransac::Shape> shape : ransac.shapes())
if (Sphere* sphere = dynamic_cast<Sphere*>(shape.get()))
std::cerr << "Detected sphere of center " << sphere->center() // Center should be approx 0, 0, 0
<< " and of radius " << sphere->radius() << std::endl; // Radius should be approx 1

View File

@ -1259,7 +1259,7 @@ public:
// non-manifold vertices would not be duplicated in interior
// vertices of patche)
// special code to handle non-manifold vertices on the boundary
BOOST_FOREACH (vertex_descriptor vd, vertices(tm1))
for (vertex_descriptor vd : vertices(tm1))
{
boost::optional<halfedge_descriptor> op_h = is_border(vd, tm1);
if (op_h == boost::none) continue;
@ -1629,12 +1629,12 @@ public:
}
// Code dedicated to the handling of non-manifold vertices
BOOST_FOREACH(vertex_descriptor vd, border_nm_vertices)
for(vertex_descriptor vd : border_nm_vertices)
{
// first check if at least one incident patch will be kept
boost::unordered_set<std::size_t> id_p_rm;
bool all_removed=true;
BOOST_FOREACH(halfedge_descriptor h, halfedges_around_target(vd, tm1))
for(halfedge_descriptor h : halfedges_around_target(vd, tm1))
{
face_descriptor f = face(h, tm1);
if ( f != GT::null_face() )
@ -1649,7 +1649,7 @@ public:
if (all_removed)
id_p_rm.erase(id_p_rm.begin());
// remove the vertex from the interior vertices of patches to be removed
BOOST_FOREACH(std::size_t pid, id_p_rm)
for(std::size_t pid : id_p_rm)
patches_of_tm1[pid].interior_vertices.erase(vd);
// we now need to update the next/prev relationship induced by the future removal of patches
@ -1703,7 +1703,7 @@ public:
while(true);
if (hit == end) break;
}
BOOST_FOREACH ( const Hedge_pair& p, hedges_to_link)
for(const Hedge_pair& p : hedges_to_link)
set_next(p.first, p.second, tm1);
}
}

View File

@ -28,7 +28,7 @@ bool is_ccw(int xi, int yi,
CGAL::Polygon_2<K> polygon;
if(polyline.front() == polyline.back())
{
BOOST_FOREACH(const typename K::Point_3& p, polyline)
for(const typename K::Point_3& p : polyline)
{
polygon.push_back(typename K::Point_2(p[xi], p[yi]));
}

View File

@ -6,8 +6,6 @@
#include <CGAL/boost/graph/named_params_helper.h>
#include <CGAL/Polygon_mesh_processing/repair.h>
#include <boost/foreach.hpp>
#include <cassert>
#include <fstream>
#include <map>

View File

@ -258,7 +258,7 @@ public:
is_tree_empty = tree.empty();
nb_lines = positions_lines.size();
setEdgeContainer(0, new Ec(Vi::PROGRAM_NO_SELECTION, false));
BOOST_FOREACH(auto v, CGAL::QGLViewer::QGLViewerPool())
for(auto v : CGAL::QGLViewer::QGLViewerPool())
{
CGAL::Three::Viewer_interface* viewer = static_cast<CGAL::Three::Viewer_interface*>(v);
initGL(viewer);
@ -488,7 +488,7 @@ public:
setEdgeContainer(0, new Ec(Vi::PROGRAM_NO_SELECTION, false));
texture = new ::Texture(m_grid_size,m_grid_size);
getTriangleContainer(0)->setTextureSize(QSize(m_grid_size, m_grid_size));
BOOST_FOREACH(auto v, CGAL::QGLViewer::QGLViewerPool())
for(auto v : CGAL::QGLViewer::QGLViewerPool())
{
CGAL::Three::Viewer_interface* viewer = static_cast<CGAL::Three::Viewer_interface*>(v);
initGL(viewer);

View File

@ -64,7 +64,7 @@ public:
bbox.xmax(),bbox.ymax(),bbox.zmax()));
nb_points = points.size();
BOOST_FOREACH(auto v, CGAL::QGLViewer::QGLViewerPool())
for(auto v : CGAL::QGLViewer::QGLViewerPool())
{
CGAL::Three::Viewer_interface* viewer = static_cast<CGAL::Three::Viewer_interface*>(v);
initGL(viewer);

View File

@ -305,7 +305,7 @@ Scene_alpha_shape_item::Scene_alpha_shape_item(Scene_points_with_normal_item *po
vertices.push_back(it->point().y()+offset.y);
vertices.push_back(it->point().z()+offset.z);
}
BOOST_FOREACH(auto v, CGAL::QGLViewer::QGLViewerPool())
for(auto v : CGAL::QGLViewer::QGLViewerPool())
{
CGAL::Three::Viewer_interface* viewer = static_cast<CGAL::Three::Viewer_interface*>(v);
if(!isInit(viewer))

View File

@ -532,7 +532,7 @@ void Scene_c3t3_item::common_constructor(bool is_surface)
setEdgeContainer(Grid_edges, new Ec(Vi::PROGRAM_NO_SELECTION, false));
setEdgeContainer(C3t3_edges, new Ec(Vi::PROGRAM_C3T3_EDGES, false));
setPointContainer(C3t3_points, new Pc(Vi::PROGRAM_C3T3_EDGES, false));
BOOST_FOREACH(auto v, CGAL::QGLViewer::QGLViewerPool())
for(auto v : CGAL::QGLViewer::QGLViewerPool())
{
v->installEventFilter(this);
}
@ -611,7 +611,7 @@ void Scene_c3t3_item::updateCutPlane()
if(!d)
return;
if(d->need_changed) {
BOOST_FOREACH(auto v, CGAL::QGLViewer::QGLViewerPool())
for(auto v : CGAL::QGLViewer::QGLViewerPool())
{
CGAL::Three::Viewer_interface* viewer = static_cast<CGAL::Three::Viewer_interface*>(v);
d->are_intersection_buffers_filled[viewer] = false;
@ -1581,7 +1581,7 @@ Scene_c3t3_item::setColor(QColor c)
d->compute_color_map(c);
invalidateOpenGLBuffers();
d->invalidate_stats();
BOOST_FOREACH(auto v, CGAL::QGLViewer::QGLViewerPool())
for(auto v : CGAL::QGLViewer::QGLViewerPool())
{
CGAL::Three::Viewer_interface* viewer = static_cast<CGAL::Three::Viewer_interface*>(v);
d->are_intersection_buffers_filled[viewer] = false;
@ -1636,7 +1636,7 @@ void Scene_c3t3_item::show_intersection(bool b)
d->intersection->setRenderingMode(renderingMode());
connect(d->intersection, SIGNAL(destroyed()), this, SLOT(reset_intersection_item()));
BOOST_FOREACH(auto v, CGAL::QGLViewer::QGLViewerPool())
for(auto v : CGAL::QGLViewer::QGLViewerPool())
{
CGAL::Three::Viewer_interface* viewer = static_cast<CGAL::Three::Viewer_interface*>(v);
d->are_intersection_buffers_filled[viewer] = false;

View File

@ -1295,7 +1295,7 @@ void Scene_surface_mesh_item::invalidate(Gl_data_names name)
getEdgeContainer(0)->reset_vbos(name);
getPointContainer(0)->reset_vbos(name);
bool has_been_init = false;
BOOST_FOREACH(CGAL::QGLViewer* v, CGAL::QGLViewer::QGLViewerPool())
for(CGAL::QGLViewer* v : CGAL::QGLViewer::QGLViewerPool())
{
CGAL::Three::Viewer_interface* viewer = static_cast<CGAL::Three::Viewer_interface*>(v);
if(!isInit(viewer))

View File

@ -165,7 +165,7 @@ void Scene_textured_surface_mesh_item::common_constructor()
setEdgeContainer(0, new Ec(Vi::PROGRAM_WITH_TEXTURED_EDGES, false));//edges
getTriangleContainer(0)->setTextureSize(QSize(d->texture.GetWidth(), d->texture.GetHeight()));
getEdgeContainer(0)->setTextureSize(QSize(d->texture.GetWidth(), d->texture.GetHeight()));
BOOST_FOREACH(auto v, CGAL::QGLViewer::QGLViewerPool())
for(auto v : CGAL::QGLViewer::QGLViewerPool())
{
CGAL::Three::Viewer_interface* viewer = static_cast<CGAL::Three::Viewer_interface*>(v);
initGL(viewer);

View File

@ -406,12 +406,12 @@ void MainWindow::loadWKT(QString
if(! points.empty()){
std::cout << "Ignore " << points.size() << " isolated points" << std::endl;
}
BOOST_FOREACH(LineString poly, polylines){
for(LineString poly : polylines){
if ( poly.size() > 2 ){
m_pct.insert_constraint(poly.begin(), poly.end());
}
}
BOOST_FOREACH(Polygon_with_holes_2 poly, polygons){
for(Polygon_with_holes_2 poly : polygons){
m_pct.insert_constraint(poly.outer_boundary().vertices_begin(), poly.outer_boundary().vertices_end());
for(Polygon_with_holes_2::Hole_const_iterator it = poly.holes_begin(); it != poly.holes_end(); ++it){
const Polygon_2& hole = *it;

View File

@ -13,7 +13,6 @@
#define CGAL_ITERATOR_RANGE_H
#include <CGAL/tuple.h>
#include <boost/foreach.hpp>
#include <utility>
namespace CGAL {

View File

@ -6,7 +6,6 @@
#include <fstream>
#include <CGAL/IO/WKT.h>
#include <boost/foreach.hpp> //must be included before WKT for some reason
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <vector>
@ -27,7 +26,7 @@ int main(int argc, char* argv[])
CGAL::read_linestring_WKT(is, ls);
is.close();
}
BOOST_FOREACH(Point p, ls)
for(Point p : ls)
std::cout<<p<<std::endl;
ls.clear();
MultiLineString mls;
@ -36,9 +35,9 @@ int main(int argc, char* argv[])
CGAL::read_multi_linestring_WKT(is, mls);
is.close();
}
BOOST_FOREACH(LineString l, mls)
for(LineString l : mls)
{
BOOST_FOREACH(const Point& p, l)
for(const Point& p : l)
std::cout<<p<<std::endl;
}
return 0;

View File

@ -9,8 +9,6 @@
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <boost/foreach.hpp>
#include <vector>
//typedef CGAL::Simple_cartesian<CGAL::Gmpq> Kernel;
@ -26,7 +24,7 @@ int main(int argc, char* argv[])
std::ifstream is((argc>1)?argv[1]:"data/multipoint.wkt");
MultiPoint mp;
CGAL::read_multi_point_WKT(is, mp);
BOOST_FOREACH(const Point& p, mp)
for(const Point& p : mp)
{
std::cout<<p<<std::endl;
}

View File

@ -10,8 +10,6 @@
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <boost/foreach.hpp>
#include <vector>
#include <deque>
@ -35,7 +33,7 @@ int main(int argc, char* argv[])
if(!p.outer_boundary().is_empty())
polys.push_back(p);
}while(is.good() && !is.eof());
BOOST_FOREACH(Polygon p, polys)
for(Polygon p : polys)
std::cout<<p<<std::endl;
}
@ -43,7 +41,7 @@ int main(int argc, char* argv[])
std::ifstream is((argc>2)?argv[2]:"data/multipolygon.wkt");
MultiPolygon mp;
CGAL::read_multi_polygon_WKT(is, mp);
BOOST_FOREACH(Polygon p, mp)
for(Polygon p : mp)
std::cout<<p<<std::endl;
}
return 0;

View File

@ -10,8 +10,6 @@
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <boost/foreach.hpp>
#include <vector>
//typedef CGAL::Simple_cartesian<CGAL::Gmpq> Kernel;
@ -35,12 +33,12 @@ int main(int argc, char* argv[])
MultiPolygon polygons;
CGAL::read_WKT(is, points,polylines,polygons);
BOOST_FOREACH(Point p, points)
for(Point p : points)
std::cout<<p<<std::endl;
BOOST_FOREACH(LineString ls, polylines)
BOOST_FOREACH(Point p, ls)
for(LineString ls : polylines)
for(Point p : ls)
std::cout<<p<<std::endl;
BOOST_FOREACH(Polygon p, polygons)
for(Polygon p : polygons)
std::cout<<p<<std::endl;
}

View File

@ -9,8 +9,6 @@
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <boost/foreach.hpp>
#include <vector>
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;

View File

@ -11,8 +11,6 @@
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Simple_cartesian.h>
#include <boost/foreach.hpp>
#include <vector>
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;

View File

@ -4,7 +4,6 @@
#include <CGAL/Polygon_mesh_processing/triangulate_faces.h>
#include <fstream>
#include <string>
#include <boost/foreach.hpp>
#include "draw_surface_mesh_small_faces.h"
typedef CGAL::Simple_cartesian<double> K;
@ -26,7 +25,7 @@ int main(int argc, char* argv[])
boost::tie(faces_size, created)=sm.add_property_map<face_descriptor, FT>("f:size",0.);
CGAL_assertion(created);
BOOST_FOREACH(face_descriptor fd, sm.faces())
for(face_descriptor fd : sm.faces())
{ faces_size[fd]=CGAL::Polygon_mesh_processing::face_area(fd, sm); }
draw_surface_mesh_with_small_faces(sm);