From 20898e4b313a76f44ec87a93284f52e4aee64498 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Thu, 14 May 2020 13:46:57 +0200 Subject: [PATCH] fix functions calls --- .../reconstruction_structured.cpp | 6 ++--- BGL/examples/BGL_LCC/copy_lcc.cpp | 3 ++- BGL/examples/BGL_LCC/distance_lcc.cpp | 18 ++++++------- .../BGL_LCC/incident_vertices_lcc.cpp | 4 +-- BGL/examples/BGL_LCC/normals_lcc.cpp | 26 +++++++++---------- BGL/examples/BGL_LCC/range_lcc.cpp | 10 +++---- .../BGL_LCC/transform_iterator_lcc.cpp | 10 +++---- BGL/examples/BGL_OpenMesh/TriMesh.cpp | 2 +- ...lection_borders_regularization_example.cpp | 3 ++- .../surface_mesh_partition.cpp | 2 +- BGL/include/CGAL/boost/graph/IO/STL.h | 8 +++--- .../CGAL/boost/graph/IO/polygon_mesh_io.h | 3 ++- .../Point_set_3/point_set_advanced.cpp | 2 +- .../Point_set_3/point_set_read_ply.cpp | 2 +- .../Point_set_3/point_set_read_xyz.cpp | 4 +-- .../read_write_xyz_point_set_example.cpp | 2 +- .../registration_with_OpenGR.cpp | 4 +-- ...tion_with_opengr_pointmatcher_pipeline.cpp | 4 +-- .../include/CGAL/IO/read_off_points.h | 1 - .../edge_aware_upsample_test.cpp | 2 +- .../normal_estimation_test.cpp | 2 +- .../Point_set_processing_3/vcm_all_test.cpp | 2 +- .../corefinement_LCC.cpp | 9 ++++--- .../hole_filling_example_LCC.cpp | 7 ++--- .../surface_intersection_sm_poly.cpp | 5 ++-- .../Polyhedron/Plugins/IO/GOCAD_io_plugin.cpp | 22 ++++++++-------- Stream_support/include/CGAL/IO/PLY.h | 2 +- 27 files changed, 84 insertions(+), 81 deletions(-) diff --git a/Advancing_front_surface_reconstruction/examples/Advancing_front_surface_reconstruction/reconstruction_structured.cpp b/Advancing_front_surface_reconstruction/examples/Advancing_front_surface_reconstruction/reconstruction_structured.cpp index a5bf7ada010..cca5609f509 100644 --- a/Advancing_front_surface_reconstruction/examples/Advancing_front_surface_reconstruction/reconstruction_structured.cpp +++ b/Advancing_front_surface_reconstruction/examples/Advancing_front_surface_reconstruction/reconstruction_structured.cpp @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include @@ -112,10 +112,8 @@ int main (int argc, char* argv[]) const char* fname = (argc>1) ? argv[1] : "data/cube.pwn"; // Loading point set from a file. - std::ifstream stream(fname); - if (!stream || - !CGAL::read_XYZ(stream, + if (!CGAL::read_points(fname, std::back_inserter(points), CGAL::parameters::point_map(Point_map()). normal_map(Normal_map()))) diff --git a/BGL/examples/BGL_LCC/copy_lcc.cpp b/BGL/examples/BGL_LCC/copy_lcc.cpp index 0c84c58a0b6..65086dfeb7f 100644 --- a/BGL/examples/BGL_LCC/copy_lcc.cpp +++ b/BGL/examples/BGL_LCC/copy_lcc.cpp @@ -6,6 +6,7 @@ #include #include +#include #include #include @@ -38,7 +39,7 @@ int main(int argc, char* argv[]) Target1 T1; { CGAL::copy_face_graph(S, T1); - CGAL::write_off("lcc.off", T1); + CGAL::write_OFF("lcc.off", T1); } S.clear(); diff --git a/BGL/examples/BGL_LCC/distance_lcc.cpp b/BGL/examples/BGL_LCC/distance_lcc.cpp index 6e4d2cbe995..7d76d579cb3 100644 --- a/BGL/examples/BGL_LCC/distance_lcc.cpp +++ b/BGL/examples/BGL_LCC/distance_lcc.cpp @@ -1,7 +1,7 @@ #include #include -#include +#include #include @@ -20,24 +20,24 @@ typedef boost::graph_traits::vertex_iterator vertex_iterator; int main(int argc, char** argv) { LCC lcc; - CGAL::read_OFF((argc>1)?argv[1]:"cube.off", lcc); + CGAL::read_polygon_mesh((argc>1)?argv[1]:"cube.off", lcc); // This is the vector where the distance gets written to - std::vector distance(lcc.vertex_attributes().size()); + std::vector distance(lcc.vertex_attributes().size()); - // Here we start at an arbitrary vertex + // Here we start at an arbitrary vertex // Any other vertex could be the starting point vertex_iterator vb, ve; boost::tie(vb,ve)=vertices(lcc); vertex_descriptor vd = *vb; - + std::cout << "We compute distances to " << vd->point() << std::endl; // bfs = breadth first search explores the graph - // Just as the distance_recorder there is a way to record the predecessor of a vertex + // Just as the distance_recorder there is a way to record the predecessor of a vertex boost::breadth_first_search(lcc, - vd, - visitor(boost::make_bfs_visitor + vd, + visitor(boost::make_bfs_visitor (boost::record_distances (make_iterator_property_map (distance.begin(), @@ -50,6 +50,6 @@ int main(int argc, char** argv) vd = *vb; std::cout<point()<<" is "<id()]<<" hops away."< #include -#include +#include #include #include @@ -51,7 +51,7 @@ OutputIterator adjacent_vertices_V2(const LCC& g, int main(int argc, char** argv) { LCC lcc; - CGAL::read_OFF((argc>1)?argv[1]:"cube.off", lcc); + CGAL::read_polygon_mesh((argc>1)?argv[1]:"cube.off", lcc); GraphTraits::vertex_iterator vi = vertices(lcc).first; std::list V; diff --git a/BGL/examples/BGL_LCC/normals_lcc.cpp b/BGL/examples/BGL_LCC/normals_lcc.cpp index a7655055d29..3cdd3580bef 100644 --- a/BGL/examples/BGL_LCC/normals_lcc.cpp +++ b/BGL/examples/BGL_LCC/normals_lcc.cpp @@ -1,7 +1,7 @@ #include #include -#include +#include #include #include @@ -17,12 +17,12 @@ typedef CGAL::Linear_cell_complex_traits<3, Kernel> LCC_traits; typedef CGAL::Linear_cell_complex_for_bgl_combinatorial_map_helper <2, 3, LCC_traits>::type LCC; -template -void calculate_face_normals(const HalfedgeGraph& g, - PointMap pm, - NormalMap nm) +void calculate_face_normals(const HalfedgeGraph& g, + PointMap pm, + NormalMap nm) { typedef boost::graph_traits GraphTraits; typedef typename GraphTraits::face_iterator face_iterator; @@ -42,7 +42,7 @@ void calculate_face_normals(const HalfedgeGraph& g, edg = next(edg, g); point p2 = pm[target(edg, g)]; edg = next(edg, g); - + if(edg == edgb) { // triangle nm[*fb] = CGAL::unit_normal(p1, p2, p0); @@ -54,11 +54,11 @@ void calculate_face_normals(const HalfedgeGraph& g, n = n + CGAL::normal(p1, p2, p0); p0 = p1; p1 = p2; - + edg = next(edg, g); p2 = pm[target(edg, g)]; } while(edg != edgb); - + nm[*fb] = n / CGAL::sqrt(n.squared_length()); } } @@ -70,13 +70,13 @@ int main(int argc, char** argv) Face_index_map; LCC lcc; - CGAL::read_OFF((argc>1)?argv[1]:"cube.off", lcc); - + CGAL::read_polygon_mesh((argc>1)?argv[1]:"cube.off", lcc); + // Ad hoc property_map to store normals. Face_index_map is used to // map face_descriptors to a contiguous range of indices. See // http://www.boost.org/libs/property_map/doc/vector_property_map.html // for details. - boost::vector_property_map + boost::vector_property_map normals(get(CGAL::face_index, lcc)); calculate_face_normals( @@ -88,7 +88,7 @@ int main(int argc, char** argv) std::cout << "Normals" << std::endl; for(LCC::Attribute_range<2>::type::iterator it=lcc.attributes<2>().begin(); it!=lcc.attributes<2>().end(); ++it) - { + { // Facet_iterator is a face_descriptor, so we can use it as the // key here std::cout << normals[it] << std::endl; diff --git a/BGL/examples/BGL_LCC/range_lcc.cpp b/BGL/examples/BGL_LCC/range_lcc.cpp index 1a54baa4d1a..ad261980311 100644 --- a/BGL/examples/BGL_LCC/range_lcc.cpp +++ b/BGL/examples/BGL_LCC/range_lcc.cpp @@ -2,7 +2,7 @@ #include #include -#include +#include #include #include @@ -36,15 +36,15 @@ struct Fct void fct(const LCC& lcc) { vertex_range vr(vertices(lcc)); - + std::cout << "new for loop" << std::endl; for(vertex_descriptor vd : vr){ std::cout << vd->point() << std::endl; } - + std::cout << "boost::tie + std::for_each" << std::endl; vertex_iterator vb, ve; - + boost::tie(vb,ve) = vertices_range(lcc); std::for_each(vb,ve, Fct()); } @@ -52,7 +52,7 @@ void fct(const LCC& lcc) int main(int argc, char** argv) { LCC lcc; - CGAL::read_OFF((argc>1)?argv[1]:"cube.off", lcc); + CGAL::read_polygon_mesh((argc>1)?argv[1]:"cube.off", lcc); fct(lcc); return 0; diff --git a/BGL/examples/BGL_LCC/transform_iterator_lcc.cpp b/BGL/examples/BGL_LCC/transform_iterator_lcc.cpp index 2fa99bc696d..9e6134449ec 100644 --- a/BGL/examples/BGL_LCC/transform_iterator_lcc.cpp +++ b/BGL/examples/BGL_LCC/transform_iterator_lcc.cpp @@ -3,7 +3,7 @@ #include #include #include -#include +#include #include #include @@ -21,7 +21,7 @@ typedef CGAL::Halfedge_around_target_iterator halfedge_around_target_iterat template struct Source { - const G* g; + const G* g; Source() : g(NULL) @@ -43,17 +43,17 @@ struct Source { int main(int argc, char** argv) { LCC lcc; - CGAL::read_OFF((argc>1)?argv[1]:"cube.off", lcc); + CGAL::read_polygon_mesh((argc>1)?argv[1]:"cube.off", lcc); GraphTraits::vertex_descriptor vd = *(vertices(lcc).first); - typedef boost::transform_iterator,halfedge_around_target_iterator> adjacent_vertex_iterator; + typedef boost::transform_iterator,halfedge_around_target_iterator> adjacent_vertex_iterator; halfedge_around_target_iterator hb,he; boost::tie(hb,he) = halfedges_around_target(halfedge(vd,lcc),lcc); adjacent_vertex_iterator avib, avie; avib = boost::make_transform_iterator(hb, Source(lcc)); avie = boost::make_transform_iterator(he, Source(lcc)); - + std::list V; std::copy(avib,avie, std::back_inserter(V)); return 0; diff --git a/BGL/examples/BGL_OpenMesh/TriMesh.cpp b/BGL/examples/BGL_OpenMesh/TriMesh.cpp index 28f78c6c4ab..dfadaaaeb8a 100644 --- a/BGL/examples/BGL_OpenMesh/TriMesh.cpp +++ b/BGL/examples/BGL_OpenMesh/TriMesh.cpp @@ -33,7 +33,7 @@ int main(int argc, char** argv ) 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); + CGAL::write_OFF((argc>2)?argv[2]:"out.off", mesh); return 0; } } diff --git a/BGL/examples/BGL_graphcut/face_selection_borders_regularization_example.cpp b/BGL/examples/BGL_graphcut/face_selection_borders_regularization_example.cpp index 76b9f82d2b7..9904bfffecc 100644 --- a/BGL/examples/BGL_graphcut/face_selection_borders_regularization_example.cpp +++ b/BGL/examples/BGL_graphcut/face_selection_borders_regularization_example.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include @@ -20,7 +21,7 @@ int main(int argc, char** argv) } Mesh mesh; - CGAL::read_off (in, mesh); + CGAL::read_OFF (in, mesh); boost::unordered_map is_selected_map; diff --git a/BGL/examples/BGL_surface_mesh/surface_mesh_partition.cpp b/BGL/examples/BGL_surface_mesh/surface_mesh_partition.cpp index 8f731b0d676..40dd8c6766a 100644 --- a/BGL/examples/BGL_surface_mesh/surface_mesh_partition.cpp +++ b/BGL/examples/BGL_surface_mesh/surface_mesh_partition.cpp @@ -47,7 +47,7 @@ int main(int argc, char** argv) // Output the mesh extracted from subpart n°0 std::ofstream out("sm_part_0.off"); out.precision(17); - CGAL::write_off(out, part_sm); + CGAL::write_OFF(out, part_sm); // Output all the vertices that are in the part n°0 std::ofstream outxyz("out.xyz"); diff --git a/BGL/include/CGAL/boost/graph/IO/STL.h b/BGL/include/CGAL/boost/graph/IO/STL.h index 2f22264f050..31ad68087cc 100644 --- a/BGL/include/CGAL/boost/graph/IO/STL.h +++ b/BGL/include/CGAL/boost/graph/IO/STL.h @@ -139,10 +139,10 @@ bool write_STL(std::ostream& out, const float coords[12] = { - static_cast(n.x()), static_cast(n.y()), static_cast(n.z()), - static_cast(p.x()), static_cast(p.y()), static_cast(p.z()), - static_cast(q.x()), static_cast(q.y()), static_cast(q.z()), - static_cast(r.x()), static_cast(r.y()), static_cast(r.z()) }; + static_cast(to_double(n.x())), static_cast(to_double(n.y())), static_cast(to_double(n.z())), + static_cast(to_double(p.x())), static_cast(to_double(p.y())), static_cast(to_double(p.z())), + static_cast(to_double(q.x())), static_cast(to_double(q.y())), static_cast(to_double(q.z())), + static_cast(to_double(r.x())), static_cast(to_double(r.y())), static_cast(to_double(r.z())) }; for(int i=0; i<12; ++i) out.write(reinterpret_cast(&coords[i]), sizeof(coords[i])); diff --git a/BGL/include/CGAL/boost/graph/IO/polygon_mesh_io.h b/BGL/include/CGAL/boost/graph/IO/polygon_mesh_io.h index 926615cb007..6bc5ac5bef9 100644 --- a/BGL/include/CGAL/boost/graph/IO/polygon_mesh_io.h +++ b/BGL/include/CGAL/boost/graph/IO/polygon_mesh_io.h @@ -144,10 +144,11 @@ bool write_polygon_mesh(const std::string& fname, if (fname.find(".stl") != std::string::npos) { return write_STL(fname, g, np); } - +#ifdef CGAL_USE_VTK if (fname.find(".vtp") != std::string::npos) { return write_VTP(fname, g, np); } +#endif return false; } diff --git a/Point_set_3/examples/Point_set_3/point_set_advanced.cpp b/Point_set_3/examples/Point_set_3/point_set_advanced.cpp index 0d241090867..88d8c7d9bdc 100644 --- a/Point_set_3/examples/Point_set_3/point_set_advanced.cpp +++ b/Point_set_3/examples/Point_set_3/point_set_advanced.cpp @@ -19,7 +19,7 @@ int main (int argc, char** argv) Point_set point_set; point_set.add_normal_map(); // Reading input in OFF format - if (!f || !CGAL::read_off_points + if (!f || !CGAL::read_OFF (f, point_set.index_back_inserter(), // OutputIterator CGAL::parameters::point_map(point_set.point_push_map()). diff --git a/Point_set_3/examples/Point_set_3/point_set_read_ply.cpp b/Point_set_3/examples/Point_set_3/point_set_read_ply.cpp index 082916a4de7..7e4db2aa151 100644 --- a/Point_set_3/examples/Point_set_3/point_set_read_ply.cpp +++ b/Point_set_3/examples/Point_set_3/point_set_read_ply.cpp @@ -53,7 +53,7 @@ int main (int argc, char** argv) { std::ofstream out ("out.ply"); out.precision(17); // Use sufficient precision in ASCII - CGAL::write_ply_point_set (out, point_set); // same as `out << point_set` + CGAL::write_PLY (out, point_set); // same as `out << point_set` } return 0; diff --git a/Point_set_3/examples/Point_set_3/point_set_read_xyz.cpp b/Point_set_3/examples/Point_set_3/point_set_read_xyz.cpp index f227c22d855..3bf3823d865 100644 --- a/Point_set_3/examples/Point_set_3/point_set_read_xyz.cpp +++ b/Point_set_3/examples/Point_set_3/point_set_read_xyz.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include @@ -19,7 +19,7 @@ int main (int argc, char** argv) Point_set point_set; // Reading input in XYZ format - if (!f || !CGAL::read_XYZ (f, point_set)) + if (!f || !CGAL::read_XYZ(f, point_set)) { std::cerr << "Can't read input file " << std::endl; return EXIT_FAILURE; diff --git a/Point_set_processing_3/examples/Point_set_processing_3/read_write_xyz_point_set_example.cpp b/Point_set_processing_3/examples/Point_set_processing_3/read_write_xyz_point_set_example.cpp index 32a51237142..e453ff88ef4 100644 --- a/Point_set_processing_3/examples/Point_set_processing_3/read_write_xyz_point_set_example.cpp +++ b/Point_set_processing_3/examples/Point_set_processing_3/read_write_xyz_point_set_example.cpp @@ -36,7 +36,7 @@ int main(int argc, char*argv[]) } // Saves point set. - // Note: write_xyz_points() requires property maps to access each + // Note: write_XYZ() requires property maps to access each // point position and normal. std::ofstream out("oni_copy.xyz"); out.precision(17); diff --git a/Point_set_processing_3/examples/Point_set_processing_3/registration_with_OpenGR.cpp b/Point_set_processing_3/examples/Point_set_processing_3/registration_with_OpenGR.cpp index 7c159b895b5..453ab216e21 100644 --- a/Point_set_processing_3/examples/Point_set_processing_3/registration_with_OpenGR.cpp +++ b/Point_set_processing_3/examples/Point_set_processing_3/registration_with_OpenGR.cpp @@ -27,7 +27,7 @@ int main(int argc, const char** argv) std::vector pwns1, pwns2; std::ifstream input(fname1); if (!input || - !CGAL::read_PLY_points(input, std::back_inserter(pwns1), + !CGAL::read_PLY(input, std::back_inserter(pwns1), CGAL::parameters::point_map (CGAL::First_of_pair_property_map()). normal_map (Normal_map()))) { @@ -38,7 +38,7 @@ int main(int argc, const char** argv) input.open(fname2); if (!input || - !CGAL::read_PLY_points(input, std::back_inserter(pwns2), + !CGAL::read_PLY(input, std::back_inserter(pwns2), CGAL::parameters::point_map (Point_map()). normal_map (Normal_map()))) { diff --git a/Point_set_processing_3/examples/Point_set_processing_3/registration_with_opengr_pointmatcher_pipeline.cpp b/Point_set_processing_3/examples/Point_set_processing_3/registration_with_opengr_pointmatcher_pipeline.cpp index 5a9b1401115..173a9b601d3 100644 --- a/Point_set_processing_3/examples/Point_set_processing_3/registration_with_opengr_pointmatcher_pipeline.cpp +++ b/Point_set_processing_3/examples/Point_set_processing_3/registration_with_opengr_pointmatcher_pipeline.cpp @@ -30,7 +30,7 @@ int main(int argc, const char** argv) std::vector pwns1, pwns2; std::ifstream input(fname1); if (!input || - !CGAL::read_PLY_points(input, std::back_inserter(pwns1), + !CGAL::read_PLY(input, std::back_inserter(pwns1), CGAL::parameters::point_map (CGAL::First_of_pair_property_map()). normal_map (Normal_map()))) { @@ -41,7 +41,7 @@ int main(int argc, const char** argv) input.open(fname2); if (!input || - !CGAL::read_PLY_points(input, std::back_inserter(pwns2), + !CGAL::read_PLY(input, std::back_inserter(pwns2), CGAL::parameters::point_map (Point_map()). normal_map (Normal_map()))) { diff --git a/Point_set_processing_3/include/CGAL/IO/read_off_points.h b/Point_set_processing_3/include/CGAL/IO/read_off_points.h index fe9231403eb..ccf1e047f11 100644 --- a/Point_set_processing_3/include/CGAL/IO/read_off_points.h +++ b/Point_set_processing_3/include/CGAL/IO/read_off_points.h @@ -545,7 +545,6 @@ read_off_points( } #else - typename CGAL_BGL_NP_TEMPLATE_PARAMETERS template diff --git a/Point_set_processing_3/test/Point_set_processing_3/edge_aware_upsample_test.cpp b/Point_set_processing_3/test/Point_set_processing_3/edge_aware_upsample_test.cpp index ba3cb19c2f1..3a9f2d26eb2 100644 --- a/Point_set_processing_3/test/Point_set_processing_3/edge_aware_upsample_test.cpp +++ b/Point_set_processing_3/test/Point_set_processing_3/edge_aware_upsample_test.cpp @@ -123,7 +123,7 @@ int main(int argc, char * argv[]) // If XYZ file format: std::ifstream stream(input_filename.c_str()); if(stream && - CGAL::read_xyz_points + CGAL::read_XYZ (stream, std::back_inserter(points), CGAL::parameters::point_map(CGAL::First_of_pair_property_map()). diff --git a/Point_set_processing_3/test/Point_set_processing_3/normal_estimation_test.cpp b/Point_set_processing_3/test/Point_set_processing_3/normal_estimation_test.cpp index 0bc9be658a3..1fdfb543495 100644 --- a/Point_set_processing_3/test/Point_set_processing_3/normal_estimation_test.cpp +++ b/Point_set_processing_3/test/Point_set_processing_3/normal_estimation_test.cpp @@ -311,7 +311,7 @@ int main(int argc, char * argv[]) { std::ifstream stream(input_filename.c_str()); success = stream && - CGAL::read_off_points(stream, + CGAL::read_OFF(stream, std::back_inserter(points), CGAL::parameters::normal_map (CGAL::make_normal_of_point_with_normal_map(PointList::value_type())) diff --git a/Point_set_processing_3/test/Point_set_processing_3/vcm_all_test.cpp b/Point_set_processing_3/test/Point_set_processing_3/vcm_all_test.cpp index b91df52272d..931f4587bbd 100644 --- a/Point_set_processing_3/test/Point_set_processing_3/vcm_all_test.cpp +++ b/Point_set_processing_3/test/Point_set_processing_3/vcm_all_test.cpp @@ -33,7 +33,7 @@ std::cout << "=== test_fandisk ===\n"; cov.reserve(nb_points); std::ifstream stream("data/fandisk.off"); if (!stream || - !CGAL::read_off_points(stream, + !CGAL::read_OFF(stream, std::back_inserter(points), CGAL::parameters::point_map(pmap))) { diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_LCC.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_LCC.cpp index 07e73285d3d..e942637a616 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_LCC.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_LCC.cpp @@ -2,6 +2,7 @@ #include #include +#include #include @@ -20,8 +21,8 @@ int main(int argc, char* argv[]) std::ifstream input(filename1); LCC mesh1, mesh2; - CGAL::read_OFF(filename1, mesh1); - CGAL::read_OFF(filename2, mesh2); + CGAL::Polygon_mesh_processing::IO::read_polygon_mesh(filename1, mesh1); + CGAL::Polygon_mesh_processing::IO::read_polygon_mesh(filename2, mesh2); std::cout << "Number of vertices before corefinement " << num_vertices(mesh1) << " and " @@ -35,10 +36,10 @@ int main(int argc, char* argv[]) std::ofstream output("mesh1_refined.off"); output.precision(17); - CGAL::write_off(output, mesh1); + CGAL::write_OFF(output, mesh1); output.close(); output.open("mesh2_refined.off"); - CGAL::write_off(output, mesh2); + CGAL::write_OFF(output, mesh2); output.close(); return 0; diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/hole_filling_example_LCC.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/hole_filling_example_LCC.cpp index 063c5e9ed07..842da24ab3e 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/hole_filling_example_LCC.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/hole_filling_example_LCC.cpp @@ -3,6 +3,7 @@ #include #include +#include #include #include @@ -23,7 +24,7 @@ int main(int argc, char* argv[]) { const char* filename = (argc > 1) ? argv[1] : "data/mech-holes-shark.off"; LCC mesh; - CGAL::read_OFF(filename, mesh); + CGAL::Polygon_mesh_processing::IO::read_polygon_mesh(filename, mesh); // Incrementally fill the holes unsigned int nb_holes = 0; @@ -53,10 +54,10 @@ int main(int argc, char* argv[]) std::cout << std::endl; std::cout << nb_holes << " holes have been filled" << std::endl; - + std::ofstream out("filled_LCC.off"); out.precision(17); - CGAL::write_off(out, mesh); + CGAL::write_OFF(out, mesh); return 0; } diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/surface_intersection_sm_poly.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/surface_intersection_sm_poly.cpp index f03e2e97665..b4588b7b4de 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/surface_intersection_sm_poly.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/surface_intersection_sm_poly.cpp @@ -7,6 +7,7 @@ #include #include +#include #include #include @@ -27,13 +28,13 @@ template void run(const char* filename1, const char* filename2, const char* msg) { TriangleMesh mesh1; - if ( !CGAL::read_OFF(filename1, mesh1) ) { + if ( !CGAL::Polygon_mesh_processing::IO::read_polygon_mesh(filename1, mesh1) ) { std::cerr << filename1 << " is not a valid off file.\n"; exit(1); } TriangleMesh mesh2; - if ( !CGAL::read_OFF(filename2, mesh2) ) { + if ( !CGAL::Polygon_mesh_processing::IO::read_polygon_mesh(filename2, mesh2) ) { std::cerr << filename2 << " is not a valid off file.\n"; exit(1); } diff --git a/Polyhedron/demo/Polyhedron/Plugins/IO/GOCAD_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/IO/GOCAD_io_plugin.cpp index 0111d432a75..f026bd14a53 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/IO/GOCAD_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/IO/GOCAD_io_plugin.cpp @@ -49,7 +49,7 @@ bool Polyhedron_demo_gocad_plugin::canLoad(QFileInfo) const { QList Polyhedron_demo_gocad_plugin::load(QFileInfo fileinfo, bool& ok, bool add_to_scene) { - + // Open file std::ifstream in(fileinfo.filePath().toUtf8()); if(!in) { @@ -57,8 +57,8 @@ Polyhedron_demo_gocad_plugin::load(QFileInfo fileinfo, bool& ok, bool add_to_sce ok = false; return QList(); } - - + + CGAL::Timer t; t.start(); // Try to read GOCAD file in a surface_mesh @@ -73,8 +73,8 @@ Polyhedron_demo_gocad_plugin::load(QFileInfo fileinfo, bool& ok, bool add_to_sce } SMesh& P = * const_cast(item->polyhedron()); - std::string name, color; - if(! read_GOCAD(in, name, color, P)) + std::pair name_and_color; + if(! CGAL::read_GOCAD(in, name_and_color, P)) { std::cerr << "Error: Invalid polyhedron" << std::endl; delete item; @@ -84,12 +84,12 @@ Polyhedron_demo_gocad_plugin::load(QFileInfo fileinfo, bool& ok, bool add_to_sce t.stop(); std::cerr << "Reading took " << t.time() << " sec." << std::endl; - if(name.size() == 0){ + if(name_and_color.first.size() == 0){ item->setName(fileinfo.baseName()); } else { - item->setName(name.c_str()); + item->setName(name_and_color.first.c_str()); } - QColor qcolor(color.c_str()); + QColor qcolor(name_and_color.second.c_str()); if(qcolor.isValid()) { item->setColor(qcolor); @@ -114,14 +114,14 @@ save(QFileInfo fileinfo,QList& items) // This plugin supports polyhedrons const Scene_surface_mesh_item* sm_item = qobject_cast(item); - + if(!sm_item) return false; - + std::ofstream out(fileinfo.filePath().toUtf8()); out.precision (std::numeric_limits::digits10 + 2); SMesh* poly = const_cast(sm_item->polyhedron()); - write_GOCAD(out, qPrintable(fileinfo.baseName()), *poly); + CGAL::write_GOCAD(out, qPrintable(fileinfo.baseName()), *poly); items.pop_front(); return true; diff --git a/Stream_support/include/CGAL/IO/PLY.h b/Stream_support/include/CGAL/IO/PLY.h index 6e1c9868b71..63e9d4f4a9e 100644 --- a/Stream_support/include/CGAL/IO/PLY.h +++ b/Stream_support/include/CGAL/IO/PLY.h @@ -222,7 +222,7 @@ bool read_PLY(std::istream& is, { std::vector > dummy_pui; std::vector > dummy_pf; - return IO::internal::read_PLY(is, points, polygons, dummy_pui, std::back_inserter(fcolors), std::back_inserter(vcolors), dummy_pf, verbose); + return IO::internal::read_PLY(is, points, polygons, std::back_inserter(dummy_pui), std::back_inserter(fcolors), std::back_inserter(vcolors), std::back_inserter(dummy_pf), verbose); }