diff --git a/.github/workflows/build_doc.yml b/.github/workflows/build_doc.yml index 53d20c39f0e..e8282405392 100644 --- a/.github/workflows/build_doc.yml +++ b/.github/workflows/build_doc.yml @@ -65,6 +65,7 @@ jobs: mkdir -p build_doc && cd build_doc && cmake ../Documentation/doc - name: Build and Upload Doc + id: build_and_run if: steps.get_round.outputs.result != 'stop' run: | set -ex @@ -77,7 +78,13 @@ jobs: if [ "$LIST_OF_PKGS" = "" ]; then exit 1 fi - cd build_doc && make -j2 doc && make -j2 doc_with_postprocessing + cd build_doc && make -j2 doc + make -j2 doc_with_postprocessing 2>tmp.log + if [ -s tmp.log ]; then + content=`cat ./build_doc/tmp.log` + echo ::set-output name=DoxygenError::$(cat tmp.log) + exit 1 + fi cd .. git clone https://CGAL:${{ secrets.PUSH_TO_CGAL_GITHUB_IO_TOKEN }}@github.com/CGAL/cgal.github.io.git mkdir -p cgal.github.io/${PR_NUMBER}/$ROUND @@ -99,7 +106,7 @@ jobs: - name: Post address uses: actions/github-script@v3 - if: steps.get_round.outputs.result != 'stop' + if: ${{ success() && steps.get_round.outputs.result != 'stop' }} with: script: | const address = "The documentation is built. It will be available, after a few minutes, here : https://cgal.github.io/${{ steps.get_pr_number.outputs.result }}/${{ steps.get_round.outputs.result }}/Manual/index.html" @@ -109,3 +116,17 @@ jobs: issue_number: ${{ github.event.issue.number }}, body: address }); + + - name: Post error + uses: actions/github-script@v3 + if: ${{ failure() && steps.get_round.outputs.result != 'stop' }} + with: + script: | + const error = "${{steps.build_and_run.outputs.DoxygenError}}" + const msg = "There was an error while building the doc: \n"+error + github.issues.createComment({ + owner: "CGAL", + repo: "cgal", + issue_number: ${{ github.event.issue.number }}, + body: msg + }); diff --git a/AABB_tree/examples/AABB_tree/AABB_cached_bbox_example.cpp b/AABB_tree/examples/AABB_tree/AABB_cached_bbox_example.cpp index dc81b53098d..6b2fc21e603 100644 --- a/AABB_tree/examples/AABB_tree/AABB_cached_bbox_example.cpp +++ b/AABB_tree/examples/AABB_tree/AABB_cached_bbox_example.cpp @@ -27,7 +27,7 @@ void triangle_mesh(const char* fname) typedef CGAL::AABB_tree Tree; TriangleMesh tmesh; - if(!CGAL::read_polygon_mesh(fname, tmesh) || CGAL::is_triangle_mesh(tmesh)) + if(!CGAL::IO::read_polygon_mesh(fname, tmesh) || CGAL::is_triangle_mesh(tmesh)) { std::cerr << "Invalid input." << std::endl; return; diff --git a/AABB_tree/examples/AABB_tree/AABB_ray_shooting_example.cpp b/AABB_tree/examples/AABB_tree/AABB_ray_shooting_example.cpp index 2a8bfbec29b..f1d983eccf1 100644 --- a/AABB_tree/examples/AABB_tree/AABB_ray_shooting_example.cpp +++ b/AABB_tree/examples/AABB_tree/AABB_ray_shooting_example.cpp @@ -47,7 +47,7 @@ int main(int argc, char* argv[]) const char* filename = (argc > 1) ? argv[1] : "data/tetrahedron.off"; Mesh mesh; - if(!CGAL::read_polygon_mesh(filename, mesh)) + if(!CGAL::IO::read_polygon_mesh(filename, mesh)) { std::cerr << "Invalid input." << std::endl; return 1; 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 c0aedf6974b..8dda55c4597 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 @@ -114,9 +114,9 @@ int main (int argc, char* argv[]) const char* fname = (argc>1) ? argv[1] : "data/cube.pwn"; // Loading point set from a file. - if (!CGAL::read_points(fname, std::back_inserter(points), - CGAL::parameters::point_map(Point_map()). - normal_map(Normal_map()))) + if (!CGAL::IO::read_points(fname, std::back_inserter(points), + CGAL::parameters::point_map(Point_map()). + normal_map(Normal_map()))) { std::cerr << "Error: cannot read file" << std::endl; return EXIT_FAILURE; diff --git a/Algebraic_foundations/examples/Algebraic_foundations/fraction_traits.cpp b/Algebraic_foundations/examples/Algebraic_foundations/fraction_traits.cpp index 0cf448daab4..3d85eed1e86 100644 --- a/Algebraic_foundations/examples/Algebraic_foundations/fraction_traits.cpp +++ b/Algebraic_foundations/examples/Algebraic_foundations/fraction_traits.cpp @@ -17,7 +17,7 @@ int main(){ CGAL::Gmpq fraction(4,5); FT::Decompose()(fraction,numerator,denominator); - CGAL::set_pretty_mode(std::cout); + CGAL::IO::set_pretty_mode(std::cout); std::cout << "decompose fraction: "<< std::endl; std::cout << "fraction : " << fraction << std::endl; std::cout << "numerator : " << numerator<< std::endl; diff --git a/Algebraic_foundations/examples/Algebraic_foundations/implicit_interoperable_dispatch.cpp b/Algebraic_foundations/examples/Algebraic_foundations/implicit_interoperable_dispatch.cpp index a781e8fc700..0393f435966 100644 --- a/Algebraic_foundations/examples/Algebraic_foundations/implicit_interoperable_dispatch.cpp +++ b/Algebraic_foundations/examples/Algebraic_foundations/implicit_interoperable_dispatch.cpp @@ -31,7 +31,7 @@ binary_func(const A& a , const B& b){ } int main(){ - CGAL::set_pretty_mode(std::cout); + CGAL::IO::set_pretty_mode(std::cout); // Function call for ImplicitInteroperable types std::cout<< binary_func(double(3), int(5)) << std::endl; diff --git a/Algebraic_foundations/include/CGAL/Needs_parens_as_product.h b/Algebraic_foundations/include/CGAL/Needs_parens_as_product.h index a55040176d1..1aa82b277e3 100644 --- a/Algebraic_foundations/include/CGAL/Needs_parens_as_product.h +++ b/Algebraic_foundations/include/CGAL/Needs_parens_as_product.h @@ -56,9 +56,9 @@ public: Output_rep(const T& tt) : t(tt) {} std::ostream& operator () (std::ostream& out) const { if ( needs_parens_as_product(t)) { - return out << "(" << oformat(t) << ")"; + return out << "(" << IO::oformat(t) << ")"; } else { - return out << oformat(t); + return out << IO::oformat(t); } } }; diff --git a/Algebraic_foundations/include/CGAL/number_utils.h b/Algebraic_foundations/include/CGAL/number_utils.h index 03e2e757477..5fc8c6e4570 100644 --- a/Algebraic_foundations/include/CGAL/number_utils.h +++ b/Algebraic_foundations/include/CGAL/number_utils.h @@ -303,19 +303,21 @@ to_interval( const Real_embeddable& x) { } template -NT approximate_sqrt(const NT& nt, CGAL::Null_functor) +typename Coercion_traits::Type +approximate_sqrt(const NT& x, CGAL::Null_functor) { - return NT(sqrt(CGAL::to_double(nt))); + return sqrt(CGAL::to_double(x)); } template -NT approximate_sqrt(const NT& nt, Sqrt sqrt) +typename Sqrt::result_type +approximate_sqrt(const NT& nt, Sqrt sqrt) { return sqrt(nt); } template -NT approximate_sqrt(const NT& nt) +decltype(auto) approximate_sqrt(const NT& nt) { // the initial version of this function was using Algebraic_category // for the dispatch but some ring type (like Gmpz) provides a Sqrt diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_curve_kernel_2.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_curve_kernel_2.h index cb3f4e68239..b02303fa6af 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_curve_kernel_2.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_curve_kernel_2.h @@ -49,7 +49,7 @@ #include -#include +#include namespace CGAL { @@ -393,8 +393,8 @@ public: Algebraic_curve_kernel_2() : _m_gcd_cache_2(new Gcd_cache_2()) { - _m_curve_cache_2 = boost::shared_ptr(new Curve_cache_2(this)); - _m_curve_pair_cache_2 = boost::shared_ptr (new Curve_pair_cache_2(this)); + _m_curve_cache_2 = std::shared_ptr(new Curve_cache_2(this)); + _m_curve_pair_cache_2 = std::shared_ptr (new Curve_pair_cache_2(this)); // std::cout << "CONSTRUCTION Algebraic_curve_kernel_2 " << std::endl; } @@ -2766,9 +2766,9 @@ public: protected: -mutable boost::shared_ptr _m_curve_cache_2; -mutable boost::shared_ptr _m_curve_pair_cache_2; -mutable boost::shared_ptr _m_gcd_cache_2; +mutable std::shared_ptr _m_curve_cache_2; +mutable std::shared_ptr _m_curve_pair_cache_2; +mutable std::shared_ptr _m_gcd_cache_2; }; // class Algebraic_curve_kernel_2 diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h index 11900ce8bfa..7d2ed6298e2 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h @@ -436,8 +436,8 @@ std::ostream& operator << (std::ostream& os, const CGAL::internal::Algebraic_real_d_1& x){ os << "[" << x.polynomial() - << ",[" << oformat(x.low()) - << " , " << oformat(x.high()) << " ]]"; + << ",[" << IO::oformat(x.low()) + << " , " << IO::oformat(x.high()) << " ]]"; return os; } @@ -458,9 +458,9 @@ operator >> (std::istream& is, is >> poly; swallow(is, ',');// read the "," swallow(is, '[');// read the "," - is >> iformat(low); + is >> IO::iformat(low); swallow(is, ',');// read the "," - is >> iformat(high); + is >> IO::iformat(high); swallow(is, ']');// read the "]" swallow(is, ']');// read the "]" x = ALGNUM(poly, low, high); diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_analysis_2.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_analysis_2.h index 34290afa7e2..339fe371068 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_analysis_2.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_analysis_2.h @@ -2417,7 +2417,7 @@ std::ostream& operator<< ( typedef typename Curve::Asymptote_y Asymptote_y; - switch (::CGAL::get_mode(out)) { + switch (::CGAL::IO::get_mode(out)) { case ::CGAL::IO::PRETTY: { out << "--------------- Analysis results ---------------" << std::endl; @@ -2514,7 +2514,7 @@ std::istream& operator>> ( std::istream& is, Curve_analysis_2< AlgebraicKernelWithAnalysis_2, Rep_ >& curve) { - CGAL_precondition(CGAL::is_ascii(is)); + CGAL_precondition(CGAL::IO::is_ascii(is)); typedef AlgebraicKernelWithAnalysis_2 Algebraic_kernel_with_analysis_2; diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Event_line_builder.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Event_line_builder.h index 75ca4b777f1..978fb2a5e88 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Event_line_builder.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Event_line_builder.h @@ -441,7 +441,7 @@ protected: } /* #if CGAL_ACK_DEBUG_FLAG - ::CGAL::set_ascii_mode(CGAL_ACK_DEBUG_PRINT); + ::CGAL::IO::set_ascii_mode(CGAL_ACK_DEBUG_PRINT); CGAL_ACK_DEBUG_PRINT << "Stha: " << (*seq_it) << std::endl; #endif */ diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Xy_coordinate_2.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Xy_coordinate_2.h index 5172dcf80e6..7167c9f8a12 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Xy_coordinate_2.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Xy_coordinate_2.h @@ -675,7 +675,7 @@ template < class AlgebraicCurveKernel_2, class Rep> std::ostream& operator<< (std::ostream& os, const Xy_coordinate_2& pt) { - switch (::CGAL::get_mode(os)) { + switch (::CGAL::IO::get_mode(os)) { case ::CGAL::IO::PRETTY: { os << "[x-coord: " << CGAL::to_double(pt.x()) << "; curve: " << pt.curve().polynomial_2() << @@ -703,7 +703,7 @@ std::istream& operator >> ( std::istream& is, Xy_coordinate_2< AlgebraicCurveKernel_2, Rep_>& pt) { - CGAL_precondition(CGAL::is_ascii(is)); + CGAL_precondition(CGAL::IO::is_ascii(is)); // this instance's first template argument typedef AlgebraicCurveKernel_2 Algebraic_curve_kernel_2; diff --git a/Algebraic_kernel_d/test/Algebraic_kernel_d/Curve_analysis_2.cpp b/Algebraic_kernel_d/test/Algebraic_kernel_d/Curve_analysis_2.cpp index 0f1667d105e..2f55d2cd933 100644 --- a/Algebraic_kernel_d/test/Algebraic_kernel_d/Curve_analysis_2.cpp +++ b/Algebraic_kernel_d/test/Algebraic_kernel_d/Curve_analysis_2.cpp @@ -162,7 +162,7 @@ template void test_routine() { CGAL_ACK_DEBUG_PRINT << "P[3(0,P[2(0,-2)(2,2)])(1,P[1(1,-1)])(3,P[1(1,-6)])]" << std::endl; #endif f=from_string("P[3(0,P[2(0,-2)(2,2)])(1,P[1(1,-1)])(3,P[1(1,-6)])]"); - ::CGAL::set_pretty_mode(std::cout); + ::CGAL::IO::set_pretty_mode(std::cout); curve=construct_curve_2(f); assert(curve.number_of_status_lines_with_event()==1); assert(number_of_objects(curve)==2); diff --git a/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_algebraic_curve_kernel_2.h b/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_algebraic_curve_kernel_2.h index d9fb58b9663..dca16083212 100644 --- a/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_algebraic_curve_kernel_2.h +++ b/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_algebraic_curve_kernel_2.h @@ -92,7 +92,7 @@ void test_algebraic_curve_kernel_2() { Poly_2 polys[ACK_2_n_polys]; - ::CGAL::set_mode(std::cerr, ::CGAL::IO::PRETTY); + ::CGAL::IO::set_mode(std::cerr, ::CGAL::IO::PRETTY); //std::cerr << "constructing curves..\n"; for(int i = 0; i < ACK_2_n_polys; i++) { diff --git a/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_algebraic_kernel_1.h b/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_algebraic_kernel_1.h index d087b945a6b..ac9ea88f5e5 100644 --- a/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_algebraic_kernel_1.h +++ b/Algebraic_kernel_d/test/Algebraic_kernel_d/include/CGAL/_test_algebraic_kernel_1.h @@ -291,7 +291,7 @@ void test_algebraic_kernel_1(const AlgebraicKernel_d_1& ak_1){ assert(compare_1(bound,Algebraic_real_1(2)) == SMALLER ); } - CGAL::set_pretty_mode(std::cerr); + CGAL::IO::set_pretty_mode(std::cerr); // Approximations bool all_right = true; @@ -408,13 +408,13 @@ void test_algebraic_kernel_1(const AlgebraicKernel_d_1& ak_1){ #define CGAL_TEST_ALGEBRAIC_REAL_IO(_f) \ alg1=_f; \ - ss<>CGAL::iformat(alg2); \ - CGAL_assertion(!ss.fail()); \ + ss>>CGAL::IO::iformat(alg2); \ + CGAL_assertion(!ss.fail()); \ ss.clear(); \ assert(alg1==alg2) - // Note: after the reading ss>>CGAL::iformat(alg2) the state of ss can + // Note: after the reading ss>>CGAL::IO::iformat(alg2) the state of ss can // have the eofbit. The C++ norm says if one tries to write to a stream // with eofbit, then the failbit will be set. That is why one must // clear the iostate with ss.clear(). @@ -422,7 +422,7 @@ void test_algebraic_kernel_1(const AlgebraicKernel_d_1& ak_1){ Algebraic_real_1 alg1,alg2; std::stringstream ss; - CGAL::set_ascii_mode(ss); + CGAL::IO::set_ascii_mode(ss); // test construction from int, Coefficient and Bound CGAL_TEST_ALGEBRAIC_REAL_IO(construct_algebraic_real_1(int(2))); diff --git a/Alpha_shapes_3/include/CGAL/internal/Lazy_alpha_nt_3.h b/Alpha_shapes_3/include/CGAL/internal/Lazy_alpha_nt_3.h index c4384e9ccff..536939db210 100644 --- a/Alpha_shapes_3/include/CGAL/internal/Lazy_alpha_nt_3.h +++ b/Alpha_shapes_3/include/CGAL/internal/Lazy_alpha_nt_3.h @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include diff --git a/Alpha_shapes_3/test/Alpha_shapes_3/include/CGAL/_test_cls_alpha_shape_3.h b/Alpha_shapes_3/test/Alpha_shapes_3/include/CGAL/_test_cls_alpha_shape_3.h index dc01d1e9392..d71e8aef398 100644 --- a/Alpha_shapes_3/test/Alpha_shapes_3/include/CGAL/_test_cls_alpha_shape_3.h +++ b/Alpha_shapes_3/test/Alpha_shapes_3/include/CGAL/_test_cls_alpha_shape_3.h @@ -23,7 +23,7 @@ template bool file_input(std::ifstream& is, std::list& L, int nb=0) { - CGAL::set_ascii_mode(is); + CGAL::IO::set_ascii_mode(is); int n; is >> n; if (nb != 0 && nb <= n) n=nb; diff --git a/Alpha_shapes_3/test/Alpha_shapes_3/include/CGAL/_test_weighted_alpha_shape_3.h b/Alpha_shapes_3/test/Alpha_shapes_3/include/CGAL/_test_weighted_alpha_shape_3.h index c8a099743c5..51d677c3774 100644 --- a/Alpha_shapes_3/test/Alpha_shapes_3/include/CGAL/_test_weighted_alpha_shape_3.h +++ b/Alpha_shapes_3/test/Alpha_shapes_3/include/CGAL/_test_weighted_alpha_shape_3.h @@ -22,7 +22,7 @@ template bool file_input(std::ifstream& is, std::list& L) { - CGAL::set_ascii_mode(is); + CGAL::IO::set_ascii_mode(is); int n; is >> n; std::cout << "Reading " << n << " points" << std::endl; diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_2_impl.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_2_impl.h index cad9b199647..e5988f9f77b 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_2_impl.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_2_impl.h @@ -1966,7 +1966,7 @@ Apollonius_graph_2::file_output(std::ostream& os) const CGAL_assertion( n >= 1 ); - if( is_ascii(os) ) { + if( IO::is_ascii(os) ) { os << n << ' ' << m << ' ' << dimension() << std::endl; } else { os << n << m << dimension(); @@ -1980,24 +1980,24 @@ Apollonius_graph_2::file_output(std::ostream& os) const V[infinite_vertex()] = inum++; // finite vertices - if (is_ascii(os)) os << std::endl; + if (IO::is_ascii(os)) os << std::endl; for (Finite_vertices_iterator vit = finite_vertices_begin(); vit != finite_vertices_end(); ++vit) { V[vit] = inum++; os << vit->site(); - if ( is_ascii(os) ) { os << ' '; } + if ( IO::is_ascii(os) ) { os << ' '; } os << vit->number_of_hidden_sites(); typename Vertex::Hidden_sites_iterator hit; for (hit = vit->hidden_sites_begin(); hit != vit->hidden_sites_end(); ++hit) { - if ( is_ascii(os) ) { os << ' '; } + if ( IO::is_ascii(os) ) { os << ' '; } os << *hit; } // write non-combinatorial info of the vertex // os << *vit ; - if ( is_ascii(os) ) { os << std::endl; } + if ( IO::is_ascii(os) ) { os << std::endl; } } - if ( is_ascii(os) ) { os << std::endl; } + if ( IO::is_ascii(os) ) { os << std::endl; } // vertices of the faces inum = 0; @@ -2007,25 +2007,25 @@ Apollonius_graph_2::file_output(std::ostream& os) const F[fit] = inum++; for(int j = 0; j < dim ; ++j) { os << V[ fit->vertex(j) ]; - if( is_ascii(os) ) { os << ' '; } + if( IO::is_ascii(os) ) { os << ' '; } } // write non-combinatorial info of the face // os << *fit ; - if( is_ascii(os) ) { os << std::endl; } + if( IO::is_ascii(os) ) { os << std::endl; } } - if( is_ascii(os) ) { os << std::endl; } + if( IO::is_ascii(os) ) { os << std::endl; } // neighbor pointers of the faces for( All_faces_iterator it = all_faces_begin(); it != all_faces_end(); ++it) { for(int j = 0; j < dimension()+1; ++j){ os << F[ it->neighbor(j) ]; - if( is_ascii(os) ) { os << ' '; } + if( IO::is_ascii(os) ) { os << ' '; } } - if( is_ascii(os) ) { os << std::endl; } + if( IO::is_ascii(os) ) { os << std::endl; } } - if ( is_ascii(os) ) { os << std::endl; } + if ( IO::is_ascii(os) ) { os << std::endl; } } diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_hierarchy_2_impl.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_hierarchy_2_impl.h index 2b9e0acf72c..ba13844eb0e 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_hierarchy_2_impl.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_hierarchy_2_impl.h @@ -484,7 +484,7 @@ file_output(std::ostream& os) const // write each level of the hierarchy for (unsigned int i = 0; i < ag_hierarchy_2__maxlevel; ++i) { hierarchy[i]->file_output(os); - if ( is_ascii(os) ) { os << std::endl << std::endl; } + if ( IO::is_ascii(os) ) { os << std::endl << std::endl; } } Vertex_map* V = new Vertex_map[ag_hierarchy_2__maxlevel]; @@ -520,22 +520,22 @@ file_output(std::ostream& os) const } // write up and down pointer info - if ( is_ascii(os) ) { os << std::endl << std::endl; } + if ( IO::is_ascii(os) ) { os << std::endl << std::endl; } for (unsigned int i = 0; i < ag_hierarchy_2__maxlevel; ++i) { os << i; - if ( is_ascii(os) ) { os << " "; } + if ( IO::is_ascii(os) ) { os << " "; } os << hierarchy[i]->number_of_vertices(); - if ( is_ascii(os) ) { os << std::endl; } + if ( IO::is_ascii(os) ) { os << std::endl; } for (Finite_vertices_iterator vit = hierarchy[i]->finite_vertices_begin(); vit != hierarchy[i]->finite_vertices_end(); ++vit) { os << V[i][vit]; - if ( is_ascii(os) ) { os << " "; } + if ( IO::is_ascii(os) ) { os << " "; } os << V_down[i][vit]; - if ( is_ascii(os) ) { os << " "; } + if ( IO::is_ascii(os) ) { os << " "; } os << V_up[i][vit]; - if ( is_ascii(os) ) { os << std::endl; } + if ( IO::is_ascii(os) ) { os << std::endl; } } - if ( is_ascii(os) ) { os << std::endl << std::endl; } + if ( IO::is_ascii(os) ) { os << std::endl << std::endl; } } delete[] V; diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/comparator_profiler.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/comparator_profiler.h index 3e3283e55b4..4395c25a54b 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/comparator_profiler.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/comparator_profiler.h @@ -19,7 +19,7 @@ #include -#include +#include namespace CGAL { @@ -33,8 +33,8 @@ public: typedef bool bool_; typedef unsigned long long_; #else - typedef CGAL::cpp11::atomic bool_; - typedef CGAL::cpp11::atomic long_; + typedef std::atomic bool_; + typedef std::atomic long_; #endif static bool_ count_cases; diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/predicate_profiler.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/predicate_profiler.h index d543e6a92a1..cf78798b185 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/predicate_profiler.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/predicate_profiler.h @@ -19,7 +19,7 @@ #include -#include +#include #define AG2_PROFILE_PREDICATES @@ -33,7 +33,7 @@ public: #ifdef CGAL_NO_ATOMIC typedef unsigned long long_; #else - typedef CGAL::cpp11::atomic long_; + typedef std::atomic long_; #endif // high level predicates diff --git a/Arrangement_on_surface_2/archive/demo/Arr_algebraic_segment_traits_2/xalci/include/misc.h b/Arrangement_on_surface_2/archive/demo/Arr_algebraic_segment_traits_2/xalci/include/misc.h index 101637c9cba..d24cb75dfcd 100644 --- a/Arrangement_on_surface_2/archive/demo/Arr_algebraic_segment_traits_2/xalci/include/misc.h +++ b/Arrangement_on_surface_2/archive/demo/Arr_algebraic_segment_traits_2/xalci/include/misc.h @@ -56,7 +56,7 @@ public: int i = 0; for(InputIterator it = begin;it != end; it++, i++) { std::stringstream curr_item; - ::CGAL::set_pretty_mode(curr_item); + ::CGAL::IO::set_pretty_mode(curr_item); curr_item << i << "th: "; curr_item << (*it); curve_list->insertItem(curr_item.str()); diff --git a/Arrangement_on_surface_2/archive/demo/Arr_algebraic_segment_traits_2/xalci/misc.cpp b/Arrangement_on_surface_2/archive/demo/Arr_algebraic_segment_traits_2/xalci/misc.cpp index 2ba998c0c0f..ce1e65f4b03 100644 --- a/Arrangement_on_surface_2/archive/demo/Arr_algebraic_segment_traits_2/xalci/misc.cpp +++ b/Arrangement_on_surface_2/archive/demo/Arr_algebraic_segment_traits_2/xalci/misc.cpp @@ -237,7 +237,7 @@ void xAlci_main_window::oc_rasterize_click() oc_activate_layers(); } else { // CGAL::set_error_behaviour(CGAL::THROW_EXCEPTION); - ::CGAL::set_pretty_mode(std::cout); + ::CGAL::IO::set_pretty_mode(std::cout); Poly_int2 f; if(!input_poly(f, oc_input->text().ascii())) diff --git a/Arrangement_on_surface_2/archive/demo/Arr_algebraic_segment_traits_2/xalci/xalci.cpp b/Arrangement_on_surface_2/archive/demo/Arr_algebraic_segment_traits_2/xalci/xalci.cpp index 3aa7f377f4b..9d0bd268bde 100644 --- a/Arrangement_on_surface_2/archive/demo/Arr_algebraic_segment_traits_2/xalci/xalci.cpp +++ b/Arrangement_on_surface_2/archive/demo/Arr_algebraic_segment_traits_2/xalci/xalci.cpp @@ -194,16 +194,16 @@ void xAlci_main_window::oc_analyse_click() Poly_int2 ress = fxx*fy*fy - ((fx*fy*fxy)*Poly_int1(2,0)) + fyy*fx*fx, res1 = f*fx, res2 = f*fy; - CGAL::set_pretty_mode(std::cout); + CGAL::IO::set_pretty_mode(std::cout); std::cout << "curv:\n " << ress << "\n\n"; std::cout << "fx:\n " << fx << "\n\n"; std::cout << "fy:\n " << fy << "\n\n"; std::cout << "f*fx:\n " << res1 << "\n\n"; std::cout << "f*fy:\n " << res2 << "\n\n"; - CGAL::set_ascii_mode(std::cout); + CGAL::IO::set_ascii_mode(std::cout); std::cout << "f:\n " << f << "\n\n"; - CGAL::set_pretty_mode(std::cout); + CGAL::IO::set_pretty_mode(std::cout); std::cout << "f:\n " << f << "\n\n"; timer.reset(); diff --git a/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/arr_bench.cpp b/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/arr_bench.cpp index 391544b48e3..ed93820690c 100644 --- a/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/arr_bench.cpp +++ b/Arrangement_on_surface_2/benchmark/Arrangement_on_surface_2/arr_bench.cpp @@ -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::IO::blue(); for (ei = arr.edges_begin(); ei != arr.edges_end(); ++ei) ws << (*ei).curve(); Arr::Vertex_iterator vi; - ws << CGAL::red(); + ws << CGAL::IO::red(); for (vi = arr.vertices_begin(); vi != arr.vertices_end(); ++vi) ws << (*vi).point(); return ws; diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementIO.cpp b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementIO.cpp index 8e1f6bbc972..5a9be364d6f 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementIO.cpp +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementIO.cpp @@ -31,7 +31,7 @@ struct ArrReader ArrFormatter arrFormatter; auto arr = new Arrangement(); - CGAL::read(*arr, ifs, arrFormatter); + CGAL::IO::read(*arr, ifs, arrFormatter); return arr; } }; @@ -106,7 +106,7 @@ struct ArrWriter using ArrFormatter = CGAL::Arr_with_history_text_formatter; ArrFormatter arrFormatter; - CGAL::write(*arr, ofs, arrFormatter); + CGAL::IO::write(*arr, ofs, arrFormatter); } }; diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_iostream.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_iostream.h index bcdfd59968d..4b18dcd6656 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_iostream.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_iostream.h @@ -1,6 +1,9 @@ namespace CGAL { + +namespace IO { + /*! - \defgroup PkgArrangementOnSurface2Read CGAL::read() + \defgroup PkgArrangementOnSurface2Read CGAL::IO::read() \ingroup PkgArrangementOnSurface2IO Reads a given arrangement from a given input stream @@ -37,7 +40,7 @@ std::istream& read (Arrangement_2& arr, /// @} /*! - \defgroup PkgArrangementOnSurface2Write CGAL::write() + \defgroup PkgArrangementOnSurface2Write CGAL::IO::write() \ingroup PkgArrangementOnSurface2IO Writes a given arrangement into a given output stream @@ -69,6 +72,8 @@ std::ostream& write (const Arrangement_2& arr, /// @} +} // namespace IO + /*! \ingroup PkgArrangementOnSurface2op_left_shift Inserts the arrangement object `arr` into the output stream @@ -93,4 +98,4 @@ template std::istream& operator>>(std::istream& is, Arrangement_2& arr); -} /* end namespace CGAL*/ +} /* end namespace CGAL::IO*/ diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_with_history_iostream.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_with_history_iostream.h index 47caa509bcc..084ec73f6bd 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_with_history_iostream.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/CGAL/IO/Arr_with_history_iostream.h @@ -1,5 +1,7 @@ namespace CGAL { +namespace IO { + /*! \ingroup PkgArrangementOnSurface2Read @@ -26,6 +28,8 @@ std::ostream& write (const Arrangement_with_history_2& arr, std::ostream& os, WithHistoryFormatter& formatter); +} // namespace IO + /*! \ingroup PkgArrangementOnSurface2op_left_shift Inserts the arrangement-with-history object `arr` into the output diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/PackageDescription.txt b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/PackageDescription.txt index 9696042adb3..19eda40a9ca 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/PackageDescription.txt +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/PackageDescription.txt @@ -203,8 +203,8 @@ implemented as peripheral classes or as free (global) functions. - `CGAL::locate()` - `CGAL::decompose()` - `CGAL::overlay()` -- `CGAL::read()` -- `CGAL::write()` +- `CGAL::IO::read()` +- `CGAL::IO::write()` - `CGAL::remove_curve()` - \link PkgArrangementOnSurface2op_left_shift `CGAL::operator<<` \endlink - \link PkgArrangementOnSurface2op_right_shift `CGAL::operator<<` \endlink diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/algebraic_curves.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/algebraic_curves.cpp index d6680e4e8c1..a7896581e3f 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/algebraic_curves.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/algebraic_curves.cpp @@ -32,7 +32,7 @@ typedef Arr_traits_2::Polynomial_2 Polynomial_2; int main() { // For nice printouts - CGAL::set_pretty_mode(std::cout); + CGAL::IO::set_pretty_mode(std::cout); Arr_traits_2 arr_traits; diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dcel_extension_io.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dcel_extension_io.cpp index fc89f889611..130d6f62573 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dcel_extension_io.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dcel_extension_io.cpp @@ -119,14 +119,14 @@ int main () std::ofstream out_file ("arr_ex_dcel_io.dat"); Formatter formatter; - write (arr, out_file, formatter); + CGAL::IO::write (arr, out_file, formatter); out_file.close(); // Read the arrangement from the file. Arrangement_2 arr2; std::ifstream in_file ("arr_ex_dcel_io.dat"); - read (arr2, in_file, formatter); + CGAL::IO::read (arr2, in_file, formatter); in_file.close(); std::cout << "The arrangement vertices: " << std::endl; diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/rational_functions.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/rational_functions.cpp index 8b1e47def30..eaef4cd9829 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/rational_functions.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/rational_functions.cpp @@ -29,7 +29,7 @@ typedef CGAL::Arrangement_2 Arrangement_2; int main () { - CGAL::set_pretty_mode(std::cout); // for nice printouts. + CGAL::IO::set_pretty_mode(std::cout); // for nice printouts. // create a polynomial representing x .-) Polynomial_1 x = CGAL::shift(Polynomial_1(1),1); diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/rational_functions_rational_coefficients.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/rational_functions_rational_coefficients.cpp index 3b9f7e391c2..f45fb97c76f 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/rational_functions_rational_coefficients.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/rational_functions_rational_coefficients.cpp @@ -31,7 +31,7 @@ typedef CGAL::Arrangement_2 Arrangement_2; int main () { - CGAL::set_pretty_mode(std::cout); // for nice printouts. + CGAL::IO::set_pretty_mode(std::cout); // for nice printouts. // Traits class object Traits_2 traits; diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unbounded_rational_functions.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unbounded_rational_functions.cpp index 1f30067dd0d..c5cc697f99d 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unbounded_rational_functions.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unbounded_rational_functions.cpp @@ -29,7 +29,7 @@ typedef CGAL::Arrangement_2 Arrangement_2; int main () { - CGAL::set_pretty_mode(std::cout); // for nice printouts. + CGAL::IO::set_pretty_mode(std::cout); // for nice printouts. // Traits class object AK1 ak1; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_circle_segment_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_circle_segment_traits_2.h index 8364ffc5cd3..746ef587cac 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_circle_segment_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_circle_segment_traits_2.h @@ -23,12 +23,12 @@ * The header file for the Arr_circle_segment_traits_2 class. */ -#include #include #include #include #include +#include namespace CGAL { @@ -80,7 +80,7 @@ public: #ifdef CGAL_NO_ATOMIC static unsigned int index; #else - static CGAL::cpp11::atomic index; + static std::atomic index; #endif return (++index); } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_conic_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_conic_traits_2.h index 45c3a903ea7..4b4fea69c74 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_conic_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_conic_traits_2.h @@ -23,8 +23,8 @@ */ #include +#include -#include #include #include #include @@ -108,7 +108,7 @@ public: #ifdef CGAL_NO_ATOMIC static unsigned int index; #else - static CGAL::cpp11::atomic index; + static std::atomic index; #endif return (++index); } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_counting_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_counting_traits_2.h index 8f07fc7be36..0ae04106cc7 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_counting_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_counting_traits_2.h @@ -26,9 +26,9 @@ #include #include +#include #include -#include #include #include @@ -958,7 +958,7 @@ public: #ifdef CGAL_NO_ATOMIC static size_t counter; #else - static CGAL::cpp11::atomic counter; + static std::atomic counter; #endif if (doit) ++counter; return counter; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_enums.h b/Arrangement_on_surface_2/include/CGAL/Arr_enums.h index 9c52c3b5800..a3425cd2fc6 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_enums.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_enums.h @@ -155,7 +155,7 @@ OutputStream& operator<<( OutputStream& os, const Arr_parameter_space& ps) { - switch (::CGAL::get_mode(os)) { + switch (::CGAL::IO::get_mode(os)) { case ::CGAL::IO::PRETTY: switch(ps) { case CGAL::ARR_LEFT_BOUNDARY: @@ -195,7 +195,7 @@ InputStream& operator>>( InputStream& is, Arr_parameter_space& ps) { - CGAL_precondition(CGAL::is_ascii(is)); + CGAL_precondition(CGAL::IO::is_ascii(is)); int i; is >> i; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_X_trapezoid.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_X_trapezoid.h index e7202ffe935..eb64e3ce7e0 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_X_trapezoid.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_X_trapezoid.h @@ -23,7 +23,7 @@ #include #include -#include +#include #ifdef CGAL_TD_DEBUG @@ -95,7 +95,7 @@ public: typedef Td_ninetuple, boost::variant, boost::variant >, + std::shared_ptr >, Halfedge_const_handle, unsigned char, Self*, Self*, @@ -230,7 +230,7 @@ public: if (type() == TD_EDGE) { - //ptr()->e2 = (boost::shared_ptr)(new X_monotone_curve_2(top()->curve())); + //ptr()->e2 = (std::shared_ptr)(new X_monotone_curve_2(top()->curve())); set_curve_for_rem_he(top()->curve()); return; } @@ -238,8 +238,8 @@ public: //else if (type() == TD_VERTEX) Curve_end v_ce(left()->curve_end()); - ptr()->e2 = (boost::shared_ptr)(new X_monotone_curve_2(v_ce.cv())); - //CGAL_assertion(boost::get>( &(ptr()->e2)) != nullptr); + ptr()->e2 = (std::shared_ptr)(new X_monotone_curve_2(v_ce.cv())); + //CGAL_assertion(boost::get>( &(ptr()->e2)) != nullptr); ptr()->e1 = (v_ce.ce() == ARR_MIN_END ) ? CGAL_TD_CV_MIN_END : CGAL_TD_CV_MAX_END; @@ -255,7 +255,7 @@ public: { CGAL_precondition (type() == TD_EDGE); - ptr()->e2 = (boost::shared_ptr)(new X_monotone_curve_2(cv)); + ptr()->e2 = (std::shared_ptr)(new X_monotone_curve_2(cv)); } /*! Set the trapezoid's type flag (Trapezoid/Edge/Vertex). */ @@ -537,8 +537,8 @@ public: CGAL_precondition(is_on_boundaries()); CGAL_assertion(boost::get( &(ptr()->e1)) != nullptr); - CGAL_assertion(boost::get >(&(ptr()->e2)) != nullptr); - X_monotone_curve_2* cv_ptr = (boost::get >(ptr()->e2)).get(); + CGAL_assertion(boost::get >(&(ptr()->e2)) != nullptr); + X_monotone_curve_2* cv_ptr = (boost::get >(ptr()->e2)).get(); CGAL_assertion(cv_ptr != nullptr); Arr_curve_end ce = @@ -555,8 +555,8 @@ public: CGAL_precondition(is_on_boundaries()); CGAL_assertion(boost::get( &(ptr()->e1)) != nullptr); - CGAL_assertion(boost::get >(&(ptr()->e2)) != nullptr); - X_monotone_curve_2* cv_ptr = (boost::get >(ptr()->e2)).get(); + CGAL_assertion(boost::get >(&(ptr()->e2)) != nullptr); + X_monotone_curve_2* cv_ptr = (boost::get >(ptr()->e2)).get(); CGAL_assertion(cv_ptr != nullptr); Arr_curve_end ce = @@ -572,8 +572,8 @@ public: CGAL_precondition(type() == TD_VERTEX); CGAL_assertion(boost::get( &(ptr()->e1)) != nullptr); - CGAL_assertion(boost::get >(&(ptr()->e2)) != nullptr); - X_monotone_curve_2* cv_ptr = (boost::get >(ptr()->e2)).get(); + CGAL_assertion(boost::get >(&(ptr()->e2)) != nullptr); + X_monotone_curve_2* cv_ptr = (boost::get >(ptr()->e2)).get(); CGAL_assertion(cv_ptr != nullptr); Arr_curve_end ce = @@ -587,8 +587,8 @@ public: { CGAL_precondition(!is_active() && type() == TD_EDGE); - CGAL_assertion(boost::get >(&(ptr()->e2)) != nullptr); - X_monotone_curve_2* cv_ptr = (boost::get >(ptr()->e2)).get(); + CGAL_assertion(boost::get >(&(ptr()->e2)) != nullptr); + X_monotone_curve_2* cv_ptr = (boost::get >(ptr()->e2)).get(); CGAL_assertion(cv_ptr != nullptr); return *cv_ptr; } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_edge.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_edge.h index 61259f33547..6954193a227 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_edge.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_edge.h @@ -22,7 +22,7 @@ #include #include -#include +#include #ifdef CGAL_TD_DEBUG diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_fictitious_vertex.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_fictitious_vertex.h index b75de1b9d97..8f038c6b5e4 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_fictitious_vertex.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_fictitious_vertex.h @@ -22,7 +22,7 @@ #include #include -#include +#include #ifdef CGAL_TD_DEBUG #define CGAL_TD_INLINE diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_vertex.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_vertex.h index 3b3e86aa0c6..9439d3825c4 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_vertex.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_vertex.h @@ -22,7 +22,7 @@ #include #include -#include +#include #ifdef CGAL_TD_DEBUG diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_edge.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_edge.h index bb57f7c6d1c..ed5759d6bc0 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_edge.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_edge.h @@ -22,7 +22,7 @@ #include #include -#include +#include #ifdef CGAL_TD_DEBUG @@ -115,14 +115,14 @@ public: public: //c'tors - Data (boost::shared_ptr& _cv, Dag_node* _p_node) + Data (std::shared_ptr& _cv, Dag_node* _p_node) : cv(_cv), p_node(_p_node) //, lb(_lb),lt(_lt),rb(_rb),rt(_rt) { } ~Data() { } protected: - boost::shared_ptr cv; + std::shared_ptr cv; Dag_node* p_node; }; @@ -148,7 +148,7 @@ public: } /*! Set the x_monotone_curve_2 for removed edge degenerate trapezoid. */ - CGAL_TD_INLINE void set_curve(boost::shared_ptr& cv) + CGAL_TD_INLINE void set_curve(std::shared_ptr& cv) { ptr()->cv = cv; } @@ -159,7 +159,7 @@ public: //@{ /*! Constructor given Vertex & Halfedge handles. */ - Td_inactive_edge (boost::shared_ptr& cv, Dag_node* node = nullptr) + Td_inactive_edge (std::shared_ptr& cv, Dag_node* node = nullptr) { PTR = new Data(cv,node); } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2.h index e48f1aa5c55..d9ff595e41d 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2.h @@ -27,7 +27,7 @@ #include #include -#include +#include #include #include @@ -1206,7 +1206,7 @@ protected: void deactivate_vertex (Dag_node& vtx_node) const; - void deactivate_edge (boost::shared_ptr& cv, Dag_node& edge_node) const; + void deactivate_edge (std::shared_ptr& cv, Dag_node& edge_node) const; //----------------------------------------------------------------------------- // Description: diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2_impl.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2_impl.h index d86c0c869f9..087920e3aec 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2_impl.h @@ -244,7 +244,7 @@ deactivate_vertex(Dag_node& vtx_node) const template void Trapezoidal_decomposition_2:: -deactivate_edge(boost::shared_ptr& cv, +deactivate_edge(std::shared_ptr& cv, Dag_node& edge_node) const { CGAL_precondition(traits->is_active(edge_node.get_data())); @@ -1870,7 +1870,7 @@ void Trapezoidal_decomposition_2::remove(Halfedge_const_handle he) //----------------------------------- //3. remove the trapezoids that represent the removed halfedge - boost::shared_ptr + std::shared_ptr removed_cv_ptr(new X_monotone_curve_2(he->curve())); Base_map_item_iterator last_edge_fragment_it = mid_it; //Base_trapezoid_iterator last_mid = mid_it; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Algebraic_point_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Algebraic_point_2.h index f3a101db437..460bbe432a7 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Algebraic_point_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Algebraic_point_2.h @@ -237,7 +237,7 @@ public: std::ostream& print (std::ostream& os) const { std::pair double_p; - switch(::CGAL::get_mode(os)) + switch(::CGAL::IO::get_mode(os)) { case ::CGAL::IO::PRETTY: double_p = this->to_double(); diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_triangulation_point_location.h b/Arrangement_on_surface_2/include/CGAL/Arr_triangulation_point_location.h index 0203f0466bd..e3f5c3565ff 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_triangulation_point_location.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_triangulation_point_location.h @@ -80,7 +80,7 @@ public: typedef Triangulation_vertex_base_with_info_2 Vbb; typedef Triangulation_hierarchy_vertex_base_2 Vb; - //typedef Triangulation_face_base_with_info_2 Fbt; + //typedef Triangulation_face_base_with_info_2 Fbt; typedef Constrained_triangulation_face_base_2 Fb; typedef Triangulation_data_structure_2 TDS; typedef Exact_predicates_tag Itag; diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Arc_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Arc_2.h index dcdb6dbbc74..cfbbcc23784 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Arc_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Arc_2.h @@ -3164,7 +3164,7 @@ public: */ void write(std::ostream& os) const { - switch (::CGAL::get_mode(os)) { + switch (::CGAL::IO::get_mode(os)) { case ::CGAL::IO::PRETTY: os << "arc@" << this->id() << "[(sup@" << this->curve().id(); if (this->is_vertical()) { @@ -3214,7 +3214,7 @@ public: */ void read(std::istream& is) { - CGAL_precondition(CGAL::is_ascii(is)); + CGAL_precondition(CGAL::IO::is_ascii(is)); Rep rep; @@ -3371,7 +3371,7 @@ std::istream& operator>> ( std::istream& is, Arc_2< CurvedKernelViaAnalysis_2, Rep_ >& arc) { - CGAL_precondition(CGAL::is_ascii(is)); + CGAL_precondition(CGAL::IO::is_ascii(is)); //typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2; //typedef Rep_ Rep; diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_functors.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_functors.h index b8dd6eaf6f9..1447bbf1ff4 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_functors.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_functors.h @@ -231,7 +231,7 @@ public: // avoid compiler warning (void)arc; - //CGAL::set_pretty_mode(std::cerr); + //CGAL::IO::set_pretty_mode(std::cerr); CERR("Construct_pt_on_arc: " << CGAL::to_double(x) << ", " << arcno << ", " << c.id() << "\narc = " << arc << "\n"); diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Point_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Point_2.h index 09e245ec4ff..b06c547b182 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Point_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Point_2.h @@ -615,7 +615,7 @@ public: */ void write(std::ostream& os) const { - switch(::CGAL::get_mode(os)) { + switch(::CGAL::IO::get_mode(os)) { case ::CGAL::IO::PRETTY: os << "point@" << this->id() << "("; os << "sup@" << this->curve().id() << "; "; @@ -722,7 +722,7 @@ public: */ void read(std::istream& is) { - CGAL_precondition(CGAL::is_ascii(is)); + CGAL_precondition(CGAL::IO::is_ascii(is)); Rep rep; @@ -823,7 +823,7 @@ std::istream& operator>> ( std::istream& is, Point_2< CurvedKernelViaAnalysis_2, Rep_ >& pt) { - CGAL_precondition(CGAL::is_ascii(is)); + CGAL_precondition(CGAL::IO::is_ascii(is)); //typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2; //typedef Rep_ Rep; diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_2.h index 745381dc630..163bbff54e9 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_2.h @@ -2586,8 +2586,8 @@ inline bool is_isolated_pixel(const Pixel_2& /* pix */) { // DEBUG ONLY #ifdef Gfx_USE_OUT void dump_neighbourhood(const Pixel_2& pix) { - CGAL::set_mode(std::cerr, CGAL::IO::PRETTY); - CGAL::set_mode(std::cout, CGAL::IO::PRETTY); + CGAL::IO::set_mode(std::cerr, CGAL::IO::PRETTY); + CGAL::IO::set_mode(std::cout, CGAL::IO::PRETTY); Stripe box[2]; // 0 - left-right stripe, 1 - bottom-top stripe //NT inv = NT(1) / NT(one << pix.level); diff --git a/Arrangement_on_surface_2/include/CGAL/IO/Arr_iostream.h b/Arrangement_on_surface_2/include/CGAL/IO/Arr_iostream.h index 7e42544af2d..0ca1a6b6bd6 100644 --- a/Arrangement_on_surface_2/include/CGAL/IO/Arr_iostream.h +++ b/Arrangement_on_surface_2/include/CGAL/IO/Arr_iostream.h @@ -29,6 +29,8 @@ namespace CGAL { +namespace IO { + /*! * Write an arrangement to an output stream using a given formatter. * \param arr The arrangement. @@ -51,6 +53,8 @@ std::ostream& return (os); } +} // namespace IO + /*! * Output operator (importer). * \param os The output stream. @@ -72,6 +76,8 @@ std::ostream& return (os); } +namespace IO { + /*! * Read an arrangement from an input stream using a given formatter. * \param arr The arrangement. @@ -94,6 +100,8 @@ std::istream& return (is); } +} // namespace IO + /*! * Output operator (exporter). * \param is The input stream. @@ -115,6 +123,11 @@ std::istream& return (is); } +#ifndef CGAL_NO_DEPRECATED_CODE +using IO::read; +using IO::write; +#endif + } //namespace CGAL #endif diff --git a/Arrangement_on_surface_2/include/CGAL/IO/Arr_text_formatter.h b/Arrangement_on_surface_2/include/CGAL/IO/Arr_text_formatter.h index d9337e2805f..a0096d36b76 100644 --- a/Arrangement_on_surface_2/include/CGAL/IO/Arr_text_formatter.h +++ b/Arrangement_on_surface_2/include/CGAL/IO/Arr_text_formatter.h @@ -120,8 +120,8 @@ public: void write_arrangement_begin() { CGAL_assertion(m_out != nullptr); - m_old_out_mode = get_mode(*m_out); - set_ascii_mode(*m_out); + m_old_out_mode = IO::get_mode(*m_out); + IO::set_ascii_mode(*m_out); _write_comment("BEGIN ARRANGEMENT"); } @@ -277,8 +277,8 @@ public: void read_arrangement_begin() { CGAL_assertion(m_in != nullptr); - m_old_in_mode = get_mode(*m_in); - set_ascii_mode(*m_in); + m_old_in_mode = IO::get_mode(*m_in); + IO::set_ascii_mode(*m_in); _skip_comments(); } diff --git a/Arrangement_on_surface_2/include/CGAL/IO/Arr_with_history_iostream.h b/Arrangement_on_surface_2/include/CGAL/IO/Arr_with_history_iostream.h index d1a37040e91..3c366136072 100644 --- a/Arrangement_on_surface_2/include/CGAL/IO/Arr_with_history_iostream.h +++ b/Arrangement_on_surface_2/include/CGAL/IO/Arr_with_history_iostream.h @@ -30,6 +30,8 @@ namespace CGAL { +namespace IO { + /*! * Write an arrangement with history to an output stream using a given * formatter. @@ -54,6 +56,8 @@ std::ostream& write return (os); } +} // namespace IO + /*! * Output operator (importer). * \param os The output stream. @@ -77,6 +81,8 @@ std::ostream& operator<< return (os); } +namespace IO { + /*! * Read an arrangement with history from an input stream using a given * formatter. @@ -101,6 +107,8 @@ std::istream& read return (is); } +} // namespace IO + /*! * Output operator (exporter). * \param is The input stream. @@ -124,6 +132,11 @@ std::istream& operator>> return (is); } +#ifndef CGAL_NO_DEPRECATED_CODE +using IO::read; +using IO::write; +#endif + } //namespace CGAL #endif diff --git a/Arrangement_on_surface_2/include/CGAL/IO/Fig_stream_Conic_arc_2.h b/Arrangement_on_surface_2/include/CGAL/IO/Fig_stream_Conic_arc_2.h index 5ca5bdecbb8..626087f67bb 100644 --- a/Arrangement_on_surface_2/include/CGAL/IO/Fig_stream_Conic_arc_2.h +++ b/Arrangement_on_surface_2/include/CGAL/IO/Fig_stream_Conic_arc_2.h @@ -18,6 +18,9 @@ #include #include +namespace CGAL { +namespace IO { + /*! * Write an x-monotone conic arc to a FIG stream. */ @@ -97,4 +100,6 @@ void write_conic_arc return; } +}} // namespace CGAL:IO + #endif diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Overlay_test.h b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Overlay_test.h index 6a45618aeb9..d1d1eaa56db 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Overlay_test.h +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Overlay_test.h @@ -745,7 +745,7 @@ bool Overlay_test::init() // Expected arrangement. Formatter formatter; - CGAL::read(m_arr, p_stream, formatter); + CGAL::IO::read(m_arr, p_stream, formatter); p_stream.close(); @@ -981,13 +981,13 @@ bool Overlay_test::perform() Arrangement arr; Overlay_traits overlay_traits(m_verbose_level); // Formatter formatter; - // CGAL::write(m_arr2, std::cout, formatter); + // CGAL::IO::write(m_arr2, std::cout, formatter); CGAL::overlay(m_arr1, m_arr2, arr, overlay_traits); // Generate the output for debugging purposes // Formatter formatter; - // CGAL::write(arr, std::cout, formatter); + // CGAL::IO::write(arr, std::cout, formatter); // Verify the resulting arrangement: if (!equivalent_arr(arr, m_arr)) { diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_batched_point_location.cpp b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_batched_point_location.cpp index 4f335409a64..2162954c316 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_batched_point_location.cpp +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_batched_point_location.cpp @@ -87,8 +87,8 @@ bool test(const char* points_filename, const char* xcurves_filename, int main(int argc, char* argv[]) { #if TEST_GEOM_TRAITS == ALGEBRAIC_GEOM_TRAITS - CGAL::set_pretty_mode(std::cout); - CGAL::set_pretty_mode(std::cerr); + CGAL::IO::set_pretty_mode(std::cout); + CGAL::IO::set_pretty_mode(std::cerr); #endif size_t verbose_level = 0; diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_construction.cpp b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_construction.cpp index 5b1c849af03..ba4e4738b41 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_construction.cpp +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_construction.cpp @@ -96,8 +96,8 @@ bool test(const char* filename, int verbose_level) int main(int argc, char* argv[]) { #if TEST_GEOM_TRAITS == ALGEBRAIC_GEOM_TRAITS - CGAL::set_pretty_mode(std::cout); - CGAL::set_pretty_mode(std::cerr); + CGAL::IO::set_pretty_mode(std::cout); + CGAL::IO::set_pretty_mode(std::cerr); #endif if (argc < 2) { diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_overlay.cpp b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_overlay.cpp index f648439034a..34992ea018b 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_overlay.cpp +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_overlay.cpp @@ -129,8 +129,8 @@ bool test(const char* filename, int verbose_level) int main(int argc, char* argv[]) { #if TEST_GEOM_TRAITS == ALGEBRAIC_GEOM_TRAITS - CGAL::set_pretty_mode(std::cout); - CGAL::set_pretty_mode(std::cerr); + CGAL::IO::set_pretty_mode(std::cout); + CGAL::IO::set_pretty_mode(std::cerr); #endif if (argc < 2) { diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_point_location.cpp b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_point_location.cpp index 9cc77ec9977..75eacfabdd0 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_point_location.cpp +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_point_location.cpp @@ -128,8 +128,8 @@ bool test3(const char* points_filename, const char* xcurves_filename, int main(int argc, char* argv[]) { #if TEST_GEOM_TRAITS == ALGEBRAIC_GEOM_TRAITS - CGAL::set_pretty_mode(std::cout); - CGAL::set_pretty_mode(std::cerr); + CGAL::IO::set_pretty_mode(std::cout); + CGAL::IO::set_pretty_mode(std::cerr); #endif if (argc < 4) { diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_point_location_dynamic.cpp b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_point_location_dynamic.cpp index 4a1d461f690..d9c13cbbd44 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_point_location_dynamic.cpp +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_point_location_dynamic.cpp @@ -91,8 +91,8 @@ bool test1(const char* points_filename, const char* xcurves_filename, int main(int argc, char* argv[]) { #if TEST_GEOM_TRAITS == ALGEBRAIC_GEOM_TRAITS - CGAL::set_pretty_mode(std::cout); - CGAL::set_pretty_mode(std::cerr); + CGAL::IO::set_pretty_mode(std::cout); + CGAL::IO::set_pretty_mode(std::cerr); #endif if (argc < 5) { diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_traits.cpp b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_traits.cpp index b883a6ba0f6..ec26c356b75 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_traits.cpp +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_traits.cpp @@ -73,8 +73,8 @@ int main(int argc, char* argv[]) { #if TEST_GEOM_TRAITS == ALGEBRAIC_GEOM_TRAITS - CGAL::set_pretty_mode(std::cout); - CGAL::set_pretty_mode(std::cerr); + CGAL::IO::set_pretty_mode(std::cout); + CGAL::IO::set_pretty_mode(std::cerr); #endif Geom_traits traits; diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_vertical_decomposition.cpp b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_vertical_decomposition.cpp index 748632219b7..9bd60487f5d 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_vertical_decomposition.cpp +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_vertical_decomposition.cpp @@ -84,8 +84,8 @@ bool test(const char* points_filename, const char* xcurves_filename, int main(int argc, char* argv[]) { #if TEST_GEOM_TRAITS == ALGEBRAIC_GEOM_TRAITS - CGAL::set_pretty_mode(std::cout); - CGAL::set_pretty_mode(std::cerr); + CGAL::IO::set_pretty_mode(std::cout); + CGAL::IO::set_pretty_mode(std::cerr); #endif size_t verbose_level = 0; diff --git a/BGL/doc/BGL/PackageDescription.txt b/BGL/doc/BGL/PackageDescription.txt index cf7e059049b..d74834a3c19 100644 --- a/BGL/doc/BGL/PackageDescription.txt +++ b/BGL/doc/BGL/PackageDescription.txt @@ -756,8 +756,8 @@ user might encounter. - `CGAL::alpha_expansion_graphcut()` \cgalCRPSection{I/O Functions} -- `CGAL::read_polygon_mesh()` -- `CGAL::write_polygon_mesh()` +- `CGAL::IO::read_polygon_mesh()` +- `CGAL::IO::write_polygon_mesh()` - \link PkgBGLIoFuncsSTL I/O for STL files \endlink - \link PkgBGLIoFuncsPLY I/O for PLY files \endlink - \link PkgBGLIoFuncsOBJ I/O for OBJ files \endlink diff --git a/BGL/examples/BGL_LCC/copy_lcc.cpp b/BGL/examples/BGL_LCC/copy_lcc.cpp index 65086dfeb7f..4d317edc099 100644 --- a/BGL/examples/BGL_LCC/copy_lcc.cpp +++ b/BGL/examples/BGL_LCC/copy_lcc.cpp @@ -39,7 +39,7 @@ int main(int argc, char* argv[]) Target1 T1; { CGAL::copy_face_graph(S, T1); - CGAL::write_OFF("lcc.off", T1); + CGAL::IO::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 afc32287a34..73dd211644c 100644 --- a/BGL/examples/BGL_LCC/distance_lcc.cpp +++ b/BGL/examples/BGL_LCC/distance_lcc.cpp @@ -20,7 +20,7 @@ typedef boost::graph_traits::vertex_iterator vertex_iterator; int main(int argc, char** argv) { LCC lcc; - CGAL::read_polygon_mesh((argc>1)?argv[1]:"cube.off", lcc); + CGAL::IO::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()); diff --git a/BGL/examples/BGL_LCC/incident_vertices_lcc.cpp b/BGL/examples/BGL_LCC/incident_vertices_lcc.cpp index fdffd6121a5..09cf04839e5 100644 --- a/BGL/examples/BGL_LCC/incident_vertices_lcc.cpp +++ b/BGL/examples/BGL_LCC/incident_vertices_lcc.cpp @@ -51,7 +51,7 @@ OutputIterator adjacent_vertices_V2(const LCC& g, int main(int argc, char** argv) { LCC lcc; - CGAL::read_polygon_mesh((argc>1)?argv[1]:"cube.off", lcc); + CGAL::IO::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 7487e1876a0..38e98f63cc6 100644 --- a/BGL/examples/BGL_LCC/normals_lcc.cpp +++ b/BGL/examples/BGL_LCC/normals_lcc.cpp @@ -70,7 +70,7 @@ int main(int argc, char** argv) Face_index_map; LCC lcc; - CGAL::read_polygon_mesh((argc>1)?argv[1]:"cube.off", lcc); + CGAL::IO::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 diff --git a/BGL/examples/BGL_LCC/range_lcc.cpp b/BGL/examples/BGL_LCC/range_lcc.cpp index ad261980311..fa9220127ba 100644 --- a/BGL/examples/BGL_LCC/range_lcc.cpp +++ b/BGL/examples/BGL_LCC/range_lcc.cpp @@ -52,7 +52,7 @@ void fct(const LCC& lcc) int main(int argc, char** argv) { LCC lcc; - CGAL::read_polygon_mesh((argc>1)?argv[1]:"cube.off", lcc); + CGAL::IO::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 12533a4ed0d..299edae306d 100644 --- a/BGL/examples/BGL_LCC/transform_iterator_lcc.cpp +++ b/BGL/examples/BGL_LCC/transform_iterator_lcc.cpp @@ -43,7 +43,7 @@ struct Source { int main(int argc, char** argv) { LCC lcc; - CGAL::read_polygon_mesh((argc>1)?argv[1]:"cube.off", lcc); + CGAL::IO::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; diff --git a/BGL/examples/BGL_OpenMesh/TriMesh.cpp b/BGL/examples/BGL_OpenMesh/TriMesh.cpp index 126ba82744f..df325b56457 100644 --- a/BGL/examples/BGL_OpenMesh/TriMesh.cpp +++ b/BGL/examples/BGL_OpenMesh/TriMesh.cpp @@ -28,13 +28,13 @@ int main(int argc, char** argv ) std::vector V; const char* filename = (argc>1)?argv[1]:"in.off"; const char* outname= (argc>2)?argv[2]:"out.off"; - CGAL::read_polygon_mesh(filename, mesh); + CGAL::IO::read_polygon_mesh(filename, 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_polygon_mesh(outname, mesh); + CGAL::IO::write_polygon_mesh(outname, 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 9904bfffecc..ab5875e1184 100644 --- a/BGL/examples/BGL_graphcut/face_selection_borders_regularization_example.cpp +++ b/BGL/examples/BGL_graphcut/face_selection_borders_regularization_example.cpp @@ -21,7 +21,7 @@ int main(int argc, char** argv) } Mesh mesh; - CGAL::read_OFF (in, mesh); + CGAL::IO::read_OFF (in, mesh); boost::unordered_map is_selected_map; diff --git a/BGL/examples/BGL_surface_mesh/connected_components.cpp b/BGL/examples/BGL_surface_mesh/connected_components.cpp index e76fe3c31f7..d078cb5e64c 100644 --- a/BGL/examples/BGL_surface_mesh/connected_components.cpp +++ b/BGL/examples/BGL_surface_mesh/connected_components.cpp @@ -17,7 +17,7 @@ int main(int argc, char* argv[]) const char* filename = (argc > 1) ? argv[1] : "data/prim.off"; Mesh sm; - if(!CGAL::read_polygon_mesh(filename, sm)) + if(!CGAL::IO::read_polygon_mesh(filename, sm)) { std::cerr << "Invalid input." << std::endl; return 1; diff --git a/BGL/examples/BGL_surface_mesh/prim.cpp b/BGL/examples/BGL_surface_mesh/prim.cpp index c98b0b4a582..2e55814270d 100644 --- a/BGL/examples/BGL_surface_mesh/prim.cpp +++ b/BGL/examples/BGL_surface_mesh/prim.cpp @@ -17,7 +17,7 @@ int main(int argc, char* argv[]) const char* filename = (argc>1) ? argv[1] : "data/prim.off"; Mesh P; - if(!CGAL::read_polygon_mesh(filename, P)) + if(!CGAL::IO::read_polygon_mesh(filename, P)) { std::cerr << "Invalid input." << std::endl; return 1; diff --git a/BGL/examples/BGL_surface_mesh/seam_mesh.cpp b/BGL/examples/BGL_surface_mesh/seam_mesh.cpp index 92e446a0ee7..ab524cabdcc 100644 --- a/BGL/examples/BGL_surface_mesh/seam_mesh.cpp +++ b/BGL/examples/BGL_surface_mesh/seam_mesh.cpp @@ -36,7 +36,7 @@ int main(int argc, char* argv[]) const char* filename = (argc>1) ? argv[1] : "data/cube.off"; Mesh sm; - if(!CGAL::read_polygon_mesh(filename, sm)) + if(!CGAL::IO::read_polygon_mesh(filename, sm)) { std::cerr << "Invalid input." << std::endl; return 1; diff --git a/BGL/examples/BGL_surface_mesh/surface_mesh_dual.cpp b/BGL/examples/BGL_surface_mesh/surface_mesh_dual.cpp index fd5535d0ea7..d278a383cab 100644 --- a/BGL/examples/BGL_surface_mesh/surface_mesh_dual.cpp +++ b/BGL/examples/BGL_surface_mesh/surface_mesh_dual.cpp @@ -40,7 +40,7 @@ int main(int argc, char* argv[]) const char* filename = (argc > 1) ? argv[1] : "data/prim.off"; Mesh primal; - if(!CGAL::read_polygon_mesh(filename, primal)) + if(!CGAL::IO::read_polygon_mesh(filename, primal)) { std::cerr << "Invalid input." << std::endl; return 1; diff --git a/BGL/examples/BGL_surface_mesh/surface_mesh_partition.cpp b/BGL/examples/BGL_surface_mesh/surface_mesh_partition.cpp index 629fddfb640..1bc03831e72 100644 --- a/BGL/examples/BGL_surface_mesh/surface_mesh_partition.cpp +++ b/BGL/examples/BGL_surface_mesh/surface_mesh_partition.cpp @@ -17,7 +17,7 @@ int main(int argc, char** argv) int number_of_parts = (argc>2) ? atoi(argv[2]) : 8; SM sm; - if(!CGAL::read_polygon_mesh(filename, sm)) + if(!CGAL::IO::read_polygon_mesh(filename, sm)) { std::cerr << "Invalid input." << std::endl; return 1; @@ -44,7 +44,7 @@ int main(int argc, char** argv) CGAL::copy_face_graph(filtered_sm, part_sm); // Output the mesh extracted from subpart n°0 - CGAL::write_polygon_mesh("sm_part_0.off", part_sm, CGAL::parameters::stream_precision(17)); + CGAL::IO::write_polygon_mesh("sm_part_0.off", part_sm, CGAL::parameters::stream_precision(17)); // Output all the vertices that are in the part n°0 std::ofstream outxyz("out.xyz"); diff --git a/BGL/examples/BGL_surface_mesh/write_inp.cpp b/BGL/examples/BGL_surface_mesh/write_inp.cpp index 71c86535874..7554bed208d 100644 --- a/BGL/examples/BGL_surface_mesh/write_inp.cpp +++ b/BGL/examples/BGL_surface_mesh/write_inp.cpp @@ -22,7 +22,7 @@ int main() std::ofstream out("out.inp"); out.precision(17); - CGAL::write_INP(out, "out.inp", "S4R", sm); + CGAL::IO::write_INP(out, "out.inp", "S4R", sm); return EXIT_SUCCESS; } diff --git a/BGL/include/CGAL/boost/graph/IO/3MF.h b/BGL/include/CGAL/boost/graph/IO/3MF.h index ebc47bc0e49..664551c9af2 100644 --- a/BGL/include/CGAL/boost/graph/IO/3MF.h +++ b/BGL/include/CGAL/boost/graph/IO/3MF.h @@ -28,6 +28,8 @@ namespace CGAL { +namespace IO { + //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// // Write @@ -58,7 +60,7 @@ bool write_3MF(const std::string& filename, const std::vector& names #ifndef DOXYGEN_RUNNING , typename boost::disable_if< - IO::internal::is_Point_set_or_Range_or_Iterator< + internal::is_Point_set_or_Range_or_Iterator< typename boost::range_value::type> >::type* = nullptr #endif ) @@ -114,7 +116,7 @@ bool write_3MF(const std::string& filename, return write_3MF(filename, all_points, all_triangles, names); } -} // namespace CGAL +} } // namespace CGAL::IO #endif // defined(CGAL_LINKED_WITH_3MF) || defined(DOXYGEN_RUNNING) diff --git a/BGL/include/CGAL/boost/graph/IO/GOCAD.h b/BGL/include/CGAL/boost/graph/IO/GOCAD.h index 966e4f4219d..e3baecc25e3 100644 --- a/BGL/include/CGAL/boost/graph/IO/GOCAD.h +++ b/BGL/include/CGAL/boost/graph/IO/GOCAD.h @@ -76,7 +76,6 @@ public: }; } // namespace internal -} // namespace IO /// \ingroup PkgBGLIoFuncsGOCAD /// @@ -120,14 +119,14 @@ bool read_GOCAD(std::istream& is, Graph& g, const CGAL_BGL_NP_CLASS& np #ifndef DOXYGEN_RUNNING - , typename boost::disable_if >::type* = nullptr + , typename boost::disable_if >::type* = nullptr #endif ) { typedef typename CGAL::GetVertexPointMap::type VPM; typedef typename boost::property_traits::value_type Point; - IO::internal::GOCAD_builder builder(is); + internal::GOCAD_builder builder(is); if(!builder(g, np)) return false; @@ -141,14 +140,14 @@ bool read_GOCAD(std::istream& is, template bool read_GOCAD(std::istream& is, std::pair& name_and_color, Graph& g, - typename boost::disable_if >::type* = nullptr) + typename boost::disable_if >::type* = nullptr) { return read_GOCAD(is, name_and_color, g, parameters::all_default()); } template bool read_GOCAD(std::istream& is, Graph& g, const CGAL_BGL_NP_CLASS& np, - typename boost::disable_if >::type* = nullptr) + typename boost::disable_if >::type* = nullptr) { std::pair dummy; return read_GOCAD(is, dummy, g, np); @@ -156,7 +155,7 @@ bool read_GOCAD(std::istream& is, Graph& g, const CGAL_BGL_NP_CLASS& np, template bool read_GOCAD(std::istream& is, Graph& g, - typename boost::disable_if >::type* = nullptr) + typename boost::disable_if >::type* = nullptr) { return read_GOCAD(is, g, parameters::all_default()); } @@ -207,12 +206,12 @@ bool read_GOCAD(const std::string& fname, Graph& g, const CGAL_BGL_NP_CLASS& np #ifndef DOXYGEN_RUNNING - , typename boost::disable_if >::type* = nullptr + , typename boost::disable_if >::type* = nullptr #endif ) { std::ifstream is(fname); - CGAL::set_mode(is, CGAL::IO::ASCII); + CGAL::IO::set_mode(is, CGAL::IO::ASCII); return read_GOCAD(is, name_and_color, g, np); } @@ -220,14 +219,14 @@ bool read_GOCAD(const std::string& fname, template bool read_GOCAD(const std::string& fname, std::pair& name_and_color, Graph& g, - typename boost::disable_if >::type* = nullptr) + typename boost::disable_if >::type* = nullptr) { return read_GOCAD(fname, name_and_color, g, parameters::all_default()); } template bool read_GOCAD(const std::string& fname, Graph& g, const CGAL_BGL_NP_CLASS& np, - typename boost::disable_if >::type* = nullptr) + typename boost::disable_if >::type* = nullptr) { std::pair dummy; return read_GOCAD(fname, dummy, g, np); @@ -235,7 +234,7 @@ bool read_GOCAD(const std::string& fname, Graph& g, const CGAL_BGL_NP_CLASS& np, template bool read_GOCAD(const std::string& fname, Graph& g, - typename boost::disable_if >::type* = nullptr) + typename boost::disable_if >::type* = nullptr) { return read_GOCAD(fname, g, parameters::all_default()); } @@ -284,7 +283,7 @@ bool write_GOCAD(std::ostream& os, const Graph& g, const CGAL_BGL_NP_CLASS& np #ifndef DOXYGEN_RUNNING - , typename boost::disable_if >::type* = nullptr + , typename boost::disable_if >::type* = nullptr #endif ) { @@ -346,7 +345,7 @@ bool write_GOCAD(std::ostream& os, template bool write_GOCAD(std::ostream& os, const char* name, const Graph& g, - typename boost::disable_if >::type* = nullptr) + typename boost::disable_if >::type* = nullptr) { return write_GOCAD(os, name, g, parameters::all_default()); } @@ -391,7 +390,7 @@ bool write_GOCAD(std::ostream& os, const Graph& g, const CGAL_BGL_NP_CLASS& np #ifndef DOXYGEN_RUNNING - , typename boost::disable_if >::type* = nullptr + , typename boost::disable_if >::type* = nullptr #endif ) { @@ -402,7 +401,7 @@ bool write_GOCAD(std::ostream& os, template bool write_GOCAD(std::ostream& os, const Graph& g, - typename boost::disable_if >::type* = nullptr) + typename boost::disable_if >::type* = nullptr) { return write_GOCAD(os, g, parameters::all_default()); } @@ -447,12 +446,12 @@ bool write_GOCAD(const std::string& fname, const Graph& g, const CGAL_BGL_NP_CLASS& np #ifndef DOXYGEN_RUNNING - , typename boost::disable_if >::type* = nullptr + , typename boost::disable_if >::type* = nullptr #endif ) { std::ofstream os(fname); - CGAL::set_mode(os, CGAL::IO::ASCII); + CGAL::IO::set_mode(os, CGAL::IO::ASCII); return write_GOCAD(os, fname.c_str(), g, np); } @@ -461,13 +460,13 @@ bool write_GOCAD(const std::string& fname, template bool write_GOCAD(const std::string& fname, const Graph& g, - typename boost::disable_if >::type* = nullptr) + typename boost::disable_if >::type* = nullptr) { return write_GOCAD(fname, g, parameters::all_default()); } /// \endcond -} // namespace CGAL +}} // namespace CGAL::IO #endif // CGAL_BGL_IO_GOCAD_H diff --git a/BGL/include/CGAL/boost/graph/IO/Generic_facegraph_builder.h b/BGL/include/CGAL/boost/graph/IO/Generic_facegraph_builder.h index 3f1d724fae3..b78d97f5af8 100644 --- a/BGL/include/CGAL/boost/graph/IO/Generic_facegraph_builder.h +++ b/BGL/include/CGAL/boost/graph/IO/Generic_facegraph_builder.h @@ -44,7 +44,7 @@ public: typedef typename GetK::Kernel Kernel; typedef typename Kernel::Vector_3 Vector; typedef typename Kernel::Point_2 Texture; - typedef CGAL::Color Color; + typedef CGAL::IO::Color Color; typedef typename CGAL::GetVertexPointMap::type VPM; diff --git a/BGL/include/CGAL/boost/graph/IO/Generic_facegraph_printer.h b/BGL/include/CGAL/boost/graph/IO/Generic_facegraph_printer.h index 5fb75be5363..c78861a855d 100644 --- a/BGL/include/CGAL/boost/graph/IO/Generic_facegraph_printer.h +++ b/BGL/include/CGAL/boost/graph/IO/Generic_facegraph_printer.h @@ -95,7 +95,7 @@ public: typedef typename GetVertexPointMap::const_type VPM; typedef typename boost::property_traits::reference Point_ref; - typedef CGAL::Color Color; + typedef CGAL::IO::Color Color; typedef typename internal_np::Lookup_named_param_def< internal_np::vertex_color_map_t, NamedParameters, @@ -153,7 +153,7 @@ public: if(has_vertex_colors) { - const CGAL::Color& vc = get(vcm, v); + const CGAL::IO::Color& vc = get(vcm, v); m_writer.write_vertex_color(vc.red(), vc.green(), vc.blue()); // @fixme correct? } @@ -182,7 +182,7 @@ public: if(has_face_colors) { - const CGAL::Color& fc = get(fcm, f); + const CGAL::IO::Color& fc = get(fcm, f); m_writer.write_face_color(fc.red(), fc.green(), fc.blue()); } diff --git a/BGL/include/CGAL/boost/graph/IO/INP.h b/BGL/include/CGAL/boost/graph/IO/INP.h index fbc15b04d96..9194174dd9b 100644 --- a/BGL/include/CGAL/boost/graph/IO/INP.h +++ b/BGL/include/CGAL/boost/graph/IO/INP.h @@ -23,6 +23,8 @@ namespace CGAL { +namespace IO { + /// \cond SKIP_IN_MANUAL template @@ -96,8 +98,27 @@ bool write_INP(const std::string& fname, const std::string& type, const Graph& g return write_INP(fname, type, g, parameters::all_default()); } +#ifndef CGAL_NO_DEPRECATED_CODE +template +CGAL_DEPRECATED bool write_inp(std::ostream& os, + const FaceGraph& g, + std::string name, + std::string type, + const NamedParameters& np) +{ + return write_INP(os, name, type, g, np); +} +template +CGAL_DEPRECATED bool write_inp(std::ostream& os, + const FaceGraph& g, + std::string name, + std::string type) +{ + return write_INP(os, name, type, g, parameters::all_default()); +} +#endif /// \endcond -} // namespace CGAL +}} // namespace CGAL::IO #endif // CGAL_BGL_IO_INP_H diff --git a/BGL/include/CGAL/boost/graph/IO/OBJ.h b/BGL/include/CGAL/boost/graph/IO/OBJ.h index 7d733c9f8b4..b97515bb7b6 100644 --- a/BGL/include/CGAL/boost/graph/IO/OBJ.h +++ b/BGL/include/CGAL/boost/graph/IO/OBJ.h @@ -68,7 +68,6 @@ public: }; } // namespace internal -} // namespace IO /*! \ingroup PkgBGLIoFuncsOBJ @@ -115,14 +114,14 @@ bool read_OBJ(std::istream& is, Graph& g, const CGAL_BGL_NP_CLASS& np #ifndef DOXYGEN_RUNNING - , typename boost::disable_if >::type* = nullptr + , typename boost::disable_if >::type* = nullptr #endif ) { typedef typename CGAL::GetVertexPointMap::type VPM; typedef typename boost::property_traits::value_type Point; - IO::internal::OBJ_builder builder(is); + internal::OBJ_builder builder(is); return builder(g, np); } @@ -130,7 +129,7 @@ bool read_OBJ(std::istream& is, template bool read_OBJ(std::istream& is, Graph& g, - typename boost::disable_if >::type* = nullptr) + typename boost::disable_if >::type* = nullptr) { return read_OBJ(is, g, parameters::all_default()); } @@ -182,12 +181,12 @@ bool read_OBJ(const std::string& fname, Graph& g, const CGAL_BGL_NP_CLASS& np #ifndef DOXYGEN_RUNNING - , typename boost::disable_if >::type* = nullptr + , typename boost::disable_if >::type* = nullptr #endif ) { std::ifstream is(fname); - CGAL::set_mode(is, CGAL::IO::ASCII); + CGAL::IO::set_mode(is, CGAL::IO::ASCII); return read_OBJ(is, g, np); } @@ -195,7 +194,7 @@ bool read_OBJ(const std::string& fname, template bool read_OBJ(const std::string& fname, Graph& g, - typename boost::disable_if >::type* = nullptr) + typename boost::disable_if >::type* = nullptr) { return read_OBJ(fname, g, parameters::all_default()); } @@ -245,11 +244,11 @@ bool write_OBJ(std::ostream& os, const Graph& g, const CGAL_BGL_NP_CLASS& np #ifndef DOXYGEN_RUNNING - , typename boost::disable_if >::type* = nullptr + , typename boost::disable_if >::type* = nullptr #endif ) { - IO::internal::Generic_facegraph_printer printer(os); + internal::Generic_facegraph_printer printer(os); return printer(g, np); } @@ -257,7 +256,7 @@ bool write_OBJ(std::ostream& os, template bool write_OBJ(std::ostream& os, const Graph& g, - typename boost::disable_if >::type* = nullptr) + typename boost::disable_if >::type* = nullptr) { return write_OBJ(os, g, parameters::all_default()); } @@ -302,12 +301,12 @@ bool write_OBJ(const std::string& fname, const Graph& g, const CGAL_BGL_NP_CLASS& np #ifndef DOXYGEN_RUNNING - , typename boost::disable_if >::type* = nullptr + , typename boost::disable_if >::type* = nullptr #endif ) { std::ofstream os(fname); - CGAL::set_mode(os, CGAL::IO::ASCII); + CGAL::IO::set_mode(os, CGAL::IO::ASCII); return write_OBJ(os, g, np); } @@ -315,13 +314,13 @@ bool write_OBJ(const std::string& fname, template bool write_OBJ(const std::string& fname, const Graph& g, - typename boost::disable_if >::type* = nullptr) + typename boost::disable_if >::type* = nullptr) { return write_OBJ(fname, g, parameters::all_default()); } /// \endcond -} // namespace CGAL +}} // namespace CGAL::IO #endif // CGAL_BGL_IO_OBJ_H diff --git a/BGL/include/CGAL/boost/graph/IO/OFF.h b/BGL/include/CGAL/boost/graph/IO/OFF.h index 57685046e79..e368a1ab92a 100644 --- a/BGL/include/CGAL/boost/graph/IO/OFF.h +++ b/BGL/include/CGAL/boost/graph/IO/OFF.h @@ -78,12 +78,11 @@ bool read_OFF_BGL(std::istream& is, typedef typename CGAL::GetVertexPointMap::type VPM; typedef typename boost::property_traits::value_type Point; - IO::internal::OFF_builder builder(is); + internal::OFF_builder builder(is); return builder(g, np); } } // namespace internal -} // namespace IO /*! \ingroup PkgBGLIoFuncsOFF @@ -127,7 +126,7 @@ bool read_OFF_BGL(std::istream& is, \cgalParamNBegin{vertex_color_map} \cgalParamDescription{a property map associating colors to the vertices of `g`} \cgalParamType{a class model of `WritablePropertyMap` with `boost::graph_traits::%vertex_descriptor` - as key type and `CGAL::Color` as value type} + as key type and `CGAL::IO::Color` as value type} \cgalParamDefault{vertex colors that may exist in the input will be ignored} \cgalParamNEnd @@ -141,7 +140,7 @@ bool read_OFF_BGL(std::istream& is, \cgalParamNBegin{face_color_map} \cgalParamDescription{a property map associating colors to the faces of `g`} \cgalParamType{a class model of `WritablePropertyMap` with `boost::graph_traits::%face_descriptor` - as key type and `CGAL::Color` as value type} + as key type and `CGAL::IO::Color` as value type} \cgalParamDefault{face colors that may exist in the input will be ignored} \cgalParamNEnd @@ -162,18 +161,18 @@ bool read_OFF(std::istream& is, Graph& g, const CGAL_BGL_NP_CLASS& np #ifndef DOXYGEN_RUNNING - , typename boost::disable_if >::type* = nullptr + , typename boost::disable_if >::type* = nullptr #endif ) { - return IO::internal::read_OFF_BGL(is, g, np); + return internal::read_OFF_BGL(is, g, np); } /// \cond SKIP_IN_MANUAL template bool read_OFF(std::istream& is, Graph& g, - typename boost::disable_if >::type* = nullptr) + typename boost::disable_if >::type* = nullptr) { return read_OFF(is, g, parameters::all_default()); } @@ -222,7 +221,7 @@ bool read_OFF(std::istream& is, Graph& g, \cgalParamNBegin{vertex_color_map} \cgalParamDescription{a property map associating colors to the vertices of `g`} \cgalParamType{a class model of `WritablePropertyMap` with `boost::graph_traits::%vertex_descriptor` - as key type and `CGAL::Color` as value type} + as key type and `CGAL::IO::Color` as value type} \cgalParamDefault{vertex colors that may exist in the input will be ignored} \cgalParamNEnd @@ -236,7 +235,7 @@ bool read_OFF(std::istream& is, Graph& g, \cgalParamNBegin{face_color_map} \cgalParamDescription{a property map associating colors to the faces of `g`} \cgalParamType{a class model of `WritablePropertyMap` with `boost::graph_traits::%face_descriptor` - as key type and `CGAL::Color` as value type} + as key type and `CGAL::IO::Color` as value type} \cgalParamDefault{face colors that may exist in the input will be ignored} \cgalParamNEnd @@ -257,7 +256,7 @@ bool read_OFF(const std::string& fname, Graph& g, const CGAL_BGL_NP_CLASS& np #ifndef DOXYGEN_RUNNING - , typename boost::disable_if >::type* = nullptr + , typename boost::disable_if >::type* = nullptr #endif ) { @@ -269,35 +268,37 @@ bool read_OFF(const std::string& fname, template bool read_OFF(const std::string& fname, Graph& g, - typename boost::disable_if >::type* = nullptr) + typename boost::disable_if >::type* = nullptr) { return read_OFF(fname, g, parameters::all_default()); } /// \endcond +} // namespace IO + #ifndef CGAL_NO_DEPRECATED_CODE /*! \ingroup PkgBGLIOFctDeprecated - \deprecated This function is deprecated since \cgal 5.2, `CGAL::read_OFF()` should be used instead. + \deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::read_OFF()` should be used instead. */ template CGAL_DEPRECATED bool read_off(std::istream& is, Graph& g, const CGAL_BGL_NP_CLASS& np) { - return read_OFF(is, g, np); + return IO::read_OFF(is, g, np); } /*! \ingroup PkgBGLIOFctDeprecated -\deprecated This function is deprecated since \cgal 5.2, `CGAL::read_OFF()` should be used instead. +\deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::read_OFF()` should be used instead. */ template CGAL_DEPRECATED bool read_off(const char* fname, Graph& g, const CGAL_BGL_NP_CLASS& np) { - return read_OFF(fname, g, np); + return IO::read_OFF(fname, g, np); } template @@ -312,6 +313,12 @@ CGAL_DEPRECATED bool read_off(const char* fname, Graph& g) return read_off(fname, g, parameters::all_default()); } +template +CGAL_DEPRECATED bool read_off(const std::string& fname, Graph& g) +{ + return read_off(fname.c_str(), g, parameters::all_default()); +} + #endif // CGAL_NO_DEPRECATED_CODE //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -326,12 +333,11 @@ bool write_OFF_BGL(std::ostream& os, const Graph& g, const CGAL_BGL_NP_CLASS& np) { - IO::internal::Generic_facegraph_printer printer(os); + internal::Generic_facegraph_printer printer(os); return printer(g, np); } } // namespace internal -} // namespace IO /*! \ingroup PkgBGLIoFuncsOFF @@ -365,7 +371,7 @@ bool write_OFF_BGL(std::ostream& os, \cgalParamNBegin{vertex_color_map} \cgalParamDescription{a property map associating colors to the vertices of `g`} \cgalParamType{a class model of `ReadablePropertyMap` with `boost::graph_traits::%vertex_descriptor` - as key type and `CGAL::Color` as value type} + as key type and `CGAL::IO::Color` as value type} \cgalParamDefault{no vertex colors in the output} \cgalParamNEnd @@ -379,7 +385,7 @@ bool write_OFF_BGL(std::ostream& os, \cgalParamNBegin{face_color_map} \cgalParamDescription{a property map associating colors to the faces of `g`} \cgalParamType{a class model of `ReadablePropertyMap` with `boost::graph_traits::%face_descriptor` - as key type and `CGAL::Color` as value type} + as key type and `CGAL::IO::Color` as value type} \cgalParamDefault{no face colors in the output} \cgalParamNEnd @@ -400,18 +406,18 @@ bool write_OFF(std::ostream& os, const Graph& g, const CGAL_BGL_NP_CLASS& np #ifndef DOXYGEN_RUNNING - , typename boost::disable_if >::type* = nullptr + , typename boost::disable_if >::type* = nullptr #endif ) { - return IO::internal::write_OFF_BGL(os, g, np); + return internal::write_OFF_BGL(os, g, np); } /// \cond SKIP_IN_MANUAL template bool write_OFF(std::ostream& os, const Graph& g, - typename boost::disable_if >::type* = nullptr) + typename boost::disable_if >::type* = nullptr) { return write_OFF(os, g, parameters::all_default()); } @@ -450,7 +456,7 @@ bool write_OFF(std::ostream& os, const Graph& g, \cgalParamNBegin{vertex_color_map} \cgalParamDescription{a property map associating colors to the vertices of `g`} \cgalParamType{a class model of `ReadablePropertyMap` with `boost::graph_traits::%vertex_descriptor` - as key type and `CGAL::Color` as value type} + as key type and `CGAL::IO::Color` as value type} \cgalParamDefault{no vertex colors in the output} \cgalParamNEnd @@ -464,7 +470,7 @@ bool write_OFF(std::ostream& os, const Graph& g, \cgalParamNBegin{face_color_map} \cgalParamDescription{a property map associating colors to the faces of `g`} \cgalParamType{a class model of `ReadablePropertyMap` with `boost::graph_traits::%face_descriptor` - as key type and `CGAL::Color` as value type} + as key type and `CGAL::IO::Color` as value type} \cgalParamDefault{no face colors in the output} \cgalParamNEnd @@ -485,7 +491,7 @@ bool write_OFF(const std::string& fname, const Graph& g, const CGAL_BGL_NP_CLASS& np #ifndef DOXYGEN_RUNNING - , typename boost::disable_if >::type* = nullptr + , typename boost::disable_if >::type* = nullptr #endif ) { @@ -503,24 +509,26 @@ bool write_OFF(const std::string& fname, template bool write_OFF(const std::string& fname, const Graph& g, - typename boost::disable_if >::type* = nullptr) + typename boost::disable_if >::type* = nullptr) { return write_OFF(fname, g, parameters::all_default()); } /// \endcond +} // namespace IO + #ifndef CGAL_NO_DEPRECATED_CODE /*! \ingroup PkgBGLIOFctDeprecated - \deprecated This function is deprecated since \cgal 5.2, `CGAL::write_OFF()` should be used instead. + \deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::write_OFF()` should be used instead. */ template CGAL_DEPRECATED bool write_off(std::ostream& os, const Graph& g, const CGAL_BGL_NP_CLASS& np) { - return write_OFF(os, g, np); + return IO::write_OFF(os, g, np); } template @@ -531,12 +539,12 @@ CGAL_DEPRECATED bool write_off(std::ostream& os, const Graph& g) /*! \ingroup PkgBGLIOFctDeprecated -\deprecated This function is deprecated since \cgal 5.2, `CGAL::write_OFF()` should be used instead. +\deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::write_OFF()` should be used instead. */ template CGAL_DEPRECATED bool write_off(const char* fname, const Graph& g, const CGAL_BGL_NP_CLASS& np) { - return write_OFF(fname, g, np); + return IO::write_OFF(fname, g, np); } template diff --git a/BGL/include/CGAL/boost/graph/IO/PLY.h b/BGL/include/CGAL/boost/graph/IO/PLY.h index c571c07d629..881d3f86b0d 100644 --- a/BGL/include/CGAL/boost/graph/IO/PLY.h +++ b/BGL/include/CGAL/boost/graph/IO/PLY.h @@ -71,12 +71,11 @@ bool read_PLY_BGL(std::istream& is, typedef typename CGAL::GetVertexPointMap::type VPM; typedef typename boost::property_traits::value_type Point; - IO::internal::PLY_builder builder(is); + internal::PLY_builder builder(is); return builder(g, np); } } // namespace internal -} // namespace IO /*! \ingroup PkgBGLIoFuncsPLY @@ -114,14 +113,14 @@ bool read_PLY_BGL(std::istream& is, \cgalParamNBegin{vertex_color_map} \cgalParamDescription{a property map associating colors to the vertices of `g`} \cgalParamType{a class model of `WritablePropertyMap` with `boost::graph_traits::%vertex_descriptor` - as key type and `CGAL::Color` as value type} + as key type and `CGAL::IO::Color` as value type} \cgalParamDefault{vertex colors that may exist in the input will be ignored} \cgalParamNEnd \cgalParamNBegin{face_color_map} \cgalParamDescription{a property map associating colors to the faces of `g`} \cgalParamType{a class model of `WritablePropertyMap` with `boost::graph_traits::%face_descriptor` - as key type and `CGAL::Color` as value type} + as key type and `CGAL::IO::Color` as value type} \cgalParamDefault{face colors that may exist in the input will be ignored} \cgalParamNEnd @@ -142,20 +141,20 @@ bool read_PLY(std::istream& is, Graph& g, const CGAL_BGL_NP_CLASS& np #ifndef DOXYGEN_RUNNING - , typename boost::disable_if >::type* = nullptr + , typename boost::disable_if >::type* = nullptr #endif ) { - return IO::internal::read_PLY_BGL(is, g, np); + return internal::read_PLY_BGL(is, g, np); } /// \cond SKIP_IN_MANUAL template bool read_PLY(std::istream& is, Graph& g, - typename boost::disable_if >::type* = nullptr) + typename boost::disable_if >::type* = nullptr) { - return IO::internal::read_PLY_BGL(is, g, parameters::all_default()); + return internal::read_PLY_BGL(is, g, parameters::all_default()); } /// \endcond @@ -200,14 +199,14 @@ bool read_PLY(std::istream& is, Graph& g, \cgalParamNBegin{vertex_color_map} \cgalParamDescription{a property map associating colors to the vertices of `g`} \cgalParamType{a class model of `WritablePropertyMap` with `boost::graph_traits::%vertex_descriptor` - as key type and `CGAL::Color` as value type} + as key type and `CGAL::IO::Color` as value type} \cgalParamDefault{vertex colors that may exist in the input will be ignored} \cgalParamNEnd \cgalParamNBegin{face_color_map} \cgalParamDescription{a property map associating colors to the faces of `g`} \cgalParamType{a class model of `WritablePropertyMap` with `boost::graph_traits::%face_descriptor` - as key type and `CGAL::Color` as value type} + as key type and `CGAL::IO::Color` as value type} \cgalParamDefault{face colors that may exist in the input will be ignored} \cgalParamNEnd @@ -228,7 +227,7 @@ bool read_PLY(const std::string& fname, Graph& g, const CGAL_BGL_NP_CLASS& np #ifndef DOXYGEN_RUNNING - , typename boost::disable_if >::type* = nullptr + , typename boost::disable_if >::type* = nullptr #endif ) { @@ -236,14 +235,14 @@ bool read_PLY(const std::string& fname, if(binary) { std::ifstream is(fname, std::ios::binary); - CGAL::set_mode(is, CGAL::IO::BINARY); - return IO::internal::read_PLY_BGL(is, g, np); + CGAL::IO::set_mode(is, CGAL::IO::BINARY); + return internal::read_PLY_BGL(is, g, np); } else { std::ifstream is(fname); - CGAL::set_mode(is, CGAL::IO::ASCII); - return IO::internal::read_PLY_BGL(is, g, np); + CGAL::IO::set_mode(is, CGAL::IO::ASCII); + return internal::read_PLY_BGL(is, g, np); } } @@ -251,7 +250,7 @@ bool read_PLY(const std::string& fname, template bool read_PLY(const std::string& fname, Graph& g, - typename boost::disable_if >::type* = nullptr) + typename boost::disable_if >::type* = nullptr) { return read_PLY(fname, g, parameters::all_default()); } @@ -297,14 +296,14 @@ bool read_PLY(const std::string& fname, Graph& g, \cgalParamNBegin{vertex_color_map} \cgalParamDescription{a property map associating colors to the vertices of `g`} \cgalParamType{a class model of `WritablePropertyMap` with `boost::graph_traits::%vertex_descriptor` - as key type and `CGAL::Color` as value type} + as key type and `CGAL::IO::Color` as value type} \cgalParamDefault{vertex colors that may exist in the input will be ignored} \cgalParamNEnd \cgalParamNBegin{face_color_map} \cgalParamDescription{a property map associating colors to the faces of `g`} \cgalParamType{a class model of `WritablePropertyMap` with `boost::graph_traits::%face_descriptor` - as key type and `CGAL::Color` as value type} + as key type and `CGAL::IO::Color` as value type} \cgalParamDefault{face colors that may exist in the input will be ignored} \cgalParamNEnd @@ -324,7 +323,7 @@ bool write_PLY(std::ostream& os, const std::string& comments, const CGAL_BGL_NP_CLASS& np #ifndef DOXYGEN_RUNNING - , typename boost::disable_if >::type* = nullptr + , typename boost::disable_if >::type* = nullptr #endif ) { @@ -335,7 +334,7 @@ bool write_PLY(std::ostream& os, typedef typename CGAL::GetInitializedVertexIndexMap::const_type VIMap; typedef typename GetVertexPointMap::const_type Vpm; typedef typename boost::property_traits::reference Point_3; - typedef CGAL::Color Color; + typedef CGAL::IO::Color Color; typedef typename internal_np::Lookup_named_param_def< internal_np::vertex_color_map_t, CGAL_BGL_NP_CLASS, @@ -365,7 +364,7 @@ bool write_PLY(std::ostream& os, // Write header os << "ply" << std::endl - << ((get_mode(os) == IO::BINARY) ? "format binary_little_endian 1.0" : "format ascii 1.0") << std::endl + << ((get_mode(os) == BINARY) ? "format binary_little_endian 1.0" : "format ascii 1.0") << std::endl << "comment Generated by the CGAL library" << std::endl; if(comments != std::string()) @@ -380,7 +379,7 @@ bool write_PLY(std::ostream& os, } os << "element vertex " << vertices(g).size() << std::endl; - IO::internal::output_property_header(os, make_ply_point_writer (CGAL::Identity_property_map())); + internal::output_property_header(os, make_ply_point_writer (CGAL::Identity_property_map())); //if vcm is not default add v:color property if(has_vcolor) { @@ -391,7 +390,7 @@ bool write_PLY(std::ostream& os, } os << "element face " << faces(g).size() << std::endl; - IO::internal::output_property_header( + internal::output_property_header( os, std::make_pair(CGAL::Identity_property_map >(), PLY_property >("vertex_indices"))); //if fcm is not default add f:color property @@ -407,10 +406,10 @@ bool write_PLY(std::ostream& os, for(vertex_descriptor vd : vertices(g)) { Point_3 p = get(vpm, vd); - IO::internal::output_properties(os, &p, make_ply_point_writer (CGAL::Identity_property_map())); + internal::output_properties(os, &p, make_ply_point_writer (CGAL::Identity_property_map())); if(has_vcolor) { - const CGAL::Color& c = get(vcm, vd); + const CGAL::IO::Color& c = get(vcm, vd); if(get_mode(os) == CGAL::IO::ASCII) os << c << std::endl; else @@ -425,12 +424,12 @@ bool write_PLY(std::ostream& os, for(halfedge_descriptor hd : halfedges_around_face(halfedge(fd, g), g)) polygon.push_back(get(vim, target(hd,g))); - IO::internal::output_properties(os, &polygon, + internal::output_properties(os, &polygon, std::make_pair(CGAL::Identity_property_map >(), PLY_property >("vertex_indices"))); if(has_fcolor) { - const CGAL::Color& c = get(fcm, fd); + const CGAL::IO::Color& c = get(fcm, fd); if(get_mode(os) == CGAL::IO::ASCII) os << c << std::endl; else @@ -447,21 +446,21 @@ bool write_PLY(std::ostream& os, template bool write_PLY(std::ostream& os, const Graph& g, const std::string& comments, - typename boost::disable_if >::type* = nullptr) + typename boost::disable_if >::type* = nullptr) { return write_PLY(os, g, comments, parameters::all_default()); } template bool write_PLY(std::ostream& os, const Graph& g, const CGAL_BGL_NP_CLASS& np, - typename boost::disable_if >::type* = nullptr) + typename boost::disable_if >::type* = nullptr) { return write_PLY(os, g, std::string(), np); } template bool write_PLY(std::ostream& os, const Graph& g, - typename boost::disable_if >::type* = nullptr) + typename boost::disable_if >::type* = nullptr) { return write_PLY(os, g, std::string(), parameters::all_default()); } @@ -507,14 +506,14 @@ bool write_PLY(std::ostream& os, const Graph& g, \cgalParamNBegin{vertex_color_map} \cgalParamDescription{a property map associating colors to the vertices of `g`} \cgalParamType{a class model of `ReadablePropertyMap` with `boost::graph_traits::%vertex_descriptor` - as key type and `CGAL::Color` as value type} + as key type and `CGAL::IO::Color` as value type} \cgalParamDefault{no vertex color in the output} \cgalParamNEnd \cgalParamNBegin{face_color_map} \cgalParamDescription{a property map associating colors to the faces of `g`} \cgalParamType{a class model of `ReadablePropertyMap` with `boost::graph_traits::%face_descriptor` - as key type and `CGAL::Color` as value type} + as key type and `CGAL::IO::Color` as value type} \cgalParamDefault{no face color in the output} \cgalParamNEnd @@ -534,7 +533,7 @@ bool write_PLY(const std::string& fname, const std::string& comments, const CGAL_BGL_NP_CLASS& np #ifndef DOXYGEN_RUNNING - , typename boost::disable_if >::type* = nullptr + , typename boost::disable_if >::type* = nullptr #endif ) { @@ -542,13 +541,13 @@ bool write_PLY(const std::string& fname, if(binary) { std::ofstream os(fname, std::ios::binary); - CGAL::set_mode(os, CGAL::IO::BINARY); + CGAL::IO::set_mode(os, CGAL::IO::BINARY); return write_PLY(os, g, comments, np); } else { std::ofstream os(fname); - CGAL::set_mode(os, CGAL::IO::ASCII); + CGAL::IO::set_mode(os, CGAL::IO::ASCII); return write_PLY(os, g, comments, np); } @@ -558,27 +557,27 @@ bool write_PLY(const std::string& fname, template bool write_PLY(const std::string& fname, const Graph& g, const std::string comments, - typename boost::disable_if >::type* = nullptr) + typename boost::disable_if >::type* = nullptr) { return write_PLY(fname, g, comments, parameters::all_default()); } template bool write_PLY(const std::string& fname, const Graph& g, const CGAL_BGL_NP_CLASS& np, - typename boost::disable_if >::type* = nullptr) + typename boost::disable_if >::type* = nullptr) { return write_PLY(fname, g, std::string(), np); } template bool write_PLY(const std::string& fname, const Graph& g, - typename boost::disable_if >::type* = nullptr) + typename boost::disable_if >::type* = nullptr) { return write_PLY(fname, g, std::string(), parameters::all_default()); } /// \endcond -} // namespace CGAL +} } // namespace CGAL::IO #endif // CGAL_BGL_IO_PLY_H diff --git a/BGL/include/CGAL/boost/graph/IO/STL.h b/BGL/include/CGAL/boost/graph/IO/STL.h index 78bd1fcb588..7bce5d9734b 100644 --- a/BGL/include/CGAL/boost/graph/IO/STL.h +++ b/BGL/include/CGAL/boost/graph/IO/STL.h @@ -63,7 +63,6 @@ public: }; } // namespace internal -} // namespace IO /*! \ingroup PkgBGLIoFuncsSTL @@ -113,7 +112,7 @@ bool read_STL(std::istream& is, typedef typename boost::property_traits::value_type Point; if(!is.good()) return false; - IO::internal::STL_builder builder(is); + internal::STL_builder builder(is); return builder(g, np); } @@ -173,7 +172,7 @@ bool read_STL(const std::string& fname, if(binary) { std::ifstream is(fname, std::ios::binary); - CGAL::set_mode(is, CGAL::IO::BINARY); + CGAL::IO::set_mode(is, CGAL::IO::BINARY); if(read_STL(is, g, np)) { return true; @@ -181,7 +180,7 @@ bool read_STL(const std::string& fname, g.clear(); } std::ifstream is(fname); - CGAL::set_mode(is, CGAL::IO::ASCII); + CGAL::IO::set_mode(is, CGAL::IO::ASCII); typedef typename CGAL::GetVertexPointMap::type VPM; VPM vpm = choose_parameter(get_parameter(np, internal_np::vertex_point), @@ -264,7 +263,7 @@ bool write_STL(std::ostream& os, set_stream_precision_from_NP(os, np); - if(get_mode(os) == IO::BINARY) + if(get_mode(os) == BINARY) { os << "FileType: Binary "; const boost::uint32_t N32 = static_cast(faces(g).size()); @@ -364,13 +363,13 @@ bool write_STL(const std::string& fname, const Graph& g, const CGAL_BGL_NP_CLASS if(binary) { std::ofstream os(fname, std::ios::binary); - CGAL::set_mode(os, CGAL::IO::BINARY); + CGAL::IO::set_mode(os, CGAL::IO::BINARY); return write_STL(os, g, np); } else { std::ofstream os(fname); - CGAL::set_mode(os, CGAL::IO::ASCII); + CGAL::IO::set_mode(os, CGAL::IO::ASCII); return write_STL(os, g, np); } @@ -385,6 +384,6 @@ bool write_STL(const std::string& fname, const Graph& g) { return write_STL(fnam /// \endcond -} // namespace CGAL +}} // namespace CGAL::IO #endif // CGAL_BGL_IO_STL_H diff --git a/BGL/include/CGAL/boost/graph/IO/VTK.h b/BGL/include/CGAL/boost/graph/IO/VTK.h index 894b3598b09..fa3446ad28f 100644 --- a/BGL/include/CGAL/boost/graph/IO/VTK.h +++ b/BGL/include/CGAL/boost/graph/IO/VTK.h @@ -113,7 +113,6 @@ bool vtkPointSet_to_polygon_mesh(vtkPointSet* poly_data, } } // namespace internal -} // namespace IO /*! * \ingroup PkgBGLIoFuncsVTP @@ -160,13 +159,13 @@ bool read_VTP(const std::string& fname, } test.close(); vtkSmartPointer data; - vtkSmartPointer obs = - vtkSmartPointer::New(); + vtkSmartPointer obs = + vtkSmartPointer::New(); - data = vtkPolyData::SafeDownCast(IO::internal::read_vtk_file(fname, obs)->GetOutput()); + data = vtkPolyData::SafeDownCast(internal::read_vtk_file(fname, obs)->GetOutput()); if (obs->GetError()) return false; - return IO::internal::vtkPointSet_to_polygon_mesh(data, g, np); + return internal::vtkPointSet_to_polygon_mesh(data, g, np); } /// \cond SKIP_IN_MANUAL @@ -180,7 +179,6 @@ bool read_VTP(const std::string& fname, Graph& g) { return read_VTP(fname, g, pa //////////////////////////////////////////////////////////////////////////////////////////////////// // Write -namespace IO { namespace internal { // writes the polys appended data at the end of the .vtp file @@ -381,7 +379,6 @@ void write_polys_points(std::ostream& os, } } // namespace internal -} // namespace IO /*! \ingroup PkgBGLIoFuncsVTP * @@ -465,16 +462,16 @@ bool write_VTP(std::ostream& os, std::size_t offset = 0; const bool binary = choose_parameter(get_parameter(np, internal_np::use_binary_mode), true); - IO::internal::write_points_tag(os, g, binary, offset, np); - IO::internal::write_polys_tag(os, g, binary, offset, np); + internal::write_points_tag(os, g, binary, offset, np); + internal::write_polys_tag(os, g, binary, offset, np); os << " \n" << " \n"; if(binary) { os << "\n_"; - IO::internal::write_polys_points(os, g, np); - IO::internal::write_polys(os, g, np); + internal::write_polys_points(os, g, np); + internal::write_polys(os, g, np); } os << "" << std::endl; @@ -534,7 +531,7 @@ bool write_VTP(const std::string& fname, const Graph& g, const CGAL_BGL_NP_CLASS std::ofstream os; if(binary){ os.open(fname, std::ios::binary); - CGAL::set_mode(os, CGAL::IO::BINARY); + CGAL::IO::set_mode(os, CGAL::IO::BINARY); } else os.open(fname); @@ -551,17 +548,19 @@ bool write_VTP(const std::string& fname, const Graph& g) { return write_VTP(fnam /// \endcond +} // namespace IO + #ifndef CGAL_NO_DEPRECATED_CODE /*! \ingroup PkgBGLIOFctDeprecated - \deprecated This function is deprecated since \cgal 5.2, `CGAL::write_VTP()` should be used instead. + \deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::write_VTP()` should be used instead. */ template CGAL_DEPRECATED bool write_vtp(std::ostream& os, const Graph& g, const CGAL_BGL_NP_CLASS& np) { - return write_VTP(os, g, np); + return IO::write_VTP(os, g, np); } template diff --git a/BGL/include/CGAL/boost/graph/IO/WRL.h b/BGL/include/CGAL/boost/graph/IO/WRL.h index dc8186862c7..db2c263b1ad 100644 --- a/BGL/include/CGAL/boost/graph/IO/WRL.h +++ b/BGL/include/CGAL/boost/graph/IO/WRL.h @@ -30,6 +30,8 @@ namespace CGAL { +namespace IO { + //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// // Write @@ -71,7 +73,7 @@ bool write_WRL(std::ostream& os, const CGAL_BGL_NP_CLASS& np) { CGAL::VRML_2_ostream vos(os); - IO::internal::Generic_facegraph_printer printer(vos); + internal::Generic_facegraph_printer printer(vos); return printer(g, np); } @@ -118,17 +120,19 @@ bool write_WRL(std::ostream& os, const Graph& g) { return write_WRL(os, g, param template bool write_WRL(const std::string& fname, const Graph& g) { return write_WRL(fname, g, parameters::all_default()); } +} // namespace IO + #ifndef CGAL_NO_DEPRECATED_CODE /*! \ingroup PkgBGLIOFctDeprecated - \deprecated This function is deprecated since \cgal 5.2, `CGAL::write_WRL()` should be used instead. + \deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::write_WRL()` should be used instead. */ template CGAL_DEPRECATED bool write_wrl(std::ostream& os, const Graph& g, const CGAL_BGL_NP_CLASS& np) { - return write_WRL(os, g, np); + return IO::write_WRL(os, g, np); } template 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 6fb5cdfec20..bd54d53014e 100644 --- a/BGL/include/CGAL/boost/graph/IO/polygon_mesh_io.h +++ b/BGL/include/CGAL/boost/graph/IO/polygon_mesh_io.h @@ -28,6 +28,8 @@ namespace CGAL { +namespace IO { + //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// // Read @@ -121,7 +123,7 @@ bool read_polygon_mesh(std::istream& is, * * \return `true` if reading was successful, `false` otherwise. * - * \sa \link PMP_IO_grp `CGAL::Polygon_mesh_processing::read_polygon_mesh()`\endlink if the data is not 2-manifold + * \sa \link PMP_IO_grp `CGAL::Polygon_mesh_processing::IO::read_polygon_mesh()`\endlink if the data is not 2-manifold */ template bool read_polygon_mesh(const std::string& fname, @@ -130,7 +132,7 @@ bool read_polygon_mesh(const std::string& fname, { const bool verbose = parameters::choose_parameter(parameters::get_parameter(np, internal_np::verbose), false); - const std::string ext = IO::internal::get_file_extension(fname); + const std::string ext = internal::get_file_extension(fname); if(ext == std::string()) { if(verbose) @@ -233,7 +235,7 @@ bool write_polygon_mesh(const std::string& fname, { const bool verbose = parameters::choose_parameter(parameters::get_parameter(np, internal_np::verbose), false); - const std::string ext = IO::internal::get_file_extension(fname); + const std::string ext = internal::get_file_extension(fname); if(ext == std::string()) { if(verbose) @@ -275,6 +277,6 @@ bool write_polygon_mesh(const std::string& fname, Graph& g) /// \endcond -} // namespace CGAL +}} // namespace CGAL::IO #endif // CGAL_BOOST_GRAPH_POLYGON_MESH_IO_H diff --git a/BGL/include/CGAL/boost/graph/selection.h b/BGL/include/CGAL/boost/graph/selection.h index 668bc4707e0..890c0622e68 100644 --- a/BGL/include/CGAL/boost/graph/selection.h +++ b/BGL/include/CGAL/boost/graph/selection.h @@ -1137,8 +1137,8 @@ void expand_face_selection_for_removal(const FaceRange& faces_to_be_deleted, //todo: take non-manifold vertices into account. template -bool is_selection_a_topological_disk(const FaceRange& face_selection, - PolygonMesh& pm) +int euler_characteristic_of_selection(const FaceRange& face_selection, + PolygonMesh& pm) { typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; typedef typename boost::graph_traits::face_descriptor face_descriptor; @@ -1154,8 +1154,18 @@ bool is_selection_a_topological_disk(const FaceRange& face_selection, sel_edges.insert(edge(h,pm)); } } - return (sel_vertices.size() - sel_edges.size() + face_selection.size() == 1); + return static_cast(sel_vertices.size()) + - static_cast(sel_edges.size()) + + static_cast(face_selection.size()); } + +template +bool is_selection_a_topological_disk(const FaceRange& face_selection, + PolygonMesh& pm) +{ + return euler_characteristic_of_selection(face_selection, pm) == 1; +} + } //end of namespace CGAL #endif //CGAL_BOOST_GRAPH_SELECTION_H diff --git a/BGL/include/CGAL/draw_face_graph.h b/BGL/include/CGAL/draw_face_graph.h index 0bc8531ed03..00e22278c7b 100644 --- a/BGL/include/CGAL/draw_face_graph.h +++ b/BGL/include/CGAL/draw_face_graph.h @@ -26,11 +26,11 @@ namespace CGAL struct DefaultColorFunctorFaceGraph { template - CGAL::Color operator()(const Graph&, + CGAL::IO::Color operator()(const Graph&, typename boost::graph_traits::face_descriptor fh) const { if (fh==boost::graph_traits::null_face()) // use to get the mono color - return CGAL::Color(100, 125, 200); // R G B between 0-255 + return CGAL::IO::Color(100, 125, 200); // R G B between 0-255 return get_random_color(CGAL::get_default_random()); } @@ -141,7 +141,7 @@ protected: { if (fh!=boost::graph_traits::null_face()) { - CGAL::Color c=fcolor(sm, fh); + CGAL::IO::Color c=fcolor(sm, fh); face_begin(c); auto hd=halfedge(fh, sm); const auto first_hd = hd; diff --git a/BGL/test/BGL/bench_read_from_stream_vs_add_face_and_add_faces.cpp b/BGL/test/BGL/bench_read_from_stream_vs_add_face_and_add_faces.cpp index cf084977444..bfec2a708f3 100644 --- a/BGL/test/BGL/bench_read_from_stream_vs_add_face_and_add_faces.cpp +++ b/BGL/test/BGL/bench_read_from_stream_vs_add_face_and_add_faces.cpp @@ -31,7 +31,7 @@ int main(int argc, char** argv) Mesh m; const char* filename = (argc>1) ? argv[1] : "data/genus3.off"; - CGAL::read_polygon_mesh(filename, m); + CGAL::IO::read_polygon_mesh(filename, m); std::cout << " is_valid? " << CGAL::is_valid_polygon_mesh(m) << "\n"; std::cout << "Total time: " << timer.time() << std::endl << std::endl; @@ -48,7 +48,7 @@ int main(int argc, char** argv) const char* filename = (argc>1) ? argv[1] : "data/blobby.off"; std::vector points; std::vector > faces_ids; - CGAL::read_polygon_soup(filename, points, faces_ids); + CGAL::IO::read_polygon_soup(filename, points, faces_ids); std::cout << " Read soup: " << timer.time() << std::endl; std::vector > triangles; @@ -85,7 +85,7 @@ int main(int argc, char** argv) std::vector points; std::vector > faces_ids; - CGAL::read_polygon_soup(filename, points, faces_ids); + CGAL::IO::read_polygon_soup(filename, points, faces_ids); std::cout << " Read soup: " << timer.time() << std::endl; std::vector > triangles; diff --git a/BGL/test/BGL/test_3mf_to_sm.cpp b/BGL/test/BGL/test_3mf_to_sm.cpp index 20d55a4924a..2feaa7e1061 100644 --- a/BGL/test/BGL/test_3mf_to_sm.cpp +++ b/BGL/test/BGL/test_3mf_to_sm.cpp @@ -24,7 +24,7 @@ typedef CGAL::Surface_mesh Mesh; typedef std::vector PointRange; typedef std::vector Polygon; typedef std::vector PolygonRange; -typedef std::vector ColorRange; +typedef std::vector ColorRange; int main(int argc, char** argv) { @@ -38,7 +38,7 @@ int main(int argc, char** argv) std::vector meshes; //testing reading functions. - if(!CGAL::read_3MF(filename, meshes)) + if(!CGAL::IO::read_3MF(filename, meshes)) return 1; for(std::size_t i = 0; i< meshes.size(); ++i) { @@ -86,7 +86,7 @@ int main(int argc, char** argv) triangle.push_back(vertex_id_map[vert]); } triangles.push_back(triangle); - colors.push_back(CGAL::Color(255,0,0,255)); + colors.push_back(CGAL::IO::Color(255,0,0,255)); } all_polygons.push_back(triangles); @@ -113,7 +113,7 @@ int main(int argc, char** argv) triangle.push_back(vertex_id_map[vert]); } triangles.push_back(triangle); - colors.push_back(CGAL::Color(0,0,255,255)); + colors.push_back(CGAL::IO::Color(0,0,255,255)); } all_polygons.push_back(triangles); @@ -125,7 +125,7 @@ int main(int argc, char** argv) meshes[0] = sphere; meshes[1] = tube; - CGAL::write_3MF("meshes.3mf", meshes, names); + CGAL::IO::write_3MF("meshes.3mf", meshes, names); std::cout << "OK." << std::endl; #endif //CGAL_LINKED_WITH_3MF diff --git a/BGL/test/BGL/test_Collapse_edge.cpp b/BGL/test/BGL/test_Collapse_edge.cpp index 28bb61af4b1..69f1c347a5e 100644 --- a/BGL/test/BGL/test_Collapse_edge.cpp +++ b/BGL/test/BGL/test_Collapse_edge.cpp @@ -43,7 +43,7 @@ collapse_edge_test() const std::string fname = "data/flat_hexahedron.off"; Mesh m; - if(!CGAL::read_OFF(fname, m)) + if(!CGAL::IO::read_OFF(fname, m)) std::cout << "Error reading file: " << fname << std::endl; bool m_is_valid = CGAL::is_valid(m); diff --git a/BGL/test/BGL/test_Euler_operations.cpp b/BGL/test/BGL/test_Euler_operations.cpp index 21b8809897d..8d2f9df3b5c 100644 --- a/BGL/test/BGL/test_Euler_operations.cpp +++ b/BGL/test/BGL/test_Euler_operations.cpp @@ -540,7 +540,7 @@ add_faces() std::ifstream in("data/head.off"); std::vector points; std::vector > faces_ids; - CGAL::read_OFF(in, points, faces_ids); + CGAL::IO::read_OFF(in, points, faces_ids); std::vector verts; verts.reserve(points.size()); @@ -561,7 +561,7 @@ add_faces() { std::ifstream in("data/open_cube.off"); T m; - CGAL::read_OFF(in, m); + CGAL::IO::read_OFF(in, m); std::vector verts(vertices(m).begin(), vertices(m).end()); std::list< std::vector > new_faces; new_faces.push_back({verts[1], verts[7], verts[4]}); @@ -574,7 +574,7 @@ add_faces() { std::ifstream in("data/open_cube.off"); T m; - CGAL::read_OFF(in, m); + CGAL::IO::read_OFF(in, m); std::vector verts(vertices(m).begin(), vertices(m).end()); verts.push_back(add_vertex(m)); put(CGAL::vertex_point, m, verts.back(), Kernel::Point_3(50,0,50)); diff --git a/BGL/test/BGL/test_Prefix.h b/BGL/test/BGL/test_Prefix.h index be2f523aaec..10851e57cce 100644 --- a/BGL/test/BGL/test_Prefix.h +++ b/BGL/test/BGL/test_Prefix.h @@ -160,7 +160,7 @@ bool read_a_mesh(OMesh& s, const std::string& str) { template bool read_a_mesh(T& m, const std::string& str) { - return CGAL::read_OFF(str, m); + return CGAL::IO::read_OFF(str, m); } bool read_a_mesh(Polyhedron& p, const std::string& str) diff --git a/BGL/test/BGL/test_bgl_read_write.cpp b/BGL/test/BGL/test_bgl_read_write.cpp index 5be2d9e33e9..0f2ccc5cc1f 100644 --- a/BGL/test/BGL/test_bgl_read_write.cpp +++ b/BGL/test/BGL/test_bgl_read_write.cpp @@ -118,35 +118,35 @@ void test_bgl_OFF(const char* filename) // read with OFF Mesh fg; std::ifstream is(filename); - bool ok = CGAL::read_OFF(is, fg); + bool ok = CGAL::IO::read_OFF(is, fg); assert(ok); assert(num_vertices(fg) != 0 && num_faces(fg) != 0); is.close(); fg.clear(); is.open(filename, std::ios::binary); - ok = CGAL::read_OFF(is, fg); + ok = CGAL::IO::read_OFF(is, fg); assert(ok); assert(num_vertices(fg) != 0 && num_faces(fg) != 0); // write with OFF { std::ofstream os("tmp.off"); - ok = CGAL::write_OFF(os, fg); + ok = CGAL::IO::write_OFF(os, fg); assert(ok); Mesh fg2; - ok = CGAL::read_OFF("tmp.off", fg2); + ok = CGAL::IO::read_OFF("tmp.off", fg2); assert(ok); assert(are_equal_meshes(fg, fg2)); } // write with PM { - ok = CGAL::write_polygon_mesh("tmp.obj.off", fg); + ok = CGAL::IO::write_polygon_mesh("tmp.obj.off", fg); assert(ok); Mesh fg2; - ok = CGAL::read_polygon_mesh("tmp.obj.off", fg2); + ok = CGAL::IO::read_polygon_mesh("tmp.obj.off", fg2); assert(ok); assert(are_equal_meshes(fg, fg2)); } @@ -156,63 +156,63 @@ void test_bgl_OFF(const char* filename) typedef typename K::Point_2 Point_2; typedef typename K::Vector_3 Vector; typedef typename boost::property_map >::type VertexNormalMap; - typedef typename boost::property_map >::type VertexColorMap; + typedef typename boost::property_map >::type VertexColorMap; typedef typename boost::property_map >::type VertexTextureMap; - typedef typename boost::property_map >::type FaceColorMap; + typedef typename boost::property_map >::type FaceColorMap; // COFF { CGAL::clear(fg); - VertexColorMap vcm = get(CGAL::dynamic_vertex_property_t(), fg); - FaceColorMap fcm = get(CGAL::dynamic_face_property_t(), fg); + VertexColorMap vcm = get(CGAL::dynamic_vertex_property_t(), fg); + FaceColorMap fcm = get(CGAL::dynamic_face_property_t(), fg); - ok = CGAL::read_OFF("data/mesh_with_colors.off", fg, CGAL::parameters::vertex_color_map(vcm) - .face_color_map(fcm)); + ok = CGAL::IO::read_OFF("data/mesh_with_colors.off", fg, CGAL::parameters::vertex_color_map(vcm) + .face_color_map(fcm)); assert(ok); assert(num_vertices(fg) == 8 && num_faces(fg) == 4); for(auto v : vertices(fg)) - assert(get(vcm, v) != CGAL::Color()); + assert(get(vcm, v) != CGAL::IO::Color()); for(auto f : faces(fg)) - assert(get(fcm, f) != CGAL::Color()); + assert(get(fcm, f) != CGAL::IO::Color()); // write with OFF { - ok = CGAL::write_OFF("tmp.off", fg, CGAL::parameters::vertex_color_map(vcm) - .face_color_map(fcm)); + ok = CGAL::IO::write_OFF("tmp.off", fg, CGAL::parameters::vertex_color_map(vcm) + .face_color_map(fcm)); assert(ok); Mesh fg2; - VertexColorMap vcm2 = get(CGAL::dynamic_vertex_property_t(), fg2); - FaceColorMap fcm2 = get(CGAL::dynamic_face_property_t(), fg2); + VertexColorMap vcm2 = get(CGAL::dynamic_vertex_property_t(), fg2); + FaceColorMap fcm2 = get(CGAL::dynamic_face_property_t(), fg2); - ok = CGAL::read_polygon_mesh("tmp.off", fg2, CGAL::parameters::vertex_color_map(vcm2) - .face_color_map(fcm2)); + ok = CGAL::IO::read_polygon_mesh("tmp.off", fg2, CGAL::parameters::vertex_color_map(vcm2) + .face_color_map(fcm2)); assert(ok); assert(are_equal_meshes(fg, fg2)); for(auto v : vertices(fg2)) - assert(get(vcm2, v) != CGAL::Color()); + assert(get(vcm2, v) != CGAL::IO::Color()); for(auto f : faces(fg2)) - assert(get(fcm2, f) != CGAL::Color()); + assert(get(fcm2, f) != CGAL::IO::Color()); } // write with PM { - ok = CGAL::write_polygon_mesh("tmp.off", fg, CGAL::parameters::vertex_color_map(vcm)); + ok = CGAL::IO::write_polygon_mesh("tmp.off", fg, CGAL::parameters::vertex_color_map(vcm)); assert(ok); Mesh fg2; - VertexColorMap vcm2 = get(CGAL::dynamic_vertex_property_t(), fg2); + VertexColorMap vcm2 = get(CGAL::dynamic_vertex_property_t(), fg2); - ok = CGAL::read_polygon_mesh("tmp.off", fg2, CGAL::parameters::vertex_color_map(vcm2)); + ok = CGAL::IO::read_polygon_mesh("tmp.off", fg2, CGAL::parameters::vertex_color_map(vcm2)); assert(ok); assert(are_equal_meshes(fg, fg2)); for(auto v : vertices(fg2)) - assert(get(vcm2, v) != CGAL::Color()); + assert(get(vcm2, v) != CGAL::IO::Color()); } } @@ -221,7 +221,7 @@ void test_bgl_OFF(const char* filename) CGAL::clear(fg); VertexNormalMap vnm = get(CGAL::dynamic_vertex_property_t(), fg); - ok = CGAL::read_OFF("data/mesh_with_normals.off", fg, CGAL::parameters::vertex_normal_map(vnm)); + ok = CGAL::IO::read_OFF("data/mesh_with_normals.off", fg, CGAL::parameters::vertex_normal_map(vnm)); assert(ok); for(auto v : vertices(fg)) @@ -230,13 +230,13 @@ void test_bgl_OFF(const char* filename) // write with OFF { std::ofstream os("tmp.off"); - ok = CGAL::write_OFF("tmp.off", fg, CGAL::parameters::vertex_normal_map(vnm)); + ok = CGAL::IO::write_OFF("tmp.off", fg, CGAL::parameters::vertex_normal_map(vnm)); assert(ok); Mesh fg2; VertexNormalMap vnm2 = get(CGAL::dynamic_vertex_property_t(), fg2); - ok = CGAL::read_polygon_mesh("tmp.off", fg2, CGAL::parameters::vertex_normal_map(vnm2)); + ok = CGAL::IO::read_polygon_mesh("tmp.off", fg2, CGAL::parameters::vertex_normal_map(vnm2)); assert(ok); assert(are_equal_meshes(fg, fg2)); @@ -246,13 +246,13 @@ void test_bgl_OFF(const char* filename) // write with PM { - ok = CGAL::write_polygon_mesh("tmp.off", fg, CGAL::parameters::vertex_normal_map(vnm)); + ok = CGAL::IO::write_polygon_mesh("tmp.off", fg, CGAL::parameters::vertex_normal_map(vnm)); assert(ok); Mesh fg2; VertexNormalMap vnm2 = get(CGAL::dynamic_vertex_property_t(), fg2); - ok = CGAL::read_polygon_mesh("tmp.off", fg2, CGAL::parameters::vertex_normal_map(vnm2)); + ok = CGAL::IO::read_polygon_mesh("tmp.off", fg2, CGAL::parameters::vertex_normal_map(vnm2)); assert(ok); assert(are_equal_meshes(fg, fg2)); @@ -267,121 +267,121 @@ void test_bgl_OFF(const char* filename) std::ifstream is("data/full.off", std::ios::binary); VertexNormalMap vnm2 = get(CGAL::dynamic_vertex_property_t(), fg); - VertexColorMap vcm2 = get(CGAL::dynamic_vertex_property_t(), fg); + VertexColorMap vcm2 = get(CGAL::dynamic_vertex_property_t(), fg); VertexTextureMap vtm2 = get(CGAL::dynamic_vertex_property_t(), fg); - FaceColorMap fcm2 = get(CGAL::dynamic_face_property_t(), fg); + FaceColorMap fcm2 = get(CGAL::dynamic_face_property_t(), fg); - ok = CGAL::read_OFF(is, fg, CGAL::parameters::vertex_normal_map(vnm2) - .vertex_color_map(vcm2) - .vertex_texture_map(vtm2) - .face_color_map(fcm2)); + ok = CGAL::IO::read_OFF(is, fg, CGAL::parameters::vertex_normal_map(vnm2) + .vertex_color_map(vcm2) + .vertex_texture_map(vtm2) + .face_color_map(fcm2)); assert(ok); assert(num_vertices(fg) != 0 && num_faces(fg) != 0); for(auto v : vertices(fg)) { assert(get(vnm2, v) != CGAL::NULL_VECTOR); - assert(get(vcm2, v) != CGAL::Color()); + assert(get(vcm2, v) != CGAL::IO::Color()); } for(auto f : faces(fg)) - assert(get(fcm2, f) != CGAL::Color()); + assert(get(fcm2, f) != CGAL::IO::Color()); fg.clear(); is.close(); is.open("data/full.off"); VertexNormalMap vnm = get(CGAL::dynamic_vertex_property_t(), fg); - VertexColorMap vcm = get(CGAL::dynamic_vertex_property_t(), fg); + VertexColorMap vcm = get(CGAL::dynamic_vertex_property_t(), fg); VertexTextureMap vtm = get(CGAL::dynamic_vertex_property_t(), fg); - FaceColorMap fcm = get(CGAL::dynamic_face_property_t(), fg); - ok = CGAL::read_OFF(is, fg, CGAL::parameters::vertex_normal_map(vnm) - .vertex_color_map(vcm) - .vertex_texture_map(vtm) - .face_color_map(fcm)); + FaceColorMap fcm = get(CGAL::dynamic_face_property_t(), fg); + ok = CGAL::IO::read_OFF(is, fg, CGAL::parameters::vertex_normal_map(vnm) + .vertex_color_map(vcm) + .vertex_texture_map(vtm) + .face_color_map(fcm)); assert(ok); assert(num_vertices(fg) != 0 && num_faces(fg) != 0); for(auto v : vertices(fg)) { assert(get(vnm, v) != CGAL::NULL_VECTOR); - assert(get(vcm, v) != CGAL::Color()); + assert(get(vcm, v) != CGAL::IO::Color()); } // write with OFF { std::ofstream os("tmp.off"); - ok = CGAL::write_OFF("tmp.off", fg, CGAL::parameters::vertex_normal_map(vnm) - .vertex_color_map(vcm) - .vertex_texture_map(vtm) - .face_color_map(fcm)); + ok = CGAL::IO::write_OFF("tmp.off", fg, CGAL::parameters::vertex_normal_map(vnm) + .vertex_color_map(vcm) + .vertex_texture_map(vtm) + .face_color_map(fcm)); assert(ok); Mesh fg2; VertexNormalMap vnm2 = get(CGAL::dynamic_vertex_property_t(), fg2); - VertexColorMap vcm2 = get(CGAL::dynamic_vertex_property_t(), fg2); + VertexColorMap vcm2 = get(CGAL::dynamic_vertex_property_t(), fg2); VertexTextureMap vtm2 = get(CGAL::dynamic_vertex_property_t(), fg2); - FaceColorMap fcm2 = get(CGAL::dynamic_face_property_t(), fg2); + FaceColorMap fcm2 = get(CGAL::dynamic_face_property_t(), fg2); - ok = CGAL::read_polygon_mesh("tmp.off", fg2, CGAL::parameters::vertex_normal_map(vnm2) - .vertex_color_map(vcm2) - .vertex_texture_map(vtm2) - .face_color_map(fcm2)); + ok = CGAL::IO::read_polygon_mesh("tmp.off", fg2, CGAL::parameters::vertex_normal_map(vnm2) + .vertex_color_map(vcm2) + .vertex_texture_map(vtm2) + .face_color_map(fcm2)); assert(ok); assert(are_equal_meshes(fg, fg2)); for(auto v : vertices(fg2)) { assert(get(vnm2, v) != CGAL::NULL_VECTOR); - assert(get(vcm2, v) != CGAL::Color()); + assert(get(vcm2, v) != CGAL::IO::Color()); } for(auto f : faces(fg2)) - assert(get(fcm2, f) != CGAL::Color()); + assert(get(fcm2, f) != CGAL::IO::Color()); } // write with PM { - ok = CGAL::write_polygon_mesh("tmp.off", fg, CGAL::parameters::vertex_normal_map(vnm) - .vertex_color_map(vcm) - .vertex_texture_map(vtm) - .face_color_map(fcm)); + ok = CGAL::IO::write_polygon_mesh("tmp.off", fg, CGAL::parameters::vertex_normal_map(vnm) + .vertex_color_map(vcm) + .vertex_texture_map(vtm) + .face_color_map(fcm)); assert(ok); Mesh fg2; VertexNormalMap vnm2 = get(CGAL::dynamic_vertex_property_t(), fg2); - VertexColorMap vcm2 = get(CGAL::dynamic_vertex_property_t(), fg2); + VertexColorMap vcm2 = get(CGAL::dynamic_vertex_property_t(), fg2); VertexTextureMap vtm2 = get(CGAL::dynamic_vertex_property_t(), fg2); - FaceColorMap fcm2 = get(CGAL::dynamic_face_property_t(), fg2); + FaceColorMap fcm2 = get(CGAL::dynamic_face_property_t(), fg2); - ok = CGAL::read_polygon_mesh("tmp.off", fg2, CGAL::parameters::vertex_normal_map(vnm2) - .vertex_color_map(vcm2) - .vertex_texture_map(vtm2) - .face_color_map(fcm2)); + ok = CGAL::IO::read_polygon_mesh("tmp.off", fg2, CGAL::parameters::vertex_normal_map(vnm2) + .vertex_color_map(vcm2) + .vertex_texture_map(vtm2) + .face_color_map(fcm2)); assert(ok); assert(are_equal_meshes(fg, fg2)); for(auto v : vertices(fg2)) { assert(get(vnm2, v) != CGAL::NULL_VECTOR); - assert(get(vcm2, v) != CGAL::Color()); + assert(get(vcm2, v) != CGAL::IO::Color()); } for(auto f : faces(fg2)) - assert(get(fcm2, f) != CGAL::Color()); + assert(get(fcm2, f) != CGAL::IO::Color()); } } //@todo test multi objects in a single file // test wrong inputs std::cerr << " ########### Error text is expected to follow." << std::endl; - ok = CGAL::read_OFF("data/mesh_that_doesnt_exist.off", fg); + ok = CGAL::IO::read_OFF("data/mesh_that_doesnt_exist.off", fg); assert(!ok); - ok = CGAL::read_OFF("data/invalid_cut.off", fg); // cut in half + ok = CGAL::IO::read_OFF("data/invalid_cut.off", fg); // cut in half assert(!ok); - ok = CGAL::read_OFF("data/invalid_nv.off", fg); // wrong number of points + ok = CGAL::IO::read_OFF("data/invalid_nv.off", fg); // wrong number of points assert(!ok); - ok = CGAL::read_OFF("data/sphere.obj", fg); + ok = CGAL::IO::read_OFF("data/sphere.obj", fg); assert(!ok); - ok = CGAL::read_OFF("data/pig.stl", fg); + ok = CGAL::IO::read_OFF("data/pig.stl", fg); assert(!ok); std::cerr << " ########### No more error text from here." << std::endl; } @@ -394,72 +394,72 @@ void test_bgl_OBJ(const std::string filename) Mesh fg; std::ifstream is(filename); - bool ok = CGAL::read_OBJ(is, fg, CGAL::parameters::verbose(true)); + bool ok = CGAL::IO::read_OBJ(is, fg, CGAL::parameters::verbose(true)); assert(ok); assert(filename != "data/sphere.obj" || (num_vertices(fg) == 272 && num_faces(fg) == 540)); // write with OBJ { std::ofstream os("tmp.obj"); - ok = CGAL::write_OBJ(os, fg); + ok = CGAL::IO::write_OBJ(os, fg); assert(ok); Mesh fg2; - ok = CGAL::read_OBJ("tmp.obj", fg2); + ok = CGAL::IO::read_OBJ("tmp.obj", fg2); assert(ok); assert(are_equal_meshes(fg, fg2)); } // write with PM { - ok = CGAL::write_polygon_mesh("tmp.obj", fg); + ok = CGAL::IO::write_polygon_mesh("tmp.obj", fg); assert(ok); Mesh fg2; - ok = CGAL::read_polygon_mesh("tmp.obj", fg2); + ok = CGAL::IO::read_polygon_mesh("tmp.obj", fg2); assert(ok); assert(are_equal_meshes(fg, fg2)); } // Test NPs CGAL::clear(fg); - ok = CGAL::read_OBJ("data/sphere.obj", fg); + ok = CGAL::IO::read_OBJ("data/sphere.obj", fg); assert(ok); assert(num_vertices(fg) == 272 && num_faces(fg) == 540); // write with OBJ { std::ofstream os("tmp.obj"); - ok = CGAL::write_OBJ("tmp.obj", fg); + ok = CGAL::IO::write_OBJ("tmp.obj", fg); assert(ok); Mesh fg2; - ok = CGAL::read_polygon_mesh("tmp.obj", fg2); + ok = CGAL::IO::read_polygon_mesh("tmp.obj", fg2); assert(ok); assert(are_equal_meshes(fg, fg2)); } // write with PM { - ok = CGAL::write_polygon_mesh("tmp.obj", fg); + ok = CGAL::IO::write_polygon_mesh("tmp.obj", fg); assert(ok); Mesh fg2; - ok = CGAL::read_polygon_mesh("tmp.obj", fg2); + ok = CGAL::IO::read_polygon_mesh("tmp.obj", fg2); assert(ok); assert(are_equal_meshes(fg, fg2)); } // test wrong inputs std::cerr << " ########### Error text is expected to follow." << std::endl; - ok = CGAL::read_OBJ("data/mesh_that_doesnt_exist.obj", fg); + ok = CGAL::IO::read_OBJ("data/mesh_that_doesnt_exist.obj", fg); assert(!ok); - ok = CGAL::read_OBJ("data/invalid_cut.obj", fg); // invalid vertex ids + ok = CGAL::IO::read_OBJ("data/invalid_cut.obj", fg); // invalid vertex ids assert(!ok); - ok = CGAL::read_OBJ("data/genus3.off", fg); // wrong extension + ok = CGAL::IO::read_OBJ("data/genus3.off", fg); // wrong extension assert(!ok); - ok = CGAL::read_OBJ("data/pig.stl", fg); + ok = CGAL::IO::read_OBJ("data/pig.stl", fg); assert(!ok); std::cerr << " ########### No more error text from here." << std::endl; } @@ -472,7 +472,7 @@ void test_bgl_PLY(const std::string filename, Mesh fg; std::ifstream is(filename); - bool ok = CGAL::read_PLY(is, fg, CGAL::parameters::use_binary_mode(false)); + bool ok = CGAL::IO::read_PLY(is, fg, CGAL::parameters::use_binary_mode(false)); is.close(); assert(ok); assert(filename != "data/colored_tetra.ply" || (num_vertices(fg) == 4 && num_faces(fg) == 4)); @@ -480,7 +480,7 @@ void test_bgl_PLY(const std::string filename, { fg.clear(); is.open(filename, std::ios::binary); - bool ok = CGAL::read_PLY(is, fg, CGAL::parameters::use_binary_mode(false)); + bool ok = CGAL::IO::read_PLY(is, fg, CGAL::parameters::use_binary_mode(false)); is.close(); assert(ok); assert(filename != "data/colored_tetra.ply" || (num_vertices(fg) == 4 && num_faces(fg) == 4)); @@ -492,120 +492,120 @@ void test_bgl_PLY(const std::string filename, if(binary) { os.open("tmp.ply", std::ios::binary); - CGAL::set_mode(os, CGAL::IO::BINARY); + CGAL::IO::set_mode(os, CGAL::IO::BINARY); } else { os.open("tmp.ply"); } - ok = CGAL::write_PLY(os, fg); + ok = CGAL::IO::write_PLY(os, fg); assert(ok); - ok = CGAL::write_PLY(os, fg, "test"); + ok = CGAL::IO::write_PLY(os, fg, "test"); assert(ok); Mesh fg2; - ok = CGAL::read_PLY("tmp.ply", fg2); + ok = CGAL::IO::read_PLY("tmp.ply", fg2); assert(ok); assert(are_equal_meshes(fg, fg2)); } // test NPs - typedef typename boost::property_map >::type VertexColorMap; - typedef typename boost::property_map >::type FaceColorMap; + typedef typename boost::property_map >::type VertexColorMap; + typedef typename boost::property_map >::type FaceColorMap; CGAL::clear(fg); - VertexColorMap vcm = get(CGAL::dynamic_vertex_property_t(), fg); - FaceColorMap fcm = get(CGAL::dynamic_face_property_t(), fg); + VertexColorMap vcm = get(CGAL::dynamic_vertex_property_t(), fg); + FaceColorMap fcm = get(CGAL::dynamic_face_property_t(), fg); std::ifstream is_c("data/colored_tetra.ply"); // ASCII - ok = CGAL::read_PLY(is_c, fg, CGAL::parameters::vertex_color_map(vcm) - .face_color_map(fcm)); + ok = CGAL::IO::read_PLY(is_c, fg, CGAL::parameters::vertex_color_map(vcm) + .face_color_map(fcm)); assert(ok); assert(num_vertices(fg) == 4 && num_faces(fg) == 4); for(auto v : vertices(fg)) { - assert(get(vcm, v) != CGAL::Color()); + assert(get(vcm, v) != CGAL::IO::Color()); } for(auto f : faces(fg)) - assert(get(fcm, f) != CGAL::Color()); + assert(get(fcm, f) != CGAL::IO::Color()); // write with PLY { - ok = CGAL::write_PLY("tmp.ply", fg, CGAL::parameters::vertex_color_map(vcm) - .face_color_map(fcm) - .use_binary_mode(binary)); + ok = CGAL::IO::write_PLY("tmp.ply", fg, CGAL::parameters::vertex_color_map(vcm) + .face_color_map(fcm) + .use_binary_mode(binary)); assert(ok); Mesh fg2; - VertexColorMap vcm2 = get(CGAL::dynamic_vertex_property_t(), fg2); - FaceColorMap fcm2 = get(CGAL::dynamic_face_property_t(), fg2); + VertexColorMap vcm2 = get(CGAL::dynamic_vertex_property_t(), fg2); + FaceColorMap fcm2 = get(CGAL::dynamic_face_property_t(), fg2); std::ifstream is_rpm; if(binary) { is_rpm.open("tmp.ply", std::ios::binary); - CGAL::set_mode(is_rpm, CGAL::IO::BINARY); + CGAL::IO::set_mode(is_rpm, CGAL::IO::BINARY); } else { is_rpm.open("tmp.ply"); } - ok = CGAL::read_PLY(is_rpm, fg2, CGAL::parameters::vertex_color_map(vcm2) - .face_color_map(fcm2)); + ok = CGAL::IO::read_PLY(is_rpm, fg2, CGAL::parameters::vertex_color_map(vcm2) + .face_color_map(fcm2)); assert(ok); assert(are_equal_meshes(fg, fg2)); // @tmp // for(auto v : vertices(fg2)) -// assert(get(vcm2, v) != CGAL::Color()); +// assert(get(vcm2, v) != CGAL::IO::Color()); // for(auto f : faces(fg2)) -// assert(get(fcm2, f) != CGAL::Color()); +// assert(get(fcm2, f) != CGAL::IO::Color()); } // write with PM { - ok = CGAL::write_polygon_mesh("tmp.ply", fg, CGAL::parameters::vertex_color_map(vcm) - .face_color_map(fcm) - .use_binary_mode(binary)); + ok = CGAL::IO::write_polygon_mesh("tmp.ply", fg, CGAL::parameters::vertex_color_map(vcm) + .face_color_map(fcm) + .use_binary_mode(binary)); assert(ok); Mesh fg2; - VertexColorMap vcm2 = get(CGAL::dynamic_vertex_property_t(), fg2); - FaceColorMap fcm2 = get(CGAL::dynamic_face_property_t(), fg2); + VertexColorMap vcm2 = get(CGAL::dynamic_vertex_property_t(), fg2); + FaceColorMap fcm2 = get(CGAL::dynamic_face_property_t(), fg2); - ok = CGAL::read_polygon_mesh("tmp.ply", fg2, CGAL::parameters::vertex_color_map(vcm2) - .face_color_map(fcm2) - .use_binary_mode(binary)); + ok = CGAL::IO::read_polygon_mesh("tmp.ply", fg2, CGAL::parameters::vertex_color_map(vcm2) + .face_color_map(fcm2) + .use_binary_mode(binary)); assert(ok); assert(are_equal_meshes(fg, fg2)); // @tmp // for(auto v : vertices(fg2)) -// assert(get(vcm2, v) != CGAL::Color()); +// assert(get(vcm2, v) != CGAL::IO::Color()); // for(auto f : faces(fg2)) -// assert(get(fcm2, f) != CGAL::Color()); +// assert(get(fcm2, f) != CGAL::IO::Color()); } // test wrong inputs std::cerr << " ########### Error text is expected to follow." << std::endl; - ok = CGAL::read_PLY("data/mesh_that_doesnt_exist.ply", fg); + ok = CGAL::IO::read_PLY("data/mesh_that_doesnt_exist.ply", fg); assert(!ok); - ok = CGAL::read_PLY("data/invalid_cut.ply", fg); // cut in half + ok = CGAL::IO::read_PLY("data/invalid_cut.ply", fg); // cut in half assert(!ok); - ok = CGAL::read_PLY("data/invalid_nv.ply", fg); // broken formatting + ok = CGAL::IO::read_PLY("data/invalid_nv.ply", fg); // broken formatting assert(!ok); - ok = CGAL::read_PLY("data/binary_cut.ply", fg); // broken binary + ok = CGAL::IO::read_PLY("data/binary_cut.ply", fg); // broken binary assert(!ok); - ok = CGAL::read_PLY("data/cube.off", fg); + ok = CGAL::IO::read_PLY("data/cube.off", fg); assert(!ok); - ok = CGAL::read_PLY("data/pig.stl", fg); + ok = CGAL::IO::read_PLY("data/pig.stl", fg); assert(!ok); std::cerr << " ########### No more error text from here." << std::endl; } @@ -635,18 +635,18 @@ void test_bgl_STL(const std::string filename) { Mesh fg; - bool ok = CGAL::read_STL(filename, fg); + bool ok = CGAL::IO::read_STL(filename, fg); assert(ok); - ok = CGAL::write_STL("tmp.stl", fg); + ok = CGAL::IO::write_STL("tmp.stl", fg); assert(ok); // write with ASCII in binary mode { - ok = CGAL::write_polygon_mesh("ascii.stl", fg, CGAL::parameters::use_binary_mode(false)); + ok = CGAL::IO::write_polygon_mesh("ascii.stl", fg, CGAL::parameters::use_binary_mode(false)); assert(ok); std::ifstream test_ascii("ascii.stl", std::ios::binary); Mesh fg2; - ok = CGAL::read_STL(test_ascii, fg2, CGAL::parameters::use_binary_mode(false)); + ok = CGAL::IO::read_STL(test_ascii, fg2, CGAL::parameters::use_binary_mode(false)); test_ascii.close(); assert(ok); assert(num_vertices(fg) == num_vertices(fg2) && num_faces(fg) == num_faces(fg2)); @@ -658,8 +658,8 @@ void test_bgl_STL(const std::string filename) Custom_VPM cvpm(cpoints); std::ifstream is(filename, std::ios::binary); - CGAL::set_mode(is, CGAL::IO::BINARY); - ok = CGAL::read_STL(is, fg, CGAL::parameters::vertex_point_map(cvpm)); + CGAL::IO::set_mode(is, CGAL::IO::BINARY); + ok = CGAL::IO::read_STL(is, fg, CGAL::parameters::vertex_point_map(cvpm)); assert(ok); assert(filename != "data/pig.stl" || (num_vertices(fg) == 8642 && num_faces(fg) == 16848)); assert(filename != "data/pig.stl" || cpoints.size() == 8642); @@ -667,36 +667,36 @@ void test_bgl_STL(const std::string filename) // write with STL { std::ofstream os("tmp.stl"); - ok = CGAL::write_STL(os, fg, CGAL::parameters::vertex_point_map(cvpm)); + ok = CGAL::IO::write_STL(os, fg, CGAL::parameters::vertex_point_map(cvpm)); assert(ok); Mesh fg2; - ok = CGAL::read_STL("tmp.stl", fg2, CGAL::parameters::vertex_point_map(cvpm)); + ok = CGAL::IO::read_STL("tmp.stl", fg2, CGAL::parameters::vertex_point_map(cvpm)); assert(ok); assert(num_vertices(fg) == num_vertices(fg2) && num_faces(fg) == num_faces(fg2)); } // write with PM { - ok = CGAL::write_polygon_mesh("tmp.stl", fg, CGAL::parameters::vertex_point_map(cvpm)); + ok = CGAL::IO::write_polygon_mesh("tmp.stl", fg, CGAL::parameters::vertex_point_map(cvpm)); assert(ok); cpoints.clear(); Mesh fg2; - ok = CGAL::read_polygon_mesh("tmp.stl", fg2, CGAL::parameters::vertex_point_map(cvpm)); + ok = CGAL::IO::read_polygon_mesh("tmp.stl", fg2, CGAL::parameters::vertex_point_map(cvpm)); assert(ok); assert(num_vertices(fg) == num_vertices(fg2) && num_faces(fg) == num_faces(fg2)); } std::cerr << " ########### Error text is expected to follow." << std::endl; - ok = CGAL::read_STL("data/mesh_that_doesnt_exist.stl", fg); + ok = CGAL::IO::read_STL("data/mesh_that_doesnt_exist.stl", fg); assert(!ok); - ok = CGAL::read_STL("data/invalid_cut.stl", fg); // cut in half + ok = CGAL::IO::read_STL("data/invalid_cut.stl", fg); // cut in half assert(!ok); - ok = CGAL::read_STL("data/invalid_header.stl", fg); // missing solid + ok = CGAL::IO::read_STL("data/invalid_header.stl", fg); // missing solid assert(!ok); - ok = CGAL::read_STL("data/sphere.obj", fg); + ok = CGAL::IO::read_STL("data/sphere.obj", fg); assert(!ok); - ok = CGAL::read_STL("data/full.off", fg); + ok = CGAL::IO::read_STL("data/full.off", fg); assert(!ok); std::cerr << " ########### No more error text from here." << std::endl; } @@ -706,7 +706,7 @@ void test_bgl_GOCAD(const char* filename) { Mesh fg; std::ifstream is(filename); - bool ok = CGAL::read_GOCAD(is, fg); + bool ok = CGAL::IO::read_GOCAD(is, fg); assert(ok); assert(num_vertices(fg) != 0 && num_faces(fg) != 0); @@ -714,19 +714,19 @@ void test_bgl_GOCAD(const char* filename) fg.clear(); CGAL::clear(fg); std::pair name_and_color; - ok = CGAL::read_GOCAD(is, name_and_color, fg); + ok = CGAL::IO::read_GOCAD(is, name_and_color, fg); assert(ok); assert(num_vertices(fg) != 0 && num_faces(fg) != 0); // write with GOCAD { std::ofstream os("tmp.ts"); - bool ok = CGAL::write_GOCAD(os, "tetrahedron", fg); + bool ok = CGAL::IO::write_GOCAD(os, "tetrahedron", fg); assert(ok); Mesh fg2; std::pair cnn; - ok = CGAL::read_GOCAD("tmp.ts", cnn, fg2); + ok = CGAL::IO::read_GOCAD("tmp.ts", cnn, fg2); assert(ok); assert(are_equal_meshes(fg, fg2)); assert(cnn.first == "tetrahedron"); @@ -734,11 +734,11 @@ void test_bgl_GOCAD(const char* filename) // write with PM { - ok = CGAL::write_polygon_mesh("tmp.ts", fg, CGAL::parameters::stream_precision(10)); + ok = CGAL::IO::write_polygon_mesh("tmp.ts", fg, CGAL::parameters::stream_precision(10)); assert(ok); Mesh fg2; - ok = CGAL::read_polygon_mesh("tmp.ts", fg2); + ok = CGAL::IO::read_polygon_mesh("tmp.ts", fg2); assert(ok); assert(are_equal_meshes(fg, fg2)); } @@ -749,7 +749,7 @@ void test_bgl_GOCAD(const char* filename) VertexPointMap vpm = get(CGAL::vertex_point, fg); std::ostringstream out; - ok = CGAL::write_GOCAD(out, "tetrahedron", fg, CGAL::parameters::vertex_point_map(vpm)); + ok = CGAL::IO::write_GOCAD(out, "tetrahedron", fg, CGAL::parameters::vertex_point_map(vpm)); assert(ok); { @@ -757,7 +757,7 @@ void test_bgl_GOCAD(const char* filename) VertexPointMap vpm2 = get(CGAL::vertex_point, fg2); std::istringstream is(out.str()); std::pair cnn; - ok = CGAL::read_GOCAD(is, cnn, fg2, CGAL::parameters::vertex_point_map(vpm2)); + ok = CGAL::IO::read_GOCAD(is, cnn, fg2, CGAL::parameters::vertex_point_map(vpm2)); assert(ok); assert(cnn.second.empty()); assert(num_vertices(fg2) == 12491); @@ -765,15 +765,15 @@ void test_bgl_GOCAD(const char* filename) } std::cerr << " ########### Error text is expected to follow." << std::endl; - ok = CGAL::read_GOCAD("data/mesh_that_doesnt_exist.ts", fg); + ok = CGAL::IO::read_GOCAD("data/mesh_that_doesnt_exist.ts", fg); assert(!ok); - ok = CGAL::read_GOCAD("data/invalid_cut.ts", fg); // cut in half + ok = CGAL::IO::read_GOCAD("data/invalid_cut.ts", fg); // cut in half assert(!ok); - ok = CGAL::read_GOCAD("data/invalid_header.ts", fg); // missing header + ok = CGAL::IO::read_GOCAD("data/invalid_header.ts", fg); // missing header assert(!ok); - ok = CGAL::read_GOCAD("data/sphere.obj", fg); + ok = CGAL::IO::read_GOCAD("data/sphere.obj", fg); assert(!ok); - ok = CGAL::read_GOCAD("data/full.off", fg); + ok = CGAL::IO::read_GOCAD("data/full.off", fg); assert(!ok); std::cerr << " ########### No more error text from here." << std::endl; } @@ -785,7 +785,7 @@ void test_bgl_VTP(const char* filename, const bool binary = false) { Mesh fg; - bool ok = CGAL::read_VTP(filename, fg); + bool ok = CGAL::IO::read_VTP(filename, fg); assert(ok); assert(std::string(filename) != "data/bones.vtp" || (num_vertices(fg) == 2154 && num_faces(fg) == 4204)); @@ -795,15 +795,15 @@ void test_bgl_VTP(const char* filename, std::ofstream os; if(binary){ os.open("tmp.vtp", std::ios::binary); - CGAL::set_mode(os, CGAL::IO::BINARY); + CGAL::IO::set_mode(os, CGAL::IO::BINARY); } else os.open("tmp.vtp"); - ok = CGAL::write_VTP(os, fg, CGAL::parameters::use_binary_mode(binary)); + ok = CGAL::IO::write_VTP(os, fg, CGAL::parameters::use_binary_mode(binary)); assert(ok); Mesh fg2; - ok = CGAL::read_VTP("tmp.vtp", fg2, CGAL::parameters::use_binary_mode(binary)); + ok = CGAL::IO::read_VTP("tmp.vtp", fg2, CGAL::parameters::use_binary_mode(binary)); assert(ok); assert(are_equal_meshes(fg, fg2)); } @@ -811,13 +811,13 @@ void test_bgl_VTP(const char* filename, // write with PM { if(binary) - ok = CGAL::write_polygon_mesh("tmp.vtp", fg); + ok = CGAL::IO::write_polygon_mesh("tmp.vtp", fg); else - ok = CGAL::write_polygon_mesh("tmp.vtp", fg, CGAL::parameters::use_binary_mode(false)); + ok = CGAL::IO::write_polygon_mesh("tmp.vtp", fg, CGAL::parameters::use_binary_mode(false)); assert(ok); Mesh fg2; - ok = CGAL::read_polygon_mesh("tmp.vtp", fg2, CGAL::parameters::use_binary_mode(binary)); + ok = CGAL::IO::read_polygon_mesh("tmp.vtp", fg2, CGAL::parameters::use_binary_mode(binary)); assert(ok); assert(are_equal_meshes(fg, fg2)); } @@ -828,14 +828,14 @@ void test_bgl_VTP(const char* filename, { CGAL::clear(fg); - ok = CGAL::read_VTP("data/bones.vtp", fg); + ok = CGAL::IO::read_VTP("data/bones.vtp", fg); assert(ok); assert(num_vertices(fg) == 2154 && num_faces(fg) == 4204); Mesh fg2; VertexPointMap vpm2 = get(CGAL::dynamic_vertex_property_t(), fg2); - ok = CGAL::read_VTP("data/bones.vtp", fg2, CGAL::parameters::vertex_point_map(vpm2)); + ok = CGAL::IO::read_VTP("data/bones.vtp", fg2, CGAL::parameters::vertex_point_map(vpm2)); assert(ok); typedef typename CGAL::GetInitializedVertexIndexMap::const_type VIM; VIM vim1 = CGAL::get_initialized_vertex_index_map(fg); @@ -849,18 +849,18 @@ void test_bgl_VTP(const char* filename, if(binary) { os.open("tmp.vtp", std::ios::binary); - CGAL::set_mode(os, CGAL::IO::BINARY); + CGAL::IO::set_mode(os, CGAL::IO::BINARY); } else { os.open("tmp.vtp"); } - ok = CGAL::write_VTP(os, fg, CGAL::parameters::use_binary_mode(binary)); + ok = CGAL::IO::write_VTP(os, fg, CGAL::parameters::use_binary_mode(binary)); assert(ok); Mesh fg2; - ok = CGAL::read_polygon_mesh("tmp.vtp", fg2, CGAL::parameters::use_binary_mode(binary)); + ok = CGAL::IO::read_polygon_mesh("tmp.vtp", fg2, CGAL::parameters::use_binary_mode(binary)); assert(ok); assert(are_equal_meshes(fg, fg2)); } @@ -868,33 +868,33 @@ void test_bgl_VTP(const char* filename, // write with PM { if(binary) - ok = CGAL::write_polygon_mesh("tmp.vtp", fg); + ok = CGAL::IO::write_polygon_mesh("tmp.vtp", fg); else - ok = CGAL::write_polygon_mesh("tmp.vtp", fg, CGAL::parameters::use_binary_mode(false)); + ok = CGAL::IO::write_polygon_mesh("tmp.vtp", fg, CGAL::parameters::use_binary_mode(false)); assert(ok); Mesh fg2; - ok = CGAL::read_polygon_mesh("tmp.vtp", fg2, CGAL::parameters::use_binary_mode(binary)); + ok = CGAL::IO::read_polygon_mesh("tmp.vtp", fg2, CGAL::parameters::use_binary_mode(binary)); assert(ok); assert(are_equal_meshes(fg, fg2)); } // test wrong inputs std::cerr << " ########### Error text is expected to follow." << std::endl; - ok = CGAL::read_VTP("data/mesh_that_doesnt_exist.vtp", fg); + ok = CGAL::IO::read_VTP("data/mesh_that_doesnt_exist.vtp", fg); assert(!ok); - ok = CGAL::read_VTP("data/invalid_cut.vtp", fg); // cut in half + ok = CGAL::IO::read_VTP("data/invalid_cut.vtp", fg); // cut in half assert(!ok); - ok = CGAL::read_VTP("data/invalid_header.vtp", fg); // missing header + ok = CGAL::IO::read_VTP("data/invalid_header.vtp", fg); // missing header assert(!ok); - ok = CGAL::read_VTP("data/wrong_nb_points.vtp", fg); // wrong number of points + ok = CGAL::IO::read_VTP("data/wrong_nb_points.vtp", fg); // wrong number of points assert(!ok); - ok = CGAL::read_VTP("data/sphere.obj", fg); + ok = CGAL::IO::read_VTP("data/sphere.obj", fg); assert(!ok); - ok = CGAL::read_VTP("data/full.off", fg); + ok = CGAL::IO::read_VTP("data/full.off", fg); assert(!ok); - ok = CGAL::read_VTP("corrupted_bin.vtp", fg); + ok = CGAL::IO::read_VTP("corrupted_bin.vtp", fg); assert(!ok); std::cerr << " ########### No more error text from here." << std::endl; } @@ -909,21 +909,21 @@ int main(int argc, char** argv) test_bgl_OFF(off_file); Polyhedron fg; - bool ok = CGAL::read_OFF("data/invalid_header.off", fg); // wrong header (NOFF but no normals) + bool ok = CGAL::IO::read_OFF("data/invalid_header.off", fg); // wrong header (NOFF but no normals) assert(ok); test_bgl_OFF(off_file); SM sm; - ok = CGAL::read_OFF("data/invalid_header.off", sm); // wrong header (NOFF but no normals) + ok = CGAL::IO::read_OFF("data/invalid_header.off", sm); // wrong header (NOFF but no normals) assert(!ok); test_bgl_OFF(off_file); LCC lcc; - ok = CGAL::read_OFF("data/invalid_header.off", lcc); // wrong header (NOFF but no normals) + ok = CGAL::IO::read_OFF("data/invalid_header.off", lcc); // wrong header (NOFF but no normals) assert(!ok); #ifdef CGAL_USE_OPENMESH test_bgl_OFF(off_file); OMesh om; - ok = CGAL::read_OFF("data/invalid_header.off", om); // wrong header (NOFF but no normals) + ok = CGAL::IO::read_OFF("data/invalid_header.off", om); // wrong header (NOFF but no normals) assert(!ok); #endif // OBJ diff --git a/BGL/test/BGL/test_clear.cpp b/BGL/test/BGL/test_clear.cpp index e2ab407fc60..c5387c52160 100644 --- a/BGL/test/BGL/test_clear.cpp +++ b/BGL/test/BGL/test_clear.cpp @@ -7,7 +7,7 @@ void test() { const std::string fname = "data/7_faces_triangle.off"; Mesh m; - if(!CGAL::read_OFF(fname, m)) + if(!CGAL::IO::read_OFF(fname, m)) std::cout << "Error reading file: " << fname << std::endl; assert(CGAL::is_valid_polygon_mesh(m)); diff --git a/BGL/test/BGL/test_deprecated_io.cpp b/BGL/test/BGL/test_deprecated_io.cpp index 5bd037191cc..cd7981d324a 100644 --- a/BGL/test/BGL/test_deprecated_io.cpp +++ b/BGL/test/BGL/test_deprecated_io.cpp @@ -44,7 +44,7 @@ int main() assert(ok); os.close(); - ok = CGAL::read_VTP("tmp.vtp", sm_in); + ok = CGAL::IO::read_VTP("tmp.vtp", sm_in); assert(ok); assert(num_vertices(sm_in) == 3 && num_faces(sm_in) == 1); sm_in.clear(); diff --git a/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/boolean_operations_2.cpp b/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/boolean_operations_2.cpp index a8dd97b66c9..424dfdbe710 100644 --- a/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/boolean_operations_2.cpp +++ b/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/boolean_operations_2.cpp @@ -31,7 +31,7 @@ void trace( std::string s ) out << s ; } -#include +#include #include #include @@ -306,7 +306,7 @@ public: class Curve_set { - typedef boost::shared_ptr Rep_ptr ; + typedef std::shared_ptr Rep_ptr ; public: @@ -417,7 +417,7 @@ private: QPen mPen ; QBrush mBrush ; - boost::shared_ptr mRep ; + std::shared_ptr mRep ; } ; diff --git a/Boolean_set_operations_2/include/CGAL/General_polygon_2.h b/Boolean_set_operations_2/include/CGAL/General_polygon_2.h index fd6badf0c40..7d1cbdea7a8 100644 --- a/Boolean_set_operations_2/include/CGAL/General_polygon_2.h +++ b/Boolean_set_operations_2/include/CGAL/General_polygon_2.h @@ -187,7 +187,7 @@ std::ostream { typename General_polygon_2::Curve_const_iterator i; - switch(get_mode(os)) { + switch(IO::get_mode(os)) { case IO::ASCII : os << p.size() << ' '; for (i = p.curves_begin(); i != p.curves_end(); ++i) { diff --git a/Bounding_volumes/examples/Min_circle_2/min_circle_homogeneous_2.cpp b/Bounding_volumes/examples/Min_circle_2/min_circle_homogeneous_2.cpp index aac519412db..238887de2e4 100644 --- a/Bounding_volumes/examples/Min_circle_2/min_circle_homogeneous_2.cpp +++ b/Bounding_volumes/examples/Min_circle_2/min_circle_homogeneous_2.cpp @@ -26,7 +26,7 @@ main( int, char**) Min_circle mc1( P, P+n, false); // very slow Min_circle mc2( P, P+n, true); // fast - CGAL::set_pretty_mode( std::cout); + CGAL::IO::set_pretty_mode( std::cout); std::cout << mc2; return 0; diff --git a/Bounding_volumes/examples/Min_ellipse_2/min_ellipse_2.cpp b/Bounding_volumes/examples/Min_ellipse_2/min_ellipse_2.cpp index f4571ad6a8c..a5f5935e5b4 100644 --- a/Bounding_volumes/examples/Min_ellipse_2/min_ellipse_2.cpp +++ b/Bounding_volumes/examples/Min_ellipse_2/min_ellipse_2.cpp @@ -39,7 +39,7 @@ main( int, char**) assert(me2.number_of_support_points()==2); // prettyprinting - CGAL::set_pretty_mode( std::cout); + CGAL::IO::set_pretty_mode( std::cout); std::cout << me2; // in general, the ellipse is not explicitly representable diff --git a/Bounding_volumes/examples/Min_sphere_d/min_sphere_homogeneous_3.cpp b/Bounding_volumes/examples/Min_sphere_d/min_sphere_homogeneous_3.cpp index 191109c0566..a0ec7ad1e17 100644 --- a/Bounding_volumes/examples/Min_sphere_d/min_sphere_homogeneous_3.cpp +++ b/Bounding_volumes/examples/Min_sphere_d/min_sphere_homogeneous_3.cpp @@ -25,7 +25,7 @@ main () Min_sphere ms (P, P+n); // smallest enclosing sphere - CGAL::set_pretty_mode (std::cout); + CGAL::IO::set_pretty_mode (std::cout); std::cout << ms; // output the sphere return 0; diff --git a/Bounding_volumes/examples/Rectangular_p_center_2/rectangular_p_center_2.cpp b/Bounding_volumes/examples/Rectangular_p_center_2/rectangular_p_center_2.cpp index 920df52e0e3..e4602fe923f 100644 --- a/Bounding_volumes/examples/Rectangular_p_center_2/rectangular_p_center_2.cpp +++ b/Bounding_volumes/examples/Rectangular_p_center_2/rectangular_p_center_2.cpp @@ -21,7 +21,7 @@ int main() int n = 10; int p = 2; OIterator cout_ip(std::cout); - CGAL::set_pretty_mode(std::cout); + CGAL::IO::set_pretty_mode(std::cout); Cont points; std::copy_n(Generator(1), n, std::back_inserter(points)); diff --git a/Bounding_volumes/include/CGAL/Min_annulus_d.h b/Bounding_volumes/include/CGAL/Min_annulus_d.h index 0be72c1b427..4f8e1d3a784 100644 --- a/Bounding_volumes/include/CGAL/Min_annulus_d.h +++ b/Bounding_volumes/include/CGAL/Min_annulus_d.h @@ -781,7 +781,7 @@ operator << ( std::ostream& os, typedef typename Traits_::ET ET; typedef ostream_iterator Et_it; - switch ( CGAL::get_mode( os)) { + switch ( CGAL::IO::get_mode( os)) { case CGAL::IO::PRETTY: os << "CGAL::Min_annulus_d( |P| = " @@ -830,7 +830,7 @@ operator << ( std::ostream& os, default: CGAL_optimisation_assertion_msg( false, - "CGAL::get_mode( os) invalid!"); + "CGAL::IO::get_mode( os) invalid!"); break; } return( os); @@ -843,7 +843,7 @@ operator >> ( std::istream& is, CGAL::Min_annulus_d& min_annulus) { using namespace std; - switch ( CGAL::get_mode( is)) { + switch ( CGAL::IO::get_mode( is)) { case CGAL::IO::PRETTY: cerr << endl; diff --git a/Bounding_volumes/include/CGAL/Min_circle_2/Min_circle_2_adapterC2.h b/Bounding_volumes/include/CGAL/Min_circle_2/Min_circle_2_adapterC2.h index a75c21f1624..3f28aef6732 100644 --- a/Bounding_volumes/include/CGAL/Min_circle_2/Min_circle_2_adapterC2.h +++ b/Bounding_volumes/include/CGAL/Min_circle_2/Min_circle_2_adapterC2.h @@ -273,7 +273,7 @@ std::ostream& operator << ( std::ostream& os, const CGAL::_Min_circle_2_adapterC2__Circle& c) { - switch ( CGAL::get_mode( os)) { + switch ( CGAL::IO::get_mode( os)) { case CGAL::IO::PRETTY: os << "CGAL::Min_circle_2_adapterC2::Circle( " @@ -294,7 +294,7 @@ operator << ( std::ostream& os, default: CGAL_optimisation_assertion_msg( false, - "CGAL::get_mode( os) invalid!"); + "CGAL::IO::get_mode( os) invalid!"); break; } return( os); @@ -305,7 +305,7 @@ std::istream& operator >> ( std::istream& is, CGAL::_Min_circle_2_adapterC2__Circle& c) { - switch ( CGAL::get_mode( is)) { + switch ( CGAL::IO::get_mode( is)) { case CGAL::IO::PRETTY: std::cerr << std::endl; diff --git a/Bounding_volumes/include/CGAL/Min_circle_2/Min_circle_2_adapterH2.h b/Bounding_volumes/include/CGAL/Min_circle_2/Min_circle_2_adapterH2.h index 166a5948eb5..74afdd668d6 100644 --- a/Bounding_volumes/include/CGAL/Min_circle_2/Min_circle_2_adapterH2.h +++ b/Bounding_volumes/include/CGAL/Min_circle_2/Min_circle_2_adapterH2.h @@ -307,7 +307,7 @@ std::ostream& operator << ( std::ostream& os, const CGAL::_Min_circle_2_adapterH2__Circle& c) { - switch ( CGAL::get_mode( os)) { + switch ( CGAL::IO::get_mode( os)) { case CGAL::IO::PRETTY: os << "CGAL::Min_circle_2_adapterH2::Circle( " @@ -333,7 +333,7 @@ operator << ( std::ostream& os, default: CGAL_optimisation_assertion_msg( false, - "CGAL::get_mode( os) invalid!"); + "CGAL::IO::get_mode( os) invalid!"); break; } return( os); @@ -344,7 +344,7 @@ std::istream& operator >> ( std::istream& is, CGAL::_Min_circle_2_adapterH2__Circle& c) { - switch ( CGAL::get_mode( is)) { + switch ( CGAL::IO::get_mode( is)) { case CGAL::IO::PRETTY: std::cerr << std::endl; diff --git a/Bounding_volumes/include/CGAL/Min_circle_2/Min_circle_2_impl.h b/Bounding_volumes/include/CGAL/Min_circle_2/Min_circle_2_impl.h index dc79b1f8812..f0a8cc7f072 100644 --- a/Bounding_volumes/include/CGAL/Min_circle_2/Min_circle_2_impl.h +++ b/Bounding_volumes/include/CGAL/Min_circle_2/Min_circle_2_impl.h @@ -28,7 +28,7 @@ operator << ( std::ostream& os, typedef typename Min_circle_2::Point Point; typedef ostream_iterator Os_it; - switch ( CGAL::get_mode( os)) { + switch ( CGAL::IO::get_mode( os)) { case CGAL::IO::PRETTY: os << endl; @@ -61,7 +61,7 @@ operator << ( std::ostream& os, default: CGAL_optimisation_assertion_msg( false, - "CGAL::get_mode( os) invalid!"); + "CGAL::IO::get_mode( os) invalid!"); break; } return( os); @@ -73,7 +73,7 @@ operator >> ( std::istream& is, CGAL::Min_circle_2& min_circle) { using namespace std; - switch ( CGAL::get_mode( is)) { + switch ( CGAL::IO::get_mode( is)) { case CGAL::IO::PRETTY: cerr << endl; diff --git a/Bounding_volumes/include/CGAL/Min_circle_2/Optimisation_circle_2_impl.h b/Bounding_volumes/include/CGAL/Min_circle_2/Optimisation_circle_2_impl.h index 7257afbb604..55057c6ac37 100644 --- a/Bounding_volumes/include/CGAL/Min_circle_2/Optimisation_circle_2_impl.h +++ b/Bounding_volumes/include/CGAL/Min_circle_2/Optimisation_circle_2_impl.h @@ -24,7 +24,7 @@ template < class K_ > std::ostream& operator << ( std::ostream& os, const CGAL::Optimisation_circle_2& c) { - switch ( CGAL::get_mode( os)) { + switch ( CGAL::IO::get_mode( os)) { case CGAL::IO::PRETTY: os << "CGAL::Optimisation_circle_2( " @@ -43,7 +43,7 @@ operator << ( std::ostream& os, const CGAL::Optimisation_circle_2& c) default: CGAL_optimisation_assertion_msg( false, - "CGAL::get_mode( os) invalid!"); + "CGAL::IO::get_mode( os) invalid!"); break; } return( os); @@ -56,7 +56,7 @@ operator >> ( std::istream& is, CGAL::Optimisation_circle_2& c) typedef typename CGAL::Optimisation_circle_2::Point Point; typedef typename CGAL::Optimisation_circle_2::Distance Distance; - switch ( CGAL::get_mode( is)) { + switch ( CGAL::IO::get_mode( is)) { case CGAL::IO::PRETTY: std::cerr << std::endl; @@ -80,7 +80,7 @@ operator >> ( std::istream& is, CGAL::Optimisation_circle_2& c) default: CGAL_optimisation_assertion_msg( false, - "CGAL::get_mode( is) invalid!"); + "CGAL::IO::get_mode( is) invalid!"); break; } return( is); diff --git a/Bounding_volumes/include/CGAL/Min_ellipse_2/Min_ellipse_2_adapterC2.h b/Bounding_volumes/include/CGAL/Min_ellipse_2/Min_ellipse_2_adapterC2.h index 6e70f09f978..b50c7e45fed 100644 --- a/Bounding_volumes/include/CGAL/Min_ellipse_2/Min_ellipse_2_adapterC2.h +++ b/Bounding_volumes/include/CGAL/Min_ellipse_2/Min_ellipse_2_adapterC2.h @@ -329,7 +329,7 @@ operator << ( std::ostream& os, const char* sep = empty; const char* tail = empty; - switch ( CGAL::get_mode( os)) { + switch ( CGAL::IO::get_mode( os)) { case CGAL::IO::PRETTY: head = pretty_head; sep = pretty_sep; @@ -342,7 +342,7 @@ operator << ( std::ostream& os, break; default: CGAL_optimisation_assertion_msg( false, - "CGAL::get_mode( os) invalid!"); + "CGAL::IO::get_mode( os) invalid!"); break; } os << head << e.n_boundary_points; @@ -374,7 +374,7 @@ std::istream& operator >> ( std::istream& is, CGAL::_Min_ellipse_2_adapterC2__Ellipse& e) { - switch ( CGAL::get_mode( is)) { + switch ( CGAL::IO::get_mode( is)) { case CGAL::IO::PRETTY: std::cerr << std::endl; diff --git a/Bounding_volumes/include/CGAL/Min_ellipse_2/Min_ellipse_2_adapterH2.h b/Bounding_volumes/include/CGAL/Min_ellipse_2/Min_ellipse_2_adapterH2.h index 9af39820a21..23454106cfc 100644 --- a/Bounding_volumes/include/CGAL/Min_ellipse_2/Min_ellipse_2_adapterH2.h +++ b/Bounding_volumes/include/CGAL/Min_ellipse_2/Min_ellipse_2_adapterH2.h @@ -337,7 +337,7 @@ operator << ( std::ostream& os, const char* sep = empty; const char* tail = empty; - switch ( CGAL::get_mode( os)) { + switch ( CGAL::IO::get_mode( os)) { case CGAL::IO::PRETTY: head = pretty_head; sep = pretty_sep; @@ -350,7 +350,7 @@ operator << ( std::ostream& os, break; default: CGAL_optimisation_assertion_msg( false, - "CGAL::get_mode( os) invalid!"); + "CGAL::IO::get_mode( os) invalid!"); break; } os << head << e.n_boundary_points; @@ -382,7 +382,7 @@ std::istream& operator >> ( std::istream& is, CGAL::_Min_ellipse_2_adapterH2__Ellipse& e) { - switch ( CGAL::get_mode( is)) { + switch ( CGAL::IO::get_mode( is)) { case CGAL::IO::PRETTY: std::cerr << std::endl; diff --git a/Bounding_volumes/include/CGAL/Min_ellipse_2/Min_ellipse_2_impl.h b/Bounding_volumes/include/CGAL/Min_ellipse_2/Min_ellipse_2_impl.h index 527a1240659..e28a847f1c5 100644 --- a/Bounding_volumes/include/CGAL/Min_ellipse_2/Min_ellipse_2_impl.h +++ b/Bounding_volumes/include/CGAL/Min_ellipse_2/Min_ellipse_2_impl.h @@ -28,7 +28,7 @@ operator << ( std::ostream& os, typedef typename Min_ellipse_2::Point Point; typedef ostream_iterator Os_it; - switch ( CGAL::get_mode( os)) { + switch ( CGAL::IO::get_mode( os)) { case CGAL::IO::PRETTY: os << endl; @@ -61,7 +61,7 @@ operator << ( std::ostream& os, default: CGAL_optimisation_assertion_msg( false, - "CGAL::get_mode( os) invalid!"); + "CGAL::IO::get_mode( os) invalid!"); break; } return( os); @@ -73,7 +73,7 @@ operator >> ( std::istream& is, CGAL::Min_ellipse_2& min_ellipse) { using namespace std; - switch ( CGAL::get_mode( is)) { + switch ( CGAL::IO::get_mode( is)) { case CGAL::IO::PRETTY: cerr << endl; diff --git a/Bounding_volumes/include/CGAL/Min_ellipse_2/Optimisation_ellipse_2_impl.h b/Bounding_volumes/include/CGAL/Min_ellipse_2/Optimisation_ellipse_2_impl.h index a2e3f211396..47b42ef90d8 100644 --- a/Bounding_volumes/include/CGAL/Min_ellipse_2/Optimisation_ellipse_2_impl.h +++ b/Bounding_volumes/include/CGAL/Min_ellipse_2/Optimisation_ellipse_2_impl.h @@ -31,7 +31,7 @@ operator << ( std::ostream& os, const CGAL::Optimisation_ellipse_2& e) const char* sep = empty; const char* tail = empty; - switch ( CGAL::get_mode( os)) { + switch ( CGAL::IO::get_mode( os)) { case CGAL::IO::PRETTY: head = pretty_head; sep = pretty_sep; @@ -44,7 +44,7 @@ operator << ( std::ostream& os, const CGAL::Optimisation_ellipse_2& e) break; default: CGAL_optimisation_assertion_msg( false, - "CGAL::get_mode( os) invalid!"); + "CGAL::IO::get_mode( os) invalid!"); break; } os << head << e.n_boundary_points; @@ -75,7 +75,7 @@ template < class K_ > std::istream& operator >> ( std::istream& is, CGAL::Optimisation_ellipse_2& e) { - switch ( CGAL::get_mode( is)) { + switch ( CGAL::IO::get_mode( is)) { case CGAL::IO::PRETTY: std::cerr << std::endl; @@ -107,7 +107,7 @@ operator >> ( std::istream& is, CGAL::Optimisation_ellipse_2& e) default: CGAL_optimisation_assertion_msg( false, - "CGAL::get_mode( is) invalid!"); + "CGAL::IO::get_mode( is) invalid!"); break; } return( is); diff --git a/Bounding_volumes/include/CGAL/Min_sphere_d/Min_sphere_d_impl.h b/Bounding_volumes/include/CGAL/Min_sphere_d/Min_sphere_d_impl.h index 1c2422c9c1f..684d1fb7e0b 100644 --- a/Bounding_volumes/include/CGAL/Min_sphere_d/Min_sphere_d_impl.h +++ b/Bounding_volumes/include/CGAL/Min_sphere_d/Min_sphere_d_impl.h @@ -25,7 +25,7 @@ operator << ( std::ostream& os, const Min_sphere_d& min_sphere) { typedef typename Min_sphere_d::Point Point; - switch ( get_mode( os)) { + switch ( IO::get_mode( os)) { case IO::PRETTY: os << std::endl; @@ -63,7 +63,7 @@ operator << ( std::ostream& os, const Min_sphere_d& min_sphere) default: CGAL_optimisation_assertion_msg - ( false, "get_mode( os) invalid!"); + ( false, "IO::get_mode( os) invalid!"); break; } return( os); @@ -73,7 +73,7 @@ template < class Traits > std::istream& operator >> ( std::istream& is, Min_sphere_d& min_sphere) { - switch ( get_mode( is)) { + switch ( IO::get_mode( is)) { case IO::PRETTY: std::cerr << std::endl; diff --git a/Bounding_volumes/test/Bounding_volumes/min_sphere_test.cpp b/Bounding_volumes/test/Bounding_volumes/min_sphere_test.cpp index e53793cf9f4..82b71269443 100644 --- a/Bounding_volumes/test/Bounding_volumes/min_sphere_test.cpp +++ b/Bounding_volumes/test/Bounding_volumes/min_sphere_test.cpp @@ -228,11 +228,11 @@ int main () std::ostringstream ost; // output string - set_ascii_mode (ost); + IO::set_ascii_mode (ost); ost << msC << msH << std::endl; // write spheres std::istringstream ist (ost.str().c_str()); // input string - set_ascii_mode (ist); + IO::set_ascii_mode (ist); ist >> msC >> msH; // read spheres assert(centerC == msC.center()); diff --git a/Bounding_volumes/test/Bounding_volumes/minimum_enclosing_quadrilateral_2_test_C.cpp b/Bounding_volumes/test/Bounding_volumes/minimum_enclosing_quadrilateral_2_test_C.cpp index 8e0a95aaad8..c009a3524a7 100644 --- a/Bounding_volumes/test/Bounding_volumes/minimum_enclosing_quadrilateral_2_test_C.cpp +++ b/Bounding_volumes/test/Bounding_volumes/minimum_enclosing_quadrilateral_2_test_C.cpp @@ -54,7 +54,7 @@ void compute(ForwardIterator f, ForwardIterator l) int main() { - CGAL::set_pretty_mode(cout); + CGAL::IO::set_pretty_mode(cout); // build a random convex 20-gon p { diff --git a/Bounding_volumes/test/Bounding_volumes/minimum_enclosing_quadrilateral_2_test_H.cpp b/Bounding_volumes/test/Bounding_volumes/minimum_enclosing_quadrilateral_2_test_H.cpp index 5acc7f9d93a..f92a59f752f 100644 --- a/Bounding_volumes/test/Bounding_volumes/minimum_enclosing_quadrilateral_2_test_H.cpp +++ b/Bounding_volumes/test/Bounding_volumes/minimum_enclosing_quadrilateral_2_test_H.cpp @@ -35,7 +35,7 @@ typedef CGAL::Random_points_in_square_2 Point_generator; int main() { - CGAL::set_pretty_mode(cout); + CGAL::IO::set_pretty_mode(cout); // build a random convex 20-gon p Polygon_2 p; diff --git a/Bounding_volumes/test/Bounding_volumes/rectangular_p_center_2_random1_test.cpp b/Bounding_volumes/test/Bounding_volumes/rectangular_p_center_2_random1_test.cpp index c39235bcf30..94ee1718336 100644 --- a/Bounding_volumes/test/Bounding_volumes/rectangular_p_center_2_random1_test.cpp +++ b/Bounding_volumes/test/Bounding_volumes/rectangular_p_center_2_random1_test.cpp @@ -135,7 +135,7 @@ int main(int argc, char* argv[]) { #ifndef CGAL_PCENTER_NO_OUTPUT - CGAL::set_pretty_mode(cerr); + CGAL::IO::set_pretty_mode(cerr); #endif // CGAL_PCENTER_NO_OUTPUT int number_of_points; diff --git a/Bounding_volumes/test/Bounding_volumes/rectangular_p_center_2_random2_test.cpp b/Bounding_volumes/test/Bounding_volumes/rectangular_p_center_2_random2_test.cpp index ff205e038ae..cd9378c9c79 100644 --- a/Bounding_volumes/test/Bounding_volumes/rectangular_p_center_2_random2_test.cpp +++ b/Bounding_volumes/test/Bounding_volumes/rectangular_p_center_2_random2_test.cpp @@ -137,7 +137,7 @@ int main(int argc, char* argv[]) { #ifndef CGAL_PCENTER_NO_OUTPUT - CGAL::set_pretty_mode(cerr); + CGAL::IO::set_pretty_mode(cerr); #endif // CGAL_PCENTER_NO_OUTPUT int number_of_points; diff --git a/Bounding_volumes/test/Bounding_volumes/test_Min_annulus_d.h b/Bounding_volumes/test/Bounding_volumes/test_Min_annulus_d.h index 0e32b0be687..a1b3c9e88e0 100644 --- a/Bounding_volumes/test/Bounding_volumes/test_Min_annulus_d.h +++ b/Bounding_volumes/test/Bounding_volumes/test_Min_annulus_d.h @@ -53,7 +53,7 @@ test_Min_annulus_d( ForwardIterator first, ForwardIterator last, CGAL::Verbose_ostream verr ( verbose >= 0); CGAL::Verbose_ostream verr0( verbose == 0); CGAL::Verbose_ostream verrX( verbose > 0); - CGAL::set_pretty_mode( verr.out()); + CGAL::IO::set_pretty_mode( verr.out()); bool is_valid_verbose = ( verbose > 0); diff --git a/Bounding_volumes/test/Bounding_volumes/test_Min_circle.cpp b/Bounding_volumes/test/Bounding_volumes/test_Min_circle.cpp index 4412a7a546f..01ce8cc429a 100644 --- a/Bounding_volumes/test/Bounding_volumes/test_Min_circle.cpp +++ b/Bounding_volumes/test/Bounding_volumes/test_Min_circle.cpp @@ -219,26 +219,26 @@ cover_Min_circle_2( bool verbose, const Traits&, const RT&) { verr << endl << " writing `test_Min_circle_2.ascii'..."; ofstream os( "test_Min_circle_2.ascii"); - CGAL::set_ascii_mode( os); + CGAL::IO::set_ascii_mode( os); os << mc; } { verr << endl << " writing `test_Min_circle_2.pretty'..."; ofstream os( "test_Min_circle_2.pretty"); - CGAL::set_pretty_mode( os); + CGAL::IO::set_pretty_mode( os); os << mc; } { verr << endl << " writing `test_Min_circle_2.binary'..."; ofstream os( "test_Min_circle_2.binary"); - CGAL::set_binary_mode( os); + CGAL::IO::set_binary_mode( os); os << mc; } { verr << endl << " reading `test_Min_circle_2.ascii'..."; Min_circle mc_in; ifstream is( "test_Min_circle_2.ascii"); - CGAL::set_ascii_mode( is); + CGAL::IO::set_ascii_mode( is); is >> mc_in; bool is_valid = mc_in.is_valid( verbose); assert( is_valid); diff --git a/Bounding_volumes/test/Bounding_volumes/test_Min_ellipse_2.cpp b/Bounding_volumes/test/Bounding_volumes/test_Min_ellipse_2.cpp index edfc855f158..535aa4674b1 100644 --- a/Bounding_volumes/test/Bounding_volumes/test_Min_ellipse_2.cpp +++ b/Bounding_volumes/test/Bounding_volumes/test_Min_ellipse_2.cpp @@ -412,26 +412,26 @@ cover_Min_ellipse_2( bool verbose, const Traits&, const RT&) { verr << endl << " writing `test_Min_ellipse_2.ascii'..."; ofstream os( "test_Min_ellipse_2.ascii"); - CGAL::set_ascii_mode( os); + CGAL::IO::set_ascii_mode( os); os << me; } { verr << endl << " writing `test_Min_ellipse_2.pretty'..."; ofstream os( "test_Min_ellipse_2.pretty"); - CGAL::set_pretty_mode( os); + CGAL::IO::set_pretty_mode( os); os << me; } { verr << endl << " writing `test_Min_ellipse_2.binary'..."; ofstream os( "test_Min_ellipse_2.binary"); - CGAL::set_binary_mode( os); + CGAL::IO::set_binary_mode( os); os << me; } { verr << endl << " reading `test_Min_ellipse_2.ascii'..."; Min_ellipse me_in; ifstream is( "test_Min_ellipse_2.ascii"); - CGAL::set_ascii_mode( is); + CGAL::IO::set_ascii_mode( is); is >> me_in; bool is_valid = me_in.is_valid( verbose); assert( is_valid); diff --git a/Box_intersection_d/include/CGAL/Box_intersection_d/Box_d.h b/Box_intersection_d/include/CGAL/Box_intersection_d/Box_d.h index a6326ed6cae..ddadb14852e 100644 --- a/Box_intersection_d/include/CGAL/Box_intersection_d/Box_d.h +++ b/Box_intersection_d/include/CGAL/Box_intersection_d/Box_d.h @@ -21,10 +21,10 @@ #include #include #include -#include #include #include +#include namespace CGAL { @@ -38,7 +38,7 @@ struct Unique_numbers { #ifdef CGAL_NO_ATOMIC static std::size_t n = 0; #else - static CGAL::cpp11::atomic n; // initialized to 0 + static std::atomic n; // initialized to 0 #endif i = n++; } diff --git a/CGAL_Core/include/CGAL/CORE/CoreDefs.h b/CGAL_Core/include/CGAL/CORE/CoreDefs.h index efeb46378cb..57c3da34645 100644 --- a/CGAL_Core/include/CGAL/CORE/CoreDefs.h +++ b/CGAL_Core/include/CGAL/CORE/CoreDefs.h @@ -29,9 +29,10 @@ #define _CORE_COREDEFS_H_ #include -#include #include +#include + #ifdef CGAL_HEADER_ONLY #define CGAL_GLOBAL_STATE_VAR(TYPE, NAME, VALUE) \ @@ -75,7 +76,7 @@ namespace CORE { #ifdef CGAL_NO_ATOMIC CGAL_GLOBAL_STATE_VAR(bool, AbortFlag, true) #else -CGAL_GLOBAL_STATE_VAR(CGAL::cpp11::atomic, AbortFlag, true) +CGAL_GLOBAL_STATE_VAR(std::atomic, AbortFlag, true) #endif /// Invalid Flag -- initiallly value is non-negative @@ -86,7 +87,7 @@ CGAL_GLOBAL_STATE_VAR(CGAL::cpp11::atomic, AbortFlag, true) #ifdef CGAL_NO_ATOMIC CGAL_GLOBAL_STATE_VAR(int, InvalidFlag, 0) #else -CGAL_GLOBAL_STATE_VAR(CGAL::cpp11::atomic, InvalidFlag, 0) +CGAL_GLOBAL_STATE_VAR(std::atomic, InvalidFlag, 0) #endif /// Escape Precision in bits @@ -102,7 +103,7 @@ CGAL_GLOBAL_STATE_VAR(long, EscapePrecFlag, 0) #ifdef CGAL_NO_ATOMIC CGAL_GLOBAL_STATE_VAR(bool, EscapePrecWarning, true) #else -CGAL_GLOBAL_STATE_VAR(CGAL::cpp11::atomic, EscapePrecWarning, true) +CGAL_GLOBAL_STATE_VAR(std::atomic, EscapePrecWarning, true) #endif // These following two values determine the precision of computing @@ -124,7 +125,7 @@ CGAL_GLOBAL_STATE_VAR(extLong, defAbsPrec, CORE_posInfty) #ifdef CGAL_NO_ATOMIC CGAL_GLOBAL_STATE_VAR(long, defBigFloatOutputDigits, 10) #else - CGAL_GLOBAL_STATE_VAR(CGAL::cpp11::atomic, defBigFloatOutputDigits, 10) + CGAL_GLOBAL_STATE_VAR(std::atomic, defBigFloatOutputDigits, 10) #endif /// default input precision in digits for converting a string to a Real or Expr @@ -138,7 +139,7 @@ CGAL_GLOBAL_STATE_VAR(extLong, defInputDigits, CORE_posInfty) #ifdef CGAL_NO_ATOMIC CGAL_GLOBAL_STATE_VAR(long, defOutputDigits, 10) // == get_static_defBigFloatOutputDigits() #else -CGAL_GLOBAL_STATE_VAR(CGAL::cpp11::atomic, defOutputDigits, 10) // == get_static_defBigFloatOutputDigits() +CGAL_GLOBAL_STATE_VAR(std::atomic, defOutputDigits, 10) // == get_static_defBigFloatOutputDigits() #endif /// default input precision in digits for converting a string to a BigFloat @@ -146,7 +147,7 @@ CGAL_GLOBAL_STATE_VAR(CGAL::cpp11::atomic, defOutputDigits, 10) // == get_ #ifdef CGAL_NO_ATOMIC CGAL_GLOBAL_STATE_VAR(long, defBigFloatInputDigits, 16) #else -CGAL_GLOBAL_STATE_VAR(CGAL::cpp11::atomic, defBigFloatInputDigits, 16) +CGAL_GLOBAL_STATE_VAR(std::atomic, defBigFloatInputDigits, 16) #endif inline @@ -169,7 +170,7 @@ CGAL_GLOBAL_STATE_VAR(extLong, defBFsqrtAbsPrec, 54) #ifdef CGAL_NO_ATOMIC CGAL_GLOBAL_STATE_VAR(bool, fpFilterFlag, true) #else -CGAL_GLOBAL_STATE_VAR(CGAL::cpp11::atomic, fpFilterFlag, true) +CGAL_GLOBAL_STATE_VAR(std::atomic, fpFilterFlag, true) #endif @@ -177,7 +178,7 @@ CGAL_GLOBAL_STATE_VAR(CGAL::cpp11::atomic, fpFilterFlag, true) #ifdef CGAL_NO_ATOMIC CGAL_GLOBAL_STATE_VAR(bool, incrementalEvalFlag, true) #else -CGAL_GLOBAL_STATE_VAR(CGAL::cpp11::atomic, incrementalEvalFlag, true) +CGAL_GLOBAL_STATE_VAR(std::atomic, incrementalEvalFlag, true) #endif @@ -185,7 +186,7 @@ CGAL_GLOBAL_STATE_VAR(CGAL::cpp11::atomic, incrementalEvalFlag, true) #ifdef CGAL_NO_ATOMIC CGAL_GLOBAL_STATE_VAR(bool, progressiveEvalFlag, true) #else -CGAL_GLOBAL_STATE_VAR(CGAL::cpp11::atomic, progressiveEvalFlag, true) +CGAL_GLOBAL_STATE_VAR(std::atomic, progressiveEvalFlag, true) #endif @@ -193,14 +194,14 @@ CGAL_GLOBAL_STATE_VAR(CGAL::cpp11::atomic, progressiveEvalFlag, true) #ifdef CGAL_NO_ATOMIC CGAL_GLOBAL_STATE_VAR(bool, rationalReduceFlag, false) #else -CGAL_GLOBAL_STATE_VAR(CGAL::cpp11::atomic, rationalReduceFlag, false) +CGAL_GLOBAL_STATE_VAR(std::atomic, rationalReduceFlag, false) #endif /// default initial (bit) precision for AddSub Progressive Evaluation #ifdef CGAL_NO_ATOMIC CGAL_GLOBAL_STATE_VAR(long, defInitialProgressivePrec, 64) #else -CGAL_GLOBAL_STATE_VAR(CGAL::cpp11::atomic, defInitialProgressivePrec, 64) +CGAL_GLOBAL_STATE_VAR(std::atomic, defInitialProgressivePrec, 64) #endif ////////////////////////////////////////////////////////////// diff --git a/CGAL_Core/include/CGAL/CORE/CoreDefs_impl.h b/CGAL_Core/include/CGAL/CORE/CoreDefs_impl.h index b7436178b0a..d28326496f3 100644 --- a/CGAL_Core/include/CGAL/CORE/CoreDefs_impl.h +++ b/CGAL_Core/include/CGAL/CORE/CoreDefs_impl.h @@ -24,6 +24,8 @@ #include "CGAL/CORE/CoreDefs.h" +#include + namespace CORE { // Default Values @@ -50,7 +52,7 @@ int IOErrorFlag = 0; #ifdef CGAL_NO_ATOMIC bool AbortFlag = true; #else -CGAL::cpp11::atomic AbortFlag(true); +std::atomic AbortFlag(true); #endif /** @@ -61,7 +63,7 @@ CGAL::cpp11::atomic AbortFlag(true); #ifdef CGAL_NO_ATOMIC int InvalidFlag = 0; #else -CGAL::cpp11::atomic InvalidFlag(0); +std::atomic InvalidFlag(0); #endif /* ************************************************************ @@ -97,7 +99,7 @@ long EscapePrecFlag = 0; #ifdef CGAL_NO_ATOMIC bool EscapePrecWarning = true; #else -CGAL::cpp11::atomic EscapePrecWarning(true); +std::atomic EscapePrecWarning(true); #endif /** The Composite Precision [defAbsPrec, defRelPrec] @@ -117,7 +119,7 @@ extLong defRelPrec = 60; #ifdef CGAL_NO_ATOMIC long defBigFloatOutputDigits = 10; #else -CGAL::cpp11::atomic defBigFloatOutputDigits(10); +std::atomic defBigFloatOutputDigits(10); #endif /** NORMALLY, we like to make this equal to defBigFloatOutputDigits @@ -125,7 +127,7 @@ CGAL::cpp11::atomic defBigFloatOutputDigits(10); #ifdef CGAL_NO_ATOMIC long defOutputDigits = 10; #else -CGAL::cpp11::atomic defOutputDigits(10); // == defBigFloatOutputDigits; +std::atomic defOutputDigits(10); // == defBigFloatOutputDigits; #endif /** String Input Precision */ @@ -142,7 +144,7 @@ extLong defInputDigits = CORE_posInfty; #ifdef CGAL_NO_ATOMIC long defBigFloatInputDigits = 16; #else -CGAL::cpp11::atomic defBigFloatInputDigits(16); +std::atomic defBigFloatInputDigits(16); #endif /* ************************************************************ @@ -154,7 +156,7 @@ CGAL::cpp11::atomic defBigFloatInputDigits(16); #ifdef CGAL_NO_ATOMIC bool fpFilterFlag = true; #else -CGAL::cpp11::atomic fpFilterFlag(true); +std::atomic fpFilterFlag(true); #endif /** IncrementaL evaluation flag @@ -163,7 +165,7 @@ CGAL::cpp11::atomic fpFilterFlag(true); #ifdef CGAL_NO_ATOMIC bool incrementalEvalFlag = true; #else -CGAL::cpp11::atomic incrementalEvalFlag(true); +std::atomic incrementalEvalFlag(true); #endif /** Progressive evaluation flag @@ -171,7 +173,7 @@ CGAL::cpp11::atomic incrementalEvalFlag(true); #ifdef CGAL_NO_ATOMIC bool progressiveEvalFlag = true; #else -CGAL::cpp11::atomic progressiveEvalFlag(true); +std::atomic progressiveEvalFlag(true); #endif /** Initial progressive evaluation precision @@ -179,7 +181,7 @@ CGAL::cpp11::atomic progressiveEvalFlag(true); #ifdef CGAL_NO_ATOMIC long defInitialProgressivePrec = 64; #else -CGAL::cpp11::atomic defInitialProgressivePrec(64); +std::atomic defInitialProgressivePrec(64); #endif /** RATIONAL REDUCTION FLAG @@ -187,7 +189,7 @@ CGAL::cpp11::atomic defInitialProgressivePrec(64); #ifdef CGAL_NO_ATOMIC bool rationalReduceFlag = false; #else -CGAL::cpp11::atomic rationalReduceFlag(false); +std::atomic rationalReduceFlag(false); #endif #endif // CGAL_HEADER_ONLY diff --git a/CGAL_ImageIO/include/CGAL/IO/read_vtk_image_data.h b/CGAL_ImageIO/include/CGAL/IO/read_vtk_image_data.h new file mode 100644 index 00000000000..ccce66f3ca6 --- /dev/null +++ b/CGAL_ImageIO/include/CGAL/IO/read_vtk_image_data.h @@ -0,0 +1,108 @@ +// Copyright (c) 2005-2008 INRIA Sophia-Antipolis (France). +// 2008 GeometryFactory +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org) +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// +// +// Author(s) : Laurent Rineau, Pierre Alliez + +#ifndef CGAL_IO_READ_VTK_IMAGE_DATA_H +#define CGAL_IO_READ_VTK_IMAGE_DATA_H + +#include +#include + +namespace CGAL { + +namespace { + +struct VTK_to_ImageIO_type_mapper { + WORD_KIND wordKind; + SIGN sign; + unsigned int wdim; +}; + +static const VTK_to_ImageIO_type_mapper VTK_to_ImageIO_type[VTK_ID_TYPE] = + { { WK_UNKNOWN, SGN_UNKNOWN, 0}, // 0=VTK_VOID + { WK_UNKNOWN, SGN_UNKNOWN, 0}, // 1=VTK_BIT + { WK_FIXED, SGN_SIGNED, 1}, // 2=VTK_CHAR + { WK_FIXED, SGN_UNSIGNED, 1}, // 3=VTK_UNSIGNED_CHAR + { WK_FIXED, SGN_SIGNED, 2}, // 4=VTK_SHORT + { WK_FIXED, SGN_UNSIGNED, 2}, // 5=VTK_UNSIGNED_SHORT + { WK_FIXED, SGN_SIGNED, 4}, // 6=VTK_INT + { WK_FIXED, SGN_UNSIGNED, 4}, // 7=VTK_UNSIGNED_INT + { WK_FIXED, SGN_SIGNED, 8}, // 8=VTK_LONG + { WK_FIXED, SGN_UNSIGNED, 8}, // 9=VTK_UNSIGNED_LONG + { WK_FLOAT, SGN_SIGNED, 4}, // 10=VTK_FLOAT + { WK_FIXED, SGN_SIGNED, 8} // 11=VTK_DOUBLE + }; + +} //end anonymous namespace + +namespace IO { + +inline +Image_3 +read_vtk_image_data(vtkImageData* vtk_image, Image_3::Own owning = Image_3::OWN_THE_DATA) +{ + if(!vtk_image) + return Image_3(); + + _image* image = ::_initImage(); + const int* dims = vtk_image->GetDimensions(); + const double* spacing = vtk_image->GetSpacing(); + const double* offset = vtk_image->GetOrigin(); + image->vectMode = VM_SCALAR; + image->xdim = dims[0]; + image->ydim = dims[1]; + image->zdim = dims[2]; + image->vdim = 1; + image->vx = (spacing[0] == 0) ? 1 : spacing[0]; + image->vy = (spacing[1] == 0) ? 1 : spacing[1]; + image->vz = (spacing[2] == 0) ? 1 : spacing[2]; + image->tx = static_cast(offset[0]); + image->ty = static_cast(offset[1]); + image->tz = static_cast(offset[2]); + image->endianness = ::_getEndianness(); + int vtk_type = vtk_image->GetScalarType(); + if(vtk_type == VTK_SIGNED_CHAR) vtk_type = VTK_CHAR; + if(vtk_type < 0 || vtk_type > VTK_DOUBLE) + vtk_type = VTK_DOUBLE; + const VTK_to_ImageIO_type_mapper& imageio_type = + VTK_to_ImageIO_type[vtk_type]; + image->wdim = imageio_type.wdim; + image->wordKind = imageio_type.wordKind; + image->sign = imageio_type.sign; + if (!vtk_image->GetPointData() || !vtk_image->GetPointData()->GetScalars()) { + ::_freeImage(image); + return Image_3(); + } + CGAL_assertion(vtk_image->GetPointData()->GetScalars()->GetNumberOfTuples() == dims[0]*dims[1]*dims[2]); + if(owning == Image_3::OWN_THE_DATA) { + image->data = ::ImageIO_alloc(dims[0]*dims[1]*dims[2]*image->wdim); + // std::cerr << "GetNumberOfTuples()=" << vtk_image->GetPointData()->GetScalars()->GetNumberOfTuples() + // << "\nimage->size()=" << dims[0]*dims[1]*dims[2] + // << "\nwdim=" << image->wdim << '\n'; + vtk_image->GetPointData()->GetScalars()->ExportToVoidPointer(image->data); + } else { + image->data = vtk_image->GetPointData()->GetScalars()->GetVoidPointer(0); + } + + return Image_3(image, owning); +} + +} // namespace IO + +#ifndef CGAL_NO_DEPRECATED_CODE +using IO::read_vtk_image_data; +#endif + +} // namespace CGAL + + +#endif // CGAL_IO_READ_VTK_IMAGE_DATA_H diff --git a/CGAL_ImageIO/include/CGAL/Image_3.h b/CGAL_ImageIO/include/CGAL/Image_3.h index 4197574199e..8ede8eefec5 100644 --- a/CGAL_ImageIO/include/CGAL/Image_3.h +++ b/CGAL_ImageIO/include/CGAL/Image_3.h @@ -19,7 +19,7 @@ #include #include -#include +#include #include #include #include @@ -81,7 +81,7 @@ class CGAL_IMAGEIO_EXPORT Image_3 public: enum Own { OWN_THE_DATA, DO_NOT_OWN_THE_DATA }; - typedef boost::shared_ptr<_image> Image_shared_ptr; + typedef std::shared_ptr<_image> Image_shared_ptr; typedef Image_shared_ptr Pointer; protected: diff --git a/CGAL_ImageIO/include/CGAL/read_vtk_image_data.h b/CGAL_ImageIO/include/CGAL/read_vtk_image_data.h index 527b7ba973e..78f6586325f 100644 --- a/CGAL_ImageIO/include/CGAL/read_vtk_image_data.h +++ b/CGAL_ImageIO/include/CGAL/read_vtk_image_data.h @@ -14,87 +14,12 @@ #ifndef CGAL_READ_VTK_IMAGE_DATA_H #define CGAL_READ_VTK_IMAGE_DATA_H -#include -#include - -namespace CGAL { - -namespace { - -struct VTK_to_ImageIO_type_mapper { - WORD_KIND wordKind; - SIGN sign; - unsigned int wdim; -}; - -static const VTK_to_ImageIO_type_mapper VTK_to_ImageIO_type[VTK_ID_TYPE] = - { { WK_UNKNOWN, SGN_UNKNOWN, 0}, // 0=VTK_VOID - { WK_UNKNOWN, SGN_UNKNOWN, 0}, // 1=VTK_BIT - { WK_FIXED, SGN_SIGNED, 1}, // 2=VTK_CHAR - { WK_FIXED, SGN_UNSIGNED, 1}, // 3=VTK_UNSIGNED_CHAR - { WK_FIXED, SGN_SIGNED, 2}, // 4=VTK_SHORT - { WK_FIXED, SGN_UNSIGNED, 2}, // 5=VTK_UNSIGNED_SHORT - { WK_FIXED, SGN_SIGNED, 4}, // 6=VTK_INT - { WK_FIXED, SGN_UNSIGNED, 4}, // 7=VTK_UNSIGNED_INT - { WK_FIXED, SGN_SIGNED, 8}, // 8=VTK_LONG - { WK_FIXED, SGN_UNSIGNED, 8}, // 9=VTK_UNSIGNED_LONG - { WK_FLOAT, SGN_SIGNED, 4}, // 10=VTK_FLOAT - { WK_FIXED, SGN_SIGNED, 8} // 11=VTK_DOUBLE - }; - -} //end anonymous namespace - -inline -Image_3 -read_vtk_image_data(vtkImageData* vtk_image, Image_3::Own owning = Image_3::OWN_THE_DATA) -{ - if(!vtk_image) - return Image_3(); - - _image* image = ::_initImage(); - const int* dims = vtk_image->GetDimensions(); - const double* spacing = vtk_image->GetSpacing(); - const double* offset = vtk_image->GetOrigin(); - image->vectMode = VM_SCALAR; - image->xdim = dims[0]; - image->ydim = dims[1]; - image->zdim = dims[2]; - image->vdim = 1; - image->vx = (spacing[0] == 0) ? 1 : spacing[0]; - image->vy = (spacing[1] == 0) ? 1 : spacing[1]; - image->vz = (spacing[2] == 0) ? 1 : spacing[2]; - image->tx = static_cast(offset[0]); - image->ty = static_cast(offset[1]); - image->tz = static_cast(offset[2]); - image->endianness = ::_getEndianness(); - int vtk_type = vtk_image->GetScalarType(); - if(vtk_type == VTK_SIGNED_CHAR) vtk_type = VTK_CHAR; - if(vtk_type < 0 || vtk_type > VTK_DOUBLE) - vtk_type = VTK_DOUBLE; - const VTK_to_ImageIO_type_mapper& imageio_type = - VTK_to_ImageIO_type[vtk_type]; - image->wdim = imageio_type.wdim; - image->wordKind = imageio_type.wordKind; - image->sign = imageio_type.sign; - if (!vtk_image->GetPointData() || !vtk_image->GetPointData()->GetScalars()) { - ::_freeImage(image); - return Image_3(); - } - CGAL_assertion(vtk_image->GetPointData()->GetScalars()->GetNumberOfTuples() == dims[0]*dims[1]*dims[2]); - if(owning == Image_3::OWN_THE_DATA) { - image->data = ::ImageIO_alloc(dims[0]*dims[1]*dims[2]*image->wdim); - // std::cerr << "GetNumberOfTuples()=" << vtk_image->GetPointData()->GetScalars()->GetNumberOfTuples() - // << "\nimage->size()=" << dims[0]*dims[1]*dims[2] - // << "\nwdim=" << image->wdim << '\n'; - vtk_image->GetPointData()->GetScalars()->ExportToVoidPointer(image->data); - } else { - image->data = vtk_image->GetPointData()->GetScalars()->GetVoidPointer(0); - } - - return Image_3(image, owning); -} - -} // namespace CGAL +#ifndef CGAL_NO_DEPRECATED_CODE +#include +#define CGAL_DEPRECATED_HEADER "" +#define CGAL_REPLACEMENT_HEADER "" +#include +#endif #endif // CGAL_READ_VTK_IMAGE_DATA_H diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_2.h b/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_2.h index bb646e29e66..16395549ab3 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_2.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_2.h @@ -165,6 +165,11 @@ public: bool is_even() const { return this->Ptr()->is_even(); } bool is_odd() const { return ! (this->Ptr()->is_even()); } + bool is_translation() const { return this->Ptr()->is_translation(); } + bool is_scaling() const { return this->Ptr()->is_scaling(); } + bool is_reflection() const { return this->Ptr()->is_reflection(); } + bool is_rotation() const { return this->Ptr()->is_rotation(); } + FT cartesian(int i, int j) const { return this->Ptr()->cartesian(i,j); } FT homogeneous(int i, int j) const { return cartesian(i,j); } FT m(int i, int j) const { return cartesian(i,j); } diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_3.h b/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_3.h index 7a04f837092..d696e1917a3 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_3.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_3.h @@ -143,14 +143,7 @@ public: Plane_3 transform(const Plane_3& p) const - { - if (is_even()) - return Plane_3(transform(p.point()), - transpose().inverse().transform(p.orthogonal_direction())); - else - return Plane_3(transform(p.point()), - - transpose().inverse().transform(p.orthogonal_direction())); - } + { return this->Ptr()->transform(p); } Plane_3 operator()(const Plane_3& p) const @@ -161,6 +154,10 @@ public: bool is_even() const { return this->Ptr()->is_even(); } bool is_odd() const { return ! (this->Ptr()->is_even()); } + bool is_translation() const { return this->Ptr()->is_translation(); } + bool is_scaling() const { return this->Ptr()->is_scaling(); } + + FT cartesian(int i, int j) const { return this->Ptr()->cartesian(i,j); } FT homogeneous(int i, int j) const { return cartesian(i,j); } FT m(int i, int j) const { return cartesian(i,j); } diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_rep_2.h b/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_rep_2.h index 4737742e568..afce7dc25ed 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_rep_2.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_rep_2.h @@ -60,6 +60,11 @@ public: virtual Aff_transformation_2 inverse() const = 0; virtual bool is_even() const = 0; + virtual bool is_translation() const { return false; } + virtual bool is_scaling() const { return false; } + virtual bool is_rotation() const { return false; } + virtual bool is_reflection() const { return false; } + virtual FT cartesian(int i, int j) const = 0; virtual std::ostream &print(std::ostream &os) const = 0; }; diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_rep_3.h b/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_rep_3.h index 406cb7accca..2e441e194d3 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_rep_3.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Aff_transformation_rep_3.h @@ -31,6 +31,7 @@ public: typedef typename R::Point_3 Point_3; typedef typename R::Vector_3 Vector_3; typedef typename R::Direction_3 Direction_3; + typedef typename R::Plane_3 Plane_3; typedef typename R::Aff_transformation_3 Aff_transformation_3; virtual ~Aff_transformation_rep_baseC3(){} @@ -38,6 +39,7 @@ public: virtual Point_3 transform(const Point_3 &p) const = 0; virtual Vector_3 transform(const Vector_3 &v) const = 0; virtual Direction_3 transform(const Direction_3 &d) const = 0; + virtual Plane_3 transform(const Plane_3& p) const = 0; virtual Aff_transformation_3 operator*( const Aff_transformation_rep_baseC3 &t) const = 0; @@ -54,6 +56,9 @@ public: virtual Aff_transformation_3 inverse() const = 0; virtual Aff_transformation_3 transpose() const = 0; virtual bool is_even() const = 0; + + virtual bool is_translation() const { return false; } + virtual bool is_scaling() const { return false; } virtual FT cartesian(int i, int j) const = 0; virtual std::ostream &print(std::ostream &os) const = 0; }; @@ -75,6 +80,7 @@ public: typedef typename Transformation_base_3::Point_3 Point_3; typedef typename Transformation_base_3::Vector_3 Vector_3; typedef typename Transformation_base_3::Direction_3 Direction_3; + typedef typename Transformation_base_3::Plane_3 Plane_3; typedef typename Transformation_base_3:: Aff_transformation_3 Aff_transformation_3; @@ -127,6 +133,17 @@ public: t31 * v.x() + t32 * v.y() + t33 * v.z()); } + virtual Plane_3 transform(const Plane_3& p) const + { + if (is_even()) + return Plane_3(transform(p.point()), + transpose().inverse().transform(p.orthogonal_direction())); + else + return Plane_3(transform(p.point()), + - transpose().inverse().transform(p.orthogonal_direction())); + } + + // Note that Aff_transformation is not defined yet, // so the following 6 functions have to be implemented // outside class body @@ -144,6 +161,7 @@ public: t31, t32, t33) == POSITIVE; } + virtual FT cartesian(int i, int j) const { switch (i) diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Reflection_rep_2.h b/Cartesian_kernel/include/CGAL/Cartesian/Reflection_rep_2.h index b534706373e..7a89746ffba 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Reflection_rep_2.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Reflection_rep_2.h @@ -147,6 +147,11 @@ typedef typename CGAL::Line_2 Line_2; return true; } + virtual bool is_reflection() const + { + return true; + } + FT cartesian(int i, int j) const { switch (i) diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Rotation_rep_2.h b/Cartesian_kernel/include/CGAL/Cartesian/Rotation_rep_2.h index 092ff614195..2ea097c733b 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Rotation_rep_2.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Rotation_rep_2.h @@ -139,11 +139,17 @@ public: -sinus_*t.t21 + cosinus_*t.t22, t.t23); } + bool is_even() const { return true; } + bool is_rotation() const + { + return true; + } + FT cartesian(int i, int j) const { switch (i) diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Scaling_rep_2.h b/Cartesian_kernel/include/CGAL/Cartesian/Scaling_rep_2.h index dc0b74f5905..166fa4e1a53 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Scaling_rep_2.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Scaling_rep_2.h @@ -120,6 +120,11 @@ public: return true; } + bool is_scaling() const + { + return true; + } + FT cartesian(int i, int j) const { if (i!=j) return FT(0); diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Scaling_rep_3.h b/Cartesian_kernel/include/CGAL/Cartesian/Scaling_rep_3.h index 061f1806a9e..a6b26320a8e 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Scaling_rep_3.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Scaling_rep_3.h @@ -34,6 +34,7 @@ public: typedef typename Transformation_base_3::Point_3 Point_3; typedef typename Transformation_base_3::Vector_3 Vector_3; typedef typename Transformation_base_3::Direction_3 Direction_3; + typedef typename Transformation_base_3::Plane_3 Plane_3; typedef typename Transformation_base_3::Aff_transformation_3 Aff_transformation_3; @@ -59,6 +60,12 @@ public: return d; } + virtual Plane_3 transform(const Plane_3 &p) const + { + // direction ( which is (p.a(), p.b(), p.c())) does not change + return Plane_3(p.a(),p.b(),p.c(), p.d()*scalefactor_); + } + virtual Aff_transformation_3 operator*(const Transformation_base_3 &t) const { return t.compose(*this); @@ -121,6 +128,11 @@ public: return true; } + virtual bool is_scaling() const + { + return true; + } + virtual FT cartesian(int i, int j) const { if (i!=j) return FT(0); diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Translation_rep_2.h b/Cartesian_kernel/include/CGAL/Cartesian/Translation_rep_2.h index 55e3b14fbc1..84b88ba46c5 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Translation_rep_2.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Translation_rep_2.h @@ -121,7 +121,12 @@ public: return Aff_transformation_2(TRANSLATION, - translationvector_); } - bool is_even() const + bool is_even() const + { + return true; + } + + virtual bool is_translation() const { return true; } diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Translation_rep_3.h b/Cartesian_kernel/include/CGAL/Cartesian/Translation_rep_3.h index 6377c1a3d8a..28a1d4ef811 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Translation_rep_3.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Translation_rep_3.h @@ -34,6 +34,7 @@ public: typedef typename Transformation_base_3::Point_3 Point_3; typedef typename Transformation_base_3::Vector_3 Vector_3; typedef typename Transformation_base_3::Direction_3 Direction_3; + typedef typename Transformation_base_3::Plane_3 Plane_3; typedef typename Transformation_base_3::Aff_transformation_3 Aff_transformation_3; @@ -56,6 +57,15 @@ public: return d; } + virtual Plane_3 transform(const Plane_3 &p) const + { + // direction ( which is (p.a(), p.b(), p.c())) does not change + return Plane_3(p.a(), + p.b(), + p.c(), + p.d() - ( p.a()*translationvector_.x() + p.b()*translationvector_.y() + p.c()*translationvector_.z())); + } + virtual Aff_transformation_3 operator*(const Transformation_base_3 &t) const { return t.compose(*this); @@ -125,6 +135,11 @@ public: return true; } + virtual bool is_translation() const + { + return true; + } + virtual FT cartesian(int i, int j) const { if (j==i) return FT(1); diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Weighted_point_2.h b/Cartesian_kernel/include/CGAL/Cartesian/Weighted_point_2.h index db5e9f1b98e..3e584ea9830 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Weighted_point_2.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Weighted_point_2.h @@ -79,7 +79,7 @@ template < class R_ > std::ostream & operator<<(std::ostream &os, const Weighted_pointC2 &p) { - switch(get_mode(os)) + switch(IO::get_mode(os)) { case IO::ASCII : return os << p.point() << " " << p.weight(); @@ -100,7 +100,7 @@ operator>>(std::istream &is, Weighted_pointC2 &wp) typename Weighted_pointC2::Point_2 p; is >> p; if(!is) return is; - if(is_ascii(is)) + if(IO::is_ascii(is)) is >> w; else read(is, w); diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Weighted_point_3.h b/Cartesian_kernel/include/CGAL/Cartesian/Weighted_point_3.h index 295686a3ac8..c1309fde4d8 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Weighted_point_3.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Weighted_point_3.h @@ -79,7 +79,7 @@ template < class R_ > std::ostream & operator<<(std::ostream &os, const Weighted_pointC3 &p) { - switch(get_mode(os)) + switch(IO::get_mode(os)) { case IO::ASCII : return os << p.point() << " " << p.weight(); @@ -100,7 +100,7 @@ operator>>(std::istream &is, Weighted_pointC3 &wp) typename Weighted_pointC3::Point_3 p; is >> p; if(!is) return is; - if(is_ascii(is)) + if(IO::is_ascii(is)) is >> w; else read(is, w); diff --git a/Circular_kernel_2/include/CGAL/IO/Dxf_reader.h b/Circular_kernel_2/include/CGAL/IO/Dxf_reader.h index e72a21197dc..bf00857272b 100644 --- a/Circular_kernel_2/include/CGAL/IO/Dxf_reader.h +++ b/Circular_kernel_2/include/CGAL/IO/Dxf_reader.h @@ -120,13 +120,13 @@ private: is >> n; CGAL_assertion(n == 10); - is >> iformat(cx); + is >> IO::iformat(cx); is >> n; CGAL_assertion(n == 20); - is >> iformat(cy); + is >> IO::iformat(cy); is >> n; CGAL_assertion(n == 40); - is >> iformat(r); + is >> IO::iformat(r); FT sqr_ft(r*r); circ = typename K::Construct_circle_2()(Point_2(cx,cy), sqr_ft); } @@ -144,13 +144,13 @@ private: is >> n; CGAL_assertion(n == 10); - is >> iformat(cx); + is >> IO::iformat(cx); is >> n; CGAL_assertion(n == 20); - is >> iformat(cy); + is >> IO::iformat(cy); is >> n; CGAL_assertion(n == 40); - is >> iformat(r); + is >> IO::iformat(r); center = typename K::Construct_point_2()(cx,cy); rft = FT(r); // intentionally not squared @@ -181,10 +181,10 @@ read_polygon(std::istream& is, Polygon& poly) CGAL_assertion(n == 0); is >> n; CGAL_assertion(n == 10); - is >> iformat(x); + is >> IO::iformat(x); is >> n; CGAL_assertion(n == 20); - is >> iformat(y); + is >> IO::iformat(y); is >> n; len = 0; if(n == 42){ diff --git a/Circular_kernel_2/include/CGAL/IO/Dxf_reader_doubles.h b/Circular_kernel_2/include/CGAL/IO/Dxf_reader_doubles.h index df8895e6b33..4da1adc4c96 100644 --- a/Circular_kernel_2/include/CGAL/IO/Dxf_reader_doubles.h +++ b/Circular_kernel_2/include/CGAL/IO/Dxf_reader_doubles.h @@ -124,13 +124,13 @@ private: is >> n; CGAL_assertion(n == 10); - is >> iformat(cx); + is >> IO::iformat(cx); is >> n; CGAL_assertion(n == 20); - is >> iformat(cy); + is >> IO::iformat(cy); is >> n; CGAL_assertion(n == 40); - is >> iformat(r); + is >> IO::iformat(r); FT sqr_ft(r*r); circ = CGAL::make_array(cx,cy,sqr_ft); } @@ -160,10 +160,10 @@ read_polygon(std::istream& is, Polygon& poly) CGAL_assertion(n == 0); is >> n; CGAL_assertion(n == 10); - is >> iformat(x); + is >> IO::iformat(x); is >> n; CGAL_assertion(n == 20); - is >> iformat(y); + is >> IO::iformat(y); is >> n; len = 0; if(n == 42){ diff --git a/Classification/examples/Classification/example_classification.cpp b/Classification/examples/Classification/example_classification.cpp index 4ccad1912eb..7c1424a9fd1 100644 --- a/Classification/examples/Classification/example_classification.cpp +++ b/Classification/examples/Classification/example_classification.cpp @@ -52,9 +52,9 @@ int main (int argc, char** argv) std::cerr << "Reading input" << std::endl; std::vector pts; - if (!(CGAL::read_points(filename, std::back_inserter(pts), - // the PLY reader expects a binary file by default - CGAL::parameters::use_binary_mode(false)))) + if (!(CGAL::IO::read_points(filename, std::back_inserter(pts), + // the PLY reader expects a binary file by default + CGAL::parameters::use_binary_mode(false)))) { std::cerr << "Error: cannot read " << filename << std::endl; return EXIT_FAILURE; @@ -107,10 +107,10 @@ int main (int argc, char** argv) Label_handle ground = labels.add ("ground"); // Init name and color - Label_handle vegetation = labels.add ("vegetation", CGAL::Color(0,255,0)); + Label_handle vegetation = labels.add ("vegetation", CGAL::IO::Color(0,255,0)); // Init name, Color and standard index (here, ASPRS building index) - Label_handle roof = labels.add ("roof", CGAL::Color (255, 0, 0), 6); + Label_handle roof = labels.add ("roof", CGAL::IO::Color (255, 0, 0), 6); //! [Labels] /////////////////////////////////////////////////////////////////// @@ -211,7 +211,7 @@ int main (int argc, char** argv) std::ofstream f ("classification.ply"); - CGAL::write_PLY_with_properties + CGAL::IO::write_PLY_with_properties (f, CGAL::make_range (boost::counting_iterator(0), boost::counting_iterator(pts.size())), CGAL::make_ply_point_writer (CGAL::make_property_map(pts)), diff --git a/Classification/examples/Classification/example_cluster_classification.cpp b/Classification/examples/Classification/example_cluster_classification.cpp index ea11160b881..b044324fc0e 100644 --- a/Classification/examples/Classification/example_cluster_classification.cpp +++ b/Classification/examples/Classification/example_cluster_classification.cpp @@ -58,9 +58,9 @@ int main (int argc, char** argv) std::cerr << "Reading input" << std::endl; Point_set pts; - if(!(CGAL::read_point_set(filename, pts, - // the PLY reader expects a binary file by default - CGAL::parameters::use_binary_mode(true)))) + if(!(CGAL::IO::read_point_set(filename, pts, + // the PLY reader expects a binary file by default + CGAL::parameters::use_binary_mode(true)))) { std::cerr << "Error: cannot read " << filename << std::endl; return EXIT_FAILURE; diff --git a/Classification/examples/Classification/example_ethz_random_forest.cpp b/Classification/examples/Classification/example_ethz_random_forest.cpp index b0333f58ec4..cfb33d8c2b4 100644 --- a/Classification/examples/Classification/example_ethz_random_forest.cpp +++ b/Classification/examples/Classification/example_ethz_random_forest.cpp @@ -129,7 +129,7 @@ int main (int argc, char** argv) label_map[i] = label_indices[i]; // update label map with computed classification Label_handle label = labels[label_indices[i]]; - const CGAL::Color& color = label->color(); + const CGAL::IO::Color& color = label->color(); red[i] = color.red(); green[i] = color.green(); blue[i] = color.blue(); diff --git a/Classification/examples/Classification/example_feature.cpp b/Classification/examples/Classification/example_feature.cpp index f20ec6661b9..3c39407d41a 100644 --- a/Classification/examples/Classification/example_feature.cpp +++ b/Classification/examples/Classification/example_feature.cpp @@ -70,9 +70,9 @@ int main (int argc, char** argv) std::vector pts; std::cerr << "Reading input" << std::endl; - if (!(CGAL::read_points(filename, std::back_inserter(pts), - // the PLY reader expects a binary file by default - CGAL::parameters::use_binary_mode(false)))) + if (!(CGAL::IO::read_points(filename, std::back_inserter(pts), + // the PLY reader expects a binary file by default + CGAL::parameters::use_binary_mode(false)))) { std::cerr << "Error: cannot read " << filename << std::endl; return EXIT_FAILURE; diff --git a/Classification/examples/Classification/example_mesh_classification.cpp b/Classification/examples/Classification/example_mesh_classification.cpp index 226bd23ad72..104236d5495 100644 --- a/Classification/examples/Classification/example_mesh_classification.cpp +++ b/Classification/examples/Classification/example_mesh_classification.cpp @@ -40,9 +40,9 @@ int main (int argc, char** argv) filename_config = argv[2]; Mesh mesh; - if(!CGAL::read_polygon_mesh(filename, mesh, - // the PLY reader expects a binary file by default - CGAL::parameters::use_binary_mode(false))) + if(!CGAL::IO::read_polygon_mesh(filename, mesh, + // the PLY reader expects a binary file by default + CGAL::parameters::use_binary_mode(false))) { std::cerr << "Invalid input." << std::endl; return 1; diff --git a/Classification/examples/Classification/example_opencv_random_forest.cpp b/Classification/examples/Classification/example_opencv_random_forest.cpp index 52a6bbaa379..2a73d846685 100644 --- a/Classification/examples/Classification/example_opencv_random_forest.cpp +++ b/Classification/examples/Classification/example_opencv_random_forest.cpp @@ -121,7 +121,7 @@ int main (int argc, char** argv) label_map[i] = label_indices[i]; // update label map with computed classification Label_handle label = labels[label_indices[i]]; - const CGAL::Color& color = label->color(); + const CGAL::IO::Color& color = label->color(); red[i] = color.red(); green[i] = color.green(); blue[i] = color.blue(); diff --git a/Classification/examples/Classification/gis_tutorial_example.cpp b/Classification/examples/Classification/gis_tutorial_example.cpp index 996ec59ea9e..fe90c423415 100644 --- a/Classification/examples/Classification/gis_tutorial_example.cpp +++ b/Classification/examples/Classification/gis_tutorial_example.cpp @@ -217,8 +217,8 @@ int main (int argc, char** argv) Mesh dsm_mesh; CGAL::copy_face_graph (dsm, dsm_mesh); std::ofstream dsm_ofile ("dsm.ply", std::ios_base::binary); - CGAL::set_binary_mode (dsm_ofile); - CGAL::write_PLY (dsm_ofile, dsm_mesh); + CGAL::IO::set_binary_mode (dsm_ofile); + CGAL::IO::write_PLY (dsm_ofile, dsm_mesh); dsm_ofile.close(); //! [Save DSM] @@ -300,8 +300,8 @@ int main (int argc, char** argv) Mesh tin_colored_mesh; - Mesh::Property_map - color_map = tin_colored_mesh.add_property_map("f:color").first; + Mesh::Property_map + color_map = tin_colored_mesh.add_property_map("f:color").first; CGAL::copy_face_graph (tin_with_info, tin_colored_mesh, CGAL::parameters::face_to_face_output_iterator @@ -310,20 +310,20 @@ int main (int argc, char** argv) { // Color unassigned faces gray if (ff.first->info() < 0) - color_map[ff.second] = CGAL::Color(128, 128, 128); + color_map[ff.second] = CGAL::IO::Color(128, 128, 128); else { // Random color seeded by the component ID CGAL::Random r (ff.first->info()); - color_map[ff.second] = CGAL::Color (r.get_int(64, 192), + color_map[ff.second] = CGAL::IO::Color (r.get_int(64, 192), r.get_int(64, 192), r.get_int(64, 192)); } }))); std::ofstream tin_colored_ofile ("colored_tin.ply", std::ios_base::binary); - CGAL::set_binary_mode (tin_colored_ofile); - CGAL::write_PLY (tin_colored_ofile, tin_colored_mesh); + CGAL::IO::set_binary_mode (tin_colored_ofile); + CGAL::IO::write_PLY (tin_colored_ofile, tin_colored_mesh); tin_colored_ofile.close(); //! [Save TIN with info] @@ -415,8 +415,8 @@ int main (int argc, char** argv) // Save original DTM std::ofstream dtm_ofile ("dtm.ply", std::ios_base::binary); - CGAL::set_binary_mode (dtm_ofile); - CGAL::write_PLY (dtm_ofile, dtm_mesh); + CGAL::IO::set_binary_mode (dtm_ofile); + CGAL::IO::write_PLY (dtm_ofile, dtm_mesh); dtm_ofile.close(); std::cerr << face_selection.size() << " face(s) are selected for removal" << std::endl; @@ -439,8 +439,8 @@ int main (int argc, char** argv) // Save filtered DTM std::ofstream dtm_holes_ofile ("dtm_with_holes.ply", std::ios_base::binary); - CGAL::set_binary_mode (dtm_holes_ofile); - CGAL::write_PLY (dtm_holes_ofile, dtm_mesh); + CGAL::IO::set_binary_mode (dtm_holes_ofile); + CGAL::IO::write_PLY (dtm_holes_ofile, dtm_mesh); dtm_holes_ofile.close(); // Get all holes @@ -477,8 +477,8 @@ int main (int argc, char** argv) // Save DTM with holes filled std::ofstream dtm_filled_ofile ("dtm_filled.ply", std::ios_base::binary); - CGAL::set_binary_mode (dtm_filled_ofile); - CGAL::write_PLY (dtm_filled_ofile, dtm_mesh); + CGAL::IO::set_binary_mode (dtm_filled_ofile); + CGAL::IO::write_PLY (dtm_filled_ofile, dtm_mesh); dtm_filled_ofile.close(); //! [Hole filling] @@ -490,8 +490,8 @@ int main (int argc, char** argv) CGAL::Polygon_mesh_processing::isotropic_remeshing (faces(dtm_mesh), spacing, dtm_mesh); std::ofstream dtm_remeshed_ofile ("dtm_remeshed.ply", std::ios_base::binary); - CGAL::set_binary_mode (dtm_remeshed_ofile); - CGAL::write_PLY (dtm_remeshed_ofile, dtm_mesh); + CGAL::IO::set_binary_mode (dtm_remeshed_ofile); + CGAL::IO::write_PLY (dtm_remeshed_ofile, dtm_mesh); dtm_remeshed_ofile.close(); //! [Remeshing] @@ -642,7 +642,7 @@ int main (int argc, char** argv) // Output to WKT file std::ofstream contour_ofile ("contour.wkt"); contour_ofile.precision(18); - CGAL::write_multi_linestring_WKT (contour_ofile, polylines); + CGAL::IO::write_multi_linestring_WKT (contour_ofile, polylines); contour_ofile.close(); //! [Contouring split] @@ -680,7 +680,7 @@ int main (int argc, char** argv) // Output to WKT file std::ofstream simplified_ofile ("simplified.wkt"); simplified_ofile.precision(18); - CGAL::write_multi_linestring_WKT (simplified_ofile, polylines); + CGAL::IO::write_multi_linestring_WKT (simplified_ofile, polylines); simplified_ofile.close(); //! [Contouring simplify] @@ -736,7 +736,7 @@ int main (int argc, char** argv) // Save the classified point set std::ofstream classified_ofile ("classified.ply"); - CGAL::set_binary_mode (classified_ofile); + CGAL::IO::set_binary_mode (classified_ofile); classified_ofile << points; classified_ofile.close(); } diff --git a/Classification/include/CGAL/Classification/Feature/Color_channel.h b/Classification/include/CGAL/Classification/Feature/Color_channel.h index b0296d191bb..2ca3825491a 100644 --- a/Classification/include/CGAL/Classification/Feature/Color_channel.h +++ b/Classification/include/CGAL/Classification/Feature/Color_channel.h @@ -56,7 +56,7 @@ namespace Feature { `ColorMap`. \tparam ColorMap model of `ReadablePropertyMap` whose key type is the value type of the iterator of `PointRange` and value type - is `CGAL::Color`. + is `CGAL::IO::Color`. */ template class Color_channel : public Feature_base diff --git a/Classification/include/CGAL/Classification/Label.h b/Classification/include/CGAL/Classification/Label.h index 6a21b630768..7801942afcb 100644 --- a/Classification/include/CGAL/Classification/Label.h +++ b/Classification/include/CGAL/Classification/Label.h @@ -15,6 +15,7 @@ #include #include +#include #include namespace CGAL { @@ -39,7 +40,7 @@ private: std::string m_name; std::size_t m_index; std::size_t m_standard_index; - CGAL::Color m_color; + CGAL::IO::Color m_color; friend Label_set; @@ -48,7 +49,7 @@ public: /// \cond SKIP_IN_MANUAL // Undocumented: Labels should be created by the set Label (std::string name, std::size_t index, std::size_t standard_index, - const CGAL::Color& color) + const CGAL::IO::Color& color) : m_name (name), m_index (index), m_standard_index (standard_index) , m_color (color) { } @@ -84,7 +85,7 @@ public: attribute embedded in a data set which _can_ be used (see `Color_channel`). */ - const CGAL::Color& color() const { return m_color; } + const CGAL::IO::Color& color() const { return m_color; } /// @} @@ -93,7 +94,7 @@ public: void set_name (const std::string& name) { m_name = name; } void set_standard_index(std::size_t idx) { m_standard_index = idx; } - void set_color (const Color& color) { m_color = color; } + void set_color (const IO::Color& color) { m_color = color; } /// @} }; diff --git a/Classification/include/CGAL/Classification/Label_set.h b/Classification/include/CGAL/Classification/Label_set.h index d95902b9258..8af0f5e935b 100644 --- a/Classification/include/CGAL/Classification/Label_set.h +++ b/Classification/include/CGAL/Classification/Label_set.h @@ -86,7 +86,7 @@ public: \return a handle to the newly added label. */ Label_handle add (const char* name, - CGAL::Color color, + CGAL::IO::Color color, std::size_t standard_index = -1) { Label_handle out = std::make_shared @@ -135,70 +135,70 @@ public: */ Label_handle add (const char* name) { - static std::unordered_map > init_map; + static std::unordered_map > init_map; if (init_map.empty()) { init_map.insert (std::make_pair ("unassigned", - std::make_pair (2, CGAL::Color (0, 0, 0)))); + std::make_pair (2, CGAL::IO::Color (0, 0, 0)))); init_map.insert (std::make_pair ("ground", - std::make_pair (2, CGAL::Color (186, 189, 182)))); + std::make_pair (2, CGAL::IO::Color (186, 189, 182)))); init_map.insert (std::make_pair ("low_vegetation", - std::make_pair (3, CGAL::Color (78, 154, 6)))); + std::make_pair (3, CGAL::IO::Color (78, 154, 6)))); init_map.insert (std::make_pair ("medium_vegetation", - std::make_pair (4, CGAL::Color (138, 226, 52)))); + std::make_pair (4, CGAL::IO::Color (138, 226, 52)))); init_map.insert (std::make_pair ("high_vegetation", - std::make_pair (5, CGAL::Color (204, 255, 201)))); + std::make_pair (5, CGAL::IO::Color (204, 255, 201)))); init_map.insert (std::make_pair ("building", - std::make_pair (6, CGAL::Color (245, 121, 0)))); + std::make_pair (6, CGAL::IO::Color (245, 121, 0)))); init_map.insert (std::make_pair ("noise", - std::make_pair (7, CGAL::Color (128, 0, 0)))); + std::make_pair (7, CGAL::IO::Color (128, 0, 0)))); init_map.insert (std::make_pair ("reserved", - std::make_pair (8, CGAL::Color (233, 185, 110)))); + std::make_pair (8, CGAL::IO::Color (233, 185, 110)))); init_map.insert (std::make_pair ("water", - std::make_pair (9, CGAL::Color (114, 159, 207)))); + std::make_pair (9, CGAL::IO::Color (114, 159, 207)))); init_map.insert (std::make_pair ("rail", - std::make_pair (10, CGAL::Color (136, 46, 25)))); + std::make_pair (10, CGAL::IO::Color (136, 46, 25)))); init_map.insert (std::make_pair ("road_surface", - std::make_pair (11, CGAL::Color (56, 56, 56)))); + std::make_pair (11, CGAL::IO::Color (56, 56, 56)))); init_map.insert (std::make_pair ("reserved_2", - std::make_pair (12, CGAL::Color (193, 138, 51)))); + std::make_pair (12, CGAL::IO::Color (193, 138, 51)))); init_map.insert (std::make_pair ("wire_guard", - std::make_pair (13, CGAL::Color (37, 61, 136)))); + std::make_pair (13, CGAL::IO::Color (37, 61, 136)))); init_map.insert (std::make_pair ("wire_conductor", - std::make_pair (14, CGAL::Color (173, 127, 168)))); + std::make_pair (14, CGAL::IO::Color (173, 127, 168)))); init_map.insert (std::make_pair ("wire_conduct", - std::make_pair (14, CGAL::Color (173, 127, 168)))); + std::make_pair (14, CGAL::IO::Color (173, 127, 168)))); init_map.insert (std::make_pair ("transmission_tower", - std::make_pair (15, CGAL::Color (136, 138, 133)))); + std::make_pair (15, CGAL::IO::Color (136, 138, 133)))); init_map.insert (std::make_pair ("trans_tower", - std::make_pair (15, CGAL::Color (136, 138, 133)))); + std::make_pair (15, CGAL::IO::Color (136, 138, 133)))); init_map.insert (std::make_pair ("wire_connect", - std::make_pair (16, CGAL::Color (145, 64, 236)))); + std::make_pair (16, CGAL::IO::Color (145, 64, 236)))); init_map.insert (std::make_pair ("bridge_deck", - std::make_pair (17, CGAL::Color (213, 93, 93)))); + std::make_pair (17, CGAL::IO::Color (213, 93, 93)))); init_map.insert (std::make_pair ("high_noise", - std::make_pair (18, CGAL::Color (255, 0, 0)))); + std::make_pair (18, CGAL::IO::Color (255, 0, 0)))); // Undocumented additions init_map.insert (std::make_pair ("low_veget", - std::make_pair (3, CGAL::Color (78, 154, 6)))); + std::make_pair (3, CGAL::IO::Color (78, 154, 6)))); init_map.insert (std::make_pair ("medium_veget", - std::make_pair (4, CGAL::Color (138, 226, 52)))); + std::make_pair (4, CGAL::IO::Color (138, 226, 52)))); init_map.insert (std::make_pair ("vegetation", - std::make_pair (4, CGAL::Color (138, 226, 52)))); + std::make_pair (4, CGAL::IO::Color (138, 226, 52)))); init_map.insert (std::make_pair ("high_veget", - std::make_pair (5, CGAL::Color (204, 255, 201)))); + std::make_pair (5, CGAL::IO::Color (204, 255, 201)))); init_map.insert (std::make_pair ("roof", - std::make_pair (6, CGAL::Color (245, 121, 0)))); + std::make_pair (6, CGAL::IO::Color (245, 121, 0)))); init_map.insert (std::make_pair ("facade", - std::make_pair (-1, CGAL::Color (77, 131, 186)))); + std::make_pair (-1, CGAL::IO::Color (77, 131, 186)))); } std::string sname (name); auto found = init_map.find (sname); if (found == init_map.end()) return add (name, - CGAL::Color ((unsigned char)(m_random.get_int(64, 192)), + CGAL::IO::Color ((unsigned char)(m_random.get_int(64, 192)), (unsigned char)(m_random.get_int(64, 192)), (unsigned char)(m_random.get_int(64, 192)))); diff --git a/Classification/include/CGAL/Classification/Point_set_feature_generator.h b/Classification/include/CGAL/Classification/Point_set_feature_generator.h index 8a1ebcd4e21..81b94516e4f 100644 --- a/Classification/include/CGAL/Classification/Point_set_feature_generator.h +++ b/Classification/include/CGAL/Classification/Point_set_feature_generator.h @@ -355,7 +355,7 @@ public: \tparam ColorMap model of `ReadablePropertyMap` whose key type is the value type of the iterator of `PointRange` and value type is - `CGAL::Color`. + `CGAL::IO::Color`. \param features the feature set where the features are instantiated. \param color_map property map to access the colors of the input points (if any). diff --git a/Classification/test/Classification/test_classification_point_set.cpp b/Classification/test/Classification/test_classification_point_set.cpp index 9bd20262c1f..0a1dc9cee79 100644 --- a/Classification/test/Classification/test_classification_point_set.cpp +++ b/Classification/test/Classification/test_classification_point_set.cpp @@ -37,7 +37,7 @@ typedef Classification::Point_set_feature_generator Size_t_map; -typedef Point_set::Property_map Color_map; +typedef Point_set::Property_map Color_map; @@ -55,7 +55,7 @@ int main (int, char**) normal_map = pts.normal_map(); boost::tie (echo_map, map_added) = pts.add_property_map ("echo"); assert (map_added); - boost::tie (color_map, map_added) = pts.add_property_map ("color"); + boost::tie (color_map, map_added) = pts.add_property_map ("color"); assert (map_added); for (std::size_t i = 0; i < 1000; ++ i) @@ -68,7 +68,7 @@ int main (int, char**) CGAL::get_default_random().get_double(), CGAL::get_default_random().get_double())); echo_map[*it] = std::size_t(CGAL::get_default_random().get_int(0, 4)); - color_map[*it] = CGAL::Color ((unsigned char)(CGAL::get_default_random().get_int(0, 255)), + color_map[*it] = CGAL::IO::Color ((unsigned char)(CGAL::get_default_random().get_int(0, 255)), (unsigned char)(CGAL::get_default_random().get_int(0, 255)), (unsigned char)(CGAL::get_default_random().get_int(0, 255))); } diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map_iterators_base.h b/Combinatorial_map/include/CGAL/Combinatorial_map_iterators_base.h index b0f2943c707..78d14522eb9 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map_iterators_base.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map_iterators_base.h @@ -389,7 +389,7 @@ namespace CGAL { {} /// Destructor. - ~CMap_non_basic_iterator() CGAL_NOEXCEPT(CGAL_NO_ASSERTIONS_BOOL) + ~CMap_non_basic_iterator() noexcept(!CGAL_ASSERTIONS_ENABLED) { CGAL_destructor_assertion( this->mmark_number!=Map::INVALID_MARK ); if (this->mmap->get_number_of_times_mark_reserved diff --git a/Convex_hull_2/examples/Convex_hull_2/ch_from_cin_to_cout.cpp b/Convex_hull_2/examples/Convex_hull_2/ch_from_cin_to_cout.cpp index cb3d04d28da..957e316d045 100644 --- a/Convex_hull_2/examples/Convex_hull_2/ch_from_cin_to_cout.cpp +++ b/Convex_hull_2/examples/Convex_hull_2/ch_from_cin_to_cout.cpp @@ -6,8 +6,8 @@ typedef K::Point_2 Point_2; int main() { - CGAL::set_ascii_mode(std::cin); - CGAL::set_ascii_mode(std::cout); + CGAL::IO::set_ascii_mode(std::cin); + CGAL::IO::set_ascii_mode(std::cout); std::istream_iterator< Point_2 > in_start( std::cin ); std::istream_iterator< Point_2 > in_end; std::ostream_iterator< Point_2 > out( std::cout, "\n" ); diff --git a/Convex_hull_2/examples/Convex_hull_2/ch_graham_anderson.cpp b/Convex_hull_2/examples/Convex_hull_2/ch_graham_anderson.cpp index 019ede1ed24..68fb6ca8109 100644 --- a/Convex_hull_2/examples/Convex_hull_2/ch_graham_anderson.cpp +++ b/Convex_hull_2/examples/Convex_hull_2/ch_graham_anderson.cpp @@ -37,8 +37,8 @@ ch_graham_anderson( InputIterator first, InputIterator beyond, int main() { - CGAL::set_ascii_mode(std::cin); - CGAL::set_ascii_mode(std::cout); + CGAL::IO::set_ascii_mode(std::cin); + CGAL::IO::set_ascii_mode(std::cout); std::istream_iterator< Point_2 > in_start( std::cin ); std::istream_iterator< Point_2 > in_end; std::ostream_iterator< Point_2 > out( std::cout, "\n" ); diff --git a/Convex_hull_2/examples/Convex_hull_2/ch_timing.cpp b/Convex_hull_2/examples/Convex_hull_2/ch_timing.cpp index 591fd7213c5..c75adf6ac67 100644 --- a/Convex_hull_2/examples/Convex_hull_2/ch_timing.cpp +++ b/Convex_hull_2/examples/Convex_hull_2/ch_timing.cpp @@ -24,7 +24,7 @@ int main( int argc, char* argv[] ) } std::ifstream F( (argc >= 2) ? argv[1] : "files/CD500"); - CGAL::set_ascii_mode( F ); + CGAL::IO::set_ascii_mode( F ); std::istream_iterator< Point_2> in_start( F ); std::istream_iterator< Point_2> in_end; diff --git a/Convex_hull_3/examples/Convex_hull_3/extreme_indices_3.cpp b/Convex_hull_3/examples/Convex_hull_3/extreme_indices_3.cpp index 4a65e65dace..b6c016c77ac 100644 --- a/Convex_hull_3/examples/Convex_hull_3/extreme_indices_3.cpp +++ b/Convex_hull_3/examples/Convex_hull_3/extreme_indices_3.cpp @@ -16,7 +16,7 @@ int main(int argc, char* argv[]) const char* filename = (argc>1) ? argv[1] : "data/star.off"; std::vector points; - if(!CGAL::read_points(filename, std::back_inserter(points))) + if(!CGAL::IO::read_points(filename, std::back_inserter(points))) { std::cerr<< "Cannot open input file." <1) ? argv[1] : "data/star.off"; Mesh sm; - if(!CGAL::read_polygon_mesh(filename, sm)) + if(!CGAL::IO::read_polygon_mesh(filename, sm)) { std::cerr<< "Cannot open input file." <1) ? argv[1] : "data/star.off"; Surface_mesh poly; - if(!CGAL::read_polygon_mesh(filename, poly)) + if(!CGAL::IO::read_polygon_mesh(filename, poly)) { std::cerr<< "Cannot open input file." <2)?argv[2]:"out.off", sm); + CGAL::IO::write_polygon_mesh((argc>2)?argv[2]:"out.off", sm); return 0; } diff --git a/Convex_hull_3/test/Convex_hull_3/test_ch_3_ambiguity.cpp b/Convex_hull_3/test/Convex_hull_3/test_ch_3_ambiguity.cpp index 393945ed5e4..0cfa1503d9c 100644 --- a/Convex_hull_3/test/Convex_hull_3/test_ch_3_ambiguity.cpp +++ b/Convex_hull_3/test/Convex_hull_3/test_ch_3_ambiguity.cpp @@ -15,7 +15,7 @@ int main(int argc, char* argv[]) const char* filename = (argc>1)? argv[1] : "data/cross.off"; Surface_mesh poly; - if(!CGAL::read_polygon_mesh(filename, poly)) + if(!CGAL::IO::read_polygon_mesh(filename, poly)) { std::cerr<<"Could not find a correct input file."< Kernel; diff --git a/Convex_hull_d/test/Convex_hull_d/delaunay_d-test.cpp b/Convex_hull_d/test/Convex_hull_d/delaunay_d-test.cpp index 5815e5affc5..1dc96b23f93 100644 --- a/Convex_hull_d/test/Convex_hull_d/delaunay_d-test.cpp +++ b/Convex_hull_d/test/Convex_hull_d/delaunay_d-test.cpp @@ -28,7 +28,7 @@ typedef double FT; int main() { - CGAL::set_pretty_mode ( std::cerr ); + CGAL::IO::set_pretty_mode ( std::cerr ); CGAL_KD_SETDTHREAD(193); CGAL_TEST_START; { diff --git a/Convex_hull_d/test/Convex_hull_d/include/CGAL/test_macros.h b/Convex_hull_d/test/Convex_hull_d/include/CGAL/test_macros.h index 7ba8334b2f1..369323eab84 100644 --- a/Convex_hull_d/test/Convex_hull_d/include/CGAL/test_macros.h +++ b/Convex_hull_d/test/Convex_hull_d/include/CGAL/test_macros.h @@ -14,7 +14,7 @@ else {} #define CGAL_IO_TEST(datao,datai,iomode) { \ std::stringstream S; \ - CGAL::set_mode(S,iomode); \ + CGAL::IO::set_mode(S,iomode); \ S << datao; \ if ( iomode != CGAL::IO::BINARY) \ S << '\n'; \ diff --git a/Documentation/doc/Documentation/Developer_manual/Chapter_checks.txt b/Documentation/doc/Documentation/Developer_manual/Chapter_checks.txt index 52083c63a03..1a6fb78e4cb 100644 --- a/Documentation/doc/Documentation/Developer_manual/Chapter_checks.txt +++ b/Documentation/doc/Documentation/Developer_manual/Chapter_checks.txt @@ -243,8 +243,7 @@ and \cgalCite{cgal:a-esgc-98} (also available at https://www.boost.org/community/exception_safety.html). Any destructor which might throw an exception, including a destructor which uses the `CGAL_destructor_assertion` macro, should be marked with the -`CGAL_NOEXCEPT(false)` macro. This macro provides future compatibility with -C++11 and above, which provides the `noexcept` keyword. +`noexcept(!CGAL_ASSERTIONS_ENABLED)`. \section secchecks_req_and_rec Requirements and recommendations diff --git a/Documentation/doc/resources/1.8.20/header_package.html b/Documentation/doc/resources/1.8.20/header_package.html index 8bd4b964ccb..007d84e7b10 100644 --- a/Documentation/doc/resources/1.8.20/header_package.html +++ b/Documentation/doc/resources/1.8.20/header_package.html @@ -12,6 +12,7 @@ + @@ -41,7 +42,6 @@ MathJax.Hub.Config({ }); $mathjax - $extrastylesheet diff --git a/Generator/include/CGAL/internal/Generic_random_point_generator.h b/Generator/include/CGAL/internal/Generic_random_point_generator.h index 76c52dd55cb..a161df1da76 100644 --- a/Generator/include/CGAL/internal/Generic_random_point_generator.h +++ b/Generator/include/CGAL/internal/Generic_random_point_generator.h @@ -18,7 +18,6 @@ #include #include #include -#include #include diff --git a/Generator/test/Generator/rcs_test.cpp b/Generator/test/Generator/rcs_test.cpp index b541bbe742d..89ea1bc8a64 100644 --- a/Generator/test/Generator/rcs_test.cpp +++ b/Generator/test/Generator/rcs_test.cpp @@ -37,7 +37,7 @@ using std::back_inserter; using CGAL::Simple_cartesian; using CGAL::Creator_uniform_2; using CGAL::Random_points_in_square_2; -using CGAL::set_pretty_mode; +using CGAL::IO::set_pretty_mode; using CGAL::random_convex_set_2; diff --git a/Geomview/TODO b/Geomview/TODO index 76063554941..6b19b556a92 100644 --- a/Geomview/TODO +++ b/Geomview/TODO @@ -32,7 +32,7 @@ Color: - See how we can mix the Color output with the raw mode. Currently it's not clear to me. Check how to do transparency with Geomview ? - (passing the one from CGAL::Color) + (passing the one from CGAL::IO::Color) Demo : ------ diff --git a/Geomview/demo/Geomview/gv_terrain.cpp b/Geomview/demo/Geomview/gv_terrain.cpp index bed8f15171a..7506d6fcc44 100644 --- a/Geomview/demo/Geomview/gv_terrain.cpp +++ b/Geomview/demo/Geomview/gv_terrain.cpp @@ -39,7 +39,7 @@ int main() CGAL::Geomview_stream gv(CGAL::Bbox_3(-100, -100, -100, 600, 600, 600)); gv.set_line_width(4); // gv.set_trace(true); - gv.set_bg_color(CGAL::Color(0, 200, 200)); + gv.set_bg_color(CGAL::IO::Color(0, 200, 200)); // gv.clear(); Delaunay D; @@ -57,13 +57,13 @@ int main() // use different colors, and put a few sleeps/clear. - gv << CGAL::blue(); + gv << CGAL::IO::blue(); std::cout << "Drawing 2D Delaunay triangulation in wired mode.\n"; gv.set_wired(true); gv << D; #if 1 // It's too slow ! Needs to use OFF for that. - gv << CGAL::red(); + gv << CGAL::IO::red(); std::cout << "Drawing its Voronoi diagram.\n"; gv.set_wired(true); D.draw_dual(gv); diff --git a/Geomview/demo/Geomview/kernel.cpp b/Geomview/demo/Geomview/kernel.cpp index 8461d9a7997..3b623dd1e5b 100644 --- a/Geomview/demo/Geomview/kernel.cpp +++ b/Geomview/demo/Geomview/kernel.cpp @@ -41,7 +41,7 @@ int main() gv.clear(); // remove the pickplane. gv << K::Point_2 (200, 100); - gv << CGAL::blue(); + gv << CGAL::IO::blue(); gv << K::Point_3 (200, 100, 100); gv << CGAL::red(); gv << K::Segment_2 (K::Point_2(200, 100), diff --git a/Geomview/include/CGAL/IO/Geomview_stream_impl.h b/Geomview/include/CGAL/IO/Geomview_stream_impl.h index 08a558043a7..216371cd715 100644 --- a/Geomview/include/CGAL/IO/Geomview_stream_impl.h +++ b/Geomview/include/CGAL/IO/Geomview_stream_impl.h @@ -197,7 +197,7 @@ Geomview_stream::pickplane(const Bbox_3 &bbox) // close the text bracket << "}) (pickable pickplane no)"; - set_ascii_mode(bin_bak); + IO::set_ascii_mode(bin_bak); } CGAL_INLINE_FUNCTION diff --git a/GraphicsView/demo/Alpha_shapes_2/Alpha_shapes_2.cpp b/GraphicsView/demo/Alpha_shapes_2/Alpha_shapes_2.cpp index 374e297f3cc..33b37b40a91 100644 --- a/GraphicsView/demo/Alpha_shapes_2/Alpha_shapes_2.cpp +++ b/GraphicsView/demo/Alpha_shapes_2/Alpha_shapes_2.cpp @@ -275,7 +275,7 @@ MainWindow::open(QString fileName) if(fileName.endsWith(".wkt",Qt::CaseInsensitive)) { #if BOOST_VERSION >= 105600 && (! defined(BOOST_GCC) || BOOST_GCC >= 40500) - CGAL::read_multi_point_WKT(ifs, points); + CGAL::IO::read_multi_point_WKT(ifs, points); #endif } else diff --git a/GraphicsView/demo/Apollonius_graph_2/Apollonius_graph_2.cpp b/GraphicsView/demo/Apollonius_graph_2/Apollonius_graph_2.cpp index 8292f28262d..c7dd490fe03 100644 --- a/GraphicsView/demo/Apollonius_graph_2/Apollonius_graph_2.cpp +++ b/GraphicsView/demo/Apollonius_graph_2/Apollonius_graph_2.cpp @@ -243,7 +243,7 @@ MainWindow::open(QString fileName) { #if BOOST_VERSION >= 105600 && (! defined(BOOST_GCC) || BOOST_GCC >= 40500) std::vector point_3_s; - CGAL::read_multi_point_WKT(ifs, point_3_s); + CGAL::IO::read_multi_point_WKT(ifs, 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())); @@ -289,7 +289,7 @@ MainWindow::on_actionSavePoints_triggered() vit->point().y(), vit->weight())); } - CGAL::write_multi_point_WKT(ofs, points); + CGAL::IO::write_multi_point_WKT(ofs, points); #endif } else diff --git a/GraphicsView/demo/Bounding_volumes/Bounding_volumes.cpp b/GraphicsView/demo/Bounding_volumes/Bounding_volumes.cpp index 12928ca9897..5347a0eb263 100644 --- a/GraphicsView/demo/Bounding_volumes/Bounding_volumes.cpp +++ b/GraphicsView/demo/Bounding_volumes/Bounding_volumes.cpp @@ -498,7 +498,7 @@ MainWindow::open(QString fileName) if(fileName.endsWith(".wkt", Qt::CaseInsensitive)) { #if BOOST_VERSION >= 105600 && (! defined(BOOST_GCC) || BOOST_GCC >= 40500) - CGAL::read_multi_point_WKT(ifs, points); + CGAL::IO::read_multi_point_WKT(ifs, points); for(K::Point_2 p : points) { mc.insert(p); @@ -547,7 +547,7 @@ MainWindow::on_actionSavePoints_triggered() for(Min_circle::Point_iterator pit = mc.points_begin(); pit != mc.points_end(); ++pit) out_pts.push_back(*pit); - CGAL::write_multi_point_WKT(ofs, out_pts); + CGAL::IO::write_multi_point_WKT(ofs, out_pts); #endif } else diff --git a/GraphicsView/demo/Circular_kernel_2/Circular_kernel_2.cpp b/GraphicsView/demo/Circular_kernel_2/Circular_kernel_2.cpp index b54014b9f0b..78a92469a02 100644 --- a/GraphicsView/demo/Circular_kernel_2/Circular_kernel_2.cpp +++ b/GraphicsView/demo/Circular_kernel_2/Circular_kernel_2.cpp @@ -241,7 +241,7 @@ MainWindow::open(QString fileName) do { std::vector multi_points; - CGAL::read_multi_point_WKT(ifs, multi_points); + CGAL::IO::read_multi_point_WKT(ifs, multi_points); if(multi_points.size() == 2) { Line_arc_2 la(Segment_2(multi_points[0], diff --git a/GraphicsView/demo/L1_Voronoi_diagram_2/L1_voronoi_diagram_2.cpp b/GraphicsView/demo/L1_Voronoi_diagram_2/L1_voronoi_diagram_2.cpp index c240f8c62a3..4a8334ea142 100644 --- a/GraphicsView/demo/L1_Voronoi_diagram_2/L1_voronoi_diagram_2.cpp +++ b/GraphicsView/demo/L1_Voronoi_diagram_2/L1_voronoi_diagram_2.cpp @@ -296,7 +296,7 @@ MainWindow::open(QString fileName) if(fileName.endsWith(".wkt", Qt::CaseInsensitive)) { #if BOOST_VERSION >= 105600 && (! defined(BOOST_GCC) || BOOST_GCC >= 40500) - CGAL::read_multi_point_WKT(ifs, m_sites); + CGAL::IO::read_multi_point_WKT(ifs, m_sites); #endif } else @@ -330,7 +330,7 @@ MainWindow::on_actionSavePoints_triggered() std::ofstream ofs(qPrintable(fileName)); if(fileName.endsWith(".wkt", Qt::CaseInsensitive)){ #if BOOST_VERSION >= 105600 && (! defined(BOOST_GCC) || BOOST_GCC >= 40500) - CGAL::write_multi_point_WKT(ofs, m_sites); + CGAL::IO::write_multi_point_WKT(ofs, m_sites); #endif }else for(Points::iterator it = m_sites.begin(); diff --git a/GraphicsView/demo/Periodic_2_triangulation_2/Periodic_2_Delaunay_triangulation_2.cpp b/GraphicsView/demo/Periodic_2_triangulation_2/Periodic_2_Delaunay_triangulation_2.cpp index e956d72a171..26f21da2b2f 100644 --- a/GraphicsView/demo/Periodic_2_triangulation_2/Periodic_2_Delaunay_triangulation_2.cpp +++ b/GraphicsView/demo/Periodic_2_triangulation_2/Periodic_2_Delaunay_triangulation_2.cpp @@ -377,7 +377,7 @@ MainWindow::open(QString fileName) if(fileName.endsWith(".wkt", Qt::CaseInsensitive)) { #if BOOST_VERSION >= 105600 && (! defined(BOOST_GCC) || BOOST_GCC >= 40500) - CGAL::read_multi_point_WKT(ifs, points); + CGAL::IO::read_multi_point_WKT(ifs, points); #endif } else @@ -423,7 +423,7 @@ MainWindow::on_actionSavePoints_triggered() { points.push_back(vit->point()); } - CGAL::write_multi_point_WKT(ofs, points); + CGAL::IO::write_multi_point_WKT(ofs, points); #endif } else diff --git a/GraphicsView/demo/Polygon/Polygon_2.cpp b/GraphicsView/demo/Polygon/Polygon_2.cpp index 98d66af08c5..1e7486d2d6b 100644 --- a/GraphicsView/demo/Polygon/Polygon_2.cpp +++ b/GraphicsView/demo/Polygon/Polygon_2.cpp @@ -253,7 +253,7 @@ MainWindow::open(QString fileName) { #if BOOST_VERSION >= 105600 && (! defined(BOOST_GCC) || BOOST_GCC >= 40500) CGAL::Polygon_with_holes_2 P; - CGAL::read_polygon_WKT(ifs, P); + CGAL::IO::read_polygon_WKT(ifs, P); poly = Polygon2(P.outer_boundary().begin(), P.outer_boundary().end()); #endif @@ -288,7 +288,7 @@ MainWindow::on_actionSavePolygon_triggered() CGAL::Polygon_2 P(poly.begin(), poly.end()); CGAL::Polygon_with_holes_2 Pwh(P); - CGAL::write_polygon_WKT(ofs, Pwh); + CGAL::IO::write_polygon_WKT(ofs, Pwh); #endif } else diff --git a/GraphicsView/demo/Segment_Delaunay_graph_2/Segment_voronoi_2.cpp b/GraphicsView/demo/Segment_Delaunay_graph_2/Segment_voronoi_2.cpp index ac6d7af1f48..6f3ca72391e 100644 --- a/GraphicsView/demo/Segment_Delaunay_graph_2/Segment_voronoi_2.cpp +++ b/GraphicsView/demo/Segment_Delaunay_graph_2/Segment_voronoi_2.cpp @@ -357,7 +357,7 @@ MainWindow::loadWKTConstraints(QString std::ifstream ifs(qPrintable(fileName)); do{ std::vector polygons; - CGAL::read_multi_polygon_WKT(ifs, polygons); + CGAL::IO::read_multi_polygon_WKT(ifs, polygons); for(const Polygon& poly : polygons) { if(poly.outer_boundary().is_empty()) @@ -387,7 +387,7 @@ MainWindow::loadWKTConstraints(QString SVD::Vertex_handle vqold; do{ std::vector linestrings; - CGAL::read_multi_linestring_WKT(ifs, linestrings); + CGAL::IO::read_multi_linestring_WKT(ifs, linestrings); for(const LineString& ls : linestrings) { bool first_pass=true; diff --git a/GraphicsView/demo/Segment_Delaunay_graph_Linf_2/Segment_voronoi_linf_2.cpp b/GraphicsView/demo/Segment_Delaunay_graph_Linf_2/Segment_voronoi_linf_2.cpp index ae4f72bc55e..623c4b96095 100644 --- a/GraphicsView/demo/Segment_Delaunay_graph_Linf_2/Segment_voronoi_linf_2.cpp +++ b/GraphicsView/demo/Segment_Delaunay_graph_Linf_2/Segment_voronoi_linf_2.cpp @@ -400,7 +400,7 @@ MainWindow::loadWKT(QString do { std::vector mpts; - CGAL::read_multi_point_WKT(ifs, mpts); + CGAL::IO::read_multi_point_WKT(ifs, mpts); for(const K::Point_2& p : mpts) svd.insert(p); }while(ifs.good() && !ifs.eof()); @@ -411,7 +411,7 @@ MainWindow::loadWKT(QString { typedef std::vector LineString; std::vector mls; - CGAL::read_multi_linestring_WKT(ifs, mls); + CGAL::IO::read_multi_linestring_WKT(ifs, mls); for(const LineString& ls : mls) { if(ls.empty()) @@ -449,7 +449,7 @@ MainWindow::loadWKT(QString { typedef CGAL::Polygon_with_holes_2 Polygon; std::vector mps; - CGAL::read_multi_polygon_WKT(ifs, mps); + CGAL::IO::read_multi_polygon_WKT(ifs, mps); for(const Polygon& poly : mps) { if(poly.outer_boundary().is_empty()) diff --git a/GraphicsView/demo/Snap_rounding_2/Snap_rounding_2.cpp b/GraphicsView/demo/Snap_rounding_2/Snap_rounding_2.cpp index 0225624b96e..d051c31e6f1 100644 --- a/GraphicsView/demo/Snap_rounding_2/Snap_rounding_2.cpp +++ b/GraphicsView/demo/Snap_rounding_2/Snap_rounding_2.cpp @@ -272,7 +272,7 @@ MainWindow::open(QString fileName) { #if BOOST_VERSION >= 105600 && (! defined(BOOST_GCC) || BOOST_GCC >= 40500) std::vector > mls; - CGAL::read_multi_linestring_WKT(ifs, mls); + CGAL::IO::read_multi_linestring_WKT(ifs, mls); for(const std::vector& ls : mls) { if(ls.size() > 2) @@ -322,7 +322,7 @@ MainWindow::on_actionSaveSegments_triggered() ls[1] = seg.target(); mls.push_back(ls); } - CGAL::write_multi_linestring_WKT(ofs, mls); + CGAL::IO::write_multi_linestring_WKT(ofs, mls); #endif } else diff --git a/GraphicsView/demo/Spatial_searching_2/Spatial_searching_2.cpp b/GraphicsView/demo/Spatial_searching_2/Spatial_searching_2.cpp index 1af26ec7514..bcbdfbf939b 100644 --- a/GraphicsView/demo/Spatial_searching_2/Spatial_searching_2.cpp +++ b/GraphicsView/demo/Spatial_searching_2/Spatial_searching_2.cpp @@ -272,7 +272,7 @@ MainWindow::open(QString fileName) if(fileName.endsWith(".wkt", Qt::CaseInsensitive)) { #if BOOST_VERSION >= 105600 && (! defined(BOOST_GCC) || BOOST_GCC >= 40500) - CGAL::read_multi_point_WKT(ifs, points); + CGAL::IO::read_multi_point_WKT(ifs, points); #endif } else{ diff --git a/GraphicsView/demo/Stream_lines_2/Stream_lines_2.cpp b/GraphicsView/demo/Stream_lines_2/Stream_lines_2.cpp index b0e1fb852ec..c52054572e6 100644 --- a/GraphicsView/demo/Stream_lines_2/Stream_lines_2.cpp +++ b/GraphicsView/demo/Stream_lines_2/Stream_lines_2.cpp @@ -200,7 +200,7 @@ MainWindow::open(QString fileName) do { std::vector ps; - CGAL::read_multi_point_WKT(ifs, ps); + CGAL::IO::read_multi_point_WKT(ifs, ps); if(size == -1) size = static_cast(ps.size()); else if(ps.size() > 0 && size != static_cast(ps.size())) @@ -266,7 +266,7 @@ MainWindow::on_actionSavePoints_triggered() mp[i].push_back(Point_2(regular_grid->get_field(j,i).x(), regular_grid->get_field(j,i).y())); } - CGAL::write_multi_point_WKT(ofs, mp[i]); + CGAL::IO::write_multi_point_WKT(ofs, mp[i]); } ofs.close(); } diff --git a/GraphicsView/demo/Triangulation_2/Constrained_Delaunay_triangulation_2.cpp b/GraphicsView/demo/Triangulation_2/Constrained_Delaunay_triangulation_2.cpp index 60dd77c388d..a827b567f5b 100644 --- a/GraphicsView/demo/Triangulation_2/Constrained_Delaunay_triangulation_2.cpp +++ b/GraphicsView/demo/Triangulation_2/Constrained_Delaunay_triangulation_2.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #if BOOST_VERSION >= 105600 && (! defined(BOOST_GCC) || BOOST_GCC >= 40500) #include #endif @@ -571,7 +571,7 @@ MainWindow::loadWKT(QString typedef CGAL::Polygon_with_holes_2 Polygon; typedef CGAL::Point_2 Point; std::vector mps; - CGAL::read_multi_polygon_WKT(ifs, mps); + CGAL::IO::read_multi_polygon_WKT(ifs, mps); for(const Polygon& p : mps) { if(p.outer_boundary().is_empty()) @@ -603,7 +603,7 @@ MainWindow::loadWKT(QString { typedef std::vector LineString; std::vector mls; - CGAL::read_multi_linestring_WKT(ifs, mls); + CGAL::IO::read_multi_linestring_WKT(ifs, mls); for(const LineString& ls : mls) { if(ls.empty()) @@ -641,7 +641,7 @@ MainWindow::loadWKT(QString do { std::vector mpts; - CGAL::read_multi_point_WKT(ifs, mpts); + CGAL::IO::read_multi_point_WKT(ifs, mpts); for(const K::Point_2& p : mpts) { cdt.insert(p); @@ -669,7 +669,7 @@ void MainWindow::loadPolyConstraints(QString fileName) { std::ifstream ifs(qPrintable(fileName)); - read_triangle_poly_file(cdt,ifs); + CGAL::IO::read_triangle_poly_file(cdt,ifs); discoverComponents(cdt, m_seeds); Q_EMIT( changed()); actionRecenter->trigger(); @@ -788,7 +788,7 @@ MainWindow::saveConstraints(QString fileName) output << cdt; else if (output) { - CGAL::write_vtu(output, cdt); + CGAL::IO::write_VTU(output, cdt); } } diff --git a/GraphicsView/demo/Triangulation_2/Delaunay_triangulation_2.cpp b/GraphicsView/demo/Triangulation_2/Delaunay_triangulation_2.cpp index 9d810c04398..1bed7aeef2c 100644 --- a/GraphicsView/demo/Triangulation_2/Delaunay_triangulation_2.cpp +++ b/GraphicsView/demo/Triangulation_2/Delaunay_triangulation_2.cpp @@ -344,7 +344,7 @@ MainWindow::open(QString fileName) if(fileName.endsWith(".wkt", Qt::CaseInsensitive)) { #if BOOST_VERSION >= 105600 && (! defined(BOOST_GCC) || BOOST_GCC >= 40500) - CGAL::read_multi_point_WKT(ifs, points); + CGAL::IO::read_multi_point_WKT(ifs, points); #endif } else @@ -388,7 +388,7 @@ MainWindow::on_actionSavePoints_triggered() { points.push_back(vit->point()); } - CGAL::write_multi_point_WKT(ofs, points); + CGAL::IO::write_multi_point_WKT(ofs, points); #endif } else diff --git a/GraphicsView/demo/Triangulation_2/Regular_triangulation_2.cpp b/GraphicsView/demo/Triangulation_2/Regular_triangulation_2.cpp index 483a8ab3d27..c4a18a1e715 100644 --- a/GraphicsView/demo/Triangulation_2/Regular_triangulation_2.cpp +++ b/GraphicsView/demo/Triangulation_2/Regular_triangulation_2.cpp @@ -260,7 +260,7 @@ MainWindow::on_actionLoadPoints_triggered() { #if BOOST_VERSION >= 105600 && (! defined(BOOST_GCC) || BOOST_GCC >= 40500) std::vector points_3; - CGAL::read_multi_point_WKT(ifs, points_3); + CGAL::IO::read_multi_point_WKT(ifs, 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())); @@ -308,7 +308,7 @@ MainWindow::on_actionSavePoints_triggered() vit->point().y(), vit->point().weight())); } - CGAL::write_multi_point_WKT(ofs, points_3); + CGAL::IO::write_multi_point_WKT(ofs, points_3); #endif } else diff --git a/GraphicsView/include/CGAL/Buffer_for_vao.h b/GraphicsView/include/CGAL/Buffer_for_vao.h index 2be331a35f5..e0af44f8e89 100644 --- a/GraphicsView/include/CGAL/Buffer_for_vao.h +++ b/GraphicsView/include/CGAL/Buffer_for_vao.h @@ -244,7 +244,7 @@ public: // 1.2) Add a point, with color. template - void add_point(const KPoint& kp, const CGAL::Color& c) + void add_point(const KPoint& kp, const CGAL::IO::Color& c) { add_point(kp); add_color(c); @@ -268,7 +268,7 @@ public: // 2.2) Add a segment, with color. template - void add_segment(const KPoint& kp1, const KPoint& kp2, const CGAL::Color& c) + void add_segment(const KPoint& kp1, const KPoint& kp2, const CGAL::IO::Color& c) { add_segment(kp1, kp2); add_color(c); @@ -294,7 +294,7 @@ public: //3.2) Add a ray segment, with color template void add_ray_segment(const KPoint& kp1, const KVector& kp2, - const CGAL::Color& c) + const CGAL::IO::Color& c) { add_point(kp1); add_point_infinity(kp2); @@ -313,7 +313,7 @@ public: // 4.1) Add a line, with color template void add_line_segment(const KPoint& kp1, const KPoint& kp2, - const CGAL::Color& c) + const CGAL::IO::Color& c) { add_point_infinity(kp1); add_point_infinity(kp2); @@ -330,7 +330,7 @@ public: { face_begin_internal(false, false); } // 3.2) Add a face, with a color, without normal. - void face_begin(const CGAL::Color& c) + void face_begin(const CGAL::IO::Color& c) { m_color_of_face=c; face_begin_internal(true, false); @@ -346,7 +346,7 @@ public: // 3.3) Add a face, with a color and with a normal. template - void face_begin(const CGAL::Color& c, const KNormal& kv) + void face_begin(const CGAL::IO::Color& c, const KNormal& kv) { m_color_of_face=c; m_normal_of_face=get_local_vector(kv); @@ -477,7 +477,7 @@ public: } ///adds `acolor` RGB components to `buffer` - static void add_color_in_buffer(const CGAL::Color& acolor, std::vector& buffer) + static void add_color_in_buffer(const CGAL::IO::Color& acolor, std::vector& buffer) { buffer.push_back((float)acolor.red()/(float)255); buffer.push_back((float)acolor.green()/(float)255); @@ -837,7 +837,7 @@ protected: return is_facet_convex(m_points_of_face, N); } - void add_color(const CGAL::Color& acolor) + void add_color(const CGAL::IO::Color& acolor) { if (m_color_buffer!=nullptr) { add_color_in_buffer(acolor, *m_color_buffer); } @@ -917,7 +917,7 @@ protected: std::vector m_points_of_face; std::vector m_vertex_normals_for_face; std::vector m_indices_of_points_of_face; - CGAL::Color m_color_of_face; + CGAL::IO::Color m_color_of_face; Local_vector m_normal_of_face; }; diff --git a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h index c2c05f90c53..0d44fbc3356 100644 --- a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h +++ b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h @@ -56,12 +56,12 @@ namespace CGAL { //------------------------------------------------------------------------------ -inline CGAL::Color get_random_color(CGAL::Random& random) +inline CGAL::IO::Color get_random_color(CGAL::Random& random) { - CGAL::Color res; + CGAL::IO::Color res; do { - res=CGAL::Color(random.get_int(0,256), + res=CGAL::IO::Color(random.get_int(0,256), random.get_int(0,256), random.get_int(0,256)); } @@ -318,7 +318,7 @@ public: { m_buffer_for_mono_points.add_point(p); } template - void add_point(const KPoint& p, const CGAL::Color& acolor) + void add_point(const KPoint& p, const CGAL::IO::Color& acolor) { m_buffer_for_colored_points.add_point(p, acolor); } template @@ -327,7 +327,7 @@ public: template void add_segment(const KPoint& p1, const KPoint& p2, - const CGAL::Color& acolor) + const CGAL::IO::Color& acolor) { m_buffer_for_colored_segments.add_segment(p1, p2, acolor); } template @@ -359,7 +359,7 @@ public: } template - void add_ray(const KPoint &p, const KVector &v, const CGAL::Color &acolor) + void add_ray(const KPoint &p, const KVector &v, const CGAL::IO::Color &acolor) { double bigNumber = 1e30; m_buffer_for_colored_rays.add_ray_segment(p, (p + (bigNumber)*v), acolor); @@ -374,7 +374,7 @@ public: } template - void add_line(const KPoint &p, const KVector &v, const CGAL::Color &acolor) + void add_line(const KPoint &p, const KVector &v, const CGAL::IO::Color &acolor) { double bigNumber = 1e30; m_buffer_for_colored_lines.add_line_segment((p - (bigNumber)*v), @@ -412,7 +412,7 @@ public: { m_buffer_for_mono_faces.face_begin(); } } - void face_begin(const CGAL::Color& acolor) + void face_begin(const CGAL::IO::Color& acolor) { if (is_a_face_started()) { @@ -1702,11 +1702,11 @@ protected: double m_size_rays; double m_size_lines; - CGAL::Color m_vertices_mono_color; - CGAL::Color m_edges_mono_color; - CGAL::Color m_rays_mono_color; - CGAL::Color m_lines_mono_color; - CGAL::Color m_faces_mono_color; + CGAL::IO::Color m_vertices_mono_color; + CGAL::IO::Color m_edges_mono_color; + CGAL::IO::Color m_rays_mono_color; + CGAL::IO::Color m_lines_mono_color; + CGAL::IO::Color m_faces_mono_color; QVector4D m_ambient_color; bool m_are_buffers_initialized; diff --git a/GraphicsView/include/CGAL/Qt/SegmentDelaunayGraphGraphicsItem.h b/GraphicsView/include/CGAL/Qt/SegmentDelaunayGraphGraphicsItem.h index 730d7d7983f..c63945a3adc 100644 --- a/GraphicsView/include/CGAL/Qt/SegmentDelaunayGraphGraphicsItem.h +++ b/GraphicsView/include/CGAL/Qt/SegmentDelaunayGraphGraphicsItem.h @@ -164,9 +164,9 @@ SegmentDelaunayGraphGraphicsItem::drawAll(QPainter *painter, const QStyleOpti vit != t->finite_vertices_end(); ++vit) { typename T::Site_2 s = vit->site(); if ( s.is_input() ) { - //*widget << CGAL::red(); + //*widget << CGAL::IO::red(); } else { - //*widget << CGAL::yellow(); + //*widget << CGAL::IO::yellow(); } if ( s.is_point() ) { QPointF point = matrix.map(convert(s.point())); diff --git a/GraphicsView/include/CGAL/Qt/SegmentDelaunayGraphLinfGraphicsItem.h b/GraphicsView/include/CGAL/Qt/SegmentDelaunayGraphLinfGraphicsItem.h index 41a373b584c..a0a83fb7504 100644 --- a/GraphicsView/include/CGAL/Qt/SegmentDelaunayGraphLinfGraphicsItem.h +++ b/GraphicsView/include/CGAL/Qt/SegmentDelaunayGraphLinfGraphicsItem.h @@ -199,7 +199,7 @@ SegmentDelaunayGraphLinfGraphicsItem::drawAll(QPainter *painter, const QStyle vit != t->finite_vertices_end(); ++vit) { typename T::Site_2 s = vit->site(); if ( s.is_input() ) { - //*widget << CGAL::red(); + //*widget << CGAL::IO::red(); } else { //*widget << CGAL::yellow(); } diff --git a/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_items_2.h b/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_items_2.h index e2b1cf49d3a..39b806a2412 100644 --- a/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_items_2.h +++ b/HalfedgeDS/doc/HalfedgeDS/CGAL/HalfedgeDS_items_2.h @@ -56,9 +56,9 @@ library. // A face type with a color member variable. template struct My_face : public CGAL::HalfedgeDS_face_base { -CGAL::Color color; +CGAL::IO::Color color; My_face() {} -My_face( CGAL::Color c) : color(c) {} +My_face( CGAL::IO::Color c) : color(c) {} }; // An items type using my face. diff --git a/HalfedgeDS/examples/HalfedgeDS/hds_prog_color.cpp b/HalfedgeDS/examples/HalfedgeDS/hds_prog_color.cpp index 6b294fefe5c..adcfdc0c5fe 100644 --- a/HalfedgeDS/examples/HalfedgeDS/hds_prog_color.cpp +++ b/HalfedgeDS/examples/HalfedgeDS/hds_prog_color.cpp @@ -5,9 +5,9 @@ // A face type with a color member variable. template struct My_face : public CGAL::HalfedgeDS_face_base { - CGAL::Color color; + CGAL::IO::Color color; My_face() {} - My_face( CGAL::Color c) : color(c) {} + My_face( CGAL::IO::Color c) : color(c) {} }; // An items type using my face. @@ -28,8 +28,8 @@ typedef HDS::Face_handle Face_handle; int main() { HDS hds; - Face_handle f = hds.faces_push_back( Face( CGAL::red())); - f->color = CGAL::blue(); - CGAL_assertion( f->color == CGAL::blue()); + Face_handle f = hds.faces_push_back( Face( CGAL::IO::red())); + f->color = CGAL::IO::blue(); + CGAL_assertion( f->color == CGAL::IO::blue()); return 0; } diff --git a/Hash_map/test/Hash_map/include/CGAL/test_macros.h b/Hash_map/test/Hash_map/include/CGAL/test_macros.h index 7ba8334b2f1..369323eab84 100644 --- a/Hash_map/test/Hash_map/include/CGAL/test_macros.h +++ b/Hash_map/test/Hash_map/include/CGAL/test_macros.h @@ -14,7 +14,7 @@ else {} #define CGAL_IO_TEST(datao,datai,iomode) { \ std::stringstream S; \ - CGAL::set_mode(S,iomode); \ + CGAL::IO::set_mode(S,iomode); \ S << datao; \ if ( iomode != CGAL::IO::BINARY) \ S << '\n'; \ diff --git a/Heat_method_3/examples/Heat_method_3/heat_method.cpp b/Heat_method_3/examples/Heat_method_3/heat_method.cpp index dbe02789fdd..430b8c196fa 100644 --- a/Heat_method_3/examples/Heat_method_3/heat_method.cpp +++ b/Heat_method_3/examples/Heat_method_3/heat_method.cpp @@ -17,7 +17,7 @@ int main(int argc, char* argv[]) const char* filename = (argc > 1) ? argv[1] : "./data/elephant.off"; Triangle_mesh tm; - if(!CGAL::read_polygon_mesh(filename, tm) || + if(!CGAL::IO::read_polygon_mesh(filename, tm) || CGAL::is_empty(tm) || !CGAL::is_triangle_mesh(tm)) { std::cerr << "Invalid input file." << std::endl; diff --git a/Heat_method_3/examples/Heat_method_3/heat_method_surface_mesh.cpp b/Heat_method_3/examples/Heat_method_3/heat_method_surface_mesh.cpp index 88e12912805..c056b80da4f 100644 --- a/Heat_method_3/examples/Heat_method_3/heat_method_surface_mesh.cpp +++ b/Heat_method_3/examples/Heat_method_3/heat_method_surface_mesh.cpp @@ -19,7 +19,7 @@ int main(int argc, char* argv[]) const char* filename = (argc > 1) ? argv[1] : "./data/sphere.off"; Triangle_mesh tm; - if(!CGAL::read_polygon_mesh(filename, tm) || + if(!CGAL::IO::read_polygon_mesh(filename, tm) || CGAL::is_empty(tm) || !CGAL::is_triangle_mesh(tm)) { std::cerr << "Invalid input file." << std::endl; diff --git a/Heat_method_3/examples/Heat_method_3/heat_method_surface_mesh_direct.cpp b/Heat_method_3/examples/Heat_method_3/heat_method_surface_mesh_direct.cpp index 21213768184..ac3e0d4a152 100644 --- a/Heat_method_3/examples/Heat_method_3/heat_method_surface_mesh_direct.cpp +++ b/Heat_method_3/examples/Heat_method_3/heat_method_surface_mesh_direct.cpp @@ -21,7 +21,7 @@ int main(int argc, char* argv[]) const char* filename = (argc > 1) ? argv[1] : "./data/elephant.off"; Triangle_mesh tm; - if(!CGAL::read_polygon_mesh(filename, tm) || + if(!CGAL::IO::read_polygon_mesh(filename, tm) || CGAL::is_empty(tm) || !CGAL::is_triangle_mesh(tm)) { std::cerr << "Invalid input file." << std::endl; diff --git a/Homogeneous_kernel/include/CGAL/Homogeneous/Aff_transformationH2.h b/Homogeneous_kernel/include/CGAL/Homogeneous/Aff_transformationH2.h index 3a42574fa9d..a97ca83abf5 100644 --- a/Homogeneous_kernel/include/CGAL/Homogeneous/Aff_transformationH2.h +++ b/Homogeneous_kernel/include/CGAL/Homogeneous/Aff_transformationH2.h @@ -58,6 +58,11 @@ class Aff_transformation_rep_baseH2 : public Ref_counted_virtual general_form() const = 0; virtual bool is_even() const = 0; + virtual bool is_translation() const { return false; } + virtual bool is_scaling() const { return false; } + virtual bool is_reflection() const { return false; } + virtual bool is_rotation() const { return false; } + virtual RT homogeneous(int i, int j) const = 0; virtual FT cartesian(int i, int j) const = 0; }; @@ -247,6 +252,10 @@ class Translation_repH2 : public Aff_transformation_rep_baseH2 is_even() const { return true; } + virtual bool + is_translation() const + { return true; } + virtual Aff_transformation_repH2 general_form() const { @@ -321,6 +330,11 @@ class Rotation_repH2 : public Aff_transformation_rep_baseH2 { return true; } + + virtual bool + is_rotation() const + { return true; } + virtual Aff_transformation_repH2 general_form() const { @@ -392,6 +406,10 @@ class Scaling_repH2 : public Aff_transformation_rep_baseH2 is_even() const { return true; } + virtual bool + is_scaling() const + { return true; } + virtual Aff_transformation_repH2 general_form() const { @@ -456,6 +474,10 @@ class Reflection_repH2 : public Aff_transformation_rep_baseH2 is_even() const { return false; } + virtual bool + is_reflection() const + { return true; } + virtual Aff_transformation_repH2 general_form() const { @@ -576,6 +598,11 @@ public: bool is_even() const; bool is_odd() const; + bool is_translation() const; + bool is_scaling() const; + bool is_rotation() const; + bool is_reflection() const; + // Access functions for matrix form FT cartesian(int i, int j) const; RT homogeneous(int i, int j) const; @@ -739,6 +766,30 @@ Aff_transformationH2:: is_odd() const { return ! is_even(); } +template < class R > +bool +Aff_transformationH2:: +is_translation() const +{ return this->Ptr()->is_translation(); } + +template < class R > +bool +Aff_transformationH2:: +is_scaling() const +{ return this->Ptr()->is_scaling(); } + +template < class R > +bool +Aff_transformationH2:: +is_rotation() const +{ return this->Ptr()->is_rotation(); } + +template < class R > +bool +Aff_transformationH2:: +is_reflection() const +{ return this->Ptr()->is_reflection(); } + template < class R > inline typename Aff_transformationH2::FT diff --git a/Homogeneous_kernel/include/CGAL/Homogeneous/Aff_transformationH3.h b/Homogeneous_kernel/include/CGAL/Homogeneous/Aff_transformationH3.h index b67c4f024a3..f269496d79d 100644 --- a/Homogeneous_kernel/include/CGAL/Homogeneous/Aff_transformationH3.h +++ b/Homogeneous_kernel/include/CGAL/Homogeneous/Aff_transformationH3.h @@ -82,11 +82,21 @@ public: virtual bool is_even() const = 0; + virtual bool + is_translation() const { return false; } + + virtual bool + is_scaling() const { return false; } + virtual RT homogeneous(int i, int j) const = 0; virtual FT cartesian(int i, int j) const = 0; + + // this function has a default here as it is only used for "pure" scaling and translation + // and not for the other types (Identity and general case) + virtual Aff_transformation_3 compose(const Aff_transformation_rep_baseH3*) const { return Aff_transformation_3(); } }; template < class R_ > @@ -221,6 +231,128 @@ public: { return (i==j) ? FT(1) : FT(0); } }; +template < class R > +class Scaling_repH3 : public Aff_transformation_rep_baseH3 +{ + public: + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Point_3 Point_3; + typedef typename R::Vector_3 Vector_3; + typedef typename R::Direction_3 Direction_3; + typedef typename R::Plane_3 Plane_3; + typedef typename R::Aff_transformation_3 Aff_transformation_3; + typedef Aff_transformation_rep_baseH3 Base; + typedef Scaling_repH3 Self; + + Scaling_repH3() + {} + + Scaling_repH3(const RT& scaling_numerator, + const RT& scaling_denominator) : + _sf_num(scaling_numerator), _sf_den(scaling_denominator) + { + if ( scaling_denominator < RT(0) ) + { + _sf_num = - _sf_num; + _sf_den = - _sf_den; + }; + } + + virtual ~Scaling_repH3() + {} + + virtual Point_3 + transform(const Point_3 & p) const + { + return Point_3( p.hx() * _sf_num, + p.hy() * _sf_num, + p.hz() * _sf_num, + p.hw() * _sf_den ); + } + virtual Vector_3 + transform(const Vector_3 & v) const + { + return Vector_3( v.hx() * _sf_num, + v.hy() * _sf_num, + v.hz() * _sf_num, + v.hw() * _sf_den ); + } + + virtual Direction_3 + transform(const Direction_3 & d) const + { return d; } + + virtual Plane_3 + transform(const Plane_3 & p) const + { + return Plane_3(p.a()*_sf_den, p.b()*_sf_den, p.c()*_sf_den, p.d()*_sf_num); + } + + virtual Aff_transformation_3 + inverse() const + { return Aff_transformation_3(SCALING, _sf_den, _sf_num); } + + virtual Aff_transformation_3 + transpose() const + { return Aff_transformation_3(SCALING, _sf_num, _sf_den); } + + virtual bool + is_even() const + { return true; } + + virtual bool + is_scaling() const + { return true; } + + virtual Aff_transformation_repH3 + general_form() const + { + return + Aff_transformation_repH3(_sf_num, RT(0) , RT(0) ,RT(0) , + RT(0) , _sf_num, RT(0) ,RT(0) , + RT(0) , RT(0) , _sf_num,RT(0) , + _sf_den ); + } + + Aff_transformation_3 compose(const Base* aff) const + { + const Self* sr = dynamic_cast(aff); + return Aff_transformation_3(SCALING, _sf_num * sr->_sf_num, _sf_den * sr->_sf_den); + } + + virtual RT homogeneous(int i, int j) const; + virtual FT cartesian(int i, int j) const; + + + private: + RT _sf_num; + RT _sf_den; +}; + + +template < class R > +typename Scaling_repH3::RT +Scaling_repH3:: +homogeneous(int i, int j) const +{ + if(i!=j) return RT(0); + if (i==3) return _sf_den; + return _sf_num; +} + +template +typename Scaling_repH3::FT +Scaling_repH3:: +cartesian(int i, int j) const +{ + if(i!=j) return FT(0); + if (i==3) return FT(1); + return FT(_sf_num) / FT(_sf_den); +} + + + template < class R_ > class Translation_repH3 : public Aff_transformation_rep_baseH3 { @@ -231,6 +363,8 @@ class Translation_repH3 : public Aff_transformation_rep_baseH3 typedef typename R_::Direction_3 Direction_3; typedef typename R_::Plane_3 Plane_3; typedef typename R_::Aff_transformation_3 Aff_transformation_3; + typedef Aff_transformation_rep_baseH3 Base; + typedef Translation_repH3 Self; public: typedef R_ R; @@ -264,12 +398,21 @@ public: virtual bool is_even() const; + virtual bool + is_translation() const; + virtual RT homogeneous(int i, int j) const ; virtual FT cartesian(int i, int j) const ; + Aff_transformation_3 compose(const Base* aff) const + { + const Self* sr = dynamic_cast(aff); + return Aff_transformation_3(TRANSLATION, tv + sr->tv); + } + friend class Aff_transformationH3; private: @@ -340,6 +483,12 @@ public: bool is_odd() const; + bool + is_scaling() const; + + bool + is_translation() const; + FT cartesian(int i, int j) const { return this->Ptr()->cartesian(i,j); } @@ -539,6 +688,7 @@ Aff_transformation_repH3::is_even() const t20, t21, t22 ) ) == POSITIVE ); } + template < class R > CGAL_KERNEL_LARGE_INLINE typename Aff_transformation_repH3::RT @@ -693,6 +843,12 @@ bool Translation_repH3::is_even() const { return true; } +template < class R > +inline +bool +Translation_repH3::is_translation() const +{ return true; } + template < class R > CGAL_KERNEL_LARGE_INLINE typename Translation_repH3::RT @@ -800,11 +956,7 @@ CGAL_KERNEL_INLINE Aff_transformationH3:: Aff_transformationH3(const Scaling&, const RT& num, const RT& den) { - const RT RT0(0); - initialize_with(Aff_transformation_repH3(num, RT0, RT0, RT0, - RT0, num, RT0, RT0, - RT0, RT0, num, RT0, - den )); + initialize_with(Scaling_repH3(num, den )); } template < class R > @@ -890,15 +1042,35 @@ bool Aff_transformationH3::is_odd() const { return ( ! (this->Ptr()->is_even() )); } + +template < class R > +inline +bool +Aff_transformationH3::is_scaling() const +{ return this->Ptr()->is_scaling(); } + +template < class R > +inline +bool +Aff_transformationH3::is_translation() const +{ return this->Ptr()->is_translation(); } + template < class R > CGAL_KERNEL_INLINE Aff_transformationH3 operator*(const Aff_transformationH3& left_argument, const Aff_transformationH3& right_argument ) { - return _general_transformation_composition( - left_argument.Ptr() ->general_form(), - right_argument.Ptr()->general_form() ); + if(left_argument.is_scaling() && right_argument.is_scaling()){ + return left_argument.Ptr()->compose(right_argument.Ptr()); + } + + if(left_argument.is_translation() && right_argument.is_translation()){ + return left_argument.Ptr()->compose(right_argument.Ptr()); + } + + return _general_transformation_composition(left_argument.Ptr() ->general_form(), + right_argument.Ptr()->general_form() ); } template < class R > diff --git a/Homogeneous_kernel/include/CGAL/Homogeneous/Weighted_point_2.h b/Homogeneous_kernel/include/CGAL/Homogeneous/Weighted_point_2.h index 9cc5691df9c..1b422904b90 100644 --- a/Homogeneous_kernel/include/CGAL/Homogeneous/Weighted_point_2.h +++ b/Homogeneous_kernel/include/CGAL/Homogeneous/Weighted_point_2.h @@ -79,7 +79,7 @@ template < class R_ > std::ostream & operator<<(std::ostream &os, const Weighted_pointH2 &p) { - switch(get_mode(os)) + switch(IO::get_mode(os)) { case IO::ASCII : return os << p.point() << " " << p.weight(); @@ -100,7 +100,7 @@ operator>>(std::istream &is, Weighted_pointH2 &wp) typename Weighted_pointH2::Point_2 p; is >> p; if(!is) return is; - if(is_ascii(is)) + if(IO::is_ascii(is)) is >> w; else read(is, w); diff --git a/Homogeneous_kernel/include/CGAL/Homogeneous/Weighted_point_3.h b/Homogeneous_kernel/include/CGAL/Homogeneous/Weighted_point_3.h index 6d9c5bf6e4b..6c32feaf000 100644 --- a/Homogeneous_kernel/include/CGAL/Homogeneous/Weighted_point_3.h +++ b/Homogeneous_kernel/include/CGAL/Homogeneous/Weighted_point_3.h @@ -79,7 +79,7 @@ template < class R_ > std::ostream & operator<<(std::ostream &os, const Weighted_pointH3 &p) { - switch(get_mode(os)) + switch(IO::get_mode(os)) { case IO::ASCII : return os << p.point() << " " << p.weight(); @@ -100,7 +100,7 @@ operator>>(std::istream &is, Weighted_pointH3 &wp) typename Weighted_pointH3::Point_3 p; is >> p; if(!is) return is; - if(is_ascii(is)) + if(IO::is_ascii(is)) is >> w; else read(is, w); diff --git a/Hyperbolic_triangulation_2/examples/Hyperbolic_triangulation_2/ht2_example_color.cpp b/Hyperbolic_triangulation_2/examples/Hyperbolic_triangulation_2/ht2_example_color.cpp index 59c1bec4a73..6108168f301 100644 --- a/Hyperbolic_triangulation_2/examples/Hyperbolic_triangulation_2/ht2_example_color.cpp +++ b/Hyperbolic_triangulation_2/examples/Hyperbolic_triangulation_2/ht2_example_color.cpp @@ -12,7 +12,7 @@ typedef CGAL::Hyperbolic_Delaunay_triangulation_CK_traits_2<> Gt; typedef CGAL::Hyperbolic_triangulation_face_base_2 Hyperbolic_face_base; -typedef CGAL::Triangulation_face_base_with_info_2 Face_base_with_info; typedef CGAL::Triangulation_vertex_base_2 Vertex_base; typedef CGAL::Triangulation_data_structure_2has_vertex(vo)) { - fit->info() = CGAL::red(); + fit->info() = CGAL::IO::red(); origin_faces++; } } @@ -57,7 +57,7 @@ int main(int argc, char** argv) int red_faces = 0; for(fit = dt.hyperbolic_faces_begin(); fit != dt.hyperbolic_faces_end(); ++fit) { - if(fit->info() == CGAL::red()) + if(fit->info() == CGAL::IO::red()) { red_faces++; } diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index 38102e7205f..5ae1f610222 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -25,6 +25,10 @@ Release date: June 2021 A comprehensive list of the supported file formats is available in the Stream_support package [here](https://doc.cgal.org/5.3/Stream_support/index.html#IOstreamSupportedFormats); inversely, the following [page](https://doc.cgal.org/5.3/Stream_support/IOStreamSupportedFileFormats.html) can be used to find out which CGAL data structures can be used given a specific file format. +### [2D and 3D Linear Geometry Kernel](https://doc.cgal.org/5.3/Manual/packages.html#PkgKernel23) + +- Added functions to the classes `Aff_transformation_2` and `Aff_transformation_3`, which enable to determine if they internally have a specialized representation. + ### [Quadtrees, Octrees, and Orthtrees](https://doc.cgal.org/5.3/Manual/packages.html#PkgOrthree) (new package) - This package implements a tree data structure in which each node @@ -601,7 +605,7 @@ Release date: November 2019 - Added a function to convert a Nef_polyhedron_3 to a polygon soup: [`CGAL::convert_nef_polyhedron_to_polygon_soup()`](https://doc.cgal.org/5.0/Nef_3/group__PkgNef3IOFunctions.html#ga28a9eb4da0cd6153f0c16f7f9eaf6665) ### [IO Streams](https://doc.cgal.org/5.0/Manual/packages.html#PkgStreamSupport) -- **Breaking change:** The API of [`CGAL::Color`](https://doc.cgal.org/5.0/Stream_support/classCGAL_1_1Color.html) has been cleaned up. +- **Breaking change:** The API of [`CGAL::IO::Color`](https://doc.cgal.org/5.0/Stream_support/classCGAL_1_1Color.html) has been cleaned up. - Added new functions to support some parts of the WKT file format: * [`CGAL::read_WKT()`](https://doc.cgal.org/5.0/Stream_support/group__PkgStreamSupportRef.html#gad2872abfe6fcf17d705d38567fdd6248) * [`CGAL::read_point_WKT()`](https://doc.cgal.org/5.0/Stream_support/group__PkgStreamSupportRef.html#gadbd2705b183e467507abd2f167446eba) diff --git a/Installation/cmake/modules/FindTBB.cmake b/Installation/cmake/modules/FindTBB.cmake index 23caa1cbf9a..2a0af128346 100644 --- a/Installation/cmake/modules/FindTBB.cmake +++ b/Installation/cmake/modules/FindTBB.cmake @@ -189,6 +189,11 @@ endmacro() # Now to actually find TBB # +#start with CONFIG Mode +find_package(TBB QUIET NO_MODULE) +if(TBB_FOUND) + return() +endif()#TBB_FOUND # Get path, convert backslashes as ${ENV_${var}} getenv_path(TBB_ROOT) diff --git a/Installation/include/CGAL/Mesh_3/Mesh_complex_3_in_triangulation_3_fwd.h b/Installation/include/CGAL/Mesh_3/Mesh_complex_3_in_triangulation_3_fwd.h index d0202553abc..6d644faa1ec 100644 --- a/Installation/include/CGAL/Mesh_3/Mesh_complex_3_in_triangulation_3_fwd.h +++ b/Installation/include/CGAL/Mesh_3/Mesh_complex_3_in_triangulation_3_fwd.h @@ -13,6 +13,8 @@ /// \file Mesh_complex_3_in_triangulation_3_fwd.h /// Forward declarations of the Mesh_3 package. +#include + #ifndef DOXYGEN_RUNNING namespace CGAL { diff --git a/Installation/include/CGAL/atomic.h b/Installation/include/CGAL/atomic.h index 5c92b46fd2a..da0a5c1c0a2 100644 --- a/Installation/include/CGAL/atomic.h +++ b/Installation/include/CGAL/atomic.h @@ -10,6 +10,9 @@ #ifndef CGAL_ATOMIC_H #define CGAL_ATOMIC_H +#define CGAL_DEPRECATED_HEADER "" +#define CGAL_REPLACEMENT_HEADER "" + #include #ifdef CGAL_HAS_THREADS diff --git a/Installation/include/CGAL/config.h b/Installation/include/CGAL/config.h index 76d6fd9366c..037042875aa 100644 --- a/Installation/include/CGAL/config.h +++ b/Installation/include/CGAL/config.h @@ -623,6 +623,9 @@ using std::max; # include # include # include +# include +# include +# include // namespace CGAL { // @@ -641,6 +644,16 @@ namespace CGAL { using std::is_enum; using std::unordered_set; using std::unordered_map; + using std::atomic; + using std::memory_order_relaxed; + using std::memory_order_consume; + using std::memory_order_acquire; + using std::memory_order_release; + using std::memory_order_acq_rel; + using std::memory_order_seq_cst; + using std::atomic_thread_fence; + using std::thread; + } // namespace cpp0x = cpp11; @@ -652,15 +665,17 @@ namespace CGAL { // Typedef for the type of nullptr. typedef const void * Nullptr_t; // Anticipate C++0x's std::nullptr_t - +namespace cpp11{ +#if CGAL_CXX20 || __cpp_lib_is_invocable>=201703L + template class result_of; + template + class result_of : public std::invoke_result { }; +#else + using std::result_of; +#endif +}//namespace cpp11 } //namespace CGAL -//Support for c++11 noexcept -#if BOOST_VERSION > 104600 && !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(BOOST_NO_NOEXCEPT) -#define CGAL_NOEXCEPT(x) noexcept(x) -#else -#define CGAL_NOEXCEPT(x) -#endif // The fallthrough attribute // See for clang: @@ -684,12 +699,6 @@ typedef const void * Nullptr_t; // Anticipate C++0x's std::nullptr_t #define CGAL_CFG_BOOST_VARIANT_SWAP_BUG 1 #endif -#ifndef CGAL_NO_ASSERTIONS -# define CGAL_NO_ASSERTIONS_BOOL false -#else -# define CGAL_NO_ASSERTIONS_BOOL true -#endif - #if defined( __INTEL_COMPILER) #define CGAL_ADDITIONAL_VARIANT_FOR_ICL ,int #else diff --git a/Installation/test/Installation/test_gmp_mpfr_dll.cpp b/Installation/test/Installation/test_gmp_mpfr_dll.cpp index 89f7684d370..3f407098996 100644 --- a/Installation/test/Installation/test_gmp_mpfr_dll.cpp +++ b/Installation/test/Installation/test_gmp_mpfr_dll.cpp @@ -7,6 +7,8 @@ int main() { #define GMP_SONAME "libgmp-10" #define MPFR_SONAME "libmpfr-4" +#define GMP_SONAME_BACKUP "gmp" +#define MPFR_SONAME_BACKUP "mpfr-6" #define GMP_MAJOR 5 #define MPFR_MAJOR 3 @@ -44,7 +46,7 @@ bool get_version_info(const LPCTSTR name, { delete[] versionInfo; std::cerr << name << " has no VersionInfo!\n"; - return false; + return true; } // we have version information UINT len = 0; @@ -63,7 +65,9 @@ int main() { std::cout << "Hello MPFR version " << mpfr_get_version() << std::endl; int major, minor, patch, build; if(!get_version_info(GMP_SONAME, major, minor, patch, build)) { - return 1; + if(!get_version_info(GMP_SONAME_BACKUP, major, minor, patch, build)) { + return 1; + } } std::cout << "GMP version " @@ -71,16 +75,16 @@ int main() { << minor << "." << patch << "." << build << "\n"; - assert(major==GMP_MAJOR); major = 0; if(!get_version_info(MPFR_SONAME, major, minor, patch, build)) { - return 1; + if(!get_version_info(MPFR_SONAME_BACKUP, major, minor, patch, build)) { + return 1; + } } std::cout << "MPFR version " << major << "." << minor << "." << patch << "." << build << "\n"; - assert(major==MPFR_MAJOR); } #endif diff --git a/Interpolation/demo/Interpolation/interpolation_2_demo.cpp b/Interpolation/demo/Interpolation/interpolation_2_demo.cpp index 13b8a7331b7..9fd09814a58 100644 --- a/Interpolation/demo/Interpolation/interpolation_2_demo.cpp +++ b/Interpolation/demo/Interpolation/interpolation_2_demo.cpp @@ -270,7 +270,7 @@ int main(int , char** ) //viewer CGAL::Geomview_stream gv(CGAL::Bbox_3(0,0,0, 2, 2, 2)); - gv.set_bg_color(CGAL::Color(0, 200, 200)); + gv.set_bg_color(CGAL::IO::Color(0, 200, 200)); gv.clear(); gv.set_line_width(2); @@ -278,14 +278,14 @@ int main(int , char** ) std::cout << "The data points are displayed in blue in the geomview" << " application." << std::endl; - gv << CGAL::blue(); + gv << CGAL::IO::blue(); visu_points(gv,sample_3); //show the gradients if(method>0){ std::cout << "The function gradients are displayed by red lines " <<" in the geomview application." << std::endl; - gv <>(std::istream &is, MyPointC2 &p) { double x, y; int c; - switch(CGAL::get_mode(is)) { + switch(CGAL::IO::get_mode(is)) { case CGAL::IO::ASCII : is >> x >> y >> c; break; diff --git a/Kernel_23/examples/Kernel_23/MySegmentC2.h b/Kernel_23/examples/Kernel_23/MySegmentC2.h index bca24c85bc9..903cb5a5b89 100644 --- a/Kernel_23/examples/Kernel_23/MySegmentC2.h +++ b/Kernel_23/examples/Kernel_23/MySegmentC2.h @@ -224,7 +224,7 @@ template < class R > std::ostream & operator<<(std::ostream &os, const MySegmentC2 &s) { - switch(CGAL::get_mode(os)) { + switch(CGAL::IO::get_mode(os)) { case CGAL::IO::ASCII : return os << s.source() << ' ' << s.target(); case CGAL::IO::BINARY : diff --git a/Kernel_23/include/CGAL/Bbox_2.h b/Kernel_23/include/CGAL/Bbox_2.h index cb84444425a..e3e118f9240 100644 --- a/Kernel_23/include/CGAL/Bbox_2.h +++ b/Kernel_23/include/CGAL/Bbox_2.h @@ -176,7 +176,7 @@ inline std::ostream& operator<<(std::ostream &os, const Bbox_2 &b) { - switch(get_mode(os)) { + switch(IO::get_mode(os)) { case IO::ASCII : os << b.xmin() << ' ' << b.ymin() << ' ' << b.xmax() << ' ' << b.ymax(); @@ -205,9 +205,9 @@ operator>>(std::istream &is, Bbox_2 &b) double xmax = 0; double ymax = 0; - switch(get_mode(is)) { + switch(IO::get_mode(is)) { case IO::ASCII : - is >> iformat(xmin) >> iformat(ymin) >> iformat(xmax) >> iformat(ymax); + is >> IO::iformat(xmin) >> IO::iformat(ymin) >> IO::iformat(xmax) >> IO::iformat(ymax); break; case IO::BINARY : read(is, xmin); diff --git a/Kernel_23/include/CGAL/Bbox_3.h b/Kernel_23/include/CGAL/Bbox_3.h index 2f5b6e49425..a013e041291 100644 --- a/Kernel_23/include/CGAL/Bbox_3.h +++ b/Kernel_23/include/CGAL/Bbox_3.h @@ -205,7 +205,7 @@ inline std::ostream& operator<<(std::ostream &os, const Bbox_3& b) { - switch(get_mode(os)) + switch(IO::get_mode(os)) { case IO::ASCII : return os << b.xmin() << ' ' << b.ymin() << ' ' << b.zmin() @@ -241,11 +241,11 @@ operator>>(std::istream &is, Bbox_3& b) double ymax = 0; double zmax = 0; - switch(get_mode(is)) + switch(IO::get_mode(is)) { case IO::ASCII : - is >> iformat(xmin) >> iformat(ymin) >> iformat(zmin) - >> iformat(xmax) >> iformat(ymax) >> iformat(zmax); + is >> IO::iformat(xmin) >> IO::iformat(ymin) >> IO::iformat(zmin) + >> IO::iformat(xmax) >> IO::iformat(ymax) >> IO::iformat(zmax); break; case IO::BINARY : read(is, xmin); diff --git a/Kernel_23/include/CGAL/Circle_2.h b/Kernel_23/include/CGAL/Circle_2.h index a1cc8092654..a94c4f2f598 100644 --- a/Kernel_23/include/CGAL/Circle_2.h +++ b/Kernel_23/include/CGAL/Circle_2.h @@ -221,7 +221,7 @@ template std::ostream& insert(std::ostream& os, const Circle_2& c) { - switch(get_mode(os)) { + switch(IO::get_mode(os)) { case IO::ASCII : os << c.center() << ' ' << c.squared_radius() << ' ' << static_cast(c.orientation()); @@ -264,9 +264,9 @@ extract(std::istream& is, Circle_2& c) typename R::Point_2 center; typename R::FT squared_radius(0); int o=0; - switch(get_mode(is)) { + switch(IO::get_mode(is)) { case IO::ASCII : - is >> center >> iformat(squared_radius) >> o; + is >> center >> IO::iformat(squared_radius) >> o; break; case IO::BINARY : is >> center; diff --git a/Kernel_23/include/CGAL/Direction_2.h b/Kernel_23/include/CGAL/Direction_2.h index 37f1196d794..9d512db64de 100644 --- a/Kernel_23/include/CGAL/Direction_2.h +++ b/Kernel_23/include/CGAL/Direction_2.h @@ -180,7 +180,7 @@ std::ostream& insert(std::ostream& os, const Direction_2& d, const Cartesian_tag&) { typename R::Vector_2 v = d.to_vector(); - switch(get_mode(os)) { + switch(IO::get_mode(os)) { case IO::ASCII : return os << v.x() << ' ' << v.y(); case IO::BINARY : @@ -196,7 +196,7 @@ template std::ostream& insert(std::ostream& os, const Direction_2& d, const Homogeneous_tag&) { - switch(get_mode(os)) + switch(IO::get_mode(os)) { case IO::ASCII : return os << d.dx() << ' ' << d.dy(); @@ -223,9 +223,9 @@ std::istream& extract(std::istream& is, Direction_2& d, const Cartesian_tag&) { typename R::FT x(0), y(0); - switch(get_mode(is)) { + switch(IO::get_mode(is)) { case IO::ASCII : - is >> iformat(x) >> iformat(y); + is >> IO::iformat(x) >> IO::iformat(y); break; case IO::BINARY : read(is, x); @@ -247,10 +247,10 @@ std::istream& extract(std::istream& is, Direction_2& d, const Homogeneous_tag&) { typename R::RT x, y; - switch(get_mode(is)) + switch(IO::get_mode(is)) { case IO::ASCII : - is >> iformat(x) >> iformat(y); + is >> IO::iformat(x) >> IO::iformat(y); break; case IO::BINARY : read(is, x); diff --git a/Kernel_23/include/CGAL/Direction_3.h b/Kernel_23/include/CGAL/Direction_3.h index 77be97c63be..aedb284da3f 100644 --- a/Kernel_23/include/CGAL/Direction_3.h +++ b/Kernel_23/include/CGAL/Direction_3.h @@ -133,7 +133,7 @@ std::ostream& insert(std::ostream& os, const Direction_3& d, const Cartesian_tag&) { typename R::Vector_3 v = d.to_vector(); - switch(get_mode(os)) { + switch(IO::get_mode(os)) { case IO::ASCII : return os << v.x() << ' ' << v.y() << ' ' << v.z(); case IO::BINARY : @@ -151,7 +151,7 @@ template std::ostream& insert(std::ostream& os, const Direction_3& d, const Homogeneous_tag&) { - switch(get_mode(os)) + switch(IO::get_mode(os)) { case IO::ASCII : return os << d.dx() << ' ' << d.dy() << ' ' << d.dz(); @@ -180,9 +180,9 @@ std::istream& extract(std::istream& is, Direction_3& d, const Cartesian_tag&) { typename R::FT x(0), y(0), z(0); - switch(get_mode(is)) { + switch(IO::get_mode(is)) { case IO::ASCII : - is >> iformat(x) >> iformat(y) >> iformat(z); + is >> IO::iformat(x) >> IO::iformat(y) >> IO::iformat(z); break; case IO::BINARY : read(is, x); @@ -205,10 +205,10 @@ std::istream& extract(std::istream& is, Direction_3& d, const Homogeneous_tag&) { typename R::RT x, y, z; - switch(get_mode(is)) + switch(IO::get_mode(is)) { case IO::ASCII : - is >> iformat(x) >> iformat(y) >> iformat(z); + is >> IO::iformat(x) >> IO::iformat(y) >> IO::iformat(z); break; case IO::BINARY : read(is, x); diff --git a/Kernel_23/include/CGAL/Iso_cuboid_3.h b/Kernel_23/include/CGAL/Iso_cuboid_3.h index 9c241a184ec..6a004ca5ce1 100644 --- a/Kernel_23/include/CGAL/Iso_cuboid_3.h +++ b/Kernel_23/include/CGAL/Iso_cuboid_3.h @@ -231,7 +231,7 @@ template < class R > std::ostream & operator<<(std::ostream& os, const Iso_cuboid_3& r) { - switch(get_mode(os)) { + switch(IO::get_mode(os)) { case IO::ASCII : return os << (r.min)() << ' ' << (r.max)(); case IO::BINARY : diff --git a/Kernel_23/include/CGAL/Iso_rectangle_2.h b/Kernel_23/include/CGAL/Iso_rectangle_2.h index 10041882ce5..5929236e1a1 100644 --- a/Kernel_23/include/CGAL/Iso_rectangle_2.h +++ b/Kernel_23/include/CGAL/Iso_rectangle_2.h @@ -222,7 +222,7 @@ template < class R > std::ostream & operator<<(std::ostream &os, const Iso_rectangle_2 &r) { - switch(get_mode(os)) { + switch(IO::get_mode(os)) { case IO::ASCII : return os << (r.min)() << ' ' << (r.max)(); case IO::BINARY : diff --git a/Kernel_23/include/CGAL/Line_2.h b/Kernel_23/include/CGAL/Line_2.h index 79b4dcbc9f8..605193d46c7 100644 --- a/Kernel_23/include/CGAL/Line_2.h +++ b/Kernel_23/include/CGAL/Line_2.h @@ -240,7 +240,7 @@ template std::ostream& insert(std::ostream& os, const Line_2& l) { - switch(get_mode(os)) { + switch(IO::get_mode(os)) { case IO::ASCII : return os << l.a() << ' ' << l.b() << ' ' << l.c(); case IO::BINARY : @@ -267,9 +267,9 @@ std::istream& extract(std::istream& is, Line_2& l) { typename R::RT a(0), b(0), c(0); - switch(get_mode(is)) { + switch(IO::get_mode(is)) { case IO::ASCII : - is >> iformat(a) >> iformat(b) >> iformat(c); + is >> IO::iformat(a) >> IO::iformat(b) >> IO::iformat(c); break; case IO::BINARY : read(is, a); diff --git a/Kernel_23/include/CGAL/Line_3.h b/Kernel_23/include/CGAL/Line_3.h index ef303c87d34..c17c39eb8d4 100644 --- a/Kernel_23/include/CGAL/Line_3.h +++ b/Kernel_23/include/CGAL/Line_3.h @@ -138,7 +138,7 @@ template < class R > std::ostream & operator<<(std::ostream &os, const Line_3 &l) { - switch(get_mode(os)) { + switch(IO::get_mode(os)) { case IO::ASCII : return os << l.point(0) << ' ' << l.point(1); case IO::BINARY : diff --git a/Kernel_23/include/CGAL/Plane_3.h b/Kernel_23/include/CGAL/Plane_3.h index 659cde8d50b..058c96b919e 100644 --- a/Kernel_23/include/CGAL/Plane_3.h +++ b/Kernel_23/include/CGAL/Plane_3.h @@ -228,7 +228,7 @@ template < class R > std::ostream & operator<<(std::ostream &os, const Plane_3 &p) { - switch(get_mode(os)) { + switch(IO::get_mode(os)) { case IO::ASCII : return os << p.a() << ' ' << p.b() << ' ' << p.c() << ' ' << p.d(); case IO::BINARY : @@ -249,9 +249,9 @@ std::istream & operator>>(std::istream &is, Plane_3 &p) { typename R::RT a(0), b(0), c(0), d(0); - switch(get_mode(is)) { + switch(IO::get_mode(is)) { case IO::ASCII : - is >> iformat(a) >> iformat(b) >> iformat(c) >> iformat(d); + is >> IO::iformat(a) >> IO::iformat(b) >> IO::iformat(c) >> IO::iformat(d); break; case IO::BINARY : read(is, a); diff --git a/Kernel_23/include/CGAL/Point_2.h b/Kernel_23/include/CGAL/Point_2.h index 1d4403354b7..297817303ee 100644 --- a/Kernel_23/include/CGAL/Point_2.h +++ b/Kernel_23/include/CGAL/Point_2.h @@ -190,7 +190,7 @@ template std::ostream& insert(std::ostream& os, const Point_2& p,const Cartesian_tag&) { - switch(get_mode(os)) { + switch(IO::get_mode(os)) { case IO::ASCII : return os << p.x() << ' ' << p.y(); case IO::BINARY : @@ -206,7 +206,7 @@ template std::ostream& insert(std::ostream& os, const Point_2& p,const Homogeneous_tag&) { - switch(get_mode(os)) + switch(IO::get_mode(os)) { case IO::ASCII : return os << p.hx() << ' ' << p.hy() << ' ' << p.hw(); @@ -235,9 +235,9 @@ std::istream& extract(std::istream& is, Point_2& p, const Cartesian_tag&) { typename R::FT x(0), y(0); - switch(get_mode(is)) { + switch(IO::get_mode(is)) { case IO::ASCII : - is >> iformat(x) >> iformat(y); + is >> IO::iformat(x) >> IO::iformat(y); break; case IO::BINARY : read(is, x); @@ -260,7 +260,7 @@ std::istream& extract(std::istream& is, Point_2& p, const Homogeneous_tag&) { typename R::RT hx, hy, hw; - switch(get_mode(is)) + switch(IO::get_mode(is)) { case IO::ASCII : is >> hx >> hy >> hw; diff --git a/Kernel_23/include/CGAL/Point_3.h b/Kernel_23/include/CGAL/Point_3.h index a8487afeb38..77858d83689 100644 --- a/Kernel_23/include/CGAL/Point_3.h +++ b/Kernel_23/include/CGAL/Point_3.h @@ -216,7 +216,7 @@ template std::ostream& insert(std::ostream& os, const Point_3& p,const Cartesian_tag&) { - switch(get_mode(os)) { + switch(IO::get_mode(os)) { case IO::ASCII : return os << p.x() << ' ' << p.y() << ' ' << p.z(); case IO::BINARY : @@ -234,7 +234,7 @@ template std::ostream& insert(std::ostream& os, const Point_3& p,const Homogeneous_tag&) { - switch(get_mode(os)) + switch(IO::get_mode(os)) { case IO::ASCII : return os << p.hx() << ' ' << p.hy() << ' ' << p.hz() << ' ' << p.hw(); @@ -265,9 +265,9 @@ std::istream& extract(std::istream& is, Point_3& p, const Cartesian_tag&) { typename R::FT x(0), y(0), z(0); - switch(get_mode(is)) { + switch(IO::get_mode(is)) { case IO::ASCII : - is >> iformat(x) >> iformat(y) >> iformat(z); + is >> IO::iformat(x) >> IO::iformat(y) >> IO::iformat(z); break; case IO::BINARY : read(is, x); @@ -291,7 +291,7 @@ std::istream& extract(std::istream& is, Point_3& p, const Homogeneous_tag&) { typename R::RT hx, hy, hz, hw; - switch(get_mode(is)) + switch(IO::get_mode(is)) { case IO::ASCII : is >> hx >> hy >> hz >> hw; diff --git a/Kernel_23/include/CGAL/Ray_2.h b/Kernel_23/include/CGAL/Ray_2.h index 732ea145918..161b11fc01e 100644 --- a/Kernel_23/include/CGAL/Ray_2.h +++ b/Kernel_23/include/CGAL/Ray_2.h @@ -198,7 +198,7 @@ template std::ostream& insert(std::ostream& os, const Ray_2& r, const Cartesian_tag&) { - switch(get_mode(os)) { + switch(IO::get_mode(os)) { case IO::ASCII : return os << r.source() << ' ' << r.second_point(); case IO::BINARY : @@ -212,7 +212,7 @@ template std::ostream& insert(std::ostream& os, const Ray_2& r, const Homogeneous_tag&) { - switch(get_mode(os)) + switch(IO::get_mode(os)) { case IO::ASCII : return os << r.source() << ' ' << r.second_point(); diff --git a/Kernel_23/include/CGAL/Ray_3.h b/Kernel_23/include/CGAL/Ray_3.h index 6854f30a46f..fe0c2e056e5 100644 --- a/Kernel_23/include/CGAL/Ray_3.h +++ b/Kernel_23/include/CGAL/Ray_3.h @@ -166,7 +166,7 @@ template std::ostream& insert(std::ostream& os, const Ray_3& r, const Cartesian_tag&) { - switch(get_mode(os)) { + switch(IO::get_mode(os)) { case IO::ASCII : return os << r.start() << ' ' << r.direction(); case IO::BINARY : @@ -180,7 +180,7 @@ template std::ostream& insert(std::ostream& os, const Ray_3& r, const Homogeneous_tag&) { - switch(get_mode(os)) + switch(IO::get_mode(os)) { case IO::ASCII : return os << r.start() << ' ' << r.direction(); diff --git a/Kernel_23/include/CGAL/Segment_2.h b/Kernel_23/include/CGAL/Segment_2.h index 8143beeb5c0..72773d62789 100644 --- a/Kernel_23/include/CGAL/Segment_2.h +++ b/Kernel_23/include/CGAL/Segment_2.h @@ -242,7 +242,7 @@ template < class R > std::ostream & operator<<(std::ostream &os, const Segment_2 &s) { - switch(get_mode(os)) { + switch(IO::get_mode(os)) { case IO::ASCII : return os << s.source() << ' ' << s.target(); case IO::BINARY : diff --git a/Kernel_23/include/CGAL/Segment_3.h b/Kernel_23/include/CGAL/Segment_3.h index fa0e4e7569d..1274e3d7868 100644 --- a/Kernel_23/include/CGAL/Segment_3.h +++ b/Kernel_23/include/CGAL/Segment_3.h @@ -173,7 +173,7 @@ template < class R > std::ostream & operator<<(std::ostream &os, const Segment_3 &s) { - switch(get_mode(os)) { + switch(IO::get_mode(os)) { case IO::ASCII : return os << s.source() << ' ' << s.target(); case IO::BINARY : diff --git a/Kernel_23/include/CGAL/Sphere_3.h b/Kernel_23/include/CGAL/Sphere_3.h index 246801a068e..59f3d142cd1 100644 --- a/Kernel_23/include/CGAL/Sphere_3.h +++ b/Kernel_23/include/CGAL/Sphere_3.h @@ -208,7 +208,7 @@ template std::ostream& insert(std::ostream& os, const Sphere_3& c,const Cartesian_tag&) { - switch(get_mode(os)) { + switch(IO::get_mode(os)) { case IO::ASCII : os << c.center() << ' ' << c.squared_radius() << ' ' << static_cast(c.orientation()); @@ -240,7 +240,7 @@ template std::ostream& insert(std::ostream& os, const Sphere_3& c, const Homogeneous_tag&) { - switch(get_mode(os)) { + switch(IO::get_mode(os)) { case IO::ASCII : os << c.center() << ' ' << c.squared_radius() << ' ' << static_cast(c.orientation()); @@ -283,7 +283,7 @@ extract(std::istream& is, Sphere_3& c, const Cartesian_tag&) typename R::Point_3 center; typename R::FT squared_radius(0); int o=0; - switch(get_mode(is)) { + switch(IO::get_mode(is)) { case IO::ASCII : is >> center >> squared_radius >> o; break; @@ -311,7 +311,7 @@ extract(std::istream& is, Sphere_3& c, const Homogeneous_tag&) typename R::Point_3 center; typename R::FT squared_radius; int o=0; - switch(get_mode(is)) { + switch(IO::get_mode(is)) { case IO::ASCII : is >> center >> squared_radius >> o; break; diff --git a/Kernel_23/include/CGAL/Tetrahedron_3.h b/Kernel_23/include/CGAL/Tetrahedron_3.h index 634e73434da..edbe34c85ce 100644 --- a/Kernel_23/include/CGAL/Tetrahedron_3.h +++ b/Kernel_23/include/CGAL/Tetrahedron_3.h @@ -147,7 +147,7 @@ template < class R > std::ostream & operator<<(std::ostream &os, const Tetrahedron_3 &t) { - switch(get_mode(os)) { + switch(IO::get_mode(os)) { case IO::ASCII : return os << t[0] << ' ' << t[1] << ' ' << t[2] << ' ' << t[3]; case IO::BINARY : diff --git a/Kernel_23/include/CGAL/Triangle_2.h b/Kernel_23/include/CGAL/Triangle_2.h index 5cc5aa97cad..2b7d6b5a0aa 100644 --- a/Kernel_23/include/CGAL/Triangle_2.h +++ b/Kernel_23/include/CGAL/Triangle_2.h @@ -175,7 +175,7 @@ template < class R > std::ostream & operator<<(std::ostream &os, const Triangle_2 &t) { - switch(get_mode(os)) { + switch(IO::get_mode(os)) { case IO::ASCII : return os << t[0] << ' ' << t[1] << ' ' << t[2]; case IO::BINARY : diff --git a/Kernel_23/include/CGAL/Triangle_3.h b/Kernel_23/include/CGAL/Triangle_3.h index 7999ca64f82..a1e2348e165 100644 --- a/Kernel_23/include/CGAL/Triangle_3.h +++ b/Kernel_23/include/CGAL/Triangle_3.h @@ -117,7 +117,7 @@ template < class R > std::ostream & operator<<(std::ostream &os, const Triangle_3 &t) { - switch(get_mode(os)) { + switch(IO::get_mode(os)) { case IO::ASCII : return os << t[0] << ' ' << t[1] << ' ' << t[2]; case IO::BINARY : diff --git a/Kernel_23/include/CGAL/Vector_2.h b/Kernel_23/include/CGAL/Vector_2.h index 8c08dfd29d5..bc8e6a72a03 100644 --- a/Kernel_23/include/CGAL/Vector_2.h +++ b/Kernel_23/include/CGAL/Vector_2.h @@ -290,7 +290,7 @@ template std::ostream& insert(std::ostream& os, const Vector_2& v, const Cartesian_tag&) { - switch(get_mode(os)) { + switch(IO::get_mode(os)) { case IO::ASCII : return os << v.x() << ' ' << v.y(); case IO::BINARY : @@ -306,7 +306,7 @@ template std::ostream& insert(std::ostream& os, const Vector_2& v, const Homogeneous_tag&) { - switch(get_mode(os)) + switch(IO::get_mode(os)) { case IO::ASCII : return os << v.hx() << ' ' << v.hy() << ' ' << v.hw(); @@ -336,9 +336,9 @@ std::istream& extract(std::istream& is, Vector_2& v, const Cartesian_tag&) { typename R::FT x(0), y(0); - switch(get_mode(is)) { + switch(IO::get_mode(is)) { case IO::ASCII : - is >> iformat(x) >> iformat(y); + is >> IO::iformat(x) >> IO::iformat(y); break; case IO::BINARY : read(is, x); @@ -361,7 +361,7 @@ std::istream& extract(std::istream& is, Vector_2& v, const Homogeneous_tag&) { typename R::RT hx, hy, hw; - switch(get_mode(is)) + switch(IO::get_mode(is)) { case IO::ASCII : is >> hx >> hy >> hw; diff --git a/Kernel_23/include/CGAL/Vector_3.h b/Kernel_23/include/CGAL/Vector_3.h index 681e3ec7ceb..75e071c0a7c 100644 --- a/Kernel_23/include/CGAL/Vector_3.h +++ b/Kernel_23/include/CGAL/Vector_3.h @@ -267,7 +267,7 @@ template std::ostream& insert(std::ostream& os, const Vector_3& v, const Cartesian_tag&) { - switch(get_mode(os)) { + switch(IO::get_mode(os)) { case IO::ASCII : return os << v.x() << ' ' << v.y() << ' ' << v.z(); case IO::BINARY : @@ -285,7 +285,7 @@ template std::ostream& insert(std::ostream& os, const Vector_3& v, const Homogeneous_tag&) { - switch(get_mode(os)) + switch(IO::get_mode(os)) { case IO::ASCII : return os << v.hx() << ' ' << v.hy() << ' ' << v.hz() << ' ' << v.hw(); @@ -316,9 +316,9 @@ std::istream& extract(std::istream& is, Vector_3& v, const Cartesian_tag&) { typename R::FT x(0), y(0), z(0); - switch(get_mode(is)) { + switch(IO::get_mode(is)) { case IO::ASCII : - is >> iformat(x) >> iformat(y) >> iformat(z); + is >> IO::iformat(x) >> IO::iformat(y) >> IO::iformat(z); break; case IO::BINARY : read(is, x); @@ -341,7 +341,7 @@ std::istream& extract(std::istream& is, Vector_3& v, const Homogeneous_tag&) { typename R::RT hx, hy, hz, hw; - switch(get_mode(is)) + switch(IO::get_mode(is)) { case IO::ASCII : is >> hx >> hy >> hz >> hw; diff --git a/Kernel_23/include/CGAL/Weighted_point_2.h b/Kernel_23/include/CGAL/Weighted_point_2.h index 68742e47973..006fbe8cbc0 100644 --- a/Kernel_23/include/CGAL/Weighted_point_2.h +++ b/Kernel_23/include/CGAL/Weighted_point_2.h @@ -236,7 +236,7 @@ template std::ostream& insert(std::ostream& os, const Weighted_point_2& p,const Cartesian_tag&) { - switch(get_mode(os)) { + switch(IO::get_mode(os)) { case IO::ASCII : return os << p.point() << ' ' << p.weight(); case IO::BINARY : @@ -253,7 +253,7 @@ template std::ostream& insert(std::ostream& os, const Weighted_point_2& p,const Homogeneous_tag&) { - switch(get_mode(os)) + switch(IO::get_mode(os)) { case IO::ASCII : return os << p.point() << ' ' << p.weight(); @@ -283,9 +283,9 @@ std::istream& extract(std::istream& is, Weighted_point_2& p, const Cartesian_tag&) { typename R::FT x, y, weight; - switch(get_mode(is)) { + switch(IO::get_mode(is)) { case IO::ASCII : - is >> iformat(x) >> iformat(y) >> iformat(weight); + is >> IO::iformat(x) >> IO::iformat(y) >> IO::iformat(weight); break; case IO::BINARY : read(is, x); @@ -309,7 +309,7 @@ extract(std::istream& is, Weighted_point_2& p, const Homogeneous_tag&) { typename R::RT hx, hy, hw; typename R::FT weight; - switch(get_mode(is)) + switch(IO::get_mode(is)) { case IO::ASCII : is >> hx >> hy >> hw >> weight; diff --git a/Kernel_23/include/CGAL/Weighted_point_3.h b/Kernel_23/include/CGAL/Weighted_point_3.h index 37aa35f5f4b..25e2eeaa62e 100644 --- a/Kernel_23/include/CGAL/Weighted_point_3.h +++ b/Kernel_23/include/CGAL/Weighted_point_3.h @@ -251,7 +251,7 @@ template std::ostream& insert(std::ostream& os, const Weighted_point_3& p,const Cartesian_tag&) { - switch(get_mode(os)) { + switch(IO::get_mode(os)) { case IO::ASCII : return os << p.point() << ' ' << p.weight(); case IO::BINARY : @@ -270,7 +270,7 @@ template std::ostream& insert(std::ostream& os, const Weighted_point_3& p,const Homogeneous_tag&) { - switch(get_mode(os)) + switch(IO::get_mode(os)) { case IO::ASCII : return os << p.hx() << ' ' << p.hy() << ' ' << p.hz() << ' ' << p.hw() << ' ' << p.weight(); @@ -303,9 +303,9 @@ std::istream& extract(std::istream& is, Weighted_point_3& p, const Cartesian_tag&) { typename R::FT x, y, z, weight; - switch(get_mode(is)) { + switch(IO::get_mode(is)) { case IO::ASCII : - is >> iformat(x) >> iformat(y) >> iformat(z) >> iformat(weight); + is >> IO::iformat(x) >> IO::iformat(y) >> IO::iformat(z) >> IO::iformat(weight); break; case IO::BINARY : read(is, x); @@ -330,7 +330,7 @@ extract(std::istream& is, Weighted_point_3& p, const Homogeneous_tag&) { typename R::RT hx, hy, hz, hw; typename R::FT weight; - switch(get_mode(is)) + switch(IO::get_mode(is)) { case IO::ASCII : is >> hx >> hy >> hz >> hw >> weight; diff --git a/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_aff_transformation_2.h b/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_aff_transformation_2.h index 31f104419fb..ccdde6d298c 100644 --- a/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_aff_transformation_2.h +++ b/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_aff_transformation_2.h @@ -135,7 +135,9 @@ _test_cls_aff_transformation_2(const R& ) CGAL::Aff_transformation_2 rot3( CGAL::ROTATION, RT(3),RT(4),RT(5)); - + CGAL::Aff_transformation_2 refle(CGAL::REFLECTION, CGAL::Line_2( + CGAL::Point_2(1,3), + CGAL::Point_2(2,1))); CGAL::Aff_transformation_2 a[14]; @@ -295,6 +297,34 @@ _test_cls_aff_transformation_2(const R& ) assert( rot3.is_even() ); assert( xrefl.is_odd() ); + // translation + assert( translate.is_translation() ); + assert( ! scale11.is_translation() ); + assert( ! gtrans.is_translation() ); + assert( ! rot90.is_translation() ); + assert( ! refle.is_translation() ); + + // scaling + assert( scale11.is_scaling() ); + assert( ! translate.is_scaling() ); + assert( ! gscale.is_scaling() ); + assert( ! rot90.is_scaling() ); + assert( ! refle.is_scaling() ); + + // reflection + assert( ! scale11.is_reflection() ); + assert( ! translate.is_reflection() ); + assert( ! gscale.is_reflection() ); + assert( ! rot90.is_reflection() ); + assert( refle.is_reflection() ); + + // rotation + assert( ! scale11.is_rotation() ); + assert( ! translate.is_rotation() ); + assert( ! gscale.is_rotation() ); + assert( rot90.is_rotation() ); + assert( !refle.is_rotation() ); + // rotation assert( d0.transform( rot90 ) == d1 ); assert( d1.transform( rot90.inverse() ) == d0 ); diff --git a/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_aff_transformation_3.h b/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_aff_transformation_3.h index c10c07d1b1c..3c0db87e36f 100644 --- a/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_aff_transformation_3.h +++ b/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_aff_transformation_3.h @@ -151,6 +151,16 @@ _test_cls_aff_transformation_3(const R& ) assert( ident.is_even() ); assert( xrefl.is_odd() ); + // translation + assert( translate.is_translation() ); + assert( ! scale11.is_translation() ); + assert( ! gtrans.is_translation() ); + + // scaling + assert( scale11.is_scaling() ); + assert( ! translate.is_scaling() ); + assert( ! gscale.is_scaling() ); + CGAL::Aff_transformation_3 a[11]; std::cout << '.'; @@ -261,7 +271,7 @@ _test_cls_aff_transformation_3(const R& ) assert( vec.transform(translate) == vec.transform(gtrans) ); assert( dir.transform(translate) == dir.transform(gtrans) ); assert( pnt.transform(translate) == pnt.transform(gtrans) ); - assert( pla.transform(translate) == pla.transform(gtrans) ); + assert( pla.transform(translate) == pla.transform(gtrans) || nonexact ); // xrefl tdir = d0.transform(xrefl); diff --git a/Kernel_d/include/CGAL/Kernel_d/Matrix__.h b/Kernel_d/include/CGAL/Kernel_d/Matrix__.h index 5ecbfcc10b7..779137a2ccc 100644 --- a/Kernel_d/include/CGAL/Kernel_d/Matrix__.h +++ b/Kernel_d/include/CGAL/Kernel_d/Matrix__.h @@ -746,7 +746,7 @@ std::ostream& operator<<(std::ostream& os, const Matrix_& M) int d = M.row_dimension(); int k = M.column_dimension(); - switch (get_mode(os)) { + switch (IO::get_mode(os)) { case CGAL::IO::BINARY: CGAL::write( os, d); CGAL::write( os, k); @@ -790,7 +790,7 @@ std::istream& operator>>(std::istream& is, Matrix_& M) x_d2,0 ... x_d2,d1-1 */ int cdim, rdim, i; - switch(get_mode(is)) { + switch(IO::get_mode(is)) { case CGAL::IO::BINARY : CGAL::read(is,rdim); CGAL::read(is,cdim); diff --git a/Kernel_d/include/CGAL/Kernel_d/Pair_d.h b/Kernel_d/include/CGAL/Kernel_d/Pair_d.h index a5cbbd2482f..6f9c435e07a 100644 --- a/Kernel_d/include/CGAL/Kernel_d/Pair_d.h +++ b/Kernel_d/include/CGAL/Kernel_d/Pair_d.h @@ -61,7 +61,7 @@ Direction_d direction() const void read(std::istream& is) { - switch( get_mode(is) ) { + switch( IO::get_mode(is) ) { case CGAL::IO::ASCII : is >> _p[0] >> _p[1]; break; case CGAL::IO::BINARY : @@ -73,7 +73,7 @@ void read(std::istream& is) void print(std::ostream& os, const char* _name) const { - switch( get_mode(os) ) { + switch( IO::get_mode(os) ) { case CGAL::IO::ASCII : os << _p[0] << " " << _p[1]; break; case CGAL::IO::BINARY : diff --git a/Kernel_d/include/CGAL/Kernel_d/Tuple_d.h b/Kernel_d/include/CGAL/Kernel_d/Tuple_d.h index 30539b5512d..9468a19db47 100644 --- a/Kernel_d/include/CGAL/Kernel_d/Tuple_d.h +++ b/Kernel_d/include/CGAL/Kernel_d/Tuple_d.h @@ -212,7 +212,7 @@ Comparison_result operator()( template void Tuple_d::print(std::ostream& os, const char* l) const { int i; - switch( get_mode(os) ) { + switch( IO::get_mode(os) ) { case CGAL::IO::ASCII : os << size() << " "; for (i = 0; i < size(); ++i) @@ -235,7 +235,7 @@ void Tuple_d::print(std::ostream& os, const char* l) const template void Tuple_d::read(std::istream& is) { int i = 0, d; - switch( get_mode(is) ) { + switch( IO::get_mode(is) ) { case CGAL::IO::ASCII : is >> d; v = Vector(d); while (i < d && is >> v[i] ) ++i; diff --git a/Kernel_d/include/CGAL/Kernel_d/Vector__.h b/Kernel_d/include/CGAL/Kernel_d/Vector__.h index 94a49f3f264..efeb82ad8e1 100644 --- a/Kernel_d/include/CGAL/Kernel_d/Vector__.h +++ b/Kernel_d/include/CGAL/Kernel_d/Vector__.h @@ -405,7 +405,7 @@ std::ostream& operator<<(std::ostream& os, const Vector_& v) /*{\Xbinopfunc writes |\Mvar| componentwise to the output stream $O$.}*/ { /* syntax: d x_0 x_1 ... x_d-1 */ int d = v.dimension(); - switch (get_mode(os)) { + switch (IO::get_mode(os)) { case CGAL::IO::BINARY: CGAL::write( os, d); for ( int i = 0; i < d; ++i) @@ -434,7 +434,7 @@ std::istream& operator>>(std::istream& is, Vector_& v) /*{\Xbinopfunc reads |\Mvar| componentwise from the input stream $I$.}*/ { /* syntax: d x_0 x_1 ... x_d-1 */ int d; - switch (get_mode(is)) { + switch (IO::get_mode(is)) { case CGAL::IO::ASCII : case CGAL::IO::BINARY : is >> d; diff --git a/Kernel_d/test/Kernel_d/Linear_algebra-test.cpp b/Kernel_d/test/Kernel_d/Linear_algebra-test.cpp index 543de175b53..cc12532746e 100644 --- a/Kernel_d/test/Kernel_d/Linear_algebra-test.cpp +++ b/Kernel_d/test/Kernel_d/Linear_algebra-test.cpp @@ -30,7 +30,7 @@ typedef double FT; int main(int argc, char* argv[]) { CGAL_KD_SETDTHREAD(151); - CGAL::set_pretty_mode ( std::cerr ); + CGAL::IO::set_pretty_mode ( std::cerr ); CGAL_TEST_START; { typedef RT NT; diff --git a/Kernel_d/test/Kernel_d/include/CGAL/test_macros.h b/Kernel_d/test/Kernel_d/include/CGAL/test_macros.h index 53dbe3cc356..94eee89202d 100644 --- a/Kernel_d/test/Kernel_d/include/CGAL/test_macros.h +++ b/Kernel_d/test/Kernel_d/include/CGAL/test_macros.h @@ -13,7 +13,7 @@ else #define CGAL_IO_TEST(datao,datai,iomode) { \ std::stringstream S; \ - CGAL::set_mode(S,iomode); \ + CGAL::IO::set_mode(S,iomode); \ S << datao; \ if ( iomode != CGAL::IO::BINARY) \ S << '\n'; \ diff --git a/Kernel_d/test/Kernel_d/interface-test.cpp b/Kernel_d/test/Kernel_d/interface-test.cpp index 17f962823c8..1429ac6ac76 100644 --- a/Kernel_d/test/Kernel_d/interface-test.cpp +++ b/Kernel_d/test/Kernel_d/interface-test.cpp @@ -24,7 +24,7 @@ typedef double FT_; int main() { CGAL_KD_SETDTHREAD(2); - CGAL::set_pretty_mode ( std::cerr ); + CGAL::IO::set_pretty_mode ( std::cerr ); CGAL_TEST_START; { // Homogeneous Kernel typedef CGAL::Homogeneous_d Kernel; diff --git a/Kernel_d/test/Kernel_d/intersection-test.cpp b/Kernel_d/test/Kernel_d/intersection-test.cpp index 2735aa0fc72..3f22d193653 100644 --- a/Kernel_d/test/Kernel_d/intersection-test.cpp +++ b/Kernel_d/test/Kernel_d/intersection-test.cpp @@ -29,7 +29,7 @@ typedef CGAL::Quotient FT; #endif int main() -{ CGAL::set_pretty_mode ( std::cerr ); +{ CGAL::IO::set_pretty_mode ( std::cerr ); CGAL_TEST_START; { typedef CGAL::Homogeneous_d Kernel; diff --git a/Linear_cell_complex/demo/Linear_cell_complex/MainWindow.cpp b/Linear_cell_complex/demo/Linear_cell_complex/MainWindow.cpp index a7107bfb3ab..2e7a347c8d2 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/MainWindow.cpp +++ b/Linear_cell_complex/demo/Linear_cell_complex/MainWindow.cpp @@ -1823,7 +1823,7 @@ void MainWindow::onMengerInc() LCC::Attribute_handle<3>::type ah = (scene.lcc)->create_attribute<3>(); scene.lcc->set_attribute<3>(mengerVolumes[i], ah); scene.lcc->info<3>(mengerVolumes[i]).color()= - (CGAL::Color(myrandom.get_int(0,256), + (CGAL::IO::Color(myrandom.get_int(0,256), myrandom.get_int(0,256), myrandom.get_int(0,256))); @@ -1925,11 +1925,11 @@ void MainWindow::split_vol_in_three(Dart_handle dh, bool removecenter) if (scene.lcc->are_attributes_automatically_managed()) { scene.lcc->info<3>(f1).color()= - (CGAL::Color(myrandom.get_int(0,256), + (CGAL::IO::Color(myrandom.get_int(0,256), myrandom.get_int(0,256), myrandom.get_int(0,256))); scene.lcc->info<3>(f2).color()= - (CGAL::Color(myrandom.get_int(0,256), + (CGAL::IO::Color(myrandom.get_int(0,256), myrandom.get_int(0,256), myrandom.get_int(0,256))); @@ -1979,11 +1979,11 @@ void MainWindow::split_vol_in_nine(Dart_handle dh, bool removecenter) if (scene.lcc->are_attributes_automatically_managed()) { scene.lcc->info<3>(f1).color()= - (CGAL::Color(myrandom.get_int(0,256), + (CGAL::IO::Color(myrandom.get_int(0,256), myrandom.get_int(0,256), myrandom.get_int(0,256))); scene.lcc->info<3>(f2).color()= - (CGAL::Color(myrandom.get_int(0,256), + (CGAL::IO::Color(myrandom.get_int(0,256), myrandom.get_int(0,256), myrandom.get_int(0,256))); @@ -2039,11 +2039,11 @@ void MainWindow::split_vol_in_twentyseven(Dart_handle dh) if (scene.lcc->are_attributes_automatically_managed()) { scene.lcc->info<3>(f1).color()= - (CGAL::Color(myrandom.get_int(0,256), + (CGAL::IO::Color(myrandom.get_int(0,256), myrandom.get_int(0,256), myrandom.get_int(0,256))); scene.lcc->info<3>(f2).color()= - (CGAL::Color(myrandom.get_int(0,256), + (CGAL::IO::Color(myrandom.get_int(0,256), myrandom.get_int(0,256), myrandom.get_int(0,256))); update_volume_list_add(scene.lcc->attribute<3>(dh)); @@ -3177,7 +3177,7 @@ void MainWindow::onSierpinskiTriangleInc() LCC::Attribute_handle<3>::type ah = (scene.lcc)->create_attribute<3>(); scene.lcc->set_attribute<3>(sierpinskiTriangleSurfaces[i], ah); scene.lcc->info<3>(sierpinskiTriangleSurfaces[i]).color()= - (CGAL::Color(myrandom.get_int(0,256), + (CGAL::IO::Color(myrandom.get_int(0,256), myrandom.get_int(0,256), myrandom.get_int(0,256))); diff --git a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h index 6137e328faf..18e66603ef4 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h +++ b/Linear_cell_complex/demo/Linear_cell_complex/Viewer.h @@ -77,13 +77,13 @@ struct MyDrawingFunctorLCC /// @return the color of the volume containing dh /// used only if colored_volume(alcc, dh) and !colored_face(alcc, dh) template - CGAL::Color volume_color(const LCC& alcc, + CGAL::IO::Color volume_color(const LCC& alcc, typename LCC::Dart_const_handle dh) const { return alcc.template info<3>(dh).color(); } /// @return the color of the face containing dh /// used only if colored_face(alcc, dh) template - CGAL::Color face_color(const LCC& alcc, + CGAL::IO::Color face_color(const LCC& alcc, typename LCC::Dart_const_handle dh) const { CGAL::Random random((unsigned int)(alcc.darts().index(dh))); @@ -92,15 +92,15 @@ struct MyDrawingFunctorLCC /// @return the color of the edge containing dh /// used only if colored_edge(alcc, dh) template - CGAL::Color edge_color(const LCC&, + CGAL::IO::Color edge_color(const LCC&, typename LCC::Dart_const_handle) const - { return CGAL::Color(0, 0, 0); } + { return CGAL::IO::Color(0, 0, 0); } /// @return the color of the vertex containing dh /// used only if colored_vertex(alcc, dh) template - CGAL::Color vertex_color(const LCC&, + CGAL::IO::Color vertex_color(const LCC&, typename LCC::Dart_const_handle) const - { return CGAL::Color(0, 0, 0); } + { return CGAL::IO::Color(0, 0, 0); } }; diff --git a/Linear_cell_complex/demo/Linear_cell_complex/typedefs.h b/Linear_cell_complex/demo/Linear_cell_complex/typedefs.h index 17924ecca8d..459c745f1b9 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/typedefs.h +++ b/Linear_cell_complex/demo/Linear_cell_complex/typedefs.h @@ -51,15 +51,15 @@ class Volume_info friend void CGAL::write_cmap_attribute_node(boost::property_tree::ptree & node, const Volume_info& arg); public: - Volume_info() : m_color(CGAL::Color(myrandom.get_int(0,256), + Volume_info() : m_color(CGAL::IO::Color(myrandom.get_int(0,256), myrandom.get_int(0,256), myrandom.get_int(0,256))), m_status( LCC_DEMO_VISIBLE | LCC_DEMO_FILLED ) {} - CGAL::Color& color() + CGAL::IO::Color& color() { return m_color; } - const CGAL::Color& color() const + const CGAL::IO::Color& color() const { return m_color; } std::string color_name() const @@ -97,7 +97,7 @@ public: { set_filled(!is_filled()); } private: - CGAL::Color m_color; + CGAL::IO::Color m_color; char m_status; }; @@ -120,7 +120,7 @@ inline void read_cmap_attribute_node char r = v.second.get("color-r"); char g = v.second.get("color-g"); char b = v.second.get("color-b"); - val.m_color = CGAL::Color(r,g,b); + val.m_color = CGAL::IO::Color(r,g,b); } catch(const std::exception & ) {} diff --git a/Linear_cell_complex/examples/Linear_cell_complex/basic_viewer.h b/Linear_cell_complex/examples/Linear_cell_complex/basic_viewer.h index 6b7b97eb3c1..cbc75458f95 100644 --- a/Linear_cell_complex/examples/Linear_cell_complex/basic_viewer.h +++ b/Linear_cell_complex/examples/Linear_cell_complex/basic_viewer.h @@ -286,7 +286,7 @@ public: { bb=bb+p.bbox(); } } - void add_color(const CGAL::Color& acolor, std::vector& color_vector) + void add_color(const CGAL::IO::Color& acolor, std::vector& color_vector) { color_vector.push_back((double)color_of_face.red()/(double)255); color_vector.push_back((double)color_of_face.green()/(double)255); @@ -303,7 +303,7 @@ public: void add_mono_point(const Local_point& p) { add_point(p, arrays[POS_MONO_POINTS]); } - void add_colored_point(const Local_point& p, const CGAL::Color& acolor) + void add_colored_point(const Local_point& p, const CGAL::IO::Color& acolor) { add_point(p, arrays[POS_COLORED_POINTS]); add_color(acolor, arrays[COLOR_POINTS]); @@ -316,7 +316,7 @@ public: } void add_colored_segment(const Local_point& p1, const Local_point& p2, - const CGAL::Color& acolor) + const CGAL::IO::Color& acolor) { add_point(p1, arrays[POS_COLORED_SEGMENTS]); add_point(p2, arrays[POS_COLORED_SEGMENTS]); @@ -341,7 +341,7 @@ public: } /// Start a new face, with a given color. - void colored_face_begin(const CGAL::Color& acolor) + void colored_face_begin(const CGAL::IO::Color& acolor) { color_of_face=acolor; m_started_face_is_colored=true; @@ -1132,9 +1132,9 @@ private: double m_size_points; double m_size_edges; - CGAL::Color m_vertices_mono_color; - CGAL::Color m_edges_mono_color; - CGAL::Color m_faces_mono_color; + CGAL::IO::Color m_vertices_mono_color; + CGAL::IO::Color m_edges_mono_color; + CGAL::IO::Color m_faces_mono_color; QVector4D m_ambient_color; bool m_are_buffers_initialized; @@ -1184,7 +1184,7 @@ private: bool m_started_face_is_colored; std::vector points_of_face; std::vector vertex_normals_for_face; - CGAL::Color color_of_face; + CGAL::IO::Color color_of_face; }; #endif // CGAL_BASIC_VIEWER_H diff --git a/Linear_cell_complex/examples/Linear_cell_complex/gmap_linear_cell_complex_3.cpp b/Linear_cell_complex/examples/Linear_cell_complex/gmap_linear_cell_complex_3.cpp index 7e4d6771338..fbb3f60d826 100644 --- a/Linear_cell_complex/examples/Linear_cell_complex/gmap_linear_cell_complex_3.cpp +++ b/Linear_cell_complex/examples/Linear_cell_complex/gmap_linear_cell_complex_3.cpp @@ -49,7 +49,7 @@ int main() // Display all the vertices of the lcc by iterating on the // Vertex_attribute container. - CGAL::set_ascii_mode(std::cout); + CGAL::IO::set_ascii_mode(std::cout); std::cout<<"Vertices: "; for (LCC_3::Vertex_attribute_const_range::iterator v=lcc.vertex_attributes().begin(), diff --git a/Linear_cell_complex/examples/Linear_cell_complex/linear_cell_complex_3.cpp b/Linear_cell_complex/examples/Linear_cell_complex/linear_cell_complex_3.cpp index 9704f6fed30..929390f6b0a 100644 --- a/Linear_cell_complex/examples/Linear_cell_complex/linear_cell_complex_3.cpp +++ b/Linear_cell_complex/examples/Linear_cell_complex/linear_cell_complex_3.cpp @@ -48,7 +48,7 @@ int main() // Display all the vertices of the lcc by iterating on the // Vertex_attribute container. - CGAL::set_ascii_mode(std::cout); + CGAL::IO::set_ascii_mode(std::cout); std::cout<<"Vertices: "; for (LCC_3::Vertex_attribute_const_range::iterator v=lcc.vertex_attributes().begin(), diff --git a/Linear_cell_complex/include/CGAL/Linear_cell_complex_constructors.h b/Linear_cell_complex/include/CGAL/Linear_cell_complex_constructors.h index 211c76a78ae..9ec501d454b 100644 --- a/Linear_cell_complex/include/CGAL/Linear_cell_complex_constructors.h +++ b/Linear_cell_complex/include/CGAL/Linear_cell_complex_constructors.h @@ -156,7 +156,7 @@ namespace CGAL { } FT x, y; - ais >> iformat(x) >> iformat(y); + ais >> IO::iformat(x) >> IO::iformat(y); vertices.push_back(Point{x, y}); --numVertices; } @@ -305,8 +305,8 @@ namespace CGAL { } File_header_OFF header(false); - header.set_binary(is_binary(out)); - header.set_no_comments(!is_pretty(out)); + header.set_binary(IO::is_binary(out)); + header.set_no_comments(!IO::is_pretty(out)); File_writer_OFF writer( header); writer.header().set_polyhedral_surface(true); writer.header().set_halfedges(alcc.number_of_darts()); diff --git a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h index 49383d6f5eb..5e1a46e52c7 100644 --- a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h +++ b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h @@ -84,7 +84,7 @@ struct DefaultDrawingFunctorLCC /// @return the color of the volume containing dh /// used only if colored_volume(alcc, dh) and !colored_face(alcc, dh) template - CGAL::Color volume_color(const LCC& alcc, + CGAL::IO::Color volume_color(const LCC& alcc, typename LCC::Dart_const_handle dh) const { CGAL::Random random((unsigned int)(alcc.darts().index(dh))); @@ -93,7 +93,7 @@ struct DefaultDrawingFunctorLCC /// @return the color of the face containing dh /// used only if colored_face(alcc, dh) template - CGAL::Color face_color(const LCC& alcc, + CGAL::IO::Color face_color(const LCC& alcc, typename LCC::Dart_const_handle dh) const { CGAL::Random random((unsigned int)(alcc.darts().index(dh))); @@ -102,7 +102,7 @@ struct DefaultDrawingFunctorLCC /// @return the color of the edge containing dh /// used only if colored_edge(alcc, dh) template - CGAL::Color edge_color(const LCC& alcc, + CGAL::IO::Color edge_color(const LCC& alcc, typename LCC::Dart_const_handle dh) const { CGAL::Random random((unsigned int)(alcc.darts().index(dh))); @@ -111,7 +111,7 @@ struct DefaultDrawingFunctorLCC /// @return the color of the vertex containing dh /// used only if colored_vertex(alcc, dh) template - CGAL::Color vertex_color(const LCC& alcc, + CGAL::IO::Color vertex_color(const LCC& alcc, typename LCC::Dart_const_handle dh) const { CGAL::Random random((unsigned int)(alcc.darts().index(dh))); @@ -213,17 +213,17 @@ protected: if (m_random_face_color) { CGAL::Random random((unsigned int)(lcc->darts().index(dh))); - CGAL::Color c=get_random_color(random); + CGAL::IO::Color c=get_random_color(random); face_begin(c); } else if (m_drawing_functor.colored_face(*lcc, dh)) { - CGAL::Color c=m_drawing_functor.face_color(*lcc, dh); + CGAL::IO::Color c=m_drawing_functor.face_color(*lcc, dh); face_begin(c); } else if (m_drawing_functor.colored_volume(*lcc, voldh)) { - CGAL::Color c=m_drawing_functor.volume_color(*lcc, voldh); + CGAL::IO::Color c=m_drawing_functor.volume_color(*lcc, voldh); face_begin(c); } else diff --git a/Mesh_2/demo/Mesh_2/conform.cpp b/Mesh_2/demo/Mesh_2/conform.cpp index a27d4d5549c..894185d02fb 100644 --- a/Mesh_2/demo/Mesh_2/conform.cpp +++ b/Mesh_2/demo/Mesh_2/conform.cpp @@ -86,7 +86,7 @@ int main(int argc, char** argv) if(input) { Tr t; - CGAL::read_triangle_poly_file(t, input); + CGAL::IO::read_triangle_poly_file(t, input); if(delaunay) { if(verbose) @@ -103,12 +103,12 @@ int main(int argc, char** argv) if(argc==arg_count+1) { if(terminal_output) - CGAL::write_triangle_poly_file(t, std::cout); + CGAL::IO::write_triangle_poly_file(t, std::cout); } else { std::ofstream output(argv[arg_count+1]); - CGAL::write_triangle_poly_file(t, output); + CGAL::IO::write_triangle_poly_file(t, output); } if(terminal_output) diff --git a/Mesh_2/demo/Mesh_2/mesh.cpp b/Mesh_2/demo/Mesh_2/mesh.cpp index 504eb065411..303420ca7f4 100644 --- a/Mesh_2/demo/Mesh_2/mesh.cpp +++ b/Mesh_2/demo/Mesh_2/mesh.cpp @@ -93,18 +93,18 @@ int main(int argc, char** argv) std::ifstream input(argv[arg_count]); if(input) { - CGAL::read_triangle_poly_file(t, input); + CGAL::IO::read_triangle_poly_file(t, input); CGAL::refine_Delaunay_mesh_2(t, criteria); if(argc==arg_count+1) { if(terminal_output) - CGAL::write_triangle_poly_file(t, std::cout); + CGAL::IO::write_triangle_poly_file(t, std::cout); } else { std::ofstream output(argv[arg_count+1]); - CGAL::write_triangle_poly_file(t, output); + CGAL::IO::write_triangle_poly_file(t, output); } if(terminal_output) std::cerr diff --git a/Mesh_2/doc/Mesh_2/CGAL/IO/write_vtu.h b/Mesh_2/doc/Mesh_2/CGAL/IO/write_VTU.h similarity index 89% rename from Mesh_2/doc/Mesh_2/CGAL/IO/write_vtu.h rename to Mesh_2/doc/Mesh_2/CGAL/IO/write_VTU.h index 146cb6bb785..c750c1f80a8 100644 --- a/Mesh_2/doc/Mesh_2/CGAL/IO/write_vtu.h +++ b/Mesh_2/doc/Mesh_2/CGAL/IO/write_VTU.h @@ -1,4 +1,5 @@ namespace CGAL{ +namespace IO { //!\ingroup PkgMesh2IO //! \brief writes the faces of a domain and its constrained edges embedded in //! a 2D constrained Delaunay triangulation using the `PolyData` XML format. @@ -9,11 +10,11 @@ namespace CGAL{ //! //! \param os the stream used for writing. //! \param tr the triangulated domain to be written. -//! \param mode decides if the data should be written in binary (`IO::BINARY`) -//! or in ASCII (`IO::ASCII`). +//! \param mode decides if the data should be written in binary (`BINARY`) +//! or in ASCII (`ASCII`). //! template -void write_vtu(std::ostream& os, +void write_VTU(std::ostream& os, const CDT& tr, IO::Mode mode = IO::BINARY); -} +} } diff --git a/Mesh_2/doc/Mesh_2/Mesh_2.txt b/Mesh_2/doc/Mesh_2/Mesh_2.txt index fef716532ff..9e96c31499d 100644 --- a/Mesh_2/doc/Mesh_2/Mesh_2.txt +++ b/Mesh_2/doc/Mesh_2/Mesh_2.txt @@ -328,7 +328,7 @@ in the Reference Manual. \section secMesh_2_IO Input/Output -It is possible to export the result of a meshing in VTU, using the function `write_vtu()`. +It is possible to export the result of a meshing in VTU, using the function `CGAL::IO::write_VTU()`. For more information about this format, see \ref IOStreamVTK. */ } /* namespace CGAL */ diff --git a/Mesh_2/doc/Mesh_2/PackageDescription.txt b/Mesh_2/doc/Mesh_2/PackageDescription.txt index 2c39e083c2a..458e3bf6b05 100644 --- a/Mesh_2/doc/Mesh_2/PackageDescription.txt +++ b/Mesh_2/doc/Mesh_2/PackageDescription.txt @@ -64,7 +64,7 @@ The package can handle intersecting input constraints and set no restriction on - `CGAL::lloyd_optimize_mesh_2` \cgalCRPSection{I/O Functions} -- `CGAL::write_vtu()` +- `CGAL::IO::write_VTU()` \cgalCRPSection{Enumerations} - `CGAL::Mesh_optimization_return_code` diff --git a/Mesh_2/include/CGAL/IO/File_poly.h b/Mesh_2/include/CGAL/IO/File_poly.h index 79b2f7ee359..9f3002c32f0 100644 --- a/Mesh_2/include/CGAL/IO/File_poly.h +++ b/Mesh_2/include/CGAL/IO/File_poly.h @@ -18,13 +18,7 @@ namespace CGAL { -template -inline -void -read_triangle_poly_file(CDT& t, std::istream &f) -{ - read_triangle_poly_file(t, f, Emptyset_iterator()); -} +namespace IO { //the function that reads a Shewchuk Triangle .poly file template @@ -80,6 +74,14 @@ read_triangle_poly_file(CDT& t, std::istream &f, } } +template +inline +void +read_triangle_poly_file(CDT& t, std::istream &f) +{ + read_triangle_poly_file(t, f, Emptyset_iterator()); +} + //the function that write a Shewchuk Triangle .poly file template void @@ -156,6 +158,13 @@ write_triangle_poly_file(const CDT& t, std::ostream &f) write_triangle_poly_file(t, f, l.begin(), l.end()); } +} // namespace IO + +#ifndef CGAL_NO_DEPRECATED_CODE +using IO::read_triangle_poly_file; +using IO::write_triangle_poly_file; +#endif + } // end namespace CGAL #endif // CGAL_FILE_POLY_H diff --git a/Mesh_2/include/CGAL/IO/write_vtu.h b/Mesh_2/include/CGAL/IO/write_VTU.h similarity index 89% rename from Mesh_2/include/CGAL/IO/write_vtu.h rename to Mesh_2/include/CGAL/IO/write_VTU.h index fe7a3f85b5b..de6a0a313bd 100644 --- a/Mesh_2/include/CGAL/IO/write_vtu.h +++ b/Mesh_2/include/CGAL/IO/write_VTU.h @@ -12,8 +12,8 @@ // // Author(s) : Laurent RINEAU, Stephane Tayeb, Maxime Gimeno -#ifndef CGAL_WRITE_VTU_H -#define CGAL_WRITE_VTU_H +#ifndef CGAL_IO_WRITE_VTU_H +#define CGAL_IO_WRITE_VTU_H #include @@ -68,7 +68,7 @@ write_cells_tag_2(std::ostream& os, tr.constrained_edges_end())) * sizeof(std::size_t); } else { - os << "\">\n"; + os << ">\n"; for(typename CDT::Finite_faces_iterator fit = tr.finite_faces_begin(), end = tr.finite_faces_end(); @@ -81,6 +81,17 @@ write_cells_tag_2(std::ostream& os, os << V[fit->vertex(1)] << " "; } } + for(typename CDT::Constrained_edges_iterator + cei = tr.constrained_edges_begin(), + end = tr.constrained_edges_end(); + cei != end; ++cei) + { + for(int i=0; i<3; ++i) + { + if(i != cei->second) + os << V[cei->first->vertex(i)] << " "; + } + } os << " \n"; } @@ -96,7 +107,7 @@ write_cells_tag_2(std::ostream& os, // 1 offset (size_t) per cell + length of the encoded data (size_t) } else { - os << "\">\n"; + os << ">\n"; std::size_t cells_offset = 0; for(typename CDT::Finite_faces_iterator fit = tr.finite_faces_begin() ; @@ -109,6 +120,13 @@ write_cells_tag_2(std::ostream& os, os << cells_offset << " "; } } + for(std::size_t i = 0, end = std::distance(tr.constrained_edges_begin(), + tr.constrained_edges_end()); + i < end; ++i) + { + cells_offset += 2; + os << cells_offset << " "; + } os << " \n"; } @@ -125,7 +143,7 @@ write_cells_tag_2(std::ostream& os, // 1 unsigned char per cell + length of the encoded data (size_t) } else { - os << "\">\n"; + os << ">\n"; for(typename CDT::Finite_faces_iterator fit = tr.finite_faces_begin() ; fit != tr.finite_faces_end() ; @@ -136,6 +154,12 @@ write_cells_tag_2(std::ostream& os, os << "5 "; } } + for(std::size_t i = 0, end = std::distance(tr.constrained_edges_begin(), + tr.constrained_edges_end()); + i < end; ++i) + { + os << "3 "; + } os << " \n"; } os << " \n"; @@ -301,10 +325,10 @@ write_attributes_2(std::ostream& os, } template -void write_vtu_with_attributes(std::ostream& os, +void write_VTU_with_attributes(std::ostream& os, const CDT& tr, std::vector*> >& attributes, - IO::Mode mode = IO::BINARY) + Mode mode = BINARY) { typedef typename CDT::Vertex_handle Vertex_handle; std::map V; @@ -336,7 +360,7 @@ void write_vtu_with_attributes(std::ostream& os, os << " \n"; std::size_t offset = 0; - const bool binary = (mode == IO::BINARY); + const bool binary = (mode == BINARY); write_cdt_points_tag(os,tr,V,binary,offset); write_cells_tag_2(os,tr,number_of_triangles, V,binary,offset); if(attributes.empty()) @@ -361,16 +385,27 @@ void write_vtu_with_attributes(std::ostream& os, } } // namespace internal -} // namespace CGAL +template +void write_VTU(std::ostream& os, + const CDT& tr, + Mode mode = BINARY) +{ + std::vector*> > dummy_atts; + internal::write_VTU_with_attributes(os, tr, dummy_atts, mode); +} + +} // namespace IO + +#ifndef CGAL_NO_DEPRECATED_CODE template void write_vtu(std::ostream& os, const CDT& tr, IO::Mode mode = IO::BINARY) { - std::vector*> > dummy_atts; - IO::internal::write_vtu_with_attributes(os, tr, dummy_atts, mode); + IO::write_VTU(os, tr, mode); } +#endif } //end CGAL -#endif // CGAL_WRITE_VTU_H +#endif // CGAL_IO_WRITE_VTU_H diff --git a/Mesh_2/test/Mesh_2/test_conforming.cpp b/Mesh_2/test/Mesh_2/test_conforming.cpp index ece577c247f..bfd56abd7f0 100644 --- a/Mesh_2/test/Mesh_2/test_conforming.cpp +++ b/Mesh_2/test/Mesh_2/test_conforming.cpp @@ -38,7 +38,7 @@ struct Tester { std::cout << "Reading fish.poly...\n"; std::ifstream poly_file("fish.poly"); - CGAL::read_triangle_poly_file(cdt, poly_file); + CGAL::IO::read_triangle_poly_file(cdt, poly_file); const size_type number_of_vertices_poly = cdt.number_of_vertices(); const size_type number_of_constrained_edges_poly = diff --git a/Mesh_2/test/Mesh_2/test_lloyd.cpp b/Mesh_2/test/Mesh_2/test_lloyd.cpp index 8543f1978b9..a07c417cc06 100644 --- a/Mesh_2/test/Mesh_2/test_lloyd.cpp +++ b/Mesh_2/test/Mesh_2/test_lloyd.cpp @@ -39,7 +39,7 @@ struct Lloyd_tester std::cerr << "Reading fish-and-rectangle.poly..."; std::ifstream poly_file("fish-and-rectangle.poly"); - CGAL::read_triangle_poly_file(cdt, poly_file, std::back_inserter(seeds)); + CGAL::IO::read_triangle_poly_file(cdt, poly_file, std::back_inserter(seeds)); CGAL_assertion( cdt.is_valid() ); std::cerr << " done.\nNumber of vertices: " << cdt.number_of_vertices() diff --git a/Mesh_2/test/Mesh_2/test_meshing.cpp b/Mesh_2/test/Mesh_2/test_meshing.cpp index fc7b34e9a00..76c1eb8fa46 100644 --- a/Mesh_2/test/Mesh_2/test_meshing.cpp +++ b/Mesh_2/test/Mesh_2/test_meshing.cpp @@ -59,7 +59,7 @@ struct Tester2 { std::cerr << "Reading fish-and-rectangle.poly..."; std::ifstream poly_file("fish-and-rectangle.poly"); - CGAL::read_triangle_poly_file(cdt, poly_file, std::back_inserter(seeds)); + CGAL::IO::read_triangle_poly_file(cdt, poly_file, std::back_inserter(seeds)); assert(cdt.is_valid()); const size_type inititial_number_of_vertices = cdt.number_of_vertices(); std::cerr << " done.\nNumber of vertices: " << cdt.number_of_vertices() diff --git a/Mesh_3/archive/applications/Distribution_displayer.h b/Mesh_3/archive/applications/Distribution_displayer.h index 7b790b5aa7c..492de63cc2d 100644 --- a/Mesh_3/archive/applications/Distribution_displayer.h +++ b/Mesh_3/archive/applications/Distribution_displayer.h @@ -6,11 +6,11 @@ struct Distribution_displayer { virtual void fill_rectangle(double x1, double y1, double x2, double y2, - CGAL::Color c) = 0; + CGAL::IO::Color c) = 0; virtual void segment(double x1, double y1, double x2, double y2, - CGAL::Color c) = 0; + CGAL::IO::Color c) = 0; virtual ~Distribution_displayer() {}; }; diff --git a/Mesh_3/archive/applications/Gd_displayer.cpp b/Mesh_3/archive/applications/Gd_displayer.cpp index 529ef5efa7d..8b395cd438e 100644 --- a/Mesh_3/archive/applications/Gd_displayer.cpp +++ b/Mesh_3/archive/applications/Gd_displayer.cpp @@ -20,7 +20,7 @@ Gd_displayer::~Gd_displayer() void Gd_displayer::fill_rectangle(double x1, double y1, double x2, double y2, - CGAL::Color c) + CGAL::IO::Color c) { gdImageFilledRectangle(im, x_pixel(x1), y_pixel(y2), @@ -30,7 +30,7 @@ void Gd_displayer::fill_rectangle(double x1, double y1, void Gd_displayer::segment(double x1, double y1, double x2, double y2, - CGAL::Color c) + CGAL::IO::Color c) { gdImageLine(im, x_pixel(x1), y_pixel(y1), diff --git a/Mesh_3/archive/applications/Gd_displayer.h b/Mesh_3/archive/applications/Gd_displayer.h index bad8700844e..9df1f7c047a 100644 --- a/Mesh_3/archive/applications/Gd_displayer.h +++ b/Mesh_3/archive/applications/Gd_displayer.h @@ -21,11 +21,11 @@ struct Gd_displayer : public Distribution_displayer //@{ void fill_rectangle(double x1, double y1, double x2, double y2, - CGAL::Color c); + CGAL::IO::Color c); void segment(double x1, double y1, double x2, double y2, - CGAL::Color c); + CGAL::IO::Color c); //@} /** \name FUNCTIONS SPECIFIC TO Gd_displayer */ @@ -73,7 +73,7 @@ struct Gd_displayer : public Distribution_displayer /** Returns the index of the color c in the image palette. */ inline - int gd_color(CGAL::Color c) + int gd_color(CGAL::IO::Color c) { int i = gdImageColorExact(im, c.red(), diff --git a/Mesh_3/archive/applications/Qt_widget_displayer.cpp b/Mesh_3/archive/applications/Qt_widget_displayer.cpp index 1526edfe798..2662f5f78df 100644 --- a/Mesh_3/archive/applications/Qt_widget_displayer.cpp +++ b/Mesh_3/archive/applications/Qt_widget_displayer.cpp @@ -14,7 +14,7 @@ Qt_widget_displayer::Qt_widget_displayer(CGAL::Qt_widget* w) : widget(w) {} void Qt_widget_displayer::fill_rectangle(double x1, double y1, double x2, double y2, - CGAL::Color color) + CGAL::IO::Color color) { *widget << CGAL::FillColor(color) << color @@ -23,7 +23,7 @@ void Qt_widget_displayer::fill_rectangle(double x1, double y1, void Qt_widget_displayer::segment(double x1, double y1, double x2, double y2, - CGAL::Color color) + CGAL::IO::Color color) { *widget << color << Segment_2(Point_2(x1, y1), Point_2(x2, y2)); diff --git a/Mesh_3/archive/applications/Qt_widget_displayer.h b/Mesh_3/archive/applications/Qt_widget_displayer.h index 3f5224c8887..02d08f0e980 100644 --- a/Mesh_3/archive/applications/Qt_widget_displayer.h +++ b/Mesh_3/archive/applications/Qt_widget_displayer.h @@ -10,11 +10,11 @@ struct Qt_widget_displayer : public Distribution_displayer void fill_rectangle(double x1, double y1, double x2, double y2, - CGAL::Color c); + CGAL::IO::Color c); void segment(double x1, double y1, double x2, double y2, - CGAL::Color c); + CGAL::IO::Color c); private: CGAL::Qt_widget* widget; }; diff --git a/Mesh_3/archive/applications/cgal_to_medit.cpp b/Mesh_3/archive/applications/cgal_to_medit.cpp index 932c2c89850..e69f729004e 100644 --- a/Mesh_3/archive/applications/cgal_to_medit.cpp +++ b/Mesh_3/archive/applications/cgal_to_medit.cpp @@ -39,7 +39,7 @@ int main(int , char** argv) // &std::cout) ) // debug to cout { std::cout << " Writing " << argv[2] << std::endl; - CGAL::output_to_medit(ofs, c2t3); + CGAL::IO::output_to_medit(ofs, c2t3); return EXIT_SUCCESS; } else diff --git a/Mesh_3/archive/applications/display_distribution.cpp b/Mesh_3/archive/applications/display_distribution.cpp index c989ce8952c..28188b9c9d7 100644 --- a/Mesh_3/archive/applications/display_distribution.cpp +++ b/Mesh_3/archive/applications/display_distribution.cpp @@ -165,8 +165,8 @@ void output_distribution_to_png(std::vector& elements, widget->show(); widget->lock(); - *widget << CGAL::FillColor(CGAL::Color(200, 200, 200)) - << CGAL::Color(200, 200, 200) + *widget << CGAL::FillColor(CGAL::IO::Color(200, 200, 200)) + << CGAL::IO::Color(200, 200, 200) << Rectangle_2(Point_2(0, 0), Point_2(1,1)); if( number_of_classes == 0 ) return; @@ -189,7 +189,7 @@ void output_distribution_to_png(std::vector& elements, Point_2((k+1)*width, height)); } else - *widget << CGAL::red() << Segment_2(Point_2(k*width, 0), + *widget << CGAL::IO::red() << Segment_2(Point_2(k*width, 0), Point_2((k+1)*width, 0)); widget->unlock(); diff --git a/Mesh_3/archive/applications/distribution.cpp b/Mesh_3/archive/applications/distribution.cpp index d45a3fbce70..97e1b6c33c5 100644 --- a/Mesh_3/archive/applications/distribution.cpp +++ b/Mesh_3/archive/applications/distribution.cpp @@ -27,7 +27,7 @@ void display_distribution(Distribution_displayer* display, if( number_of_classes == 0 ) return; const double width = 1.0 / number_of_classes; - display->fill_rectangle(0., 0., 1., 1., CGAL::Color(200, 200, 200)); + display->fill_rectangle(0., 0., 1., 1., CGAL::IO::Color(200, 200, 200)); for(int k = 0; k < number_of_classes; ++k) if(distribution[k]>0) { @@ -39,5 +39,5 @@ void display_distribution(Distribution_displayer* display, else display->segment(k * width, 0., (k+1) * width, 0., - CGAL::red()); + CGAL::IO::red()); } diff --git a/Mesh_3/archive/applications/lanteri_process_results.cpp b/Mesh_3/archive/applications/lanteri_process_results.cpp index 44302fdec30..d433adc1ebb 100644 --- a/Mesh_3/archive/applications/lanteri_process_results.cpp +++ b/Mesh_3/archive/applications/lanteri_process_results.cpp @@ -99,7 +99,7 @@ bool process_aux_2(const std::vector& qualities, displays[i]->segment(x_position_of_length_bound, 0.0, x_position_of_length_bound, -0.05, - CGAL::blue()); + CGAL::IO::blue()); } *out_stream << "saving " << filename.c_str() << "...\n"; diff --git a/Mesh_3/archive/applications/mesh_implicit_domains.cpp b/Mesh_3/archive/applications/mesh_implicit_domains.cpp index 1f85de4129f..2a5a623dadd 100644 --- a/Mesh_3/archive/applications/mesh_implicit_domains.cpp +++ b/Mesh_3/archive/applications/mesh_implicit_domains.cpp @@ -240,7 +240,7 @@ int main(int argc, char* argv[]) // Output std::ofstream medit_file("out.mesh"); - CGAL::output_to_medit(medit_file, c3t3, !vm.count("no_label_rebind"), vm.count("show_patches")); + CGAL::IO::output_to_medit(medit_file, c3t3, !vm.count("no_label_rebind"), vm.count("show_patches")); return 0; } diff --git a/Mesh_3/archive/applications/mesher_tester.h b/Mesh_3/archive/applications/mesher_tester.h index c27cd811dbd..cc8107179fe 100644 --- a/Mesh_3/archive/applications/mesher_tester.h +++ b/Mesh_3/archive/applications/mesher_tester.h @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include "thread_queue.h" @@ -51,7 +51,7 @@ template struct Optimizer; template struct Mesher { - Mesher(const boost::shared_ptr >& pdomain_builder, + Mesher(const std::shared_ptr >& pdomain_builder, const int mesh_nb, const std::string& filename, const std::string& output, @@ -95,7 +95,7 @@ struct Mesher timer.start(); // we keep c3t3 between lines - boost::shared_ptr pc3t3_save (new C3T3()); + std::shared_ptr pc3t3_save (new C3T3()); // Generate Mesh file_out << "Generate mesh..."; @@ -183,7 +183,7 @@ private: } private: - boost::shared_ptr > pdomain_builder_; + std::shared_ptr > pdomain_builder_; int mesh_nb_; std::string filename_; std::string output_prefix_; @@ -196,8 +196,8 @@ private: template struct Optimizer { - Optimizer(const boost::shared_ptr& pc3t3, - const boost::shared_ptr >& pdomain_builder, + Optimizer(const std::shared_ptr& pc3t3, + const std::shared_ptr >& pdomain_builder, const int mesh_nb, const std::string& output, const std::string& command_line) @@ -339,8 +339,8 @@ private: private: - boost::shared_ptr pc3t3_; - boost::shared_ptr > pdomain_builder_; + std::shared_ptr pc3t3_; + std::shared_ptr > pdomain_builder_; std::string mesh_nb_; std::string output_prefix_; std::string command_line_; @@ -571,7 +571,7 @@ void mesh(const std::string& data, const std::string& output_dir, const int nb_t //Load the domain std::stringstream cout_loc; cout_loc << "+ [" << filename << "] Create domain..."; - boost::shared_ptr > pdomain_builder(new Domain_builder(it->path().string())); + std::shared_ptr > pdomain_builder(new Domain_builder(it->path().string())); cout_loc << "done (" << timer.time() << "s)\n"; std::cout << cout_loc.str(); diff --git a/Mesh_3/archive/applications/output_distribution_to_stdout.cpp b/Mesh_3/archive/applications/output_distribution_to_stdout.cpp index 1742f1191a9..2b18f4488f2 100644 --- a/Mesh_3/archive/applications/output_distribution_to_stdout.cpp +++ b/Mesh_3/archive/applications/output_distribution_to_stdout.cpp @@ -171,8 +171,8 @@ void parse_argv(int argc, char** argv, int extra_args = 0) // widget->show(); // // // widget->lock(); -//// *widget << CGAL::FillColor(CGAL::Color(200, 200, 200)) -//// << CGAL::Color(200, 200, 200) +//// *widget << CGAL::FillColor(CGAL::IO::Color(200, 200, 200)) +//// << CGAL::IO::Color(200, 200, 200) //// << Rectangle_2(Point_2(0, 0), Point_2(1,1)); //// // if( number_of_classes == 0 ) return; @@ -195,7 +195,7 @@ void parse_argv(int argc, char** argv, int extra_args = 0) //// Point_2((k+1)*width, height)); // } // else -//// *widget << CGAL::red() << Segment_2(Point_2(k*width, 0), +//// *widget << CGAL::IO::red() << Segment_2(Point_2(k*width, 0), //// Point_2((k+1)*width, 0)); // // // widget->unlock(); diff --git a/Mesh_3/archive/applications/slivers_exuder.cpp b/Mesh_3/archive/applications/slivers_exuder.cpp index 1d02cef1932..a3d13d27e0c 100644 --- a/Mesh_3/archive/applications/slivers_exuder.cpp +++ b/Mesh_3/archive/applications/slivers_exuder.cpp @@ -69,7 +69,7 @@ int main(int argc, char** argv) timer.stop(); std::cout << " Pumping done. CPU time: " << timer.time() << std::endl; - CGAL::set_binary_mode(ofs); + CGAL::IO::set_binary_mode(ofs); std::cout << " Writing " << argv[2] << std::endl; CGAL::Mesh_3::output_mesh(ofs, c2t3); ofs.close(); diff --git a/Mesh_3/archive/examples/Mesh_3/mesh_polyhedral_edge_tolerance_region.cpp b/Mesh_3/archive/examples/Mesh_3/mesh_polyhedral_edge_tolerance_region.cpp index 36ccb42983a..771051e4ba3 100644 --- a/Mesh_3/archive/examples/Mesh_3/mesh_polyhedral_edge_tolerance_region.cpp +++ b/Mesh_3/archive/examples/Mesh_3/mesh_polyhedral_edge_tolerance_region.cpp @@ -60,7 +60,7 @@ int main(int argc, char*argv[]) // Output std::ofstream medit_file("out.mesh"); - CGAL::output_to_medit(medit_file, c3t3); + CGAL::IO::output_to_medit(medit_file, c3t3); return 0; } diff --git a/Mesh_3/archive/examples/Mesh_3/mesh_polyhedral_implicit_function.cpp b/Mesh_3/archive/examples/Mesh_3/mesh_polyhedral_implicit_function.cpp index 6f4fc2a96e0..0b9fdcefb01 100644 --- a/Mesh_3/archive/examples/Mesh_3/mesh_polyhedral_implicit_function.cpp +++ b/Mesh_3/archive/examples/Mesh_3/mesh_polyhedral_implicit_function.cpp @@ -59,7 +59,7 @@ int main(int argc, char*argv[]) // Output std::ofstream medit_file("out.mesh"); - CGAL::output_to_medit(medit_file, c3t3); + CGAL::IO::output_to_medit(medit_file, c3t3); return 0; } diff --git a/Mesh_3/archive/examples/Mesh_3/mesh_polyhedral_surface_tolerance_region.cpp b/Mesh_3/archive/examples/Mesh_3/mesh_polyhedral_surface_tolerance_region.cpp index 8f6ff483511..c13fd3615ec 100644 --- a/Mesh_3/archive/examples/Mesh_3/mesh_polyhedral_surface_tolerance_region.cpp +++ b/Mesh_3/archive/examples/Mesh_3/mesh_polyhedral_surface_tolerance_region.cpp @@ -58,7 +58,7 @@ int main(int argc, char*argv[]) // Output std::ofstream medit_file("out.mesh"); - CGAL::output_to_medit(medit_file, c3t3); + CGAL::IO::output_to_medit(medit_file, c3t3); return 0; } diff --git a/Mesh_3/benchmark/Mesh_3/StdAfx.h b/Mesh_3/benchmark/Mesh_3/StdAfx.h index ac0f9e1b5b2..7f3c5f93ca7 100644 --- a/Mesh_3/benchmark/Mesh_3/StdAfx.h +++ b/Mesh_3/benchmark/Mesh_3/StdAfx.h @@ -131,7 +131,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/Mesh_3/doc/Mesh_3/CGAL/IO/File_avizo.h b/Mesh_3/doc/Mesh_3/CGAL/IO/File_avizo.h index 94c1c3684a6..f4f679a9eb5 100644 --- a/Mesh_3/doc/Mesh_3/CGAL/IO/File_avizo.h +++ b/Mesh_3/doc/Mesh_3/CGAL/IO/File_avizo.h @@ -1,4 +1,5 @@ namespace CGAL{ +namespace IO { /** * \ingroup PkgMesh3IOFunctions * @brief outputs mesh to avizo format @@ -10,4 +11,4 @@ template void output_to_avizo(std::ostream& os, const C3T3& c3t3); -} +}} diff --git a/Mesh_3/doc/Mesh_3/CGAL/IO/File_medit.h b/Mesh_3/doc/Mesh_3/CGAL/IO/File_medit.h index 62bb1476d86..bdbb7e0d01e 100644 --- a/Mesh_3/doc/Mesh_3/CGAL/IO/File_medit.h +++ b/Mesh_3/doc/Mesh_3/CGAL/IO/File_medit.h @@ -1,5 +1,5 @@ namespace CGAL { - +namespace IO { /// \ingroup PkgMesh3IOFunctions /// /// \brief outputs a mesh complex to the medit (`.mesh`) file format. @@ -18,4 +18,4 @@ void output_to_medit(std::ostream& os, bool rebind = false, bool show_patches = false); -} // end namespace CGAL +}} // end namespace CGAL::IO diff --git a/Mesh_3/doc/Mesh_3/CGAL/IO/File_tetgen.h b/Mesh_3/doc/Mesh_3/CGAL/IO/File_tetgen.h index b142b41f0c7..8294618586b 100644 --- a/Mesh_3/doc/Mesh_3/CGAL/IO/File_tetgen.h +++ b/Mesh_3/doc/Mesh_3/CGAL/IO/File_tetgen.h @@ -1,4 +1,5 @@ namespace CGAL{ +namespace IO { /** * \ingroup PkgMesh3IOFunctions * @brief outputs a mesh complex to tetgen format @@ -16,4 +17,4 @@ output_to_tetgen(std::string filename, const C3T3& c3t3, bool rebind = false, bool show_patches = false); -} +} } diff --git a/Mesh_3/doc/Mesh_3/CGAL/IO/output_to_vtu.h b/Mesh_3/doc/Mesh_3/CGAL/IO/output_to_vtu.h index 70a64f586c7..e1d9d87e4a9 100644 --- a/Mesh_3/doc/Mesh_3/CGAL/IO/output_to_vtu.h +++ b/Mesh_3/doc/Mesh_3/CGAL/IO/output_to_vtu.h @@ -1,4 +1,5 @@ namespace CGAL{ +namespace IO { //! \ingroup PkgMesh3IOFunctions //! //! \brief writes a tetrahedron mesh using the `UnstructuredGrid` XML format. @@ -13,5 +14,5 @@ namespace CGAL{ template void output_to_vtu(std::ostream& os, const C3T3& c3t3, - IO::Mode mode = IO::BINARY); -} + IO::Mode mode = BINARY); +} } diff --git a/Mesh_3/doc/Mesh_3/Mesh_3.txt b/Mesh_3/doc/Mesh_3/Mesh_3.txt index 364ef99de87..97d84bfb778 100644 --- a/Mesh_3/doc/Mesh_3/Mesh_3.txt +++ b/Mesh_3/doc/Mesh_3/Mesh_3.txt @@ -549,10 +549,10 @@ for more details. \section Mesh_3_section_io Input/Output Several file formats are supported for writing a mesh: - - \ref IOStreamVTK, using `CGAL::output_to_vtu()` - - \ref IOStreamAvizo, using `CGAL::output_to_avizo()` - - \ref IOStreamMedit, using `CGAL::output_to_medit()` - - \ref IOStreamTetgen, using `CGAL::output_to_tetgen()` + - \ref IOStreamVTK, using `CGAL::IO::output_to_vtu()` + - \ref IOStreamAvizo, using `CGAL::IO::output_to_avizo()` + - \ref IOStreamMedit, using `CGAL::IO::output_to_medit()` + - \ref IOStreamTetgen, using `CGAL::IO::output_to_tetgen()` \section Mesh_3_section_examples Examples diff --git a/Mesh_3/doc/Mesh_3/PackageDescription.txt b/Mesh_3/doc/Mesh_3/PackageDescription.txt index 9d9edbfd5ac..f7a09d8f473 100644 --- a/Mesh_3/doc/Mesh_3/PackageDescription.txt +++ b/Mesh_3/doc/Mesh_3/PackageDescription.txt @@ -138,7 +138,7 @@ and their associated classes: - `CGAL::Mesh_facet_topology` \cgalCRPSection{Input/Output Functions} -- `CGAL::output_to_medit()` -- `CGAL::output_to_vtu()` +- `CGAL::IO::output_to_medit()` +- `CGAL::IO::output_to_vtu()` */ diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_gray_vtk_image.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_gray_vtk_image.cpp index 0c7812d8f25..8bf9f62710a 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_gray_vtk_image.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_gray_vtk_image.cpp @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include @@ -73,7 +73,7 @@ int main(int argc, char* argv[]) vtkImageData* vtk_image = smoother->GetOutput(); vtk_image->Print(std::cerr); - CGAL::Image_3 image = CGAL::read_vtk_image_data(vtk_image); + CGAL::Image_3 image = CGAL::IO::read_vtk_image_data(vtk_image); if(image.image() == nullptr){ std::cerr << "could not create a CGAL::Image_3 from the vtk image\n"; return 0; diff --git a/Mesh_3/examples/Mesh_3/mesh_cubes_intersection.cpp b/Mesh_3/examples/Mesh_3/mesh_cubes_intersection.cpp index b25b4f127b7..12216cc2cbd 100644 --- a/Mesh_3/examples/Mesh_3/mesh_cubes_intersection.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_cubes_intersection.cpp @@ -91,7 +91,7 @@ int main() // Output std::ofstream medit_file("out_cubes_intersection.mesh"); - CGAL::output_to_medit(medit_file, c3t3); + CGAL::IO::output_to_medit(medit_file, c3t3); return 0; } diff --git a/Mesh_3/examples/Mesh_3/mesh_cubes_intersection_with_features.cpp b/Mesh_3/examples/Mesh_3/mesh_cubes_intersection_with_features.cpp index 6b67c567c5d..61d2d78d993 100644 --- a/Mesh_3/examples/Mesh_3/mesh_cubes_intersection_with_features.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_cubes_intersection_with_features.cpp @@ -178,7 +178,7 @@ int main() // Output std::ofstream medit_file("out_cubes_intersection_with_features.mesh"); - CGAL::output_to_medit(medit_file, c3t3); + CGAL::IO::output_to_medit(medit_file, c3t3); return 0; } diff --git a/Mesh_3/examples/Mesh_3/mesh_implicit_domains.cpp b/Mesh_3/examples/Mesh_3/mesh_implicit_domains.cpp index efb5ea0f743..d8790c25fd3 100644 --- a/Mesh_3/examples/Mesh_3/mesh_implicit_domains.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_implicit_domains.cpp @@ -67,7 +67,7 @@ int main() // Output std::ofstream medit_file("out.mesh"); - CGAL::output_to_medit(medit_file, c3t3); + CGAL::IO::output_to_medit(medit_file, c3t3); return 0; } diff --git a/Mesh_3/examples/Mesh_3/mesh_implicit_domains_2.cpp b/Mesh_3/examples/Mesh_3/mesh_implicit_domains_2.cpp index 4401a1ab468..6d50993bbdd 100644 --- a/Mesh_3/examples/Mesh_3/mesh_implicit_domains_2.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_implicit_domains_2.cpp @@ -69,7 +69,7 @@ int main() // Output std::ofstream medit_file("out.mesh"); - CGAL::output_to_medit(medit_file, c3t3); + CGAL::IO::output_to_medit(medit_file, c3t3); return 0; } diff --git a/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_features.cpp b/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_features.cpp index 1f79004ce4b..ce185877344 100644 --- a/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_features.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_features.cpp @@ -64,7 +64,7 @@ int main(int argc, char*argv[]) // Output std::ofstream file("out.vtu"); - CGAL::output_to_vtu(file, c3t3); + CGAL::IO::output_to_vtu(file, c3t3); // Could be replaced by: // c3t3.output_to_medit(file); diff --git a/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_features_sm.cpp b/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_features_sm.cpp index ab357f2ca0c..33b95fafea6 100644 --- a/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_features_sm.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain_with_features_sm.cpp @@ -65,7 +65,7 @@ int main(int argc, char*argv[]) // Output std::ofstream file("out-sm.vtu"); - CGAL::output_to_vtu(file, c3t3, CGAL::IO::ASCII); + CGAL::IO::output_to_vtu(file, c3t3, CGAL::IO::ASCII); // Could be replaced by: // c3t3.output_to_medit(file); diff --git a/Mesh_3/include/CGAL/Compact_mesh_cell_base_3.h b/Mesh_3/include/CGAL/Compact_mesh_cell_base_3.h index 13fd9f70083..765c2a373c9 100644 --- a/Mesh_3/include/CGAL/Compact_mesh_cell_base_3.h +++ b/Mesh_3/include/CGAL/Compact_mesh_cell_base_3.h @@ -669,7 +669,7 @@ public: friend std::istream& operator>>(std::istream &is, Compact_mesh_cell_3 &c) { Subdomain_index index; - if(is_ascii(is)) + if(IO::is_ascii(is)) is >> index; else read(is, index); @@ -678,8 +678,8 @@ public: for(int i = 0; i < 4; ++i) { Surface_patch_index i2; - if(is_ascii(is)) - is >> iformat(i2); + if(IO::is_ascii(is)) + is >> IO::iformat(i2); else { read(is, i2); @@ -693,14 +693,14 @@ public: friend std::ostream& operator<<(std::ostream &os, const Compact_mesh_cell_3 &c) { - if(is_ascii(os)) + if(IO::is_ascii(os)) os << c.subdomain_index(); else write(os, c.subdomain_index()); for(int i = 0; i < 4; ++i) { - if(is_ascii(os)) - os << ' ' << oformat(c.surface_patch_index(i)); + if(IO::is_ascii(os)) + os << ' ' << IO::oformat(c.surface_patch_index(i)); else write(os, c.surface_patch_index(i)); } diff --git a/Mesh_3/include/CGAL/IO/Complex_3_in_triangulation_3_to_vtk.h b/Mesh_3/include/CGAL/IO/Complex_3_in_triangulation_3_to_vtk.h index 2d101a4ea92..1586f5ac4f7 100644 --- a/Mesh_3/include/CGAL/IO/Complex_3_in_triangulation_3_to_vtk.h +++ b/Mesh_3/include/CGAL/IO/Complex_3_in_triangulation_3_to_vtk.h @@ -26,6 +26,8 @@ namespace CGAL { +namespace IO { + //if export_complex is false, there must be no far point. template vtkUnstructuredGrid* @@ -121,6 +123,12 @@ output_c3t3_to_vtk_unstructured_grid(const C3T3& c3t3, return grid; } +} // namespace IO + +#ifndef CGAL_NO_DEPRECATED_CODE +using IO::output_c3t3_to_vtk_unstructured_grid; +#endif + } // end namespace CGAL #endif // CGAL_COMPLEX_3_IN_TRIANGULATION_3_TO_VTK diff --git a/Mesh_3/include/CGAL/IO/File_avizo.h b/Mesh_3/include/CGAL/IO/File_avizo.h index 704200b069b..f2b31d68d6c 100644 --- a/Mesh_3/include/CGAL/IO/File_avizo.h +++ b/Mesh_3/include/CGAL/IO/File_avizo.h @@ -24,9 +24,14 @@ namespace CGAL { -namespace Mesh_3 { - +namespace IO { +/** + * @brief outputs mesh to avizo format + * @param os the stream + * @param c3t3 the mesh + * \see \ref IOStreamAvizo + */ template void output_to_avizo(std::ostream& os, @@ -137,24 +142,11 @@ output_to_avizo(std::ostream& os, } // end output_to_avizo(...) -} // end namespace Mesh_3 +} // end namespace IO - - - -/** - * @brief outputs mesh to avizo format - * @param os the stream - * @param c3t3 the mesh - * \see \ref IOStreamAvizo - */ -template -void -output_to_avizo(std::ostream& os, - const C3T3& c3t3) -{ - Mesh_3::output_to_avizo(os,c3t3); -} +#ifndef CGAL_NO_DEPRECATED_CODE +using IO::output_to_avizo; +#endif } // end namespace CGAL diff --git a/Mesh_3/include/CGAL/IO/File_binary_mesh_3.h b/Mesh_3/include/CGAL/IO/File_binary_mesh_3.h index 52ac49d057b..a2a87ee45ca 100644 --- a/Mesh_3/include/CGAL/IO/File_binary_mesh_3.h +++ b/Mesh_3/include/CGAL/IO/File_binary_mesh_3.h @@ -23,7 +23,7 @@ namespace CGAL { -namespace Mesh_3 { +namespace IO { template bool @@ -35,9 +35,9 @@ save_binary_file(std::ostream& os, if(binary) os << "binary "; os << "CGAL c3t3 " << CGAL::Get_io_signature()() << "\n"; if(binary) { - CGAL::set_binary_mode(os); + CGAL::IO::set_binary_mode(os); } else { - CGAL::set_ascii_mode(os); + CGAL::IO::set_ascii_mode(os); os.precision(std::numeric_limits::digits10+2); } return !!(os << c3t3); @@ -71,13 +71,21 @@ bool load_binary_file(std::istream& is, C3T3& c3t3) return false; } } - if(binary) CGAL::set_binary_mode(is); + if(binary) CGAL::IO::set_binary_mode(is); is >> c3t3; return !!is; // call operator!() twice, because operator bool() is C++11 } -} // end namespace Mesh_3 +} // end namespace IO + +#ifndef CGAL_NO_DEPRECATED_CODE +namespace Mesh_3 { +using IO::save_binary_file; +using IO::load_binary_file; +} +#endif + } // end namespace CGAL #endif // CGAL_IO_FILE_BINARY_MESH_3_H diff --git a/Mesh_3/include/CGAL/IO/File_maya.h b/Mesh_3/include/CGAL/IO/File_maya.h index c482186b386..4546132bb95 100644 --- a/Mesh_3/include/CGAL/IO/File_maya.h +++ b/Mesh_3/include/CGAL/IO/File_maya.h @@ -25,6 +25,7 @@ #include namespace CGAL { +namespace IO { template void output_to_maya(std::ostream& os, @@ -310,6 +311,12 @@ output_to_maya(std::ostream& os, #endif } // end output_to_maya(...) +} // namespace IO + +#ifndef CGAL_NO_DEPRECATED_CODE +using IO::output_to_maya; +#endif + } // end namespace CGAL #endif // CGAL_IO_FILE_MAYA_H diff --git a/Mesh_3/include/CGAL/IO/File_medit.h b/Mesh_3/include/CGAL/IO/File_medit.h index bac7e7b2560..95585dc1b82 100644 --- a/Mesh_3/include/CGAL/IO/File_medit.h +++ b/Mesh_3/include/CGAL/IO/File_medit.h @@ -862,6 +862,8 @@ output_to_medit(std::ostream& os, } // end namespace Mesh_3 +namespace IO { + /** * @brief outputs mesh to medit format * @param os the stream @@ -912,6 +914,12 @@ bool read_MEDIT(std::istream& in, T3& t3) return CGAL::build_triangulation_from_file(in, t3); } +} // namespace IO + +#ifndef CGAL_NO_DEPRECATED_CODE +using IO::output_to_medit; +#endif + } // end namespace CGAL #endif // CGAL_IO_FILE_MEDIT_H diff --git a/Mesh_3/include/CGAL/IO/File_tetgen.h b/Mesh_3/include/CGAL/IO/File_tetgen.h index 0eca7bdb760..03fad2e7998 100644 --- a/Mesh_3/include/CGAL/IO/File_tetgen.h +++ b/Mesh_3/include/CGAL/IO/File_tetgen.h @@ -187,8 +187,7 @@ output_to_tetgen(std::string filename, } // end namespace Mesh_3 - - +namespace IO { template void @@ -213,6 +212,12 @@ output_to_tetgen(std::string filename, } } +} // namespace IO + +#ifndef CGAL_NO_DEPRECATED_CODE +using IO::output_to_tetgen; +#endif + } // end namespace CGAL #endif // CGAL_IO_FILE_TETGEN_H diff --git a/Mesh_3/include/CGAL/IO/facets_in_complex_3_to_triangle_mesh.h b/Mesh_3/include/CGAL/IO/facets_in_complex_3_to_triangle_mesh.h index d69f445716f..95b6d7eeddf 100644 --- a/Mesh_3/include/CGAL/IO/facets_in_complex_3_to_triangle_mesh.h +++ b/Mesh_3/include/CGAL/IO/facets_in_complex_3_to_triangle_mesh.h @@ -11,175 +11,17 @@ // Author(s) : Maxime Gimeno, // Mael Rouxel-Labbé -#ifndef CGAL_FACETS_IN_COMPLEX_3_TO_TRIANGLE_MESH_H -#define CGAL_FACETS_IN_COMPLEX_3_TO_TRIANGLE_MESH_H +#ifndef CGAL_IO_FACETS_IN_COMPLEX_3_TO_TRIANGLE_MESH_H +#define CGAL_IO_FACETS_IN_COMPLEX_3_TO_TRIANGLE_MESH_H #include -#include -#include -#include -#include -#include +#ifndef CGAL_NO_DEPRECATED_CODE +#include -#include -#include +#define CGAL_DEPRECATED_HEADER "" +#define CGAL_REPLACEMENT_HEADER "" +#include +#endif -#include -#include -#include -#include - -namespace CGAL { - -namespace Mesh_3 { - -namespace internal { - -template -void resize(Polygon& p, std::size_t size) -{ - p.resize(size); -} - -template -void resize(std::array&, std::size_t CGAL_assertion_code(size)) -{ - CGAL_assertion(size == N); -} - -template -void facets_in_complex_3_to_triangle_soup(const C3T3& c3t3, - const typename C3T3::Subdomain_index sd_index, - PointContainer& points, - FaceContainer& faces, - const bool normals_point_outside_of_the_subdomain = true, - const bool export_all_facets = false) -{ - typedef typename PointContainer::value_type Point_3; - typedef typename FaceContainer::value_type Face; - - typedef typename C3T3::Triangulation Tr; - - typedef typename Tr::Vertex_handle Vertex_handle; - typedef typename Tr::Cell_handle Cell_handle; - typedef typename Tr::Weighted_point Weighted_point; - - typedef typename C3T3::Facets_in_complex_iterator Ficit; - - typedef CGAL::Hash_handles_with_or_without_timestamps Hash_fct; - typedef boost::unordered_map VHmap; - - typedef typename C3T3::size_type size_type; - - size_type nf = c3t3.number_of_facets_in_complex(); - faces.reserve(faces.size() + nf); - points.reserve(points.size() + nf/2); // approximating Euler - - VHmap vh_to_ids; - std::size_t inum = 0; - - for(Ficit fit = c3t3.facets_in_complex_begin(), - end = c3t3.facets_in_complex_end(); fit != end; ++fit) - { - Cell_handle c = fit->first; - int s = fit->second; - Face f; - resize(f, 3); - - typename C3T3::Subdomain_index cell_sdi = c3t3.subdomain_index(c); - typename C3T3::Subdomain_index opp_sdi = c3t3.subdomain_index(c->neighbor(s)); - - if(!export_all_facets && cell_sdi != sd_index && opp_sdi != sd_index) - continue; - - for(std::size_t i=1; i<4; ++i) - { - typename VHmap::iterator map_entry; - bool is_new; - Vertex_handle v = c->vertex((s+i)&3); - CGAL_assertion(v != Vertex_handle() && !c3t3.triangulation().is_infinite(v)); - - boost::tie(map_entry, is_new) = vh_to_ids.insert(std::make_pair(v, inum)); - if(is_new) - { - const Weighted_point& p = c3t3.triangulation().point(c, (s+i)&3); - const Point_3 bp = Point_3(CGAL::to_double(p.x()), - CGAL::to_double(p.y()), - CGAL::to_double(p.z())); - points.push_back(bp); - ++inum; - } - - f[i-1] = map_entry->second; - } - - if(export_all_facets) - { - if((cell_sdi > opp_sdi) == (s%2 == 1)) - std::swap(f[0], f[1]); - } - else - { - if(((cell_sdi == sd_index) == (s%2 == 1)) == normals_point_outside_of_the_subdomain) - std::swap(f[0], f[1]); - } - - faces.push_back(f); - } -} - -template -void facets_in_complex_3_to_triangle_soup(const C3T3& c3t3, - PointContainer& points, - FaceContainer& faces) -{ - typedef typename C3T3::Subdomain_index Subdomain_index; - Subdomain_index useless = Subdomain_index(); - facets_in_complex_3_to_triangle_soup(c3t3, useless, points, faces, - true/*point outward*/, true /*extract all facets*/); -} - -} // end namespace internal - -} // end namespace Mesh_3 - -//! \ingroup PkgMesh3Functions -//! -//! \brief builds a `TriangleMesh` from the surface facets, with a consistent orientation -//! at the interface of two subdomains. -//! -//! This function exports the surface as a `TriangleMesh` and appends it to `graph`, using -//! `orient_polygon_soup()`. -//! -//! @tparam C3T3 a model of `MeshComplexWithFeatures_3InTriangulation_3`. -//! @tparam TriangleMesh a model of `MutableFaceGraph` with an internal point property map. -//! The point type should be compatible with the one used in `C3T3`. -//! -//! @param c3t3 an instance of `C3T3`. -//! @param graph an instance of `TriangleMesh`. -template -void facets_in_complex_3_to_triangle_mesh(const C3T3& c3t3, TriangleMesh& graph) -{ - namespace PMP = CGAL::Polygon_mesh_processing; - - typedef typename boost::property_map::type VertexPointMap; - typedef typename boost::property_traits::value_type Point_3; - - typedef std::array Face; - - std::vector faces; - std::vector points; - - Mesh_3::internal::facets_in_complex_3_to_triangle_soup(c3t3, points, faces); - - if(!PMP::is_polygon_soup_a_polygon_mesh(faces)) - PMP::orient_polygon_soup(points, faces); - CGAL_postcondition(PMP::is_polygon_soup_a_polygon_mesh(faces)); - - PMP::polygon_soup_to_polygon_mesh(points, faces, graph); -} - -} // namespace CGAL - -#endif // CGAL_FACETS_IN_COMPLEX_3_TO_TRIANGLE_MESH_H +#endif // CGAL_IO_FACETS_IN_COMPLEX_3_TO_TRIANGLE_MESH_H diff --git a/Mesh_3/include/CGAL/IO/output_to_vtu.h b/Mesh_3/include/CGAL/IO/output_to_vtu.h index 65a96d013d7..d553ddfdfed 100644 --- a/Mesh_3/include/CGAL/IO/output_to_vtu.h +++ b/Mesh_3/include/CGAL/IO/output_to_vtu.h @@ -136,9 +136,9 @@ write_cells(std::ostream& os, connectivity_table.push_back(V[cit->vertex(i)]); } - IO::internal::write_vector(os,connectivity_table); - IO::internal::write_vector(os,offsets); - IO::internal::write_vector(os,cell_type); + internal::write_vector(os,connectivity_table); + internal::write_vector(os,offsets); + internal::write_vector(os,cell_type); } @@ -214,7 +214,7 @@ write_c3t3_points(std::ostream& os, coordinates.push_back(vit->point()[1]); coordinates.push_back(dim == 3 ? vit->point()[2] : 0.0); } - IO::internal::write_vector(os,coordinates); + internal::write_vector(os,coordinates); } // writes the attribute tags before binary data is appended @@ -264,7 +264,7 @@ void write_attributes(std::ostream& os, const std::vector& att) { - IO::internal::write_vector(os,att); + internal::write_vector(os,att); } enum VTU_ATTRIBUTE_TYPE{ @@ -279,7 +279,7 @@ template void output_to_vtu_with_attributes(std::ostream& os, const C3T3& c3t3, std::vector >&attributes, - IO::Mode mode = IO::BINARY) + Mode mode = BINARY) { //CGAL_assertion(attributes.size() == attribute_types.size()); typedef typename C3T3::Triangulation Tr; @@ -308,7 +308,7 @@ void output_to_vtu_with_attributes(std::ostream& os, << "\" NumberOfCells=\"" << c3t3.number_of_cells() << "\">\n"; std::size_t offset = 0; - const bool binary = (mode == IO::BINARY); + const bool binary = (mode == BINARY); write_c3t3_points_tag(os,tr,number_of_vertices,V,binary,offset); write_cells_tag(os,c3t3,V,binary,offset); // fills V if the mode is ASCII os << " \n"; @@ -350,13 +350,12 @@ void output_to_vtu_with_attributes(std::ostream& os, } } // namespace internal -} // namespace IO //public API template void output_to_vtu(std::ostream& os, const C3T3& c3t3, - IO::Mode mode = IO::BINARY) + Mode mode = BINARY) { typedef typename C3T3::Cells_in_complex_iterator Cell_iterator; std::vector mids; @@ -368,12 +367,18 @@ void output_to_vtu(std::ostream& os, mids.push_back(v); } - std::vector > atts; - IO::internal::Vtu_attributes v = &mids; + std::vector > atts; + internal::Vtu_attributes v = &mids; atts.push_back(std::make_pair("MeshDomain", v)); - IO::internal::output_to_vtu_with_attributes(os, c3t3, atts, mode); + internal::output_to_vtu_with_attributes(os, c3t3, atts, mode); } +} // namespace IO + +#ifndef CGAL_NO_DEPRECATED_CODE +using IO::output_to_vtu; +#endif + } // namespace CGAL #endif // CGAL_VTK_IO_H diff --git a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h index 0dceef7f282..6a755990d5e 100644 --- a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include @@ -148,7 +148,7 @@ protected: typedef typename Geom_traits::Sphere_3 Sphere_3; typedef typename Geom_traits::Iso_cuboid_3 Iso_cuboid_3; typedef typename Geom_traits::FT FT; - typedef boost::shared_ptr CGAL_Random_share_ptr_t; + typedef std::shared_ptr CGAL_Random_share_ptr_t; /// Returns squared error bound from \c bbox and \c error FT squared_error_bound(const Iso_cuboid_3& bbox, const FT& error) const { diff --git a/Mesh_3/include/CGAL/Mesh_3/Dump_c3t3.h b/Mesh_3/include/CGAL/Mesh_3/Dump_c3t3.h index 147d4ac59f4..5a798e665e0 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Dump_c3t3.h +++ b/Mesh_3/include/CGAL/Mesh_3/Dump_c3t3.h @@ -45,7 +45,7 @@ struct Dump_c3t3 { std::clog<<"======dump c3t3===== to: " << prefix << std::endl; std::ofstream medit_file((prefix+".mesh").c_str()); medit_file.precision(17); - CGAL::output_to_medit(medit_file, c3t3, false /*rebind*/, true /*show_patches*/); + CGAL::IO::output_to_medit(medit_file, c3t3, false /*rebind*/, true /*show_patches*/); medit_file.close(); std::string bin_filename = prefix; @@ -55,7 +55,7 @@ struct Dump_c3t3 { std::string signature = CGAL::Get_io_signature()(); CGAL_assertion(signature != std::string()); bin_file << "binary CGAL c3t3 " << signature << "\n"; - CGAL::set_binary_mode(bin_file); + CGAL::IO::set_binary_mode(bin_file); bin_file << c3t3; } }; // end struct template Dump_c3t3 diff --git a/Mesh_3/include/CGAL/Mesh_3/Mesh_complex_3_in_triangulation_3_base.h b/Mesh_3/include/CGAL/Mesh_3/Mesh_complex_3_in_triangulation_3_base.h index 618d8c51b8b..c12dac28be1 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Mesh_complex_3_in_triangulation_3_base.h +++ b/Mesh_3/include/CGAL/Mesh_3/Mesh_complex_3_in_triangulation_3_base.h @@ -462,7 +462,7 @@ public: bool show_patches = false) const { // Call global function - CGAL::output_to_medit(os,*this,rebind,show_patches); + CGAL::IO::output_to_medit(os,*this,rebind,show_patches); } /// Outputs the mesh to maya @@ -470,7 +470,7 @@ public: bool surfaceOnly = true) const { // Call global function - CGAL::output_to_maya(os,*this,surfaceOnly); + CGAL::IO::output_to_maya(os,*this,surfaceOnly); } //------------------------------------------------------- diff --git a/Mesh_3/include/CGAL/Mesh_3/Mesh_surface_cell_base_3.h b/Mesh_3/include/CGAL/Mesh_3/Mesh_surface_cell_base_3.h index 90a0e1ec909..3e5437c8244 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Mesh_surface_cell_base_3.h +++ b/Mesh_3/include/CGAL/Mesh_3/Mesh_surface_cell_base_3.h @@ -283,7 +283,7 @@ operator>>(std::istream &is, Mesh_surface_cell_base_3 &c) is >> static_cast(c); for(int i = 0; i < 4; ++i) { - if(is_ascii(is)) + if(IO::is_ascii(is)) is >> index; else { @@ -303,8 +303,8 @@ operator<<(std::ostream &os, os << static_cast(c); for(int i = 0; i < 4; ++i) { - if(is_ascii(os)) - os << ' ' << oformat(c.surface_patch_index(i)); + if(IO::is_ascii(os)) + os << ' ' << IO::oformat(c.surface_patch_index(i)); else write(os, c.surface_patch_index(i)); } diff --git a/Mesh_3/include/CGAL/Mesh_3/Mesher_3.h b/Mesh_3/include/CGAL/Mesh_3/Mesher_3.h index 0d81d7a8455..de889e42acf 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Mesher_3.h +++ b/Mesh_3/include/CGAL/Mesh_3/Mesher_3.h @@ -45,7 +45,6 @@ #include #include #include -#include #ifdef CGAL_MESH_3_USE_OLD_SURFACE_RESTRICTED_DELAUNAY_UPDATE #include @@ -65,6 +64,7 @@ #include #include #include +#include namespace CGAL { namespace Mesh_3 { @@ -222,7 +222,7 @@ public: std::size_t maximal_number_of_vertices = 0, Mesh_error_code* error_code = 0 #ifndef CGAL_NO_ATOMIC - , CGAL::cpp11::atomic* stop_ptr = 0 + , std::atomic* stop_ptr = 0 #endif ); @@ -294,7 +294,7 @@ private: #ifndef CGAL_NO_ATOMIC /// Pointer to the atomic Boolean that can stop the process - CGAL::cpp11::atomic* const stop_ptr; + std::atomic* const stop_ptr; #endif #ifdef CGAL_LINKED_WITH_TBB @@ -318,7 +318,7 @@ private: bool forced_stop() const { #ifndef CGAL_NO_ATOMIC if(stop_ptr != 0 && - stop_ptr->load(CGAL::cpp11::memory_order_acquire) == true) + stop_ptr->load(std::memory_order_acquire) == true) { if(error_code_ != 0) *error_code_ = CGAL_MESH_3_STOPPED; return true; @@ -353,7 +353,7 @@ Mesher_3::Mesher_3(C3T3& c3t3, std::size_t maximal_number_of_vertices, Mesh_error_code* error_code #ifndef CGAL_NO_ATOMIC - , CGAL::cpp11::atomic* stop_ptr + , std::atomic* stop_ptr #endif ) : Base(c3t3.bbox(), diff --git a/Mesh_3/include/CGAL/Mesh_3/Mesher_level.h b/Mesh_3/include/CGAL/Mesh_3/Mesher_level.h index b0b7c00229c..b0c7e357c96 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Mesher_level.h +++ b/Mesh_3/include/CGAL/Mesh_3/Mesher_level.h @@ -23,7 +23,6 @@ #include #endif -#include #include #ifdef CGAL_CONCURRENT_MESH_3_PROFILING @@ -37,7 +36,7 @@ # include #endif -#include +#include namespace CGAL { namespace Mesh_3 { @@ -677,7 +676,7 @@ public: void set_lock_ds(Lock_data_structure *) {} void set_worksharing_ds(WorksharingDataStructureType *) {} #ifndef CGAL_NO_ATOMIC - void set_stop_pointer(CGAL::cpp11::atomic*) {} + void set_stop_pointer(std::atomic*) {} #endif protected: @@ -1147,7 +1146,7 @@ public: } #ifndef CGAL_NO_ATOMIC - void set_stop_pointer(CGAL::cpp11::atomic* stop_ptr) + void set_stop_pointer(std::atomic* stop_ptr) { m_stop_ptr = stop_ptr; } @@ -1156,7 +1155,7 @@ public: bool forced_stop() const { #ifndef CGAL_NO_ATOMIC if(m_stop_ptr != 0 && - m_stop_ptr->load(CGAL::cpp11::memory_order_acquire) == true) + m_stop_ptr->load(std::memory_order_acquire) == true) { CGAL_assertion(m_task_group != 0); m_task_group->cancel(); @@ -1177,7 +1176,7 @@ protected: tbb::task_group *m_task_group; #ifndef CGAL_NO_ATOMIC - CGAL::cpp11::atomic* m_stop_ptr; + std::atomic* m_stop_ptr; #endif private: diff --git a/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h b/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h index ab9a4844e5f..36a48742614 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h +++ b/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h @@ -46,7 +46,6 @@ #include #include #include -#include #include @@ -70,6 +69,7 @@ #include #include #include +#include namespace CGAL { namespace Mesh_3 { @@ -102,7 +102,7 @@ void debug_dump_c3t3(const std::string filename, const C3t3& c3t3) std::ofstream out(filename.c_str(), std::ios_base::out|std::ios_base::binary); out << "binary CGAL c3t3 " << CGAL::Get_io_signature()() << "\n"; - CGAL::set_binary_mode(out); + CGAL::IO::set_binary_mode(out); out << c3t3; } @@ -143,7 +143,7 @@ public: std::size_t maximal_number_of_vertices = 0, Mesh_error_code* error_code = 0 #ifndef CGAL_NO_ATOMIC - , CGAL::cpp11::atomic* stop_ptr = 0 + , std::atomic* stop_ptr = 0 #endif ); @@ -156,7 +156,7 @@ public: bool forced_stop() const { #ifndef CGAL_NO_ATOMIC if(stop_ptr_ != 0 && - stop_ptr_->load(CGAL::cpp11::memory_order_acquire) == true) + stop_ptr_->load(std::memory_order_acquire) == true) { if(error_code_ != 0) *error_code_ = CGAL_MESH_3_STOPPED; return true; @@ -469,7 +469,7 @@ private: Mesh_error_code* const error_code_; #ifndef CGAL_NO_ATOMIC /// Pointer to the atomic Boolean that can stop the process - CGAL::cpp11::atomic* const stop_ptr_; + std::atomic* const stop_ptr_; #endif }; @@ -481,7 +481,7 @@ Protect_edges_sizing_field(C3T3& c3t3, const MD& domain, std::size_t maximal_number_of_vertices, Mesh_error_code* error_code #ifndef CGAL_NO_ATOMIC - , CGAL::cpp11::atomic* stop_ptr + , std::atomic* stop_ptr #endif ) : c3t3_(c3t3) @@ -578,7 +578,7 @@ insert_corners() Index p_index = domain_.index_from_corner_index(cit->first); #if CGAL_MESH_3_PROTECTION_DEBUG & 1 - std::cerr << "** treat corner #" << CGAL::oformat(p_index) << std::endl; + std::cerr << "** treat corner #" << CGAL::IO::oformat(p_index) << std::endl; #endif // Get weight (the ball radius is given by the 'query_size' function) @@ -679,7 +679,7 @@ insert_point(const Bare_point& p, const Weight& w, int dim, const Index& index, std::cerr << " ERROR dim=" << dim << " index="; } - std::cerr << CGAL::oformat(index) << std::endl; + std::cerr << CGAL::IO::oformat(index) << std::endl; if(v == Vertex_handle()) std::cerr << " HIDDEN!\n"; std::cerr << "The weight was " << w << std::endl; @@ -708,7 +708,7 @@ smart_insert_point(const Bare_point& p, Weight w, int dim, const Index& index, std::cerr << "smart_insert_point( (" << p << "), w=" << w << ", dim=" << dim - << ", index=" << CGAL::oformat(index) << ")\n"; + << ", index=" << CGAL::IO::oformat(index) << ")\n"; #endif const Tr& tr = c3t3_.triangulation(); @@ -1337,7 +1337,7 @@ refine_balls() std::ostringstream oss; oss << "dump_protecting_balls_" << refine_balls_iteration_nb << ".cgal"; std::ofstream outfile(oss.str().c_str(), std::ios_base::binary | std::ios_base::out); - CGAL::Mesh_3::save_binary_file(outfile, c3t3_, true); + CGAL::IO::save_binary_file(outfile, c3t3_, true); outfile.close(); #endif //CGAL_MESH_3_DUMP_FEATURES_PROTECTION_ITERATIONS @@ -1498,7 +1498,7 @@ change_ball_size(const Vertex_handle& v, const FT squared_size, const bool speci #if CGAL_MESH_3_PROTECTION_DEBUG & 1 std::cerr << "change_ball_size(v=" << disp_vert(v) << " dim=" << c3t3_.in_dimension(v) - << " index=" << CGAL::oformat(c3t3_.index(v)) + << " index=" << CGAL::IO::oformat(c3t3_.index(v)) << " ,\n" << " (squared) size=" << w << ", special_ball=" << std::boolalpha << special_ball << std::endl; @@ -1636,7 +1636,7 @@ check_and_fix_vertex_along_edge(const Vertex_handle& v, ErasedVeOutIt out) std::cerr << "check_and_fix_vertex_along_edge(" << disp_vert(v) << " dim=" << get_dimension(v) - << " index=" << CGAL::oformat(c3t3_.index(v)) + << " index=" << CGAL::IO::oformat(c3t3_.index(v)) << " special=" << std::boolalpha << is_special(v) << ")\n"; #endif @@ -1906,7 +1906,7 @@ repopulate(InputIterator begin, InputIterator last, std::cerr << "repopulate(begin=" << disp_vert(*begin) << "\n" << " last=" << disp_vert(*last) << "\n" << " distance(begin, last)=" << std::distance(begin, last) << ",\n" - << " index=" << CGAL::oformat(index) << ",\n" + << " index=" << CGAL::IO::oformat(index) << ",\n" << " orientation=" << orientation << ")\n"; #endif CGAL_assertion( std::distance(begin,last) >= 0 ); @@ -1946,7 +1946,7 @@ repopulate(InputIterator begin, InputIterator last, default: std::cerr << " ERROR dim=" << get_dimension(*current) << " index="; } - std::cerr << CGAL::oformat(c3t3_.index(*current)) << std::endl; + std::cerr << CGAL::IO::oformat(c3t3_.index(*current)) << std::endl; #endif // CGAL_MESH_3_PROTECTION_DEBUG *out++ = *current; c3t3_.triangulation().remove(*current); @@ -1971,7 +1971,7 @@ analyze_and_repopulate(InputIterator begin, InputIterator last, std::cerr << "analyze_and_repopulate(begin=" << disp_vert(*begin) << "\n" << " last=" << disp_vert(*last) << "\n" << " distance(begin, last)=" << std::distance(begin, last) << ",\n" - << " index=" << CGAL::oformat(index) << ",\n" + << " index=" << CGAL::IO::oformat(index) << ",\n" << " orientation=" << orientation << ")\n"; #endif CGAL_assertion( std::distance(begin,last) >= 0 ); diff --git a/Mesh_3/include/CGAL/Mesh_3/Refine_cells_3.h b/Mesh_3/include/CGAL/Mesh_3/Refine_cells_3.h index 7392d5667a9..f3d1e0ba7fa 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Refine_cells_3.h +++ b/Mesh_3/include/CGAL/Mesh_3/Refine_cells_3.h @@ -26,7 +26,6 @@ #include #include #endif -#include #include #include @@ -41,7 +40,7 @@ #include #include #include - +#include namespace CGAL { @@ -319,7 +318,7 @@ public: C3T3& c3t3, std::size_t maximal_number_of_vertices #ifndef CGAL_NO_ATOMIC - , CGAL::cpp11::atomic* stop_ptr + , std::atomic* stop_ptr #endif ); // For parallel @@ -332,7 +331,7 @@ public: WorksharingDataStructureType *worksharing_ds, std::size_t maximal_number_of_vertices #ifndef CGAL_NO_ATOMIC - , CGAL::cpp11::atomic* stop_ptr + , std::atomic* stop_ptr #endif ); @@ -372,7 +371,7 @@ public: { #ifndef CGAL_NO_ATOMIC if(m_stop_ptr != 0 && - m_stop_ptr->load(CGAL::cpp11::memory_order_acquire) == true) + m_stop_ptr->load(std::memory_order_acquire) == true) { return true; } @@ -573,7 +572,7 @@ private: #ifndef CGAL_NO_ATOMIC /// Pointer to the atomic Boolean that can stop the process - CGAL::cpp11::atomic* const m_stop_ptr; + std::atomic* const m_stop_ptr; #endif private: // Disabled copy constructor @@ -595,7 +594,7 @@ Refine_cells_3(Tr& triangulation, C3T3& c3t3, std::size_t maximal_number_of_vertices #ifndef CGAL_NO_ATOMIC - , CGAL::cpp11::atomic* stop_ptr + , std::atomic* stop_ptr #endif ) : Mesher_level* stop_ptr + , std::atomic* stop_ptr #endif ) : Mesher_level #include -#include #include #include @@ -51,6 +50,7 @@ #include #include #include +#include namespace CGAL { @@ -255,7 +255,7 @@ public: const Criteria& criteria, std::size_t maximal_number_of_vertices #ifndef CGAL_NO_ATOMIC - , CGAL::cpp11::atomic* stop_ptr + , std::atomic* stop_ptr #endif ) : r_tr_(tr) @@ -275,7 +275,7 @@ public: { #ifndef CGAL_NO_ATOMIC if(m_stop_ptr != 0 && - m_stop_ptr->load(CGAL::cpp11::memory_order_acquire) == true) + m_stop_ptr->load(std::memory_order_acquire) == true) { return true; } @@ -615,7 +615,7 @@ protected: std::size_t m_maximal_number_of_vertices_; #ifndef CGAL_NO_ATOMIC /// Pointer to the atomic Boolean that can stop the process - CGAL::cpp11::atomic* const m_stop_ptr; + std::atomic* const m_stop_ptr; #endif }; // end class template Refine_facets_3_base @@ -783,7 +783,7 @@ public: int mesh_topology, std::size_t maximal_number_of_vertices #ifndef CGAL_NO_ATOMIC - , CGAL::cpp11::atomic* stop_ptr + , std::atomic* stop_ptr #endif ); // For parallel @@ -796,7 +796,7 @@ public: WorksharingDataStructureType *worksharing_ds, std::size_t maximal_number_of_vertices #ifndef CGAL_NO_ATOMIC - , CGAL::cpp11::atomic* stop_ptr + , std::atomic* stop_ptr #endif ); @@ -916,7 +916,7 @@ Refine_facets_3(Tr& triangulation, int mesh_topology, std::size_t maximal_number_of_vertices #ifndef CGAL_NO_ATOMIC - , CGAL::cpp11::atomic* stop_ptr + , std::atomic* stop_ptr #endif ) : Rf_base(triangulation, c3t3, oracle, criteria, mesh_topology, @@ -945,7 +945,7 @@ Refine_facets_3(Tr& triangulation, WorksharingDataStructureType *worksharing_ds, std::size_t maximal_number_of_vertices #ifndef CGAL_NO_ATOMIC - , CGAL::cpp11::atomic* stop_ptr + , std::atomic* stop_ptr #endif ) : Rf_base(triangulation, c3t3, oracle, criteria, maximal_number_of_vertices diff --git a/Mesh_3/include/CGAL/Mesh_3/Refine_facets_manifold_base.h b/Mesh_3/include/CGAL/Mesh_3/Refine_facets_manifold_base.h index 3038ce6383f..17b04cc4239 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Refine_facets_manifold_base.h +++ b/Mesh_3/include/CGAL/Mesh_3/Refine_facets_manifold_base.h @@ -19,7 +19,6 @@ #include -#include #include #include @@ -31,6 +30,7 @@ #include #include +#include namespace CGAL { @@ -308,7 +308,7 @@ public: int mesh_topology, std::size_t maximal_number_of_vertices #ifndef CGAL_NO_ATOMIC - , CGAL::cpp11::atomic* stop_ptr + , std::atomic* stop_ptr #endif ) : Base(triangulation, @@ -446,7 +446,7 @@ public: #ifndef CGAL_NO_ATOMIC if(this->m_stop_ptr != 0 && - this->m_stop_ptr->load(CGAL::cpp11::memory_order_acquire) == true) + this->m_stop_ptr->load(std::memory_order_acquire) == true) { return true; } diff --git a/Mesh_3/include/CGAL/Mesh_3/experimental/Lipschitz_sizing_experimental.h b/Mesh_3/include/CGAL/Mesh_3/experimental/Lipschitz_sizing_experimental.h index a0e2524dbb6..a2553333dc1 100644 --- a/Mesh_3/include/CGAL/Mesh_3/experimental/Lipschitz_sizing_experimental.h +++ b/Mesh_3/include/CGAL/Mesh_3/experimental/Lipschitz_sizing_experimental.h @@ -29,7 +29,7 @@ #include #include -#include +#include #include #include @@ -93,7 +93,7 @@ private: private: //only one of these aabb_trees is needed const Tree* m_ptree; - boost::shared_ptr m_own_ptree; + std::shared_ptr m_own_ptree; const MeshDomain& m_domain; Parameters m_params; @@ -104,7 +104,7 @@ private: #ifdef CGAL_MESH_3_EXPERIMENTAL_USE_PATCHES_IDS //help to accelerate aabb_tree queries in m_ptree - boost::shared_ptr m_kd_tree; + std::shared_ptr m_kd_tree; Facet_patch_id_map m_facet_patch_id_map; const Patches_ids_map& patches_ids_map; diff --git a/Mesh_3/include/CGAL/Mesh_3/experimental/Lipschitz_sizing_polyhedron.h b/Mesh_3/include/CGAL/Mesh_3/experimental/Lipschitz_sizing_polyhedron.h index c60ce33db5c..df2c3e0bd46 100644 --- a/Mesh_3/include/CGAL/Mesh_3/experimental/Lipschitz_sizing_polyhedron.h +++ b/Mesh_3/include/CGAL/Mesh_3/experimental/Lipschitz_sizing_polyhedron.h @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include @@ -66,7 +66,7 @@ public: private: const Tree* m_ptree; - boost::shared_ptr m_own_ptree; + std::shared_ptr m_own_ptree; const MeshDomain& m_domain; Parameters m_params; diff --git a/Mesh_3/include/CGAL/Mesh_3/experimental/Sizing_field_with_aabb_tree.h b/Mesh_3/include/CGAL/Mesh_3/experimental/Sizing_field_with_aabb_tree.h index 300d63900d3..0dcff62901b 100644 --- a/Mesh_3/include/CGAL/Mesh_3/experimental/Sizing_field_with_aabb_tree.h +++ b/Mesh_3/include/CGAL/Mesh_3/experimental/Sizing_field_with_aabb_tree.h @@ -174,7 +174,7 @@ struct Sizing_field_with_aabb_tree #ifdef CGAL_MESH_3_PROTECTION_HIGH_VERBOSITY if(dim <= 1) { std::cerr << "Sizing(" << p << ", dim=" << dim - << ", index=#" << CGAL::oformat(id) << "): "; + << ", index=#" << CGAL::IO::oformat(id) << "): "; } #endif // CGAL_MESH_3_PROTECTION_HIGH_VERBOSITY double result = d_; @@ -258,12 +258,12 @@ struct Sizing_field_with_aabb_tree "Ids are { ") % group(setprecision(17),result) % group(setprecision(17),p) - % CGAL::oformat(get(facet_patch_id_map, + % CGAL::IO::oformat(get(facet_patch_id_map, projection_traits.closest_point_and_primitive().second)) % group(setprecision(17), projection_traits.closest_point_and_primitive().first); for(Patch_index i : ids) { - s << CGAL::oformat(i) << " "; + s << CGAL::IO::oformat(i) << " "; } s << "}\n"; std::cerr << s.str(); @@ -327,10 +327,10 @@ struct Sizing_field_with_aabb_tree "Closest face id: %4%\n" "Ids are { ") % result % p % curve_id - % CGAL::oformat(get(facet_patch_id_map, + % CGAL::IO::oformat(get(facet_patch_id_map, projection_traits.closest_point_and_primitive().second)); for(Patch_index i : ids) { - s << CGAL::oformat(i) << " "; + s << CGAL::IO::oformat(i) << " "; } s << "}\n"; std::cerr << s.str(); @@ -346,10 +346,10 @@ struct Sizing_field_with_aabb_tree "Closest face id: %4%\n" "Ids are { ") % result % p % curve_id - % CGAL::oformat(get(facet_patch_id_map, + % CGAL::IO::oformat(get(facet_patch_id_map, projection_traits.closest_point_and_primitive().second)); for(Patch_index i : ids) { - s << CGAL::oformat(i) << " "; + s << CGAL::IO::oformat(i) << " "; } s << "}\n"; CGAL_assertion_msg(result <=0, s.str().c_str()); @@ -364,7 +364,7 @@ struct Sizing_field_with_aabb_tree % result % p % curve_id % projection_traits.closest_point_and_primitive().second->patch_id(); for(Patch_index i : ids) { - s << CGAL::oformat(i) << " "; + s << CGAL::IO::oformat(i) << " "; } s << "}\n"; std::cerr << "ERROR at " << __FILE__ << " line " << __LINE__ << " :\n" diff --git a/Mesh_3/include/CGAL/Mesh_cell_base_3.h b/Mesh_3/include/CGAL/Mesh_cell_base_3.h index 2babd0cc5db..b944bdad4ac 100644 --- a/Mesh_3/include/CGAL/Mesh_cell_base_3.h +++ b/Mesh_3/include/CGAL/Mesh_cell_base_3.h @@ -248,7 +248,7 @@ operator>>(std::istream &is, Mesh_cell_base_3 &c) { typename Mesh_cell_base_3::Subdomain_index index; - if(is_ascii(is)) + if(IO::is_ascii(is)) is >> index; else read(is, index); @@ -263,7 +263,7 @@ std::ostream& operator<<(std::ostream &os, const Mesh_cell_base_3 &c) { - if(is_ascii(os)) + if(IO::is_ascii(os)) os << c.subdomain_index(); else write(os, c.subdomain_index()); diff --git a/Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h b/Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h index 165df38676d..e72a0b7ec36 100644 --- a/Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h +++ b/Mesh_3/include/CGAL/Mesh_domain_with_polyline_features_3.h @@ -40,8 +40,7 @@ #include #include #include -#include -#include +#include namespace CGAL { @@ -859,7 +858,7 @@ public: typedef CGAL::AABB_tree Curves_AABB_tree; private: - mutable boost::shared_ptr curves_aabb_tree_ptr_; + mutable std::shared_ptr curves_aabb_tree_ptr_; mutable bool curves_aabb_tree_is_built; public: @@ -884,7 +883,7 @@ public: if(curves_aabb_tree_ptr_) { curves_aabb_tree_ptr_->clear(); } else { - curves_aabb_tree_ptr_ = boost::make_shared(); + curves_aabb_tree_ptr_ = std::make_shared(); } for(typename Edges::const_iterator edges_it = edges_.begin(), diff --git a/Mesh_3/include/CGAL/Mesh_vertex_base_3.h b/Mesh_3/include/CGAL/Mesh_vertex_base_3.h index ecb1f9464c5..91f0ab6f07e 100644 --- a/Mesh_3/include/CGAL/Mesh_vertex_base_3.h +++ b/Mesh_3/include/CGAL/Mesh_vertex_base_3.h @@ -28,6 +28,7 @@ #include #include #include +#include namespace CGAL { @@ -65,6 +66,13 @@ template <> class Mesh_vertex_base_3_base { public: + Mesh_vertex_base_3_base() + {} + + Mesh_vertex_base_3_base( const Mesh_vertex_base_3_base& c) + { + m_erase_counter.store(c.erase_counter()); + } // Erase counter (cf. Compact_container) unsigned int erase_counter() const @@ -81,7 +89,7 @@ public: } protected: - typedef tbb::atomic Erase_counter_type; + typedef std::atomic Erase_counter_type; Erase_counter_type m_erase_counter; }; @@ -248,7 +256,7 @@ public: { is >> static_cast(v); int dimension; - if(is_ascii(is)) { + if(IO::is_ascii(is)) { is >> dimension; } else { @@ -267,7 +275,7 @@ public: friend std::ostream& operator<<(std::ostream &os, const Mesh_vertex_3& v) { os << static_cast(v); - if(is_ascii(os)) { + if(IO::is_ascii(os)) { os << " " << v.in_dimension() << " "; } else { diff --git a/Mesh_3/include/CGAL/facets_in_complex_3_to_triangle_mesh.h b/Mesh_3/include/CGAL/facets_in_complex_3_to_triangle_mesh.h new file mode 100644 index 00000000000..d69f445716f --- /dev/null +++ b/Mesh_3/include/CGAL/facets_in_complex_3_to_triangle_mesh.h @@ -0,0 +1,185 @@ +// Copyright (c) 2009-2017 GeometryFactory (France). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org). +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial +// +// +// Author(s) : Maxime Gimeno, +// Mael Rouxel-Labbé + +#ifndef CGAL_FACETS_IN_COMPLEX_3_TO_TRIANGLE_MESH_H +#define CGAL_FACETS_IN_COMPLEX_3_TO_TRIANGLE_MESH_H + +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +namespace CGAL { + +namespace Mesh_3 { + +namespace internal { + +template +void resize(Polygon& p, std::size_t size) +{ + p.resize(size); +} + +template +void resize(std::array&, std::size_t CGAL_assertion_code(size)) +{ + CGAL_assertion(size == N); +} + +template +void facets_in_complex_3_to_triangle_soup(const C3T3& c3t3, + const typename C3T3::Subdomain_index sd_index, + PointContainer& points, + FaceContainer& faces, + const bool normals_point_outside_of_the_subdomain = true, + const bool export_all_facets = false) +{ + typedef typename PointContainer::value_type Point_3; + typedef typename FaceContainer::value_type Face; + + typedef typename C3T3::Triangulation Tr; + + typedef typename Tr::Vertex_handle Vertex_handle; + typedef typename Tr::Cell_handle Cell_handle; + typedef typename Tr::Weighted_point Weighted_point; + + typedef typename C3T3::Facets_in_complex_iterator Ficit; + + typedef CGAL::Hash_handles_with_or_without_timestamps Hash_fct; + typedef boost::unordered_map VHmap; + + typedef typename C3T3::size_type size_type; + + size_type nf = c3t3.number_of_facets_in_complex(); + faces.reserve(faces.size() + nf); + points.reserve(points.size() + nf/2); // approximating Euler + + VHmap vh_to_ids; + std::size_t inum = 0; + + for(Ficit fit = c3t3.facets_in_complex_begin(), + end = c3t3.facets_in_complex_end(); fit != end; ++fit) + { + Cell_handle c = fit->first; + int s = fit->second; + Face f; + resize(f, 3); + + typename C3T3::Subdomain_index cell_sdi = c3t3.subdomain_index(c); + typename C3T3::Subdomain_index opp_sdi = c3t3.subdomain_index(c->neighbor(s)); + + if(!export_all_facets && cell_sdi != sd_index && opp_sdi != sd_index) + continue; + + for(std::size_t i=1; i<4; ++i) + { + typename VHmap::iterator map_entry; + bool is_new; + Vertex_handle v = c->vertex((s+i)&3); + CGAL_assertion(v != Vertex_handle() && !c3t3.triangulation().is_infinite(v)); + + boost::tie(map_entry, is_new) = vh_to_ids.insert(std::make_pair(v, inum)); + if(is_new) + { + const Weighted_point& p = c3t3.triangulation().point(c, (s+i)&3); + const Point_3 bp = Point_3(CGAL::to_double(p.x()), + CGAL::to_double(p.y()), + CGAL::to_double(p.z())); + points.push_back(bp); + ++inum; + } + + f[i-1] = map_entry->second; + } + + if(export_all_facets) + { + if((cell_sdi > opp_sdi) == (s%2 == 1)) + std::swap(f[0], f[1]); + } + else + { + if(((cell_sdi == sd_index) == (s%2 == 1)) == normals_point_outside_of_the_subdomain) + std::swap(f[0], f[1]); + } + + faces.push_back(f); + } +} + +template +void facets_in_complex_3_to_triangle_soup(const C3T3& c3t3, + PointContainer& points, + FaceContainer& faces) +{ + typedef typename C3T3::Subdomain_index Subdomain_index; + Subdomain_index useless = Subdomain_index(); + facets_in_complex_3_to_triangle_soup(c3t3, useless, points, faces, + true/*point outward*/, true /*extract all facets*/); +} + +} // end namespace internal + +} // end namespace Mesh_3 + +//! \ingroup PkgMesh3Functions +//! +//! \brief builds a `TriangleMesh` from the surface facets, with a consistent orientation +//! at the interface of two subdomains. +//! +//! This function exports the surface as a `TriangleMesh` and appends it to `graph`, using +//! `orient_polygon_soup()`. +//! +//! @tparam C3T3 a model of `MeshComplexWithFeatures_3InTriangulation_3`. +//! @tparam TriangleMesh a model of `MutableFaceGraph` with an internal point property map. +//! The point type should be compatible with the one used in `C3T3`. +//! +//! @param c3t3 an instance of `C3T3`. +//! @param graph an instance of `TriangleMesh`. +template +void facets_in_complex_3_to_triangle_mesh(const C3T3& c3t3, TriangleMesh& graph) +{ + namespace PMP = CGAL::Polygon_mesh_processing; + + typedef typename boost::property_map::type VertexPointMap; + typedef typename boost::property_traits::value_type Point_3; + + typedef std::array Face; + + std::vector faces; + std::vector points; + + Mesh_3::internal::facets_in_complex_3_to_triangle_soup(c3t3, points, faces); + + if(!PMP::is_polygon_soup_a_polygon_mesh(faces)) + PMP::orient_polygon_soup(points, faces); + CGAL_postcondition(PMP::is_polygon_soup_a_polygon_mesh(faces)); + + PMP::polygon_soup_to_polygon_mesh(points, faces, graph); +} + +} // namespace CGAL + +#endif // CGAL_FACETS_IN_COMPLEX_3_TO_TRIANGLE_MESH_H diff --git a/Mesh_3/include/CGAL/internal/Mesh_3/Boundary_of_subdomain_of_complex_3_in_triangulation_3_to_off.h b/Mesh_3/include/CGAL/internal/Mesh_3/Boundary_of_subdomain_of_complex_3_in_triangulation_3_to_off.h index b08974e545e..93f5b70d430 100644 --- a/Mesh_3/include/CGAL/internal/Mesh_3/Boundary_of_subdomain_of_complex_3_in_triangulation_3_to_off.h +++ b/Mesh_3/include/CGAL/internal/Mesh_3/Boundary_of_subdomain_of_complex_3_in_triangulation_3_to_off.h @@ -14,7 +14,7 @@ #include -#include +#include namespace CGAL { diff --git a/Mesh_3/include/CGAL/internal/Mesh_3/Handle_IO_for_pair_of_int.h b/Mesh_3/include/CGAL/internal/Mesh_3/Handle_IO_for_pair_of_int.h index 7def0a39e9b..b8b9c0c6182 100644 --- a/Mesh_3/include/CGAL/internal/Mesh_3/Handle_IO_for_pair_of_int.h +++ b/Mesh_3/include/CGAL/internal/Mesh_3/Handle_IO_for_pair_of_int.h @@ -41,7 +41,7 @@ public: Output_rep( const T& tt) : t(tt) {} //! perform the output, calls \c operator\<\< by default. std::ostream& operator()( std::ostream& out) const { - if(is_ascii(out)) { + if(IO::is_ascii(out)) { out << t.first << " " << t.second; } else { CGAL::write(out, t.first); @@ -62,7 +62,7 @@ public: Output_rep(const Variant& v) : v(v) {} std::ostream& operator()( std::ostream& out) const { if(v.which() == 1) { - out << oformat(boost::get >(v)); + out << IO::oformat(boost::get >(v)); } else { out << boost::get(v); } @@ -79,7 +79,7 @@ public: Input_rep( T& tt) : t(tt) {} //! perform the output, calls \c operator\<\< by default. std::istream& operator()( std::istream& in) const { - if(is_ascii(in)) { + if(IO::is_ascii(in)) { in >> t.first >> t.second; } else { CGAL::read(in, t.first); diff --git a/Mesh_3/include/CGAL/internal/Mesh_3/indices_management.h b/Mesh_3/include/CGAL/internal/Mesh_3/indices_management.h index fdb84a6c82b..a4b05a9cc61 100644 --- a/Mesh_3/include/CGAL/internal/Mesh_3/indices_management.h +++ b/Mesh_3/include/CGAL/internal/Mesh_3/indices_management.h @@ -163,13 +163,13 @@ struct Read_mesh_domain_index { switch(dimension) { case 0: typename MT::Corner_index ci; - if(is_ascii(is)) is >> ci; + if(IO::is_ascii(is)) is >> ci; else CGAL::read(is, ci); return ci; break; case 1: typename MT::Curve_index si; - if(is_ascii(is)) is >> si; + if(IO::is_ascii(is)) is >> si; else CGAL::read(is, si); return si; break; @@ -195,13 +195,13 @@ struct Write_mesh_domain_index { switch(dimension) { case 0: { const Ci& ci = get_index(index); - if(is_ascii(os)) os << oformat(ci); + if(IO::is_ascii(os)) os << IO::oformat(ci); else CGAL::write(os, ci); } break; case 1: { const Si& si = get_index(index); - if(is_ascii(os)) os << oformat(si); + if(IO::is_ascii(os)) os << IO::oformat(si); else CGAL::write(os, si); } break; @@ -223,14 +223,14 @@ struct Read_mesh_domain_index { switch(dimension) { case 2: { typename MT::Surface_patch_index spi; - if(is_ascii(is)) is >> iformat(spi); + if(IO::is_ascii(is)) is >> IO::iformat(spi); else CGAL::read(is, spi); return spi; } break; default: {// 3 typename MT::Subdomain_index di; - if(is_ascii(is)) is >> iformat(di); + if(IO::is_ascii(is)) is >> IO::iformat(di); else CGAL::read(is, di); return di; } @@ -254,13 +254,13 @@ struct Write_mesh_domain_index { switch(dimension) { case 2: { const Spi& spi = get_index(index); - if(is_ascii(os)) os << oformat(spi); + if(IO::is_ascii(os)) os << IO::oformat(spi); else CGAL::write(os, spi); } break; default: {// 3 const Di& di = get_index(index); - if(is_ascii(os)) os << oformat(di); + if(IO::is_ascii(os)) os << IO::oformat(di); else CGAL::write(os, di); } break; @@ -272,12 +272,12 @@ struct Write_mesh_domain_index { template struct Read_write_index { void operator()(std::ostream& os, int, Index index) const { - if(is_ascii(os)) os << oformat(index); + if(IO::is_ascii(os)) os << IO::oformat(index); else CGAL::write(os, index); } Index operator()(std::istream& is, int) const { Index index; - if(is_ascii(is)) is >> iformat(index); + if(IO::is_ascii(is)) is >> IO::iformat(index); else CGAL::read(is, index); return index; } @@ -287,7 +287,7 @@ struct Variant_write_visitor { std::ostream& os; template void operator()(T v) const { - if(is_ascii(os)) os << CGAL::oformat(v); + if(IO::is_ascii(os)) os << CGAL::IO::oformat(v); else CGAL::write(os, v); } }; @@ -299,7 +299,7 @@ struct Variant_read_visitor { template void operator()(T) const { T v; - if(is_ascii(is)) is >> CGAL::iformat(v); + if(IO::is_ascii(is)) is >> CGAL::IO::iformat(v); else CGAL::read(is, v); variant = v; } diff --git a/Mesh_3/include/CGAL/make_mesh_3.h b/Mesh_3/include/CGAL/make_mesh_3.h index 6bc7be6c596..a75e120da69 100644 --- a/Mesh_3/include/CGAL/make_mesh_3.h +++ b/Mesh_3/include/CGAL/make_mesh_3.h @@ -32,6 +32,8 @@ #include #include +#include + namespace CGAL { namespace parameters { @@ -192,7 +194,7 @@ void init_c3t3_with_features(C3T3& c3t3, std::size_t maximal_number_of_vertices = 0, Mesh_error_code* pointer_to_error_code = 0 #ifndef CGAL_NO_ATOMIC - , CGAL::cpp11::atomic* pointer_to_stop = 0 + , std::atomic* pointer_to_stop = 0 #endif ) { diff --git a/Mesh_3/include/CGAL/refine_mesh_3.h b/Mesh_3/include/CGAL/refine_mesh_3.h index bba8c6c199e..acbf847b26b 100644 --- a/Mesh_3/include/CGAL/refine_mesh_3.h +++ b/Mesh_3/include/CGAL/refine_mesh_3.h @@ -28,10 +28,11 @@ #include #include #include -#include #include +#include + namespace CGAL { namespace details { @@ -196,7 +197,7 @@ struct Manifold_options { // Various Mesh_3 option struct Mesh_3_options { #ifndef CGAL_NO_ATOMIC - typedef CGAL::cpp11::atomic* Pointer_to_stop_atomic_boolean_t; + typedef std::atomic* Pointer_to_stop_atomic_boolean_t; #else typedef bool* Pointer_to_stop_atomic_boolean_t; #endif diff --git a/Mesh_3/test/Mesh_3/test_c3t3.cpp b/Mesh_3/test/Mesh_3/test_c3t3.cpp index 7e4828a460d..ffbc80d090a 100644 --- a/Mesh_3/test/Mesh_3/test_c3t3.cpp +++ b/Mesh_3/test/Mesh_3/test_c3t3.cpp @@ -393,8 +393,8 @@ struct Tester assert ( c3t3.surface_patch_index(*patch_fit_bis) == surface_patch_index_bis ); std::ofstream out_medit("test-medit.mesh"); - CGAL::output_to_medit(out_medit, c3t3); - CGAL::output_to_tetgen("test-tetgen", c3t3); + CGAL::IO::output_to_medit(out_medit, c3t3); + CGAL::IO::output_to_tetgen("test-tetgen", c3t3); } }; diff --git a/Mesh_3/test/Mesh_3/test_c3t3_into_facegraph.cpp b/Mesh_3/test/Mesh_3/test_c3t3_into_facegraph.cpp index 6df89caf971..9a953580e1b 100644 --- a/Mesh_3/test/Mesh_3/test_c3t3_into_facegraph.cpp +++ b/Mesh_3/test/Mesh_3/test_c3t3_into_facegraph.cpp @@ -1,6 +1,6 @@ #include -#include +#include #include #include diff --git a/Mesh_3/test/Mesh_3/test_c3t3_io.cpp b/Mesh_3/test/Mesh_3/test_c3t3_io.cpp index 03f8e8e0a2d..5e75b344e14 100644 --- a/Mesh_3/test/Mesh_3/test_c3t3_io.cpp +++ b/Mesh_3/test/Mesh_3/test_c3t3_io.cpp @@ -85,7 +85,7 @@ public: Output_rep( const T& tt) : t(tt) {} //! perform the output, calls \c operator\<\< by default. std::ostream& operator()( std::ostream& out) const { - if(is_ascii(out)) { + if(IO::is_ascii(out)) { out << (int)t; } else { CGAL::write(out, (int)t); @@ -104,7 +104,7 @@ public: //! perform the output, calls \c operator\<\< by default. std::istream& operator()( std::istream& in) const { int i; - if(is_ascii(in)) { + if(IO::is_ascii(in)) { in >> i; } else { CGAL::read(in, i); @@ -119,11 +119,11 @@ public: namespace std { std::ostream& operator<<(std::ostream& out, MD_heterogeneous_types::Subdomain_index index) { - return out << CGAL::oformat(index); + return out << CGAL::IO::oformat(index); } std::istream& operator>>(std::istream& in, MD_heterogeneous_types::Subdomain_index& index) { - return in >> CGAL::iformat(index); + return in >> CGAL::IO::iformat(index); } } // end namespace std @@ -153,7 +153,7 @@ public: Output_rep( const T& tt) : t(tt) {} //! perform the output, calls \c operator\<\< by default. std::ostream& operator()( std::ostream& out) const { - if(is_ascii(out)) { + if(IO::is_ascii(out)) { out << t.first << " " << t.second; } else { CGAL::write(out, t.first); @@ -172,7 +172,7 @@ public: Input_rep( T& tt) : t(tt) {} //! perform the output, calls \c operator\<\< by default. std::istream& operator()( std::istream& in) const { - if(is_ascii(in)) { + if(IO::is_ascii(in)) { in >> t.first >> t.second; } else { CGAL::read(in, t.first); @@ -187,11 +187,11 @@ public: namespace std { std::ostream& operator<<(std::ostream& out, MD_heterogeneous_types::Surface_patch_index index) { - return out << CGAL::oformat(index); + return out << CGAL::IO::oformat(index); } std::istream& operator>>(std::istream& in, MD_heterogeneous_types::Surface_patch_index& index) { - return in >> CGAL::iformat(index); + return in >> CGAL::IO::iformat(index); } } // end namespace std @@ -332,7 +332,7 @@ struct Test_c3t3_io { std::cout << "IO format: " << CGAL::Get_io_signature()() << std::endl; std::stringstream stream(mode); if(binary) { - CGAL::set_binary_mode(stream); + CGAL::IO::set_binary_mode(stream); } stream << c3t3; if(!binary) { @@ -367,9 +367,9 @@ struct Test_c3t3_io { ( binary ? (std::ios_base::in | std::ios_base::binary) : std::ios_base::in)); - CGAL::Mesh_3::save_binary_file(ss, c3t3, binary); + CGAL::IO::save_binary_file(ss, c3t3, binary); assert(ss); - CGAL::Mesh_3::load_binary_file(ss, c3t3_bis); + CGAL::IO::load_binary_file(ss, c3t3_bis); assert(ss); } if(!check_equality(c3t3, c3t3_bis)) return false; @@ -392,7 +392,7 @@ struct Test_c3t3_io { std::ofstream output(filename.c_str(), binary ? (std::ios_base::out | std::ios_base::binary) : std::ios_base::out); - CGAL::Mesh_3::save_binary_file(output, c3t3_bis, binary); + CGAL::IO::save_binary_file(output, c3t3_bis, binary); } c3t3_bis.clear(); @@ -401,7 +401,7 @@ struct Test_c3t3_io { binary ? (std::ios_base::in | std::ios_base::binary) : std::ios_base::in); assert(input); - CGAL::Mesh_3::load_binary_file(input, c3t3_bis); + CGAL::IO::load_binary_file(input, c3t3_bis); assert(input); } if(!check_equality(c3t3, c3t3_bis)) return false; diff --git a/Mesh_3/test/Mesh_3/test_mesh_cell_base_3.cpp b/Mesh_3/test/Mesh_3/test_mesh_cell_base_3.cpp index 0e433bb0922..2a4bc5a5748 100644 --- a/Mesh_3/test/Mesh_3/test_mesh_cell_base_3.cpp +++ b/Mesh_3/test/Mesh_3/test_mesh_cell_base_3.cpp @@ -1,6 +1,6 @@ #include -#include +#include #include #include diff --git a/Mesh_3/test/Mesh_3/test_meshing_determinism.cpp b/Mesh_3/test/Mesh_3/test_meshing_determinism.cpp index d40f3563053..7ca31d4cfe4 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_determinism.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_determinism.cpp @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include diff --git a/Mesh_3/test/Mesh_3/test_meshing_polyhedron_with_features.cpp b/Mesh_3/test/Mesh_3/test_meshing_polyhedron_with_features.cpp index abb96ddf620..58cb2f6153c 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_polyhedron_with_features.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_polyhedron_with_features.cpp @@ -90,16 +90,16 @@ struct Polyhedron_with_features_tester : public Tester Polyhedral_tag()); //, 1099, 1099, 1158, 1158, 4902, 4902); std::ofstream out_medit("test-medit.mesh"); - CGAL::output_to_medit(out_medit, c3t3); - CGAL::output_to_tetgen("test-tetgen", c3t3); + CGAL::IO::output_to_medit(out_medit, c3t3); + CGAL::IO::output_to_tetgen("test-tetgen", c3t3); std::ofstream out_binary("test-binary.mesh.cgal", std::ios_base::out|std::ios_base::binary); - CGAL::Mesh_3::save_binary_file(out_binary, c3t3); + CGAL::IO::save_binary_file(out_binary, c3t3); out_binary.close(); C3t3 c3t3_bis; std::ifstream in_binary("test-binary.mesh.cgal", std::ios_base::in|std::ios_base::binary); - CGAL::Mesh_3::load_binary_file(in_binary, c3t3_bis); + CGAL::IO::load_binary_file(in_binary, c3t3_bis); assert(c3t3_bis.triangulation() == c3t3.triangulation()); } diff --git a/Mesh_3/test/Mesh_3/test_meshing_polylines_only.cpp b/Mesh_3/test/Mesh_3/test_meshing_polylines_only.cpp index c82df518002..a8ad7dfc6a9 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_polylines_only.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_polylines_only.cpp @@ -93,7 +93,7 @@ int main(int argc, char** argv) std::ofstream medit_file("out-mesh-polylines.mesh"); c3t3.output_to_medit(medit_file); std::ofstream binary_file("out-mesh-polylines.binary.cgal", std::ios::binary|std::ios::out); - save_binary_file(binary_file, c3t3); + CGAL::IO::save_binary_file(binary_file, c3t3); std::cout << "Number of vertices in c3t3: " << c3t3.triangulation().number_of_vertices() << std::endl; assert(c3t3.triangulation().number_of_vertices() > 900); diff --git a/Modular_arithmetic/examples/Modular_arithmetic/modular_filter.cpp b/Modular_arithmetic/examples/Modular_arithmetic/modular_filter.cpp index 52920116692..4d6f223fc32 100644 --- a/Modular_arithmetic/examples/Modular_arithmetic/modular_filter.cpp +++ b/Modular_arithmetic/examples/Modular_arithmetic/modular_filter.cpp @@ -67,7 +67,7 @@ Polynomial modular_filtered_gcd(const Polynomial& p1, const Polynomial& p2){ } int main(){ - CGAL::set_pretty_mode(std::cout); + CGAL::IO::set_pretty_mode(std::cout); typedef CGAL::Gmpz NT; typedef CGAL::Polynomial Poly; diff --git a/Nef_2/examples/Nef_2/nef_2_exploration.cpp b/Nef_2/examples/Nef_2/nef_2_exploration.cpp index 011b2887dbd..3895ce9ba78 100644 --- a/Nef_2/examples/Nef_2/nef_2_exploration.cpp +++ b/Nef_2/examples/Nef_2/nef_2_exploration.cpp @@ -76,7 +76,7 @@ void explore(std::string s, const Nef_polyhedron& poly) int main() { - CGAL::set_pretty_mode(std::cout); + CGAL::IO::set_pretty_mode(std::cout); Nef_polyhedron N0(Nef_polyhedron::COMPLETE); explore("complete", N0); diff --git a/Nef_2/include/CGAL/Filtered_extended_homogeneous.h b/Nef_2/include/CGAL/Filtered_extended_homogeneous.h index 31f67e9e45d..f1d2ae85290 100644 --- a/Nef_2/include/CGAL/Filtered_extended_homogeneous.h +++ b/Nef_2/include/CGAL/Filtered_extended_homogeneous.h @@ -144,7 +144,7 @@ inline double to_double(const SPolynomial& p) template std::ostream& operator<<(std::ostream& os, const SPolynomial& p) { - switch( get_mode(os) ) { + switch( IO::get_mode(os) ) { case CGAL::IO::ASCII : os << p.m() << " " << p.n(); break; case CGAL::IO::BINARY : @@ -158,7 +158,7 @@ std::ostream& operator<<(std::ostream& os, const SPolynomial& p) template std::istream& operator>>(std::istream& is, SPolynomial& p) { RT m,n; - switch( get_mode(is) ){ + switch( IO::get_mode(is) ){ case CGAL::IO::ASCII : is >> m >> n; p = SPolynomial(m,n); break; case CGAL::IO::BINARY : @@ -309,7 +309,7 @@ CheckPoint checkrep() const template std::ostream& operator<<(std::ostream& os, const Extended_point& p) -{ switch( get_mode(os) ) { +{ switch( IO::get_mode(os) ) { case CGAL::IO::ASCII : os << p.hx() << " " << p.hy() << " " << p.hw(); break; case CGAL::IO::BINARY : @@ -327,7 +327,7 @@ std::ostream& operator<<(std::ostream& os, const Extended_point& p) template std::istream& operator>>(std::istream& is, Extended_point& p) { SPolynomial x,y; RT w; - switch( get_mode(is) ){ + switch( IO::get_mode(is) ){ case CGAL::IO::ASCII : is >> x >> y >> w; break; case CGAL::IO::BINARY : diff --git a/Nef_2/include/CGAL/Nef_2/PM_checker.h b/Nef_2/include/CGAL/Nef_2/PM_checker.h index ab2c590a361..a971ee5b946 100644 --- a/Nef_2/include/CGAL/Nef_2/PM_checker.h +++ b/Nef_2/include/CGAL/Nef_2/PM_checker.h @@ -124,7 +124,7 @@ check_order_preserving_embedding(Vertex_const_handle v) const { if ( is_isolated(v) ) return; std::ostringstream error_status; - CGAL::set_pretty_mode ( error_status ); + CGAL::IO::set_pretty_mode ( error_status ); Halfedge_const_handle ef = first_out_edge(v) ,e=ef,en,enn; error_status << "check_order_preserving_embedding\n"; error_status << "vertex " << PV(v) << std::endl; @@ -251,7 +251,7 @@ check_is_triangulation() const CGAL::Unique_hash_map< Halfedge_const_iterator, bool> on_boundary(false); Halfedge_around_face_const_circulator hit(eb), hend(hit); std::ostringstream error_status; - CGAL::set_pretty_mode ( error_status ); + CGAL::IO::set_pretty_mode ( error_status ); error_status << "check_is_triangulation\n"; error_status << "on boundary:\n"; CGAL_For_all(hit,hend) { diff --git a/Nef_2/include/CGAL/Nef_2/PM_const_decorator.h b/Nef_2/include/CGAL/Nef_2/PM_const_decorator.h index ab08adba6cc..8ccfb77c1b6 100644 --- a/Nef_2/include/CGAL/Nef_2/PM_const_decorator.h +++ b/Nef_2/include/CGAL/Nef_2/PM_const_decorator.h @@ -398,7 +398,7 @@ void check_integrity_and_topological_planarity(bool faces=true) const; template std::string PV(VH v) -{ std::ostringstream os; CGAL::set_pretty_mode(os); +{ std::ostringstream os; CGAL::IO::set_pretty_mode(os); if (v != VH()) os << v->point(); else os << "nil"; return os.str(); diff --git a/Nef_2/include/CGAL/Nef_2/PM_io_parser.h b/Nef_2/include/CGAL/Nef_2/PM_io_parser.h index 39b99b37d7c..2ad7ebf2739 100644 --- a/Nef_2/include/CGAL/Nef_2/PM_io_parser.h +++ b/Nef_2/include/CGAL/Nef_2/PM_io_parser.h @@ -117,8 +117,8 @@ to output |H| to |os|.}*/ vn(Base::number_of_vertices()), en(Base::number_of_halfedges()), fn(Base::number_of_faces()) -{ verbose = (get_mode(out) != CGAL::IO::ASCII && - get_mode(out) != CGAL::IO::BINARY); +{ verbose = (IO::get_mode(out) != CGAL::IO::ASCII && + IO::get_mode(out) != CGAL::IO::BINARY); } @@ -130,8 +130,8 @@ PM_io_parser(std::ostream& os, const PMDEC& D) vn(Base::number_of_vertices()), en(Base::number_of_halfedges()), fn(Base::number_of_faces()) -{ verbose = (get_mode(out) != CGAL::IO::ASCII && - get_mode(out) != CGAL::IO::BINARY); +{ verbose = (IO::get_mode(out) != CGAL::IO::ASCII && + IO::get_mode(out) != CGAL::IO::BINARY); } diff --git a/Nef_2/include/CGAL/Nef_2/Polynomial.h b/Nef_2/include/CGAL/Nef_2/Polynomial.h index d2a146f6392..30c5963b4ad 100644 --- a/Nef_2/include/CGAL/Nef_2/Polynomial.h +++ b/Nef_2/include/CGAL/Nef_2/Polynomial.h @@ -1737,7 +1737,7 @@ template std::ostream& operator << (std::ostream& os, const Polynomial& p) { int i; - switch( get_mode(os) ) + switch( IO::get_mode(os) ) { case CGAL::IO::ASCII : os << p.degree() << ' '; @@ -1773,7 +1773,7 @@ std::istream& operator >> (std::istream& is, Polynomial& p) { char ch; NT c; bool pretty = false; - switch( get_mode(is) ) { + switch( IO::get_mode(is) ) { case CGAL::IO::ASCII : case CGAL::IO::PRETTY : is >> ch; diff --git a/Nef_2/test/Nef_2/EPoint-test.cpp b/Nef_2/test/Nef_2/EPoint-test.cpp index 2e2302a1f2f..4b83f8dce08 100644 --- a/Nef_2/test/Nef_2/EPoint-test.cpp +++ b/Nef_2/test/Nef_2/EPoint-test.cpp @@ -39,7 +39,7 @@ int main() typedef EDec::Standard_RT RT; EDec D; - CGAL::set_pretty_mode ( std::cerr ); + CGAL::IO::set_pretty_mode ( std::cerr ); Point ps1(0,0), ps2(1,1), ps3(1,0), ps4(0,1), ps5(1,1,2); EDec::Point_type t1,t2,t3; EP eps1 = D.construct_point(ps1); @@ -149,7 +149,7 @@ int main() typedef EDec::Standard_RT RT; EDec D; - CGAL::set_pretty_mode ( std::cerr ); + CGAL::IO::set_pretty_mode ( std::cerr ); Point ps1(0,0), ps2(1,1), ps3(1,0), ps4(0,1), ps5(1,1,2); EDec::Point_type t1,t2,t3; EP eps1 = D.construct_point(ps1); @@ -256,7 +256,7 @@ int main() typedef EDec::Standard_RT RT; EDec D; - CGAL::set_pretty_mode ( std::cerr ); + CGAL::IO::set_pretty_mode ( std::cerr ); Point ps1(0,0), ps2(1,1), ps3(1,0), ps4(0,1), ps5(1,1,2); EDec::Point_type t1,t2,t3; EP eps1 = D.construct_point(ps1); diff --git a/Nef_2/test/Nef_2/Nef_polyhedron_2-test.cpp b/Nef_2/test/Nef_2/Nef_polyhedron_2-test.cpp index 77819fd3f5b..e925809395e 100644 --- a/Nef_2/test/Nef_2/Nef_polyhedron_2-test.cpp +++ b/Nef_2/test/Nef_2/Nef_polyhedron_2-test.cpp @@ -16,7 +16,7 @@ int main() #endif CGAL_NEF_SETDTHREAD(911); // 911 - CGAL::set_pretty_mode ( std::cerr ); + CGAL::IO::set_pretty_mode ( std::cerr ); std::cerr << "using " << CGAL::pointlocationversion << std::endl; std::cerr << "using " << CGAL::sweepversion << std::endl; CGAL_TEST_START; diff --git a/Nef_2/test/Nef_2/Polynomial-test.cpp b/Nef_2/test/Nef_2/Polynomial-test.cpp index 45370b1402e..38fa46c51ae 100644 --- a/Nef_2/test/Nef_2/Polynomial-test.cpp +++ b/Nef_2/test/Nef_2/Polynomial-test.cpp @@ -25,7 +25,7 @@ using namespace CGAL; int main() { - //CGAL_NEF_SETDTHREAD(3); CGAL::set_pretty_mode ( std::cerr ); + //CGAL_NEF_SETDTHREAD(3); CGAL::IO::set_pretty_mode ( std::cerr ); CGAL_TEST_START; { PRT(Integer,Integer); diff --git a/Nef_2/test/Nef_2/include/CGAL/test_macros.h b/Nef_2/test/Nef_2/include/CGAL/test_macros.h index 9193a65a90a..d1bb6ab1c33 100644 --- a/Nef_2/test/Nef_2/include/CGAL/test_macros.h +++ b/Nef_2/test/Nef_2/include/CGAL/test_macros.h @@ -14,7 +14,7 @@ std::cerr<<"ERROR: ("<<__LINE__ <<") test "<<#b<<" failed."<mark() ? ct : cf; + CGAL::IO::Color c = v->mark() ? ct : cf; glPointSize(10); glColor3ub(c.red(), c.green(), c.blue()); glBegin(GL_POINTS); @@ -291,9 +291,9 @@ namespace OGL { void draw(Edge_iterator e) const { CGAL_NEF_TRACEN("drawing edge "<<*e); Double_point p = e->source(), q = e->target(); - CGAL::Color cf(CGAL_NEF3_MARKED_EDGE_COLOR), + CGAL::IO::Color cf(CGAL_NEF3_MARKED_EDGE_COLOR), ct(CGAL_NEF3_UNMARKED_EDGE_COLOR); // more blue-ish - CGAL::Color c = e->mark() ? ct : cf; + CGAL::IO::Color c = e->mark() ? ct : cf; glLineWidth(5); glColor3ub(c.red(),c.green(),c.blue()); glBegin(GL_LINE_STRIP); @@ -317,9 +317,9 @@ namespace OGL { GLU_TESS_WINDING_POSITIVE); DFacet::Coord_const_iterator cit; - CGAL::Color cf(CGAL_NEF3_MARKED_FACET_COLOR), + CGAL::IO::Color cf(CGAL_NEF3_MARKED_FACET_COLOR), ct(CGAL_NEF3_UNMARKED_FACET_COLOR); // more blue-ish - CGAL::Color c = (f->mark() ? ct : cf); + CGAL::IO::Color c = (f->mark() ? ct : cf); glColor3ub(c.red(),c.green(),c.blue()); gluTessBeginPolygon(tess_,f->normal()); CGAL_NEF_TRACEN(" "); diff --git a/Nef_3/doc/Nef_3/Nef_3.txt b/Nef_3/doc/Nef_3/Nef_3.txt index b4fee9d321a..636630cd569 100644 --- a/Nef_3/doc/Nef_3/Nef_3.txt +++ b/Nef_3/doc/Nef_3/Nef_3.txt @@ -579,4 +579,3 @@ the `Object_handle` can represent a `Vertex_const_handle`, a */ } /* namespace CGAL */ - diff --git a/Nef_3/examples/Nef_3/transformation.cpp b/Nef_3/examples/Nef_3/transformation.cpp index 74d1108888f..0e79e62e832 100644 --- a/Nef_3/examples/Nef_3/transformation.cpp +++ b/Nef_3/examples/Nef_3/transformation.cpp @@ -4,11 +4,7 @@ #include -//instead of -//typedef CGAL::Extended_homogeneous Kernel; -// workaround for VC++ -struct Kernel : public CGAL::Extended_homogeneous {}; - +typedef CGAL::Extended_homogeneous Kernel; typedef CGAL::Nef_polyhedron_3 Nef_polyhedron; typedef Nef_polyhedron::Plane_3 Plane_3; typedef Nef_polyhedron::Vector_3 Vector_3; @@ -22,10 +18,7 @@ int main() { 0,0,-1, 0,1,0, 1); - Aff_transformation_3 scale(3,0,0, - 0,3,0, - 0,0,3, - 2); + Aff_transformation_3 scale(CGAL::SCALING, 3, 2); N.transform(transl); CGAL_assertion(N == Nef_polyhedron(Plane_3(0,1,0,-7))); diff --git a/Nef_3/include/CGAL/Nef_3/Halfedge.h b/Nef_3/include/CGAL/Nef_3/Halfedge.h index 21506e7db3b..b0c21962585 100644 --- a/Nef_3/include/CGAL/Nef_3/Halfedge.h +++ b/Nef_3/include/CGAL/Nef_3/Halfedge.h @@ -144,7 +144,7 @@ class Halfedge_base public: std::string debug() const { std::stringstream os; - set_pretty_mode(os); + CGAL::IO::set_pretty_mode(os); os<<"sv [ "<mark() ? ct : cf; + CGAL::IO::Color c = v->mark() ? ct : cf; glPointSize(10); glColor3ub(c.red(), c.green(), c.blue()); glBegin(GL_POINTS); @@ -357,9 +357,9 @@ namespace OGL { void draw(Edge_iterator e) const { // CGAL_NEF_TRACEN("drawing edge "<<*e); Double_point p = e->source(), q = e->target(); - CGAL::Color cf(CGAL_NEF3_MARKED_EDGE_COLOR), + CGAL::IO::Color cf(CGAL_NEF3_MARKED_EDGE_COLOR), ct(CGAL_NEF3_UNMARKED_EDGE_COLOR); // more blue-ish - CGAL::Color c = e->mark() ? ct : cf; + CGAL::IO::Color c = e->mark() ? ct : cf; glLineWidth(5); glColor3ub(c.red(),c.green(),c.blue()); glBegin(GL_LINE_STRIP); @@ -383,9 +383,9 @@ namespace OGL { GLU_TESS_WINDING_POSITIVE); DFacet::Coord_const_iterator cit; - CGAL::Color cf(CGAL_NEF3_MARKED_FACET_COLOR), + CGAL::IO::Color cf(CGAL_NEF3_MARKED_FACET_COLOR), ct(CGAL_NEF3_UNMARKED_FACET_COLOR); // more blue-ish - CGAL::Color c = (f->mark() ? ct : cf); + CGAL::IO::Color c = (f->mark() ? ct : cf); glColor3ub(c.red(),c.green(),c.blue()); gluTessBeginPolygon(tess_,f->normal()); // CGAL_NEF_TRACEN(" "); diff --git a/Nef_3/include/CGAL/Nef_3/Pluecker_line_3.h b/Nef_3/include/CGAL/Nef_3/Pluecker_line_3.h index 2b48b76bbee..ab1f4bf4a14 100644 --- a/Nef_3/include/CGAL/Nef_3/Pluecker_line_3.h +++ b/Nef_3/include/CGAL/Nef_3/Pluecker_line_3.h @@ -316,7 +316,7 @@ on their Pluecker coefficient tuples.}*/ template std::ostream& operator<<(std::ostream& os, const Pluecker_line_3& l) { - switch( get_mode(os) ) { + switch( IO::get_mode(os) ) { case CGAL::IO::ASCII : for (unsigned i=0; i<6; ++i) os << l[i] << " "; return os; diff --git a/Nef_3/include/CGAL/Nef_3/SHalfedge.h b/Nef_3/include/CGAL/Nef_3/SHalfedge.h index ddf5b382b1d..31694604135 100644 --- a/Nef_3/include/CGAL/Nef_3/SHalfedge.h +++ b/Nef_3/include/CGAL/Nef_3/SHalfedge.h @@ -216,7 +216,7 @@ class SHalfedge_base { std::string debug() const { std::stringstream os; - set_pretty_mode(os); + CGAL::IO::set_pretty_mode(os); os <<"e[ "<debug()<<", " <source_->debug() #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO diff --git a/Nef_3/include/CGAL/Nef_3/SHalfloop.h b/Nef_3/include/CGAL/Nef_3/SHalfloop.h index e6cc98bf944..59c449c150f 100644 --- a/Nef_3/include/CGAL/Nef_3/SHalfloop.h +++ b/Nef_3/include/CGAL/Nef_3/SHalfloop.h @@ -102,7 +102,7 @@ class SHalfloop_base { public: std::string debug() const { std::stringstream os; - set_pretty_mode(os); + CGAL::IO::set_pretty_mode(os); os<<"sl [ "< #include -#define CGAL_NEF3_LGREY CGAL::Color(170,170,200) -#define CGAL_NEF3_DGREY CGAL::Color(30,30,50) +#define CGAL_NEF3_LGREY CGAL::IO::Color(170,170,200) +#define CGAL_NEF3_DGREY CGAL::IO::Color(30,30,50) namespace CGAL { diff --git a/Nef_3/include/CGAL/Nef_3/SNC_SM_visualizor.h b/Nef_3/include/CGAL/Nef_3/SNC_SM_visualizor.h index ec1b81c1014..e06f5b8e92f 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_SM_visualizor.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_SM_visualizor.h @@ -24,8 +24,8 @@ #include #include -#define CGAL_NEF_LGREY CGAL::Color(170,170,200) -#define CGAL_NEF_DGREY CGAL::Color(30,30,50) +#define CGAL_NEF_LGREY CGAL::IO::Color(170,170,200) +#define CGAL_NEF_DGREY CGAL::IO::Color(30,30,50) namespace CGAL { diff --git a/Nef_3/include/CGAL/Nef_3/SNC_constructor.h b/Nef_3/include/CGAL/Nef_3/SNC_constructor.h index e5bf90033ff..23041cff316 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_constructor.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_constructor.h @@ -831,7 +831,7 @@ public: ec->circle()); Sphere_point sp(intersection(c, seg.sphere_circle())); CGAL_NEF_TRACEN(seg <<" has_on " << sp); - if(!seg.has_on(sp)) + if(!seg.has_on_after_intersection(sp)) sp = sp.antipode(); sv = D.new_svertex(sp); CGAL_NEF_TRACEN("new svertex 3 " << normalized(sp)); @@ -2063,7 +2063,7 @@ class SNC_constructor ec->circle()); Sphere_point sp(intersection(c, seg.sphere_circle())); CGAL_NEF_TRACEN(seg <<" has_on " << sp); - if(!seg.has_on(sp)) + if(!seg.has_on_after_intersection(sp)) sp = sp.antipode(); sv = D.new_svertex(sp); CGAL_NEF_TRACEN("new svertex 3 " << normalized(sp)); diff --git a/Nef_3/include/CGAL/Nef_3/SNC_decorator.h b/Nef_3/include/CGAL/Nef_3/SNC_decorator.h index ba0a8c09bd1..181479d575d 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_decorator.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_decorator.h @@ -176,7 +176,7 @@ class SNC_decorator : public SNC_const_decorator { } std::string debug(SHalfedge_handle e) const - { std::stringstream os; set_pretty_mode(os); + { std::stringstream os; CGAL::IO::set_pretty_mode(os); os << "sedge-use " << e->source()->source()->point() << e->twin()->source()->twin()->source()->point() <<'\0'; return os.str(); diff --git a/Nef_3/include/CGAL/Nef_3/SNC_indexed_items.h b/Nef_3/include/CGAL/Nef_3/SNC_indexed_items.h index 2bee2a582e5..80fb7487800 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_indexed_items.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_indexed_items.h @@ -15,9 +15,6 @@ #include - -#include - #include #include #include @@ -26,6 +23,8 @@ #include #include +#include + #undef CGAL_NEF_DEBUG #define CGAL_NEF_DEBUG 83 #include @@ -42,7 +41,7 @@ class Index_generator { #ifdef CGAL_NO_ATOMIC static int unique; #else - static CGAL::cpp11::atomic unique; + static std::atomic unique; #endif return unique++; } diff --git a/Nef_3/include/CGAL/Nef_3/SNC_io_parser.h b/Nef_3/include/CGAL/Nef_3/SNC_io_parser.h index 7968f56902b..c0ddcc5ff22 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_io_parser.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_io_parser.h @@ -1112,8 +1112,8 @@ SNC_io_parser::SNC_io_parser(std::ostream& os, SNC_structure& W, sln(W.number_of_shalfloops()), sfn(W.number_of_sfaces()) { - verbose = (get_mode(out) != CGAL::IO::ASCII && - get_mode(out) != CGAL::IO::BINARY); + verbose = (IO::get_mode(out) != CGAL::IO::ASCII && + IO::get_mode(out) != CGAL::IO::BINARY); sorted = sort; reduce = reduce_; reduce = reduce && this->is_extended_kernel() && this->is_bounded(); diff --git a/Nef_3/include/CGAL/Nef_3/SNC_point_locator.h b/Nef_3/include/CGAL/Nef_3/SNC_point_locator.h index 74dd49f210d..10fdcd01a9b 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_point_locator.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_point_locator.h @@ -126,7 +126,7 @@ public: virtual void add_vertex(Vertex_handle) {} - virtual ~SNC_point_locator() CGAL_NOEXCEPT(CGAL_NO_ASSERTIONS_BOOL) + virtual ~SNC_point_locator() noexcept(!CGAL_ASSERTIONS_ENABLED) { CGAL_NEF_CLOG(""); CGAL_NEF_CLOG("construction_time: "< -#include +#include #include -#include -#include -#include - -#undef CGAL_NEF_DEBUG -#define CGAL_NEF_DEBUG 17 -#include +#include +#include +#include namespace CGAL { -template -Point_2 point_3_get_x_y_point_2(const Point_3& p, const Homogeneous_tag&) { - return( Point_2(p.hx(), p.hy(), p.hw()) ); -} - -template -Point_2 point_3_get_y_z_point_2(const Point_3& p, const Homogeneous_tag&) { - return( Point_2(p.hy(), p.hz(), p.hw()) ); -} - -template -Point_2 point_3_get_z_x_point_2(const Point_3& p, const Homogeneous_tag&) { - return( Point_2(p.hz(), p.hx(), p.hw()) ); -} - -template -Point_2 point_3_get_x_y_point_2(const Point_3& p, const Cartesian_tag&) { - return( Point_2(p.x(), p.y()) ); -} - -template -Point_2 point_3_get_y_z_point_2(const Point_3& p, const Cartesian_tag&) { - return( Point_2(p.y(), p.z()) ); -} - -template -Point_2 point_3_get_z_x_point_2(const Point_3& p, const Cartesian_tag&) { - return( Point_2(p.z(), p.x()) ); -} - -template -Point_2 point_3_get_x_y_point_2(const Point_3& p) { - return point_3_get_x_y_point_2(p,typename R::Kernel_tag()); -} - -template -Point_2 point_3_get_y_z_point_2(const Point_3& p) { - return point_3_get_y_z_point_2(p,typename R::Kernel_tag()); -} - -template -Point_2 point_3_get_z_x_point_2(const Point_3& p) { - return point_3_get_z_x_point_2(p,typename R::Kernel_tag()); -} - template Bounded_side bounded_side_3(IteratorForward first, IteratorForward last, const Point_3& point, - typename R::Plane_3 plane = typename R::Plane_3(0,0,0,0)) { - typedef typename R::Point_2 Point_2; - typedef typename R::Point_3 Point_3; - typedef typename R::Plane_3 Plane_3; + const Plane_3& plane) +{ + typedef typename CGAL::Projection_traits_yz_3 YZ; + typedef typename CGAL::Projection_traits_xz_3 XZ; + typedef typename CGAL::Projection_traits_xy_3 XY; - if(plane == Plane_3(0,0,0,0)) { - // TO TEST: code never tested - IteratorForward p(first); - Point_3 p0(*(p++)); - CGAL_assertion(p != last); - Point_3 p1(*(p++)); - CGAL_assertion(p != last); - Point_3 p2(*(p++)); - plane = Plane_3(p0, p1, p2); - - /* since we just need to project the points to a non-perpendicular plane - we don't need to care about the plane orientation */ - } + CGAL_assertion(!plane.is_degenerate()); typename R::Non_zero_dimension_3 non_zero_dimension_3; int dir = non_zero_dimension_3(plane.orthogonal_vector()); - - CGAL_assertion(!plane.is_degenerate()); - Point_2 (*t)(const Point_3&); - - if(dir == 0){ - t = &point_3_get_y_z_point_2< Point_2, Point_3, R>; - }else if(dir == 1){ - t = &point_3_get_z_x_point_2< Point_2, Point_3, R>; - }else{ - t = &point_3_get_x_y_point_2< Point_2, Point_3, R>; + if(dir == 0) { + return bounded_side_2(first, last, point, YZ()); + } else if(dir == 1) { + return bounded_side_2(first, last, point, XZ()); + } else { + return bounded_side_2(first, last, point, XY()); } - - std::vector< Point_2> points; - CGAL_NEF_TRACEN("facet:"); - for( ; first != last; ++first ) { - CGAL_NEF_TRACEN(t(*first)<<" "<<*first); - points.push_back( t(*first)); - } - Bounded_side side = bounded_side_2( points.begin(), points.end(), t(point)); - return side; } } //namespace CGAL diff --git a/Nef_3/include/CGAL/Nef_polyhedron_3.h b/Nef_3/include/CGAL/Nef_polyhedron_3.h index 8a2e1e16520..c1a0791152f 100644 --- a/Nef_3/include/CGAL/Nef_polyhedron_3.h +++ b/Nef_3/include/CGAL/Nef_polyhedron_3.h @@ -1710,6 +1710,8 @@ protected: bool ninety = is_90degree_rotation(aff); bool scale = is_scaling(aff); + bool translate = aff.is_translation(); + Vertex_iterator vi; CGAL_forall_vertices( vi, snc()) { @@ -1726,8 +1728,10 @@ protected: vertex_list.push_back(vi); } else { vi->point() = vi->point().transform( aff); - SM_decorator sdeco(&*vi); - sdeco.transform( linear); + if(! translate){ + SM_decorator sdeco(&*vi); + sdeco.transform( linear); + } } } diff --git a/Nef_3/include/CGAL/draw_nef_3.h b/Nef_3/include/CGAL/draw_nef_3.h index bcdb6c61ae3..8a1f4a74931 100644 --- a/Nef_3/include/CGAL/draw_nef_3.h +++ b/Nef_3/include/CGAL/draw_nef_3.h @@ -30,11 +30,11 @@ namespace CGAL { struct DefaultColorFunctorNefPolyhedron { template - static CGAL::Color run(const NefPolyhedron&, + static CGAL::IO::Color run(const NefPolyhedron&, typename NefPolyhedron::Halffacet_const_handle fh) { if (fh == nullptr) // use to get the mono color - return CGAL::Color(100, 125, 200); // R G B between 0-255 + return CGAL::IO::Color(100, 125, 200); // R G B between 0-255 CGAL::Random random((unsigned int)(std::size_t)(&(*fh))); return get_random_color(random); @@ -111,7 +111,7 @@ protected: return; } - CGAL::Color c = viewer.run_color(f); + CGAL::IO::Color c = viewer.run_color(f); viewer.face_begin(c); SHalfedge_around_facet_const_circulator hc_start(se); @@ -171,7 +171,7 @@ protected: negate_all_normals(); } - CGAL::Color run_color(Halffacet_const_handle fh) + CGAL::IO::Color run_color(Halffacet_const_handle fh) { return m_fcolor.run(nef, fh); } diff --git a/Nef_S2/include/CGAL/Nef_S2/SM_checker.h b/Nef_S2/include/CGAL/Nef_S2/SM_checker.h index c5311e9a445..dd659105e70 100644 --- a/Nef_S2/include/CGAL/Nef_S2/SM_checker.h +++ b/Nef_S2/include/CGAL/Nef_S2/SM_checker.h @@ -108,7 +108,7 @@ void SM_checker:: check_order_preserving_embedding(Vertex_const_handle v) const { std::ostrstream error_status; - CGAL::set_pretty_mode ( error_status ); + CGAL::IO::set_pretty_mode ( error_status ); Halfedge_const_handle ef = first_out_edge(v) ,e=ef,en,enn; error_status << "check_order_preserving_embedding\n"; error_status << "vertex " << PV(v) << endl; @@ -219,7 +219,7 @@ check_is_triangulation() const CGAL::Hash_map< Halfedge_const_iterator, bool> on_boundary(false); Halfedge_around_face_const_circulator hit(eb), hend(hit); std::ostrstream error_status; - CGAL::set_pretty_mode ( error_status ); + CGAL::IO::set_pretty_mode ( error_status ); error_status << "check_is_triangulation\n"; error_status << "on boundary:\n"; CGAL_For_all(hit,hend) { diff --git a/Nef_S2/include/CGAL/Nef_S2/SM_io_parser.h b/Nef_S2/include/CGAL/Nef_S2/SM_io_parser.h index d58126bac9c..7c09b4eaf0c 100644 --- a/Nef_S2/include/CGAL/Nef_S2/SM_io_parser.h +++ b/Nef_S2/include/CGAL/Nef_S2/SM_io_parser.h @@ -152,8 +152,8 @@ SM_io_parser(std::ostream& iout, const Base& D) en(this->number_of_shalfedges()), ln(this->number_of_shalfloops()), fn(this->number_of_sfaces()) -{ verbose = (get_mode(out) != CGAL::IO::ASCII && - get_mode(out) != CGAL::IO::BINARY); +{ verbose = (IO::get_mode(out) != CGAL::IO::ASCII && + IO::get_mode(out) != CGAL::IO::BINARY); } diff --git a/Nef_S2/include/CGAL/Nef_S2/SM_items.h b/Nef_S2/include/CGAL/Nef_S2/SM_items.h index f779f23273f..d1141a21311 100644 --- a/Nef_S2/include/CGAL/Nef_S2/SM_items.h +++ b/Nef_S2/include/CGAL/Nef_S2/SM_items.h @@ -109,7 +109,7 @@ public: public: std::string debug() const - { std::ostringstream os; set_pretty_mode(os); + { std::ostringstream os; CGAL::IO::set_pretty_mode(os); os<<"V"<debug()<<", " <source_->debug()<< #ifdef CGAL_I_DO_WANT_TO_USE_GENINFO @@ -289,7 +289,7 @@ public: const GenPtr& info() const { return info_; } std::string debug() const - { std::ostringstream os; set_pretty_mode(os); + { std::ostringstream os; CGAL::IO::set_pretty_mode(os); os<<"l"< #include -#define CGAL_NEF_LGREY CGAL::Color(170,170,200) -#define CGAL_NEF_DGREY CGAL::Color(30,30,50) +#define CGAL_NEF_LGREY CGAL::IO::Color(170,170,200) +#define CGAL_NEF_DGREY CGAL::IO::Color(30,30,50) namespace CGAL { template diff --git a/Nef_S2/include/CGAL/Nef_S2/Sphere_geometry_OGL.h b/Nef_S2/include/CGAL/Nef_S2/Sphere_geometry_OGL.h index 505fe604fa5..db3a99f3ad9 100644 --- a/Nef_S2/include/CGAL/Nef_S2/Sphere_geometry_OGL.h +++ b/Nef_S2/include/CGAL/Nef_S2/Sphere_geometry_OGL.h @@ -33,8 +33,8 @@ #define CGAL_NEF_DEBUG 151 #include -#define CGAL_NEF_LGREY CGAL::Color(170,170,200) -#define CGAL_NEF_DGREY CGAL::Color(30,30,50) +#define CGAL_NEF_LGREY CGAL::IO::Color(170,170,200) +#define CGAL_NEF_DGREY CGAL::IO::Color(30,30,50) namespace CGAL { namespace OGL { @@ -240,12 +240,12 @@ template class Sphere_point : public VPoint, public Gen_object { typedef R_ R; CGAL::Sphere_point p_; - CGAL::Color c_; + CGAL::IO::Color c_; unsigned w_; public: Sphere_point() {} Sphere_point(const CGAL::Sphere_point& p, - CGAL::Color c = CGAL::black(), unsigned w = 10) : + CGAL::IO::Color c = CGAL::black(), unsigned w = 10) : VPoint(Approximator::approximate(p)), p_(p), c_(c), w_(w) {} Sphere_point(const Sphere_point& p) : VPoint(p), Gen_object() { p_ = p.p_; c_ = p.c_; w_ = p.w_; } @@ -283,12 +283,12 @@ template class Sphere_segment : public VSegment, public Gen_object { typedef R_ R; CGAL::Sphere_segment s_; - CGAL::Color c_; + CGAL::IO::Color c_; unsigned w_; public: Sphere_segment() {} Sphere_segment(const CGAL::Sphere_segment& s, - CGAL::Color c = CGAL::black(), unsigned w = 2) + CGAL::IO::Color c = CGAL::black(), unsigned w = 2) : VSegment(Approximator::approximate(s)), s_(s), c_(c), w_(w) {} Sphere_segment(const Sphere_segment& s) : VSegment(s), Gen_object() { s_ = s.s_; c_ = s.c_; w_ = s.w_; } @@ -336,12 +336,12 @@ template class Sphere_circle : public VSegment, public Gen_object { typedef R_ R; CGAL::Sphere_circle s_; - CGAL::Color c_; + CGAL::IO::Color c_; unsigned w_; public: Sphere_circle() {} Sphere_circle(const CGAL::Sphere_circle& s, - CGAL::Color c = CGAL::black(), unsigned w = 2) + CGAL::IO::Color c = CGAL::black(), unsigned w = 2) : VSegment(Approximator::approximate(s)), s_(s), c_(c), w_(w) {} Sphere_circle(const Sphere_circle& s) : VSegment(s), Gen_object() { s_ = s.s_; c_ = s.c_; w_ = s.w_; } @@ -382,12 +382,12 @@ template class Sphere_triangle : public VTriangle, public Gen_object { typedef R_ R; CGAL::Sphere_triangle t_; - CGAL::Color c_; + CGAL::IO::Color c_; public: Sphere_triangle() {} Sphere_triangle(const CGAL::Sphere_triangle& t, - CGAL::Color c = CGAL::Color(100,100,120)) + CGAL::IO::Color c = CGAL::IO::Color(100,100,120)) : VTriangle(Approximator::approximate(t)), t_(t), c_(c) {} Sphere_triangle(const Sphere_triangle& t) : VTriangle(t), Gen_object() @@ -530,27 +530,27 @@ Unit_sphere& operator=(const Unit_sphere& S) template void push_back(const CGAL::Sphere_point& p, - CGAL::Color c = CGAL::yellow(), unsigned w = 5) + CGAL::IO::Color c = CGAL::IO::yellow(), unsigned w = 5) { objects_.push_back(new Sphere_point(p,c,w)); } template void push_back(const CGAL::Sphere_segment& s, - CGAL::Color c = CGAL::black(), unsigned w = 1) + CGAL::IO::Color c = CGAL::IO::black(), unsigned w = 1) { objects_.push_back(new Sphere_segment(s,c,w)); } template void push_back(const CGAL::Sphere_circle& s, - CGAL::Color c = CGAL::black(), unsigned w = 1) + CGAL::IO::Color c = CGAL::IO::black(), unsigned w = 1) { objects_.push_back(new Sphere_circle(s,c,w)); } template void push_back(const CGAL::Sphere_triangle& t, - CGAL::Color c = CGAL::white()) + CGAL::IO::Color c = CGAL::IO::white()) { triangles_.push_back(new Sphere_triangle(t,c)); } template void push_back_triangle_edge(const CGAL::Sphere_segment& s, - CGAL::Color c = CGAL::blue(), unsigned w = 1) + CGAL::IO::Color c = CGAL::IO::blue(), unsigned w = 1) { triangle_edges_.push_back(new Sphere_segment(s,c,w)); } void set_style(int style) { diff --git a/Nef_S2/include/CGAL/Nef_S2/Sphere_map.h b/Nef_S2/include/CGAL/Nef_S2/Sphere_map.h index 0ee5d431292..9e2982fd347 100644 --- a/Nef_S2/include/CGAL/Nef_S2/Sphere_map.h +++ b/Nef_S2/include/CGAL/Nef_S2/Sphere_map.h @@ -229,7 +229,7 @@ public: Sphere_map(bool = false) : boundary_item_(boost::none), svertices_(), sedges_(), sfaces_(), shalfloop_() {} - ~Sphere_map() CGAL_NOEXCEPT(CGAL_NO_ASSERTIONS_BOOL) + ~Sphere_map() noexcept(!CGAL_ASSERTIONS_ENABLED) { CGAL_destructor_assertion_catch( clear(); diff --git a/Nef_S2/include/CGAL/Nef_S2/Sphere_segment.h b/Nef_S2/include/CGAL/Nef_S2/Sphere_segment.h index d9404603373..2db237e33dc 100644 --- a/Nef_S2/include/CGAL/Nef_S2/Sphere_segment.h +++ b/Nef_S2/include/CGAL/Nef_S2/Sphere_segment.h @@ -177,7 +177,7 @@ void split_halfcircle(Sphere_segment& s1, Plane_3 h(Point_3(0,0,0),(target()-CGAL::ORIGIN)); Sphere_point p = CGAL::intersection(sphere_circle(),Sphere_circle(h)); - if ( !has_on(p) ) p = p.antipode(); + if ( !has_on_after_intersection(p) ) p = p.antipode(); s1 = Sphere_segment(this->ptr()->ps_,p,this->ptr()->c_); s2 = Sphere_segment(p,this->ptr()->pt_,this->ptr()->c_); } diff --git a/Nef_S2/include/CGAL/Nef_polyhedron_S2.h b/Nef_S2/include/CGAL/Nef_polyhedron_S2.h index 59613249388..7cc81e3800d 100644 --- a/Nef_S2/include/CGAL/Nef_polyhedron_S2.h +++ b/Nef_S2/include/CGAL/Nef_polyhedron_S2.h @@ -73,7 +73,7 @@ class Nef_polyhedron_S2_rep { public: Nef_polyhedron_S2_rep() : sm_() {} Nef_polyhedron_S2_rep(const Self&) : sm_() {} - ~Nef_polyhedron_S2_rep() CGAL_NOEXCEPT(CGAL_NO_ASSERTIONS_BOOL) + ~Nef_polyhedron_S2_rep() noexcept(!CGAL_ASSERTIONS_ENABLED) { CGAL_destructor_assertion_catch( sm_.clear(); diff --git a/Nef_S2/test/Nef_S2/Nef_polyhedron_S2-test.cpp b/Nef_S2/test/Nef_S2/Nef_polyhedron_S2-test.cpp index 55c2823abf6..e429bab74f2 100644 --- a/Nef_S2/test/Nef_S2/Nef_polyhedron_S2-test.cpp +++ b/Nef_S2/test/Nef_S2/Nef_polyhedron_S2-test.cpp @@ -23,7 +23,7 @@ typedef Nef_polyhedron::Object_handle Object_handle; int main(int, char**) { - CGAL::set_pretty_mode ( std::cerr ); + CGAL::IO::set_pretty_mode ( std::cerr ); CGAL_NEF_SETDTHREAD(911); std::cerr << CGAL::sweepversion << std::endl; diff --git a/Nef_S2/test/Nef_S2/Sphere_geometry-test.cpp b/Nef_S2/test/Nef_S2/Sphere_geometry-test.cpp index ea48998ac63..bda03d3f6b4 100644 --- a/Nef_S2/test/Nef_S2/Sphere_geometry-test.cpp +++ b/Nef_S2/test/Nef_S2/Sphere_geometry-test.cpp @@ -21,7 +21,7 @@ typedef CGAL::Plane_3 Plane; int main() { CGAL_TEST_START; - CGAL::set_pretty_mode ( std::cout ); + CGAL::IO::set_pretty_mode ( std::cout ); SPoint p(0,0,1), q(1,1,0), r(1,-1,0), s(1,1,1); SSegment s1(p,q), s2(p,r,false), s3(SPoint(0,-1,0),SPoint(-1,0,0)); SCircle c0, c1(p,q), c2(1,1,1), c3(Plane(1,1,1,0)); diff --git a/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Point_d.h b/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Point_d.h index f21a7f6b4ba..63dd30f2369 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Point_d.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Point_d.h @@ -141,7 +141,7 @@ public: { auto b = p.cartesian_begin(); auto e = p.cartesian_end(); - if(is_ascii(os)) + if(IO::is_ascii(os)) { os << p.dimension(); for(; b != e; ++b){ @@ -162,7 +162,7 @@ public: friend std::istream& operator>>(std::istream &is, Point_d & p) { int dim; - if( is_ascii(is) ) + if( IO::is_ascii(is) ) is >> dim; else { @@ -171,10 +171,10 @@ public: if(!is) return is; std::vector coords(dim); - if(is_ascii(is)) + if(IO::is_ascii(is)) { for(int i=0;i> iformat(coords[i]); + is >> IO::iformat(coords[i]); } else { diff --git a/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Vector_d.h b/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Vector_d.h index de13385758d..3c45a5eecb0 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Vector_d.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Vector_d.h @@ -134,7 +134,7 @@ public: { auto b = v.cartesian_begin(); auto e = v.cartesian_end(); - if(is_ascii(os)) + if(IO::is_ascii(os)) { os << v.dimension(); for(; b != e; ++b){ @@ -155,7 +155,7 @@ public: friend std::istream & operator>>(std::istream &is, Vector_d & v) { int dim; - if( is_ascii(is) ) + if( IO::is_ascii(is) ) is >> dim; else { @@ -164,10 +164,10 @@ public: if(!is) return is; std::vector coords(dim); - if(is_ascii(is)) + if(IO::is_ascii(is)) { for(int i=0;i> iformat(coords[i]); + is >> IO::iformat(coords[i]); } else { diff --git a/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Weighted_point_d.h b/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Weighted_point_d.h index ba88c4e0db7..c3020b65f7c 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Weighted_point_d.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/Wrapper/Weighted_point_d.h @@ -92,7 +92,7 @@ public: template std::ostream& operator<<(std::ostream& os, const Weighted_point_d& p) { - if(is_ascii(os)) + if(IO::is_ascii(os)) { return os << p.point() << ' ' << p.weight(); } @@ -111,9 +111,9 @@ std::istream& operator>>(std::istream& is, Weighted_point_d& p) typedef typename Get_type::type Point_; typedef typename Get_functor >::type CWP; Point_ q; FT_ w; - if(is_ascii(is)) + if(IO::is_ascii(is)) { - if(is >> q >> iformat(w)) p=CWP()(q,w); + if(is >> q >> IO::iformat(w)) p=CWP()(q,w); } else { diff --git a/Number_types/include/CGAL/CORE_BigRat.h b/Number_types/include/CGAL/CORE_BigRat.h index 871f209e42e..0f51dac5663 100644 --- a/Number_types/include/CGAL/CORE_BigRat.h +++ b/Number_types/include/CGAL/CORE_BigRat.h @@ -156,7 +156,7 @@ public: Output_rep( const ::CORE::BigRat& tt) : t(tt) {} //! perform the output, calls \c operator\<\< by default. std::ostream& operator()( std::ostream& out) const { - switch (get_mode(out)) { + switch (IO::get_mode(out)) { case IO::PRETTY:{ if(CGAL_CORE_DENOMINATOR(t) == ::CORE::BigRat(1)) return out < needs_parens_as_product; if (needs_parens_as_product(t)) - return out <<"("<< oformat(t) <<")"; + return out <<"("<< IO::oformat(t) <<")"; else - return out << oformat(t); + return out << IO::oformat(t); } }; diff --git a/Number_types/include/CGAL/Counted_number.h b/Number_types/include/CGAL/Counted_number.h index 68fe0409671..bb3dc060f0e 100644 --- a/Number_types/include/CGAL/Counted_number.h +++ b/Number_types/include/CGAL/Counted_number.h @@ -19,9 +19,9 @@ #define CGAL_COUNTED_NUMBER_H #include -#include #include // for Root_of_selector #include +#include namespace CGAL { @@ -30,7 +30,7 @@ class Counted_number { #ifdef CGAL_NO_ATOMIC static unsigned long #else - static CGAL::cpp11::atomic + static std::atomic #endif s_neg_count, s_add_count, s_sub_count, s_mul_count, s_div_count, @@ -280,64 +280,64 @@ template< class NT > unsigned long Counted_number::s_mod_count = 0; #else template -CGAL::cpp11::atomic Counted_number::s_neg_count; +std::atomic Counted_number::s_neg_count; template -CGAL::cpp11::atomic Counted_number::s_add_count; +std::atomic Counted_number::s_add_count; template -CGAL::cpp11::atomic Counted_number::s_sub_count; +std::atomic Counted_number::s_sub_count; template -CGAL::cpp11::atomic Counted_number::s_mul_count; +std::atomic Counted_number::s_mul_count; template -CGAL::cpp11::atomic Counted_number::s_div_count; +std::atomic Counted_number::s_div_count; template -CGAL::cpp11::atomic Counted_number::s_eq_count; +std::atomic Counted_number::s_eq_count; template -CGAL::cpp11::atomic Counted_number::s_comp_count; +std::atomic Counted_number::s_comp_count; template< class NT > -CGAL::cpp11::atomic Counted_number::s_simplify_count; +std::atomic Counted_number::s_simplify_count; template< class NT > -CGAL::cpp11::atomic Counted_number::s_unit_part_count; +std::atomic Counted_number::s_unit_part_count; template< class NT > -CGAL::cpp11::atomic Counted_number::s_is_zero_count; +std::atomic Counted_number::s_is_zero_count; template< class NT > -CGAL::cpp11::atomic Counted_number::s_is_one_count; +std::atomic Counted_number::s_is_one_count; template< class NT > -CGAL::cpp11::atomic Counted_number::s_square_count; +std::atomic Counted_number::s_square_count; template< class NT > -CGAL::cpp11::atomic Counted_number::s_integral_division_count; +std::atomic Counted_number::s_integral_division_count; template< class NT > -CGAL::cpp11::atomic Counted_number::s_is_square_count; +std::atomic Counted_number::s_is_square_count; template< class NT > -CGAL::cpp11::atomic Counted_number::s_sqrt_count; +std::atomic Counted_number::s_sqrt_count; template< class NT > -CGAL::cpp11::atomic Counted_number::s_kth_root_count; +std::atomic Counted_number::s_kth_root_count; template< class NT > -CGAL::cpp11::atomic Counted_number::s_root_of_count; +std::atomic Counted_number::s_root_of_count; template< class NT > -CGAL::cpp11::atomic Counted_number::s_gcd_count; +std::atomic Counted_number::s_gcd_count; template< class NT > -CGAL::cpp11::atomic Counted_number::s_div_mod_count; +std::atomic Counted_number::s_div_mod_count; template< class NT > -CGAL::cpp11::atomic Counted_number::s_mod_count; +std::atomic Counted_number::s_mod_count; #endif @@ -490,14 +490,14 @@ void Counted_number::report(std::ostream &os) template std::ostream& operator<<(std::ostream &os, Counted_number const &n) { - return os << ::CGAL::oformat( n.rep() )<< std::endl; + return os << ::CGAL::IO::oformat( n.rep() )<< std::endl; } template std::istream& operator>>(std::istream &is, Counted_number &n) { NT num; - is >> ::CGAL::iformat(num); + is >> ::CGAL::IO::iformat(num); if (is) n = Counted_number(num); return is; } diff --git a/Number_types/include/CGAL/GMP/Gmpfr_type.h b/Number_types/include/CGAL/GMP/Gmpfr_type.h index 4d2931fb8d2..33d7108b159 100644 --- a/Number_types/include/CGAL/GMP/Gmpfr_type.h +++ b/Number_types/include/CGAL/GMP/Gmpfr_type.h @@ -1167,7 +1167,7 @@ std::ostream& operator<<(std::ostream& os,const Gmpfr &a){ if(a.is_inf()) return os<<(a<0?"-inf":"+inf"); // The rest of the function was written by George Tzoumas. - if (!is_pretty(os)) { + if (!IO::is_pretty(os)) { std::pair ie=a.to_integer_exp(); os << ie.first << 'e' << ie.second; return os; diff --git a/Number_types/include/CGAL/Interval_nt.h b/Number_types/include/CGAL/Interval_nt.h index 690f1cc4c74..b981657d0fb 100644 --- a/Number_types/include/CGAL/Interval_nt.h +++ b/Number_types/include/CGAL/Interval_nt.h @@ -438,9 +438,9 @@ private: if(c == '['){ // read original output from operator << double inf,sup; CGAL_SWALLOW(is, '[');// read the "[" - is >> iformat(inf); + is >> IO::iformat(inf); CGAL_SWALLOW(is, ';');// read the ";" - is >> iformat(sup); + is >> IO::iformat(sup); CGAL_SWALLOW(is, ']');// read the "]" I = Interval_nt(inf,sup); }else{ //read double (backward compatibility) diff --git a/Number_types/include/CGAL/Mpzf.h b/Number_types/include/CGAL/Mpzf.h index 163da7fa066..60034bb3896 100644 --- a/Number_types/include/CGAL/Mpzf.h +++ b/Number_types/include/CGAL/Mpzf.h @@ -919,8 +919,6 @@ struct Mpzf { Mpzf& operator*=(Mpzf const&x){ *this=*this*x; return *this; } #ifdef CGAL_MPZF_DIVISION_OPERATOR Mpzf& operator/=(Mpzf const&x){ *this=*this/x; return *this; } -#else // not CGAL_MPZF_DIVISION_OPERATOR - Mpzf& operator/=(Mpzf const&x){ *this=division(*this,x); return *this; } #endif // not CGAL_MPZF_DIVISION_OPERATOR bool is_canonical () const { diff --git a/Number_types/include/CGAL/Sqrt_extension/io.h b/Number_types/include/CGAL/Sqrt_extension/io.h index 6a7b593691f..37ac7f7b0f9 100644 --- a/Number_types/include/CGAL/Sqrt_extension/io.h +++ b/Number_types/include/CGAL/Sqrt_extension/io.h @@ -38,15 +38,15 @@ input_ascii(std::istream& is , Sqrt_extension& result){ swallow(is, 'X'); swallow(is, 'T'); swallow(is, '['); - is >> iformat(a0); + is >> IO::iformat(a0); do is.get(c); while (isspace(c)); if (c != ',') CGAL_error_msg( "input error: , expected" ); - is >> iformat(a1); + is >> IO::iformat(a1); do is.get(c); while (isspace(c)); if (c != ',') CGAL_error_msg( "input error: , expected" ); - is >> iformat(root); + is >> IO::iformat(root); do is.get(c); while (isspace(c)); if (c != ']') CGAL_error_msg( "input error: ] expected" ); @@ -61,13 +61,13 @@ input_ascii(std::istream& is , Sqrt_extension& result){ template void output_maple(std::ostream& os, const Sqrt_extension& x){ - CGAL::IO::Mode o_mode=::CGAL::get_mode(os); - ::CGAL::set_mode(os,CGAL::IO::PRETTY); + CGAL::IO::Mode o_mode=::CGAL::IO::get_mode(os); + ::CGAL::IO::set_mode(os,CGAL::IO::PRETTY); if ( x.a0() != NT(0)){ if ( x.a1() != NT(0)){ os << x.a0() - << "+" << CGAL::oformat(x.a1(),CGAL::Parens_as_product_tag()) + << "+" << CGAL::IO::oformat(x.a1(),CGAL::Parens_as_product_tag()) << "*sqrt(" << x.root() << ")"; }else{ os << x.a0(); @@ -75,13 +75,13 @@ output_maple(std::ostream& os, const Sqrt_extension& x) } else{ if (x.a1() != NT(0)){ - os << CGAL::oformat(x.a1(),CGAL::Parens_as_product_tag()) + os << CGAL::IO::oformat(x.a1(),CGAL::Parens_as_product_tag()) << "*sqrt(" << x.root() << ")"; }else{ os << 0; } } - ::CGAL::set_mode(os,o_mode); + ::CGAL::IO::set_mode(os,o_mode); return; } @@ -133,7 +133,7 @@ public: template std::ostream& operator << (std::ostream& os, const Sqrt_extension& ext){ - switch(CGAL::get_mode(os)) { + switch(CGAL::IO::get_mode(os)) { case CGAL::IO::PRETTY: output_maple(os,ext); break; default: @@ -151,7 +151,7 @@ std::ostream& operator << (std::ostream& os, */ template std::istream& operator >> (std::istream& is, Sqrt_extension& ext) { - CGAL_precondition(!CGAL::is_pretty(is)); + CGAL_precondition(!CGAL::IO::is_pretty(is)); input_ascii(is,ext); return is; } diff --git a/Number_types/include/CGAL/leda_rational.h b/Number_types/include/CGAL/leda_rational.h index e520781c132..6b0da89b525 100644 --- a/Number_types/include/CGAL/leda_rational.h +++ b/Number_types/include/CGAL/leda_rational.h @@ -180,7 +180,7 @@ public: Output_rep( const leda_rational& tt) : t(tt) {} //! perform the output, calls \c operator\<\< by default. std::ostream& operator()( std::ostream& out) const { - switch (get_mode(out)) { + switch (IO::get_mode(out)) { case IO::PRETTY:{ if(t.denominator() == leda_integer(1)) return out < needs_parens_as_product; if (needs_parens_as_product(t)) - return out <<"("<< oformat(t) <<")"; + return out <<"("<< IO::oformat(t) <<")"; else - return out << oformat(t); + return out << IO::oformat(t); } }; diff --git a/Number_types/include/CGAL/leda_real.h b/Number_types/include/CGAL/leda_real.h index b05fa068e30..2dd4c458762 100644 --- a/Number_types/include/CGAL/leda_real.h +++ b/Number_types/include/CGAL/leda_real.h @@ -197,8 +197,8 @@ public: Output_rep( const ::leda::real& tt) : t(tt) {} //! perform the output, calls \c operator\<\< by default. std::ostream& operator()( std::ostream& out) const { - if (t<0) out << "(" << ::CGAL::oformat(t)<<")"; - else out << ::CGAL::oformat(t); + if (t<0) out << "(" << ::CGAL::IO::oformat(t)<<")"; + else out << ::CGAL::IO::oformat(t); return out; } }; diff --git a/Number_types/include/CGAL/mpq_class.h b/Number_types/include/CGAL/mpq_class.h index 6250ea95e3a..76611b93cf9 100644 --- a/Number_types/include/CGAL/mpq_class.h +++ b/Number_types/include/CGAL/mpq_class.h @@ -40,7 +40,6 @@ namespace CGAL { - // AST for mpq_class template<> class Algebraic_structure_traits< mpq_class > diff --git a/Number_types/test/Number_types/CORE_BigInt.cpp b/Number_types/test/Number_types/CORE_BigInt.cpp index 98b9dc4e3b1..8cfe816f043 100644 --- a/Number_types/test/Number_types/CORE_BigInt.cpp +++ b/Number_types/test/Number_types/CORE_BigInt.cpp @@ -14,35 +14,35 @@ void test_io(){ // MODE ASCII { std::stringstream ss; - CGAL::set_ascii_mode(ss); - ss << CGAL::oformat(NT(1)); + CGAL::IO::set_ascii_mode(ss); + ss << CGAL::IO::oformat(NT(1)); assert( ss.str() == "1"); }{ std::stringstream ss; - CGAL::set_ascii_mode(ss); - ss << CGAL::oformat(NT(0)); + CGAL::IO::set_ascii_mode(ss); + ss << CGAL::IO::oformat(NT(0)); assert( ss.str() == "0"); }{ std::stringstream ss; - CGAL::set_ascii_mode(ss); - ss << CGAL::oformat(NT(-1)); + CGAL::IO::set_ascii_mode(ss); + ss << CGAL::IO::oformat(NT(-1)); assert( ss.str() == "-1"); } //MODE PRETTY { std::stringstream ss; - CGAL::set_pretty_mode(ss); - ss << CGAL::oformat(NT(1), CGAL::Parens_as_product_tag()); + CGAL::IO::set_pretty_mode(ss); + ss << CGAL::IO::oformat(NT(1), CGAL::Parens_as_product_tag()); assert( ss.str() == "1"); }{ std::stringstream ss; - CGAL::set_pretty_mode(ss); - ss << CGAL::oformat(NT(0),CGAL::Parens_as_product_tag()); + CGAL::IO::set_pretty_mode(ss); + ss << CGAL::IO::oformat(NT(0),CGAL::Parens_as_product_tag()); assert( ss.str() == "0"); }{ std::stringstream ss; - CGAL::set_pretty_mode(ss); - ss << CGAL::oformat(NT(-1), CGAL::Parens_as_product_tag()); + CGAL::IO::set_pretty_mode(ss); + ss << CGAL::IO::oformat(NT(-1), CGAL::Parens_as_product_tag()); assert( ss.str() == "(-1)"); } } diff --git a/Number_types/test/Number_types/CORE_BigRat.cpp b/Number_types/test/Number_types/CORE_BigRat.cpp index e6ea9bdfd1b..60124ec0277 100644 --- a/Number_types/test/Number_types/CORE_BigRat.cpp +++ b/Number_types/test/Number_types/CORE_BigRat.cpp @@ -17,36 +17,36 @@ void test_io(){ // MODE ASCII { std::stringstream ss; - CGAL::set_ascii_mode(ss); - ss << CGAL::oformat(NT(1)); + CGAL::IO::set_ascii_mode(ss); + ss << CGAL::IO::oformat(NT(1)); //std::cout << ss.str()<(); CGAL::test_real_embeddable(); - // assert(CGAL::approximate_sqrt(NT(4)) == NT(2)); + assert(CGAL::approximate_sqrt(NT(4)) == NT(2)); } return 0; diff --git a/Number_types/test/Number_types/Sqrt_extension.h b/Number_types/test/Number_types/Sqrt_extension.h index 5491ab24d56..a1b3da61423 100644 --- a/Number_types/test/Number_types/Sqrt_extension.h +++ b/Number_types/test/Number_types/Sqrt_extension.h @@ -189,95 +189,95 @@ void sqrt_ext_pretty_output_test(){ // TEST without Parens_as_product_tag { std::stringstream ss; - CGAL::set_pretty_mode(ss); + CGAL::IO::set_pretty_mode(ss); ss << EXT1(-1,0,2); assert( ss.str()=="-1"); }{ std::stringstream ss; - CGAL::set_pretty_mode(ss); + CGAL::IO::set_pretty_mode(ss); ss << EXT1(0,0,2); assert( ss.str() == "0"); }{ std::stringstream ss; - CGAL::set_pretty_mode(ss); + CGAL::IO::set_pretty_mode(ss); ss << EXT1(1,0,2); assert( ss.str() == "1"); }{ std::stringstream ss; - CGAL::set_pretty_mode(ss); + CGAL::IO::set_pretty_mode(ss); ss << EXT1(1,2,2); assert( ss.str() == "1+2*sqrt(2)"); }{ std::stringstream ss; - CGAL::set_pretty_mode(ss); + CGAL::IO::set_pretty_mode(ss); ss << EXT1(1,-2,2); assert( ss.str() == "1+(-2)*sqrt(2)"); }{ std::stringstream ss; - CGAL::set_pretty_mode(ss); + CGAL::IO::set_pretty_mode(ss); ss << EXT1(-1,2,2); assert( ss.str() == "-1+2*sqrt(2)"); }{ std::stringstream ss; - CGAL::set_pretty_mode(ss); + CGAL::IO::set_pretty_mode(ss); ss << EXT1(-1,-2,2); assert( ss.str() == "-1+(-2)*sqrt(2)"); }{ std::stringstream ss; - CGAL::set_pretty_mode(ss); + CGAL::IO::set_pretty_mode(ss); ss << EXT1(0,2,2); assert( ss.str()=="2*sqrt(2)"); }{ std::stringstream ss; - CGAL::set_pretty_mode(ss); + CGAL::IO::set_pretty_mode(ss); ss << EXT1(0,-2,2); assert( ss.str()=="(-2)*sqrt(2)"); } // TEST with Parens_as_product_tag { std::stringstream ss; - CGAL::set_pretty_mode(ss); - ss << oformat(EXT1(-1,0,2),CGAL::Parens_as_product_tag()); + CGAL::IO::set_pretty_mode(ss); + ss << CGAL::IO::oformat(EXT1(-1,0,2),CGAL::Parens_as_product_tag()); assert( ss.str()=="(-1)"); }{ std::stringstream ss; - CGAL::set_pretty_mode(ss); - ss << oformat(EXT1(0,0,2),CGAL::Parens_as_product_tag()); + CGAL::IO::set_pretty_mode(ss); + ss << CGAL::IO::oformat(EXT1(0,0,2),CGAL::Parens_as_product_tag()); assert( ss.str() == "0"); }{ std::stringstream ss; - CGAL::set_pretty_mode(ss); - ss << oformat(EXT1(1,0,2),CGAL::Parens_as_product_tag()); + CGAL::IO::set_pretty_mode(ss); + ss << CGAL::IO::oformat(EXT1(1,0,2),CGAL::Parens_as_product_tag()); assert( ss.str() == "1"); }{ std::stringstream ss; - CGAL::set_pretty_mode(ss); - ss << oformat(EXT1(1,2,2),CGAL::Parens_as_product_tag()); + CGAL::IO::set_pretty_mode(ss); + ss << CGAL::IO::oformat(EXT1(1,2,2),CGAL::Parens_as_product_tag()); assert( ss.str() == "(1+2*sqrt(2))"); }{ std::stringstream ss; - CGAL::set_pretty_mode(ss); - ss << oformat(EXT1(1,-2,2),CGAL::Parens_as_product_tag()); + CGAL::IO::set_pretty_mode(ss); + ss << CGAL::IO::oformat(EXT1(1,-2,2),CGAL::Parens_as_product_tag()); assert( ss.str() == "(1+(-2)*sqrt(2))"); }{ std::stringstream ss; - CGAL::set_pretty_mode(ss); - ss << oformat(EXT1(-1,2,2),CGAL::Parens_as_product_tag()); + CGAL::IO::set_pretty_mode(ss); + ss << CGAL::IO::oformat(EXT1(-1,2,2),CGAL::Parens_as_product_tag()); assert( ss.str() == "(-1+2*sqrt(2))"); }{ std::stringstream ss; - CGAL::set_pretty_mode(ss); - ss << oformat(EXT1(-1,-2,2),CGAL::Parens_as_product_tag()); + CGAL::IO::set_pretty_mode(ss); + ss << CGAL::IO::oformat(EXT1(-1,-2,2),CGAL::Parens_as_product_tag()); assert( ss.str() == "(-1+(-2)*sqrt(2))"); }{ std::stringstream ss; - CGAL::set_pretty_mode(ss); - ss << oformat(EXT1(0,2,2),CGAL::Parens_as_product_tag()); + CGAL::IO::set_pretty_mode(ss); + ss << CGAL::IO::oformat(EXT1(0,2,2),CGAL::Parens_as_product_tag()); assert( ss.str()=="2*sqrt(2)"); }{ std::stringstream ss; - CGAL::set_pretty_mode(ss); - ss << oformat(EXT1(0,-2,2),CGAL::Parens_as_product_tag()); + CGAL::IO::set_pretty_mode(ss); + ss << CGAL::IO::oformat(EXT1(0,-2,2),CGAL::Parens_as_product_tag()); assert( ss.str()=="(-2)*sqrt(2)"); } } diff --git a/Number_types/test/Number_types/include/CGAL/_test_io.h b/Number_types/test/Number_types/include/CGAL/_test_io.h index 8fd4e4024e0..12bbcf8a3b0 100644 --- a/Number_types/test/Number_types/include/CGAL/_test_io.h +++ b/Number_types/test/Number_types/include/CGAL/_test_io.h @@ -29,8 +29,8 @@ void test_io(_CT x){ NT a(x); std::stringstream ss; - ss<>CGAL::iformat(a); + ss<>CGAL::IO::iformat(a); assert(a==NT(x)); } @@ -44,8 +44,8 @@ void test_io(){ NT a; std::stringstream ss; - ss<>CGAL::iformat(a); + ss<>CGAL::IO::iformat(a); assert(a==NT()); } @@ -58,8 +58,8 @@ void test_interval_io(_CT x){ NT a(x),b(x); std::stringstream ss; - ss<>CGAL::iformat(a); + ss<>CGAL::IO::iformat(a); assert(a.inf()==b.inf()); assert(a.sup()==b.sup()); } diff --git a/Number_types/test/Number_types/include/CGAL/_test_utilities.h b/Number_types/test/Number_types/include/CGAL/_test_utilities.h index 49a0d8e5224..a53184e65c5 100644 --- a/Number_types/test/Number_types/include/CGAL/_test_utilities.h +++ b/Number_types/test/Number_types/include/CGAL/_test_utilities.h @@ -366,6 +366,10 @@ test_utilities(const NT& x) if (!test_gcd(x,typename AST::Algebraic_category())) return false; if (!test_sqrt(x,typename AST::Sqrt())) return false; + // approximate_sqrt + std::cout << " approximate_sqrt()" << std::endl; + if(NT(CGAL::approximate_sqrt(one)) != one) return false; + return true; } diff --git a/Number_types/test/Number_types/ioformat.cpp b/Number_types/test/Number_types/ioformat.cpp index a483d2f5971..e2d0bf7cda9 100644 --- a/Number_types/test/Number_types/ioformat.cpp +++ b/Number_types/test/Number_types/ioformat.cpp @@ -51,10 +51,10 @@ void test_it(const char* N, int value) NT tmp2(0), tmp1 = static_cast(value); std::ostringstream os; - os << ::CGAL::oformat(tmp1); + os << ::CGAL::IO::oformat(tmp1); std::cout << os.str() << std::endl; std::istringstream is(os.str()); - is >> ::CGAL::iformat(tmp2); + is >> ::CGAL::IO::iformat(tmp2); assert( tmp1 == tmp2 ); } diff --git a/Number_types/test/Number_types/mpq_class.cpp b/Number_types/test/Number_types/mpq_class.cpp index 03d4aaa3d4b..ca215c874c6 100644 --- a/Number_types/test/Number_types/mpq_class.cpp +++ b/Number_types/test/Number_types/mpq_class.cpp @@ -33,7 +33,7 @@ int main() { { mpq_class q; std::istringstream in("12.34"); - in >> CGAL::iformat(q); + in >> CGAL::IO::iformat(q); assert(in); assert(q.get_num() == 617); assert(q.get_den() == 50); diff --git a/Number_types/test/Number_types/utilities.cpp b/Number_types/test/Number_types/utilities.cpp index b4e3e22c81f..f8028bf59d6 100644 --- a/Number_types/test/Number_types/utilities.cpp +++ b/Number_types/test/Number_types/utilities.cpp @@ -1,10 +1,5 @@ #include -// TODO: solve conflict of CORE with GMPXX -#ifdef CGAL_USE_CORE -#undef CGAL_USE_GMPXX -#endif - #include #include #include @@ -77,7 +72,7 @@ int main() TESTIT(long double, "long double") // CGAL number types - //TESTIT(CGAL::MP_Float, "MP_Float") + //TESTIT(CGAL::MP_Float, "MP_Float") // CGAL::div(MP_Float, MP_Float) does not implement _integer_ division TESTIT(CGAL::Quotient, "Quotient") TESTIT(QMPF, "Quotient") TESTIT(CGAL::Lazy_exact_nt, "Lazy_exact_nt >") @@ -129,7 +124,7 @@ int main() // TEST Sqrt_extension #ifdef CGAL_USE_GMP typedef CGAL::Sqrt_extension Ext_int; - TESTIT(Ext_int , "CGAL::Sqrt_extension"); + TESTIT(Ext_int , "CGAL::Sqrt_extension"); typedef CGAL::Sqrt_extension Ext_int_int; TESTIT(Ext_int_int , "CGAL::Sqrt_extension"); typedef CGAL::Sqrt_extension Ext_rat_int; diff --git a/Optimal_bounding_box/benchmark/Optimal_bounding_box/bench_obb.cpp b/Optimal_bounding_box/benchmark/Optimal_bounding_box/bench_obb.cpp index 247cf6435ff..69496827890 100644 --- a/Optimal_bounding_box/benchmark/Optimal_bounding_box/bench_obb.cpp +++ b/Optimal_bounding_box/benchmark/Optimal_bounding_box/bench_obb.cpp @@ -29,7 +29,7 @@ void bench_finding_obb(const std::string filename, std::vector points; std::vector > unused_faces; - CGAL::read_polygon_soup(filename, points, unused_faces); + CGAL::IO::read_polygon_soup(filename, points, unused_faces); std::vector ch_points; std::array obb_points1; diff --git a/Optimal_bounding_box/examples/Optimal_bounding_box/obb_example.cpp b/Optimal_bounding_box/examples/Optimal_bounding_box/obb_example.cpp index 4b786a85ee4..82ef633a101 100644 --- a/Optimal_bounding_box/examples/Optimal_bounding_box/obb_example.cpp +++ b/Optimal_bounding_box/examples/Optimal_bounding_box/obb_example.cpp @@ -23,7 +23,7 @@ int main(int argc, char** argv) const char* filename = (argc > 1) ? argv[1] : "data/pig.off"; Surface_mesh sm; - if(!PMP::read_polygon_mesh(filename, sm) || sm.is_empty()) + if(!PMP::IO::read_polygon_mesh(filename, sm) || sm.is_empty()) { std::cerr << "Invalid input file." << std::endl; return EXIT_FAILURE; diff --git a/Optimal_bounding_box/examples/Optimal_bounding_box/obb_with_point_maps_example.cpp b/Optimal_bounding_box/examples/Optimal_bounding_box/obb_with_point_maps_example.cpp index dd20c5e2095..81ee1fcc328 100644 --- a/Optimal_bounding_box/examples/Optimal_bounding_box/obb_with_point_maps_example.cpp +++ b/Optimal_bounding_box/examples/Optimal_bounding_box/obb_with_point_maps_example.cpp @@ -24,7 +24,7 @@ int main(int argc, char** argv) const char* filename = (argc > 1) ? argv[1] : "data/pig.off"; Surface_mesh sm; - if(!CGAL::Polygon_mesh_processing::read_polygon_mesh(filename, sm) || sm.is_empty()) + if(!CGAL::Polygon_mesh_processing::IO::read_polygon_mesh(filename, sm) || sm.is_empty()) { std::cerr << "Invalid input file." << std::endl; return EXIT_FAILURE; diff --git a/Optimal_bounding_box/examples/Optimal_bounding_box/rotated_aabb_tree_example.cpp b/Optimal_bounding_box/examples/Optimal_bounding_box/rotated_aabb_tree_example.cpp index 176ca6ff53b..53957ff0b03 100644 --- a/Optimal_bounding_box/examples/Optimal_bounding_box/rotated_aabb_tree_example.cpp +++ b/Optimal_bounding_box/examples/Optimal_bounding_box/rotated_aabb_tree_example.cpp @@ -36,7 +36,7 @@ int main(int argc, char** argv) const char* filename = (argc > 1) ? argv[1] : "data/pig.off"; Surface_mesh sm; - if(!CGAL::Polygon_mesh_processing::read_polygon_mesh(filename, sm) || sm.is_empty()) + if(!CGAL::Polygon_mesh_processing::IO::read_polygon_mesh(filename, sm) || sm.is_empty()) { std::cerr << "Invalid input file." << std::endl; return EXIT_FAILURE; diff --git a/Periodic_2_triangulation_2/doc/Periodic_2_triangulation_2/Periodic_2_triangulation_2.txt b/Periodic_2_triangulation_2/doc/Periodic_2_triangulation_2/Periodic_2_triangulation_2.txt index 93c54224799..f33b9862f3c 100644 --- a/Periodic_2_triangulation_2/doc/Periodic_2_triangulation_2/Periodic_2_triangulation_2.txt +++ b/Periodic_2_triangulation_2/doc/Periodic_2_triangulation_2/Periodic_2_triangulation_2.txt @@ -309,7 +309,7 @@ the `TriangulationDataStructure_2` (e.g. a `Vertex_handle` or `Face_handle`), he can use the `Triangulation_vertex_base_with_info_2` class to add his own information easily in the vertices. The example below shows how to -add a `CGAL::Color` this way. +add a `CGAL::IO::Color` this way. \cgalExample{Periodic_2_triangulation_2/p2t2_colored_vertices.cpp} diff --git a/Periodic_2_triangulation_2/examples/Periodic_2_triangulation_2/p2t2_colored_vertices.cpp b/Periodic_2_triangulation_2/examples/Periodic_2_triangulation_2/p2t2_colored_vertices.cpp index aeed55bfdd3..fdf8a5ac45f 100644 --- a/Periodic_2_triangulation_2/examples/Periodic_2_triangulation_2/p2t2_colored_vertices.cpp +++ b/Periodic_2_triangulation_2/examples/Periodic_2_triangulation_2/p2t2_colored_vertices.cpp @@ -9,7 +9,7 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef CGAL::Periodic_2_Delaunay_triangulation_traits_2 GT; typedef CGAL::Periodic_2_triangulation_vertex_base_2 Vb; -typedef CGAL::Triangulation_vertex_base_with_info_2 VbInfo; +typedef CGAL::Triangulation_vertex_base_with_info_2 VbInfo; typedef CGAL::Periodic_2_triangulation_face_base_2 Fb; @@ -32,7 +32,7 @@ int main() PDT::Vertex_iterator vit; for (vit = T.vertices_begin(); vit != T.vertices_end(); ++vit) if (T.degree(vit) == 6) - vit->info() = CGAL::red(); + vit->info() = CGAL::IO::red(); return 0; } diff --git a/Periodic_2_triangulation_2/include/CGAL/Periodic_2_offset_2.h b/Periodic_2_triangulation_2/include/CGAL/Periodic_2_offset_2.h index c97034bb790..574fd1d31ec 100644 --- a/Periodic_2_triangulation_2/include/CGAL/Periodic_2_offset_2.h +++ b/Periodic_2_triangulation_2/include/CGAL/Periodic_2_offset_2.h @@ -146,7 +146,7 @@ inline typename K::Point_2 operator+(const typename K::Point_2 &p, const Periodi inline std::ostream &operator<<(std::ostream &os, const Periodic_2_offset_2 &off) { - if (is_ascii(os)) + if (IO::is_ascii(os)) os << off.x() << " " << off.y(); else { @@ -161,7 +161,7 @@ inline std::istream &operator>>(std::istream &is, Periodic_2_offset_2 &off) { int x = 0, y = 0; - if (is_ascii(is)) + if (IO::is_ascii(is)) is >> x >> y; else { diff --git a/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_2.h b/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_2.h index ef8a5d063f9..542fcb98d3d 100644 --- a/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_2.h +++ b/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_2.h @@ -4145,7 +4145,7 @@ Periodic_2_triangulation_2::save(std::ostream& os) const size_type n = number_of_vertices(); - if (is_ascii(os)) + if (IO::is_ascii(os)) os << domain() << std::endl << cover[0] << " " << cover[1] << std::endl << n*cover[0]*cover[1] << std::endl; @@ -4172,7 +4172,7 @@ Periodic_2_triangulation_2::save(std::ostream& os) const { V[it] = i++; os << it->point(); - if (is_ascii(os)) + if (IO::is_ascii(os)) os << std::endl; } } @@ -4185,7 +4185,7 @@ Periodic_2_triangulation_2::save(std::ostream& os) const vit = _virtual_vertices.find(it); if (vit != _virtual_vertices.end()) continue; V[it] = i++; - if (is_ascii(os)) + if (IO::is_ascii(os)) os << it->point() << std::endl << Offset(0, 0) << std::endl; else @@ -4199,7 +4199,7 @@ Periodic_2_triangulation_2::save(std::ostream& os) const vvit = _virtual_vertices.find(vv[j]); CGAL_triangulation_assertion(vvit != _virtual_vertices.end()); V[vv[j]] = i++; - if (is_ascii(os)) + if (IO::is_ascii(os)) os << vv[j]->point() << std::endl << vvit->second.second << std::endl; else os << vv[j]->point() << vvit->second.second; @@ -4213,7 +4213,7 @@ Periodic_2_triangulation_2::save(std::ostream& os) const // asks the tds for the combinatorial information // vertices of the faces size_type m = _tds.number_of_faces(); - if (is_ascii(os)) os << std::endl << m << std::endl; + if (IO::is_ascii(os)) os << std::endl << m << std::endl; else write(os, m); std::cout << "save, #Faces: " << m << std::endl; @@ -4223,13 +4223,13 @@ Periodic_2_triangulation_2::save(std::ostream& os) const F[ib] = inum++; for(int j = 0; j < 3 ; ++j) { - if(is_ascii(os)) os << V[ib->vertex(j)] << " "; + if(IO::is_ascii(os)) os << V[ib->vertex(j)] << " "; else write(os, V[ib->vertex(j)]); } os << *ib ; - if(is_ascii(os)) os << "\n"; + if(IO::is_ascii(os)) os << "\n"; } - if(is_ascii(os)) os << "\n"; + if(IO::is_ascii(os)) os << "\n"; std::cout << "save, face check: " << inum << " == " << m << std::endl; CGAL_assertion(m == (size_type)inum); @@ -4241,10 +4241,10 @@ Periodic_2_triangulation_2::save(std::ostream& os) const for(int j = 0; j < 3; ++j) { CGAL_assertion(F.is_defined(it->neighbor(j))); - if(is_ascii(os)) os << F[it->neighbor(j)] << " "; + if(IO::is_ascii(os)) os << F[it->neighbor(j)] << " "; else write(os, F[it->neighbor(j)]); } - if(is_ascii(os)) os << "\n"; + if(IO::is_ascii(os)) os << "\n"; } // write offsets @@ -4255,7 +4255,7 @@ Periodic_2_triangulation_2::save(std::ostream& os) const Face_handle ch(it); for (int j = 0; j < 3; j++) { - if(is_ascii(os)) + if(IO::is_ascii(os)) { os << ch->offset(j); if ( j == 3 ) @@ -4276,7 +4276,7 @@ Periodic_2_triangulation_2::save(std::ostream& os) const for(Face_iterator it = faces_begin(); it != faces_end(); ++it) { os << *it; // other information - if(is_ascii(os)) + if(IO::is_ascii(os)) os << std::endl; } } @@ -4307,7 +4307,7 @@ Periodic_2_triangulation_2::load(std::istream& is) int cx = 0, cy = 0; size_type n = 0; - if (is_ascii(is)) + if (IO::is_ascii(is)) { is >> domain; is >> cx >> cy >> n; @@ -4372,7 +4372,7 @@ Periodic_2_triangulation_2::load(std::istream& is) // Creation of the faces std::size_t index; size_type m; - if (is_ascii(is)) is >> m; + if (IO::is_ascii(is)) is >> m; else read(is, m); std::vector F(m); std::cout << "load, #Faces: " << m << std::endl; @@ -4382,7 +4382,7 @@ Periodic_2_triangulation_2::load(std::istream& is) F[i] = _tds.create_face() ; for(int j = 0; j < 3 ; ++j) { - if (is_ascii(is)) is >> index; + if (IO::is_ascii(is)) is >> index; else read(is, index); CGAL_assertion(index < V.size()); F[i]->set_vertex(j, V[index]); @@ -4401,7 +4401,7 @@ Periodic_2_triangulation_2::load(std::istream& is) { for(int j = 0; j < 3; ++j) { - if (is_ascii(is)) is >> index; + if (IO::is_ascii(is)) is >> index; else read(is, index); if (index >= F.size()) { std::cout << __FILE__ << ", " << __FUNCTION__ << ", l:" << __LINE__ << " f=" @@ -4419,7 +4419,7 @@ Periodic_2_triangulation_2::load(std::istream& is) int off[3] = {0, 0, 0}; for (std::size_t j = 0 ; j < m; j++) { - if (is_ascii(is)) + if (IO::is_ascii(is)) is >> off[0] >> off[1] >> off[2]; else { diff --git a/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h b/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h index e4859ea033f..fe0a13cf13a 100644 --- a/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h +++ b/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h @@ -26,11 +26,11 @@ namespace CGAL { // Default color functor; user can change it to have its own face color struct DefaultColorFunctorP2T2 { template - static CGAL::Color run(const P2T2 &, + static CGAL::IO::Color run(const P2T2 &, const typename P2T2::Periodic_triangle_iterator /*ti*/) { //CGAL::Random random((unsigned int)(std::size_t)(&*ti)); //return get_random_color(random); - return CGAL::Color(73, 250, 117); + return CGAL::IO::Color(73, 250, 117); } }; @@ -107,7 +107,7 @@ protected: // Construct the triangle in 9-sheeted covering space and add to viewer Triangle t(p2t2.triangle(*ti)); - CGAL::Color c=m_fcolor.run(p2t2, ti); + CGAL::IO::Color c=m_fcolor.run(p2t2, ti); face_begin(c); add_point_in_face(t[0]); add_point_in_face(t[1]); @@ -116,9 +116,9 @@ protected: // Display the edges of the faces as segments with a // light gray color for better visualization - add_segment(t[0], t[1], CGAL::Color(207, 213, 211)); - add_segment(t[1], t[2], CGAL::Color(207, 213, 211)); - add_segment(t[2], t[0], CGAL::Color(207, 213, 211)); + add_segment(t[0], t[1], CGAL::IO::Color(207, 213, 211)); + add_segment(t[1], t[2], CGAL::IO::Color(207, 213, 211)); + add_segment(t[2], t[0], CGAL::IO::Color(207, 213, 211)); } void compute_domain() @@ -135,10 +135,10 @@ protected: Kernel::Point_2 p3(orig_domain.xmax(), orig_domain.ymin()); Kernel::Point_2 p4((orig_domain.max)()); - add_segment(p1 + shift, p2 + shift, CGAL::Color(96, 104, 252)); - add_segment(p1 + shift, p3 + shift, CGAL::Color(96, 104, 252)); - add_segment(p2 + shift, p4 + shift, CGAL::Color(96, 104, 252)); - add_segment(p3 + shift, p4 + shift, CGAL::Color(96, 104, 252)); + add_segment(p1 + shift, p2 + shift, CGAL::IO::Color(96, 104, 252)); + add_segment(p1 + shift, p3 + shift, CGAL::IO::Color(96, 104, 252)); + add_segment(p2 + shift, p4 + shift, CGAL::IO::Color(96, 104, 252)); + add_segment(p3 + shift, p4 + shift, CGAL::IO::Color(96, 104, 252)); } } } diff --git a/Periodic_2_triangulation_2/test/Periodic_2_triangulation_2/include/interface_test.h b/Periodic_2_triangulation_2/test/Periodic_2_triangulation_2/include/interface_test.h index 4975d0456b6..30cae39bae1 100644 --- a/Periodic_2_triangulation_2/test/Periodic_2_triangulation_2/include/interface_test.h +++ b/Periodic_2_triangulation_2/test/Periodic_2_triangulation_2/include/interface_test.h @@ -496,7 +496,7 @@ void test_io(T &pt1, bool ex) T pt1r; ss1 >> pt1r; - assert(CGAL::is_ascii(ss1)); + assert(CGAL::IO::is_ascii(ss1)); if (!ex) { assert(pt1 == pt1r); @@ -508,11 +508,11 @@ void test_io(T &pt1, bool ex) if (!ex) { std::stringstream ss1b; - CGAL::set_binary_mode(ss1b); + CGAL::IO::set_binary_mode(ss1b); ss1b << pt1; ss1b >> pt1r; - assert(CGAL::is_binary(ss1b)); + assert(CGAL::IO::is_binary(ss1b)); assert(pt1 == pt1r); } @@ -521,10 +521,10 @@ void test_io(T &pt1, bool ex) pt1r.clear(); std::stringstream ss1p; - CGAL::set_pretty_mode(ss1p); + CGAL::IO::set_pretty_mode(ss1p); ss1p << pt1; - assert(CGAL::is_pretty(ss1p)); + assert(CGAL::IO::is_pretty(ss1p)); } template diff --git a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/PackageDescription.txt b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/PackageDescription.txt index 8add9262b9b..4de34cd9b43 100644 --- a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/PackageDescription.txt +++ b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/PackageDescription.txt @@ -101,6 +101,6 @@ Many classes and functions used by this package are defined within the package and \ref PkgMesh3Parameters. \cgalCRPSection{Input/Output Functions} -- \link PkgPeriodic3Mesh3IOFunctions `CGAL::output_periodic_mesh_to_medit()` \endlink +- \link PkgPeriodic3Mesh3IOFunctions `CGAL::IO::output_periodic_mesh_to_medit()` \endlink */ diff --git a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/Periodic_3_mesh_3.txt b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/Periodic_3_mesh_3.txt index 1996212d4c9..5d1380e5950 100644 --- a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/Periodic_3_mesh_3.txt +++ b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/Periodic_3_mesh_3.txt @@ -416,7 +416,7 @@ This section presents various use cases of the periodic mesh generator. \subsection Periodic_3_mesh_3SubMultipleCopies Visualizing Multiple Copies of a Periodic Mesh Generated meshes can be output to the `.mesh` file format, which can be visualized with the demo -of the package \ref PkgPolyhedron. The function \link PkgPeriodic3Mesh3IOFunctions `CGAL::output_periodic_mesh_to_medit()` \endlink +of the package \ref PkgPolyhedron. The function \link PkgPeriodic3Mesh3IOFunctions `CGAL::IO::output_periodic_mesh_to_medit()` \endlink takes a stream, a mesh complex, and - optionally - the number of periodic copies that should be drawn, making it easier to observe the periodicity of the result. \cgalFigureRef{Periodic_3_mesh_3Periodic_copies} illustrates the different output diff --git a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_multi_domain.cpp b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_multi_domain.cpp index 40ca5720f0c..0b57091170c 100644 --- a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_multi_domain.cpp +++ b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_multi_domain.cpp @@ -89,9 +89,9 @@ int main(int argc, char** argv) // Output std::ofstream medit_file("output_multi_domain.mesh"); - CGAL::output_periodic_mesh_to_medit(medit_file, c3t3, number_of_copies_in_output, - false /*do not associate different colors to each copy*/, - false /*do not rebind*/, true /*show patches*/); + CGAL::IO::output_periodic_mesh_to_medit(medit_file, c3t3, number_of_copies_in_output, + false /*do not associate different colors to each copy*/, + false /*do not rebind*/, true /*show patches*/); std::cout << "EXIT SUCCESS" << std::endl; return 0; diff --git a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape.cpp b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape.cpp index 2e74bc44c0b..9c39c8758e3 100644 --- a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape.cpp +++ b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape.cpp @@ -67,7 +67,7 @@ int main(int argc, char** argv) C3t3 c3t3 = CGAL::make_periodic_3_mesh_3(domain, criteria); std::ofstream medit_file("output_implicit_shape.mesh"); - CGAL::output_periodic_mesh_to_medit(medit_file, c3t3, number_of_copies_in_output); + CGAL::IO::output_periodic_mesh_to_medit(medit_file, c3t3, number_of_copies_in_output); std::cout << "EXIT SUCCESS" << std::endl; return 0; diff --git a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_features.cpp b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_features.cpp index 6a0ceed004a..680b0153c95 100644 --- a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_features.cpp +++ b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_features.cpp @@ -111,13 +111,13 @@ int main(int argc, char** argv) C3t3 c3t3 = CGAL::make_periodic_3_mesh_3(domain, criteria, no_features(), no_exude(), no_perturb()); std::ofstream medit_file("output_implicit_shape_without_protection.mesh"); - CGAL::output_periodic_mesh_to_medit(medit_file, c3t3, number_of_copies_in_output); + CGAL::IO::output_periodic_mesh_to_medit(medit_file, c3t3, number_of_copies_in_output); // Mesh generation WITH feature preservation (and no optimizers) C3t3 c3t3_bis = CGAL::make_periodic_3_mesh_3(domain, criteria, features(), no_exude(), no_perturb()); std::ofstream medit_file_bis("output_implicit_shape_with_protection.mesh"); - CGAL::output_periodic_mesh_to_medit(medit_file_bis, c3t3_bis, number_of_copies_in_output); + CGAL::IO::output_periodic_mesh_to_medit(medit_file_bis, c3t3_bis, number_of_copies_in_output); std::cout << "EXIT SUCCESS" << std::endl; return 0; diff --git a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_optimizers.cpp b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_optimizers.cpp index 1bf84816848..3d2c42a4c4e 100644 --- a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_optimizers.cpp +++ b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_optimizers.cpp @@ -76,7 +76,7 @@ int main(int argc, char** argv) exude(sliver_bound=10, time_limit=0)); std::ofstream medit_file("output_implicit_shape_optimized.mesh"); - CGAL::output_periodic_mesh_to_medit(medit_file, c3t3); + CGAL::IO::output_periodic_mesh_to_medit(medit_file, c3t3); // Below, the mesh generation and the optimizations are done in several calls C3t3 c3t3_bis = CGAL::make_periodic_3_mesh_3(domain, criteria, @@ -84,7 +84,7 @@ int main(int argc, char** argv) no_perturb(), no_exude()); std::ofstream medit_file_bis("output_implicit_shape_non-optimized.mesh"); - CGAL::output_periodic_mesh_to_medit(medit_file_bis, c3t3_bis); + CGAL::IO::output_periodic_mesh_to_medit(medit_file_bis, c3t3_bis); // Now, call each optimizer with its global function CGAL::odt_optimize_periodic_3_mesh_3(c3t3_bis, domain, convergence=0.03, freeze_bound=0.02, time_limit=30); @@ -93,7 +93,7 @@ int main(int argc, char** argv) CGAL::exude_periodic_3_mesh_3(c3t3_bis, sliver_bound=10, time_limit=0); std::ofstream medit_file_ter("output_implicit_shape_two_steps.mesh"); - CGAL::output_periodic_mesh_to_medit(medit_file_ter, c3t3_bis, number_of_copies_in_output); + CGAL::IO::output_periodic_mesh_to_medit(medit_file_ter, c3t3_bis, number_of_copies_in_output); std::cout << "EXIT SUCCESS" << std::endl; return 0; diff --git a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_subdomains.cpp b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_subdomains.cpp index 4d6c01aff53..8de56fad9a7 100644 --- a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_subdomains.cpp +++ b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/mesh_implicit_shape_with_subdomains.cpp @@ -78,7 +78,7 @@ int main(int argc, char** argv) // Output std::ofstream medit_file("output_implicit_with_subdomains.mesh"); - CGAL::output_periodic_mesh_to_medit(medit_file, c3t3, number_of_copies_in_output); + CGAL::IO::output_periodic_mesh_to_medit(medit_file, c3t3, number_of_copies_in_output); std::cout << "EXIT SUCCESS" << std::endl; return 0; diff --git a/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_3/IO/File_medit.h b/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_3/IO/File_medit.h index 63c2b6bb934..dda69561ff2 100644 --- a/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_3/IO/File_medit.h +++ b/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_3/IO/File_medit.h @@ -330,6 +330,8 @@ void output_to_medit(std::ostream& os, } // namespace Periodic_3_mesh_3 +namespace IO { + /** * \brief outputs a periodic mesh to the .mesh file format, which can be visualized * using medit. By default, 7 copies are used, for a total of 8 instances of the domains. @@ -367,6 +369,12 @@ void output_periodic_mesh_to_medit(std::ostream& os, } } +} // namespace IO + +#ifndef CGAL_NO_DEPRECATED_CODE +using IO::output_periodic_mesh_to_medit; +#endif + } // namespace CGAL #endif // CGAL_PERIODIC_3_MESH_3_IO_FILE_MEDIT_H diff --git a/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_3/Protect_edges_sizing_field.h b/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_3/Protect_edges_sizing_field.h index 8b0f3b1fb6c..842abf61081 100644 --- a/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_3/Protect_edges_sizing_field.h +++ b/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_3/Protect_edges_sizing_field.h @@ -756,7 +756,7 @@ get_positions_with_vertex_at_extremity(const Bare_point& known_point, { #if CGAL_MESH_3_PROTECTION_DEBUG & 2 std::cerr << "get_positions_with_vertex_at_extremity()" << std::endl - << "known_point: " << known_point << " on curve " << CGAL::oformat(curve_index) + << "known_point: " << known_point << " on curve " << CGAL::IO::oformat(curve_index) << " orientation: " << orientation << " inverted order ? " << std::boolalpha << inverted_return_order << std::endl; #endif @@ -1391,7 +1391,7 @@ insert_corners() Index p_index = domain_.index_from_corner_index(corner_index); #if CGAL_MESH_3_PROTECTION_DEBUG & 1 - std::cerr << "** treat corner #" << CGAL::oformat(p_index) << std::endl; + std::cerr << "** treat corner #" << CGAL::IO::oformat(p_index) << std::endl; #endif // Get weight (the ball radius is given by the 'query_size' function) @@ -1476,7 +1476,7 @@ insert_point(const Bare_point& p, const Weight& w, int dim, const Index& index, #if CGAL_MESH_3_PROTECTION_DEBUG & 1 std::cerr << "insert_point()" << std::endl; std::cerr << "pos: " << p << " weight: " << w - << " dim: " << dim << " index: " << CGAL::oformat(index) << std::endl; + << " dim: " << dim << " index: " << CGAL::IO::oformat(index) << std::endl; #endif using CGAL::Mesh_3::internal::weight_modifier; @@ -1540,7 +1540,7 @@ insert_point(const Bare_point& p, const Weight& w, int dim, const Index& index, std::cerr << " ERROR dim=" << dim << " index="; } - std::cerr << CGAL::oformat(index) << std::endl; + std::cerr << CGAL::IO::oformat(index) << std::endl; if(v == Vertex_handle()) std::cerr << " HIDDEN!\n"; std::cerr << "The weight was " << w << std::endl; @@ -1569,7 +1569,7 @@ smart_insert_point(const Bare_point& p, Weight w, int dim, const Index& index, std::cerr << "smart_insert_point((" << p << "), w=" << w << ", dim=" << dim - << ", index=" << CGAL::oformat(index) << ")\n"; + << ", index=" << CGAL::IO::oformat(index) << ")\n"; #endif const Tr& tr = c3t3_.triangulation(); @@ -2267,7 +2267,7 @@ refine_balls() std::ostringstream oss; oss << "dump_protecting_balls_" << refine_balls_iteration_nb << ".cgal"; std::ofstream outfile(oss.str().c_str(), std::ios_base::binary | std::ios_base::out); - CGAL::Mesh_3::save_binary_file(outfile, c3t3_, true); + CGAL::IO::save_binary_file(outfile, c3t3_, true); outfile.close(); #endif //CGAL_MESH_3_DUMP_FEATURES_PROTECTION_ITERATIONS @@ -2452,7 +2452,7 @@ change_ball_size(Vertex_handle& v, const FT squared_size, const bool special_bal #if CGAL_MESH_3_PROTECTION_DEBUG & 1 std::cerr << "change_ball_size(v=" << disp_vert(v) << " dim=" << c3t3_.in_dimension(v) - << " index=" << CGAL::oformat(c3t3_.index(v)) + << " index=" << CGAL::IO::oformat(c3t3_.index(v)) << " ,\n" << " (squared) size=" << w << ", special_ball=" << std::boolalpha << special_ball << std::endl; @@ -2622,7 +2622,7 @@ check_and_fix_vertex_along_edge(const Vertex_handle& v, ErasedVeOutIt out) std::cerr << "check_and_fix_vertex_along_edge(" << disp_vert(v) << " dim=" << get_dimension(v) - << " index=" << CGAL::oformat(c3t3_.index(v)) + << " index=" << CGAL::IO::oformat(c3t3_.index(v)) << " special=" << std::boolalpha << is_special(v) << ")\n"; #endif @@ -2930,7 +2930,7 @@ repopulate(InputIterator begin, InputIterator last, std::cerr << "repopulate(begin=" << disp_vert(*begin) << "\n" << " last=" << disp_vert(*last) << "\n" << " distance(begin, last)=" << std::distance(begin, last) << ",\n" - << " curve_index=" << CGAL::oformat(curve_index) << ",\n" + << " curve_index=" << CGAL::IO::oformat(curve_index) << ",\n" << " orientation=" << orientation << ")\n"; #endif CGAL_assertion(std::distance(begin,last) >= 0); @@ -2972,7 +2972,7 @@ repopulate(InputIterator begin, InputIterator last, default: std::cerr << " ERROR dim=" << get_dimension(*current) << " curve_index="; } - std::cerr << CGAL::oformat(c3t3_.index(*current)) << std::endl; + std::cerr << CGAL::IO::oformat(c3t3_.index(*current)) << std::endl; #endif // CGAL_MESH_3_PROTECTION_DEBUG *out++ = *current; remove_from_correspondence_map(*current, curve_index); @@ -2997,7 +2997,7 @@ analyze_and_repopulate(InputIterator begin, InputIterator last, std::cerr << "analyze_and_repopulate(begin=" << disp_vert(*begin) << "\n" << " last=" << disp_vert(*last) << "\n" << " distance(begin, last)=" << std::distance(begin, last) << ",\n" - << " curve_index=" << CGAL::oformat(curve_index) << ",\n" + << " curve_index=" << CGAL::IO::oformat(curve_index) << ",\n" << " orientation=" << orientation << ")\n"; #endif CGAL_assertion(std::distance(begin,last) >= 0); diff --git a/Periodic_3_mesh_3/test/Periodic_3_mesh_3/test_implicit_shapes_bunch.cpp b/Periodic_3_mesh_3/test/Periodic_3_mesh_3/test_implicit_shapes_bunch.cpp index 2609fdfc15a..b39838e6dc7 100644 --- a/Periodic_3_mesh_3/test/Periodic_3_mesh_3/test_implicit_shapes_bunch.cpp +++ b/Periodic_3_mesh_3/test/Periodic_3_mesh_3/test_implicit_shapes_bunch.cpp @@ -244,7 +244,7 @@ int main() // Output std::ofstream medit_file(file_name.c_str()); - CGAL::output_periodic_mesh_to_medit(medit_file, c3t3); + CGAL::IO::output_periodic_mesh_to_medit(medit_file, c3t3); } std::cout << "EXIT SUCCESS" << std::endl; diff --git a/Periodic_3_mesh_3/test/Periodic_3_mesh_3/test_implicit_shapes_with_features.cpp b/Periodic_3_mesh_3/test/Periodic_3_mesh_3/test_implicit_shapes_with_features.cpp index 4025ca277bb..2a297d3f89b 100644 --- a/Periodic_3_mesh_3/test/Periodic_3_mesh_3/test_implicit_shapes_with_features.cpp +++ b/Periodic_3_mesh_3/test/Periodic_3_mesh_3/test_implicit_shapes_with_features.cpp @@ -98,7 +98,7 @@ void test_protected_sphere() // Output std::ofstream medit_file_bis("protected_sphere.mesh"); - CGAL::output_periodic_mesh_to_medit(medit_file_bis, c3t3_bis); + CGAL::IO::output_periodic_mesh_to_medit(medit_file_bis, c3t3_bis); } //////////////////////////////////////////////////////////////////////////////// @@ -163,7 +163,7 @@ void test_protected_squary_cylinder() // Output std::ofstream medit_file_bis("squary_cylinder.mesh"); - CGAL::output_periodic_mesh_to_medit(medit_file_bis, c3t3_bis); + CGAL::IO::output_periodic_mesh_to_medit(medit_file_bis, c3t3_bis); } //////////////////////////////////////////////////////////////////////////////// @@ -276,7 +276,7 @@ void test_protected_squary_cylinder_2() // Output std::ofstream medit_file_bis("squary_cylinder_2.mesh"); - CGAL::output_periodic_mesh_to_medit(medit_file_bis, c3t3_bis); + CGAL::IO::output_periodic_mesh_to_medit(medit_file_bis, c3t3_bis); } //////////////////////////////////////////////////////////////////////////////// diff --git a/Periodic_3_mesh_3/test/Periodic_3_mesh_3/test_triply_periodic_minimal_surfaces.cpp b/Periodic_3_mesh_3/test/Periodic_3_mesh_3/test_triply_periodic_minimal_surfaces.cpp index 812fde428ba..cab19a02eda 100644 --- a/Periodic_3_mesh_3/test/Periodic_3_mesh_3/test_triply_periodic_minimal_surfaces.cpp +++ b/Periodic_3_mesh_3/test/Periodic_3_mesh_3/test_triply_periodic_minimal_surfaces.cpp @@ -305,7 +305,7 @@ int main(int, char**) oss_2 << iter->first << "__" << it->first << "__" << *i << ".mesh"; std::string output_filename = oss_2.str(); std::ofstream medit_file( output_filename.data() ); - CGAL::output_periodic_mesh_to_medit(medit_file, c3t3, *i); + CGAL::IO::output_periodic_mesh_to_medit(medit_file, c3t3, *i); medit_file.close(); std::cout << ", " << *i << "-copy Saved" << std::flush; diff --git a/Periodic_3_triangulation_3/examples/Periodic_3_triangulation_3/README b/Periodic_3_triangulation_3/examples/Periodic_3_triangulation_3/README index 3396740a56e..82227c8a755 100644 --- a/Periodic_3_triangulation_3/examples/Periodic_3_triangulation_3/README +++ b/Periodic_3_triangulation_3/examples/Periodic_3_triangulation_3/README @@ -13,7 +13,7 @@ class for the triangulation data structure. If the user does not need to add a type in a vertex that depends on the TriangulationDataStructure_3 (e.g. a Vertex_handle or Cell_handle), then he can use the Triangulation_vertex_base_with_info_3 class to add his own information -easily in the vertices. This example shows how to add a CGAL::Color this way. +easily in the vertices. This example shows how to add a CGAL::IO::Color this way. ------------------------------------------------------------------------------- diff --git a/Periodic_3_triangulation_3/examples/Periodic_3_triangulation_3/colored_vertices.cpp b/Periodic_3_triangulation_3/examples/Periodic_3_triangulation_3/colored_vertices.cpp index 989b702679a..73afbf028eb 100644 --- a/Periodic_3_triangulation_3/examples/Periodic_3_triangulation_3/colored_vertices.cpp +++ b/Periodic_3_triangulation_3/examples/Periodic_3_triangulation_3/colored_vertices.cpp @@ -15,7 +15,7 @@ typedef CGAL::Triangulation_vertex_base_3 Vb; typedef CGAL::Periodic_3_triangulation_ds_cell_base_3<> CbDS; typedef CGAL::Triangulation_cell_base_3 Cb; -typedef CGAL::Triangulation_vertex_base_with_info_3 VbInfo; +typedef CGAL::Triangulation_vertex_base_with_info_3 VbInfo; typedef CGAL::Triangulation_data_structure_3 TDS; typedef CGAL::Periodic_3_Delaunay_triangulation_3 P3DT3; @@ -36,7 +36,7 @@ int main(int, char**) P3DT3::Vertex_iterator vit; for (vit = T.vertices_begin(); vit != T.vertices_end(); ++vit) { if (T.degree(vit) == 16) { - vit->info() = CGAL::red(); + vit->info() = CGAL::IO::red(); } } diff --git a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_offset_3.h b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_offset_3.h index ed1560c74c3..ca7124d8688 100644 --- a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_offset_3.h +++ b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_offset_3.h @@ -108,7 +108,7 @@ inline Point_3 operator+(const Point_3 &p, const Periodic_3_offset_3 &off) inline std::ostream &operator<<(std::ostream &os, const Periodic_3_offset_3 &off) { - if (is_ascii(os)) + if (IO::is_ascii(os)) os << off.x() << " " << off.y() << " " << off.z(); else { write(os,off.x()); @@ -121,7 +121,7 @@ inline std::ostream inline std::istream &operator>>(std::istream &is, Periodic_3_offset_3 &off) { int x=0,y=0,z=0; - if (is_ascii(is)) + if (IO::is_ascii(is)) is >> x >> y >> z; else { read(is,x); diff --git a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3.h b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3.h index 380e9b70f86..01661657268 100644 --- a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3.h +++ b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3.h @@ -22,7 +22,6 @@ #include #include -#include #include #include #include @@ -4023,7 +4022,7 @@ operator>> (std::istream& is, Periodic_3_triangulation_3& tr) int cx=0, cy=0, cz=0; size_type n=0; - if(is_ascii(is)) { + if(IO::is_ascii(is)) { is >> domain; is >> cx >> cy >> cz; is >> n; @@ -4079,7 +4078,7 @@ operator>> (std::istream& is, Periodic_3_triangulation_3& tr) // read offsets int off[4] = {0,0,0,0}; for(std::size_t j=0; j < m; j++) { - if(is_ascii(is)) + if(IO::is_ascii(is)) is >> off[0] >> off[1] >> off[2] >> off[3]; else { read(is,off[0]); @@ -4130,7 +4129,7 @@ operator<< (std::ostream& os,const Periodic_3_triangulation_3& tr) Covering_sheets cover = tr.number_of_sheets(); size_type n = tr.number_of_vertices(); - if(is_ascii(os)) + if(IO::is_ascii(os)) os << domain << std::endl << cover[0] << " " << cover[1] << " " << cover[2] << std::endl << n*cover[0]*cover[1]*cover[2] << std::endl; @@ -4152,7 +4151,7 @@ operator<< (std::ostream& os,const Periodic_3_triangulation_3& tr) for(Vertex_iterator it=tr.vertices_begin(); it!=tr.vertices_end(); ++it) { V[it] = i++; os << it->point(); - if(is_ascii(os)) + if(IO::is_ascii(os)) os << std::endl; } } else { @@ -4164,7 +4163,7 @@ operator<< (std::ostream& os,const Periodic_3_triangulation_3& tr) continue; V[it]=i++; - if(is_ascii(os)) + if(IO::is_ascii(os)) os << it->point() << std::endl << Offset(0,0,0) << std::endl; else os << it->point() << Offset(0,0,0); @@ -4176,7 +4175,7 @@ operator<< (std::ostream& os,const Periodic_3_triangulation_3& tr) vvit = tr.virtual_vertices.find(vv[j]); CGAL_triangulation_assertion(vvit != tr.virtual_vertices.end()); V[vv[j]] = i++; - if(is_ascii(os)) + if(IO::is_ascii(os)) os << vv[j]->point() << std::endl << vvit->second.second << std::endl; else os << vv[j]->point() << vvit->second.second; @@ -4196,7 +4195,7 @@ operator<< (std::ostream& os,const Periodic_3_triangulation_3& tr) //Cell_handle ch = std::find(tr.cells_begin(), tr.cells_end(), i); Cell_handle ch(it); for(int j=0; j<4; j++) { - if(is_ascii(os)) { + if(IO::is_ascii(os)) { os << ch->offset(j); if( j==3 ) os << std::endl; @@ -4214,7 +4213,7 @@ operator<< (std::ostream& os,const Periodic_3_triangulation_3& tr) if(tr.number_of_vertices() != 0) { for(Cell_iterator it=tr.cells_begin(); it != tr.cells_end(); ++it) { os << *it; // other information - if(is_ascii(os)) + if(IO::is_ascii(os)) os << std::endl; } } diff --git a/Periodic_3_triangulation_3/test/Periodic_3_triangulation_3/include/CGAL/_test_cls_periodic_3_alpha_shape_3.h b/Periodic_3_triangulation_3/test/Periodic_3_triangulation_3/include/CGAL/_test_cls_periodic_3_alpha_shape_3.h index 06b33577161..d018131f7c7 100644 --- a/Periodic_3_triangulation_3/test/Periodic_3_triangulation_3/include/CGAL/_test_cls_periodic_3_alpha_shape_3.h +++ b/Periodic_3_triangulation_3/test/Periodic_3_triangulation_3/include/CGAL/_test_cls_periodic_3_alpha_shape_3.h @@ -19,7 +19,7 @@ template bool file_input(std::ifstream& is, std::list& L, int nb=0) { - CGAL::set_ascii_mode(is); + CGAL::IO::set_ascii_mode(is); int n; is >> n; if(nb != 0 && nb <= n) n=nb; diff --git a/Periodic_3_triangulation_3/test/Periodic_3_triangulation_3/include/CGAL/_test_cls_periodic_3_triangulation_3.h b/Periodic_3_triangulation_3/test/Periodic_3_triangulation_3/include/CGAL/_test_cls_periodic_3_triangulation_3.h index 7534db8b4bc..ddac2399a7c 100644 --- a/Periodic_3_triangulation_3/test/Periodic_3_triangulation_3/include/CGAL/_test_cls_periodic_3_triangulation_3.h +++ b/Periodic_3_triangulation_3/test/Periodic_3_triangulation_3/include/CGAL/_test_cls_periodic_3_triangulation_3.h @@ -647,8 +647,8 @@ _test_cls_periodic_3_triangulation_3(const PeriodicTriangulation &, ss1 >> PT1r; ss3 >> PT3r; - assert(CGAL::is_ascii(ss1)); - assert(CGAL::is_ascii(ss3)); + assert(CGAL::IO::is_ascii(ss1)); + assert(CGAL::IO::is_ascii(ss3)); if (!ex) assert(PT1 == PT1r); if (!ex) assert(PT3 == PT3r); @@ -659,15 +659,15 @@ _test_cls_periodic_3_triangulation_3(const PeriodicTriangulation &, if (!ex) { std::stringstream ss1b; std::stringstream ss3b; - CGAL::set_binary_mode(ss1b); - CGAL::set_binary_mode(ss3b); + CGAL::IO::set_binary_mode(ss1b); + CGAL::IO::set_binary_mode(ss3b); ss1b << PT1; ss3b << PT3; ss1b >> PT1r; ss3b >> PT3r; - assert(CGAL::is_binary(ss1b)); - assert(CGAL::is_binary(ss3b)); + assert(CGAL::IO::is_binary(ss1b)); + assert(CGAL::IO::is_binary(ss3b)); assert(PT1 == PT1r); assert(PT3 == PT3r); @@ -679,12 +679,12 @@ _test_cls_periodic_3_triangulation_3(const PeriodicTriangulation &, PT3r.clear(); std::stringstream ss1p; std::stringstream ss3p; - CGAL::set_pretty_mode(ss1p); - CGAL::set_pretty_mode(ss3p); + CGAL::IO::set_pretty_mode(ss1p); + CGAL::IO::set_pretty_mode(ss3p); ss1p << PT1; ss3p << PT3; - assert(CGAL::is_pretty(ss1p)); - assert(CGAL::is_pretty(ss3p)); + assert(CGAL::IO::is_pretty(ss1p)); + assert(CGAL::IO::is_pretty(ss3p)); } } diff --git a/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_Delaunay_triangulation_2.h b/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_Delaunay_triangulation_2.h index 0c74a7a8be4..3b17771004c 100644 --- a/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_Delaunay_triangulation_2.h +++ b/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_Delaunay_triangulation_2.h @@ -24,7 +24,6 @@ #include #include -#include #include #include diff --git a/Point_set_3/doc/Point_set_3/PackageDescription.txt b/Point_set_3/doc/Point_set_3/PackageDescription.txt index e8a7fec57d9..966775eda7c 100644 --- a/Point_set_3/doc/Point_set_3/PackageDescription.txt +++ b/Point_set_3/doc/Point_set_3/PackageDescription.txt @@ -82,8 +82,8 @@ These overloads, available after including `CGAL/Point_set_3/IO.h`, allow the user to call point set processing algorithms without having to handle manually property maps and iterators. -- `CGAL::read_point_set()` -- `CGAL::write_point_set()` +- `CGAL::IO::read_point_set()` +- `CGAL::IO::write_point_set()` - \link PkgPointSet3IOLAS I/O for `LAS` files \endlink - \link PkgPointSet3IOOFF I/O for `OFF` files \endlink - \link PkgPointSet3IOPLY I/O for `PLY` files \endlink diff --git a/Point_set_3/examples/Point_set_3/draw_point_set_3.cpp b/Point_set_3/examples/Point_set_3/draw_point_set_3.cpp index 1adcd7245f3..9a0d04904f9 100644 --- a/Point_set_3/examples/Point_set_3/draw_point_set_3.cpp +++ b/Point_set_3/examples/Point_set_3/draw_point_set_3.cpp @@ -16,7 +16,7 @@ int main (int argc, char** argv) const char* filename = argc > 1 ? argv[1] : "data/oni.xyz"; Point_set point_set; - if(!CGAL::read_point_set(filename, point_set)) + if(!CGAL::IO::read_point_set(filename, point_set)) { std::cerr << "Can't read input file " << filename << std::endl; return EXIT_FAILURE; 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 795cc43f9f8..84dec4e5e8f 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 @@ -21,7 +21,7 @@ int main (int argc, char** argv) point_set.add_normal_map(); // Reading input in OFF format - if(!CGAL::read_points(filename, point_set.index_back_inserter(), + if(!CGAL::IO::read_points(filename, point_set.index_back_inserter(), CGAL::parameters::point_map(point_set.point_push_map()) .normal_map(point_set.normal_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 5a58de114cb..e59c33b4e93 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 @@ -19,7 +19,7 @@ int main (int argc, char** argv) Point_set point_set; - if(!CGAL::read_PLY(f, point_set)) // same as `f >> point_set` + if(!CGAL::IO::read_PLY(f, point_set)) // same as `f >> point_set` { std::cerr << "Can't read input file " << std::endl; return EXIT_FAILURE; @@ -45,11 +45,11 @@ int main (int argc, char** argv) if(argc > 2 && strcmp (argv[2], "-b") == 0) // Optional binary output { - CGAL::write_PLY("out.ply", point_set, CGAL::parameters::stream_precision(17)); + CGAL::IO::write_PLY("out.ply", point_set, CGAL::parameters::stream_precision(17)); } else // ASCII output { - CGAL::write_PLY("out.ply", point_set, CGAL::parameters::stream_precision(17) + CGAL::IO::write_PLY("out.ply", point_set, CGAL::parameters::stream_precision(17) .use_binary_mode(false)); } 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 c9ce2d6e757..f5337e3f7fa 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 @@ -18,7 +18,7 @@ int main (int argc, char** argv) // Reading input Point_set point_set; - if(!CGAL::read_XYZ(fname, point_set)) + if(!CGAL::IO::read_XYZ(fname, point_set)) { std::cerr << "Can't read input file " << std::endl; return EXIT_FAILURE; @@ -36,7 +36,7 @@ int main (int argc, char** argv) } // Writing result in OFF format - if(!CGAL::write_OFF("normalized_normals.off", point_set, CGAL::parameters::stream_precision(17))) + if(!CGAL::IO::write_OFF("normalized_normals.off", point_set, CGAL::parameters::stream_precision(17))) return EXIT_FAILURE; return EXIT_SUCCESS; diff --git a/Point_set_3/include/CGAL/Point_set_3/IO.h b/Point_set_3/include/CGAL/Point_set_3/IO.h index 994c8b0750d..b0da6a026d8 100644 --- a/Point_set_3/include/CGAL/Point_set_3/IO.h +++ b/Point_set_3/include/CGAL/Point_set_3/IO.h @@ -73,19 +73,20 @@ std::istream& operator>>(std::istream& is, is.seekg(0); if(line.find("OFF") == 0 || line.find("NOFF") == 0) - CGAL::read_OFF(is, ps); + CGAL::IO::read_OFF(is, ps); else if(line.find("ply") == 0) - CGAL::read_PLY(is, ps); + CGAL::IO::read_PLY(is, ps); #ifdef CGAL_LINKED_WITH_LASLIB else if(line.find("LASF") == 0) - CGAL::read_LAS(is, ps); + CGAL::IO::read_LAS(is, ps); #endif // LAS else - CGAL::read_XYZ(is, ps); + CGAL::IO::read_XYZ(is, ps); return is; } +namespace IO { /*! \ingroup PkgPointSet3IO @@ -127,7 +128,7 @@ bool read_point_set(const std::string& fname, CGAL::Point_set_3& ps, const CGAL_BGL_NP_CLASS& np) { - const std::string ext = IO::internal::get_file_extension(fname); + const std::string ext = internal::get_file_extension(fname); if(ext == "xyz" || ext == "pwn") return read_XYZ(fname, ps); @@ -151,6 +152,8 @@ bool read_point_set(const std::string& fname, CGAL::Point_set_3& return read_point_set(fname, ps, parameters::all_default()); } +} // namespace IO + /// \endcond //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -175,10 +178,12 @@ template std::ostream& operator<<(std::ostream& os, const CGAL::Point_set_3& ps) { - write_PLY(os, ps); + IO::write_PLY(os, ps); return os; } +namespace IO { + /*! \ingroup PkgPointSet3IO @@ -223,7 +228,7 @@ bool write_point_set(const std::string& fname, CGAL::Point_set_3& ps, const CGAL_BGL_NP_CLASS& np) { - const std::string ext = IO::internal::get_file_extension(fname); + const std::string ext = internal::get_file_extension(fname); if(ext == "xyz") return write_XYZ(fname, ps, np); @@ -249,6 +254,8 @@ bool write_point_set(const std::string& fname, CGAL::Point_set_3& /// \endcond +} // namespace IO + } // namespace CGAL #endif // CGAL_POINT_SET_3_IO diff --git a/Point_set_3/include/CGAL/Point_set_3/IO/LAS.h b/Point_set_3/include/CGAL/Point_set_3/IO/LAS.h index 14916e4e89c..b68091e5fbb 100644 --- a/Point_set_3/include/CGAL/Point_set_3/IO/LAS.h +++ b/Point_set_3/include/CGAL/Point_set_3/IO/LAS.h @@ -32,6 +32,8 @@ class Point_set_3; //////////////////////////////////////////////////////////////////////////////////////////////////// // Read +namespace IO { + namespace internal { template @@ -158,23 +160,25 @@ template bool read_LAS(const std::string& fname, CGAL::Point_set_3& point_set) { std::ifstream is(fname, std::ios::binary); - CGAL::set_mode(is, CGAL::IO::BINARY); + CGAL::IO::set_mode(is, CGAL::IO::BINARY); return read_LAS(is, point_set); } +} // namespace IO + #ifndef CGAL_NO_DEPRECATED_CODE /*! \ingroup PkgPointSet3IODeprecated - \deprecated This function is deprecated since \cgal 5.2, - \link PkgPointSet3IO `CGAL::read_LAS()` \endlink should be used instead. + \deprecated This function is deprecated since \cgal 5.3, + \link PkgPointSet3IO `CGAL::IO::read_LAS()` \endlink should be used instead. */ template CGAL_DEPRECATED bool read_las_point_set(std::istream& is, ///< input stream. CGAL::Point_set_3& point_set) ///< point set { - return read_LAS(is, point_set); + return IO::read_LAS(is, point_set); } #endif // CGAL_NO_DEPRECATED_CODE @@ -183,6 +187,8 @@ CGAL_DEPRECATED bool read_las_point_set(std::istream& is, ///< input stream. //////////////////////////////////////////////////////////////////////////////////////////////////// // Write +namespace IO { + /*! \ingroup PkgPointSet3IOLAS @@ -390,23 +396,25 @@ bool write_LAS(const std::string& fname, CGAL::Point_set_3& point_set) { std::ofstream os(fname, std::ios::binary); - CGAL::set_mode(os, CGAL::IO::BINARY); + CGAL::IO::set_mode(os, CGAL::IO::BINARY); return write_LAS(os, point_set); } +} // namespace IO + #ifndef CGAL_NO_DEPRECATED_CODE /*! \ingroup PkgPointSet3IODeprecated - \deprecated This function is deprecated since \cgal 5.2, - \link PkgPointSet3IO `CGAL::write_LAS()` \endlink should be used instead. + \deprecated This function is deprecated since \cgal 5.3, + \link PkgPointSet3IO `CGAL::IO::write_LAS()` \endlink should be used instead. */ template CGAL_DEPRECATED bool write_las_point_set(std::ostream& os, ///< output stream. CGAL::Point_set_3& point_set) ///< point set { - return write_LAS(os, point_set); + return IO::write_LAS(os, point_set); } #endif // CGAL_NO_DEPRECATED_CODE diff --git a/Point_set_3/include/CGAL/Point_set_3/IO/OFF.h b/Point_set_3/include/CGAL/Point_set_3/IO/OFF.h index b8882c97fdc..44f0c2fb584 100644 --- a/Point_set_3/include/CGAL/Point_set_3/IO/OFF.h +++ b/Point_set_3/include/CGAL/Point_set_3/IO/OFF.h @@ -37,6 +37,8 @@ class Point_set_3; //////////////////////////////////////////////////////////////////////////////////////////////////// // Read +namespace IO { + /*! \ingroup PkgPointSet3IOOFF @@ -55,9 +57,9 @@ bool read_OFF(std::istream& is, { point_set.add_normal_map(); - bool out = CGAL::read_OFF(is, point_set.index_back_inserter(), - CGAL::parameters::point_map(point_set.point_push_map()) - .normal_map(point_set.normal_push_map())); + bool out = CGAL::IO::read_OFF(is, point_set.index_back_inserter(), + CGAL::parameters::point_map(point_set.point_push_map()) + .normal_map(point_set.normal_push_map())); bool has_normals = false; for(typename CGAL::Point_set_3::const_iterator it=point_set.begin(); it!=point_set.end(); ++it) @@ -94,19 +96,21 @@ bool read_OFF(const std::string& fname, CGAL::Point_set_3& point_ return read_OFF(is, point_set); } +} // namespace IO + #ifndef CGAL_NO_DEPRECATED_CODE /*! \ingroup PkgPointSet3IODeprecated - \deprecated This function is deprecated since \cgal 5.2, - \link PkgPointSet3IO `CGAL::read_OFF()` \endlink should be used instead. + \deprecated This function is deprecated since \cgal 5.3, + \link PkgPointSet3IO `CGAL::IO::read_OFF()` \endlink should be used instead. */ template CGAL_DEPRECATED bool read_off_point_set(std::istream& is, ///< input stream. CGAL::Point_set_3& point_set) ///< point set. { - return read_OFF(is, point_set); + return IO::read_OFF(is, point_set); } #endif // CGAL_NO_DEPRECATED_CODE @@ -115,6 +119,8 @@ CGAL_DEPRECATED bool read_off_point_set(std::istream& is, ///< input stream. //////////////////////////////////////////////////////////////////////////////////////////////////// // Write +namespace IO { + /*! \ingroup PkgPointSet3IOOFF @@ -207,19 +213,21 @@ bool write_OFF(const std::string& fname, const CGAL::Point_set_3& /// \endcond +} // namespace IO + #ifndef CGAL_NO_DEPRECATED_CODE /*! \ingroup PkgPointSet3IODeprecated - \deprecated This function is deprecated since \cgal 5.2, - \link PkgPointSet3IO `CGAL::write_OFF()` \endlink should be used instead. + \deprecated This function is deprecated since \cgal 5.3, + \link PkgPointSet3IO `CGAL::IO::write_OFF()` \endlink should be used instead. */ template CGAL_DEPRECATED bool write_off_point_set(std::ostream& os, ///< output stream. const CGAL::Point_set_3& point_set) ///< point set { - return write_OFF(os, point_set); + return IO::write_OFF(os, point_set); } #endif // CGAL_NO_DEPRECATED_CODE diff --git a/Point_set_3/include/CGAL/Point_set_3/IO/PLY.h b/Point_set_3/include/CGAL/Point_set_3/IO/PLY.h index 4646ffbd974..fafccda8376 100644 --- a/Point_set_3/include/CGAL/Point_set_3/IO/PLY.h +++ b/Point_set_3/include/CGAL/Point_set_3/IO/PLY.h @@ -97,7 +97,7 @@ public: for(std::size_t j=0; jname(); if(name == "x" || @@ -213,8 +213,6 @@ public: }; } // namespace internal -} // namespace IO - //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -255,8 +253,8 @@ bool read_PLY(std::istream& is, return false; } - IO::internal::PLY_reader reader(true); - IO::internal::Point_set_3_filler filler(point_set); + internal::PLY_reader reader(true); + internal::Point_set_3_filler filler(point_set); if(!(reader.init(is))) { @@ -268,7 +266,7 @@ bool read_PLY(std::istream& is, for(std::size_t i=0; iget(is); if(is.fail()) return false; @@ -351,13 +349,13 @@ bool read_PLY(const std::string& fname, if(binary) { std::ifstream is(fname, std::ios::binary); - CGAL::set_mode(is, CGAL::IO::BINARY); + CGAL::IO::set_mode(is, CGAL::IO::BINARY); return read_PLY(is, point_set, comments); } else { std::ifstream is(fname); - CGAL::set_mode(is, CGAL::IO::ASCII); + CGAL::IO::set_mode(is, CGAL::IO::ASCII); return read_PLY(is, point_set, comments); } } @@ -386,13 +384,15 @@ bool read_PLY(const std::string& fname, CGAL::Point_set_3& point_ /// \endcond +} // namespace IO + #ifndef CGAL_NO_DEPRECATED_CODE /*! \ingroup PkgPointSet3IODeprecated - \deprecated This function is deprecated since \cgal 5.2, - \link PkgPointSet3IO `CGAL::read_PLY()` \endlink should be used instead. + \deprecated This function is deprecated since \cgal 5.3, + \link PkgPointSet3IO `CGAL::IO::read_PLY()` \endlink should be used instead. \brief reads a point set with properties from an input stream in ASCII or Binary PLY format. @@ -412,7 +412,7 @@ CGAL_DEPRECATED bool read_ply_point_set(std::istream& is, ///< input stream. CGAL::Point_set_3& point_set, ///< point set std::string& comments) ///< PLY comments. { - return read_PLY(is, point_set, comments); + return IO::read_PLY(is, point_set, comments); } template @@ -420,7 +420,7 @@ CGAL_DEPRECATED bool read_ply_point_set(std::istream& is, ///< input stream. CGAL::Point_set_3& point_set) ///< point set { std::string dummy; - return read_PLY(is, point_set, dummy); + return IO::read_PLY(is, point_set, dummy); } #endif // CGAL_NO_DEPRECATED_CODE @@ -429,6 +429,8 @@ CGAL_DEPRECATED bool read_ply_point_set(std::istream& is, ///< input stream. //////////////////////////////////////////////////////////////////////////////////////////////////// // Write +namespace IO { + /*! \ingroup PkgPointSet3IOPLY @@ -496,7 +498,7 @@ bool write_PLY(std::ostream& os, set_stream_precision_from_NP(os, np); os << "ply" << std::endl - << ((get_mode(os) == IO::BINARY) ? "format binary_little_endian 1.0" : "format ascii 1.0") << std::endl + << ((CGAL::IO::get_mode(os) == CGAL::IO::BINARY) ? "format binary_little_endian 1.0" : "format ascii 1.0") << std::endl << "comment Generated by the CGAL library" << std::endl; if(comments != std::string()) @@ -513,7 +515,7 @@ bool write_PLY(std::ostream& os, os << "element vertex " << point_set.number_of_points() << std::endl; std::vector prop = point_set.base().properties(); - std::vector*> printers; + std::vector*> printers; for(std::size_t i=0; i(point_set.point_map())); + printers.push_back(new internal::Property_printer(point_set.point_map())); continue; } if(prop[i] == "normal") @@ -551,7 +553,7 @@ bool write_PLY(std::ostream& os, << "property double ny" << std::endl << "property double nz" << std::endl; } - printers.push_back(new IO::internal::Property_printer(point_set.normal_map())); + printers.push_back(new internal::Property_printer(point_set.normal_map())); continue; } @@ -562,7 +564,7 @@ bool write_PLY(std::ostream& os, if(okay) { os << "property char " << prop[i] << std::endl; - printers.push_back(new IO::internal::Char_property_printer(pmap)); + printers.push_back(new internal::Char_property_printer(pmap)); continue; } } @@ -572,7 +574,7 @@ bool write_PLY(std::ostream& os, if(okay) { os << "property uchar " << prop[i] << std::endl; - printers.push_back(new IO::internal::Char_property_printer(pmap)); + printers.push_back(new internal::Char_property_printer(pmap)); continue; } } @@ -582,7 +584,7 @@ bool write_PLY(std::ostream& os, if(okay) { os << "property short " << prop[i] << std::endl; - printers.push_back(new IO::internal::Simple_property_printer(pmap)); + printers.push_back(new internal::Simple_property_printer(pmap)); continue; } } @@ -592,7 +594,7 @@ bool write_PLY(std::ostream& os, if(okay) { os << "property ushort " << prop[i] << std::endl; - printers.push_back(new IO::internal::Simple_property_printer(pmap)); + printers.push_back(new internal::Simple_property_printer(pmap)); continue; } } @@ -602,7 +604,7 @@ bool write_PLY(std::ostream& os, if(okay) { os << "property int " << prop[i] << std::endl; - printers.push_back(new IO::internal::Simple_property_printer(pmap)); + printers.push_back(new internal::Simple_property_printer(pmap)); continue; } } @@ -612,7 +614,7 @@ bool write_PLY(std::ostream& os, if(okay) { os << "property uint " << prop[i] << std::endl; - printers.push_back(new IO::internal::Simple_property_printer(pmap)); + printers.push_back(new internal::Simple_property_printer(pmap)); continue; } } @@ -622,7 +624,7 @@ bool write_PLY(std::ostream& os, if(okay) { os << "property int " << prop[i] << std::endl; - printers.push_back(new IO::internal::Simple_property_printer(pmap)); + printers.push_back(new internal::Simple_property_printer(pmap)); continue; } } @@ -632,7 +634,7 @@ bool write_PLY(std::ostream& os, if(okay) { os << "property uint " << prop[i] << std::endl; - printers.push_back(new IO::internal::Simple_property_printer(pmap)); + printers.push_back(new internal::Simple_property_printer(pmap)); continue; } } @@ -642,7 +644,7 @@ bool write_PLY(std::ostream& os, if(okay) { os << "property float " << prop[i] << std::endl; - printers.push_back(new IO::internal::Simple_property_printer(pmap)); + printers.push_back(new internal::Simple_property_printer(pmap)); continue; } } @@ -652,7 +654,7 @@ bool write_PLY(std::ostream& os, if(okay) { os << "property double " << prop[i] << std::endl; - printers.push_back(new IO::internal::Simple_property_printer(pmap)); + printers.push_back(new internal::Simple_property_printer(pmap)); continue; } } @@ -665,11 +667,11 @@ bool write_PLY(std::ostream& os, for(std::size_t i=0; iprint(os, *it); - if(get_mode(os) == IO::ASCII) + if(get_mode(os) == ASCII) os << " "; } - if(get_mode(os) == IO::ASCII) + if(get_mode(os) == ASCII) os << std::endl; } @@ -748,13 +750,13 @@ bool write_PLY(const std::string& fname, if(binary) { std::ofstream os(fname, std::ios::binary); - CGAL::set_mode(os, CGAL::IO::BINARY); + CGAL::IO::set_mode(os, BINARY); return write_PLY(os, point_set, comments, np); } else { std::ofstream os(fname); - CGAL::set_mode(os, CGAL::IO::ASCII); + CGAL::IO::set_mode(os, ASCII); return write_PLY(os, point_set, comments, np); } } @@ -782,20 +784,22 @@ bool write_PLY(const std::string& fname, const CGAL::Point_set_3& /// \endcond +} // namespace IO + #ifndef CGAL_NO_DEPRECATED_CODE /*! \ingroup PkgPointSet3IODeprecated - \deprecated This function is deprecated since \cgal 5.2, - \link PkgPointSet3IO `CGAL::write_PLY()` \endlink should be used instead. + \deprecated This function is deprecated since \cgal 5.3, + \link PkgPointSet3IO `CGAL::IO::write_PLY()` \endlink should be used instead. */ template CGAL_DEPRECATED bool write_ply_point_set(std::ostream& os, const CGAL::Point_set_3& point_set, const std::string& comments = std::string()) { - return write_PLY(os, point_set, comments); + return IO::write_PLY(os, point_set, comments); } #endif // CGAL_NO_DEPRECATED_CODE diff --git a/Point_set_3/include/CGAL/Point_set_3/IO/XYZ.h b/Point_set_3/include/CGAL/Point_set_3/IO/XYZ.h index a7b243fc192..33499ce8620 100644 --- a/Point_set_3/include/CGAL/Point_set_3/IO/XYZ.h +++ b/Point_set_3/include/CGAL/Point_set_3/IO/XYZ.h @@ -36,6 +36,8 @@ class Point_set_3; //////////////////////////////////////////////////////////////////////////////////////////////////// // Read +namespace IO { + /*! \ingroup PkgPointSet3IOXYZ @@ -54,9 +56,9 @@ bool read_XYZ(std::istream& is, { point_set.add_normal_map(); - bool out = CGAL::read_XYZ(is, point_set.index_back_inserter(), - CGAL::parameters::point_map(point_set.point_push_map()) - .normal_map(point_set.normal_push_map())); + bool out = CGAL::IO::read_XYZ(is, point_set.index_back_inserter(), + CGAL::parameters::point_map(point_set.point_push_map()) + .normal_map(point_set.normal_push_map())); bool has_normals = false; for(typename CGAL::Point_set_3::const_iterator it=point_set.begin(); it!=point_set.end(); ++it) @@ -93,18 +95,20 @@ bool read_XYZ(const std::string& fname, CGAL::Point_set_3& point_ return read_XYZ(is, point_set); } +} // namespace IO + #ifndef CGAL_NO_DEPRECATED_CODE /*! \ingroup PkgPointSet3IODeprecated - \deprecated This function is deprecated since \cgal 5.2, - \link PkgPointSet3IO `CGAL::read_XYZ()` \endlink should be used instead. + \deprecated This function is deprecated since \cgal 5.3, + \link PkgPointSet3IO `CGAL::IO::read_XYZ()` \endlink should be used instead. */ template CGAL_DEPRECATED bool read_xyz_point_set(std::istream& is, CGAL::Point_set_3& point_set) { - return read_XYZ(is, point_set); + return IO::read_XYZ(is, point_set); } #endif // CGAL_NO_DEPRECATED_CODE @@ -113,6 +117,8 @@ CGAL_DEPRECATED bool read_xyz_point_set(std::istream& is, CGAL::Point_set_3& /// \endcond +} // namespace IO + #ifndef CGAL_NO_DEPRECATED_CODE /*! \ingroup PkgPointSet3IODeprecated - \deprecated This function is deprecated since \cgal 5.2, - \link PkgPointSet3IO `CGAL::write_XYZ()` \endlink should be used instead. + \deprecated This function is deprecated since \cgal 5.3, + \link PkgPointSet3IO `CGAL::IO::write_XYZ()` \endlink should be used instead. */ template CGAL_DEPRECATED bool write_xyz_point_set(std::ostream& os, const CGAL::Point_set_3& point_set) { - return write_XYZ(os, point_set); + return IO::write_XYZ(os, point_set); } #endif // CGAL_NO_DEPRECATED_CODE diff --git a/Point_set_3/include/CGAL/draw_point_set_3.h b/Point_set_3/include/CGAL/draw_point_set_3.h index 510ba937a0c..54e3c413eb2 100644 --- a/Point_set_3/include/CGAL/draw_point_set_3.h +++ b/Point_set_3/include/CGAL/draw_point_set_3.h @@ -66,7 +66,7 @@ protected: void compute_vertex(const Point& p) { add_point(p); - // We can use add_point(p, c) with c a CGAL::Color to add a colored point + // We can use add_point(p, c) with c a CGAL::IO::Color to add a colored point } void compute_elements() diff --git a/Point_set_3/test/Point_set_3/point_set_test.cpp b/Point_set_3/test/Point_set_3/point_set_test.cpp index 1e03a609caf..1adfaca14a6 100644 --- a/Point_set_3/test/Point_set_3/point_set_test.cpp +++ b/Point_set_3/test/Point_set_3/point_set_test.cpp @@ -36,7 +36,7 @@ int main (int, char**) test (point_set.has_normal_map(), "point set should have normals."); const char* fname ("data/oni.pwn"); - if(!CGAL::read_point_set(fname, point_set)) + if(!CGAL::IO::read_point_set(fname, point_set)) { test (false, "failed to read input point set."); return EXIT_FAILURE; diff --git a/Point_set_processing_3/doc/Point_set_processing_3/PackageDescription.txt b/Point_set_processing_3/doc/Point_set_processing_3/PackageDescription.txt index 0b57f4220c4..bf0029d6c94 100644 --- a/Point_set_processing_3/doc/Point_set_processing_3/PackageDescription.txt +++ b/Point_set_processing_3/doc/Point_set_processing_3/PackageDescription.txt @@ -81,8 +81,8 @@ format. \cgalCRPSection{I/O (All Formats)} -- `CGAL::read_points()` -- `CGAL::write_points()` +- `CGAL::IO::read_points()` +- `CGAL::IO::write_points()` \cgalCRPSection{I/O (XYZ/OFF Formats)} @@ -91,23 +91,23 @@ format. \cgalCRPSection{I/O (PLY Format)} -- \link PkgPointSetProcessing3IOPly `CGAL::read_PLY()` \endlink -- `CGAL::read_PLY_with_properties()` -- \link PkgPointSetProcessing3IOPly `CGAL::write_PLY()` \endlink -- `CGAL::write_PLY_with_properties()` -- `CGAL::PLY_property` -- `CGAL::make_ply_point_reader()` -- `CGAL::make_ply_point_writer()` -- `CGAL::make_ply_normal_reader()` -- `CGAL::make_ply_normal_writer()` +- \link PkgPointSetProcessing3IOPly `CGAL::IO::read_PLY()` \endlink +- `CGAL::IO::read_PLY_with_properties()` +- \link PkgPointSetProcessing3IOPly `CGAL::IO::write_PLY()` \endlink +- `CGAL::IO::write_PLY_with_properties()` +- `CGAL::IO::PLY_property` +- `CGAL::IO::make_ply_point_reader()` +- `CGAL::IO::make_ply_point_writer()` +- `CGAL::IO::make_ply_normal_reader()` +- `CGAL::IO::make_ply_normal_writer()` \cgalCRPSection{I/O (LAS Format)} -- `CGAL::read_LAS()` -- `CGAL::read_LAS_with_properties()` -- `CGAL::write_LAS()` -- `CGAL::write_LAS_with_properties()` -- `CGAL::make_las_point_reader()` -- `CGAL::make_las_point_writer()` +- `CGAL::IO::read_LAS()` +- `CGAL::IO::read_LAS_with_properties()` +- `CGAL::IO::write_LAS()` +- `CGAL::IO::write_LAS_with_properties()` +- `CGAL::IO::make_las_point_reader()` +- `CGAL::IO::make_las_point_writer()` */ diff --git a/Point_set_processing_3/examples/Point_set_processing_3/average_spacing_example.cpp b/Point_set_processing_3/examples/Point_set_processing_3/average_spacing_example.cpp index 7d21a8237af..bb679700a26 100644 --- a/Point_set_processing_3/examples/Point_set_processing_3/average_spacing_example.cpp +++ b/Point_set_processing_3/examples/Point_set_processing_3/average_spacing_example.cpp @@ -27,8 +27,8 @@ int main(int argc, char*argv[]) // we use a property map that accesses the 1st element of the tuple. std::vector points; - if (!CGAL::read_points(fname, std::back_inserter(points), - CGAL::parameters::point_map(CGAL::Nth_of_tuple_property_map<1, IndexedPointWithColorTuple>()))) + if (!CGAL::IO::read_points(fname, std::back_inserter(points), + CGAL::parameters::point_map(CGAL::Nth_of_tuple_property_map<1, IndexedPointWithColorTuple>()))) { std::cerr << "Error: cannot read file " << fname << std::endl; return EXIT_FAILURE; diff --git a/Point_set_processing_3/examples/Point_set_processing_3/bilateral_smooth_point_set_example.cpp b/Point_set_processing_3/examples/Point_set_processing_3/bilateral_smooth_point_set_example.cpp index dc37c7a7eb8..dd4c2cbb390 100644 --- a/Point_set_processing_3/examples/Point_set_processing_3/bilateral_smooth_point_set_example.cpp +++ b/Point_set_processing_3/examples/Point_set_processing_3/bilateral_smooth_point_set_example.cpp @@ -27,9 +27,9 @@ int main(int argc, char*argv[]) // Reads a point set file in points[] * with normals *. std::vector points; - if(!CGAL::read_points(input_filename, std::back_inserter(points), - CGAL::parameters::point_map(CGAL::First_of_pair_property_map()) - .normal_map(CGAL::Second_of_pair_property_map()))) + if(!CGAL::IO::read_points(input_filename, std::back_inserter(points), + CGAL::parameters::point_map(CGAL::First_of_pair_property_map()) + .normal_map(CGAL::Second_of_pair_property_map()))) { std::cerr << "Error: cannot read file " << input_filename << std::endl; return EXIT_FAILURE; @@ -54,10 +54,10 @@ int main(int argc, char*argv[]) } //// Save point set. - if(!CGAL::write_XYZ(output_filename, points, - CGAL::parameters::point_map(CGAL::First_of_pair_property_map()) - .normal_map(CGAL::Second_of_pair_property_map()) - .stream_precision(17))) + if(!CGAL::IO::write_XYZ(output_filename, points, + CGAL::parameters::point_map(CGAL::First_of_pair_property_map()) + .normal_map(CGAL::Second_of_pair_property_map()) + .stream_precision(17))) return EXIT_FAILURE; return EXIT_SUCCESS; diff --git a/Point_set_processing_3/examples/Point_set_processing_3/clustering_example.cpp b/Point_set_processing_3/examples/Point_set_processing_3/clustering_example.cpp index eddf432eddf..6e058e1b1fe 100644 --- a/Point_set_processing_3/examples/Point_set_processing_3/clustering_example.cpp +++ b/Point_set_processing_3/examples/Point_set_processing_3/clustering_example.cpp @@ -56,7 +56,7 @@ int main (int argc, char** argv) } std::ofstream ofile("out.ply", std::ios_base::binary); - CGAL::set_binary_mode(ofile); + CGAL::IO::set_binary_mode(ofile); ofile << points; return EXIT_SUCCESS; diff --git a/Point_set_processing_3/examples/Point_set_processing_3/edge_aware_upsample_point_set_example.cpp b/Point_set_processing_3/examples/Point_set_processing_3/edge_aware_upsample_point_set_example.cpp index 2456b2dc1bc..89247f76650 100644 --- a/Point_set_processing_3/examples/Point_set_processing_3/edge_aware_upsample_point_set_example.cpp +++ b/Point_set_processing_3/examples/Point_set_processing_3/edge_aware_upsample_point_set_example.cpp @@ -25,10 +25,10 @@ int main(int argc, char* argv[]) // Reads a .xyz point set file in points[], *with normals*. std::vector points; - if(!CGAL::read_points(input_filename, - std::back_inserter(points), - CGAL::parameters::point_map(CGAL::First_of_pair_property_map()) - .normal_map(CGAL::Second_of_pair_property_map()))) + if(!CGAL::IO::read_points(input_filename, + std::back_inserter(points), + CGAL::parameters::point_map(CGAL::First_of_pair_property_map()) + .normal_map(CGAL::Second_of_pair_property_map()))) { std::cerr << "Error: cannot read file " << input_filename << std::endl; return EXIT_FAILURE; @@ -52,10 +52,10 @@ int main(int argc, char* argv[]) number_of_output_points(number_of_output_points)); // Saves point set. - if(!CGAL::write_points(output_filename, points, - CGAL::parameters::point_map(CGAL::First_of_pair_property_map()) - .normal_map(CGAL::Second_of_pair_property_map()) - .stream_precision(17))) + if(!CGAL::IO::write_points(output_filename, points, + CGAL::parameters::point_map(CGAL::First_of_pair_property_map()) + .normal_map(CGAL::Second_of_pair_property_map()) + .stream_precision(17))) return EXIT_FAILURE; return EXIT_SUCCESS; diff --git a/Point_set_processing_3/examples/Point_set_processing_3/edges_example.cpp b/Point_set_processing_3/examples/Point_set_processing_3/edges_example.cpp index 24d29c76fbc..3f80772a7d4 100644 --- a/Point_set_processing_3/examples/Point_set_processing_3/edges_example.cpp +++ b/Point_set_processing_3/examples/Point_set_processing_3/edges_example.cpp @@ -22,9 +22,9 @@ int main (int , char**) { // Reads a polygon mesh file in points[]. std::list points; - if(!CGAL::read_points("data/fandisk.off", - std::back_inserter(points), - CGAL::parameters::point_map(CGAL::First_of_pair_property_map()))) + if(!CGAL::IO::read_points("data/fandisk.off", + std::back_inserter(points), + CGAL::parameters::point_map(CGAL::First_of_pair_property_map()))) { std::cerr << "Error: cannot read file data/fandisk.off" << std::endl; return EXIT_FAILURE; diff --git a/Point_set_processing_3/examples/Point_set_processing_3/grid_simplification_example.cpp b/Point_set_processing_3/examples/Point_set_processing_3/grid_simplification_example.cpp index ac026943b61..e949000b5ad 100644 --- a/Point_set_processing_3/examples/Point_set_processing_3/grid_simplification_example.cpp +++ b/Point_set_processing_3/examples/Point_set_processing_3/grid_simplification_example.cpp @@ -16,7 +16,7 @@ int main(int argc, char*argv[]) // Reads a point set file in points[]. std::vector points; - if(!CGAL::read_points(fname, std::back_inserter(points))) + if(!CGAL::IO::read_points(fname, std::back_inserter(points))) { std::cerr << "Error: cannot read file " << fname << std::endl; return EXIT_FAILURE; diff --git a/Point_set_processing_3/examples/Point_set_processing_3/hierarchy_simplification_example.cpp b/Point_set_processing_3/examples/Point_set_processing_3/hierarchy_simplification_example.cpp index 8226659a32d..d5e7f2b2d8d 100644 --- a/Point_set_processing_3/examples/Point_set_processing_3/hierarchy_simplification_example.cpp +++ b/Point_set_processing_3/examples/Point_set_processing_3/hierarchy_simplification_example.cpp @@ -19,7 +19,7 @@ int main(int argc, char*argv[]) // Reads a point set file in points[]. std::vector points; - if(!CGAL::read_points(fname, std::back_inserter(points))) + if(!CGAL::IO::read_points(fname, std::back_inserter(points))) { std::cerr << "Error: cannot read file " << fname << std::endl; return EXIT_FAILURE; @@ -41,7 +41,7 @@ int main(int argc, char*argv[]) << task_timer.time() << " seconds, " << (memory>>20) << " Mib allocated." << std::endl; - CGAL::write_points("out.xyz", points, CGAL::parameters::stream_precision(17)); + CGAL::IO::write_points("out.xyz", points, CGAL::parameters::stream_precision(17)); return EXIT_SUCCESS; } diff --git a/Point_set_processing_3/examples/Point_set_processing_3/normal_estimation.cpp b/Point_set_processing_3/examples/Point_set_processing_3/normal_estimation.cpp index 3fdb8f53e0f..bd4847a22e4 100644 --- a/Point_set_processing_3/examples/Point_set_processing_3/normal_estimation.cpp +++ b/Point_set_processing_3/examples/Point_set_processing_3/normal_estimation.cpp @@ -244,8 +244,8 @@ int main(int argc, char * argv[]) PointList points; std::cerr << "Open " << input_filename << " for reading..." << std::endl; - if(!CGAL::read_points(input_filename.c_str(), std::back_inserter(points), - CGAL::parameters::point_map(CGAL::First_of_pair_property_map()))) + if(!CGAL::IO::read_points(input_filename.c_str(), std::back_inserter(points), + CGAL::parameters::point_map(CGAL::First_of_pair_property_map()))) { std::cerr << "Error: cannot read file " << input_filename << std::endl; return EXIT_FAILURE; @@ -290,10 +290,10 @@ int main(int argc, char * argv[]) std::cerr << "Write file " << output_filename << std::endl << std::endl; - if(!CGAL::write_points(output_filename, points, - CGAL::parameters::point_map(CGAL::First_of_pair_property_map()) - .normal_map(CGAL::Second_of_pair_property_map()) - .stream_precision(17))) + if(!CGAL::IO::write_points(output_filename, points, + CGAL::parameters::point_map(CGAL::First_of_pair_property_map()) + .normal_map(CGAL::Second_of_pair_property_map()) + .stream_precision(17))) { std::cerr << "Error: cannot write file " << output_filename << std::endl; return EXIT_FAILURE; diff --git a/Point_set_processing_3/examples/Point_set_processing_3/normals_example.cpp b/Point_set_processing_3/examples/Point_set_processing_3/normals_example.cpp index 9eb5e9b634a..40dfd2556ea 100644 --- a/Point_set_processing_3/examples/Point_set_processing_3/normals_example.cpp +++ b/Point_set_processing_3/examples/Point_set_processing_3/normals_example.cpp @@ -27,9 +27,9 @@ int main(int argc, char*argv[]) // Reads a point set file in points[]. std::list points; - if(!CGAL::read_points(fname, - std::back_inserter(points), - CGAL::parameters::point_map(CGAL::First_of_pair_property_map()))) + if(!CGAL::IO::read_points(fname, + std::back_inserter(points), + CGAL::parameters::point_map(CGAL::First_of_pair_property_map()))) { std::cerr << "Error: cannot read file " << fname<< std::endl; return EXIT_FAILURE; diff --git a/Point_set_processing_3/examples/Point_set_processing_3/orient_scanlines_example.cpp b/Point_set_processing_3/examples/Point_set_processing_3/orient_scanlines_example.cpp index 9e6beca4da1..642da49d893 100644 --- a/Point_set_processing_3/examples/Point_set_processing_3/orient_scanlines_example.cpp +++ b/Point_set_processing_3/examples/Point_set_processing_3/orient_scanlines_example.cpp @@ -16,8 +16,8 @@ using Scanline_id_map = CGAL::Nth_of_tuple_property_map<3, Point_with_info>; void dump (const char* filename, const std::vector& points) { std::ofstream ofile (filename, std::ios::binary); - CGAL::set_binary_mode(ofile); - CGAL::write_PLY + CGAL::IO::set_binary_mode(ofile); + CGAL::IO::write_PLY (ofile, points, CGAL::parameters::point_map (Point_map()). normal_map (Normal_map())); @@ -33,13 +33,13 @@ int main (int argc, char** argv) std::cerr << "Reading input file " << fname << std::endl; std::ifstream ifile (fname, std::ios::binary); if (!ifile || - !CGAL::read_LAS_with_properties + !CGAL::IO::read_LAS_with_properties (ifile, std::back_inserter (points), - CGAL::make_las_point_reader (Point_map()), + CGAL::IO::make_las_point_reader (Point_map()), std::make_pair (Scan_angle_map(), - CGAL::LAS_property::Scan_angle()), + CGAL::IO::LAS_property::Scan_angle()), std::make_pair (Scanline_id_map(), - CGAL::LAS_property::Scan_direction_flag()))) + CGAL::IO::LAS_property::Scan_direction_flag()))) { std::cerr << "Can't read " << fname << std::endl; return EXIT_FAILURE; diff --git a/Point_set_processing_3/examples/Point_set_processing_3/property_map.cpp b/Point_set_processing_3/examples/Point_set_processing_3/property_map.cpp index 56a131c35e3..2b940185cc3 100644 --- a/Point_set_processing_3/examples/Point_set_processing_3/property_map.cpp +++ b/Point_set_processing_3/examples/Point_set_processing_3/property_map.cpp @@ -82,7 +82,7 @@ void orient_normals(Iterator beg, Iterator end, OrientationPMap orient_pmap, Nor int main() { - CGAL::set_pretty_mode(std::cout); + CGAL::IO::set_pretty_mode(std::cout); // Here we run it on plain points. No need for a property map { diff --git a/Point_set_processing_3/examples/Point_set_processing_3/random_simplification_example.cpp b/Point_set_processing_3/examples/Point_set_processing_3/random_simplification_example.cpp index d6ec4e2904a..fef22b7a078 100644 --- a/Point_set_processing_3/examples/Point_set_processing_3/random_simplification_example.cpp +++ b/Point_set_processing_3/examples/Point_set_processing_3/random_simplification_example.cpp @@ -18,7 +18,7 @@ int main(int argc, char*argv[]) // Reads a point set file in points[]. std::vector points; - if(!CGAL::read_points(fname, std::back_inserter(points))) + if(!CGAL::IO::read_points(fname, std::back_inserter(points))) { std::cerr << "Error: cannot read file " << fname << std::endl; return EXIT_FAILURE; @@ -33,7 +33,7 @@ int main(int argc, char*argv[]) // Saves point set. const std::string output_filename = (argc>2) ? argv[2] : "Three_lady_copy.xyz"; - if(!CGAL::write_points(output_filename, points, CGAL::parameters::stream_precision(17))) + if(!CGAL::IO::write_points(output_filename, points, CGAL::parameters::stream_precision(17))) return EXIT_FAILURE; return EXIT_SUCCESS; diff --git a/Point_set_processing_3/examples/Point_set_processing_3/read_las_example.cpp b/Point_set_processing_3/examples/Point_set_processing_3/read_las_example.cpp index 8cf2f1be534..11d266a2d5b 100644 --- a/Point_set_processing_3/examples/Point_set_processing_3/read_las_example.cpp +++ b/Point_set_processing_3/examples/Point_set_processing_3/read_las_example.cpp @@ -21,14 +21,14 @@ int main(int argc, char*argv[]) // Reads a .las point set file with normal vectors and colors std::ifstream in(fname, std::ios_base::binary); std::vector points; // store points - if(!CGAL::read_LAS_with_properties(in, std::back_inserter (points), - CGAL::make_las_point_reader(CGAL::First_of_pair_property_map()), - std::make_tuple(CGAL::Second_of_pair_property_map(), - CGAL::Construct_array(), - CGAL::LAS_property::R(), - CGAL::LAS_property::G(), - CGAL::LAS_property::B(), - CGAL::LAS_property::I()))) + if(!CGAL::IO::read_LAS_with_properties(in, std::back_inserter (points), + CGAL::IO::make_las_point_reader(CGAL::First_of_pair_property_map()), + std::make_tuple(CGAL::Second_of_pair_property_map(), + CGAL::Construct_array(), + CGAL::IO::LAS_property::R(), + CGAL::IO::LAS_property::G(), + CGAL::IO::LAS_property::B(), + CGAL::IO::LAS_property::I()))) { std::cerr << "Error: cannot read file " << fname << std::endl; return EXIT_FAILURE; diff --git a/Point_set_processing_3/examples/Point_set_processing_3/read_ply_points_with_colors_example.cpp b/Point_set_processing_3/examples/Point_set_processing_3/read_ply_points_with_colors_example.cpp index 347ac0aecf4..9d3fad1476d 100644 --- a/Point_set_processing_3/examples/Point_set_processing_3/read_ply_points_with_colors_example.cpp +++ b/Point_set_processing_3/examples/Point_set_processing_3/read_ply_points_with_colors_example.cpp @@ -28,15 +28,15 @@ int main(int argc, char*argv[]) // Reads a .ply point set file with normal vectors and colors std::vector points; // store points std::ifstream in(fname); - if(!CGAL::read_PLY_with_properties(in, std::back_inserter(points), - CGAL::make_ply_point_reader(Point_map()), - std::make_pair(Intensity_map(), CGAL::PLY_property("intensity")), - std::make_tuple(Color_map(), - CGAL::Construct_array(), - CGAL::PLY_property("red"), - CGAL::PLY_property("green"), - CGAL::PLY_property("blue")), - CGAL::make_ply_normal_reader(Normal_map()))) + if(!CGAL::IO::read_PLY_with_properties(in, std::back_inserter(points), + CGAL::make_ply_point_reader(Point_map()), + std::make_pair(Intensity_map(), CGAL::PLY_property("intensity")), + std::make_tuple(Color_map(), + CGAL::Construct_array(), + CGAL::IO::PLY_property("red"), + CGAL::IO::PLY_property("green"), + CGAL::IO::PLY_property("blue")), + CGAL::IO::make_ply_normal_reader(Normal_map()))) { std::cerr << "Error: cannot read file " << fname << 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 33e49442e6c..ae628ced81e 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 @@ -26,10 +26,10 @@ int main(int argc, char*argv[]) // over points and as well as property maps to access each // point position and normal. std::vector points; - if(!CGAL::read_XYZ(fname, - std::back_inserter(points), - CGAL::parameters::point_map(CGAL::First_of_pair_property_map()) - .normal_map(CGAL::Second_of_pair_property_map()))) + if(!CGAL::IO::read_XYZ(fname, + std::back_inserter(points), + CGAL::parameters::point_map(CGAL::First_of_pair_property_map()) + .normal_map(CGAL::Second_of_pair_property_map()))) { std::cerr << "Error: cannot read file " << fname << std::endl; return EXIT_FAILURE; @@ -38,10 +38,10 @@ int main(int argc, char*argv[]) // Saves point set. // Note: write_XYZ() requires property maps to access each // point position and normal. - if(!CGAL::write_XYZ("oni_copy.xyz", points, - CGAL::parameters::point_map(CGAL::First_of_pair_property_map()) - .normal_map(CGAL::Second_of_pair_property_map()) - .stream_precision(17))) + if(!CGAL::IO::write_XYZ("oni_copy.xyz", points, + CGAL::parameters::point_map(CGAL::First_of_pair_property_map()) + .normal_map(CGAL::Second_of_pair_property_map()) + .stream_precision(17))) return EXIT_FAILURE; return EXIT_SUCCESS; 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 983d5b5b811..b14e5527e28 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 @@ -26,17 +26,17 @@ int main(int argc, const char** argv) const char* fname2 = (argc>2) ? argv[2] : "data/hippo2.ply"; std::vector pwns1, pwns2; - if(!CGAL::read_points(fname1, std::back_inserter(pwns1), - CGAL::parameters::point_map(CGAL::First_of_pair_property_map()) - .normal_map(Normal_map()))) + if(!CGAL::IO::read_points(fname1, std::back_inserter(pwns1), + CGAL::parameters::point_map(CGAL::First_of_pair_property_map()) + .normal_map(Normal_map()))) { std::cerr << "Error: cannot read file " << fname1 << std::endl; return EXIT_FAILURE; } - if(!CGAL::read_points(fname2, std::back_inserter(pwns2), - CGAL::parameters::point_map(Point_map()) - .normal_map(Normal_map()))) + if(!CGAL::IO::read_points(fname2, std::back_inserter(pwns2), + CGAL::parameters::point_map(Point_map()) + .normal_map(Normal_map()))) { std::cerr << "Error: cannot read file " << fname2 << std::endl; return EXIT_FAILURE; @@ -64,10 +64,10 @@ int main(int argc, const char** argv) params::point_map(Point_map()) .normal_map(Normal_map())); - if(!CGAL::write_points("pwns2_aligned.ply", pwns2, - CGAL::parameters::point_map(Point_map()) - .normal_map(Normal_map()) - .stream_precision(17))) + if(!CGAL::IO::write_points("pwns2_aligned.ply", pwns2, + CGAL::parameters::point_map(Point_map()) + .normal_map(Normal_map()) + .stream_precision(17))) return EXIT_FAILURE; std::cout << "Registration score: " << score << ".\n" 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 a26cb3e4dcc..f3988aaf24f 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 @@ -29,17 +29,17 @@ int main(int argc, const char** argv) const char* fname2 = (argc>2) ? argv[2] : "data/hippo2.ply"; std::vector pwns1, pwns2; - if(!CGAL::read_points(fname1, std::back_inserter(pwns1), - CGAL::parameters::point_map(CGAL::First_of_pair_property_map()) - .normal_map (Normal_map()))) + if(!CGAL::IO::read_points(fname1, std::back_inserter(pwns1), + CGAL::parameters::point_map(CGAL::First_of_pair_property_map()) + .normal_map (Normal_map()))) { std::cerr << "Error: cannot read file " << fname1 << std::endl; return EXIT_FAILURE; } - if(!CGAL::read_points(fname2, std::back_inserter(pwns2), - CGAL::parameters::point_map(Point_map()) - .normal_map(Normal_map()))) + if(!CGAL::IO::read_points(fname2, std::back_inserter(pwns2), + CGAL::parameters::point_map(Point_map()) + .normal_map(Normal_map()))) { std::cerr << "Error: cannot read file " << fname2 << std::endl; return EXIT_FAILURE; @@ -64,9 +64,9 @@ int main(int argc, const char** argv) params::point_map(Point_map()).normal_map(Normal_map()), params::point_map(Point_map()).normal_map(Normal_map()).transformation(res)); - if(!CGAL::write_points("pwns2_aligned.ply", pwns2, - CGAL::parameters::point_map(Point_map()) - .normal_map(Normal_map()))) + if(!CGAL::IO::write_points("pwns2_aligned.ply", pwns2, + CGAL::parameters::point_map(Point_map()) + .normal_map(Normal_map()))) { return EXIT_FAILURE; } diff --git a/Point_set_processing_3/examples/Point_set_processing_3/registration_with_pointmatcher.cpp b/Point_set_processing_3/examples/Point_set_processing_3/registration_with_pointmatcher.cpp index cfbb6463d16..1d78d67f9a1 100644 --- a/Point_set_processing_3/examples/Point_set_processing_3/registration_with_pointmatcher.cpp +++ b/Point_set_processing_3/examples/Point_set_processing_3/registration_with_pointmatcher.cpp @@ -29,17 +29,17 @@ int main(int argc, const char** argv) const char* fname2 = (argc>2)?argv[2]:"data/hippo2.ply"; std::vector pwns1, pwns2; - if(!CGAL::read_points(fname1, std::back_inserter(pwns1), - CGAL::parameters::point_map(CGAL::First_of_pair_property_map()) - .normal_map(Normal_map()))) + if(!CGAL::IO::read_points(fname1, std::back_inserter(pwns1), + CGAL::parameters::point_map(CGAL::First_of_pair_property_map()) + .normal_map(Normal_map()))) { std::cerr << "Error: cannot read file " << fname1 << std::endl; return EXIT_FAILURE; } - if(!CGAL::read_points(fname2, std::back_inserter(pwns2), - CGAL::parameters::point_map(Point_map()) - .normal_map(Normal_map()))) + if(!CGAL::IO::read_points(fname2, std::back_inserter(pwns2), + CGAL::parameters::point_map(Point_map()) + .normal_map(Normal_map()))) { std::cerr << "Error: cannot read file " << fname2 << std::endl; return EXIT_FAILURE; @@ -139,8 +139,8 @@ int main(int argc, const char** argv) } while (!converged); - if(!CGAL::write_points("pwns2_aligned.ply", pwns2, - CGAL::parameters::point_map(Point_map()).normal_map(Normal_map()))) + if(!CGAL::IO::write_points("pwns2_aligned.ply", pwns2, + CGAL::parameters::point_map(Point_map()).normal_map(Normal_map()))) return EXIT_FAILURE; std::cout << "Transformed version of " << fname2 << " written to pwn2_aligned.ply.\n"; diff --git a/Point_set_processing_3/examples/Point_set_processing_3/remove_outliers_example.cpp b/Point_set_processing_3/examples/Point_set_processing_3/remove_outliers_example.cpp index 777fb38828e..9ef2280fef9 100644 --- a/Point_set_processing_3/examples/Point_set_processing_3/remove_outliers_example.cpp +++ b/Point_set_processing_3/examples/Point_set_processing_3/remove_outliers_example.cpp @@ -20,8 +20,8 @@ int main(int argc, char*argv[]) // Reads a point set file in points[]. // The Identity_property_map property map can be omitted here as it is the default value. std::vector points; - if(!CGAL::read_points(fname, std::back_inserter(points), - CGAL::parameters::point_map(CGAL::Identity_property_map()))) + if(!CGAL::IO::read_points(fname, std::back_inserter(points), + CGAL::parameters::point_map(CGAL::Identity_property_map()))) { std::cerr << "Error: cannot read file " << fname << std::endl; return EXIT_FAILURE; diff --git a/Point_set_processing_3/examples/Point_set_processing_3/scale_estimation_example.cpp b/Point_set_processing_3/examples/Point_set_processing_3/scale_estimation_example.cpp index 094de32e4aa..da20e6caf5f 100644 --- a/Point_set_processing_3/examples/Point_set_processing_3/scale_estimation_example.cpp +++ b/Point_set_processing_3/examples/Point_set_processing_3/scale_estimation_example.cpp @@ -27,7 +27,7 @@ int main (int argc, char** argv) // read input std::vector points; - if(!CGAL::read_points(fname, std::back_inserter(points))) + if(!CGAL::IO::read_points(fname, std::back_inserter(points))) { std::cerr << "Error: can't read input file" << std::endl; return EXIT_FAILURE; diff --git a/Point_set_processing_3/examples/Point_set_processing_3/structuring_example.cpp b/Point_set_processing_3/examples/Point_set_processing_3/structuring_example.cpp index 11ce92c5aac..d53aa1a27d8 100644 --- a/Point_set_processing_3/examples/Point_set_processing_3/structuring_example.cpp +++ b/Point_set_processing_3/examples/Point_set_processing_3/structuring_example.cpp @@ -32,9 +32,9 @@ int main (int argc, char** argv) // Loading point set from a file. - if(!CGAL::read_points(filename, std::back_inserter(points), - CGAL::parameters::point_map(Point_map()) - .normal_map(Normal_map()))) + if(!CGAL::IO::read_points(filename, std::back_inserter(points), + CGAL::parameters::point_map(Point_map()) + .normal_map(Normal_map()))) { std::cerr << "Error: cannot read file cube.pwn" << std::endl; return EXIT_FAILURE; @@ -64,10 +64,10 @@ int main (int argc, char** argv) std::cerr << structured_pts.size () << " structured point(s) generated." << std::endl; - CGAL::write_points("out.pwn", structured_pts, - CGAL::parameters::point_map(Point_map()) - .normal_map(Normal_map()) - .stream_precision(17)); + CGAL::IO::write_points("out.pwn", structured_pts, + CGAL::parameters::point_map(Point_map()) + .normal_map(Normal_map()) + .stream_precision(17)); return EXIT_SUCCESS; } diff --git a/Point_set_processing_3/examples/Point_set_processing_3/wlop_simplify_and_regularize_point_set_example.cpp b/Point_set_processing_3/examples/Point_set_processing_3/wlop_simplify_and_regularize_point_set_example.cpp index 524c080051b..a4cb0104130 100644 --- a/Point_set_processing_3/examples/Point_set_processing_3/wlop_simplify_and_regularize_point_set_example.cpp +++ b/Point_set_processing_3/examples/Point_set_processing_3/wlop_simplify_and_regularize_point_set_example.cpp @@ -23,7 +23,7 @@ int main(int argc, char** argv) // Reads a .xyz point set file in points[] std::vector points; - if(!CGAL::read_points(input_filename, std::back_inserter(points))) + if(!CGAL::IO::read_points(input_filename, std::back_inserter(points))) { std::cerr << "Error: cannot read file " << input_filename << std::endl; return EXIT_FAILURE; @@ -40,7 +40,7 @@ int main(int argc, char** argv) CGAL::parameters::select_percentage(retain_percentage). neighbor_radius (neighbor_radius)); - if(!CGAL::write_points(output_filename, output, CGAL::parameters::stream_precision(17))) + if(!CGAL::IO::write_points(output_filename, output, CGAL::parameters::stream_precision(17))) return EXIT_FAILURE; return EXIT_SUCCESS; diff --git a/Point_set_processing_3/examples/Point_set_processing_3/write_ply_points_example.cpp b/Point_set_processing_3/examples/Point_set_processing_3/write_ply_points_example.cpp index 6542eb28ee6..ab9451d1e9d 100644 --- a/Point_set_processing_3/examples/Point_set_processing_3/write_ply_points_example.cpp +++ b/Point_set_processing_3/examples/Point_set_processing_3/write_ply_points_example.cpp @@ -31,7 +31,7 @@ struct Output_rep< ::Color, F > { { } std::ostream& operator() (std::ostream& out) const { - if (is_ascii(out)) + if (IO::is_ascii(out)) out << int(c[0]) << " " << int(c[1]) << " " << int(c[2]) << " " << int(c[3]); else out.write(reinterpret_cast(&c), sizeof(c)); @@ -54,16 +54,16 @@ int main(int, char**) i)); std::ofstream f("out.ply", std::ios::binary); - CGAL::set_binary_mode(f); // The PLY file will be written in the binary format + CGAL::IO::set_binary_mode(f); // The PLY file will be written in the binary format - CGAL::write_PLY_with_properties(f, points, - CGAL::make_ply_point_writer (Point_map()), - std::make_tuple(Color_map(), - CGAL::PLY_property("red"), - CGAL::PLY_property("green"), - CGAL::PLY_property("blue"), - CGAL::PLY_property("alpha")), - std::make_pair(Intensity_map(), CGAL::PLY_property("intensity"))); + CGAL::IO::write_PLY_with_properties(f, points, + CGAL::make_ply_point_writer (Point_map()), + std::make_tuple(Color_map(), + CGAL::IO::PLY_property("red"), + CGAL::IO::PLY_property("green"), + CGAL::IO::PLY_property("blue"), + CGAL::IO::PLY_property("alpha")), + std::make_pair(Intensity_map(), CGAL::IO::PLY_property("intensity"))); return EXIT_SUCCESS; } diff --git a/Point_set_processing_3/include/CGAL/IO/read_las_points.h b/Point_set_processing_3/include/CGAL/IO/read_las_points.h index 1a907e6d002..5e9e127d0f8 100644 --- a/Point_set_processing_3/include/CGAL/IO/read_las_points.h +++ b/Point_set_processing_3/include/CGAL/IO/read_las_points.h @@ -64,6 +64,8 @@ namespace CGAL { +namespace IO { + /// \cond SKIP_IN_MANUAL namespace LAS_property { namespace Id { @@ -544,7 +546,7 @@ bool read_LAS(const std::string& filename, const CGAL_BGL_NP_CLASS& np) { std::ifstream is(filename, std::ios::binary); - CGAL::set_mode(is, CGAL::IO::BINARY); + CGAL::IO::set_mode(is, CGAL::IO::BINARY); return read_LAS(is, output, np); } @@ -554,7 +556,7 @@ template bool read_LAS(const std::string& fname, OutputIterator output, const CGAL_BGL_NP_CLASS& np) { std::ifstream is(fname, std::ios::binary); - CGAL::set_mode(is, CGAL::IO::BINARY); + CGAL::IO::set_mode(is, CGAL::IO::BINARY); return read_LAS::type>(is, output, np); } @@ -572,10 +574,15 @@ bool read_LAS(const std::string& fname, OutputIterator output) /// \endcond +} // namespace IO + #ifndef CGAL_NO_DEPRECATED_CODE /// \cond SKIP_IN_MANUAL +using IO::make_las_point_reader; +namespace LAS_property = IO::LAS_property; + template @@ -603,7 +610,7 @@ bool read_las_points(std::istream& is, ///< input stream. /** \ingroup PkgPointSetProcessing3IODeprecated - \deprecated This function is deprecated since \cgal 5.2, `CGAL::read_LAS_with_properties()` should be used instead. + \deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::read_LAS_with_properties()` should be used instead. */ template (properties)...); + return IO::read_LAS_with_properties(is, output, std::forward(properties)...); } /// \cond SKIP_IN_MANUAL @@ -623,7 +630,7 @@ CGAL_DEPRECATED bool read_las_points_with_properties(std::istream& is, OutputIterator output, PropertyHandler&& ... properties) { - return read_LAS_with_properties::type>(is, output, std::forward(properties)...); + return IO::read_LAS_with_properties::type>(is, output, std::forward(properties)...); } /// \endcond @@ -631,7 +638,7 @@ CGAL_DEPRECATED bool read_las_points_with_properties(std::istream& is, /** \ingroup PkgPointSetProcessing3IODeprecated - \deprecated This function is deprecated since \cgal 5.2, `CGAL::read_LAS()` should be used instead. + \deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::read_LAS()` should be used instead. */ template , CGAL_BGL_NP_CLASS>::type point_map = choose_parameter, CGAL_BGL_NP_CLASS>::type>(get_parameter(np, internal_np::point_map)); - return read_LAS(is, output, make_las_point_reader(point_map)); + return IO::read_LAS(is, output, make_las_point_reader(point_map)); } /// \cond SKIP_IN_MANUAL @@ -655,21 +662,21 @@ CGAL_DEPRECATED bool read_las_points(std::istream& is, template CGAL_DEPRECATED bool read_las_points(std::istream& is, OutputIterator output) { - return read_LAS(is, output, CGAL::parameters::all_default()); + return IO::read_LAS(is, output, CGAL::parameters::all_default()); } // variant with default output iterator value type template CGAL_DEPRECATED bool read_las_points(std::istream& is, OutputIterator output, const CGAL_BGL_NP_CLASS& np) { - return read_LAS::type>(is, output, np); + return IO::read_LAS::type>(is, output, np); } // variant with default NP and output iterator value type template CGAL_DEPRECATED bool read_las_points(std::istream& is, OutputIterator output) { - return read_LAS::type>(is, output, CGAL::parameters::all_default()); + return IO::read_LAS::type>(is, output, CGAL::parameters::all_default()); } /// \endcond 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 5c06ffcefdc..8fee80ba6bf 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 @@ -40,6 +40,8 @@ namespace CGAL { +namespace IO { + /** \ingroup PkgPointSetProcessing3IOOff @@ -166,16 +168,16 @@ bool read_OFF(std::istream& is, // Reads position + normal... double x,y,z; double nx,ny,nz; - if (iss >> iformat(x) >> iformat(y) >> iformat(z)) + if (iss >> IO::iformat(x) >> IO::iformat(y) >> IO::iformat(z)) { //the extra `()` seem to fix a very strange bug. Without them, the put() won't compile. Point point((FT(x)), (FT(y)), (FT(z))); Vector normal = CGAL::NULL_VECTOR; // ... + normal... - if (iss >> iformat(nx)) + if (iss >> IO::iformat(nx)) { // In case we could read one number, we expect that there are two more - if(iss >> iformat(ny) >> iformat(nz)){ + if(iss >> IO::iformat(ny) >> IO::iformat(nz)){ normal = Vector(FT(nx),FT(ny),FT(nz)); } else { std::cerr << "Error line " << lineNumber << " of file" << std::endl; @@ -248,7 +250,7 @@ bool read_OFF(const std::string& fname, ) { std::ifstream is(fname); - return read_OFF(is, output, np); + return read_OFF(is, output, np); } /// \cond SKIP_IN_MANUAL @@ -303,6 +305,8 @@ bool read_OFF(const std::string& fname, OutputIterator output, /// \endcond +} // namespace IO + #ifndef CGAL_NO_DEPRECATED_CODE /// \cond SKIP_IN_MANUAL @@ -319,10 +323,10 @@ bool read_off_points_and_normals(std::istream& is, ///< input stream. NormalPMap normal_map, ///< property map: value_type of OutputIterator -> Vector_3. const Kernel& /*kernel*/) ///< geometric traits. { - return read_OFF(is, output, - parameters::point_map(point_map) - .normal_map(normal_map) - .geom_traits(Kernel())); + return IO::read_OFF(is, output, + parameters::point_map(point_map) + .normal_map(normal_map) + .geom_traits(Kernel())); } template Vector_3. const Kernel& kernel) ///< geometric traits. { - return read_OFF::type>(is, output, - parameters::point_map(point_map) - .normal_map(normal_map) - .geom_traits(kernel)); + return IO::read_OFF::type>(is, output, + parameters::point_map(point_map) + .normal_map(normal_map) + .geom_traits(kernel)); } template Point_3. NormalPMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3. { - return read_OFF(is, output, parameters::point_map(point_map) + return IO::read_OFF(is, output, parameters::point_map(point_map) .normal_map(normal_map)); } @@ -365,9 +369,9 @@ bool read_off_points_and_normals(std::istream& is, ///< input stream. PointPMap point_map, ///< property map: value_type of OutputIterator -> Point_3. NormalPMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3. { - return read_OFF::type>(is, output, - parameters::point_map(point_map) - .normal_map(normal_map)); + return IO::read_OFF::type>(is, output, + parameters::point_map(point_map) + .normal_map(normal_map)); } template Vector_3. { - return read_OFF(is, output, parameters::normal_map(normal_map)); + return IO::read_OFF(is, output, parameters::normal_map(normal_map)); } template Vector_3. { - return read_OFF::type>(is, output, parameters::normal_map(normal_map)); + return IO::read_OFF::type>(is, output, parameters::normal_map(normal_map)); } template CGAL_DEPRECATED bool read_off_points(std::istream& is, OutputIterator output) { - return read_OFF(is, output); + return IO::read_OFF(is, output); } // variant with default output iterator value type template CGAL_DEPRECATED bool read_off_points(std::istream& is, OutputIterator output, const CGAL_BGL_NP_CLASS& np) { - return read_OFF(is, output, np); + return IO::read_OFF(is, output, np); } // variant with default NP and output iterator value type template CGAL_DEPRECATED bool read_off_points(std::istream& is, OutputIterator output) { - return read_OFF(is, output, CGAL::parameters::all_default()); + return IO::read_OFF(is, output, CGAL::parameters::all_default()); } /// \endcond diff --git a/Point_set_processing_3/include/CGAL/IO/read_ply_points.h b/Point_set_processing_3/include/CGAL/IO/read_ply_points.h index 6cf449e48e6..53fad444a93 100644 --- a/Point_set_processing_3/include/CGAL/IO/read_ply_points.h +++ b/Point_set_processing_3/include/CGAL/IO/read_ply_points.h @@ -43,6 +43,8 @@ namespace CGAL { +namespace IO { + #ifdef DOXYGEN_RUNNING // Document some parts from Stream_support here for convenience /** \ingroup PkgPointSetProcessing3IOPly @@ -148,7 +150,7 @@ bool read_PLY_with_properties(std::istream& is, if(!is) return false; - IO::internal::PLY_reader reader(true); + internal::PLY_reader reader(true); if(!(reader.init(is))) { @@ -158,13 +160,13 @@ bool read_PLY_with_properties(std::istream& is, for(std::size_t i = 0; i < reader.number_of_elements(); ++ i) { - IO::internal::PLY_element& element = reader.element(i); + internal::PLY_element& element = reader.element(i); for(std::size_t j = 0; j < element.number_of_items(); ++ j) { for(std::size_t k = 0; k < element.number_of_properties(); ++ k) { - IO::internal::PLY_read_number* property = element.property(k); + internal::PLY_read_number* property = element.property(k); property->get(is); if(is.fail()) @@ -174,7 +176,7 @@ bool read_PLY_with_properties(std::istream& is, if(element.name() == "vertex" || element.name() == "vertices") { OutputValueType new_element; - IO::internal::process_properties(element, new_element, std::forward(properties)...); + internal::process_properties(element, new_element, std::forward(properties)...); *(output ++) = new_element; } } @@ -338,13 +340,13 @@ bool read_PLY(const std::string& fname, if(binary) { std::ifstream is(fname, std::ios::binary); - CGAL::set_mode(is, CGAL::IO::BINARY); + CGAL::IO::set_mode(is, CGAL::IO::BINARY); return read_PLY(is, output, np); } else { std::ifstream is(fname); - CGAL::set_mode(is, CGAL::IO::ASCII); + CGAL::IO::set_mode(is, CGAL::IO::ASCII); return read_PLY(is, output, np); } } @@ -398,6 +400,8 @@ bool read_PLY(const std::string& fname, OutputIterator output, /// \endcond +} // namespace IO + #ifndef CGAL_NO_DEPRECATED_CODE /// \cond SKIP_IN_MANUAL @@ -412,7 +416,7 @@ bool read_ply_points_and_normals(std::istream& is, ///< input stream. PointMap point_map, ///< property map: value_type of OutputIterator -> Point_3. NormalMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3. { - return read_PLY(is, output, parameters::point_map(point_map) + return IO::read_PLY(is, output, parameters::point_map(point_map) .normal_map(normal_map)); } @@ -425,7 +429,7 @@ bool read_ply_points_and_normals(std::istream& is, ///< input stream. PointMap point_map, ///< property map: value_type of OutputIterator -> Point_3. NormalMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3. { - return read_PLY::type>(is, output, parameters::point_map(point_map) + return IO::read_PLY::type>(is, output, parameters::point_map(point_map) .normal_map(normal_map)); } @@ -437,7 +441,7 @@ bool read_ply_points_and_normals(std::istream& is, ///< input stream. OutputIterator output, ///< output iterator over points. NormalMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3. { - return read_PLY(is, output, parameters::normal_map(normal_map)); + return IO::read_PLY(is, output, parameters::normal_map(normal_map)); } template @@ -446,7 +450,7 @@ bool read_ply_points_and_normals(std::istream& is, ///< input stream. OutputIterator output, ///< output iterator over points. NormalMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3. { - return read_PLY::type>(is, output, parameters::normal_map(normal_map)); + return IO::read_PLY::type>(is, output, parameters::normal_map(normal_map)); } template Point_3. { - return read_PLY(is, output, parameters::point_map(point_map)); + return IO::read_PLY(is, output, parameters::point_map(point_map)); } template Point_3. { - return read_PLY::type>(is, output, parameters::point_map(point_map)); + return IO::read_PLY::type>(is, output, parameters::point_map(point_map)); } /// \endcond @@ -475,25 +479,25 @@ bool read_ply_points(std::istream& is, ///< input stream. /** \ingroup PkgPointSetProcessing3IODeprecated - \deprecated This function is deprecated since \cgal 5.2, - \link PkgPointSetProcessing3IOPly `CGAL::read_PLY_with_properties()` \endlink should be used instead. + \deprecated This function is deprecated since \cgal 5.3, + \link PkgPointSetProcessing3IOPly `CGAL::IO::read_PLY_with_properties()` \endlink should be used instead. */ template CGAL_DEPRECATED bool read_ply_points_with_properties(std::istream& is, OutputIterator output, PropertyHandler&& ... properties) { - return read_PLY_with_properties(is, output, std::forward(properties)...); + return IO::read_PLY_with_properties(is, output, std::forward(properties)...); } /** \ingroup PkgPointSetProcessing3IODeprecated - \deprecated This function is deprecated since \cgal 5.2, - \link PkgPointSetProcessing3IOPly `CGAL::read_PLY()` \endlink should be used instead. + \deprecated This function is deprecated since \cgal 5.3, + \link PkgPointSetProcessing3IOPly `CGAL::IO::read_PLY()` \endlink should be used instead. */ template CGAL_DEPRECATED bool read_ply_points(std::istream& is, OutputIterator output, const CGAL_BGL_NP_CLASS& np) { - return read_PLY(is, output, np); + return IO::read_PLY(is, output, np); } /// \cond SKIP_IN_MANUAL @@ -502,14 +506,14 @@ template CGAL_DEPRECATED bool read_ply_points_with_properties(std::istream& is, OutputIterator output, PropertyHandler&& ... properties) { - return read_PLY_with_properties::type>(is, output, std::forward(properties)...); + return IO::read_PLY_with_properties::type>(is, output, std::forward(properties)...); } template CGAL_DEPRECATED bool read_ply_points(std::istream& is, OutputIterator output) { - return read_PLY(is, output, parameters::all_default()); + return IO::read_PLY(is, output, parameters::all_default()); } // variant with default output iterator value type @@ -517,14 +521,14 @@ template CGAL_DEPRECATED bool read_ply_points(std::istream& is, OutputIterator output, const CGAL_BGL_NP_CLASS& np) { - return read_PLY::type>(is, output, np); + return IO::read_PLY::type>(is, output, np); } // variant with default NP and output iterator value type template CGAL_DEPRECATED bool read_ply_points(std::istream& is, OutputIterator output) { - return read_PLY::type>(is, output, parameters::all_default()); + return IO::read_PLY::type>(is, output, parameters::all_default()); } /// \endcond diff --git a/Point_set_processing_3/include/CGAL/IO/read_points.h b/Point_set_processing_3/include/CGAL/IO/read_points.h index 4b4a8eee0f6..b9c31d64f69 100644 --- a/Point_set_processing_3/include/CGAL/IO/read_points.h +++ b/Point_set_processing_3/include/CGAL/IO/read_points.h @@ -28,6 +28,8 @@ namespace CGAL { +namespace IO { + /** \ingroup PkgPointSetProcessing3IO @@ -88,7 +90,7 @@ bool read_points(const std::string& fname, PointOutputIterator output, const NamedParameters& np) { - const std::string ext = IO::internal::get_file_extension(fname); + const std::string ext = internal::get_file_extension(fname); if(ext == "xyz" || ext == "pwn") return read_XYZ(fname, output, np); @@ -128,6 +130,6 @@ bool read_points(const std::string& fname, OutputIterator output) /// \endcond -} // namespace CGAL +} } // namespace CGAL::IO #endif // CGAL_POINT_SET_PROCESSING_READ_POINTS_H diff --git a/Point_set_processing_3/include/CGAL/IO/read_xyz_points.h b/Point_set_processing_3/include/CGAL/IO/read_xyz_points.h index 00f64422095..a414ddb839a 100644 --- a/Point_set_processing_3/include/CGAL/IO/read_xyz_points.h +++ b/Point_set_processing_3/include/CGAL/IO/read_xyz_points.h @@ -37,6 +37,8 @@ namespace CGAL { +namespace IO { + /** \ingroup PkgPointSetProcessing3IOXyz @@ -228,7 +230,7 @@ bool read_XYZ(const std::string& fname, const CGAL_BGL_NP_CLASS& np) { std::ifstream is(fname); - return read_XYZ(is, output, np); + return read_XYZ(is, output, np); } /// \cond SKIP_IN_MANUAL @@ -275,6 +277,8 @@ bool read_XYZ(const std::string& fname, OutputIterator output) return read_XYZ::type>(fname, output, parameters::all_default()); } +} // namespace IO + /// \endcond #ifndef CGAL_NO_DEPRECATED_CODE @@ -293,10 +297,10 @@ bool read_xyz_points_and_normals(std::istream& is, ///< input stream. NormalPMap normal_map, ///< property map: value_type of OutputIterator -> Vector_3. const Kernel& /*kernel*/) ///< geometric traits. { - return read_XYZ(is, output, - parameters::point_map(point_map) - .normal_map(normal_map) - .geom_traits(Kernel())); + return IO::read_XYZ(is, output, + parameters::point_map(point_map) + .normal_map(normal_map) + .geom_traits(Kernel())); } template Vector_3. const Kernel& kernel) ///< geometric traits. { - return read_XYZ::type>(is, output, - parameters::point_map(point_map) - .normal_map(normal_map) - .geom_traits(kernel)); + return IO::read_XYZ::type>(is, output, + parameters::point_map(point_map) + .normal_map(normal_map) + .geom_traits(kernel)); } template Point_3. NormalPMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3. { - return read_XYZ(is, output, - parameters::point_map(point_map) - .normal_map(normal_map)); + return IO::read_XYZ(is, output, + parameters::point_map(point_map) + .normal_map(normal_map)); } template Point_3. NormalPMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3. { - return read_XYZ::type>(is, output, - parameters::point_map(point_map) - .normal_map(normal_map)); + return IO::read_XYZ::type>(is, output, + parameters::point_map(point_map) + .normal_map(normal_map)); } template Vector_3. { - return read_XYZ(is, output, parameters::normal_map(normal_map)); + return IO::read_XYZ(is, output, parameters::normal_map(normal_map)); } template Vector_3. { - return read_XYZ::type>(is, output, - parameters::normal_map(normal_map)); + return IO::read_XYZ::type>(is, output, + parameters::normal_map(normal_map)); } template Point_3. const Kernel& kernel) ///< geometric traits. { - return read_XYZ(is, output, - parameters::point_map(point_map) - .geom_traits(kernel)); + return IO::read_XYZ(is, output, + parameters::point_map(point_map) + .geom_traits(kernel)); } template Point_3. const Kernel& kernel) ///< geometric traits. { - return read_XYZ::type>(is, output, - parameters::point_map(point_map) - .geom_traits(kernel)); + return IO::read_XYZ::type>(is, output, + parameters::point_map(point_map) + .geom_traits(kernel)); } template Point_3. { - return read_XYZ(is, output, parameters::point_map(point_map)); + return IO::read_XYZ(is, output, parameters::point_map(point_map)); } template Point_3. { - return read_XYZ::type>(is, output, - parameters::point_map(point_map)); + return IO::read_XYZ::type>(is, output, + parameters::point_map(point_map)); } /// \endcond @@ -423,8 +427,8 @@ bool read_xyz_points(std::istream& is, ///< input stream. /** \ingroup PkgPointSetProcessing3IODeprecated - \deprecated This function is deprecated since \cgal 5.2, - \link PkgPointSetProcessing3IOXyz `CGAL::read_XYZ()` \endlink should be used instead. + \deprecated This function is deprecated since \cgal 5.3, + \link PkgPointSetProcessing3IOXyz `CGAL::IO::read_XYZ()` \endlink should be used instead. \returns `true` if reading was successful, `false` otherwise. */ @@ -435,7 +439,7 @@ CGAL_DEPRECATED bool read_xyz_points(std::istream& is, OutputIterator output, const CGAL_BGL_NP_CLASS& np) { - return read_XYZ(is, output, np); + return IO::read_XYZ(is, output, np); } /// \cond SKIP_IN_MANUAL @@ -445,7 +449,7 @@ template (is, output, parameters::all_default()); + return IO::read_XYZ(is, output, parameters::all_default()); } template ::type>(is, output, np); + return IO::read_XYZ::type>(is, output, np); } template CGAL_DEPRECATED bool read_xyz_points(std::istream& is, OutputIterator output) { - return read_XYZ::type>(is, output, parameters::all_default()); + return IO::read_XYZ::type>(is, output, parameters::all_default()); } /// \endcond diff --git a/Point_set_processing_3/include/CGAL/IO/write_las_points.h b/Point_set_processing_3/include/CGAL/IO/write_las_points.h index fc54662f2b8..14679ca570a 100644 --- a/Point_set_processing_3/include/CGAL/IO/write_las_points.h +++ b/Point_set_processing_3/include/CGAL/IO/write_las_points.h @@ -66,6 +66,8 @@ namespace CGAL { +namespace IO { + /** \ingroup PkgPointSetProcessing3IOLas @@ -286,7 +288,7 @@ bool write_LAS(std::ostream& os, const PointRange& points, const CGAL_BGL_NP_CLASS& np #ifndef DOXYGEN_RUNNING - , typename boost::enable_if >::type* = nullptr + , typename boost::enable_if >::type* = nullptr #endif ) { @@ -341,12 +343,12 @@ bool write_LAS(const std::string& filename, const PointRange& points, const CGAL_BGL_NP_CLASS& np #ifndef DOXYGEN_RUNNING - , typename boost::enable_if >::type* = nullptr + , typename boost::enable_if >::type* = nullptr #endif ) { std::ofstream os(filename, std::ios::binary); - CGAL::set_mode(os, CGAL::IO::BINARY); + CGAL::IO::set_mode(os, CGAL::IO::BINARY); return write_LAS(os, points, np); } @@ -355,24 +357,28 @@ bool write_LAS(const std::string& filename, // variant with default NP template bool write_LAS(std::ostream& os, const PointRange& points, - typename boost::enable_if >::type* = nullptr) + typename boost::enable_if >::type* = nullptr) { return write_LAS(os, points, CGAL::Point_set_processing_3::parameters::all_default(points)); } template bool write_LAS(const std::string& filename, const PointRange& points, - typename boost::enable_if >::type* = nullptr) + typename boost::enable_if >::type* = nullptr) { std::ofstream os(filename, std::ios::binary); - CGAL::set_mode(os, CGAL::IO::BINARY); + CGAL::IO::set_mode(os, CGAL::IO::BINARY); return write_LAS(os, points, parameters::all_default()); } /// \endcond +} // namespace IO + #ifndef CGAL_NO_DEPRECATED_CODE +using IO::make_las_point_writer; + /// \cond SKIP_IN_MANUAL template Point_3. { CGAL::Iterator_range points (first, beyond); - return write_LAS(os, points, parameters::point_map(point_map)); + return IO::write_LAS(os, points, parameters::point_map(point_map)); } template @@ -394,7 +400,7 @@ bool write_las_points(std::ostream& os, ///< output stream. ForwardIterator beyond) ///< past-the-end input point. { CGAL::Iterator_range points (first, beyond); - return write_LAS(os, points); + return IO::write_LAS(os, points); } /// \endcond @@ -402,7 +408,7 @@ bool write_las_points(std::ostream& os, ///< output stream. /** \ingroup PkgPointSetProcessing3IODeprecated - \deprecated This function is deprecated since \cgal 5.2, `CGAL::write_LAS_with_properties()` should be used instead. + \deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::write_LAS_with_properties()` should be used instead. */ template point_property, + IO::LAS_property::X, + IO::LAS_property::Y, + IO::LAS_property::Z> point_property, PropertyHandler&& ... properties) { - return write_LAS_with_properties(os, points, point_property, std::forward(properties)...); + return IO::write_LAS_with_properties(os, points, point_property, std::forward(properties)...); } /** \ingroup PkgPointSetProcessing3IODeprecated - \deprecated This function is deprecated since \cgal 5.2, `CGAL::write_LAS()` should be used instead. + \deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::write_LAS()` should be used instead. */ template bool write_las_points(std::ostream& os, const PointRange& points, const CGAL_BGL_NP_CLASS& np) { - return write_LAS(os, points, np); + return IO::write_LAS(os, points, np); } #endif //CGAL_NO_DEPRECATED_CODE diff --git a/Point_set_processing_3/include/CGAL/IO/write_off_points.h b/Point_set_processing_3/include/CGAL/IO/write_off_points.h index ab5a9169338..8985e286e39 100644 --- a/Point_set_processing_3/include/CGAL/IO/write_off_points.h +++ b/Point_set_processing_3/include/CGAL/IO/write_off_points.h @@ -89,6 +89,8 @@ bool write_OFF_PSP(std::ostream& os, } // namespace internal } // namespace Point_set_processing_3 +namespace IO { + /** \ingroup PkgPointSetProcessing3IOOff @@ -135,7 +137,7 @@ bool write_OFF(std::ostream& os, const PointRange& points, const CGAL_BGL_NP_CLASS& np #ifndef DOXYGEN_RUNNING - , typename boost::enable_if >::type* = nullptr + , typename boost::enable_if >::type* = nullptr #endif ) { @@ -146,7 +148,7 @@ bool write_OFF(std::ostream& os, template bool write_OFF(std::ostream& os, const PointRange& points, - typename boost::enable_if >::type* = nullptr) + typename boost::enable_if >::type* = nullptr) { return write_OFF(os, points, parameters::all_default()); } @@ -202,7 +204,7 @@ bool write_OFF(const std::string& filename, const PointRange& points, const CGAL_BGL_NP_CLASS& np #ifndef DOXYGEN_RUNNING - , typename boost::enable_if >::type* = nullptr + , typename boost::enable_if >::type* = nullptr #endif ) { @@ -215,7 +217,7 @@ bool write_OFF(const std::string& filename, template bool write_OFF(const std::string& filename, const PointRange& points, - typename boost::enable_if >::type* = nullptr) + typename boost::enable_if >::type* = nullptr) { std::ofstream os(filename); return write_OFF(os, points, parameters::all_default()); @@ -223,6 +225,8 @@ bool write_OFF(const std::string& filename, const PointRange& points, /// \endcond +} // IO namespace + #ifndef CGAL_NO_DEPRECATED_CODE /// \cond SKIP_IN_MANUAL @@ -319,13 +323,13 @@ bool write_off_points(std::ostream& os, ///< output stream. /** \ingroup PkgPointSetProcessing3IODeprecated - \deprecated This function is deprecated since \cgal 5.2, - \link PkgPointSetProcessing3IOOff `CGAL::write_OFF()` \endlink should be used instead. + \deprecated This function is deprecated since \cgal 5.3, + \link PkgPointSetProcessing3IOOff `CGAL::IO::write_OFF()` \endlink should be used instead. */ template CGAL_DEPRECATED bool write_off_points(std::ostream& os, const PointRange& points, const CGAL_BGL_NP_CLASS& np) { - return write_OFF(os, points, np); + return IO::write_OFF(os, points, np); } /// \cond SKIP_IN_MANUAL @@ -334,7 +338,7 @@ CGAL_DEPRECATED bool write_off_points(std::ostream& os, const PointRange& points template CGAL_DEPRECATED bool write_off_points(std::ostream& os, const PointRange& points) { - return write_OFF(os, points, parameters::all_default()); + return IO::write_OFF(os, points, parameters::all_default()); } /// \endcond diff --git a/Point_set_processing_3/include/CGAL/IO/write_ply_points.h b/Point_set_processing_3/include/CGAL/IO/write_ply_points.h index 14cf9256949..33c1b8da3b5 100644 --- a/Point_set_processing_3/include/CGAL/IO/write_ply_points.h +++ b/Point_set_processing_3/include/CGAL/IO/write_ply_points.h @@ -40,6 +40,8 @@ namespace CGAL { +namespace IO { + #ifdef DOXYGEN_RUNNING // Document some parts from Stream_support here for convenience /** \ingroup PkgPointSetProcessing3IOPly @@ -92,7 +94,7 @@ namespace CGAL { user wants to write a complex object as several %PLY properties. In that case, a specialization of `Output_rep` must be provided for `PropertyMap::value_type` that handles both ASCII - and binary output (see `CGAL::get_mode()`). + and binary output (see `CGAL::IO::get_mode()`). \attention When writing to a binary file, the flag `std::ios::binary` flag must be set during the creation of the `ofstream`. @@ -123,17 +125,17 @@ template (properties)...); + internal::output_property_header (os, std::forward(properties)...); os << "end_header" << std::endl; // Write positions + normals for(typename PointRange::const_iterator it = points.begin(); it != points.end(); it++) - IO::internal::output_properties (os, it, std::forward(properties)...); + internal::output_properties (os, it, std::forward(properties)...); return !os.fail(); } @@ -189,7 +191,7 @@ bool write_PLY(std::ostream& os, const PointRange& points, const CGAL_BGL_NP_CLASS& np #ifndef DOXYGEN_RUNNING - , typename boost::enable_if >::type* = nullptr + , typename boost::enable_if >::type* = nullptr #endif ) { @@ -226,7 +228,7 @@ bool write_PLY(std::ostream& os, template bool write_PLY(std::ostream& os, const PointRange& points, - typename boost::enable_if >::type* = nullptr) + typename boost::enable_if >::type* = nullptr) { return write_PLY(os, points, parameters::all_default()); } @@ -288,7 +290,7 @@ bool write_PLY(const std::string& filename, const PointRange& points, const CGAL_BGL_NP_CLASS& np #ifndef DOXYGEN_RUNNING - , typename boost::enable_if >::type* = nullptr + , typename boost::enable_if >::type* = nullptr #endif ) { @@ -296,13 +298,13 @@ bool write_PLY(const std::string& filename, if(binary) { std::ofstream os(filename, std::ios::binary); - CGAL::set_mode(os, CGAL::IO::BINARY); + CGAL::IO::set_mode(os, CGAL::IO::BINARY); return write_PLY(os, points, np); } else { std::ofstream os(filename); - CGAL::set_mode(os, CGAL::IO::ASCII); + CGAL::IO::set_mode(os, CGAL::IO::ASCII); return write_PLY(os, points, np); } } @@ -311,13 +313,15 @@ bool write_PLY(const std::string& filename, template bool write_PLY(const std::string& filename, const PointRange& points, - typename boost::enable_if >::type* = nullptr) + typename boost::enable_if >::type* = nullptr) { return write_PLY(filename, points, parameters::all_default()); } /// \endcond +} // namespace IO + #ifndef CGAL_NO_DEPRECATED_CODE /// \cond SKIP_IN_MANUAL @@ -333,7 +337,7 @@ bool write_ply_points_and_normals(std::ostream& os, ///< output stream. VectorMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3. { CGAL::Iterator_range points (first, beyond); - return write_PLY(os, points, parameters::point_map(point_map) + return IO::write_PLY(os, points, parameters::point_map(point_map) .normal_map(normal_map)); } @@ -346,7 +350,7 @@ bool write_ply_points_and_normals(std::ostream& os, ///< output stream. VectorMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3. { CGAL::Iterator_range points(first, beyond); - return write_PLY(os, points, parameters::normal_map (normal_map)); + return IO::write_PLY(os, points, parameters::normal_map (normal_map)); } template Point_3. { CGAL::Iterator_range points(first, beyond); - return write_PLY(os, points, parameters::point_map(point_map)); + return IO::write_PLY(os, points, parameters::point_map(point_map)); } template @@ -368,7 +372,7 @@ bool write_ply_points(std::ostream& os, ///< output stream. ForwardIterator beyond) ///< past-the-end input point. { CGAL::Iterator_range points (first, beyond); - return write_PLY(os, points); + return IO::write_PLY(os, points); } /// \endcond @@ -376,8 +380,8 @@ bool write_ply_points(std::ostream& os, ///< output stream. /** \ingroup PkgPointSetProcessing3IODeprecated -\deprecated This function is deprecated since \cgal 5.2, - \link PkgPointSetProcessing3IOPly `CGAL::write_PLY_with_properties()` \endlink should be used instead. +\deprecated This function is deprecated since \cgal 5.3, + \link PkgPointSetProcessing3IOPly `CGAL::IO::write_PLY_with_properties()` \endlink should be used instead. */ template @@ -385,19 +389,19 @@ CGAL_DEPRECATED bool write_ply_points_with_properties(std::ostream& os, ///< out const PointRange& points, ///< input point range. PropertyHandler&& ... properties) ///< parameter pack of property handlers { - return write_PLY_with_properties(os, points, std::forward(properties)...); + return IO::write_PLY_with_properties(os, points, std::forward(properties)...); } /** \ingroup PkgPointSetProcessing3IODeprecated -\deprecated This function is deprecated since \cgal 5.2, - \link PkgPointSetProcessing3IOPly `CGAL::write_PLY()` \endlink should be used instead. +\deprecated This function is deprecated since \cgal 5.3, + \link PkgPointSetProcessing3IOPly `CGAL::IO::write_PLY()` \endlink should be used instead. */ template CGAL_DEPRECATED bool write_ply_points(std::ostream& os, const PointRange& points, const CGAL_BGL_NP_CLASS& np) { - return write_PLY(os, points, np); + return IO::write_PLY(os, points, np); } /// \cond SKIP_IN_MANUAL @@ -405,7 +409,7 @@ CGAL_DEPRECATED bool write_ply_points(std::ostream& os, const PointRange& points template CGAL_DEPRECATED bool write_ply_points(std::ostream& os, const PointRange& points) { - return write_PLY(os, points, parameters::all_default()); + return IO::write_PLY(os, points, parameters::all_default()); } /// \endcond diff --git a/Point_set_processing_3/include/CGAL/IO/write_points.h b/Point_set_processing_3/include/CGAL/IO/write_points.h index e663fbe318f..61d64bfe8b1 100644 --- a/Point_set_processing_3/include/CGAL/IO/write_points.h +++ b/Point_set_processing_3/include/CGAL/IO/write_points.h @@ -33,6 +33,8 @@ namespace CGAL { +namespace IO { + /** \ingroup PkgPointSetProcessing3IO @@ -96,11 +98,11 @@ bool write_points(const std::string& fname, const PointRange& points, const CGAL_BGL_NP_CLASS& np, #ifndef DOXYGEN_RUNNING - typename boost::enable_if >::type* = nullptr + typename boost::enable_if >::type* = nullptr #endif ) { - const std::string ext = IO::internal::get_file_extension(fname); + const std::string ext = internal::get_file_extension(fname); if(ext == "xyz" || ext == "pwn") return write_XYZ(fname, points, np); @@ -120,13 +122,13 @@ bool write_points(const std::string& fname, template bool write_points(const std::string& fname,const PointRange& points, - typename boost::enable_if >::type* = nullptr) + typename boost::enable_if >::type* = nullptr) { return write_points(fname, points, parameters::all_default()); } /// \endcond -} // namespace CGAL +} } // namespace CGAL::IO #endif // CGAL_POINT_SET_PROCESSING_WRITE_POINTS_H diff --git a/Point_set_processing_3/include/CGAL/IO/write_xyz_points.h b/Point_set_processing_3/include/CGAL/IO/write_xyz_points.h index 5ccfa93d943..403f1d25f05 100644 --- a/Point_set_processing_3/include/CGAL/IO/write_xyz_points.h +++ b/Point_set_processing_3/include/CGAL/IO/write_xyz_points.h @@ -86,6 +86,8 @@ bool write_XYZ_PSP(std::ostream& os, } // namespace internal } // Point_set_processing_3 +namespace IO { + /** \ingroup PkgPointSetProcessing3IOXyz @@ -132,7 +134,7 @@ bool write_XYZ(std::ostream& os, const PointRange& points, const CGAL_BGL_NP_CLASS& np #ifndef DOXYGEN_RUNNING - , typename boost::enable_if >::type* = nullptr + , typename boost::enable_if >::type* = nullptr #endif ) { @@ -143,7 +145,7 @@ bool write_XYZ(std::ostream& os, template bool write_XYZ(std::ostream& os, const PointRange& points, - typename boost::enable_if >::type* = nullptr) + typename boost::enable_if >::type* = nullptr) { return write_XYZ(os, points, parameters::all_default()); } @@ -196,7 +198,7 @@ bool write_XYZ(const std::string& filename, const PointRange& points, const CGAL_BGL_NP_CLASS& np #ifndef DOXYGEN_RUNNING - , typename boost::enable_if >::type* = nullptr + , typename boost::enable_if >::type* = nullptr #endif ) { @@ -208,7 +210,7 @@ bool write_XYZ(const std::string& filename, template bool write_XYZ(const std::string& filename, const PointRange& points, - typename boost::enable_if >::type* = nullptr) + typename boost::enable_if >::type* = nullptr) { std::ofstream os(filename); return write_XYZ(os, points, parameters::all_default()); @@ -216,6 +218,8 @@ bool write_XYZ(const std::string& filename, const PointRange& points, /// \endcond +} // namespace IO + #ifndef CGAL_NO_DEPRECATED_CODE /// \cond SKIP_IN_MANUAL @@ -233,10 +237,10 @@ bool write_xyz_points_and_normals(std::ostream& os, ///< output stream. const Kernel& /*kernel*/) ///< geometric traits. { CGAL::Iterator_range points(first, beyond); - return write_XYZ(os, points, - parameters::point_map(point_map) - .normal_map(normal_map) - .geom_traits(Kernel())); + return IO::write_XYZ(os, points, + parameters::point_map(point_map) + .normal_map(normal_map) + .geom_traits(Kernel())); } template Vector_3. { CGAL::Iterator_range points (first, beyond); - return write_XYZ(os, points, - parameters::point_map(point_map) - .normal_map(normal_map)); + return IO::write_XYZ(os, points, + parameters::point_map(point_map) + .normal_map(normal_map)); } template Vector_3. { CGAL::Iterator_range points(first, beyond); - return write_XYZ(os, points, parameters::normal_map(normal_map)); + return IO::write_XYZ(os, points, parameters::normal_map(normal_map)); } template points (first, beyond); - return write_XYZ(os, points, parameters::point_map(point_map) + return IO::write_XYZ(os, points, parameters::point_map(point_map) .geom_traits (kernel)); } @@ -292,7 +296,7 @@ bool write_xyz_points(std::ostream& os, ///< output stream. PointMap point_map) ///< property map: value_type of OutputIterator -> Point_3. { CGAL::Iterator_range points(first, beyond); - return write_XYZ(os, points, parameters::point_map(point_map)); + return IO::write_XYZ(os, points, parameters::point_map(point_map)); } template @@ -302,7 +306,7 @@ bool write_xyz_points(std::ostream& os, ///< output stream. ForwardIterator beyond) ///< past-the-end input point. { CGAL::Iterator_range points (first, beyond); - return write_XYZ(os, points); + return IO::write_XYZ(os, points); } /// \endcond @@ -310,13 +314,13 @@ bool write_xyz_points(std::ostream& os, ///< output stream. /** \ingroup PkgPointSetProcessing3IODeprecated - \deprecated This function is deprecated since \cgal 5.2, + \deprecated This function is deprecated since \cgal 5.3, \link PkgPointSetProcessing3IOXyz `CGAL::write_XYZ()` \endlink should be used instead. */ template CGAL_DEPRECATED bool write_xyz_points(std::ostream& os, const PointRange& points, const CGAL_BGL_NP_CLASS& np) { - return write_XYZ(os, points, np); + return IO::write_XYZ(os, points, np); } /// \cond SKIP_IN_MANUAL @@ -324,7 +328,7 @@ CGAL_DEPRECATED bool write_xyz_points(std::ostream& os, const PointRange& points template CGAL_DEPRECATED bool write_xyz_points(std::ostream& os, const PointRange& points) { - return write_XYZ(os, points, parameters::all_default(points)); + return IO::write_XYZ(os, points, parameters::all_default()); } /// \endcond diff --git a/Point_set_processing_3/include/CGAL/Point_set_processing_3/internal/Callback_wrapper.h b/Point_set_processing_3/include/CGAL/Point_set_processing_3/internal/Callback_wrapper.h index c52826db44b..229eae5897a 100644 --- a/Point_set_processing_3/include/CGAL/Point_set_processing_3/internal/Callback_wrapper.h +++ b/Point_set_processing_3/include/CGAL/Point_set_processing_3/internal/Callback_wrapper.h @@ -13,10 +13,10 @@ #define CGAL_PSP_INTERNAL_CALLBACK_WRAPPER_H #include - +#include +#include #include -#include namespace CGAL { namespace Point_set_processing_3 { @@ -91,11 +91,11 @@ template <> class Callback_wrapper { const std::function& m_callback; - cpp11::atomic* m_advancement; - cpp11::atomic* m_interrupted; + std::atomic* m_advancement; + std::atomic* m_interrupted; std::size_t m_size; bool m_creator; - cpp11::thread* m_thread; + std::thread* m_thread; // assignment operator shouldn't be used (m_callback is const ref) Callback_wrapper& operator= (const Callback_wrapper&) @@ -109,17 +109,17 @@ public: std::size_t advancement = 0, bool interrupted = false) : m_callback (callback) - , m_advancement (new cpp11::atomic()) - , m_interrupted (new cpp11::atomic()) + , m_advancement (new std::atomic()) + , m_interrupted (new std::atomic()) , m_size (size) , m_creator (true) , m_thread (nullptr) { - // cpp11::atomic only has default constructor, initialization done in two steps + // std::atomic only has default constructor, initialization done in two steps *m_advancement = advancement; *m_interrupted = interrupted; if (m_callback) - m_thread = new cpp11::thread (*this); + m_thread = new std::thread (*this); } Callback_wrapper (const Callback_wrapper& other) @@ -150,11 +150,11 @@ public: *m_advancement = advancement; *m_interrupted = interrupted; if (m_callback) - m_thread = new cpp11::thread (*this); + m_thread = new std::thread (*this); } - cpp11::atomic& advancement() { return *m_advancement; } - cpp11::atomic& interrupted() { return *m_interrupted; } + std::atomic& advancement() { return *m_advancement; } + std::atomic& interrupted() { return *m_interrupted; } void join() { if (m_thread != nullptr) @@ -169,7 +169,9 @@ public: *m_interrupted = true; if (*m_interrupted) return; - cpp11::sleep_for (0.00001); + typedef std::chrono::nanoseconds nanoseconds; + nanoseconds ns (nanoseconds::rep (1000000000.0 * 0.00001)); + std::this_thread::sleep_for(ns); } if (m_callback) m_callback (1.); diff --git a/Point_set_processing_3/test/Point_set_processing_3/analysis_test.cpp b/Point_set_processing_3/test/Point_set_processing_3/analysis_test.cpp index 5745b19fbb3..0912829311c 100644 --- a/Point_set_processing_3/test/Point_set_processing_3/analysis_test.cpp +++ b/Point_set_processing_3/test/Point_set_processing_3/analysis_test.cpp @@ -99,7 +99,7 @@ int main(int argc, char * argv[]) std::cerr << "Open " << argv[i] << " for reading..." << std::endl; // If XYZ file format: - if(CGAL::read_points(argv[i], std::back_inserter(points))) + if(CGAL::IO::read_points(argv[i], std::back_inserter(points))) { std::cerr << "ok (" << points.size() << " points)" << std::endl; } diff --git a/Point_set_processing_3/test/Point_set_processing_3/bilateral_smoothing_test.cpp b/Point_set_processing_3/test/Point_set_processing_3/bilateral_smoothing_test.cpp index 45dad2baa51..479dc82fd93 100644 --- a/Point_set_processing_3/test/Point_set_processing_3/bilateral_smoothing_test.cpp +++ b/Point_set_processing_3/test/Point_set_processing_3/bilateral_smoothing_test.cpp @@ -108,10 +108,10 @@ int main(int argc, char * argv[]) std::cerr << "Opening " << argv[i] << " for reading..." << std::endl; // If XYZ file format: - if(CGAL::read_points(argv[i], - std::back_inserter(points), - CGAL::parameters::point_map(CGAL::First_of_pair_property_map()) - .normal_map(CGAL::Second_of_pair_property_map()))) + if(CGAL::IO::read_points(argv[i], + std::back_inserter(points), + CGAL::parameters::point_map(CGAL::First_of_pair_property_map()) + .normal_map(CGAL::Second_of_pair_property_map()))) { std::cerr << "ok (" << points.size() << " points)" << std::endl; } 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 c6279fbeb48..efd939f928b 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 @@ -118,10 +118,10 @@ int main(int argc, char * argv[]) std::cerr << "Opening " << argv[i] << " for reading..." << std::endl; // If XYZ file format: - if(CGAL::read_points(argv[i], - std::back_inserter(points), - CGAL::parameters::point_map(CGAL::First_of_pair_property_map()) - .normal_map(CGAL::Second_of_pair_property_map()))) + if(CGAL::IO::read_points(argv[i], + std::back_inserter(points), + CGAL::parameters::point_map(CGAL::First_of_pair_property_map()) + .normal_map(CGAL::Second_of_pair_property_map()))) { std::cerr << "ok (" << points.size() << " points)" << std::endl; } 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 cd011c9b71f..a2af205fa05 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 @@ -310,10 +310,10 @@ int main(int argc, char * argv[]) { std::ifstream stream(input_filename.c_str()); success = stream && - CGAL::read_OFF(stream, - std::back_inserter(points), - CGAL::parameters::normal_map - (CGAL::make_normal_of_point_with_normal_map(PointList::value_type())) + CGAL::IO::read_OFF(stream, + std::back_inserter(points), + CGAL::parameters::normal_map + (CGAL::make_normal_of_point_with_normal_map(PointList::value_type())) ); } // If XYZ file format @@ -321,9 +321,9 @@ int main(int argc, char * argv[]) extension == ".pwn" || extension == ".PWN") { std::ifstream stream(input_filename.c_str()); - success = stream && CGAL::read_XYZ(stream, - std::back_inserter(points), - CGAL::parameters::normal_map(CGAL::make_normal_of_point_with_normal_map(PointList::value_type()))); + success = stream && CGAL::IO::read_XYZ(stream, + std::back_inserter(points), + CGAL::parameters::normal_map(CGAL::make_normal_of_point_with_normal_map(PointList::value_type()))); } if (success) { diff --git a/Point_set_processing_3/test/Point_set_processing_3/read_test.cpp b/Point_set_processing_3/test/Point_set_processing_3/read_test.cpp index e4dacad400d..1f3217ca8c4 100644 --- a/Point_set_processing_3/test/Point_set_processing_3/read_test.cpp +++ b/Point_set_processing_3/test/Point_set_processing_3/read_test.cpp @@ -17,33 +17,33 @@ typedef std::pair PointVectorPair; bool read(std::string s) { std::vector pv_pairs; - return CGAL::read_points(s, back_inserter(pv_pairs), - CGAL::parameters::point_map(CGAL::First_of_pair_property_map()) - .normal_map(CGAL::Second_of_pair_property_map())); + return CGAL::IO::read_points(s, back_inserter(pv_pairs), + CGAL::parameters::point_map(CGAL::First_of_pair_property_map()) + .normal_map(CGAL::Second_of_pair_property_map())); } bool read(std::string s, std::vector& pv_pairs) { - return CGAL::read_points(s, back_inserter(pv_pairs), - CGAL::parameters::point_map(CGAL::First_of_pair_property_map()) - .normal_map(CGAL::Second_of_pair_property_map())); + return CGAL::IO::read_points(s, back_inserter(pv_pairs), + CGAL::parameters::point_map(CGAL::First_of_pair_property_map()) + .normal_map(CGAL::Second_of_pair_property_map())); } bool read_off(std::string s, std::vector& pv_pairs) { - return CGAL::read_OFF(s, back_inserter(pv_pairs), - CGAL::parameters::point_map(CGAL::First_of_pair_property_map()) - .normal_map(CGAL::Second_of_pair_property_map())); + return CGAL::IO::read_OFF(s, back_inserter(pv_pairs), + CGAL::parameters::point_map(CGAL::First_of_pair_property_map()) + .normal_map(CGAL::Second_of_pair_property_map())); } bool read_ply(std::string s, std::vector& pv_pairs) { - return CGAL::read_PLY(s, back_inserter(pv_pairs), - CGAL::parameters::point_map(CGAL::First_of_pair_property_map()) - .normal_map(CGAL::Second_of_pair_property_map())); + return CGAL::IO::read_PLY(s, back_inserter(pv_pairs), + CGAL::parameters::point_map(CGAL::First_of_pair_property_map()) + .normal_map(CGAL::Second_of_pair_property_map())); } int main() diff --git a/Point_set_processing_3/test/Point_set_processing_3/read_test_with_different_pmaps.cpp b/Point_set_processing_3/test/Point_set_processing_3/read_test_with_different_pmaps.cpp index 316e832db0d..93585569d14 100644 --- a/Point_set_processing_3/test/Point_set_processing_3/read_test_with_different_pmaps.cpp +++ b/Point_set_processing_3/test/Point_set_processing_3/read_test_with_different_pmaps.cpp @@ -77,7 +77,7 @@ bool test_no_deduction_points_and_normals_xyz(const char* file_name) // read with custom output iterator type dummy_counter::counter = 0; std::ifstream input(file_name); - CGAL::read_XYZ( + CGAL::IO::read_XYZ( input, back_inserter(indices), CGAL::parameters::point_map (points). normal_map (normals). @@ -87,7 +87,7 @@ bool test_no_deduction_points_and_normals_xyz(const char* file_name) input.clear(); input.close(); input.open(file_name); - CGAL::read_XYZ( + CGAL::IO::read_XYZ( input, back_inserter(pv_pairs), CGAL::parameters::point_map(CGAL::First_of_pair_property_map()). normal_map(CGAL::Second_of_pair_property_map()). @@ -107,7 +107,7 @@ bool test_no_deduction_points_and_normals_off(const char* file_name) // read with custom output iterator type dummy_counter::counter = 0; std::ifstream input(file_name); - CGAL::read_OFF( + CGAL::IO::read_OFF( input, back_inserter(indices), CGAL::parameters::point_map(points). normal_map(normals). @@ -117,7 +117,7 @@ bool test_no_deduction_points_and_normals_off(const char* file_name) input.clear(); input.close(); input.open(file_name); - CGAL::read_OFF( + CGAL::IO::read_OFF( input, back_inserter(pv_pairs), CGAL::parameters::point_map(CGAL::First_of_pair_property_map()). normal_map(CGAL::Second_of_pair_property_map()). @@ -136,7 +136,7 @@ bool test_no_deduction_points_xyz(const char* file_name) // read with custom output iterator type dummy_counter::counter = 0; std::ifstream input(file_name); - CGAL::read_XYZ( + CGAL::IO::read_XYZ( input, back_inserter(indices), CGAL::parameters::point_map(points_1).geom_traits(Kernel())); @@ -144,7 +144,7 @@ bool test_no_deduction_points_xyz(const char* file_name) input.clear(); input.close(); input.open(file_name); - CGAL::read_XYZ( + CGAL::IO::read_XYZ( input, back_inserter(points_2), CGAL::parameters::point_map(CGAL::Identity_property_map()). geom_traits(Kernel())); @@ -162,7 +162,7 @@ bool test_no_deduction_points_off(const char* file_name) // read with custom output iterator type dummy_counter::counter = 0; std::ifstream input(file_name); - CGAL::read_OFF( + CGAL::IO::read_OFF( input, back_inserter(indices), CGAL::parameters::point_map(points_1). geom_traits(Kernel())); @@ -171,7 +171,7 @@ bool test_no_deduction_points_off(const char* file_name) input.clear(); input.close(); input.open(file_name); - CGAL::read_OFF( + CGAL::IO::read_OFF( input, back_inserter(points_2), CGAL::parameters::point_map(CGAL::Identity_property_map()). geom_traits(Kernel())); @@ -186,14 +186,14 @@ void compile_test() { std::ifstream input; input.open("data/read_test/simple.xyz"); - CGAL::read_XYZ( + CGAL::IO::read_XYZ( input, std::front_inserter(points)); input.clear(); input.close(); input.open("data/read_test/simple.xyz"); - CGAL::read_XYZ( + CGAL::IO::read_XYZ( input, std::front_inserter(points), CGAL::parameters::point_map(CGAL::Identity_property_map())); @@ -201,7 +201,7 @@ void compile_test() { input.close(); input.open("data/read_test/simple.xyz"); - CGAL::read_XYZ( + CGAL::IO::read_XYZ( input, std::front_inserter(points), CGAL::parameters::point_map(CGAL::Identity_property_map()). @@ -211,21 +211,21 @@ void compile_test() { // this will span all OutputIteratorValueType versions input.open("data/read_test/simple.xyz"); - CGAL::read_XYZ( + CGAL::IO::read_XYZ( input, std::front_inserter(points)); input.clear(); input.close(); //----------------------------------------------------------------------- input.open("data/read_test/simple.off"); - CGAL::read_OFF( + CGAL::IO::read_OFF( input, std::front_inserter(points)); input.clear(); input.close(); input.open("data/read_test/simple.off"); - CGAL::read_OFF( + CGAL::IO::read_OFF( input, std::front_inserter(points), CGAL::parameters::point_map(CGAL::Identity_property_map())); @@ -233,7 +233,7 @@ void compile_test() { input.close(); input.open("data/read_test/simple.off"); - CGAL::read_OFF( + CGAL::IO::read_OFF( input, std::front_inserter(points), CGAL::parameters::point_map(CGAL::Identity_property_map()). @@ -243,14 +243,14 @@ void compile_test() { // this will span all OutputIteratorValueType versions input.open("data/read_test/simple.off"); - CGAL::read_OFF( + CGAL::IO::read_OFF( input, std::front_inserter(points)); input.clear(); input.close(); //----------------------------------------------------------------------- input.open("data/read_test/simple.xyz"); - CGAL::read_XYZ( + CGAL::IO::read_XYZ( input, std::front_inserter(points), CGAL::parameters::normal_map(boost::dummy_property_map())); @@ -258,7 +258,7 @@ void compile_test() { input.close(); input.open("data/read_test/simple.xyz"); - CGAL::read_XYZ( + CGAL::IO::read_XYZ( input, std::front_inserter(pv_pairs), CGAL::parameters::point_map(CGAL::First_of_pair_property_map()). @@ -267,7 +267,7 @@ void compile_test() { input.close(); input.open("data/read_test/simple.xyz"); - CGAL::read_XYZ( + CGAL::IO::read_XYZ( input, std::front_inserter(pv_pairs), CGAL::parameters::point_map(CGAL::First_of_pair_property_map()). @@ -277,7 +277,7 @@ void compile_test() { input.close(); input.open("data/read_test/simple.xyz"); - CGAL::read_XYZ( + CGAL::IO::read_XYZ( input, std::front_inserter(points), CGAL::parameters::normal_map(boost::dummy_property_map())); @@ -285,7 +285,7 @@ void compile_test() { input.close(); //----------------------------------------------------------------------- input.open("data/read_test/simple.off"); - CGAL::read_OFF( + CGAL::IO::read_OFF( input, std::front_inserter(points), CGAL::parameters::normal_map(boost::dummy_property_map())); @@ -293,7 +293,7 @@ void compile_test() { input.close(); input.open("data/read_test/simple.off"); - CGAL::read_OFF( + CGAL::IO::read_OFF( input, std::front_inserter(pv_pairs), CGAL::parameters::point_map(CGAL::First_of_pair_property_map()). @@ -302,7 +302,7 @@ void compile_test() { input.close(); input.open("data/read_test/simple.off"); - CGAL::read_OFF( + CGAL::IO::read_OFF( input, std::front_inserter(pv_pairs), CGAL::parameters::point_map(CGAL::First_of_pair_property_map()). @@ -312,7 +312,7 @@ void compile_test() { input.close(); input.open("data/read_test/simple.off"); - CGAL::read_OFF( + CGAL::IO::read_OFF( input, std::front_inserter(points), CGAL::parameters::normal_map(boost::dummy_property_map())); diff --git a/Point_set_processing_3/test/Point_set_processing_3/remove_outliers_test.cpp b/Point_set_processing_3/test/Point_set_processing_3/remove_outliers_test.cpp index 4f2966d2717..ff8b079ac9e 100644 --- a/Point_set_processing_3/test/Point_set_processing_3/remove_outliers_test.cpp +++ b/Point_set_processing_3/test/Point_set_processing_3/remove_outliers_test.cpp @@ -114,7 +114,7 @@ int main(int argc, char * argv[]) std::cerr << "Open " << argv[i] << " for reading..." << std::endl; // If XYZ file format: - if(CGAL::read_points(argv[i], std::back_inserter(points))) + if(CGAL::IO::read_points(argv[i], std::back_inserter(points))) { std::cerr << "ok (" << points.size() << " points)" << std::endl; } diff --git a/Point_set_processing_3/test/Point_set_processing_3/smoothing_test.cpp b/Point_set_processing_3/test/Point_set_processing_3/smoothing_test.cpp index 30ba51e94ff..0c9f141c13d 100644 --- a/Point_set_processing_3/test/Point_set_processing_3/smoothing_test.cpp +++ b/Point_set_processing_3/test/Point_set_processing_3/smoothing_test.cpp @@ -101,7 +101,7 @@ int main(int argc, char * argv[]) std::cerr << "Open " << argv[i] << " for reading..." << std::endl; // If XYZ file format: - if(CGAL::read_points(argv[i], std::back_inserter(points))) + if(CGAL::IO::read_points(argv[i], std::back_inserter(points))) { std::cerr << "ok (" << points.size() << " points)" << std::endl; } diff --git a/Point_set_processing_3/test/Point_set_processing_3/test_read_write_point_set.cpp b/Point_set_processing_3/test/Point_set_processing_3/test_read_write_point_set.cpp index 9b41a439b14..0dd90f9623d 100644 --- a/Point_set_processing_3/test/Point_set_processing_3/test_read_write_point_set.cpp +++ b/Point_set_processing_3/test/Point_set_processing_3/test_read_write_point_set.cpp @@ -86,14 +86,14 @@ bool test_points_with_np(std::string s) points.push_back(std::make_pair(Point_3(0,0,1), Vector_3(0,0,1))); points.push_back(std::make_pair(Point_3(1,1,1), Vector_3(1,1,1))); - bool ok = CGAL::write_points(s, points, - CGAL::parameters::point_map(CGAL::First_of_pair_property_map()) - .normal_map(CGAL::Second_of_pair_property_map())); + bool ok = CGAL::IO::write_points(s, points, + CGAL::parameters::point_map(CGAL::First_of_pair_property_map()) + .normal_map(CGAL::Second_of_pair_property_map())); assert(ok); std::vector pv_pairs; - ok = CGAL::read_points(s, std::back_inserter(pv_pairs), - CGAL::parameters::point_map(CGAL::First_of_pair_property_map()) - .normal_map(CGAL::Second_of_pair_property_map())); + ok = CGAL::IO::read_points(s, std::back_inserter(pv_pairs), + CGAL::parameters::point_map(CGAL::First_of_pair_property_map()) + .normal_map(CGAL::Second_of_pair_property_map())); assert(ok); assert(pv_pairs[0] == std::make_pair(Point_3(0,0,0), Vector_3(0,0,0))); assert(pv_pairs[1] == std::make_pair(Point_3(1,0,0), Vector_3(1,0,0))); @@ -109,47 +109,47 @@ void test_##TYPE(const std::string& s) { \ std::cout << "Test Point_set_3: " << s << " extension: " << #TYPE << std::endl; \ CGAL::Point_set_3 ps; \ - bool ok = CGAL::read_##TYPE(s, ps); \ + bool ok = CGAL::IO::read_##TYPE(s, ps); \ assert(ok); \ ps.clear(); \ - ok = CGAL::read_##TYPE(s.c_str(), ps); \ + ok = CGAL::IO::read_##TYPE(s.c_str(), ps); \ assert(ok); \ ps.clear(); \ std::ifstream in(s); \ - ok = CGAL::read_##TYPE(in, ps); \ + ok = CGAL::IO::read_##TYPE(in, ps); \ assert(ok); \ const char* ext = type; \ std::string fname = "tmp."; \ fname.append(ext); \ - ok = CGAL::write_##TYPE(fname, ps); \ + ok = CGAL::IO::write_##TYPE(fname, ps); \ assert(ok); \ - ok = CGAL::write_##TYPE(fname, ps, CGAL::parameters::stream_precision(10)); \ + ok = CGAL::IO::write_##TYPE(fname, ps, CGAL::parameters::stream_precision(10)); \ assert(ok); \ - ok = CGAL::write_##TYPE(fname.c_str(), ps); \ + ok = CGAL::IO::write_##TYPE(fname.c_str(), ps); \ assert(ok); \ - ok = CGAL::write_##TYPE(fname.c_str(), ps, CGAL::parameters::stream_precision(10)); \ + ok = CGAL::IO::write_##TYPE(fname.c_str(), ps, CGAL::parameters::stream_precision(10)); \ assert(ok); \ std::ofstream out(fname); \ - ok = CGAL::write_##TYPE(out, ps); \ + ok = CGAL::IO::write_##TYPE(out, ps); \ assert(ok); \ std::ofstream out2(fname); \ - ok = CGAL::write_##TYPE(out2, ps, CGAL::parameters::stream_precision(10)); \ + ok = CGAL::IO::write_##TYPE(out2, ps, CGAL::parameters::stream_precision(10)); \ assert(ok); \ CGAL::Point_set_3 ps2; \ std::ifstream is(fname); \ - ok = CGAL::read_##TYPE(is, ps2); \ + ok = CGAL::IO::read_##TYPE(is, ps2); \ assert(ok); \ assert(ps_are_equal(ps, ps2)); \ - ok = CGAL::write_point_set(fname, ps2); \ + ok = CGAL::IO::write_point_set(fname, ps2); \ assert(ok); \ - ok = CGAL::write_point_set(fname, ps2, CGAL::parameters::stream_precision(10)); \ + ok = CGAL::IO::write_point_set(fname, ps2, CGAL::parameters::stream_precision(10)); \ assert(ok); \ - ok = CGAL::write_point_set(fname.c_str(), ps2); \ + ok = CGAL::IO::write_point_set(fname.c_str(), ps2); \ assert(ok); \ - ok = CGAL::write_point_set(fname.c_str(), ps2, CGAL::parameters::stream_precision(10)); \ + ok = CGAL::IO::write_point_set(fname.c_str(), ps2, CGAL::parameters::stream_precision(10)); \ assert(ok); \ ps2.clear(); \ - ok = CGAL::read_point_set(fname, ps2); \ + ok = CGAL::IO::read_point_set(fname, ps2); \ assert(ok); \ assert(ps_are_equal(ps, ps2)); \ } @@ -162,44 +162,44 @@ void test_LAS(const std::string& s) { std::cout << "Test Point_set_3: " << s << " extension: las" < ps; - bool ok = CGAL::read_LAS(s, ps); + bool ok = CGAL::IO::read_LAS(s, ps); assert(ok); ps.clear(); - ok = CGAL::read_LAS(s.c_str(), ps); + ok = CGAL::IO::read_LAS(s.c_str(), ps); assert(ok); ps.clear(); std::ifstream in(s, std::ios::binary); - CGAL::set_mode(in, CGAL::IO::BINARY); - ok = CGAL::read_LAS(in, ps); + CGAL::IO::set_mode(in, CGAL::IO::BINARY); + ok = CGAL::IO::read_LAS(in, ps); assert(ok); const char* ext = "las"; std::string fname = "tmp."; fname.append(ext); - ok = CGAL::write_LAS(fname, ps); + ok = CGAL::IO::write_LAS(fname, ps); assert(ok); - ok = CGAL::write_LAS(fname.c_str(), ps); + ok = CGAL::IO::write_LAS(fname.c_str(), ps); assert(ok); std::ofstream out(fname, std::ios::binary); - CGAL::set_mode(out, CGAL::IO::BINARY); - ok = CGAL::write_LAS(out, ps); + CGAL::IO::set_mode(out, CGAL::IO::BINARY); + ok = CGAL::IO::write_LAS(out, ps); assert(ok); CGAL::Point_set_3 ps2; std::ifstream is(fname, std::ios::binary); - CGAL::set_mode(is, CGAL::IO::BINARY); - ok = CGAL::read_LAS(is, ps2); + CGAL::IO::set_mode(is, CGAL::IO::BINARY); + ok = CGAL::IO::read_LAS(is, ps2); assert(ok); assert(ps_are_equal(ps, ps2)); - ok = CGAL::write_point_set(fname, ps2); + ok = CGAL::IO::write_point_set(fname, ps2); assert(ok); - ok = CGAL::write_point_set(fname, ps2, CGAL::parameters::stream_precision(10)); + ok = CGAL::IO::write_point_set(fname, ps2, CGAL::parameters::stream_precision(10)); assert(ok); - ok = CGAL::write_point_set(fname.c_str(), ps2); + ok = CGAL::IO::write_point_set(fname.c_str(), ps2); assert(ok); - ok = CGAL::write_point_set(fname.c_str(), ps2, CGAL::parameters::stream_precision(10)); + ok = CGAL::IO::write_point_set(fname.c_str(), ps2, CGAL::parameters::stream_precision(10)); assert(ok); ps2.clear(); - ok = CGAL::read_point_set(fname, ps2); + ok = CGAL::IO::read_point_set(fname, ps2); assert(ok); assert(ps_are_equal(ps, ps2)); } @@ -212,41 +212,41 @@ void test_points_##TYPE(const std::string& s) { \ std::cout << "Test points: " << s << " extension: " << #TYPE << std::endl; \ std::vector ps; \ - bool ok = CGAL::read_##TYPE(s, std::back_inserter(ps)); \ + bool ok = CGAL::IO::read_##TYPE(s, std::back_inserter(ps)); \ assert(ok); \ ps.clear(); \ - ok = CGAL::read_##TYPE(s.c_str(), std::back_inserter(ps)); \ + ok = CGAL::IO::read_##TYPE(s.c_str(), std::back_inserter(ps)); \ assert(ok); \ ps.clear(); \ std::ifstream in(s); \ - ok = CGAL::read_##TYPE(in, std::back_inserter(ps)); \ + ok = CGAL::IO::read_##TYPE(in, std::back_inserter(ps)); \ assert(ok); \ const char* ext = type; \ std::string fname = "tmp."; \ fname.append(ext); \ - ok = CGAL::write_##TYPE(fname, ps); \ + ok = CGAL::IO::write_##TYPE(fname, ps); \ assert(ok); \ - ok = CGAL::write_##TYPE(fname, ps, CGAL::parameters::stream_precision(10)); \ + ok = CGAL::IO::write_##TYPE(fname, ps, CGAL::parameters::stream_precision(10)); \ assert(ok); \ - ok = CGAL::write_##TYPE(fname.c_str(), ps); \ + ok = CGAL::IO::write_##TYPE(fname.c_str(), ps); \ assert(ok); \ - ok = CGAL::write_##TYPE(fname.c_str(), ps, CGAL::parameters::stream_precision(10)); \ + ok = CGAL::IO::write_##TYPE(fname.c_str(), ps, CGAL::parameters::stream_precision(10)); \ assert(ok); \ std::ofstream out(fname); \ - ok = CGAL::write_##TYPE(out, ps); \ + ok = CGAL::IO::write_##TYPE(out, ps); \ assert(ok); \ std::ofstream out2(fname); \ - ok = CGAL::write_##TYPE(out2, ps, CGAL::parameters::stream_precision(10)); \ + ok = CGAL::IO::write_##TYPE(out2, ps, CGAL::parameters::stream_precision(10)); \ assert(ok); \ std::vector ps2; \ std::ifstream is(fname); \ - ok = CGAL::read_##TYPE(is, std::back_inserter(ps2)); \ + ok = CGAL::IO::read_##TYPE(is, std::back_inserter(ps2)); \ assert(ok); \ assert(points_are_equal(ps, ps2)); \ - ok = CGAL::write_points(fname, ps2); \ + ok = CGAL::IO::write_points(fname, ps2); \ assert(ok); \ ps2.clear(); \ - ok = CGAL::read_points(fname, std::back_inserter(ps2)); \ + ok = CGAL::IO::read_points(fname, std::back_inserter(ps2)); \ assert(ok); \ assert(points_are_equal(ps, ps2)); \ } @@ -259,41 +259,41 @@ void test_points_LAS(const std::string& s) { std::cout << "Test points: " << s << " extension: LAS "<< std::endl; std::vector ps; - bool ok = CGAL::read_LAS(s, std::back_inserter(ps)); + bool ok = CGAL::IO::read_LAS(s, std::back_inserter(ps)); assert(ok); ps.clear(); - ok = CGAL::read_LAS(s.c_str(), std::back_inserter(ps)); + ok = CGAL::IO::read_LAS(s.c_str(), std::back_inserter(ps)); assert(ok); ps.clear(); std::ifstream in(s, std::ios::binary); - ok = CGAL::read_LAS(in, std::back_inserter(ps)); + ok = CGAL::IO::read_LAS(in, std::back_inserter(ps)); assert(ok); const char* ext = "las"; std::string fname = "tmp."; fname.append(ext); - ok = CGAL::write_LAS(fname, ps); + ok = CGAL::IO::write_LAS(fname, ps); assert(ok); - ok = CGAL::write_LAS(fname, ps, CGAL::parameters::stream_precision(10)); + ok = CGAL::IO::write_LAS(fname, ps, CGAL::parameters::stream_precision(10)); assert(ok); - ok = CGAL::write_LAS(fname.c_str(), ps); + ok = CGAL::IO::write_LAS(fname.c_str(), ps); assert(ok); - ok = CGAL::write_LAS(fname.c_str(), ps, CGAL::parameters::stream_precision(10)); + ok = CGAL::IO::write_LAS(fname.c_str(), ps, CGAL::parameters::stream_precision(10)); assert(ok); std::ofstream out(fname, std::ios::binary); - ok = CGAL::write_LAS(out, ps); + ok = CGAL::IO::write_LAS(out, ps); assert(ok); std::ofstream out2(fname, std::ios::binary); - ok = CGAL::write_LAS(out2, ps, CGAL::parameters::stream_precision(10)); + ok = CGAL::IO::write_LAS(out2, ps, CGAL::parameters::stream_precision(10)); assert(ok); std::vector ps2; std::ifstream is(fname, std::ios::binary); - ok = CGAL::read_LAS(is, std::back_inserter(ps2)); + ok = CGAL::IO::read_LAS(is, std::back_inserter(ps2)); assert(ok); assert(points_are_equal(ps, ps2)); - ok = CGAL::write_points(fname, ps2); + ok = CGAL::IO::write_points(fname, ps2); assert(ok); ps2.clear(); - ok = CGAL::read_points(fname, std::back_inserter(ps2)); + ok = CGAL::IO::read_points(fname, std::back_inserter(ps2)); assert(ok); assert(points_are_equal(ps, ps2)); } 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 f746d972b16..d9df3d8e0ff 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,9 +33,9 @@ std::cout << "=== test_fandisk ===\n"; points.reserve(nb_points); cov.reserve(nb_points); - if(!CGAL::read_points("data/fandisk.off", - std::back_inserter(points), - CGAL::parameters::point_map(pmap))) + if(!CGAL::IO::read_points("data/fandisk.off", + std::back_inserter(points), + CGAL::parameters::point_map(pmap))) { std::cerr << "Error: cannot read file data/fandisk.off" << std::endl; return false; diff --git a/Point_set_processing_3/test/Point_set_processing_3/wlop_simplify_and_regularize_test.cpp b/Point_set_processing_3/test/Point_set_processing_3/wlop_simplify_and_regularize_test.cpp index 5b5611ed0eb..da4ab598335 100644 --- a/Point_set_processing_3/test/Point_set_processing_3/wlop_simplify_and_regularize_test.cpp +++ b/Point_set_processing_3/test/Point_set_processing_3/wlop_simplify_and_regularize_test.cpp @@ -122,7 +122,7 @@ int main(int argc, char * argv[]) std::cerr << "Opening " << argv[i] << " for reading..." << std::endl; // If XYZ file format: - if(CGAL::read_points(argv[i], std::back_inserter(points))) + if(CGAL::IO::read_points(argv[i], std::back_inserter(points))) { std::cerr << "ok (" << points.size() << " points)" << std::endl; } diff --git a/Poisson_surface_reconstruction_3/examples/Poisson_surface_reconstruction_3/poisson_reconstruction.cpp b/Poisson_surface_reconstruction_3/examples/Poisson_surface_reconstruction_3/poisson_reconstruction.cpp index fdbf3a92357..b958d1a23d3 100644 --- a/Poisson_surface_reconstruction_3/examples/Poisson_surface_reconstruction_3/poisson_reconstruction.cpp +++ b/Poisson_surface_reconstruction_3/examples/Poisson_surface_reconstruction_3/poisson_reconstruction.cpp @@ -187,9 +187,9 @@ int main(int argc, char * argv[]) // Reads the point set file in points[]. // Note: read_points() requires an iterator over points // + property maps to access each point's position and normal. - if (!CGAL::read_points(input_filename.c_str(), std::back_inserter(points), - CGAL::parameters::point_map(CGAL::make_first_of_pair_property_map(Point_with_normal())) - .normal_map(CGAL::make_second_of_pair_property_map(Point_with_normal())))) + if (!CGAL::IO::read_points(input_filename.c_str(), std::back_inserter(points), + CGAL::parameters::point_map(CGAL::make_first_of_pair_property_map(Point_with_normal())) + .normal_map(CGAL::make_second_of_pair_property_map(Point_with_normal())))) { std::cerr << "Error: cannot read input file!" << input_filename << std::endl; return EXIT_FAILURE; diff --git a/Poisson_surface_reconstruction_3/examples/Poisson_surface_reconstruction_3/poisson_reconstruction_example.cpp b/Poisson_surface_reconstruction_3/examples/Poisson_surface_reconstruction_3/poisson_reconstruction_example.cpp index 5495f15ec8e..da42893dc93 100644 --- a/Poisson_surface_reconstruction_3/examples/Poisson_surface_reconstruction_3/poisson_reconstruction_example.cpp +++ b/Poisson_surface_reconstruction_3/examples/Poisson_surface_reconstruction_3/poisson_reconstruction_example.cpp @@ -43,7 +43,7 @@ int main(void) // Note: read_points() requires an iterator over points // + property maps to access each point's position and normal. PointList points; - if(!CGAL::read_points("data/kitten.xyz", std::back_inserter(points), + if(!CGAL::IO::read_points("data/kitten.xyz", std::back_inserter(points), CGAL::parameters::point_map(Point_map()) .normal_map (Normal_map()))) { diff --git a/Poisson_surface_reconstruction_3/examples/Poisson_surface_reconstruction_3/poisson_reconstruction_function.cpp b/Poisson_surface_reconstruction_3/examples/Poisson_surface_reconstruction_3/poisson_reconstruction_function.cpp index f12f9e2cc6a..ef45d80cdde 100644 --- a/Poisson_surface_reconstruction_3/examples/Poisson_surface_reconstruction_3/poisson_reconstruction_function.cpp +++ b/Poisson_surface_reconstruction_3/examples/Poisson_surface_reconstruction_3/poisson_reconstruction_function.cpp @@ -17,9 +17,9 @@ int main(void) { std::vector points; - if(!CGAL::read_points("data/kitten.xyz", std::back_inserter(points), - CGAL::parameters::point_map(CGAL::First_of_pair_property_map()) - .normal_map(CGAL::Second_of_pair_property_map()))) + if(!CGAL::IO::read_points("data/kitten.xyz", std::back_inserter(points), + CGAL::parameters::point_map(CGAL::First_of_pair_property_map()) + .normal_map(CGAL::Second_of_pair_property_map()))) { std::cerr << "Error: cannot read input file!" << std::endl; return EXIT_FAILURE; diff --git a/Poisson_surface_reconstruction_3/examples/Poisson_surface_reconstruction_3/tutorial_example.cpp b/Poisson_surface_reconstruction_3/examples/Poisson_surface_reconstruction_3/tutorial_example.cpp index a763eb28516..183e8beddfa 100644 --- a/Poisson_surface_reconstruction_3/examples/Poisson_surface_reconstruction_3/tutorial_example.cpp +++ b/Poisson_surface_reconstruction_3/examples/Poisson_surface_reconstruction_3/tutorial_example.cpp @@ -140,8 +140,8 @@ int main(int argc, char*argv[]) //! [Output poisson] std::ofstream f ("out.ply", std::ios_base::binary); - CGAL::set_binary_mode (f); - CGAL::write_PLY(f, output_mesh); + CGAL::IO::set_binary_mode (f); + CGAL::IO::write_PLY(f, output_mesh); f.close (); //! [Output poisson] diff --git a/Poisson_surface_reconstruction_3/include/CGAL/Poisson_reconstruction_function.h b/Poisson_surface_reconstruction_3/include/CGAL/Poisson_reconstruction_function.h index 7fb5c3e68f3..e526d4ac91f 100644 --- a/Poisson_surface_reconstruction_3/include/CGAL/Poisson_reconstruction_function.h +++ b/Poisson_surface_reconstruction_3/include/CGAL/Poisson_reconstruction_function.h @@ -43,7 +43,7 @@ #include #include -#include +#include #include #include #include @@ -274,7 +274,7 @@ private: // operator() is pre-computed on vertices of *m_tr by solving // the Poisson equation Laplacian(f) = divergent(normals field). - boost::shared_ptr m_tr; + std::shared_ptr m_tr; mutable std::shared_ptr > m_bary; mutable std::vector Dual; mutable std::vector Normal; diff --git a/Poisson_surface_reconstruction_3/test/Poisson_surface_reconstruction_3/poisson_and_parallel_mesh_3.cpp b/Poisson_surface_reconstruction_3/test/Poisson_surface_reconstruction_3/poisson_and_parallel_mesh_3.cpp index cd97fccbb99..8de4b572bff 100644 --- a/Poisson_surface_reconstruction_3/test/Poisson_surface_reconstruction_3/poisson_and_parallel_mesh_3.cpp +++ b/Poisson_surface_reconstruction_3/test/Poisson_surface_reconstruction_3/poisson_and_parallel_mesh_3.cpp @@ -39,7 +39,7 @@ int main(int, char**) std::ifstream stream("data/oni.pwn"); if (!stream || - !CGAL::read_XYZ + !CGAL::IO::read_XYZ (stream, std::back_inserter(points), CGAL::parameters:: point_map(Point_map()). diff --git a/Poisson_surface_reconstruction_3/test/Poisson_surface_reconstruction_3/poisson_reconstruction_test.cpp b/Poisson_surface_reconstruction_3/test/Poisson_surface_reconstruction_3/poisson_reconstruction_test.cpp index 6bdd6b504c8..760e505dc27 100644 --- a/Poisson_surface_reconstruction_3/test/Poisson_surface_reconstruction_3/poisson_reconstruction_test.cpp +++ b/Poisson_surface_reconstruction_3/test/Poisson_surface_reconstruction_3/poisson_reconstruction_test.cpp @@ -138,7 +138,7 @@ int main(int argc, char * argv[]) // Note: read_points() requires an iterator over points // + property maps to access each point's position and normal. // The position property map can be omitted here as we use iterators over Point_3 elements. - if (!CGAL::read_points( + if (!CGAL::IO::read_points( input_filename.c_str(), std::back_inserter(points), CGAL::parameters::normal_map diff --git a/Polygon/examples/Polygon/Example.cpp b/Polygon/examples/Polygon/Example.cpp index 82b384cd296..2801aa03d42 100644 --- a/Polygon/examples/Polygon/Example.cpp +++ b/Polygon/examples/Polygon/Example.cpp @@ -21,7 +21,7 @@ int main() p.push_back(Point(2,2)); p.push_back(Point(0,4)); - CGAL::set_pretty_mode(std::cout); + CGAL::IO::set_pretty_mode(std::cout); std::cout << "created the polygon p:" << std::endl; std::cout << p << std::endl; std::cout << std::endl; diff --git a/Polygon/include/CGAL/General_polygon_with_holes_2.h b/Polygon/include/CGAL/General_polygon_with_holes_2.h index 9d086d4c485..ade90e4f77d 100644 --- a/Polygon/include/CGAL/General_polygon_with_holes_2.h +++ b/Polygon/include/CGAL/General_polygon_with_holes_2.h @@ -184,7 +184,7 @@ std::ostream { typename General_polygon_with_holes_2::Hole_const_iterator hit; - switch(get_mode(os)) { + switch(IO::get_mode(os)) { case IO::ASCII : os << p.outer_boundary() << ' ' << p.number_of_holes()<< ' '; for (hit = p.holes_begin(); hit != p.holes_end(); ++hit) { diff --git a/Polygon/include/CGAL/Polygon_2/Polygon_2_impl.h b/Polygon/include/CGAL/Polygon_2/Polygon_2_impl.h index c519e2e12e1..ce0714af873 100644 --- a/Polygon/include/CGAL/Polygon_2/Polygon_2_impl.h +++ b/Polygon/include/CGAL/Polygon_2/Polygon_2_impl.h @@ -112,7 +112,7 @@ operator<<(std::ostream &os, const Polygon_2& p) { typename Polygon_2::Vertex_const_iterator i; - switch(get_mode(os)) { + switch(IO::get_mode(os)) { case IO::ASCII : os << p.size() << ' '; for (i = p.vertices_begin(); i != p.vertices_end(); ++i) { diff --git a/Polygon/include/CGAL/Polygon_with_holes_2.h b/Polygon/include/CGAL/Polygon_with_holes_2.h index 561c64eefa6..d2796b9e8d8 100644 --- a/Polygon/include/CGAL/Polygon_with_holes_2.h +++ b/Polygon/include/CGAL/Polygon_with_holes_2.h @@ -103,7 +103,7 @@ std::ostream& operator<<(std::ostream &os, { typename Polygon_with_holes_2::Hole_const_iterator i; - switch(get_mode(os)) { + switch(IO::get_mode(os)) { case IO::ASCII : os << p.outer_boundary() << ' ' << p.number_of_holes()<<' '; for (i = p.holes_begin(); i != p.holes_end(); ++i) { diff --git a/Polygon/include/CGAL/draw_polygon_2.h b/Polygon/include/CGAL/draw_polygon_2.h index 60522c9263d..fc4ad6f6567 100644 --- a/Polygon/include/CGAL/draw_polygon_2.h +++ b/Polygon/include/CGAL/draw_polygon_2.h @@ -74,7 +74,7 @@ protected: Point prev=p2.vertex(p2.size()-1); - CGAL::Color c(75,160,255); + CGAL::IO::Color c(75,160,255); face_begin(c); for (typename P2::Vertex_const_iterator i=p2.vertices_begin(); diff --git a/Polygon/include/CGAL/draw_polygon_with_holes_2.h b/Polygon/include/CGAL/draw_polygon_with_holes_2.h index 0781eb883f7..7b420eea9b6 100644 --- a/Polygon/include/CGAL/draw_polygon_with_holes_2.h +++ b/Polygon/include/CGAL/draw_polygon_with_holes_2.h @@ -91,7 +91,7 @@ protected: if (p2.outer_boundary().is_empty()) return; - CGAL::Color c(75,160,255); + CGAL::IO::Color c(75,160,255); face_begin(c); compute_one_loop_elements(p2.outer_boundary(), false); diff --git a/Polygon/test/Polygon/AlgorithmTest.cpp b/Polygon/test/Polygon/AlgorithmTest.cpp index 481506f1b4b..0d52b61b998 100644 --- a/Polygon/test/Polygon/AlgorithmTest.cpp +++ b/Polygon/test/Polygon/AlgorithmTest.cpp @@ -23,7 +23,7 @@ void test_collinear_point_filtering(const R&, const char* FileName) std::cerr << "Could not open file " << FileName << "!" << endl; std::exit(1); } - CGAL::set_ascii_mode(from); + CGAL::IO::set_ascii_mode(from); std::vector polygon; std::copy(std::istream_iterator(from), std::istream_iterator(), @@ -82,7 +82,7 @@ void test_polygon(const R&, const Point&, const char* FileName) std::cerr << "could not open file " << FileName << "!" << endl; std::exit(1); } - CGAL::set_ascii_mode(from); + CGAL::IO::set_ascii_mode(from); Point point; std::vector polygon; @@ -185,7 +185,7 @@ void test_polygon(const R&, const Point&, const char* FileName) int main() { - CGAL::set_pretty_mode(cout); + CGAL::IO::set_pretty_mode(cout); cout << endl; cout << "--------------------------------------------------------" << endl; diff --git a/Polygon/test/Polygon/PolygonTest.cpp b/Polygon/test/Polygon/PolygonTest.cpp index 77fd6058eed..8b1cebe50ab 100644 --- a/Polygon/test/Polygon/PolygonTest.cpp +++ b/Polygon/test/Polygon/PolygonTest.cpp @@ -91,7 +91,7 @@ void test_iterators(ListPolygon& p, const ListPolygon& q) typedef ListPolygon::Edge_const_circulator EC; typedef ListPolygon::Edge_const_iterator EI; - CGAL::set_ascii_mode(cout); + CGAL::IO::set_ascii_mode(cout); { VC v = p.vertices_circulator(); @@ -165,28 +165,28 @@ void test_stream_operators(ListPolygon& p) { { std::ofstream to("polytest.ascii"); - CGAL::set_ascii_mode(to); + CGAL::IO::set_ascii_mode(to); to << p; to.close(); ListPolygon p_copy; std::ifstream from("polytest.ascii"); - CGAL::set_ascii_mode(from); + CGAL::IO::set_ascii_mode(from); from >> p_copy; assert(p == p_copy); } { std::ofstream to("polytest.pretty"); - CGAL::set_pretty_mode(to); + CGAL::IO::set_pretty_mode(to); to << p; } { std::ofstream to("polytest.binary"); - CGAL::set_binary_mode(to); + CGAL::IO::set_binary_mode(to); to << p; } - CGAL::set_pretty_mode(cout); + CGAL::IO::set_pretty_mode(cout); } //-----------------------------------------------------------------------// diff --git a/Polygon/test/Polygon/SimplicityTest.cpp b/Polygon/test/Polygon/SimplicityTest.cpp index 527450802b7..269392a1615 100644 --- a/Polygon/test/Polygon/SimplicityTest.cpp +++ b/Polygon/test/Polygon/SimplicityTest.cpp @@ -34,7 +34,7 @@ bool TestSimplicity(const char* FileName) int n; // number of points std::vector polygon; - CGAL::set_ascii_mode(from); + CGAL::IO::set_ascii_mode(from); from >> answer >> n; cout << " polygon has " << n << " points" << endl; for (int i=0; i 1) ? argv[1] : "data/eight.off"; Surface_mesh mesh; - if(!PMP::read_polygon_mesh(filename, mesh)) + if(!PMP::IO::read_polygon_mesh(filename, mesh)) { std::cerr << "Invalid input." << std::endl; return 1; diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/compute_normals_example_Polyhedron.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/compute_normals_example_Polyhedron.cpp index b8c732a0c1b..72f8b9a0fa0 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/compute_normals_example_Polyhedron.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/compute_normals_example_Polyhedron.cpp @@ -27,7 +27,7 @@ int main(int argc, char* argv[]) const char* filename = (argc > 1) ? argv[1] : "data/eight.off"; Polyhedron mesh; - if(!PMP::read_polygon_mesh(filename, mesh)) + if(!PMP::IO::read_polygon_mesh(filename, mesh)) { std::cerr << "Invalid input." << std::endl; return 1; diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/connected_components_example.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/connected_components_example.cpp index b0dd145c427..a0c70aad6cb 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/connected_components_example.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/connected_components_example.cpp @@ -74,7 +74,7 @@ int main(int argc, char* argv[]) const char* filename = (argc > 1) ? argv[1] : "data/blobby_3cc.off"; Mesh mesh; - if(!PMP::read_polygon_mesh(filename, mesh)) + if(!PMP::IO::read_polygon_mesh(filename, mesh)) { std::cerr << "Invalid input." << std::endl; return 1; 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 dd9749b2682..c3c74c76457 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_LCC.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_LCC.cpp @@ -20,7 +20,7 @@ int main(int argc, char* argv[]) const char* filename2 = (argc > 2) ? argv[2] : "data/eight.off"; LCC mesh1, mesh2; - if(!PMP::read_polygon_mesh(filename1, mesh1) || !PMP::read_polygon_mesh(filename2, mesh2)) + if(!PMP::IO::read_polygon_mesh(filename1, mesh1) || !PMP::IO::read_polygon_mesh(filename2, mesh2)) { std::cerr << "Invalid input." << std::endl; return 1; @@ -38,10 +38,10 @@ int main(int argc, char* argv[]) std::ofstream output("mesh1_refined.off"); output.precision(17); - CGAL::write_OFF(output, mesh1); + CGAL::IO::write_OFF(output, mesh1); output.close(); output.open("mesh2_refined.off"); - CGAL::write_OFF(output, mesh2); + CGAL::IO::write_OFF(output, mesh2); output.close(); return 0; diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_SM.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_SM.cpp index e4660e6fdef..2968f4ccce3 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_SM.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_SM.cpp @@ -18,7 +18,7 @@ int main(int argc, char* argv[]) const char* filename2 = (argc > 2) ? argv[2] : "data/eight.off"; Mesh mesh1, mesh2; - if(!PMP::read_polygon_mesh(filename1, mesh1) || !PMP::read_polygon_mesh(filename2, mesh2)) + if(!PMP::IO::read_polygon_mesh(filename1, mesh1) || !PMP::IO::read_polygon_mesh(filename2, mesh2)) { std::cerr << "Invalid input." << std::endl; return 1; @@ -34,8 +34,8 @@ int main(int argc, char* argv[]) << num_vertices(mesh1) << " and " << num_vertices(mesh2) << "\n"; - CGAL::write_polygon_mesh("mesh1_refined.off", mesh1, CGAL::parameters::stream_precision(17)); - CGAL::write_polygon_mesh("mesh2_refined.off", mesh2, CGAL::parameters::stream_precision(17)); + CGAL::IO::write_polygon_mesh("mesh1_refined.off", mesh1, CGAL::parameters::stream_precision(17)); + CGAL::IO::write_polygon_mesh("mesh2_refined.off", mesh2, CGAL::parameters::stream_precision(17)); return 0; } diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_consecutive_bool_op.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_consecutive_bool_op.cpp index 5c70a466b34..5aa7e826c4d 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_consecutive_bool_op.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_consecutive_bool_op.cpp @@ -69,7 +69,7 @@ int main(int argc, char* argv[]) const char* filename2 = (argc > 2) ? argv[2] : "data/eight.off"; Mesh mesh1, mesh2; - if(!PMP::read_polygon_mesh(filename1, mesh1) || !PMP::read_polygon_mesh(filename2, mesh2)) + if(!PMP::IO::read_polygon_mesh(filename1, mesh1) || !PMP::IO::read_polygon_mesh(filename2, mesh2)) { std::cerr << "Invalid input." << std::endl; return 1; @@ -99,7 +99,7 @@ int main(int argc, char* argv[]) params::vertex_point_map(mesh2_vpm) ) ) { std::cout << "Intersection and union were successfully computed\n"; - CGAL::write_polygon_mesh("inter_union.off", mesh2, CGAL::parameters::stream_precision(17)); + CGAL::IO::write_polygon_mesh("inter_union.off", mesh2, CGAL::parameters::stream_precision(17)); return 0; } diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_difference_remeshed.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_difference_remeshed.cpp index 54df02b8707..91a926f46b8 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_difference_remeshed.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_difference_remeshed.cpp @@ -40,7 +40,7 @@ int main(int argc, char* argv[]) const char* filename2 = (argc > 2) ? argv[2] : "data/eight.off"; Mesh mesh1, mesh2; - if(!PMP::read_polygon_mesh(filename1, mesh1) || !PMP::read_polygon_mesh(filename2, mesh2)) + if(!PMP::IO::read_polygon_mesh(filename1, mesh1) || !PMP::IO::read_polygon_mesh(filename2, mesh2)) { std::cerr << "Invalid input." << std::endl; return 1; @@ -63,7 +63,7 @@ int main(int argc, char* argv[]) if (valid_difference) { std::cout << "Difference was successfully computed\n"; - CGAL::write_polygon_mesh("difference.off", mesh1, CGAL::parameters::stream_precision(17)); + CGAL::IO::write_polygon_mesh("difference.off", mesh1, CGAL::parameters::stream_precision(17)); } else { @@ -103,7 +103,7 @@ int main(int argc, char* argv[]) PMP::isotropic_remeshing(selected_faces, 0.02, mesh1, params::edge_is_constrained_map(is_constrained_map)); - CGAL::write_polygon_mesh("difference_remeshed.off", mesh1, CGAL::parameters::stream_precision(17)); + CGAL::IO::write_polygon_mesh("difference_remeshed.off", mesh1, CGAL::parameters::stream_precision(17)); return 0; } diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_mesh_union.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_mesh_union.cpp index be53bb63b82..feb74ddf134 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_mesh_union.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_mesh_union.cpp @@ -17,7 +17,7 @@ int main(int argc, char* argv[]) const char* filename2 = (argc > 2) ? argv[2] : "data/eight.off"; Mesh mesh1, mesh2; - if(!PMP::read_polygon_mesh(filename1, mesh1) || !PMP::read_polygon_mesh(filename2, mesh2)) + if(!PMP::IO::read_polygon_mesh(filename1, mesh1) || !PMP::IO::read_polygon_mesh(filename2, mesh2)) { std::cerr << "Invalid input." << std::endl; return 1; @@ -29,7 +29,7 @@ int main(int argc, char* argv[]) if(valid_union) { std::cout << "Union was successfully computed\n"; - CGAL::write_polygon_mesh("union.off", out, CGAL::parameters::stream_precision(17)); + CGAL::IO::write_polygon_mesh("union.off", out, CGAL::parameters::stream_precision(17)); return 0; } diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_mesh_union_and_intersection.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_mesh_union_and_intersection.cpp index 2ea59a2ac90..56ded659e4d 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_mesh_union_and_intersection.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_mesh_union_and_intersection.cpp @@ -19,7 +19,7 @@ int main(int argc, char* argv[]) const char* filename2 = (argc > 2) ? argv[2] : "data/eight.off"; Mesh mesh1, mesh2; - if(!PMP::read_polygon_mesh(filename1, mesh1) || !PMP::read_polygon_mesh(filename2, mesh2)) + if(!PMP::IO::read_polygon_mesh(filename1, mesh1) || !PMP::IO::read_polygon_mesh(filename2, mesh2)) { std::cerr << "Invalid input." << std::endl; return 1; @@ -48,7 +48,7 @@ int main(int argc, char* argv[]) if (res[PMP::Corefinement::UNION]) { std::cout << "Union was successfully computed\n"; - CGAL::write_polygon_mesh("union.off", out_union, CGAL::parameters::stream_precision(17)); + CGAL::IO::write_polygon_mesh("union.off", out_union, CGAL::parameters::stream_precision(17)); } else std::cout << "Union could not be computed\n"; @@ -56,7 +56,7 @@ int main(int argc, char* argv[]) if (res[PMP::Corefinement::INTERSECTION]) { std::cout << "Intersection was successfully computed\n"; - CGAL::write_polygon_mesh("intersection.off", out_intersection, CGAL::parameters::stream_precision(17)); + CGAL::IO::write_polygon_mesh("intersection.off", out_intersection, CGAL::parameters::stream_precision(17)); } else std::cout << "Intersection could not be computed\n"; diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_mesh_union_with_attributes.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_mesh_union_with_attributes.cpp index 787844be103..d40fbe0e903 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_mesh_union_with_attributes.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_mesh_union_with_attributes.cpp @@ -52,7 +52,7 @@ int main(int argc, char* argv[]) const char* filename2 = (argc > 2) ? argv[2] : "data/eight.off"; Mesh mesh1, mesh2; - if(!PMP::read_polygon_mesh(filename1, mesh1) || !PMP::read_polygon_mesh(filename2, mesh2)) + if(!PMP::IO::read_polygon_mesh(filename1, mesh1) || !PMP::IO::read_polygon_mesh(filename2, mesh2)) { std::cerr << "Invalid input." << std::endl; return 1; @@ -88,7 +88,7 @@ int main(int argc, char* argv[]) if (valid_union) { - CGAL::write_polygon_mesh("union.off", out, CGAL::parameters::stream_precision(17)); + CGAL::IO::write_polygon_mesh("union.off", out, CGAL::parameters::stream_precision(17)); return 0; } diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_polyhedron_union.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_polyhedron_union.cpp index 71bdd4cd2f7..e8ba71436c1 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_polyhedron_union.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/corefinement_polyhedron_union.cpp @@ -19,7 +19,7 @@ int main(int argc, char* argv[]) const char* filename2 = (argc > 2) ? argv[2] : "data/eight.off"; Mesh mesh1, mesh2; - if(!PMP::read_polygon_mesh(filename1, mesh1) || !PMP::read_polygon_mesh(filename2, mesh2)) + if(!PMP::IO::read_polygon_mesh(filename1, mesh1) || !PMP::IO::read_polygon_mesh(filename2, mesh2)) { std::cerr << "Invalid input." << std::endl; return 1; diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/detect_features_example.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/detect_features_example.cpp index a95c322fc77..ee3c704e7ed 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/detect_features_example.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/detect_features_example.cpp @@ -18,7 +18,7 @@ int main(int argc, char* argv[]) const char* filename = (argc > 1) ? argv[1] : "data/P.off"; Mesh mesh; - if(!PMP::read_polygon_mesh(filename, mesh)) + if(!PMP::IO::read_polygon_mesh(filename, mesh)) { std::cerr << "Invalid input." << std::endl; return 1; diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/face_filtered_graph_example.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/face_filtered_graph_example.cpp index 9d54eea2319..8fc832cf4dc 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/face_filtered_graph_example.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/face_filtered_graph_example.cpp @@ -28,7 +28,7 @@ int main(int argc, char* argv[]) const char* filename = (argc > 1) ? argv[1] : "data/blobby_3cc.off"; Mesh mesh; - if(!PMP::read_polygon_mesh(filename, mesh)) + if(!PMP::IO::read_polygon_mesh(filename, mesh)) { std::cerr << "Invalid input." << std::endl; return 1; diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/hole_filling_example.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/hole_filling_example.cpp index 2a98bb66781..fe2cfb4a75c 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/hole_filling_example.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/hole_filling_example.cpp @@ -23,7 +23,7 @@ int main(int argc, char* argv[]) const char* filename = (argc > 1) ? argv[1] : "data/mech-holes-shark.off"; Polyhedron poly; - if(!PMP::read_polygon_mesh(filename, poly)) + if(!PMP::IO::read_polygon_mesh(filename, poly)) { std::cerr << "Invalid input." << std::endl; return 1; 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 7dd03e34d99..b7ee221fd8e 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 @@ -25,7 +25,7 @@ int main(int argc, char* argv[]) const char* filename = (argc > 1) ? argv[1] : "data/mech-holes-shark.off"; LCC mesh; - if(!PMP::read_polygon_mesh(filename, mesh)) + if(!PMP::IO::read_polygon_mesh(filename, mesh)) { std::cerr << "Invalid input." << std::endl; return 1; @@ -58,7 +58,7 @@ int main(int argc, char* argv[]) std::ofstream out("filled_LCC.off"); out.precision(17); - CGAL::write_OFF(out, mesh); + CGAL::IO::write_OFF(out, mesh); return 0; } diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/hole_filling_example_SM.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/hole_filling_example_SM.cpp index 40689ff2054..ea4082b0c5c 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/hole_filling_example_SM.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/hole_filling_example_SM.cpp @@ -52,7 +52,7 @@ int main(int argc, char* argv[]) const char* filename = (argc > 1) ? argv[1] : "data/mech-holes-shark.off"; Mesh mesh; - if(!PMP::read_polygon_mesh(filename, mesh)) + if(!PMP::IO::read_polygon_mesh(filename, mesh)) { std::cerr << "Invalid input." << std::endl; return 1; @@ -90,7 +90,7 @@ int main(int argc, char* argv[]) std::cout << std::endl; std::cout << nb_holes << " holes have been filled" << std::endl; - CGAL::write_polygon_mesh("filled_SM.off", mesh, CGAL::parameters::stream_precision(17)); + CGAL::IO::write_polygon_mesh("filled_SM.off", mesh, CGAL::parameters::stream_precision(17)); std::cout << "Mesh written to: filled_SM.off" << std::endl; return 0; diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/isotropic_remeshing_example.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/isotropic_remeshing_example.cpp index 2fb29d976ef..77e11fe115c 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/isotropic_remeshing_example.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/isotropic_remeshing_example.cpp @@ -36,7 +36,7 @@ int main(int argc, char* argv[]) const char* filename = (argc > 1) ? argv[1] : "data/pig.off"; Mesh mesh; - if(!PMP::read_polygon_mesh(filename, mesh) || !CGAL::is_triangle_mesh(mesh)) + if(!PMP::IO::read_polygon_mesh(filename, mesh) || !CGAL::is_triangle_mesh(mesh)) { std::cerr << "Invalid input." << std::endl; return 1; diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/isotropic_remeshing_of_patch_example.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/isotropic_remeshing_of_patch_example.cpp index fa67dc57d25..6a331b6a38c 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/isotropic_remeshing_of_patch_example.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/isotropic_remeshing_of_patch_example.cpp @@ -37,7 +37,7 @@ int main(int argc, char* argv[]) const char* filename = (argc > 1) ? argv[1] : "data/pig.off"; Mesh mesh; - if(!PMP::read_polygon_mesh(filename, mesh) || !CGAL::is_triangle_mesh(mesh)) + if(!PMP::IO::read_polygon_mesh(filename, mesh) || !CGAL::is_triangle_mesh(mesh)) { std::cerr << "Invalid input." << std::endl; return 1; @@ -75,7 +75,7 @@ int main(int argc, char* argv[]) .protect_constraints(true)//i.e. protect border, here ); - CGAL::write_polygon_mesh("out.off", mesh, CGAL::parameters::stream_precision(17)); + CGAL::IO::write_polygon_mesh("out.off", mesh, CGAL::parameters::stream_precision(17)); std::cout << "Remeshing done." << std::endl; return 0; diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/manifoldness_repair_example.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/manifoldness_repair_example.cpp index 94274b740b3..f035ccc4946 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/manifoldness_repair_example.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/manifoldness_repair_example.cpp @@ -35,7 +35,7 @@ int main(int argc, char* argv[]) const char* filename = (argc > 1) ? argv[1] : "data/blobby.off"; Mesh mesh; - if(!PMP::read_polygon_mesh(filename, mesh) || CGAL::is_empty(mesh)) + if(!PMP::IO::read_polygon_mesh(filename, mesh) || CGAL::is_empty(mesh)) { std::cerr << "Invalid input." << std::endl; return 1; diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/mesh_slicer_example.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/mesh_slicer_example.cpp index c8708ba8570..b6dc14e8ff1 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/mesh_slicer_example.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/mesh_slicer_example.cpp @@ -27,7 +27,7 @@ int main(int argc, char* argv[]) const char* filename = (argc > 1) ? argv[1] : "data/eight.off"; Mesh mesh; - if(!PMP::read_polygon_mesh(filename, mesh) || CGAL::is_empty(mesh) || !CGAL::is_triangle_mesh(mesh)) + if(!PMP::IO::read_polygon_mesh(filename, mesh) || CGAL::is_empty(mesh) || !CGAL::is_triangle_mesh(mesh)) { std::cerr << "Invalid input." << std::endl; return 1; diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/mesh_smoothing_example.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/mesh_smoothing_example.cpp index afb47b3a465..9aff9d2306d 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/mesh_smoothing_example.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/mesh_smoothing_example.cpp @@ -20,7 +20,7 @@ int main(int argc, char** argv) const char* filename = argc > 1 ? argv[1] : "data/anchor_dense.off"; Mesh mesh; - if(!PMP::read_polygon_mesh(filename, mesh)) + if(!PMP::IO::read_polygon_mesh(filename, mesh)) { std::cerr << "Invalid input." << std::endl; return 1; @@ -47,7 +47,7 @@ int main(int argc, char** argv) .use_safety_constraints(false) // authorize all moves .edge_is_constrained_map(eif)); - CGAL::write_polygon_mesh("mesh_smoothed.off", mesh, CGAL::parameters::stream_precision(17)); + CGAL::IO::write_polygon_mesh("mesh_smoothed.off", mesh, CGAL::parameters::stream_precision(17)); std::cout << "Done!" << std::endl; diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/orient_polygon_soup_example.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/orient_polygon_soup_example.cpp index 49cc2711c2f..f0d37d9af7d 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/orient_polygon_soup_example.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/orient_polygon_soup_example.cpp @@ -23,7 +23,7 @@ int main(int argc, char* argv[]) std::vector points; std::vector > polygons; - if(!CGAL::read_polygon_soup(filename, points, polygons) || points.empty()) + if(!CGAL::IO::read_polygon_soup(filename, points, polygons) || points.empty()) { std::cerr << "Cannot open file " << std::endl; return EXIT_FAILURE; diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/orientation_pipeline_example.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/orientation_pipeline_example.cpp index bfb6d31f783..f34b46b8604 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/orientation_pipeline_example.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/orientation_pipeline_example.cpp @@ -29,7 +29,7 @@ int main(int argc, char** argv) std::vector points; std::vector > polygons; - if(!CGAL::read_polygon_soup(input_filename, points, polygons) || + if(!CGAL::IO::read_polygon_soup(input_filename, points, polygons) || points.size() == 0 || polygons.size() == 0) { std::cerr << "Error: can not read input file.\n"; @@ -37,7 +37,7 @@ int main(int argc, char** argv) } Mesh ref1; - if(!PMP::read_polygon_mesh(reference_filename, ref1)) + if(!PMP::IO::read_polygon_mesh(reference_filename, ref1)) { std::cerr << "Invalid input." << std::endl; return 1; diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/point_inside_example.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/point_inside_example.cpp index 355430023c3..87250a1703e 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/point_inside_example.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/point_inside_example.cpp @@ -33,7 +33,7 @@ int main(int argc, char* argv[]) const char* filename = (argc > 1) ? argv[1] : "data/eight.off"; Polyhedron poly; - if(!PMP::read_polygon_mesh(filename, poly) || CGAL::is_empty(poly) || !CGAL::is_triangle_mesh(poly)) + if(!PMP::IO::read_polygon_mesh(filename, poly) || CGAL::is_empty(poly) || !CGAL::is_triangle_mesh(poly)) { std::cerr << "Invalid input." << std::endl; return 1; diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/polyhedral_envelope_of_triangle_soup.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/polyhedral_envelope_of_triangle_soup.cpp index 97a0fa3a607..89c4b7a659c 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/polyhedral_envelope_of_triangle_soup.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/polyhedral_envelope_of_triangle_soup.cpp @@ -19,7 +19,7 @@ int main(int argc, char* argv[]) std::vector points; std::vector > polygons; - CGAL::read_OFF(in, points, polygons); + CGAL::IO::read_OFF(in, points, polygons); Envelope envelope(points, polygons, eps); diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/random_perturbation_SM_example.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/random_perturbation_SM_example.cpp index d68467b62bf..2455f47fac8 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/random_perturbation_SM_example.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/random_perturbation_SM_example.cpp @@ -21,7 +21,7 @@ int main(int argc, char* argv[]) const char* filename = (argc > 1) ? argv[1] : "data/eight.off"; Surface_mesh mesh; - if(!PMP::read_polygon_mesh(filename, mesh)) + if(!PMP::IO::read_polygon_mesh(filename, mesh)) { std::cerr << "Invalid input." << std::endl; return 1; @@ -31,7 +31,7 @@ int main(int argc, char* argv[]) PMP::random_perturbation(mesh, max_size, CGAL::parameters::vertex_point_map(mesh.points()).geom_traits(K())); - CGAL::write_polygon_mesh("data/eight_perturbed.off", mesh, CGAL::parameters::stream_precision(17)); + CGAL::IO::write_polygon_mesh("data/eight_perturbed.off", mesh, CGAL::parameters::stream_precision(17)); return 0; } diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/refine_fair_example.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/refine_fair_example.cpp index b850c28ae6e..de44126ec22 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/refine_fair_example.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/refine_fair_example.cpp @@ -45,7 +45,7 @@ int main(int argc, char* argv[]) const char* filename = (argc > 1) ? argv[1] : "data/blobby.off"; Polyhedron poly; - if(!PMP::read_polygon_mesh(filename, poly) || !CGAL::is_triangle_mesh(poly)) + if(!PMP::IO::read_polygon_mesh(filename, poly) || !CGAL::is_triangle_mesh(poly)) { std::cerr << "Invalid input." << std::endl; return 1; diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/self_intersections_example.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/self_intersections_example.cpp index 75e7e45c3a0..a7b5037743d 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/self_intersections_example.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/self_intersections_example.cpp @@ -21,7 +21,7 @@ int main(int argc, char* argv[]) const char* filename = (argc > 1) ? argv[1] : "data/pig.off"; Mesh mesh; - if(!PMP::read_polygon_mesh(filename, mesh) || !CGAL::is_triangle_mesh(mesh)) + if(!PMP::IO::read_polygon_mesh(filename, mesh) || !CGAL::is_triangle_mesh(mesh)) { std::cerr << "Invalid input." << std::endl; return 1; diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/shape_smoothing_example.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/shape_smoothing_example.cpp index ae7ba6f4926..7268a84b337 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/shape_smoothing_example.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/shape_smoothing_example.cpp @@ -17,7 +17,7 @@ int main(int argc, char* argv[]) const char* filename = (argc > 1) ? argv[1] : "data/pig.off"; Mesh mesh; - if(!PMP::read_polygon_mesh(filename, mesh)) + if(!PMP::IO::read_polygon_mesh(filename, mesh)) { std::cerr << "Invalid input." << std::endl; return 1; @@ -40,7 +40,7 @@ int main(int argc, char* argv[]) PMP::smooth_shape(mesh, time, PMP::parameters::number_of_iterations(nb_iterations) .vertex_is_constrained_map(vcmap)); - CGAL::write_polygon_mesh("mesh_shape_smoothed.off", mesh, CGAL::parameters::stream_precision(17)); + CGAL::IO::write_polygon_mesh("mesh_shape_smoothed.off", mesh, CGAL::parameters::stream_precision(17)); std::cout << "Done!" << std::endl; return EXIT_SUCCESS; diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/stitch_borders_example.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/stitch_borders_example.cpp index 149bf6a5fee..7da94ff1bf5 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/stitch_borders_example.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/stitch_borders_example.cpp @@ -18,7 +18,7 @@ int main(int argc, char* argv[]) const char* filename = (argc > 1) ? argv[1] : "data/full_border_quads.off"; Polyhedron mesh; - if(!PMP::read_polygon_mesh(filename, mesh)) + if(!PMP::IO::read_polygon_mesh(filename, mesh)) { std::cerr << "Invalid input." << std::endl; return 1; @@ -36,7 +36,7 @@ int main(int argc, char* argv[]) std::cout << "\t Number of halfedges :\t" << mesh.size_of_halfedges() << std::endl; std::cout << "\t Number of facets :\t" << mesh.size_of_facets() << std::endl; - CGAL::write_polygon_mesh("mesh_stitched.off", mesh, CGAL::parameters::stream_precision(17)); + CGAL::IO::write_polygon_mesh("mesh_stitched.off", mesh, CGAL::parameters::stream_precision(17)); return 0; } diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/surface_mesh_intersection.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/surface_mesh_intersection.cpp index 177e55f46c3..9f925bdbdce 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/surface_mesh_intersection.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/surface_mesh_intersection.cpp @@ -25,7 +25,7 @@ int main(int argc, char* argv[]) const char* filename2 = (argc > 2) ? argv[2] : "data/eight.off"; Mesh mesh1, mesh2; - if(!PMP::read_polygon_mesh(filename1, mesh1) || !PMP::read_polygon_mesh(filename2, mesh2)) + if(!PMP::IO::read_polygon_mesh(filename1, mesh1) || !PMP::IO::read_polygon_mesh(filename2, mesh2)) { std::cerr << "Invalid input." << std::endl; return 1; diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/triangulate_faces_example.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/triangulate_faces_example.cpp index 70c6db3c96f..7391186d70a 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/triangulate_faces_example.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/triangulate_faces_example.cpp @@ -21,7 +21,7 @@ int main(int argc, char* argv[]) const char* outfilename = (argc > 2) ? argv[2] : "P_tri.off"; Surface_mesh mesh; - if(!PMP::read_polygon_mesh(filename, mesh)) + if(!PMP::IO::read_polygon_mesh(filename, mesh)) { std::cerr << "Invalid input." << std::endl; return 1; @@ -34,7 +34,7 @@ int main(int argc, char* argv[]) if(!CGAL::is_triangle(halfedge(f, mesh), mesh)) std::cerr << "Error: non-triangular face left in mesh." << std::endl; - CGAL::write_polygon_mesh(outfilename, mesh, CGAL::parameters::stream_precision(17)); + CGAL::IO::write_polygon_mesh(outfilename, mesh, CGAL::parameters::stream_precision(17)); return 0; } diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/triangulate_faces_split_visitor_example.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/triangulate_faces_split_visitor_example.cpp index 4036a4c504a..5091e5e447a 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/triangulate_faces_split_visitor_example.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/triangulate_faces_split_visitor_example.cpp @@ -90,7 +90,7 @@ int main(int argc, char* argv[]) Surface_mesh copy; - copy_face_graph(mesh, copy, CGAL::Emptyset_iterator(), CGAL::Emptyset_iterator(),Insert_iterator(t2q)); + CGAL::copy_face_graph(mesh, copy, CGAL::parameters::face_to_face_output_iterator(Insert_iterator(t2q))); Visitor v(t2q); CGAL::Polygon_mesh_processing::triangulate_faces(copy, diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/volume_connected_components.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/volume_connected_components.cpp index c800b9e3c27..8b90977371b 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/volume_connected_components.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/volume_connected_components.cpp @@ -21,7 +21,7 @@ int main(int argc, char** argv) const char* filename = (argc > 1) ? argv[1] : "data/blobby.off"; Surface_mesh mesh; - if(!PMP::read_polygon_mesh(filename, mesh)) + if(!PMP::IO::read_polygon_mesh(filename, mesh)) { std::cerr << "Invalid input." << std::endl; return 1; diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/IO/polygon_mesh_io.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/IO/polygon_mesh_io.h index d932c5b7583..4fe8a9deaf0 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/IO/polygon_mesh_io.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/IO/polygon_mesh_io.h @@ -33,7 +33,7 @@ namespace CGAL { namespace Polygon_mesh_processing { - +namespace IO { /*! \ingroup PMP_IO_grp @@ -82,7 +82,7 @@ namespace Polygon_mesh_processing { * * \return `true` if the reading, repairing, and orientation operations were successful, `false` otherwise. * - * \sa \link PkgBGLIOFct `CGAL::write_polygon_mesh()` \endlink + * \sa \link PkgBGLIOFct `CGAL::IO::write_polygon_mesh()` \endlink */ template bool read_polygon_mesh(const std::string& fname, @@ -101,7 +101,7 @@ bool read_polygon_mesh(const std::string& fname, std::vector points; std::vector > faces; - if(!CGAL::read_polygon_soup(fname, points, faces)) + if(!CGAL::IO::read_polygon_soup(fname, points, faces)) { if(verbose) std::cerr << "Warning: cannot read polygon soup" << std::endl; @@ -135,11 +135,12 @@ bool read_polygon_mesh(const std::string& fname, template bool read_polygon_mesh(const std::string& fname, PolygonMesh& g) { - return CGAL::Polygon_mesh_processing::read_polygon_mesh(fname, g, parameters::all_default()); + return CGAL::Polygon_mesh_processing::IO::read_polygon_mesh(fname, g, parameters::all_default()); } /// \endcond +} // namespace IO } // namespace Polygon_mesh_processing } // namespace CGAL diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/intersection_callbacks.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/intersection_callbacks.h index d764b106181..3c33b980cbc 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/intersection_callbacks.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/intersection_callbacks.h @@ -21,7 +21,7 @@ #include #include -#include +#include #include namespace CGAL { diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h index 9bbe717ca5b..f3098e2422a 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include #include @@ -92,7 +92,7 @@ namespace internal { typedef typename boost::graph_traits::edge_descriptor edge_descriptor; typedef FaceIndexMap FIMap; - boost::shared_ptr< std::set > border_edges_ptr; + std::shared_ptr< std::set > border_edges_ptr; const PM* pmesh_ptr_; public: @@ -1294,6 +1294,8 @@ private: return false; else if (is_on_mesh(hopp) && is_on_border(h)) return false; + else if (is_an_isolated_constraint(h)) + return false; else return true; } @@ -1308,6 +1310,9 @@ private: if (is_on_mesh(he) && is_on_mesh(hopp)) return false; + if (is_an_isolated_constraint(he) || is_an_isolated_constraint(hopp)) + return false; + if ( (protect_constraints_ || !collapse_constraints) && is_constrained(e)) return false; if (is_on_patch(he)) //hopp is also on patch @@ -1562,21 +1567,23 @@ private: } //tag PATCH, //h and hopp belong to the patch to be remeshed + std::vector patch_halfedges; for(face_descriptor f : face_range) { for(halfedge_descriptor h : halfedges_around_face(halfedge(f, mesh_), mesh_)) { set_status(h, PATCH); + patch_halfedges.push_back(h); } } // tag patch border halfedges - for(halfedge_descriptor h : halfedges(mesh_)) + for(halfedge_descriptor h : patch_halfedges) { - if (status(h) == PATCH - && ( status(opposite(h, mesh_)) != PATCH - || get_patch_id(face(h, mesh_)) != get_patch_id(face(opposite(h, mesh_), mesh_)))) + CGAL_assertion(status(h) == PATCH); + if( status(opposite(h, mesh_)) != PATCH + || get_patch_id(face(h, mesh_)) != get_patch_id(face(opposite(h, mesh_), mesh_))) { set_status(h, PATCH_BORDER); has_border_ = true; @@ -1610,26 +1617,31 @@ private: if (hs != PATCH_BORDER && hsopp != PATCH_BORDER) { - set_status(h, ISOLATED_CONSTRAINT); - set_status(hopp, ISOLATED_CONSTRAINT); + if(hs != MESH_BORDER) + set_status(h, ISOLATED_CONSTRAINT); + if(hsopp != MESH_BORDER) + set_status(hopp, ISOLATED_CONSTRAINT); } } } } +#ifdef CGAL_PMP_REMESHING_DEBUG std::ofstream ofs("dump_isolated.polylines.txt"); for (edge_descriptor e : edges(mesh_)) { halfedge_descriptor h = halfedge(e, mesh_); - if (status(h) == ISOLATED_CONSTRAINT) - { - CGAL_assertion(status(opposite(h, mesh_)) == ISOLATED_CONSTRAINT); + Halfedge_status so = status(opposite(h, mesh_)); + bool isolated = (status(h) == ISOLATED_CONSTRAINT || so == ISOLATED_CONSTRAINT); + CGAL_assertion(!isolated + || so == ISOLATED_CONSTRAINT + || so == MESH_BORDER); + if(isolated) ofs << "2 " << get(vpmap_, target(h, mesh_)) - << " " << get(vpmap_, source(h, mesh_)) << std::endl; - } + << " " << get(vpmap_, source(h, mesh_)) << std::endl; } ofs.close(); - +#endif } Halfedge_status status(const halfedge_descriptor& h) const @@ -1903,7 +1915,8 @@ public: bool is_an_isolated_constraint(const halfedge_descriptor& h) const { bool res = (status(h) == ISOLATED_CONSTRAINT); - CGAL_assertion(!res || status(opposite(h, mesh_)) == ISOLATED_CONSTRAINT); + CGAL_assertion_code(Halfedge_status so = status(opposite(h, mesh_))); + CGAL_assertion(!res || so == ISOLATED_CONSTRAINT || so == MESH_BORDER); return res; } @@ -1926,6 +1939,7 @@ private: unsigned int nb_mesh = 0; unsigned int nb_patch = 0; unsigned int nb_patch_border = 0; + unsigned int nb_isolated = 0; for(halfedge_descriptor h : halfedges(mesh_)) { @@ -1933,6 +1947,7 @@ private: else if(is_on_patch_border(h)) nb_patch_border++; else if(is_on_mesh(h)) nb_mesh++; else if(is_on_border(h)) nb_border++; + else if(is_an_isolated_constraint(h)) nb_isolated++; else CGAL_assertion(false); } } diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_degeneracies.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_degeneracies.h index 8254cfa4384..cb4a1ce9e08 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_degeneracies.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_degeneracies.h @@ -436,7 +436,7 @@ bool remove_almost_degenerate_faces(const FaceRange& face_range, std::cout << "Iter: " << iter << std::endl; std::ostringstream oss; oss << "degen_cleaning_iter_" << iter++ << ".off"; - CGAL::write_polygon_mesh(oss.str(), tmesh, CGAL::parameters::stream_precision(17)); + CGAL::IO::write_polygon_mesh(oss.str(), tmesh, CGAL::parameters::stream_precision(17)); #endif if(edges_to_collapse.empty() && edges_to_flip.empty()) @@ -1680,7 +1680,7 @@ bool remove_degenerate_faces(const FaceRange& face_range, #ifdef CGAL_PMP_REMOVE_DEGENERATE_FACES_DEBUG { std::cout <<"Done with null edges.\n"; - CGAL::write_polygon_mesh("/tmp/no_null_edges.off", tmesh, CGAL::parameters::stream_precision(17)); + CGAL::IO::write_polygon_mesh("/tmp/no_null_edges.off", tmesh, CGAL::parameters::stream_precision(17)); } #endif @@ -1804,7 +1804,7 @@ bool remove_degenerate_faces(const FaceRange& face_range, std::vector points; std::vector > triangles; std::ifstream in("/tmp/out.off"); - CGAL::read_OFF(in, points, triangles); + CGAL::IO::read_OFF(in, points, triangles); if(!CGAL::Polygon_mesh_processing::is_polygon_soup_a_polygon_mesh(triangles)) { std::cerr << "Warning: got a polygon soup (may simply be a non-manifold vertex)!\n"; diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_self_intersections.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_self_intersections.h index 1f0d457ddda..ca8cc0c7897 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_self_intersections.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_self_intersections.h @@ -245,7 +245,7 @@ FaceOutputIterator replace_faces_with_patch(const std::vector mesh_non_border_hedges; std::set mesh_border_hedge; for(halfedge_descriptor h : cc_border_hedges) { if(!is_border(opposite(h, tmesh), tmesh)) - only_border_edges = false; + mesh_non_border_hedges.push_back(h); else mesh_border_hedge.insert(opposite(h, tmesh)); } - int nb_cycles = 0; + if (mesh_border_hedge.empty()) + { +#ifdef CGAL_PMP_REMOVE_SELF_INTERSECTION_DEBUG + std::cout << " DEBUG: CC not handled, selection is not a topological disk (preserve_genus=false)\n"; + ++unsolved_self_intersections; +#endif + topology_issue = true; + continue; + } + + // we look for cycles of border halfedges and update selection_chi while(!mesh_border_hedge.empty()) { // we must count the number of cycle of boundary edges @@ -1790,14 +1812,14 @@ remove_self_intersections_one_step(std::set::iterator it = mesh_border_hedge.find(h); if(it == mesh_border_hedge.end()) - break; // not a cycle + break; // not a cycle does not count mesh_border_hedge.erase(it); } @@ -1805,29 +1827,19 @@ remove_self_intersections_one_step(std::set (only_border_edges ? 1 : 0)) + if(selection_chi!=1) { #ifdef CGAL_PMP_REMOVE_SELF_INTERSECTION_DEBUG - std::cout << " DEBUG: CC not handled due to the presence of " - << nb_cycles << " of boundary edges\n"; - ++unsolved_self_intersections; + std::cout << " DEBUG: CC not handled, selection is not a topological disk even if" + << " boundary cycles are removed: chi=" << selection_chi << "\n"; + ++unsolved_self_intersections; #endif - topology_issue = true; continue; } else { - if(preserve_genus) - { -#ifdef CGAL_PMP_REMOVE_SELF_INTERSECTION_DEBUG - std::cout << " DEBUG: CC not handled because it is not a topological disk (preserve_genus=true)\n"; - ++unsolved_self_intersections; -#endif - - all_fixed = false; - continue; - } + cc_border_hedges.swap(mesh_non_border_hedges); // count the number of cycles of halfedges of the boundary std::map bhs; diff --git a/Polygon_mesh_processing/include/CGAL/Polyhedral_envelope.h b/Polygon_mesh_processing/include/CGAL/Polyhedral_envelope.h index fe43b4f32d1..abc6f3804e4 100644 --- a/Polygon_mesh_processing/include/CGAL/Polyhedral_envelope.h +++ b/Polygon_mesh_processing/include/CGAL/Polyhedral_envelope.h @@ -85,6 +85,9 @@ #include #include #include +#include +#include + #ifdef DOXYGEN_RUNNING #define CGAL_PMP_NP_TEMPLATE_PARAMETERS NamedParameters #define CGAL_PMP_NP_CLASS NamedParameters diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt b/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt index 81a660cc20e..4af1dc42dfb 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt @@ -70,6 +70,7 @@ create_single_source_cgal_program("pmp_do_intersect_test.cpp") create_single_source_cgal_program("test_is_polygon_soup_a_polygon_mesh.cpp") create_single_source_cgal_program("test_stitching.cpp") create_single_source_cgal_program("remeshing_test.cpp") +create_single_source_cgal_program("remeshing_with_isolated_constraints_test.cpp" ) create_single_source_cgal_program("measures_test.cpp") create_single_source_cgal_program("triangulate_faces_test.cpp") create_single_source_cgal_program("triangulate_faces_hole_filling_dt3_test.cpp") diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/autorefinement_sm.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/autorefinement_sm.cpp index 97f80e530ee..e437fe6e23e 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/autorefinement_sm.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/autorefinement_sm.cpp @@ -17,7 +17,7 @@ int main(int argc, char* argv[]) const char* filename = (argc > 1) ? argv[1] : "data/blobby.off"; Mesh mesh; - if(!PMP::read_polygon_mesh(filename, mesh)) + if(!PMP::IO::read_polygon_mesh(filename, mesh)) { std::cerr << "Input mesh is not a valid off file." << std::endl; return 1; @@ -42,17 +42,17 @@ int main(int argc, char* argv[]) PMP::experimental::autorefine(mesh); std::cout << "Number of vertices after autorefinement " << mesh.number_of_vertices() << "\n"; - CGAL::write_polygon_mesh("mesh_autorefined.off", mesh, CGAL::parameters::stream_precision(17)); + CGAL::IO::write_polygon_mesh("mesh_autorefined.off", mesh, CGAL::parameters::stream_precision(17)); clear(mesh); - CGAL::Polygon_mesh_processing::read_polygon_mesh(filename, mesh); + CGAL::Polygon_mesh_processing::IO::read_polygon_mesh(filename, mesh); std::cout << "Number of vertices before self-intersection removal " << mesh.number_of_vertices() << "\n"; if (!PMP::experimental::autorefine_and_remove_self_intersections(mesh)) std::cout << "WARNING: Cannot remove all self-intersections\n"; std::cout << "Number of vertices after self-intersection removal " << mesh.number_of_vertices() << "\n"; - CGAL::write_polygon_mesh("mesh_fixed.off", mesh, CGAL::parameters::stream_precision(17)); + CGAL::IO::write_polygon_mesh("mesh_fixed.off", mesh, CGAL::parameters::stream_precision(17)); return EXIT_SUCCESS; } diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/remeshing_with_isolated_constraints_test.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/remeshing_with_isolated_constraints_test.cpp new file mode 100644 index 00000000000..4e7ebe96092 --- /dev/null +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/remeshing_with_isolated_constraints_test.cpp @@ -0,0 +1,61 @@ +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; +typedef Kernel::Point_3 Point_3; +typedef CGAL::Surface_mesh Polygon_mesh; + +typedef boost::graph_traits::vertex_descriptor vertex_descriptor; +typedef boost::graph_traits::edge_descriptor edge_descriptor; +typedef boost::graph_traits::face_descriptor face_descriptor; + +namespace PMP = CGAL::Polygon_mesh_processing; + +int main(int, char**) +{ + Polygon_mesh sm; + CGAL::make_grid(10, 10, sm); + PMP::triangulate_faces(sm); + std::cout << faces(sm).size() << " faces in input" << std::endl; + assert(faces(sm).size() == 200); + + std::set fs; + auto selected_faces = make_boolean_property_map(fs); + fs.insert(*(faces(sm).begin())); + CGAL::expand_face_selection(fs, sm, 1, selected_faces, CGAL::Emptyset_iterator()); + std::cout << fs.size() << " faces in the range" << std::endl; + assert(fs.size() == 4); + + typedef std::set Active_vertices; + Active_vertices active_vertices; + auto apm = make_boolean_property_map(active_vertices); + for(vertex_descriptor v : vertices(sm)) + put(apm, v, true); + + typedef CGAL::dynamic_edge_property_t Contraint_property; + typedef typename boost::property_map::type ECM; + ECM ecm = get(Contraint_property(), sm); + + for(edge_descriptor e : edges(sm)) + put(ecm, e, true); + + PMP::isotropic_remeshing(fs, 0.5, sm, CGAL::parameters::vertex_is_constrained_map(apm) + .edge_is_constrained_map(ecm) + .collapse_constraints(false) + .number_of_iterations(10) + .number_of_relaxation_steps(10)); + + std::cout << faces(sm).size() << " faces in output" << std::endl; + assert(faces(sm).size() == 234); + + return EXIT_SUCCESS; +} 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 242e50edcbf..2eec580c5bc 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 @@ -28,13 +28,13 @@ template void run(const char* filename1, const char* filename2, const char* msg) { TriangleMesh mesh1; - if ( !CGAL::Polygon_mesh_processing::read_polygon_mesh(filename1, mesh1) ) { + if ( !PMP::IO::read_polygon_mesh(filename1, mesh1) ) { std::cerr << filename1 << " is not a valid off file.\n"; exit(1); } TriangleMesh mesh2; - if ( !CGAL::Polygon_mesh_processing::read_polygon_mesh(filename2, mesh2) ) { + if ( !PMP::IO::read_polygon_mesh(filename2, mesh2) ) { std::cerr << filename2 << " is not a valid off file.\n"; exit(1); } diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_autorefinement.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_autorefinement.cpp index eb8cf3a4654..06bbfa2a147 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_autorefinement.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_autorefinement.cpp @@ -22,7 +22,7 @@ struct My_visitor : : i (new int(0) ) {} - boost::shared_ptr i; + std::shared_ptr i; }; void test(const char* fname, std::size_t nb_polylines, std::size_t total_nb_points, diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_corefine.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_corefine.cpp index 10dd9ff76d7..ec1cefd793c 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_corefine.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_corefine.cpp @@ -20,7 +20,7 @@ struct My_visitor : : i (new int(0) ) {} - boost::shared_ptr i; + std::shared_ptr i; }; void test(const char* f1, const char* f2) diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_corefinement_bool_op.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_corefinement_bool_op.cpp index 4cc5233a1ce..0355040ecad 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_corefinement_bool_op.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_corefinement_bool_op.cpp @@ -67,7 +67,7 @@ void run_boolean_operations( #ifdef CGAL_COREFINEMENT_DEBUG std::stringstream fname; fname << scenario << "_tm1_union_tm2.off"; - CGAL::write_polygon_mesh(fname.str(), union_, CGAL::parameters::stream_precision(17)); + CGAL::IO::write_polygon_mesh(fname.str(), union_, CGAL::parameters::stream_precision(17)); #endif } else @@ -79,7 +79,7 @@ void run_boolean_operations( #ifdef CGAL_COREFINEMENT_DEBUG std::stringstream fname; fname << scenario << "_tm1_inter_tm2.off"; - CGAL::write_polygon_mesh(fname.str(), inter, CGAL::parameters::stream_precision(17)); + CGAL::IO::write_polygon_mesh(fname.str(), inter, CGAL::parameters::stream_precision(17)); #endif } else @@ -91,7 +91,7 @@ void run_boolean_operations( #ifdef CGAL_COREFINEMENT_DEBUG std::stringstream fname; fname << scenario << "_tm1_minus_tm2.off"; - CGAL::write_polygon_mesh(fname.str(), tm1_minus_tm2, CGAL::parameters::stream_precision(17)); + CGAL::IO::write_polygon_mesh(fname.str(), tm1_minus_tm2, CGAL::parameters::stream_precision(17)); #endif } else @@ -103,7 +103,7 @@ void run_boolean_operations( #ifdef CGAL_COREFINEMENT_DEBUG std::stringstream fname; fname << scenario << "_tm2_minus_tm1.off"; - CGAL::write_polygon_mesh(fname.str(), tm2_minus_tm1, CGAL::parameters::stream_precision(17)); + CGAL::IO::write_polygon_mesh(fname.str(), tm2_minus_tm1, CGAL::parameters::stream_precision(17)); #endif } else diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_is_polygon_soup_a_polygon_mesh.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_is_polygon_soup_a_polygon_mesh.cpp index c6e889e008f..97836482d73 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_is_polygon_soup_a_polygon_mesh.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_is_polygon_soup_a_polygon_mesh.cpp @@ -40,7 +40,7 @@ void test_polygon_soup(std::string fname, bool expected) exit(EXIT_FAILURE); } - if(!CGAL::read_OFF(input, points, polygons)) + if(!CGAL::IO::read_OFF(input, points, polygons)) { std::cerr << "Error parsing the OFF file " << fname << "\n"; exit(EXIT_FAILURE); diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_merging_border_vertices.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_merging_border_vertices.cpp index a178117ab66..491837ea01d 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_merging_border_vertices.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_merging_border_vertices.cpp @@ -32,7 +32,7 @@ void test_merge_duplicated_vertices_in_boundary_cycles(const char* fname, if (expected_nb_vertices==0) { std::cout << "writing output to out1.off\n"; - CGAL::write_polygon_mesh("out1.off", mesh, CGAL::parameters::stream_precision(17)); + CGAL::IO::write_polygon_mesh("out1.off", mesh, CGAL::parameters::stream_precision(17)); } } diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_distance.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_distance.cpp index 7a908e33b8c..c8d1040383d 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_distance.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_distance.cpp @@ -1,11 +1,11 @@ #include #include + #include #include - - #include - +#include +#include #include #include @@ -194,6 +194,14 @@ struct Custom_traits_Hausdorff }; namespace CGAL{ + +CGAL_DEFINE_COERCION_TRAITS_FOR_SELF(Custom_traits_Hausdorff::FT) +CGAL_DEFINE_COERCION_TRAITS_FROM_TO(short, Custom_traits_Hausdorff::FT) +CGAL_DEFINE_COERCION_TRAITS_FROM_TO(int, Custom_traits_Hausdorff::FT) +CGAL_DEFINE_COERCION_TRAITS_FROM_TO(long, Custom_traits_Hausdorff::FT) +CGAL_DEFINE_COERCION_TRAITS_FROM_TO(float, Custom_traits_Hausdorff::FT) +CGAL_DEFINE_COERCION_TRAITS_FROM_TO(double, Custom_traits_Hausdorff::FT) + template<>struct Kernel_traits { typedef Custom_traits_Hausdorff Kernel; @@ -318,7 +326,7 @@ int main(int argc, char** argv) std::vector > faces; std::vector points; input.open(argv[1]); - CGAL::read_OFF(input, points, faces); + CGAL::IO::read_OFF(input, points, faces); input.close(); std::vector samples; diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_non_conforming_snapping.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_non_conforming_snapping.cpp index d9ede5fc7d0..c41b951d573 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_non_conforming_snapping.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_non_conforming_snapping.cpp @@ -51,7 +51,7 @@ void read_mesh(const char* filename, { std::vector points; std::vector > faces; - CGAL::read_STL(in, points, faces); + CGAL::IO::read_STL(in, points, faces); if(!CGAL::Polygon_mesh_processing::orient_polygon_soup(points, faces)) std::cerr << "W: File does not describe a polygon mesh" << std::endl; diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_polyhedral_envelope.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_polyhedral_envelope.cpp index 7127b22e3e0..1a7d4ff8041 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_polyhedral_envelope.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_polyhedral_envelope.cpp @@ -17,7 +17,7 @@ void test_API() std::vector points; std::vector > triangles; std::ifstream in("data/eight.off"); - CGAL::read_OFF(in, points, triangles); + CGAL::IO::read_OFF(in, points, triangles); CGAL::Surface_mesh sm; CGAL::Polyhedron_3 poly; PMP::polygon_soup_to_polygon_mesh(points, triangles, sm); diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_read_polygon_mesh.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_read_polygon_mesh.cpp index 3ad4d43e8f5..e205ea5c5db 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_read_polygon_mesh.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_read_polygon_mesh.cpp @@ -42,14 +42,14 @@ void test(const std::string& filename, const bool is_pm) Mesh g; std::cout<<"0"< cvpm(cpoints); std::cout<<"4"< 1) path = std::string(argv[1]); path += "4464_" + file_name + ".off"; std::ofstream out(path.c_str(), std::ios_base::out); - CGAL::set_ascii_mode(out); - CGAL::write_OFF(out, pmesh); + CGAL::IO::set_ascii_mode(out); + CGAL::IO::write_OFF(out, pmesh); out.close(); std::cout << "* finished writing the file" << std::endl; } diff --git a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_model_complexty_control.cpp b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_model_complexty_control.cpp index ef2f5599d51..81af025c489 100644 --- a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_model_complexty_control.cpp +++ b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_model_complexty_control.cpp @@ -50,11 +50,11 @@ int main() CGAL::Timer t; t.start(); - if (!CGAL::read_PLY_with_properties(input_stream, - std::back_inserter(points), - CGAL::make_ply_point_reader(Point_map()), - CGAL::make_ply_normal_reader(Normal_map()), - std::make_pair(Plane_index_map(), CGAL::PLY_property("segment_index")))) + if (!CGAL::IO::read_PLY_with_properties(input_stream, + std::back_inserter(points), + CGAL::make_ply_point_reader(Point_map()), + CGAL::make_ply_normal_reader(Normal_map()), + std::make_pair(Plane_index_map(), CGAL::PLY_property("segment_index")))) { std::cerr << "Error: cannot read file " << input_file << std::endl; return EXIT_FAILURE; @@ -91,7 +91,7 @@ int main() } else { const std::string& output_file = "data/building_result-0.05.off"; - if (CGAL::write_OFF(output_file, model)) { + if (CGAL::IO::write_OFF(output_file, model)) { std::cout << " Done. Saved to " << output_file << ". Time: " << t.time() << " sec." << std::endl; } else { @@ -109,7 +109,7 @@ int main() } else { const std::string& output_file = "data/building_result-0.5.off"; - if (CGAL::write_OFF(output_file, model)) + if (CGAL::IO::write_OFF(output_file, model)) std::cout << " Done. Saved to " << output_file << ". Time: " << t.time() << " sec." << std::endl; else { std::cerr << " Failed saving file." << std::endl; @@ -126,7 +126,7 @@ int main() } else { const std::string& output_file = "data/building_result-0.7.off"; - if (CGAL::write_OFF(output_file, model)){ + if (CGAL::IO::write_OFF(output_file, model)){ std::cout << " Done. Saved to " << output_file << ". Time: " << t.time() << " sec." << std::endl; } else { diff --git a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_user_provided_planes.cpp b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_user_provided_planes.cpp index dbe23f024fb..3a032287bdd 100644 --- a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_user_provided_planes.cpp +++ b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_user_provided_planes.cpp @@ -50,11 +50,11 @@ int main() CGAL::Timer t; t.start(); - if (!CGAL::read_PLY_with_properties(input_stream, - std::back_inserter(points), - CGAL::make_ply_point_reader(Point_map()), - CGAL::make_ply_normal_reader(Normal_map()), - std::make_pair(Plane_index_map(), CGAL::PLY_property("segment_index")))) + if (!CGAL::IO::read_PLY_with_properties(input_stream, + std::back_inserter(points), + CGAL::make_ply_point_reader(Point_map()), + CGAL::make_ply_normal_reader(Normal_map()), + std::make_pair(Plane_index_map(), CGAL::PLY_property("segment_index")))) { std::cerr << "Error: cannot read file " << input_file << std::endl; return EXIT_FAILURE; @@ -90,7 +90,7 @@ int main() // Saves the mesh model const std::string& output_file("data/ball_result.off"); - if (CGAL::write_OFF(output_file, model)) + if (CGAL::IO::write_OFF(output_file, model)) std::cout << " Done. Saved to " << output_file << ". Time: " << t.time() << " sec." << std::endl; else { std::cerr << " Failed saving file." << std::endl; diff --git a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_with_region_growing.cpp b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_with_region_growing.cpp index a30cfd29c01..936034142cd 100644 --- a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_with_region_growing.cpp +++ b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_with_region_growing.cpp @@ -101,8 +101,8 @@ int main() CGAL::Timer t; t.start(); - if (!CGAL::read_points(input_file.c_str(), std::back_inserter(points), - CGAL::parameters::point_map(Point_map()).normal_map(Normal_map()))) { + if (!CGAL::IO::read_points(input_file.c_str(), std::back_inserter(points), + CGAL::parameters::point_map(Point_map()).normal_map(Normal_map()))) { std::cerr << "Error: cannot read file " << input_file << std::endl; return EXIT_FAILURE; @@ -175,7 +175,7 @@ int main() std::cout << "Saving..."; t.reset(); const std::string& output_file("data/cube_result.off"); - if (CGAL::write_OFF(output_file, model)) + if (CGAL::IO::write_OFF(output_file, model)) std::cout << " Done. Saved to " << output_file << ". Time: " << t.time() << " sec." << std::endl; else { std::cerr << " Failed saving file." << std::endl; diff --git a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_without_input_planes.cpp b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_without_input_planes.cpp index 0f8365be9a7..1a5d215a79f 100644 --- a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_without_input_planes.cpp +++ b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/polyfit_example_without_input_planes.cpp @@ -68,8 +68,8 @@ int main() CGAL::Timer t; t.start(); - if (!CGAL::read_points(input_file.c_str(), std::back_inserter(points), - CGAL::parameters::point_map(Point_map()).normal_map(Normal_map()))) + if (!CGAL::IO::read_points(input_file.c_str(), std::back_inserter(points), + CGAL::parameters::point_map(Point_map()).normal_map(Normal_map()))) { std::cerr << "Error: cannot read file " << input_file << std::endl; return EXIT_FAILURE; @@ -126,7 +126,7 @@ int main() } const std::string& output_file("data/cube_result.off"); - if (CGAL::write_OFF(output_file, model)) + if (CGAL::IO::write_OFF(output_file, model)) std::cout << " Done. Saved to " << output_file << ". Time: " << t.time() << " sec." << std::endl; else { std::cerr << " Failed saving file." << std::endl; @@ -140,7 +140,7 @@ int main() algo.output_candidate_faces(candidate_faces); const std::string& candidate_faces_file("data/cube_candidate_faces.off"); std::ofstream candidate_stream(candidate_faces_file.c_str()); - if (CGAL::write_OFF(candidate_stream, candidate_faces)) + if (CGAL::IO::write_OFF(candidate_stream, candidate_faces)) std::cout << "Candidate faces saved to " << candidate_faces_file << "." << std::endl; return EXIT_SUCCESS; diff --git a/Polygonal_surface_reconstruction/test/Polygonal_surface_reconstruction/polygonal_surface_reconstruction_test_framework.h b/Polygonal_surface_reconstruction/test/Polygonal_surface_reconstruction/polygonal_surface_reconstruction_test_framework.h index 01021729f87..0f0582591cf 100644 --- a/Polygonal_surface_reconstruction/test/Polygonal_surface_reconstruction/polygonal_surface_reconstruction_test_framework.h +++ b/Polygonal_surface_reconstruction/test/Polygonal_surface_reconstruction/polygonal_surface_reconstruction_test_framework.h @@ -84,37 +84,36 @@ int reconstruct(const std::string& input_file, bool force_extract_planes) CGAL::Timer t; t.start(); if (extension == ".pwn") { - if (!CGAL::read_XYZ( - input_stream, - std::back_inserter(points), - CGAL::parameters::point_map(Point_map()).normal_map(Normal_map()))) - { + if (!CGAL::IO::read_XYZ(input_stream, + std::back_inserter(points), + CGAL::parameters::point_map(Point_map()).normal_map(Normal_map()))) + { std::cerr << " Error: cannot read file " << input_file << std::endl; - return EXIT_FAILURE; - } - else - std::cout << " Done. " << points.size() << " points. Time: " << t.time() << " sec." << std::endl; + return EXIT_FAILURE; + } + else + std::cout << " Done. " << points.size() << " points. Time: " << t.time() << " sec." << std::endl; } else if (extension == ".ply") { - if (!CGAL::read_PLY_with_properties( + if (!CGAL::IO::read_PLY_with_properties( input_stream, std::back_inserter(points), CGAL::make_ply_point_reader(Point_map()), CGAL::make_ply_normal_reader(Normal_map()), std::make_pair(Plane_index_map(), CGAL::PLY_property("segment_index")))) - { - std::cerr << " Error: cannot read file " << input_file << std::endl; - return EXIT_FAILURE; - } - else - std::cout << " Done. " << points.size() << " points. Time: " << t.time() << " sec." << std::endl; + { + std::cerr << " Error: cannot read file " << input_file << std::endl; + return EXIT_FAILURE; + } + else + std::cout << " Done. " << points.size() << " points. Time: " << t.time() << " sec." << std::endl; - int max_plane_index = 0; + int max_plane_index = 0; for (std::size_t i = 0; i < points.size(); ++i) { - int plane_index = points[i].template get<2>(); - if (plane_index > max_plane_index) - max_plane_index = plane_index; - } + int plane_index = points[i].template get<2>(); + if (plane_index > max_plane_index) + max_plane_index = plane_index; + } int num_planes = max_plane_index + 1; // if fewer than 4 planes provided, we consider it as not provided. diff --git a/Polyhedron/demo/Polyhedron/Plugins/Classification/Cluster_classification.cpp b/Polyhedron/demo/Polyhedron/Plugins/Classification/Cluster_classification.cpp index 1de6a367cb5..b919ba2ca6b 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Classification/Cluster_classification.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Classification/Cluster_classification.cpp @@ -389,10 +389,10 @@ void Cluster_classification::backup_existing_colors_and_add_new() { if (m_points->point_set()->has_colors()) { - m_color = m_points->point_set()->add_property_map("real_color").first; + m_color = m_points->point_set()->add_property_map("real_color").first; for (Point_set::const_iterator it = m_points->point_set()->begin(); it != m_points->point_set()->first_selected(); ++ it) - m_color[*it] = CGAL::Color ((unsigned char)(255 * m_points->point_set()->red(*it)), + m_color[*it] = CGAL::IO::Color ((unsigned char)(255 * m_points->point_set()->red(*it)), (unsigned char)(255 * m_points->point_set()->green(*it)), (unsigned char)(255 * m_points->point_set()->blue(*it))); @@ -404,7 +404,7 @@ void Cluster_classification::backup_existing_colors_and_add_new() void Cluster_classification::reset_colors() { - if (m_color == Point_set::Property_map()) + if (m_color == Point_set::Property_map()) m_points->point_set()->remove_colors(); else { @@ -599,7 +599,7 @@ int Cluster_classification::real_index_color() const { int out = m_index_color; - if (out == 0 && m_color == Point_set::Property_map()) + if (out == 0 && m_color == Point_set::Property_map()) out = -1; return out; } @@ -635,7 +635,7 @@ void Cluster_classification::compute_features (std::size_t nb_scales, float voxe if (normals) normal_map = m_points->point_set()->normal_map(); - bool colors = (m_color != Point_set::Property_map()); + bool colors = (m_color != Point_set::Property_map()); Point_set::Property_map echo_map; bool echo; diff --git a/Polyhedron/demo/Polyhedron/Plugins/Classification/Cluster_classification.h b/Polyhedron/demo/Polyhedron/Plugins/Classification/Cluster_classification.h index e7b3df3e9b2..224a66d20c7 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Classification/Cluster_classification.h +++ b/Polyhedron/demo/Polyhedron/Plugins/Classification/Cluster_classification.h @@ -379,7 +379,7 @@ class Cluster_classification : public Item_classification_base Point_set::Property_map m_red; Point_set::Property_map m_green; Point_set::Property_map m_blue; - Point_set::Property_map m_color; + Point_set::Property_map m_color; Point_set::Property_map m_cluster_id; Point_set::Property_map m_training; Point_set::Property_map m_classif; diff --git a/Polyhedron/demo/Polyhedron/Plugins/Classification/Item_classification_base.h b/Polyhedron/demo/Polyhedron/Plugins/Classification/Item_classification_base.h index ad13090ccc9..5b860c1b15c 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Classification/Item_classification_base.h +++ b/Polyhedron/demo/Polyhedron/Plugins/Classification/Item_classification_base.h @@ -228,7 +228,7 @@ public: void change_label_color (std::size_t position, const QColor& color) { m_labels[position]->set_color - (CGAL::Color (color.red(), color.green(), color.blue())); + (CGAL::IO::Color (color.red(), color.green(), color.blue())); } void change_label_name (std::size_t position, const std::string& name) { diff --git a/Polyhedron/demo/Polyhedron/Plugins/Classification/Point_set_item_classification.cpp b/Polyhedron/demo/Polyhedron/Plugins/Classification/Point_set_item_classification.cpp index 06a51d6d962..b6295553e1a 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Classification/Point_set_item_classification.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Classification/Point_set_item_classification.cpp @@ -325,10 +325,10 @@ void Point_set_item_classification::backup_existing_colors_and_add_new() { if (m_points->point_set()->has_colors()) { - m_color = m_points->point_set()->add_property_map("real_color").first; + m_color = m_points->point_set()->add_property_map("real_color").first; for (Point_set::const_iterator it = m_points->point_set()->begin(); it != m_points->point_set()->first_selected(); ++ it) - m_color[*it] = CGAL::Color((unsigned char)(255 * m_points->point_set()->red(*it)), + m_color[*it] = CGAL::IO::Color((unsigned char)(255 * m_points->point_set()->red(*it)), (unsigned char)(255 * m_points->point_set()->green(*it)), (unsigned char)(255 * m_points->point_set()->blue(*it))); @@ -340,7 +340,7 @@ void Point_set_item_classification::backup_existing_colors_and_add_new() void Point_set_item_classification::reset_colors() { - if (m_color == Point_set::Property_map()) + if (m_color == Point_set::Property_map()) m_points->point_set()->remove_colors(); else { @@ -491,7 +491,7 @@ int Point_set_item_classification::real_index_color() const { int out = m_index_color; - if (out == 0 && m_color == Point_set::Property_map()) + if (out == 0 && m_color == Point_set::Property_map()) out = -1; return out; } @@ -530,7 +530,7 @@ void Point_set_item_classification::compute_features (std::size_t nb_scales, flo if (normals) normal_map = m_points->point_set()->normal_map(); - bool colors = (m_color != Point_set::Property_map()); + bool colors = (m_color != Point_set::Property_map()); Point_set::Property_map echo_map; bool echo; diff --git a/Polyhedron/demo/Polyhedron/Plugins/Classification/Point_set_item_classification.h b/Polyhedron/demo/Polyhedron/Plugins/Classification/Point_set_item_classification.h index bf6f3e1cf66..f52e2438aab 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Classification/Point_set_item_classification.h +++ b/Polyhedron/demo/Polyhedron/Plugins/Classification/Point_set_item_classification.h @@ -399,7 +399,7 @@ class Point_set_item_classification : public Item_classification_base Point_set::Property_map m_red; Point_set::Property_map m_green; Point_set::Property_map m_blue; - Point_set::Property_map m_color; + Point_set::Property_map m_color; std::vector > m_label_probabilities; Point_set::Property_map m_training; diff --git a/Polyhedron/demo/Polyhedron/Plugins/Classification/Surface_mesh_item_classification.cpp b/Polyhedron/demo/Polyhedron/Plugins/Classification/Surface_mesh_item_classification.cpp index 41f56217c4c..3fc12e4dd2f 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Classification/Surface_mesh_item_classification.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Classification/Surface_mesh_item_classification.cpp @@ -58,27 +58,27 @@ Surface_mesh_item_classification::~Surface_mesh_item_classification() void Surface_mesh_item_classification::backup_existing_colors_and_add_new() { bool has_colors = false; - boost::tie (m_color, has_colors) = m_mesh->polyhedron()->property_map("f:color"); + boost::tie (m_color, has_colors) = m_mesh->polyhedron()->property_map("f:color"); if (has_colors) { m_real_color - = m_mesh->polyhedron()->add_property_map("f:real_color").first; + = m_mesh->polyhedron()->add_property_map("f:real_color").first; for(face_descriptor fd : faces(*(m_mesh->polyhedron()))) { m_real_color[fd] = m_color[fd]; - m_color[fd] = CGAL::Color(128, 128, 128); + m_color[fd] = CGAL::IO::Color(128, 128, 128); } } else m_color = - m_mesh->polyhedron()->add_property_map("f:color", CGAL::Color(128,128,128)).first; + m_mesh->polyhedron()->add_property_map("f:color", CGAL::IO::Color(128,128,128)).first; } void Surface_mesh_item_classification::change_color (int index, float* vmin, float* vmax) { m_index_color = index; int index_color = index; - if (index == 0 && m_real_color == Mesh::Property_map()) + if (index == 0 && m_real_color == Mesh::Property_map()) index_color = -1; static Color_ramp ramp; @@ -87,7 +87,7 @@ void Surface_mesh_item_classification::change_color (int index, float* vmin, flo if (index_color == -1) // item color { for(face_descriptor fd : faces(*(m_mesh->polyhedron()))) - m_color[fd] = CGAL::Color(128,128,128); + m_color[fd] = CGAL::IO::Color(128,128,128); } else if (index_color == 0) // real colors { @@ -104,7 +104,7 @@ void Surface_mesh_item_classification::change_color (int index, float* vmin, flo if (c != std::size_t(-1)) color = label_qcolor (m_labels[c]); - m_color[fd] = CGAL::Color(color.red(), color.green(), color.blue()); + m_color[fd] = CGAL::IO::Color(color.red(), color.green(), color.blue()); } } else if (index_color == 2) // training @@ -121,7 +121,7 @@ void Surface_mesh_item_classification::change_color (int index, float* vmin, flo float div = 1; if (c != c2) div = 2; - m_color[fd] = CGAL::Color(color.red() / div, + m_color[fd] = CGAL::IO::Color(color.red() / div, color.green() / div, color.blue() / div); } @@ -136,7 +136,7 @@ void Surface_mesh_item_classification::change_color (int index, float* vmin, flo { for(face_descriptor fd : faces(*(m_mesh->polyhedron()))) { - m_color[fd] = CGAL::Color((unsigned char)(128), + m_color[fd] = CGAL::IO::Color((unsigned char)(128), (unsigned char)(128), (unsigned char)(128)); } @@ -146,7 +146,7 @@ void Surface_mesh_item_classification::change_color (int index, float* vmin, flo for(face_descriptor fd : faces(*(m_mesh->polyhedron()))) { float v = (std::max) (0.f, (std::min)(1.f, m_label_probabilities[corrected_index][fd])); - m_color[fd] = CGAL::Color((unsigned char)(ramp.r(v) * 255), + m_color[fd] = CGAL::IO::Color((unsigned char)(ramp.r(v) * 255), (unsigned char)(ramp.g(v) * 255), (unsigned char)(ramp.b(v) * 255)); } @@ -190,7 +190,7 @@ void Surface_mesh_item_classification::change_color (int index, float* vmin, flo if (v < 0.f) v = 0.f; if (v > 1.f) v = 1.f; - m_color[fd] = CGAL::Color((unsigned char)(ramp.r(v) * 255), + m_color[fd] = CGAL::IO::Color((unsigned char)(ramp.r(v) * 255), (unsigned char)(ramp.g(v) * 255), (unsigned char)(ramp.b(v) * 255)); } diff --git a/Polyhedron/demo/Polyhedron/Plugins/Classification/Surface_mesh_item_classification.h b/Polyhedron/demo/Polyhedron/Plugins/Classification/Surface_mesh_item_classification.h index 1b6b2c1e720..797e88de438 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Classification/Surface_mesh_item_classification.h +++ b/Polyhedron/demo/Polyhedron/Plugins/Classification/Surface_mesh_item_classification.h @@ -200,8 +200,8 @@ protected: Scene_polyhedron_selection_item* m_selection; Mesh::Property_map m_training; Mesh::Property_map m_classif; - Mesh::Property_map m_color; - Mesh::Property_map m_real_color; + Mesh::Property_map m_color; + Mesh::Property_map m_real_color; std::vector > m_label_probabilities; diff --git a/Polyhedron/demo/Polyhedron/Plugins/Display/Display_property_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Display/Display_property_plugin.cpp index 8b92ffb1b37..c787c901e5b 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Display/Display_property_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Display/Display_property_plugin.cpp @@ -207,8 +207,8 @@ public: typedef boost::graph_traits::face_descriptor face_descriptor; typedef boost::graph_traits::halfedge_descriptor halfedge_descriptor; typedef boost::graph_traits::vertex_descriptor vertex_descriptor; - SMesh::Property_map vcolors = - sm->property_map("v:color").first; + SMesh::Property_map vcolors = + sm->property_map("v:color").first; SMesh::Property_map vdist= sm->property_map("v:dist").first; typedef CGAL::Buffer_for_vao CPF; @@ -263,7 +263,7 @@ public: } for(vertex_descriptor vd : vertices(*sm)) { - CGAL::Color c = vcolors[vd]; + CGAL::IO::Color c = vcolors[vd]; colors.push_back((float)c.red()/255); colors.push_back((float)c.green()/255); colors.push_back((float)c.blue()/255); @@ -966,8 +966,8 @@ private Q_SLOTS: dock_widget->maxBox->setValue(max); displayLegend(); //} - SMesh::Property_map vcolors = - mesh.add_property_map("v:color", CGAL::Color()).first; + SMesh::Property_map vcolors = + mesh.add_property_map("v:color", CGAL::IO::Color()).first; SMesh::Property_map vdist= mesh.add_property_map("v:dist", 0.0).first; for(boost::graph_traits::vertex_iterator vit = vertices(mesh).begin(); @@ -975,7 +975,7 @@ private Q_SLOTS: ++vit) { double h =(heat_intensity[*vit]-min)/(max-min); - CGAL::Color color( + CGAL::IO::Color color( 255*color_ramp.r(h), 255*color_ramp.g(h), 255*color_ramp.b(h)); @@ -1535,7 +1535,7 @@ private: pit != this->dataset.end(); ++pit) { - CGAL::Color color( + CGAL::IO::Color color( this->parent->color_map[value_index_map[this->property_map[*pit]]].red(), this->parent->color_map[value_index_map[this->property_map[*pit]]].green(), this->parent->color_map[value_index_map[this->property_map[*pit]]].blue()); @@ -1558,7 +1558,7 @@ private: f = 0; if(f>1) f = 1; - CGAL::Color color( + CGAL::IO::Color color( 255*this->parent->color_ramp.r(f), 255*this->parent->color_ramp.g(f), 255*this->parent->color_ramp.b(f)); @@ -1589,13 +1589,13 @@ private: void set_colors_map(std::unordered_map &value_index_map) { - SMesh::Property_map vcolors = - this->dataset.template add_property_map("v:color", CGAL::Color()).first; + SMesh::Property_map vcolors = + this->dataset.template add_property_map("v:color", CGAL::IO::Color()).first; for(boost::graph_traits::vertex_iterator vit = vertices(this->dataset).begin(); vit != vertices(this->dataset).end(); ++vit) { - CGAL::Color color( + CGAL::IO::Color color( this->parent->color_map[value_index_map[this->property_map[*vit]]].red(), this->parent->color_map[value_index_map[this->property_map[*vit]]].green(), this->parent->color_map[value_index_map[this->property_map[*vit]]].blue()); @@ -1605,8 +1605,8 @@ private: void set_colors_ramp() { - SMesh::Property_map vcolors = - this->dataset.template add_property_map("v:color", CGAL::Color()).first; + SMesh::Property_map vcolors = + this->dataset.template add_property_map("v:color", CGAL::IO::Color()).first; float max = this->parent->maxBox; float min = this->parent->minBox; for(boost::graph_traits::vertex_iterator vit = vertices(this->dataset).begin(); @@ -1620,7 +1620,7 @@ private: f = 0; if(f>1) f = 1; - CGAL::Color color( + CGAL::IO::Color color( 255*this->parent->color_ramp.r(f), 255*this->parent->color_ramp.g(f), 255*this->parent->color_ramp.b(f)); @@ -1648,13 +1648,13 @@ private: void set_colors_map(std::unordered_map &value_index_map) { - SMesh::Property_map fcolors = - this->dataset.template add_property_map("f:color", CGAL::Color()).first; + SMesh::Property_map fcolors = + this->dataset.template add_property_map("f:color", CGAL::IO::Color()).first; for(boost::graph_traits::face_iterator fit = faces(this->dataset).begin(); fit != faces(this->dataset).end(); ++fit) { - CGAL::Color color( + CGAL::IO::Color color( this->parent->color_map[value_index_map[this->property_map[*fit]]].red(), this->parent->color_map[value_index_map[this->property_map[*fit]]].green(), this->parent->color_map[value_index_map[this->property_map[*fit]]].blue()); @@ -1664,8 +1664,8 @@ private: void set_colors_ramp() { - SMesh::Property_map fcolors = - this->dataset.template add_property_map("f:color", CGAL::Color()).first; + SMesh::Property_map fcolors = + this->dataset.template add_property_map("f:color", CGAL::IO::Color()).first; float max = this->parent->maxBox; float min = this->parent->minBox; for(boost::graph_traits::face_iterator fit = faces(this->dataset).begin(); @@ -1679,7 +1679,7 @@ private: f = 0; if(f>1) f = 1; - CGAL::Color color( + CGAL::IO::Color color( 255*this->parent->color_ramp.r(f), 255*this->parent->color_ramp.g(f), 255*this->parent->color_ramp.b(f)); diff --git a/Polyhedron/demo/Polyhedron/Plugins/IO/3mf_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/IO/3mf_io_plugin.cpp index 401834f0a0f..739eb180174 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/IO/3mf_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/IO/3mf_io_plugin.cpp @@ -32,7 +32,7 @@ class Io_3mf_plugin: typedef std::vector Polygon; typedef std::vector PolygonRange; typedef std::list PolylineRange; - typedef std::vector ColorRange; + typedef std::vector ColorRange; void init() Q_DECL_OVERRIDE { QMenu* menuFile = CGAL::Three::Three::mainWindow()->findChild("menuFile"); @@ -76,10 +76,10 @@ class Io_3mf_plugin: std::vector all_polygons; std::vector names; QList result; - std::vector > all_colors; + std::vector > all_colors; int nb_meshes = - CGAL::read_3MF(fileinfo.filePath().toUtf8().toStdString(), - all_points, all_polygons, all_colors, names); + CGAL::IO::read_3MF(fileinfo.filePath().toUtf8().toStdString(), + all_points, all_polygons, all_colors, names); if(nb_meshes <0 ) { ok = false; @@ -100,7 +100,7 @@ class Io_3mf_plugin: } SMesh mesh; PMP::polygon_soup_to_polygon_mesh(points, triangles, mesh); - CGAL::Color first = colors.front(); + CGAL::IO::Color first = colors.front(); bool need_pmap = false; for(auto color : colors) { @@ -112,16 +112,16 @@ class Io_3mf_plugin: } if(need_pmap) { - SMesh::Property_map fcolor = - mesh.add_property_map("f:color",first).first; + SMesh::Property_map fcolor = + mesh.add_property_map("f:color",first).first; for(std::size_t pid = 0; pid < colors.size(); ++pid) { put(fcolor, face_descriptor(pid), colors[pid]);//should work bc mesh is just created and shouldn't have any destroyed face. Not so sure bc of orientation though. } } Scene_surface_mesh_item* sm_item = new Scene_surface_mesh_item(mesh); - if(first == CGAL::Color(0,0,0,0)) - first = CGAL::Color(50,80,120,255); + if(first == CGAL::IO::Color(0,0,0,0)) + first = CGAL::IO::Color(50,80,120,255); sm_item->setColor(QColor(first.red(), first.green(), first.blue())); sm_item->setProperty("already_colored", true); sm_item->setName(names[i].data()); @@ -206,13 +206,13 @@ class Io_3mf_plugin: triangles.push_back(triangle); } - std::vector colors; + std::vector colors; //if item is multicolor, fill colors with f:color if(sm_item->isItemMulticolor()) { colors.reserve(triangles.size()); - SMesh::Property_map fcolors = - mesh.property_map("f:color").first; + SMesh::Property_map fcolors = + mesh.property_map("f:color").first; for(auto fd : mesh.faces()) { colors.push_back(get(fcolors, fd)); @@ -227,7 +227,7 @@ class Io_3mf_plugin: { int pid = get(fpid, fd); QColor q_color = sm_item->color_vector()[pid]; - colors.push_back(CGAL::Color(q_color.red(), q_color.green(), + colors.push_back(CGAL::IO::Color(q_color.red(), q_color.green(), q_color.blue(), q_color.alpha())); } } @@ -246,7 +246,7 @@ class Io_3mf_plugin: for(Scene_points_with_normal_item* pts_item : pts_items) { QColor qc = pts_item->color(); - CGAL::Color color(qc.red(), qc.green(), qc.blue()); + CGAL::IO::Color color(qc.red(), qc.green(), qc.blue()); CGAL::IO::write_point_cloud_to_model(pts_item->point_set()->points(), color, pts_item->name().toStdString(), &pMeshObject, pModel); @@ -257,7 +257,7 @@ class Io_3mf_plugin: pol_it != pol_item->polylines.end(); ++pol_it) { QColor qc = pol_item->color(); - CGAL::Color color(qc.red(), qc.green(), qc.blue()); + CGAL::IO::Color color(qc.red(), qc.green(), qc.blue()); CGAL::IO::write_polyline_to_model(*pol_it,color, pol_item->name().toStdString(), &pMeshObject, pModel); diff --git a/Polyhedron/demo/Polyhedron/Plugins/IO/GOCAD_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/IO/GOCAD_io_plugin.cpp index 1e4e522cf45..feeef33572e 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/IO/GOCAD_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/IO/GOCAD_io_plugin.cpp @@ -74,7 +74,7 @@ Polyhedron_demo_gocad_plugin::load(QFileInfo fileinfo, bool& ok, bool add_to_sce SMesh& P = * const_cast(item->polyhedron()); std::pair name_and_color; - if(! CGAL::read_GOCAD(in, name_and_color, P)) + if(! CGAL::IO::read_GOCAD(in, name_and_color, P)) { std::cerr << "Error: Invalid polyhedron" << std::endl; delete item; @@ -121,7 +121,7 @@ save(QFileInfo fileinfo,QList& items) std::ofstream out(fileinfo.filePath().toUtf8()); out.precision (std::numeric_limits::digits10 + 2); SMesh* poly = const_cast(sm_item->polyhedron()); - CGAL::write_GOCAD(out, qPrintable(fileinfo.baseName()), *poly); + CGAL::IO::write_GOCAD(out, qPrintable(fileinfo.baseName()), *poly); items.pop_front(); return true; diff --git a/Polyhedron/demo/Polyhedron/Plugins/IO/LAS_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/IO/LAS_io_plugin.cpp index ee4b373b160..a46bc54d3bf 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/IO/LAS_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/IO/LAS_io_plugin.cpp @@ -40,7 +40,7 @@ load(QFileInfo fileinfo, bool& ok, bool add_to_scene) { item->point_set()->clear(); - ok = CGAL::read_LAS (in, *(item->point_set())) && !item->isEmpty(); + ok = CGAL::IO::read_LAS (in, *(item->point_set())) && !item->isEmpty(); if(ok) { std::cerr << item->point_set()->info(); @@ -95,7 +95,7 @@ bool Polyhedron_demo_las_plugin::save(QFileInfo fileinfo,QListpoint_set()->reset_indices(); - return CGAL::write_LAS(out, *(point_set_item->point_set())); + return CGAL::IO::write_LAS(out, *(point_set_item->point_set())); } diff --git a/Polyhedron/demo/Polyhedron/Plugins/IO/OFF_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/IO/OFF_io_plugin.cpp index 87b92228a80..e7de52da567 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/IO/OFF_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/IO/OFF_io_plugin.cpp @@ -221,7 +221,7 @@ Polyhedron_demo_off_plugin::load_obj(QFileInfo fileinfo) { //if not polygonmesh load in soup std::vector points; std::vector > polygons; - if(CGAL::read_OBJ(in, points, polygons)) + if(CGAL::IO::read_OBJ(in, points, polygons)) { Scene_polygon_soup_item* soup_item = new Scene_polygon_soup_item(); soup_item->load(points, polygons); @@ -272,7 +272,7 @@ save(QFileInfo fileinfo,QList& items) } if(fileinfo.suffix().toLower() == "obj"){ bool res = (sm_item && sm_item->save_obj(out)) - || (soup_item && CGAL::write_OBJ(out, soup_item->points(), soup_item->polygons())); + || (soup_item && CGAL::IO::write_OBJ(out, soup_item->points(), soup_item->polygons())); if(res) { items.pop_front(); diff --git a/Polyhedron/demo/Polyhedron/Plugins/IO/PLY_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/IO/PLY_io_plugin.cpp index d649629168a..fe4120c5919 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/IO/PLY_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/IO/PLY_io_plugin.cpp @@ -102,7 +102,7 @@ load(QFileInfo fileinfo, bool& ok, bool add_to_scene) { // First try mesh std::string comments; Scene_surface_mesh_item* sm_item = new Scene_surface_mesh_item(); - if (CGAL::read_PLY(in, *sm_item->face_graph(), comments)) + if (CGAL::IO::read_PLY(in, *sm_item->face_graph(), comments)) { if(sm_item->face_graph()->property_map("f:patch_id").second) { @@ -129,10 +129,10 @@ load(QFileInfo fileinfo, bool& ok, bool add_to_scene) { // else try polygon soup std::vector points; std::vector > polygons; - std::vector fcolors; - std::vector vcolors; + std::vector fcolors; + std::vector vcolors; - if (!(CGAL::read_PLY (in, points, polygons, fcolors, vcolors))) + if (!(CGAL::IO::read_PLY (in, points, polygons, fcolors, vcolors))) { QApplication::restoreOverrideCursor(); ok = false; @@ -205,7 +205,7 @@ save(QFileInfo fileinfo,QList& items) std::ofstream out(fileinfo.filePath().toUtf8().data(), std::ios::binary); if (choice == tr("Binary")) - CGAL::set_binary_mode(out); + CGAL::IO::set_binary_mode(out); else out.precision (std::numeric_limits::digits10 + 2); @@ -227,7 +227,7 @@ save(QFileInfo fileinfo,QList& items) if (soup_item) { bool res = - CGAL::write_PLY (out, soup_item->points(), soup_item->polygons()); + CGAL::IO::write_PLY (out, soup_item->points(), soup_item->polygons()); if(res) items.pop_front(); return res; @@ -239,7 +239,7 @@ save(QFileInfo fileinfo,QList& items) if (sm_item) { bool res = - CGAL::write_PLY(out, *(sm_item->polyhedron()), sm_item->comments()); + CGAL::IO::write_PLY(out, *(sm_item->polyhedron()), sm_item->comments()); if(res) items.pop_front(); return res; @@ -251,7 +251,7 @@ save(QFileInfo fileinfo,QList& items) if (stm_item) { bool res = - CGAL::write_PLY(out, *(stm_item->textured_face_graph())); + CGAL::IO::write_PLY(out, *(stm_item->textured_face_graph())); if(res) items.pop_front(); return res; diff --git a/Polyhedron/demo/Polyhedron/Plugins/IO/STL_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/IO/STL_io_plugin.cpp index 90626158e40..20fa2f36ca1 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/IO/STL_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/IO/STL_io_plugin.cpp @@ -78,7 +78,7 @@ load(QFileInfo fileinfo, bool& ok, bool add_to_scene){ } std::vector points; std::vector > triangles; - if (!CGAL::read_polygon_soup(fileinfo.filePath().toUtf8().toStdString(), points, triangles)) + if (!CGAL::IO::read_polygon_soup(fileinfo.filePath().toUtf8().toStdString(), points, triangles)) { std::cerr << "Error: invalid STL file" << std::endl; ok = false; @@ -147,16 +147,16 @@ save(QFileInfo fileinfo,QList& items) std::ofstream out(fileinfo.filePath().toUtf8(), std::ios::out | std::ios::binary); if ( choice == tr("Binary") ) - CGAL::set_mode(out, CGAL::IO::BINARY); + CGAL::IO::set_mode(out, CGAL::IO::BINARY); else { - CGAL::set_mode(out, CGAL::IO::ASCII); + CGAL::IO::set_mode(out, CGAL::IO::ASCII); out.precision (std::numeric_limits::digits10 + 2); } if (sm_item) { - CGAL::write_STL(out, *sm_item->face_graph()); + CGAL::IO::write_STL(out, *sm_item->face_graph()); items.pop_front(); return true; } diff --git a/Polyhedron/demo/Polyhedron/Plugins/IO/VTK_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/IO/VTK_io_plugin.cpp index 7dbc3eaa910..12616332198 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/IO/VTK_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/IO/VTK_io_plugin.cpp @@ -241,7 +241,7 @@ public: std::ofstream os(output_filename.data()); os << std::setprecision(16); //write header - CGAL::write_VTP(os, *mesh); + CGAL::IO::write_VTP(os, *mesh); } } else @@ -255,7 +255,7 @@ public: os << std::setprecision(16); const C3t3& c3t3 = c3t3_item->c3t3(); - CGAL::output_to_vtu(os, c3t3); + CGAL::IO::output_to_vtu(os, c3t3); } items.pop_front(); return true; diff --git a/Polyhedron/demo/Polyhedron/Plugins/IO/WKT_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/IO/WKT_io_plugin.cpp index 5c509345eda..9dbd44d2abe 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/IO/WKT_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/IO/WKT_io_plugin.cpp @@ -60,7 +60,7 @@ load(QFileInfo fileinfo, bool& ok, bool add_to_scene) { } std::list > polylines; - CGAL::read_multi_linestring_WKT (in, polylines); + CGAL::IO::read_multi_linestring_WKT (in, polylines); Scene_polylines_item* item = new Scene_polylines_item; item->polylines = polylines; @@ -101,7 +101,7 @@ save(QFileInfo fileinfo,QList& items) qobject_cast(item); if (polylines_item) { - CGAL::write_multi_linestring_WKT (out, polylines_item->polylines); + CGAL::IO::write_multi_linestring_WKT (out, polylines_item->polylines); items.pop_front(); return true; } diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp index 4dfab1afc69..e2e77c8faff 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp @@ -248,7 +248,7 @@ save(QFileInfo fileinfo, QList &items) else if (fileinfo.suffix() == "am") { std::ofstream avizo_file (qPrintable(path)); - CGAL::output_to_avizo(avizo_file, c3t3_item->c3t3()); + CGAL::IO::output_to_avizo(avizo_file, c3t3_item->c3t3()); items.pop_front(); return true; } @@ -302,7 +302,7 @@ operator>>( std::istream& is, Fake_CDT_3_vertex_base& v) { is >> static_cast::Base&>(v); char s; - if( CGAL::is_ascii(is) ) { + if( CGAL::IO::is_ascii(is) ) { is >> s; if( s == 'S' ) { v.steiner = true; @@ -359,13 +359,13 @@ std::istream& operator>>( std::istream& is, Fake_CDT_3_cell_base& c) { char s; for( int li = 0; li < 4; ++li ) { - if( CGAL::is_ascii(is) ) + if( CGAL::IO::is_ascii(is) ) is >> c.constrained_facet[li]; else CGAL::read( is, c.constrained_facet[li] ); } - if( CGAL::is_ascii(is) ) { + if( CGAL::IO::is_ascii(is) ) { is >> s; CGAL_assertion(s == '-'); } @@ -510,7 +510,7 @@ try_load_a_cdt_3(std::istream& is, C3t3& c3t3) return false; } } - if(binary) CGAL::set_binary_mode(is); + if(binary) CGAL::IO::set_binary_mode(is); if(c3t3.triangulation().file_input< Fake_CDT_3, Update_vertex_from_CDT_3, @@ -529,7 +529,7 @@ bool Polyhedron_demo_c3t3_binary_io_plugin:: try_load_other_binary_format(std::istream& is, C3t3& c3t3) { - CGAL::set_ascii_mode(is); + CGAL::IO::set_ascii_mode(is); std::string s; if(!(is >> s)) return false; bool binary = false; @@ -552,8 +552,8 @@ try_load_other_binary_format(std::istream& is, C3t3& c3t3) return false; } } - if(binary) CGAL::set_binary_mode(is); - else CGAL::set_ascii_mode(is); + if(binary) CGAL::IO::set_binary_mode(is); + else CGAL::IO::set_ascii_mode(is); std::istream& f_is = c3t3.triangulation().file_input< Fake_c3t3::Triangulation, Update_vertex, diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/CMakeLists.txt index 4c54343a0f3..5c3e9542e83 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/CMakeLists.txt @@ -35,7 +35,7 @@ if(VTK_FOUND) endif() if("${VTK_VERSION_MAJOR}" GREATER "5" OR VTK_VERSION VERSION_GREATER 5) if(TARGET VTK::IOImage) - set(VTK_LIBRARIES VTK::IOImage) + set(VTK_LIBRARIES VTK::IOImage VTK::ImagingGeneral) endif() if(NOT VTK_LIBRARIES) message( diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Io_image_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Io_image_plugin.cpp index 0d17132c053..428a0b2611e 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Io_image_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Io_image_plugin.cpp @@ -57,7 +57,7 @@ #include #include #ifdef CGAL_USE_VTK -#include +#include #include #include @@ -1312,7 +1312,7 @@ Image* Io_image_plugin::createDCMImage(QString dirname) auto vtk_image = smoother->GetOutput(); vtk_image->Print(std::cerr); image = new Image; - *image = CGAL::read_vtk_image_data(vtk_image); // copy the image data + *image = CGAL::IO::read_vtk_image_data(vtk_image); // copy the image data #else CGAL::Three::Three::warning("You need VTK to read a DCM file"); CGAL_USE(dirname); diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin_cgal_code.h b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin_cgal_code.h index 22c5ab667f7..2e72edebc9c 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin_cgal_code.h +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Mesh_3_plugin_cgal_code.h @@ -7,7 +7,7 @@ #include "Kernel_type.h" #include "Meshing_thread.h" #include "Scene_surface_mesh_item.h" -#include +#include #include class Scene_surface_mesh_item; diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Orient_soup_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Orient_soup_plugin.cpp index b98ab4052a4..467331c4fd2 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Orient_soup_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Orient_soup_plugin.cpp @@ -113,28 +113,28 @@ QList Polyhedron_demo_orient_soup_plugin::actions() const { << actionClean; } -void set_vcolors(SMesh* smesh, std::vector colors) +void set_vcolors(SMesh* smesh, std::vector colors) { typedef SMesh SMesh; typedef boost::graph_traits::vertex_descriptor vertex_descriptor; - SMesh::Property_map vcolors = - smesh->property_map("v:color").first; + SMesh::Property_map vcolors = + smesh->property_map("v:color").first; bool created; - boost::tie(vcolors, created) = smesh->add_property_map("v:color",CGAL::Color(0,0,0)); + boost::tie(vcolors, created) = smesh->add_property_map("v:color",CGAL::IO::Color(0,0,0)); assert(colors.size()==smesh->number_of_vertices()); int color_id = 0; for(vertex_descriptor vd : vertices(*smesh)) vcolors[vd] = colors[color_id++]; } -void set_fcolors(SMesh* smesh, std::vector colors) +void set_fcolors(SMesh* smesh, std::vector colors) { typedef SMesh SMesh; typedef boost::graph_traits::face_descriptor face_descriptor; - SMesh::Property_map fcolors = - smesh->property_map("f:color").first; + SMesh::Property_map fcolors = + smesh->property_map("f:color").first; bool created; - boost::tie(fcolors, created) = smesh->add_property_map("f:color",CGAL::Color(0,0,0)); + boost::tie(fcolors, created) = smesh->add_property_map("f:color",CGAL::IO::Color(0,0,0)); assert(colors.size()==smesh->number_of_faces()); int color_id = 0; for(face_descriptor fd : faces(*smesh)) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Offset_meshing_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Offset_meshing_plugin.cpp index 9eec54007ec..6521a316786 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Offset_meshing_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Offset_meshing_plugin.cpp @@ -35,7 +35,7 @@ #include #include -#include +#include #include // std::shared_ptr @@ -76,8 +76,8 @@ public: } private: - boost::shared_ptr m_tree_ptr; - boost::shared_ptr m_side_of_ptr; + std::shared_ptr m_tree_ptr; + std::shared_ptr m_side_of_ptr; double m_offset_distance; bool m_is_closed; diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Surface_mesh_approximation_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Surface_mesh_approximation_plugin.cpp index 81b324d305b..c7e14039344 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Surface_mesh_approximation_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Surface_mesh_approximation_plugin.cpp @@ -254,10 +254,10 @@ public: cvx_hull_points.push_back(origin + p.x() * base1 + p.y() * base2); } } - std::vector fcolors; + std::vector fcolors; for(const QColor& c : approx.proxy_colors()) - fcolors.push_back(CGAL::Color(c.red(), c.green(), c.blue())); - approx.visual_items().planes->load(cvx_hull_points, cvx_hulls, fcolors, std::vector()); + fcolors.push_back(CGAL::IO::Color(c.red(), c.green(), c.blue())); + approx.visual_items().planes->load(cvx_hull_points, cvx_hulls, fcolors, std::vector()); } public Q_SLOTS: diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Scene_edit_polyhedron_item.cpp b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Scene_edit_polyhedron_item.cpp index 3709992f052..f316258cb5d 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Scene_edit_polyhedron_item.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Scene_edit_polyhedron_item.cpp @@ -357,7 +357,7 @@ void Scene_edit_polyhedron_item_priv::compute_normals_and_vertices(Mesh* mesh) if(spheres) { - CGAL::Color c(0,255,0); + CGAL::IO::Color c(0,255,0); EPICK::Point_3 point(p.x()+offset.x, p.y()+offset.y, p.z()+offset.z); spheres->add_sphere(EPICK::Sphere_3(point, length_of_axis/15.0*length_of_axis/15.0), 0, c); } @@ -391,7 +391,7 @@ void Scene_edit_polyhedron_item_priv::compute_normals_and_vertices(Mesh* mesh) if(spheres_ctrl) { - CGAL::Color c(255*r,0,255*b); + CGAL::IO::Color c(255*r,0,255*b); EPICK::Point_3 center(p.x()+offset.x, p.y()+offset.y, diff --git a/Polyhedron/demo/Polyhedron/Scene_c3t3_item.cpp b/Polyhedron/demo/Polyhedron/Scene_c3t3_item.cpp index a9a3626d544..3b604818e77 100644 --- a/Polyhedron/demo/Polyhedron/Scene_c3t3_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_c3t3_item.cpp @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include "Scene_polygon_soup_item.h" @@ -186,7 +186,7 @@ public : } void addTriangle(const Tr::Bare_point& pa, const Tr::Bare_point& pb, - const Tr::Bare_point& pc, const CGAL::Color color) + const Tr::Bare_point& pc, const CGAL::IO::Color color) { const CGAL::qglviewer::Vec offset = Three::mainViewer()->offset(); Geom_traits::Vector_3 n = cross_product(pb - pa, pc - pa); @@ -1323,7 +1323,7 @@ void Scene_c3t3_item_priv::computeIntersection(const Primitive& cell) const Tr::Bare_point& pc = wp2p(ch->vertex(2)->point()); const Tr::Bare_point& pd = wp2p(ch->vertex(3)->point()); - CGAL::Color color(UC(c.red()), UC(c.green()), UC(c.blue())); + CGAL::IO::Color color(UC(c.red()), UC(c.green()), UC(c.blue())); intersection->addTriangle(pb, pa, pc, color); intersection->addTriangle(pa, pb, pd, color); @@ -1415,7 +1415,7 @@ void Scene_c3t3_item_priv::computeSpheres() typedef unsigned char UC; tr_vertices.push_back(*vit); spheres->add_sphere(Geom_traits::Sphere_3(center, radius),s_id++, - CGAL::Color(UC(c.red()), UC(c.green()), UC(c.blue()))); + CGAL::IO::Color(UC(c.red()), UC(c.green()), UC(c.blue()))); } spheres->invalidateOpenGLBuffers(); @@ -1530,7 +1530,7 @@ void Scene_c3t3_item_priv::computeElements() bool Scene_c3t3_item::load_binary(std::istream& is) { - if(!CGAL::Mesh_3::load_binary_file(is, c3t3())) return false; + if(!CGAL::IO::load_binary_file(is, c3t3())) return false; if(is && d->frame == 0) { d->frame = new CGAL::qglviewer::ManipulatedFrame(); } diff --git a/Polyhedron/demo/Polyhedron/Scene_c3t3_item.h b/Polyhedron/demo/Polyhedron/Scene_c3t3_item.h index 7d5e343ded0..c34951335b6 100644 --- a/Polyhedron/demo/Polyhedron/Scene_c3t3_item.h +++ b/Polyhedron/demo/Polyhedron/Scene_c3t3_item.h @@ -47,12 +47,12 @@ public: void setColor(QColor c) Q_DECL_OVERRIDE; bool save_binary(std::ostream& os) const { - return CGAL::Mesh_3::save_binary_file(os, c3t3()); + return CGAL::IO::save_binary_file(os, c3t3()); } bool save_ascii(std::ostream& os) const { os << "ascii CGAL c3t3 " << CGAL::Get_io_signature()() << "\n"; - CGAL::set_ascii_mode(os); + CGAL::IO::set_ascii_mode(os); return !!(os << c3t3()); } diff --git a/Polyhedron/demo/Polyhedron/Scene_group_item.cpp b/Polyhedron/demo/Polyhedron/Scene_group_item.cpp index 70570753802..29e0685ec51 100644 --- a/Polyhedron/demo/Polyhedron/Scene_group_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_group_item.cpp @@ -90,10 +90,12 @@ void Scene_group_item::update_group_number(Scene_item * new_item, int n) Scene_group_item* group = qobject_cast(new_item); if(group) + { Q_FOREACH(Scene_interface::Item_id id, group->getChildren()){ update_group_number(getChild(id),n+1); } + } new_item->has_group = n; } void Scene_group_item::setColor(QColor c) diff --git a/Polyhedron/demo/Polyhedron/Scene_points_with_normal_item.cpp b/Polyhedron/demo/Polyhedron/Scene_points_with_normal_item.cpp index deaf33e1cc7..63707001765 100644 --- a/Polyhedron/demo/Polyhedron/Scene_points_with_normal_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_points_with_normal_item.cpp @@ -554,7 +554,7 @@ bool Scene_points_with_normal_item::read_ply_point_set(std::istream& stream) d->m_points->clear(); - bool ok = CGAL::read_PLY(stream, *(d->m_points), d->m_comments) && !isEmpty(); + bool ok = CGAL::IO::read_PLY(stream, *(d->m_points), d->m_comments) && !isEmpty(); d->point_Slider->setValue(CGAL::Three::Three::getDefaultPointSize()); std::cerr << d->m_points->info(); @@ -586,9 +586,9 @@ bool Scene_points_with_normal_item::write_ply_point_set(std::ostream& stream, bo return false; if (binary) - CGAL::set_binary_mode (stream); + CGAL::IO::set_binary_mode (stream); - return CGAL::write_PLY(stream, *(d->m_points), d->m_comments); + return CGAL::IO::write_PLY(stream, *(d->m_points), d->m_comments); } // Loads point set from .OFF file @@ -597,7 +597,7 @@ bool Scene_points_with_normal_item::read_off_point_set(std::istream& stream) Q_ASSERT(d->m_points != nullptr); d->m_points->clear(); - bool ok = CGAL::read_OFF(stream, *(d->m_points)) && !isEmpty(); + bool ok = CGAL::IO::read_OFF(stream, *(d->m_points)) && !isEmpty(); d->point_Slider->setValue(CGAL::Three::Three::getDefaultPointSize()); invalidateOpenGLBuffers(); @@ -611,7 +611,7 @@ bool Scene_points_with_normal_item::write_off_point_set(std::ostream& stream) co d->m_points->reset_indices(); - return CGAL::write_OFF(stream, *(d->m_points)); + return CGAL::IO::write_OFF(stream, *(d->m_points)); } // Loads point set from .XYZ file @@ -621,7 +621,7 @@ bool Scene_points_with_normal_item::read_xyz_point_set(std::istream& stream) d->m_points->clear(); - bool ok = CGAL::read_XYZ (stream, *(d->m_points)) && !isEmpty(); + bool ok = CGAL::IO::read_XYZ (stream, *(d->m_points)) && !isEmpty(); d->point_Slider->setValue(CGAL::Three::Three::getDefaultPointSize()); invalidateOpenGLBuffers(); @@ -635,7 +635,7 @@ bool Scene_points_with_normal_item::write_xyz_point_set(std::ostream& stream) co d->m_points->reset_indices(); - return CGAL::write_XYZ(stream, *(d->m_points)); + return CGAL::IO::write_XYZ(stream, *(d->m_points)); } QString diff --git a/Polyhedron/demo/Polyhedron/Scene_polygon_soup_item.cpp b/Polyhedron/demo/Polyhedron/Scene_polygon_soup_item.cpp index 40935ddfffb..6e106c555eb 100644 --- a/Polyhedron/demo/Polyhedron/Scene_polygon_soup_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_polygon_soup_item.cpp @@ -186,7 +186,7 @@ Scene_polygon_soup_item_priv::triangulate_polygon(Polygons_iterator pit, int pol positions_poly.push_back(ffit->vertex(2)->point().y()); positions_poly.push_back(ffit->vertex(2)->point().z()); - CGAL::Color color; + CGAL::IO::Color color; if(!soup->fcolors.empty()) color = soup->fcolors[polygon_id]; for(int i=0; i<3; i++) @@ -202,7 +202,7 @@ Scene_polygon_soup_item_priv::triangulate_polygon(Polygons_iterator pit, int pol } if(!soup->vcolors.empty()) { - CGAL::Color vcolor = soup->vcolors[triangulation.v2v[ffit->vertex(i)]]; + CGAL::IO::Color vcolor = soup->vcolors[triangulation.v2v[ffit->vertex(i)]]; v_colors.push_back((float)vcolor.red()/255); v_colors.push_back((float)vcolor.green()/255); v_colors.push_back((float)vcolor.blue()/255); @@ -262,7 +262,7 @@ Scene_polygon_soup_item_priv::compute_normals_and_vertices() const{ positions_poly.push_back(p.z()+offset.z); if(!soup->fcolors.empty()) { - const CGAL::Color color = soup->fcolors[nb]; + const CGAL::IO::Color color = soup->fcolors[nb]; f_colors.push_back((float)color.red()/255); f_colors.push_back((float)color.green()/255); f_colors.push_back((float)color.blue()/255); @@ -270,7 +270,7 @@ Scene_polygon_soup_item_priv::compute_normals_and_vertices() const{ if(!soup->vcolors.empty()) { - const CGAL::Color color = soup->vcolors[it->at(i)]; + const CGAL::IO::Color color = soup->vcolors[it->at(i)]; v_colors.push_back((float)color.red()/255); v_colors.push_back((float)color.green()/255); v_colors.push_back((float)color.blue()/255); @@ -350,9 +350,9 @@ Scene_polygon_soup_item::load(std::istream& in) else d->soup->clear(); - bool result = CGAL::read_OFF(in, d->soup->points, d->soup->polygons, - CGAL::parameters::vertex_color_output_iterator(std::back_inserter(d->soup->vcolors)) - .face_color_output_iterator(std::back_inserter(d->soup->fcolors))); + bool result = CGAL::IO::read_OFF(in, d->soup->points, d->soup->polygons, + CGAL::parameters::vertex_color_output_iterator(std::back_inserter(d->soup->vcolors)) + .face_color_output_iterator(std::back_inserter(d->soup->fcolors))); invalidateOpenGLBuffers(); return result; @@ -689,8 +689,8 @@ void Scene_polygon_soup_item::load(const std::vector& points, const std:: template void Scene_polygon_soup_item::load(const std::vector& points, const std::vector& polygons, - const std::vector& fcolors, - const std::vector& vcolors) + const std::vector& fcolors, + const std::vector& vcolors) { load (points, polygons); @@ -708,8 +708,8 @@ template SCENE_POLYGON_SOUP_ITEM_EXPORT void Scene_polygon_soup_item::load& points, const std::vector >& polygons); template SCENE_POLYGON_SOUP_ITEM_EXPORT void Scene_polygon_soup_item::load > (const std::vector& points, const std::vector >& polygons, - const std::vector& fcolors, - const std::vector& vcolors); + const std::vector& fcolors, + const std::vector& vcolors); // Local Variables: // c-basic-offset: 4 @@ -718,8 +718,8 @@ template SCENE_POLYGON_SOUP_ITEM_EXPORT void Scene_polygon_soup_item::loadsoup->points; } const Scene_polygon_soup_item::Polygons& Scene_polygon_soup_item::polygons() const { return d->soup->polygons; } bool Scene_polygon_soup_item::isDataColored() { return d->soup->fcolors.size()>0 || d->soup->vcolors.size()>0;} -std::vector Scene_polygon_soup_item::getVColors() const{return d->soup->vcolors;} -std::vector Scene_polygon_soup_item::getFColors() const{return d->soup->fcolors;} +std::vector Scene_polygon_soup_item::getVColors() const{return d->soup->vcolors;} +std::vector Scene_polygon_soup_item::getFColors() const{return d->soup->fcolors;} void Scene_polygon_soup_item::itemAboutToBeDestroyed(Scene_item *item) { diff --git a/Polyhedron/demo/Polyhedron/Scene_polygon_soup_item.h b/Polyhedron/demo/Polyhedron/Scene_polygon_soup_item.h index b7a849ca566..e20306ca916 100644 --- a/Polyhedron/demo/Polyhedron/Scene_polygon_soup_item.h +++ b/Polyhedron/demo/Polyhedron/Scene_polygon_soup_item.h @@ -20,7 +20,7 @@ struct Polygon_soup typedef std::map, std::set > Edges_map; typedef boost::array Edge; typedef std::vector Polygons; - typedef std::vector Colors; + typedef std::vector Colors; typedef std::set Edges; typedef Polygons::size_type size_type; @@ -120,16 +120,16 @@ public: template void load(const std::vector& points, const std::vector& polygons, - const std::vector& fcolors, - const std::vector& vcolors); + const std::vector& fcolors, + const std::vector& vcolors); bool load(std::istream& in); void load(Scene_surface_mesh_item*); bool isDataColored(); bool save(std::ostream& out) const; - std::vector getVColors() const; - std::vector getFColors() const; + std::vector getVColors() const; + std::vector getFColors() const; QString toolTip() const Q_DECL_OVERRIDE; // Indicate if rendering mode is supported diff --git a/Polyhedron/demo/Polyhedron/Scene_polylines_item.cpp b/Polyhedron/demo/Polyhedron/Scene_polylines_item.cpp index 328539eb94c..7dfc1825da6 100644 --- a/Polyhedron/demo/Polyhedron/Scene_polylines_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_polylines_item.cpp @@ -253,7 +253,7 @@ Scene_polylines_item_private::computeSpheres() colors[2] = 200; } - CGAL::Color c(colors[0], colors[1], colors[2]); + CGAL::IO::Color c(colors[0], colors[1], colors[2]); spheres->add_sphere(K::Sphere_3(center+offset, spheres_drawn_square_radius),s_id++, c); } spheres->setToolTip( diff --git a/Polyhedron/demo/Polyhedron/Scene_spheres_item.cpp b/Polyhedron/demo/Polyhedron/Scene_spheres_item.cpp index 21df39ff5b0..836b4641636 100644 --- a/Polyhedron/demo/Polyhedron/Scene_spheres_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_spheres_item.cpp @@ -22,7 +22,7 @@ struct Scene_spheres_item_priv { typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; typedef CGAL::Sphere_3 Sphere; - typedef std::pair Sphere_pair; + typedef std::pair Sphere_pair; typedef std::vector > Spheres_container; Scene_spheres_item_priv(bool planed, std::size_t max_index, Scene_spheres_item* parent, bool pickable) @@ -247,7 +247,7 @@ void Scene_spheres_item::drawEdges(Viewer_interface *viewer) const getEdgeContainer(0)->draw(viewer, false); } -void Scene_spheres_item::add_sphere(const Sphere &sphere, std::size_t index, CGAL::Color color) +void Scene_spheres_item::add_sphere(const Sphere &sphere, std::size_t index, CGAL::IO::Color color) { if((int)index > (int)d->spheres.size() - 1) d->spheres.resize(index+1); diff --git a/Polyhedron/demo/Polyhedron/Scene_spheres_item.h b/Polyhedron/demo/Polyhedron/Scene_spheres_item.h index 7520a4fca3e..aa040096054 100644 --- a/Polyhedron/demo/Polyhedron/Scene_spheres_item.h +++ b/Polyhedron/demo/Polyhedron/Scene_spheres_item.h @@ -30,7 +30,7 @@ class SCENE_BASIC_OBJECTS_EXPORT Scene_spheres_item public: typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; typedef CGAL::Sphere_3 Sphere; - typedef std::pair Sphere_pair; + typedef std::pair Sphere_pair; typedef std::vector > Spheres_container; Scene_spheres_item(Scene_group_item* parent, std::size_t max_index = 0, bool planed = false, bool pickable = true); @@ -45,7 +45,7 @@ public: return (m == Gouraud || m == Wireframe); } void compute_bbox() const Q_DECL_OVERRIDE; - void add_sphere(const Sphere &sphere, std::size_t index = 0, CGAL::Color = CGAL::Color(120,120,120)); + void add_sphere(const Sphere &sphere, std::size_t index = 0, CGAL::IO::Color = CGAL::IO::Color(120,120,120)); void clear_spheres(); void setPrecision(int prec); void gl_initialization(CGAL::Three::Viewer_interface* viewer); diff --git a/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp b/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp index b275fc3db75..d24357f2f1c 100644 --- a/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp @@ -211,7 +211,7 @@ struct Scene_surface_mesh_item_priv{ void initialize_colors() const; void invalidate_stats(); void initializeBuffers(CGAL::Three::Viewer_interface *) const; - void addFlatData(Point, EPICK::Vector_3, CGAL::Color *, Scene_item_rendering_helper::Gl_data_names name) const; + void addFlatData(Point, EPICK::Vector_3, CGAL::IO::Color *, Scene_item_rendering_helper::Gl_data_names name) const; void* get_aabb_tree(); QList triangulate_primitive(face_descriptor fit, EPICK::Vector_3 normal); @@ -226,13 +226,13 @@ struct Scene_surface_mesh_item_priv{ void triangulate_facet(face_descriptor fd, SMesh::Property_map *fnormals, - SMesh::Property_map *fcolors, + SMesh::Property_map *fcolors, boost::property_map< SMesh, boost::vertex_index_t >::type *im, Scene_item_rendering_helper::Gl_data_names name, bool index) const; void triangulate_convex_facet(face_descriptor fd, SMesh::Property_map *fnormals, - SMesh::Property_map *fcolors, + SMesh::Property_map *fcolors, boost::property_map< SMesh, boost::vertex_index_t >::type *im, Scene_item_rendering_helper::Gl_data_names name, bool index) const; @@ -384,7 +384,7 @@ Scene_surface_mesh_item::color_vector() } -void Scene_surface_mesh_item_priv::addFlatData(Point p, EPICK::Vector_3 n, CGAL::Color *c, Scene_item_rendering_helper::Gl_data_names name) const +void Scene_surface_mesh_item_priv::addFlatData(Point p, EPICK::Vector_3 n, CGAL::IO::Color *c, Scene_item_rendering_helper::Gl_data_names name) const { const CGAL::qglviewer::Vec offset = static_cast(CGAL::QGLViewer::QGLViewerPool().first())->offset(); if(name.testFlag(Scene_item_rendering_helper::GEOMETRY)) @@ -443,11 +443,11 @@ void Scene_surface_mesh_item_priv::compute_elements(Scene_item_rendering_helper: SMesh::Property_map positions = smesh_->points(); - SMesh::Property_map vcolors = - smesh_->property_map("v:color").first; + SMesh::Property_map vcolors = + smesh_->property_map("v:color").first; - SMesh::Property_map fcolors = - smesh_->property_map("f:color").first; + SMesh::Property_map fcolors = + smesh_->property_map("f:color").first; boost::property_map< SMesh, boost::vertex_index_t >::type im = get(boost::vertex_index, *smesh_); @@ -508,8 +508,8 @@ void Scene_surface_mesh_item_priv::compute_elements(Scene_item_rendering_helper: { has_fpatch_id = smesh_->property_map("f:patch_id").second; - has_fcolors = smesh_->property_map("f:color").second; - has_vcolors = smesh_->property_map("v:color").second; + has_fcolors = smesh_->property_map("f:color").second; + has_vcolors = smesh_->property_map("v:color").second; } if(name.testFlag(Scene_item_rendering_helper::GEOMETRY)) { @@ -564,12 +564,12 @@ void Scene_surface_mesh_item_priv::compute_elements(Scene_item_rendering_helper: //The sharp features detection produces patch ids >=1, this //is meant to insure the wanted id is in the range [min,max] QColor c = item->color_vector()[fpatch_id_map[fd] - min_patch_id]; - CGAL::Color color(c.red(),c.green(),c.blue()); + CGAL::IO::Color color(c.red(),c.green(),c.blue()); CPF::add_color_in_buffer(color, f_colors); } else if(has_fcolors) { - CGAL::Color c = fcolors[fd]; + CGAL::IO::Color c = fcolors[fd]; CPF::add_color_in_buffer(c, f_colors); } } @@ -589,11 +589,11 @@ void Scene_surface_mesh_item_priv::compute_elements(Scene_item_rendering_helper: halfedge_descriptor hd = halfedge(fd, *smesh_); Point p = positions[source(hd, *smesh_)]; EPICK::Vector_3 n = fnormals[fd]; - CGAL::Color *c; + CGAL::IO::Color *c; if(has_fpatch_id) { QColor color = item->color_vector()[fpatch_id_map[fd] - min_patch_id]; - c = new CGAL::Color(color.red(),color.green(),color.blue()); + c = new CGAL::IO::Color(color.red(),color.green(),color.blue()); } else if(has_fcolors) c= &fcolors[fd]; @@ -648,7 +648,7 @@ void Scene_surface_mesh_item_priv::compute_elements(Scene_item_rendering_helper: { for(vertex_descriptor vd : vertices(*smesh_)) { - CGAL::Color c = vcolors[vd]; + CGAL::IO::Color c = vcolors[vd]; v_colors.push_back((float)c.red()/255); v_colors.push_back((float)c.green()/255); v_colors.push_back((float)c.blue()/255); @@ -896,7 +896,7 @@ void Scene_surface_mesh_item_priv::checkFloat()const void Scene_surface_mesh_item_priv::triangulate_convex_facet(face_descriptor fd, SMesh::Property_map *fnormals, - SMesh::Property_map *fcolors, + SMesh::Property_map *fcolors, boost::property_map< SMesh, boost::vertex_index_t >::type *im, Scene_item_rendering_helper::Gl_data_names name, bool index) const @@ -916,11 +916,11 @@ void Scene_surface_mesh_item_priv::triangulate_convex_facet(face_descriptor fd, p2 = smesh_->point(v2); if(!index) { - CGAL::Color* color; + CGAL::IO::Color* color; if(has_fpatch_id) { QColor c = item->color_vector()[fpatch_id_map[fd] - min_patch_id]; - color = new CGAL::Color(c.red(),c.green(),c.blue()); + color = new CGAL::IO::Color(c.red(),c.green(),c.blue()); } else if(has_fcolors) color = &(*fcolors)[fd]; @@ -953,7 +953,7 @@ void Scene_surface_mesh_item_priv::triangulate_convex_facet(face_descriptor fd, void Scene_surface_mesh_item_priv::triangulate_facet(face_descriptor fd, SMesh::Property_map *fnormals, - SMesh::Property_map *fcolors, + SMesh::Property_map *fcolors, boost::property_map< SMesh, boost::vertex_index_t >::type *im, Scene_item_rendering_helper::Gl_data_names name, bool index) const @@ -1008,11 +1008,11 @@ Scene_surface_mesh_item_priv::triangulate_facet(face_descriptor fd, //adds the vertices, normals and colors to the appropriate vectors if(!index) { - CGAL::Color* color; + CGAL::IO::Color* color; if(has_fpatch_id) { QColor c= item->color_vector()[fpatch_id_map[fd] - min_patch_id]; - color = new CGAL::Color(c.red(),c.green(),c.blue()); + color = new CGAL::IO::Color(c.red(),c.green(),c.blue()); } else if(has_fcolors) color = &(*fcolors)[fd]; @@ -1470,17 +1470,17 @@ void Scene_surface_mesh_item::setItemIsMulticolor(bool b) d->smesh_->remove_property_map(d->fpatch_id_map); d->has_fcolors = false; } - if(d->smesh_->property_map("f:color").second) + if(d->smesh_->property_map("f:color").second) { - SMesh::Property_map pmap = - d->smesh_->property_map("f:color").first; + SMesh::Property_map pmap = + d->smesh_->property_map("f:color").first; d->smesh_->remove_property_map(pmap); d->has_fcolors = false; } - if(d->smesh_->property_map("v:color").second) + if(d->smesh_->property_map("v:color").second) { - SMesh::Property_map pmap = - d->smesh_->property_map("v:color").first; + SMesh::Property_map pmap = + d->smesh_->property_map("v:color").first; d->smesh_->remove_property_map(pmap); d->has_vcolors = false; } @@ -1524,14 +1524,14 @@ bool Scene_surface_mesh_item::load_obj(std::istream& in) { typedef SMesh::Point Point; - bool failed = !CGAL::read_OBJ(in, *(d->smesh_)); + bool failed = !CGAL::IO::read_OBJ(in, *(d->smesh_)); if(failed) { in.clear(); in.seekg(0); std::vector points; std::vector > faces; - failed = !CGAL::read_OBJ(in, points, faces); + failed = !CGAL::IO::read_OBJ(in, points, faces); if(!failed) { CGAL::Polygon_mesh_processing::repair_polygon_soup(points, faces); @@ -1557,9 +1557,9 @@ Scene_surface_mesh_item::save_obj(std::ostream& out) const boost::tie(vnormals, has_normals) = d->smesh_->template property_map("v:normal"); if(has_normals) - return CGAL::write_OBJ(out, *(d->smesh_), CGAL::parameters::vertex_normal_map(vnormals)); + return CGAL::IO::write_OBJ(out, *(d->smesh_), CGAL::parameters::vertex_normal_map(vnormals)); else - return CGAL::write_OBJ(out, *(d->smesh_)); + return CGAL::IO::write_OBJ(out, *(d->smesh_)); } void diff --git a/Polyhedron/demo/Polyhedron/include/CGAL/IO/read_surf_trianglemesh.h b/Polyhedron/demo/Polyhedron/include/CGAL/IO/read_surf_trianglemesh.h index adbec646b3c..fc2ac29aeb3 100644 --- a/Polyhedron/demo/Polyhedron/include/CGAL/IO/read_surf_trianglemesh.h +++ b/Polyhedron/demo/Polyhedron/include/CGAL/IO/read_surf_trianglemesh.h @@ -138,7 +138,7 @@ void treat_surf_vertices(std::istream& input, double x(0),y(0),z(0); iss.clear(); iss.str(line); - iss >> CGAL::iformat(x) >> CGAL::iformat(y) >> CGAL::iformat(z); + iss >> CGAL::IO::iformat(x) >> CGAL::IO::iformat(y) >> CGAL::IO::iformat(z); points.push_back(Point_3(x,y,z)); } } diff --git a/Polyhedron/demo/Polyhedron/include/run_with_qprogressdialog.h b/Polyhedron/demo/Polyhedron/include/run_with_qprogressdialog.h index 47f5f9670df..f2657fda3f1 100644 --- a/Polyhedron/demo/Polyhedron/include/run_with_qprogressdialog.h +++ b/Polyhedron/demo/Polyhedron/include/run_with_qprogressdialog.h @@ -3,10 +3,11 @@ #include #include -#include #include "Callback_signaler.h" +#include + typedef CGAL::Parallel_if_available_tag Concurrency_tag; class Signal_callback @@ -112,12 +113,14 @@ void run_with_qprogressdialog (Functor& functor, #ifdef CGAL_HAS_STD_THREADS if (boost::is_convertible::value) { - CGAL::cpp11::thread thread (functor); + std::thread thread (functor); while (*signal_callback->latest_adv != 1. && *signal_callback->state) { - CGAL::cpp11::sleep_for (0.1); + typedef std::chrono::nanoseconds nanoseconds; + nanoseconds ns (nanoseconds::rep (1000000000.0 * 0.1)); + std::this_thread::sleep_for(ns); QApplication::processEvents (); } diff --git a/Polyhedron/doc/Polyhedron/CGAL/IO/Polyhedron_iostream.h b/Polyhedron/doc/Polyhedron/CGAL/IO/Polyhedron_iostream.h index 275f633766e..4af85fdec22 100644 --- a/Polyhedron/doc/Polyhedron/CGAL/IO/Polyhedron_iostream.h +++ b/Polyhedron/doc/Polyhedron/CGAL/IO/Polyhedron_iostream.h @@ -36,8 +36,8 @@ bool read_OFF( std::istream& in, Polyhedron_3& P); /*! \relates Polyhedron_3 -\deprecated This function is deprecated since \cgal 5.2, - \link PkgPolyhedronIOFunc `CGAL::read_OFF(std::ostream&, Polyhedron_3&)` \endlink should be used instead. +\deprecated This function is deprecated since \cgal 5.3, + \link PkgPolyhedronIOFunc `CGAL::IO::read_OFF(std::ostream&, Polyhedron_3&)` \endlink should be used instead. */ template bool read_off( std::ostream& out, Polyhedron_3& P); @@ -79,8 +79,8 @@ bool write_OFF( std::ostream& out, Polyhedron_3& P); /*! \relates Polyhedron_3 -\deprecated This function is deprecated since \cgal 5.2, - \link PkgPolyhedronIOFunc `CGAL::write_OFF(std::ostream&, Polyhedron_3&)` \endlink should be used instead. +\deprecated This function is deprecated since \cgal 5.3, + \link PkgPolyhedronIOFunc `CGAL::IO::write_OFF(std::ostream&, Polyhedron_3&)` \endlink should be used instead. */ template bool write_off( std::ostream& out, Polyhedron_3& P); diff --git a/Polyhedron/doc/Polyhedron/Polyhedron.txt b/Polyhedron/doc/Polyhedron/Polyhedron.txt index ff1b4df6ec8..91fc936f60b 100644 --- a/Polyhedron/doc/Polyhedron/Polyhedron.txt +++ b/Polyhedron/doc/Polyhedron/Polyhedron.txt @@ -430,7 +430,7 @@ faces but would be for vertices - and add the color attribute. template struct My_face : public CGAL::HalfedgeDS_face_base { -CGAL::Color color; +CGAL::IO::Color color; }; \endcode diff --git a/Polyhedron/examples/Polyhedron/polyhedron_copy.cpp b/Polyhedron/examples/Polyhedron/polyhedron_copy.cpp index eedf5d0c3e4..a110a0da229 100644 --- a/Polyhedron/examples/Polyhedron/polyhedron_copy.cpp +++ b/Polyhedron/examples/Polyhedron/polyhedron_copy.cpp @@ -97,14 +97,14 @@ int main( int argc, char **argv) { } if ( binary) { - vout << "CGAL::set_binary_mode( ofstream(" << name << "))" << endl; - CGAL::set_binary_mode( *p_out); + vout << "CGAL::IO::set_binary_mode( ofstream(" << name << "))" << endl; + CGAL::IO::set_binary_mode( *p_out); } else if ( noc) { - vout << "CGAL::set_ascii_mode( ofstream(" << name << "))" << endl; - CGAL::set_ascii_mode( *p_out); + vout << "CGAL::IO::set_ascii_mode( ofstream(" << name << "))" << endl; + CGAL::IO::set_ascii_mode( *p_out); } else { - vout << "CGAL::set_pretty_mode( ofstream(" << name << "))" << endl; - CGAL::set_pretty_mode( *p_out); + vout << "CGAL::IO::set_pretty_mode( ofstream(" << name << "))" << endl; + CGAL::IO::set_pretty_mode( *p_out); } vout << "ofstream(" << name << ") << CGAL::Polyhedron_3 ..." << endl; diff --git a/Polyhedron/examples/Polyhedron/polyhedron_prog_color.cpp b/Polyhedron/examples/Polyhedron/polyhedron_prog_color.cpp index 13a5569c3d0..68fe759f33a 100644 --- a/Polyhedron/examples/Polyhedron/polyhedron_prog_color.cpp +++ b/Polyhedron/examples/Polyhedron/polyhedron_prog_color.cpp @@ -5,7 +5,7 @@ // A face type with a color member variable. template struct My_face : public CGAL::HalfedgeDS_face_base { - CGAL::Color color; + CGAL::IO::Color color; }; // An items type using my face. @@ -23,6 +23,6 @@ typedef Polyhedron::Halfedge_handle Halfedge_handle; int main() { Polyhedron P; Halfedge_handle h = P.make_tetrahedron(); - h->facet()->color = CGAL::red(); + h->facet()->color = CGAL::IO::red(); return 0; } diff --git a/Polyhedron/examples/Polyhedron/polyhedron_prog_normals.cpp b/Polyhedron/examples/Polyhedron/polyhedron_prog_normals.cpp index 15f044a9e97..2cfebd9696d 100644 --- a/Polyhedron/examples/Polyhedron/polyhedron_prog_normals.cpp +++ b/Polyhedron/examples/Polyhedron/polyhedron_prog_normals.cpp @@ -31,7 +31,7 @@ int main() { P.make_tetrahedron( p, q, r, s); std::transform( P.facets_begin(), P.facets_end(), P.planes_begin(), Normal_vector()); - CGAL::set_pretty_mode( std::cout); + CGAL::IO::set_pretty_mode( std::cout); std::copy( P.planes_begin(), P.planes_end(), std::ostream_iterator( std::cout, "\n")); return 0; diff --git a/Polyhedron/examples/Polyhedron/polyhedron_prog_off.cpp b/Polyhedron/examples/Polyhedron/polyhedron_prog_off.cpp index cecca0428e8..d1fdd179c41 100644 --- a/Polyhedron/examples/Polyhedron/polyhedron_prog_off.cpp +++ b/Polyhedron/examples/Polyhedron/polyhedron_prog_off.cpp @@ -18,7 +18,7 @@ int main() { P.make_tetrahedron( p, q, r, s); // Write polyhedron in Object File Format (OFF). - CGAL::set_ascii_mode( std::cout); + CGAL::IO::set_ascii_mode( std::cout); std::cout << "OFF" << std::endl << P.size_of_vertices() << ' ' << P.size_of_facets() << " 0" << std::endl; std::copy( P.points_begin(), P.points_end(), diff --git a/Polyhedron/examples/Polyhedron/polyhedron_prog_planes.cpp b/Polyhedron/examples/Polyhedron/polyhedron_prog_planes.cpp index 08c009acc85..02cc825cda3 100644 --- a/Polyhedron/examples/Polyhedron/polyhedron_prog_planes.cpp +++ b/Polyhedron/examples/Polyhedron/polyhedron_prog_planes.cpp @@ -28,7 +28,7 @@ int main() { P.make_tetrahedron( p, q, r, s); std::transform( P.facets_begin(), P.facets_end(), P.planes_begin(), Plane_equation()); - CGAL::set_pretty_mode( std::cout); + CGAL::IO::set_pretty_mode( std::cout); std::copy( P.planes_begin(), P.planes_end(), std::ostream_iterator( std::cout, "\n")); return 0; diff --git a/Polyhedron/examples/Polyhedron/polyhedron_prog_tetra.cpp b/Polyhedron/examples/Polyhedron/polyhedron_prog_tetra.cpp index d610ded2099..15a72a60b03 100644 --- a/Polyhedron/examples/Polyhedron/polyhedron_prog_tetra.cpp +++ b/Polyhedron/examples/Polyhedron/polyhedron_prog_tetra.cpp @@ -15,7 +15,7 @@ int main() { Polyhedron P; P.make_tetrahedron( p, q, r, s); - CGAL::set_ascii_mode( std::cout); + CGAL::IO::set_ascii_mode( std::cout); for ( Vertex_iterator v = P.vertices_begin(); v != P.vertices_end(); ++v) std::cout << v->point() << std::endl; return 0; diff --git a/Polyhedron/examples/Polyhedron/polyhedron_prog_vector.cpp b/Polyhedron/examples/Polyhedron/polyhedron_prog_vector.cpp index c36b1aecaf0..9c4190a8e1e 100644 --- a/Polyhedron/examples/Polyhedron/polyhedron_prog_vector.cpp +++ b/Polyhedron/examples/Polyhedron/polyhedron_prog_vector.cpp @@ -17,7 +17,7 @@ int main() { Polyhedron P; // alternative constructor: Polyhedron P(4,12,4); P.make_tetrahedron( p, q, r, s); - CGAL::set_ascii_mode( std::cout); + CGAL::IO::set_ascii_mode( std::cout); std::copy( P.points_begin(), P.points_end(), std::ostream_iterator( std::cout, "\n")); return 0; diff --git a/Polyhedron/examples/Polyhedron/polyhedron_prog_vertex_color.cpp b/Polyhedron/examples/Polyhedron/polyhedron_prog_vertex_color.cpp index 63abfbc9b2a..639c1540f4f 100644 --- a/Polyhedron/examples/Polyhedron/polyhedron_prog_vertex_color.cpp +++ b/Polyhedron/examples/Polyhedron/polyhedron_prog_vertex_color.cpp @@ -7,7 +7,7 @@ template struct My_vertex : public CGAL::HalfedgeDS_vertex_base { - CGAL::Color color; + CGAL::IO::Color color; My_vertex() {} // repeat the required constructors My_vertex( const Point& p) : CGAL::HalfedgeDS_vertex_base(p) {} @@ -29,6 +29,6 @@ typedef Polyhedron::Halfedge_handle Halfedge_handle; int main() { Polyhedron P; Halfedge_handle h = P.make_tetrahedron(); - h->vertex()->color = CGAL::red(); + h->vertex()->color = CGAL::IO::red(); return 0; } diff --git a/Polyhedron/examples/Polyhedron/polyhedron_prog_vertex_normal.cpp b/Polyhedron/examples/Polyhedron/polyhedron_prog_vertex_normal.cpp index f39c08ed009..58d41655c40 100644 --- a/Polyhedron/examples/Polyhedron/polyhedron_prog_vertex_normal.cpp +++ b/Polyhedron/examples/Polyhedron/polyhedron_prog_vertex_normal.cpp @@ -101,7 +101,7 @@ int main() { P.make_tetrahedron( p, q, r, s); std::for_each( P.facets_begin(), P.facets_end(), Facet_normal()); std::for_each( P.vertices_begin(), P.vertices_end(), Vertex_normal()); - CGAL::set_pretty_mode( std::cout); + CGAL::IO::set_pretty_mode( std::cout); for ( Vertex_iterator i = P.vertices_begin(); i != P.vertices_end(); ++i) std::cout << i->normal() << std::endl; return 0; diff --git a/Polyhedron/include/CGAL/IO/Polyhedron_OFF_iostream.h b/Polyhedron/include/CGAL/IO/Polyhedron_OFF_iostream.h index 54b9438a8ee..bb413897c51 100644 --- a/Polyhedron/include/CGAL/IO/Polyhedron_OFF_iostream.h +++ b/Polyhedron/include/CGAL/IO/Polyhedron_OFF_iostream.h @@ -31,6 +31,8 @@ namespace CGAL { +namespace IO { + //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// // Read @@ -56,7 +58,7 @@ bool read_OFF(std::istream& in, typedef typename boost::property_traits::value_type Point; typedef typename Kernel_traits::Kernel Kernel; - typedef typename internal::Converter_selector::type Converter; + typedef typename CGAL::internal::Converter_selector::type Converter; using parameters::choose_parameter; using parameters::get_parameter; @@ -97,13 +99,37 @@ bool read_OFF(std::istream& in, Polyhedron_3& P) return read_OFF(in, P, parameters::all_default()); } +template class HDS, + class Alloc, class CGAL_BGL_NP_TEMPLATE_PARAMETERS> +bool read_OFF(const std::string& fname, + Polyhedron_3& P, + const CGAL_BGL_NP_CLASS& np) +{ + std::ifstream in(fname); + return read_OFF(in, P, np); +} + +template class HDS, + class Alloc> +bool read_OFF(const std::string& fname, Polyhedron_3& P) +{ + std::ifstream in(fname); + return read_OFF(in, P, parameters::all_default()); +} + +} // namespace IO + template class HDS, class Alloc> std::istream& operator>>(std::istream& in, Polyhedron_3& P) { - read_OFF(in, P); + IO::read_OFF(in, P); return in; } @@ -111,6 +137,8 @@ std::istream& operator>>(std::istream& in, Polyhedron_3 class HDS, @@ -149,13 +177,15 @@ bool write_OFF(std::ostream& out, const Polyhedron_3& return write_OFF(out, P, parameters::all_default()); } +} // namespace IO + template class HDS, class Alloc> std::ostream& operator<<(std::ostream& out, const Polyhedron_3& P) { - write_OFF(out, P); + IO::write_OFF(out, P); return out; } diff --git a/Polyhedron/include/CGAL/IO/Polyhedron_scan_OFF.h b/Polyhedron/include/CGAL/IO/Polyhedron_scan_OFF.h index 51935383f32..0023d882f63 100644 --- a/Polyhedron/include/CGAL/IO/Polyhedron_scan_OFF.h +++ b/Polyhedron/include/CGAL/IO/Polyhedron_scan_OFF.h @@ -88,7 +88,7 @@ void Polyhedron_scan_OFF:: operator()(HDS& target) B.add_vertex( p); if(scanner.has_vcolors()) { - Color c; + IO::Color c; file_scan_color(scanner, c); } scanner.skip_to_next_vertex(i); diff --git a/Polyhedron/include/CGAL/IO/print_OFF.h b/Polyhedron/include/CGAL/IO/print_OFF.h index 9e3e9a6e291..845539e0f8d 100644 --- a/Polyhedron/include/CGAL/IO/print_OFF.h +++ b/Polyhedron/include/CGAL/IO/print_OFF.h @@ -55,8 +55,8 @@ bool print_polyhedron_OFF(std::ostream& out, bool verbose = false) { File_header_OFF header(verbose); - header.set_binary(is_binary(out)); - header.set_no_comments(!is_pretty(out)); + header.set_binary(IO::is_binary(out)); + header.set_no_comments(!IO::is_pretty(out)); return print_polyhedron_with_header_OFF(out, P, header); } diff --git a/Polyhedron/include/CGAL/Polyhedron_incremental_builder_3.h b/Polyhedron/include/CGAL/Polyhedron_incremental_builder_3.h index f5686239a51..282e8766bdc 100644 --- a/Polyhedron/include/CGAL/Polyhedron_incremental_builder_3.h +++ b/Polyhedron/include/CGAL/Polyhedron_incremental_builder_3.h @@ -191,7 +191,7 @@ public: CGAL_assertion_code(check_protocoll = 0;) } - ~Polyhedron_incremental_builder_3() CGAL_NOEXCEPT(CGAL_NO_ASSERTIONS_BOOL) + ~Polyhedron_incremental_builder_3() noexcept(!CGAL_ASSERTIONS_ENABLED) { CGAL_destructor_assertion( check_protocoll == 0); } @@ -402,7 +402,7 @@ protected: CGAL_assertion( ! last_vertex); HalfedgeDS_items_decorator decorator; Halfedge_handle e = get_vertex_to_edge_map( w); - if ( e != Halfedge_handle()) { + if ( e != nullptr) { CGAL_assertion( e->vertex() == index_to_vertex_map[w]); // check that the facet has no self intersections if ( current_face != Face_handle() @@ -491,7 +491,7 @@ protected: // Halfedge e points to a vertex w. Walk around w to find a hole // in the facet structure. Report an error if none exist. Return // the halfedge at this hole that points to the vertex w. - CGAL_assertion( e != Halfedge_handle()); + CGAL_assertion( e != nullptr); HalfedgeDS_items_decorator decorator; Halfedge_handle start_edge( e); do { @@ -649,7 +649,7 @@ add_vertex_to_facet( std::size_t v2) { Halfedge_handle hole = lookup_hole( v1); if ( m_error) return; - CGAL_assertion( hole != Halfedge_handle()); + CGAL_assertion( hole != nullptr); h2->opposite()->HBase::set_next( hole->next()); decorator.set_prev( hole->next(), h2->opposite()); hole->HBase::set_next( h1->opposite()); @@ -689,7 +689,7 @@ add_vertex_to_facet( std::size_t v2) { } while ( e->next() != prev && e != h1); if ( e == h1) { // disconnected facet complexes - if ( hole != Halfedge_handle()) { + if ( hole != nullptr) { // The complex can be connected with // the hole at hprime. hprime->HBase::set_next( hole->next()); @@ -763,8 +763,8 @@ test_facet_indices( std::vector< std::size_t> indices) { // check if halfedge is already in the HDS and is not border halfedge Halfedge_handle v = get_vertex_to_edge_map(indices[i]); Vertex_handle w = index_to_vertex_map[indices[i+1]]; - if ( v != Halfedge_handle() - && get_vertex_to_edge_map(indices[i+1]) != Halfedge_handle()) { + if ( v != nullptr + && get_vertex_to_edge_map(indices[i+1]) != nullptr) { // cycle through halfedge-loop and find edge to indices[i+1] Halfedge_handle vstart = v; do { @@ -780,7 +780,7 @@ test_facet_indices( std::vector< std::size_t> indices) { // tested for non-manifold halfedges already, we just need to check // if the vertex indices[i] is not a closed manifold yet. Halfedge_handle v = get_vertex_to_edge_map(indices[i]); - if ( v != Halfedge_handle()) { + if ( v != nullptr) { Halfedge_handle vstart = v; do { v = v->next()->opposite(); diff --git a/Polyhedron/include/CGAL/boost/graph/properties_Polyhedron_3.h b/Polyhedron/include/CGAL/boost/graph/properties_Polyhedron_3.h index a53bde8e724..939093a7db5 100644 --- a/Polyhedron/include/CGAL/boost/graph/properties_Polyhedron_3.h +++ b/Polyhedron/include/CGAL/boost/graph/properties_Polyhedron_3.h @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #define CGAL_HDS_PARAM_ template < class Traits, class Items, class Alloc> class HDS @@ -46,7 +46,7 @@ public: reference operator[](const key_type& k) const { return (*map_)[k]; } private: - boost::shared_ptr map_; + std::shared_ptr map_; }; // Special case for edges. @@ -75,7 +75,7 @@ public: reference operator[](const key_type& k) const { return (*map_)[k]; } private: - boost::shared_ptr map_; + std::shared_ptr map_; }; template diff --git a/Polyhedron/test/Polyhedron/test_polyhedron_io.cpp b/Polyhedron/test/Polyhedron/test_polyhedron_io.cpp index ce9ff3e0ff7..fc6d0032056 100644 --- a/Polyhedron/test/Polyhedron/test_polyhedron_io.cpp +++ b/Polyhedron/test/Polyhedron/test_polyhedron_io.cpp @@ -115,7 +115,7 @@ void test_file_IO_OFF() { Polyhedron P; std::istringstream in( ::empty); - read_OFF(in, P); + IO::read_OFF(in, P); assert(P.empty()); assert(in); } diff --git a/Polyline_simplification_2/demo/Polyline_simplification_2/Polyline_simplification_2.cpp b/Polyline_simplification_2/demo/Polyline_simplification_2/Polyline_simplification_2.cpp index 0bf0684ae3f..965fa4e5bcb 100644 --- a/Polyline_simplification_2/demo/Polyline_simplification_2/Polyline_simplification_2.cpp +++ b/Polyline_simplification_2/demo/Polyline_simplification_2/Polyline_simplification_2.cpp @@ -395,7 +395,7 @@ void MainWindow::loadWKT(QString MultiPoint points; MultiLineString polylines; MultiPolygon polygons; - CGAL::read_WKT(ifs, points,polylines,polygons); + CGAL::IO::read_WKT(ifs, points,polylines,polygons); m_pct.clear(); mGI->modelChanged(); diff --git a/Polyline_simplification_2/examples/Polyline_simplification_2/points_and_vertices.cpp b/Polyline_simplification_2/examples/Polyline_simplification_2/points_and_vertices.cpp index 1ccdb7ab524..95d0aaf1a1a 100644 --- a/Polyline_simplification_2/examples/Polyline_simplification_2/points_and_vertices.cpp +++ b/Polyline_simplification_2/examples/Polyline_simplification_2/points_and_vertices.cpp @@ -62,7 +62,7 @@ int main(int argc, char* argv[]) Polygon_with_holes_2 P; Constraint_id cid; std::size_t largest = 0; - while(CGAL::read_polygon_WKT(ifs, P)){ + while(CGAL::IO::read_polygon_WKT(ifs, P)){ const Polygon_2& poly = P.outer_boundary(); Constraint_id cid2 = ct.insert_constraint(poly); if(poly.size() > largest){ diff --git a/Polyline_simplification_2/examples/Polyline_simplification_2/simplify.cpp b/Polyline_simplification_2/examples/Polyline_simplification_2/simplify.cpp index f815a9b9dd2..ccfd6222431 100644 --- a/Polyline_simplification_2/examples/Polyline_simplification_2/simplify.cpp +++ b/Polyline_simplification_2/examples/Polyline_simplification_2/simplify.cpp @@ -35,7 +35,7 @@ int main(int argc, char* argv[]) std::ifstream ifs( (argc==1)?"data/polygon.wkt":argv[1]); CT ct; Polygon_with_holes_2 P; - while(CGAL::read_polygon_WKT(ifs, P)){ + while(CGAL::IO::read_polygon_WKT(ifs, P)){ const Polygon_2& poly = P.outer_boundary(); ct.insert_constraint(poly); for(Polygon_with_holes_2::Hole_const_iterator it = P.holes_begin(); it != P.holes_end(); ++it){ diff --git a/Polyline_simplification_2/examples/Polyline_simplification_2/simplify_polygon.cpp b/Polyline_simplification_2/examples/Polyline_simplification_2/simplify_polygon.cpp index 989b6b68ba4..a5763c20399 100644 --- a/Polyline_simplification_2/examples/Polyline_simplification_2/simplify_polygon.cpp +++ b/Polyline_simplification_2/examples/Polyline_simplification_2/simplify_polygon.cpp @@ -21,12 +21,12 @@ int main(int argc, char* argv[]) { std::ifstream ifs( (argc==1)?"data/polygon.wkt":argv[1]); Polygon_with_holes_2 polygon; - CGAL::read_polygon_WKT(ifs, polygon); + CGAL::IO::read_polygon_WKT(ifs, polygon); Cost cost; polygon = PS::simplify(polygon, cost, Stop(0.5)); std::cout.precision(12); - CGAL::write_polygon_WKT(std::cout, polygon) << std::endl; + CGAL::IO::write_polygon_WKT(std::cout, polygon) << std::endl; return 0; } diff --git a/Polyline_simplification_2/examples/Polyline_simplification_2/simplify_polyline.cpp b/Polyline_simplification_2/examples/Polyline_simplification_2/simplify_polyline.cpp index f1dfd1da732..6bffee9ad49 100644 --- a/Polyline_simplification_2/examples/Polyline_simplification_2/simplify_polyline.cpp +++ b/Polyline_simplification_2/examples/Polyline_simplification_2/simplify_polyline.cpp @@ -23,7 +23,7 @@ int main(int argc, char* argv[]) #if BOOST_VERSION >= 105600 && (! defined(BOOST_GCC) || BOOST_GCC >= 40500) Polyline_2 polyline; std::ifstream ifs( (argc==1)?"data/polyline.wkt":argv[1]); - CGAL::read_linestring_WKT(ifs, polyline); + CGAL::IO::read_linestring_WKT(ifs, polyline); Cost cost; std::deque result; PS::simplify(polyline.begin(), polyline.end(), cost, Stop(0.5), std::back_inserter(result)); diff --git a/Polynomial/archive/test/Polynomial/Polynomial_traits_d.cpp b/Polynomial/archive/test/Polynomial/Polynomial_traits_d.cpp index 0a866b15a59..832f98579ee 100644 --- a/Polynomial/archive/test/Polynomial/Polynomial_traits_d.cpp +++ b/Polynomial/archive/test/Polynomial/Polynomial_traits_d.cpp @@ -17,8 +17,8 @@ template < typename AK> void test_AK_1(){ - CGAL::set_pretty_mode(std::cout); - CGAL::set_pretty_mode(std::cerr); + CGAL::IO::set_pretty_mode(std::cout); + CGAL::IO::set_pretty_mode(std::cerr); typedef typename AK::Integer Integer; typedef typename AK::Rational Rational; @@ -37,8 +37,8 @@ void test_AK_1(){ template < typename AK> void test_AK_2(){ - CGAL::set_pretty_mode(std::cout); - CGAL::set_pretty_mode(std::cerr); + CGAL::IO::set_pretty_mode(std::cout); + CGAL::IO::set_pretty_mode(std::cerr); typedef typename AK::Integer Integer; typedef typename AK::Rational Rational; @@ -57,8 +57,8 @@ void test_AK_2(){ template < typename AK> void test_AK_4(){ - CGAL::set_pretty_mode(std::cout); - CGAL::set_pretty_mode(std::cerr); + CGAL::IO::set_pretty_mode(std::cout); + CGAL::IO::set_pretty_mode(std::cerr); typedef typename AK::Integer Integer; typedef typename AK::Rational Rational; @@ -78,8 +78,8 @@ void test_AK_4(){ template < typename AK> void test_AK_5(){ - CGAL::set_pretty_mode(std::cout); - CGAL::set_pretty_mode(std::cerr); + CGAL::IO::set_pretty_mode(std::cout); + CGAL::IO::set_pretty_mode(std::cerr); typedef typename AK::Integer Integer; typedef typename AK::Rational Rational; @@ -101,8 +101,8 @@ void test_AK_5(){ template < typename AK> void test_AK_6(){ - CGAL::set_pretty_mode(std::cout); - CGAL::set_pretty_mode(std::cerr); + CGAL::IO::set_pretty_mode(std::cout); + CGAL::IO::set_pretty_mode(std::cerr); typedef typename AK::Integer Integer; typedef typename AK::Rational Rational; diff --git a/Polynomial/examples/Polynomial/coefficient_access.cpp b/Polynomial/examples/Polynomial/coefficient_access.cpp index 0ca295a45f9..97f3dae76df 100644 --- a/Polynomial/examples/Polynomial/coefficient_access.cpp +++ b/Polynomial/examples/Polynomial/coefficient_access.cpp @@ -3,7 +3,7 @@ #include int main(){ - CGAL::set_pretty_mode(std::cout); + CGAL::IO::set_pretty_mode(std::cout); typedef CGAL::Polynomial_type_generator::Type Poly_2; typedef CGAL::Polynomial_traits_d PT_2; diff --git a/Polynomial/examples/Polynomial/construction.cpp b/Polynomial/examples/Polynomial/construction.cpp index 020d23ad8b4..9c21fc55bf4 100644 --- a/Polynomial/examples/Polynomial/construction.cpp +++ b/Polynomial/examples/Polynomial/construction.cpp @@ -3,7 +3,7 @@ #include int main(){ - CGAL::set_pretty_mode(std::cout); + CGAL::IO::set_pretty_mode(std::cout); typedef CGAL::Polynomial_type_generator::Type Poly_2; typedef CGAL::Polynomial_traits_d PT_2; diff --git a/Polynomial/examples/Polynomial/degree.cpp b/Polynomial/examples/Polynomial/degree.cpp index c86516fe44c..c4fadac65c2 100644 --- a/Polynomial/examples/Polynomial/degree.cpp +++ b/Polynomial/examples/Polynomial/degree.cpp @@ -3,7 +3,7 @@ #include int main(){ - CGAL::set_pretty_mode(std::cout); + CGAL::IO::set_pretty_mode(std::cout); typedef CGAL::Polynomial_type_generator::Type Poly_2; typedef CGAL::Polynomial_traits_d PT_2; diff --git a/Polynomial/examples/Polynomial/gcd_up_to_constant_factor.cpp b/Polynomial/examples/Polynomial/gcd_up_to_constant_factor.cpp index 1314ed41f5c..674b5aeb615 100644 --- a/Polynomial/examples/Polynomial/gcd_up_to_constant_factor.cpp +++ b/Polynomial/examples/Polynomial/gcd_up_to_constant_factor.cpp @@ -3,7 +3,7 @@ #include int main(){ - CGAL::set_pretty_mode(std::cout); + CGAL::IO::set_pretty_mode(std::cout); typedef CGAL::Polynomial_type_generator::Type Poly_1; typedef CGAL::Polynomial_traits_d PT_1; diff --git a/Polynomial/examples/Polynomial/subresultants.cpp b/Polynomial/examples/Polynomial/subresultants.cpp index 69dfda7c15c..339a5baa154 100644 --- a/Polynomial/examples/Polynomial/subresultants.cpp +++ b/Polynomial/examples/Polynomial/subresultants.cpp @@ -5,7 +5,7 @@ #include int main(){ - CGAL::set_pretty_mode(std::cout); + CGAL::IO::set_pretty_mode(std::cout); typedef CGAL::Exact_integer Int; diff --git a/Polynomial/examples/Polynomial/substitute.cpp b/Polynomial/examples/Polynomial/substitute.cpp index 4b5ca70cf34..6f0c47217d3 100644 --- a/Polynomial/examples/Polynomial/substitute.cpp +++ b/Polynomial/examples/Polynomial/substitute.cpp @@ -3,7 +3,7 @@ #include int main(){ - CGAL::set_pretty_mode(std::cout); + CGAL::IO::set_pretty_mode(std::cout); typedef CGAL::Polynomial_type_generator::Type Poly_2; typedef CGAL::Polynomial_traits_d PT_2; diff --git a/Polynomial/examples/Polynomial/swap_move.cpp b/Polynomial/examples/Polynomial/swap_move.cpp index bcfb9210ae9..e6479c717ab 100644 --- a/Polynomial/examples/Polynomial/swap_move.cpp +++ b/Polynomial/examples/Polynomial/swap_move.cpp @@ -3,7 +3,7 @@ #include int main(){ - CGAL::set_pretty_mode(std::cout); + CGAL::IO::set_pretty_mode(std::cout); typedef CGAL::Polynomial_type_generator::Type Poly_3; typedef CGAL::Polynomial_traits_d PT_3; diff --git a/Polynomial/include/CGAL/Exponent_vector.h b/Polynomial/include/CGAL/Exponent_vector.h index d841191d59e..5f34cb4869b 100644 --- a/Polynomial/include/CGAL/Exponent_vector.h +++ b/Polynomial/include/CGAL/Exponent_vector.h @@ -161,7 +161,7 @@ inline std::ostream& operator << (std::ostream& os, const Exponent_vector& ev) { namespace std{ template <> inline void swap(CGAL::Exponent_vector& ev1, CGAL::Exponent_vector& ev2) - CGAL_NOEXCEPT(std::is_nothrow_move_constructible::value + noexcept(std::is_nothrow_move_constructible::value && std::is_nothrow_move_assignable::value) { ev1.swap(ev2); diff --git a/Polynomial/include/CGAL/Polynomial/Polynomial_type.h b/Polynomial/include/CGAL/Polynomial/Polynomial_type.h index 9f4316aa3eb..fc08c137347 100644 --- a/Polynomial/include/CGAL/Polynomial/Polynomial_type.h +++ b/Polynomial/include/CGAL/Polynomial/Polynomial_type.h @@ -829,7 +829,7 @@ public: * of xi. Missing coefficients are set to zero. * Whitespace is ignored. * The format of the coefficients must be understandable for - * is >> iformat(ai) . + * is >> IO::iformat(ai) . * * Example: A \c CGAL::Polynomial with a value of * 4x2 - 1 has to be written as @@ -1223,7 +1223,7 @@ Polynomial division(const Polynomial& p1, */ template std::ostream& operator << (std::ostream& os, const Polynomial& p) { - switch(CGAL::get_mode(os)) { + switch(CGAL::IO::get_mode(os)) { case CGAL::IO::PRETTY: p.output_maple(os); break; default: @@ -1242,7 +1242,7 @@ std::ostream& operator << (std::ostream& os, const Polynomial& p) { */ template std::istream& operator >> (std::istream& is, Polynomial& p) { - CGAL_precondition(!CGAL::is_pretty(is)); + CGAL_precondition(!CGAL::IO::is_pretty(is)); p = Polynomial::input_ascii(is); return is; } @@ -1253,12 +1253,12 @@ void print_maple_monomial(std::ostream& os, const NT& coeff, const std::string& var, int expn) { if (expn == 0 || coeff != NT(1)) { - os << CGAL::oformat(coeff, Parens_as_product_tag()); + os << CGAL::IO::oformat(coeff, Parens_as_product_tag()); if (expn >= 1) os << "*"; } if (expn >= 1) { os << var; - if (expn > 1) os << "^" << CGAL::oformat(expn); + if (expn > 1) os << "^" << CGAL::IO::oformat(expn); } } @@ -1291,12 +1291,12 @@ void Polynomial::output_maple(std::ostream& os) const { template void Polynomial::output_ascii(std::ostream &os) const { const Polynomial &p = *this; - if (p.is_zero()) { os << "P[0 (0," << oformat(NT(0)) << ")]"; return; } + if (p.is_zero()) { os << "P[0 (0," << IO::oformat(NT(0)) << ")]"; return; } - os << "P[" << oformat(p.degree()); + os << "P[" << IO::oformat(p.degree()); for (int i = 0; i <= p.degree(); i++) { - if (p[i] != NT(0)) os << "(" << CGAL::oformat(i) << "," - << CGAL::oformat(p[i]) << ")"; + if (p[i] != NT(0)) os << "(" << CGAL::IO::oformat(i) << "," + << CGAL::IO::oformat(p[i]) << ")"; } os << "]"; } @@ -1371,7 +1371,7 @@ Polynomial Polynomial::input_ascii(std::istream &is) { internal::swallow(is, 'P'); internal::swallow(is, '['); - is >> CGAL::iformat(degr); + is >> CGAL::IO::iformat(degr); if (degr < 0) { CGAL_error_msg( "input error: negative degree of polynomial specified"); } @@ -1381,12 +1381,12 @@ Polynomial Polynomial::input_ascii(std::istream &is) { do is.get(c); while (isspace(c)); do { if (c != '(') CGAL_error_msg( "input error: ( expected"); - is >> CGAL::iformat(i); + is >> CGAL::IO::iformat(i); if (!(i >= 0 && i <= degr && p[i] == NT(0))) { CGAL_error_msg( "input error: invalid exponent in polynomial"); }; internal::swallow(is, ','); - is >> CGAL::iformat(p.coeff(i)); + is >> CGAL::IO::iformat(p.coeff(i)); internal::swallow(is, ')'); do is.get(c); while (isspace(c)); } while (c != ']'); diff --git a/Polynomial/test/Polynomial/Interpolator.cpp b/Polynomial/test/Polynomial/Interpolator.cpp index 54d18be0db3..8f4c3a4351e 100644 --- a/Polynomial/test/Polynomial/Interpolator.cpp +++ b/Polynomial/test/Polynomial/Interpolator.cpp @@ -54,7 +54,7 @@ void test_interpolator(){ int main(){ - CGAL::set_pretty_mode(std::cout); + CGAL::IO::set_pretty_mode(std::cout); typedef CGAL::Arithmetic_kernel AK; typedef AK::Integer Integer; diff --git a/Polynomial/test/Polynomial/Polynomial_using_core.cpp b/Polynomial/test/Polynomial/Polynomial_using_core.cpp index ff19c6474d6..50c93fc7b19 100644 --- a/Polynomial/test/Polynomial/Polynomial_using_core.cpp +++ b/Polynomial/test/Polynomial/Polynomial_using_core.cpp @@ -7,7 +7,7 @@ int main() { // Set wrong rounding mode to test modular arithmetic CGAL::Protect_FPU_rounding pfr(CGAL_FE_UPWARD); - CGAL::set_pretty_mode(std::cout); + CGAL::IO::set_pretty_mode(std::cout); #ifdef CGAL_USE_CORE { diff --git a/Polynomial/test/Polynomial/Polynomial_using_leda.cpp b/Polynomial/test/Polynomial/Polynomial_using_leda.cpp index 2437bc1a36f..379f5ab37f6 100644 --- a/Polynomial/test/Polynomial/Polynomial_using_leda.cpp +++ b/Polynomial/test/Polynomial/Polynomial_using_leda.cpp @@ -6,7 +6,7 @@ int main() { // Set wrong rounding mode to test modular arithmetic CGAL::Protect_FPU_rounding pfr(CGAL_FE_UPWARD); - CGAL::set_pretty_mode(std::cout); + CGAL::IO::set_pretty_mode(std::cout); #ifdef CGAL_USE_LEDA { diff --git a/Polynomial/test/Polynomial/include/CGAL/test_modular_gcd.h b/Polynomial/test/Polynomial/include/CGAL/test_modular_gcd.h index 108f89cd655..9e013d7e18c 100644 --- a/Polynomial/test/Polynomial/include/CGAL/test_modular_gcd.h +++ b/Polynomial/test/Polynomial/include/CGAL/test_modular_gcd.h @@ -35,7 +35,7 @@ void gcd_utcf_test(const NT& f, const NT& g, const NT& d) { template void test_modular_gcd(Unique_factorization_domain_tag) { - ::CGAL::set_pretty_mode(std::cout); + ::CGAL::IO::set_pretty_mode(std::cout); typedef typename AT::Integer Integer; typedef Integer NT; @@ -100,7 +100,7 @@ void test_modular_gcd(Integral_domain_tag) { test_special_polynomials(Integral_domain_tag()); - ::CGAL::set_pretty_mode(std::cout); + ::CGAL::IO::set_pretty_mode(std::cout); typedef typename AT::Integer Integer; typedef CGAL::Sqrt_extension int_EXT_1; @@ -222,7 +222,7 @@ template void test_special_polynomials(Integral_domain_tag) { - ::CGAL::set_pretty_mode(std::cout); + ::CGAL::IO::set_pretty_mode(std::cout); typedef typename AT::Integer Integer; typedef CGAL::Sqrt_extension int_EXT_1; diff --git a/Polynomial/test/Polynomial/modular_gcd_utils.cpp b/Polynomial/test/Polynomial/modular_gcd_utils.cpp index a10dcabb7d8..c89923614ef 100644 --- a/Polynomial/test/Polynomial/modular_gcd_utils.cpp +++ b/Polynomial/test/Polynomial/modular_gcd_utils.cpp @@ -43,7 +43,7 @@ void test_modular_gcd_utils() { CGAL_USE_TYPE(Field_with_sqrt); CGAL::Random my_random(4711); - ::CGAL::set_pretty_mode(std::cout); + ::CGAL::IO::set_pretty_mode(std::cout); typedef typename AT::Integer Integer; typedef Integer NT; diff --git a/Polynomial/test/Polynomial/polynomial_gcd.cpp b/Polynomial/test/Polynomial/polynomial_gcd.cpp index 9f8b9c6d76b..aca5a767228 100644 --- a/Polynomial/test/Polynomial/polynomial_gcd.cpp +++ b/Polynomial/test/Polynomial/polynomial_gcd.cpp @@ -42,7 +42,7 @@ template void gcd_test(const POLY& f, const POLY& g, const POLY& d) { POLY tmp = CGAL::gcd(f, g); #ifdef WITH_OUTPUT - ::CGAL::set_pretty_mode(std::cout); + ::CGAL::IO::set_pretty_mode(std::cout); std::cout << "\ngcd: "; std::cout << "\nf(x) = " << f; std::cout << "\ng(x) = " << g; @@ -734,7 +734,7 @@ void trivariate_polynomial_test() { template void polynomial_gcd_test() { - ::CGAL::set_pretty_mode(std::cout); + ::CGAL::IO::set_pretty_mode(std::cout); std::cout<<" univariate "<(); std::cout<<" bivariate "< void test_polynomial_utils(){ - //CGAL::set_pretty_mode(std::cout); + //CGAL::IO::set_pretty_mode(std::cout); typedef typename AK::Integer Integer; typedef typename AK::Rational Rational; diff --git a/Polynomial/test/Polynomial/resultant.cpp b/Polynomial/test/Polynomial/resultant.cpp index 61491583631..cf704773ae0 100644 --- a/Polynomial/test/Polynomial/resultant.cpp +++ b/Polynomial/test/Polynomial/resultant.cpp @@ -70,7 +70,7 @@ int main(){ // Set wrong rounding mode to test modular arithmetic CGAL::Protect_FPU_rounding pfr(CGAL_FE_UPWARD); - CGAL::set_pretty_mode(std::cout); + CGAL::IO::set_pretty_mode(std::cout); typedef CGAL::Arithmetic_kernel AK; typedef AK::Integer Integer; diff --git a/Polynomial/test/Polynomial/test_polynomial.h b/Polynomial/test/Polynomial/test_polynomial.h index f962a34e20e..646057c636b 100644 --- a/Polynomial/test/Polynomial/test_polynomial.h +++ b/Polynomial/test/Polynomial/test_polynomial.h @@ -297,32 +297,32 @@ void io() { assert( p == q ); }{ std::ostringstream os; - CGAL::set_pretty_mode(os); - os << oformat(POLY(NT(3))); + CGAL::IO::set_pretty_mode(os); + os << CGAL::IO::oformat(POLY(NT(3))); //std::cout <::d == 1) assert( os.str() == "4*x + (-3)" ); else assert( os.str() == "4*y + (-3)" ); }{ std::ostringstream os; - CGAL::set_pretty_mode(os); - os << oformat(POLY(NT(-3),NT(4)), CGAL::Parens_as_product_tag()); + CGAL::IO::set_pretty_mode(os); + os << CGAL::IO::oformat(POLY(NT(-3),NT(4)), CGAL::Parens_as_product_tag()); if( CGAL::Polynomial_traits_d::d == 1) assert( os.str() == "(4*x + (-3))" ); diff --git a/Polynomial/test/Polynomial/test_polynomial_Coercion_traits.cpp b/Polynomial/test/Polynomial/test_polynomial_Coercion_traits.cpp index 86a39477003..8ba6939b0d0 100644 --- a/Polynomial/test/Polynomial/test_polynomial_Coercion_traits.cpp +++ b/Polynomial/test/Polynomial/test_polynomial_Coercion_traits.cpp @@ -15,7 +15,7 @@ template void test_coercion_from_to(A, B){ template void test_coercion_traits(){ - //CGAL::set_pretty_mode(std::cout); + //CGAL::IO::set_pretty_mode(std::cout); typedef typename AK::Integer Integer; typedef typename AK::Rational Rational; diff --git a/Polynomial/test/Polynomial/test_subresultants.cpp b/Polynomial/test/Polynomial/test_subresultants.cpp index cc8b392d049..a9dd531777f 100644 --- a/Polynomial/test/Polynomial/test_subresultants.cpp +++ b/Polynomial/test/Polynomial/test_subresultants.cpp @@ -491,7 +491,7 @@ void test_routine() { assert(sres[2]==coP[2]*f + coQ[2]*g); assert(sres[1]==coP[1]*f + coQ[1]*g); assert(sres[0]==coP[0]*f + coQ[0]*g); - CGAL::set_pretty_mode(std::cout); + CGAL::IO::set_pretty_mode(std::cout); assert(sres[2]==sres_check[2]); assert(sres[1]==sres_check[1]); assert(sres[0]==sres_check[0]); @@ -508,7 +508,7 @@ void test_routine() { std::back_inserter(sres), std::back_inserter(coP), std::back_inserter(coQ)); - CGAL::set_pretty_mode(std::cout); + CGAL::IO::set_pretty_mode(std::cout); for(int i=static_cast(sres.size()-1);i>=0;i--) { assert(sres[i]==coP[i]*f + coQ[i]*g); assert(sres_check[i]==sres[i]); @@ -532,7 +532,7 @@ void test_routine() { std::back_inserter(sres), std::back_inserter(coP), std::back_inserter(coQ)); - CGAL::set_pretty_mode(std::cout); + CGAL::IO::set_pretty_mode(std::cout); for(int i=static_cast(sres.size()-1);i>=0;i--) { assert(sres[i]==coP[i]*f + coQ[i]*g); assert(sres_check[i]==sres[i]); @@ -556,7 +556,7 @@ void test_routine() { std::back_inserter(sres), std::back_inserter(coP), std::back_inserter(coQ)); - CGAL::set_pretty_mode(std::cout); + CGAL::IO::set_pretty_mode(std::cout); for(int i=static_cast(sres.size()-1);i>=0;i--) { assert(sres[i]==coP[i]*f + coQ[i]*g); assert(sres_check[i]==sres[i]); diff --git a/Polytope_distance_d/include/CGAL/Polytope_distance_d.h b/Polytope_distance_d/include/CGAL/Polytope_distance_d.h index b52d1ca7219..ede3b47aa92 100644 --- a/Polytope_distance_d/include/CGAL/Polytope_distance_d.h +++ b/Polytope_distance_d/include/CGAL/Polytope_distance_d.h @@ -849,7 +849,7 @@ operator << ( std::ostream& os, typedef typename Traits_::ET ET; typedef ostream_iterator Et_it; - switch ( CGAL::get_mode( os)) { + switch ( CGAL::IO::get_mode( os)) { case CGAL::IO::PRETTY: os << "CGAL::Polytope_distance_d( |P+Q| = " @@ -918,7 +918,7 @@ operator << ( std::ostream& os, default: CGAL_optimisation_assertion_msg( false, - "CGAL::get_mode( os) invalid!"); + "CGAL::IO::get_mode( os) invalid!"); break; } return( os); diff --git a/Polytope_distance_d/test/Polytope_distance_d/test_Polytope_distance_d.h b/Polytope_distance_d/test/Polytope_distance_d/test_Polytope_distance_d.h index 1f7f293fa5b..d0122d83486 100644 --- a/Polytope_distance_d/test/Polytope_distance_d/test_Polytope_distance_d.h +++ b/Polytope_distance_d/test/Polytope_distance_d/test_Polytope_distance_d.h @@ -55,7 +55,7 @@ test_Polytope_distance_d( ForwardIterator p_first, ForwardIterator p_last, CGAL::Verbose_ostream verr0( verbose == 0); CGAL::Verbose_ostream verr1( verbose == 1); CGAL::Verbose_ostream verrX( verbose == 2); - CGAL::set_pretty_mode( verr.out()); + CGAL::IO::set_pretty_mode( verr.out()); bool is_valid_verbose = ( verbose > 1); diff --git a/Profiling_tools/include/CGAL/Profile_counter.h b/Profiling_tools/include/CGAL/Profile_counter.h index dfaacdb48f9..537d7640bee 100644 --- a/Profiling_tools/include/CGAL/Profile_counter.h +++ b/Profiling_tools/include/CGAL/Profile_counter.h @@ -48,6 +48,7 @@ #include #include #include +#include #include @@ -92,7 +93,7 @@ struct Profile_counter Profile_counter(const std::string & ss) : s(ss) { - i = 0; // needed here because of tbb::atomic + i = 0; // needed here because of std::atomic } void operator++() { ++i; } @@ -107,7 +108,7 @@ struct Profile_counter private: #ifdef CGAL_CONCURRENT_PROFILE - tbb::atomic i; + std::atomic i; #else unsigned int i; #endif @@ -167,7 +168,7 @@ struct Profile_branch_counter Profile_branch_counter(const std::string & ss) : s(ss) { - i = j = 0; // needed here because of tbb::atomic + i = j = 0; // needed here because of std::atomic } void operator++() { ++i; } @@ -183,7 +184,7 @@ struct Profile_branch_counter private: #ifdef CGAL_CONCURRENT_PROFILE - tbb::atomic i, j; + std::atomic i, j; #else unsigned int i, j; #endif @@ -196,7 +197,7 @@ struct Profile_branch_counter_3 Profile_branch_counter_3(const std::string & ss) : s(ss) { - i = j = k = 0; // needed here because of tbb::atomic + i = j = k = 0; // needed here because of std::atomic } void operator++() { ++i; } @@ -214,7 +215,7 @@ struct Profile_branch_counter_3 private: #ifdef CGAL_CONCURRENT_PROFILE - tbb::atomic i, j, k; + std::atomic i, j, k; #else unsigned int i, j, k; #endif diff --git a/Property_map/include/CGAL/Dynamic_property_map.h b/Property_map/include/CGAL/Dynamic_property_map.h index fb37d46e214..6337a639068 100644 --- a/Property_map/include/CGAL/Dynamic_property_map.h +++ b/Property_map/include/CGAL/Dynamic_property_map.h @@ -18,7 +18,7 @@ #include #include -#include +#include #include #include #include @@ -70,7 +70,7 @@ struct Dynamic_property_map { typedef boost::unordered_map Map; - boost::shared_ptr map_; + std::shared_ptr map_; V default_value_; }; @@ -119,7 +119,7 @@ struct Dynamic { put(*(m.map_), k, v); } - boost::shared_ptr map_; + std::shared_ptr map_; }; template @@ -152,7 +152,7 @@ struct Dynamic_with_index (*m.m_values)[k.idx()]=v; } - boost::shared_ptr > m_values; + std::shared_ptr > m_values; }; } // namespace internal diff --git a/Property_map/include/CGAL/Index_property_map.h b/Property_map/include/CGAL/Index_property_map.h index 4d170e39e25..314dacda060 100644 --- a/Property_map/include/CGAL/Index_property_map.h +++ b/Property_map/include/CGAL/Index_property_map.h @@ -13,7 +13,7 @@ #define CGAL_INDEX_PROPERTY_MAP_H #include -#include +#include #include #include @@ -97,7 +97,7 @@ public: private: // Property maps must be lightweight classes => share std::map - boost::shared_ptr m_index_map; + std::shared_ptr m_index_map; }; /// @cond SKIP_IN_MANUAL diff --git a/QP_solver/include/CGAL/QP_models.h b/QP_solver/include/CGAL/QP_models.h index 500a4350d2a..c2c19285096 100644 --- a/QP_solver/include/CGAL/QP_models.h +++ b/QP_solver/include/CGAL/QP_models.h @@ -1061,7 +1061,7 @@ private: template bool number(NumberType& entry) { // whitespace(); the following >> should care for this - from >> CGAL::iformat(entry); + from >> CGAL::IO::iformat(entry); return from.good(); } diff --git a/QP_solver/test/QP_solver/master_mps_to_derivatives.cpp b/QP_solver/test/QP_solver/master_mps_to_derivatives.cpp index 22a72be23f9..b0af787b72e 100644 --- a/QP_solver/test/QP_solver/master_mps_to_derivatives.cpp +++ b/QP_solver/test/QP_solver/master_mps_to_derivatives.cpp @@ -18,7 +18,7 @@ #include #include -#include +#include #include #include @@ -200,7 +200,7 @@ void write_MPS(std::ostream& out, CGAL::print_quadratic_program(out, qp, problem_name); } -boost::shared_ptr +std::shared_ptr create_output_file(const char *filename, // Note: "Bernd3" and not // "Bernd3.mps". const char *directory, @@ -210,7 +210,7 @@ create_output_file(const char *filename, // Note: "Bernd3" and not std::string new_name = std::string(directory) + std::string("/") + std::string(filename) + std::string("_") + std::string(suffix) + std::string(".mps"); - return boost::shared_ptr(new std::ofstream(new_name.c_str(), + return std::shared_ptr(new std::ofstream(new_name.c_str(), std::ios_base::trunc | std::ios_base::out)); } @@ -275,7 +275,7 @@ void create_shifted_instance(const CGAL::Quadratic_program_from_mps & qp, // output: using boost::make_transform_iterator; using boost::make_zip_iterator; - boost::shared_ptr out = create_output_file(file, dir, "shifted"); + std::shared_ptr out = create_output_file(file, dir, "shifted"); write_MPS(*out, "", // deduce number-type @@ -359,7 +359,7 @@ void create_free_instance(CGAL::Quadratic_program_from_mps& qp, qp.set_u(i, false); // variable becomes free } // output: - boost::shared_ptr out = create_output_file(file, dir, "free"); + std::shared_ptr out = create_output_file(file, dir, "free"); write_MPS(*out, "", // deduce number-type "Freed instance of original file", diff --git a/Ridges_3/examples/Ridges_3/Ridges_Umbilics_LCC.cpp b/Ridges_3/examples/Ridges_3/Ridges_Umbilics_LCC.cpp index 5ce258d2909..5df0c1a42c7 100644 --- a/Ridges_3/examples/Ridges_3/Ridges_Umbilics_LCC.cpp +++ b/Ridges_3/examples/Ridges_3/Ridges_Umbilics_LCC.cpp @@ -285,7 +285,7 @@ int main() //load the model from PolyhedralSurf P; - CGAL::read_polygon_mesh(if_name.c_str(), P); + CGAL::IO::read_polygon_mesh(if_name.c_str(), P); fprintf(stderr, "loadMesh %d Ves %d Facets\n", (int)num_vertices(P), (int)num_faces(P)); if(verbose) diff --git a/Ridges_3/include/CGAL/Umbilics.h b/Ridges_3/include/CGAL/Umbilics.h index d10ecd1a1e5..278688706d4 100644 --- a/Ridges_3/include/CGAL/Umbilics.h +++ b/Ridges_3/include/CGAL/Umbilics.h @@ -19,7 +19,7 @@ #include #include -#include +#include #include #include @@ -133,7 +133,7 @@ class Umbilic_approximation const TriangleMesh& P; typedef T_PolyhedralSurf_neighbors Poly_neighbors; - boost::shared_ptr poly_neighbors; + std::shared_ptr poly_neighbors; CGAL::Abs cgal_abs; CGAL::To_double To_double; @@ -165,7 +165,7 @@ Umbilic_approximation(const TriangleMesh& p, { CGAL_precondition(is_triangle_mesh(P)); - poly_neighbors = boost::shared_ptr(new Poly_neighbors(P)); + poly_neighbors = std::shared_ptr(new Poly_neighbors(P)); } diff --git a/STL_Extension/include/CGAL/Concurrent_compact_container.h b/STL_Extension/include/CGAL/Concurrent_compact_container.h index 3877e39f98b..d1f1a4e840f 100644 --- a/STL_Extension/include/CGAL/Concurrent_compact_container.h +++ b/STL_Extension/include/CGAL/Concurrent_compact_container.h @@ -31,7 +31,6 @@ #include #include #include -#include #include #include diff --git a/STL_Extension/include/CGAL/Handle.h b/STL_Extension/include/CGAL/Handle.h index e39f538742c..744d4392cbe 100644 --- a/STL_Extension/include/CGAL/Handle.h +++ b/STL_Extension/include/CGAL/Handle.h @@ -46,8 +46,7 @@ class Handle Handle() noexcept : PTR(static_cast(0)) {} - // FIXME: if the precondition throws in a noexcept function, the program terminates - Handle(const Handle& x) noexcept + Handle(const Handle& x) noexcept(!(CGAL_PRECONDITIONS_ENABLED || CGAL_ASSERTIONS_ENABLED)) { CGAL_precondition( x.PTR != static_cast(0) ); PTR = x.PTR; @@ -68,7 +67,7 @@ class Handle } Handle& - operator=(const Handle& x) noexcept + operator=(const Handle& x) noexcept(!CGAL_PRECONDITIONS_ENABLED) { CGAL_precondition( x.PTR != static_cast(0) ); x.PTR->count++; diff --git a/STL_Extension/include/CGAL/Handle_for.h b/STL_Extension/include/CGAL/Handle_for.h index 97543f58db8..71ac6739e36 100644 --- a/STL_Extension/include/CGAL/Handle_for.h +++ b/STL_Extension/include/CGAL/Handle_for.h @@ -102,7 +102,7 @@ public: ptr_ = p; } - Handle_for(const Handle_for& h) noexcept + Handle_for(const Handle_for& h) noexcept(!CGAL_ASSERTIONS_ENABLED) : ptr_(h.ptr_) { CGAL_assume (ptr_->count > 0); @@ -110,7 +110,7 @@ public: } Handle_for& - operator=(const Handle_for& h) noexcept + operator=(const Handle_for& h) noexcept(!CGAL_ASSERTIONS_ENABLED) { Handle_for tmp = h; swap(tmp); @@ -149,9 +149,9 @@ public: return *this; } - ~Handle_for() noexcept + ~Handle_for() { - try{ + try { if (--(ptr_->count) == 0) { Allocator_traits::destroy(allocator, ptr_); allocator.deallocate( ptr_, 1); diff --git a/STL_Extension/include/CGAL/In_place_list.h b/STL_Extension/include/CGAL/In_place_list.h index e19c8ca5e4d..3266d1ae674 100644 --- a/STL_Extension/include/CGAL/In_place_list.h +++ b/STL_Extension/include/CGAL/In_place_list.h @@ -86,6 +86,8 @@ namespace internal { bool operator==( const Self& x) const { return node == x.node; } bool operator!=( const Self& x) const { return node != x.node; } + bool operator==( std::nullptr_t) const { return node == nullptr; } + bool operator!=( std::nullptr_t) const { return node != nullptr; } bool operator< ( const Self& x) const { return node< x.node; } bool operator<=( const Self& x) const { return node<= x.node; } bool operator> ( const Self& x) const { return node> x.node; } @@ -139,6 +141,8 @@ namespace internal { bool operator==( const Self& x) const { return node == x.node; } bool operator!=( const Self& x) const { return node != x.node; } + bool operator==( std::nullptr_t) const { return node == nullptr; } + bool operator!=( std::nullptr_t) const { return node != nullptr; } bool operator< ( const Self& x) const { return node< x.node; } bool operator<=( const Self& x) const { return node<= x.node; } bool operator> ( const Self& x) const { return node> x.node; } diff --git a/STL_Extension/include/CGAL/Multiset.h b/STL_Extension/include/CGAL/Multiset.h index 5be3bc3b41c..3ef21028cd6 100644 --- a/STL_Extension/include/CGAL/Multiset.h +++ b/STL_Extension/include/CGAL/Multiset.h @@ -590,7 +590,7 @@ public: /*! * Destructor. [takes O(n) operations] */ - virtual ~Multiset (); + virtual ~Multiset () noexcept(!CGAL_ASSERTIONS_ENABLED); /*! * Assignment operator. [takes O(n) operations] @@ -1565,14 +1565,16 @@ Multiset::Multiset (const Self& t // Destructor. // template -Multiset::~Multiset () +Multiset::~Multiset () noexcept(!CGAL_ASSERTIONS_ENABLED) { if (UseCompactContainer::value) return; // Delete the entire tree recursively. - if (rootP != nullptr) - _destroy (rootP); + CGAL_destructor_assertion_catch( + if (rootP != nullptr) + _destroy (rootP); + ); rootP = nullptr; beginNode.parentP = nullptr; diff --git a/STL_Extension/include/CGAL/Object.h b/STL_Extension/include/CGAL/Object.h index 59112fe2959..6046e22552a 100644 --- a/STL_Extension/include/CGAL/Object.h +++ b/STL_Extension/include/CGAL/Object.h @@ -30,13 +30,13 @@ #include #include #include -#include +#include namespace CGAL { class Object { - boost::shared_ptr obj; + std::shared_ptr obj; // returns an any pointer from a variant struct Any_from_variant : public boost::static_visitor { diff --git a/STL_Extension/include/CGAL/Time_stamper.h b/STL_Extension/include/CGAL/Time_stamper.h index f0cfe44a574..8d346516a27 100644 --- a/STL_Extension/include/CGAL/Time_stamper.h +++ b/STL_Extension/include/CGAL/Time_stamper.h @@ -13,7 +13,6 @@ #define CGAL_TIME_STAMPER_H #include -#include namespace CGAL { diff --git a/STL_Extension/include/CGAL/algorithm.h b/STL_Extension/include/CGAL/algorithm.h index d55a6d01b87..34ca7c58cf5 100644 --- a/STL_Extension/include/CGAL/algorithm.h +++ b/STL_Extension/include/CGAL/algorithm.h @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -280,8 +281,8 @@ output_range(std::ostream& os, { InputIterator it = first; if (it != beyond) { - os << pre << oformat(*it) << post; - while (++it != beyond) os << sep << pre << oformat(*it) << post; + os << pre << CGAL::IO::oformat(*it) << post; + while (++it != beyond) os << sep << pre << CGAL::IO::oformat(*it) << post; } return os; } diff --git a/STL_Extension/include/CGAL/assertions.h b/STL_Extension/include/CGAL/assertions.h index e13f181f970..f3de2c1e8b2 100644 --- a/STL_Extension/include/CGAL/assertions.h +++ b/STL_Extension/include/CGAL/assertions.h @@ -77,6 +77,7 @@ inline bool possibly(Uncertain c); // ---------- #if defined(CGAL_NO_ASSERTIONS) +# define CGAL_ASSERTIONS_ENABLED false # define CGAL_assertion(EX) (static_cast(0)) # define CGAL_destructor_assertion(EX) (static_cast(0)) # define CGAL_destructor_assertion_catch(CODE) CODE @@ -90,6 +91,7 @@ inline bool possibly(Uncertain c); # define CGAL_assume_code(CODE) CGAL_assertion_code(CODE) # endif // not def CGAL_ASSUME #else // no CGAL_NO_ASSERTIONS +# define CGAL_ASSERTIONS_ENABLED true # define CGAL_assertion(EX) \ (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) # if __cpp_lib_uncaught_exceptions || ( _MSVC_LANG >= 201703L ) // C++17 @@ -191,10 +193,12 @@ inline bool possibly(Uncertain c); // ------------- #if defined(CGAL_NO_PRECONDITIONS) +# define CGAL_PRECONDITIONS_ENABLED false # define CGAL_precondition(EX) (static_cast(0)) # define CGAL_precondition_msg(EX,MSG) (static_cast(0)) # define CGAL_precondition_code(CODE) #else +# define CGAL_PRECONDITIONS_ENABLED true # define CGAL_precondition(EX) \ (CGAL::possibly(EX)?(static_cast(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__)) # define CGAL_precondition_msg(EX,MSG) \ diff --git a/STL_Extension/include/CGAL/result_of.h b/STL_Extension/include/CGAL/result_of.h index 863ddb90806..87329e362b7 100644 --- a/STL_Extension/include/CGAL/result_of.h +++ b/STL_Extension/include/CGAL/result_of.h @@ -18,6 +18,9 @@ #ifndef CGAL_RESULT_OF_H #define CGAL_RESULT_OF_H +#define CGAL_DEPRECATED_HEADER "" +#define CGAL_REPLACEMENT_HEADER "" + #include #include diff --git a/STL_Extension/include/CGAL/thread.h b/STL_Extension/include/CGAL/thread.h index fb5a7ca1310..7d163964cf7 100644 --- a/STL_Extension/include/CGAL/thread.h +++ b/STL_Extension/include/CGAL/thread.h @@ -12,6 +12,9 @@ #ifndef CGAL_THREAD_H #define CGAL_THREAD_H +#define CGAL_DEPRECATED_HEADER "" +#define CGAL_REPLACEMENT_HEADER "" + #include /* diff --git a/STL_Extension/include/CGAL/vector.h b/STL_Extension/include/CGAL/vector.h index e4c1a5bca28..c10a8fdd53a 100644 --- a/STL_Extension/include/CGAL/vector.h +++ b/STL_Extension/include/CGAL/vector.h @@ -109,6 +109,8 @@ public: tmp += n; return tmp.operator*(); } + bool operator==( std::nullptr_t) const { return ptr == nullptr; } + bool operator!=( std::nullptr_t) const { return ptr != nullptr; } bool operator< ( const Self& i) const { return ( ptr < i.ptr); } bool operator> ( const Self& i) const { return i < *this; } bool operator<=( const Self& i) const { return !(i < *this); } diff --git a/STL_Extension/test/STL_Extension/test_lexcompare_outputrange.cpp b/STL_Extension/test/STL_Extension/test_lexcompare_outputrange.cpp index 2ec6be68f18..7e316f70bbc 100644 --- a/STL_Extension/test/STL_Extension/test_lexcompare_outputrange.cpp +++ b/STL_Extension/test/STL_Extension/test_lexcompare_outputrange.cpp @@ -45,7 +45,7 @@ void test_lex_compare() { void test_output_range() { std::ostringstream os; std::ostream* sp; - CGAL::set_ascii_mode(os); + CGAL::IO::set_ascii_mode(os); assert(os.str() == ""); diff --git a/Scale_space_reconstruction_3/examples/Scale_space_reconstruction_3/scale_space.cpp b/Scale_space_reconstruction_3/examples/Scale_space_reconstruction_3/scale_space.cpp index be02efbc6a2..26952258243 100644 --- a/Scale_space_reconstruction_3/examples/Scale_space_reconstruction_3/scale_space.cpp +++ b/Scale_space_reconstruction_3/examples/Scale_space_reconstruction_3/scale_space.cpp @@ -24,7 +24,7 @@ int main(int argc, char** argv) std::cerr << "Reading " << std::flush; std::vector points; - if(!CGAL::read_points(argv[1], std::back_inserter(points))) + if(!CGAL::IO::read_points(argv[1], std::back_inserter(points))) { std::cerr << "Error: cannot read file" << std::endl; return EXIT_FAILURE; diff --git a/Scale_space_reconstruction_3/examples/Scale_space_reconstruction_3/scale_space_advancing_front.cpp b/Scale_space_reconstruction_3/examples/Scale_space_reconstruction_3/scale_space_advancing_front.cpp index 23a392617a0..aa34edd6441 100644 --- a/Scale_space_reconstruction_3/examples/Scale_space_reconstruction_3/scale_space_advancing_front.cpp +++ b/Scale_space_reconstruction_3/examples/Scale_space_reconstruction_3/scale_space_advancing_front.cpp @@ -32,7 +32,7 @@ int main(int argc, char** argv) // Read the data. std::cerr << "Reading " << std::flush; Point_set points; - if(!CGAL::read_point_set(argv[1], points)) + if(!CGAL::IO::read_point_set(argv[1], points)) { std::cerr << "Error: cannot read file" << std::endl; return EXIT_FAILURE; diff --git a/Scale_space_reconstruction_3/examples/Scale_space_reconstruction_3/scale_space_incremental.cpp b/Scale_space_reconstruction_3/examples/Scale_space_reconstruction_3/scale_space_incremental.cpp index 0adee0d8fda..ce2aa4d670c 100644 --- a/Scale_space_reconstruction_3/examples/Scale_space_reconstruction_3/scale_space_incremental.cpp +++ b/Scale_space_reconstruction_3/examples/Scale_space_reconstruction_3/scale_space_incremental.cpp @@ -40,7 +40,7 @@ int main(int argc, char* argv[]) std::cout << "Reading " << std::flush; std::vector points; - if(!CGAL::read_points(argv[1], std::back_inserter(points))) + if(!CGAL::IO::read_points(argv[1], std::back_inserter(points))) { std::cerr << "Error: cannot read file" << std::endl; return EXIT_FAILURE; diff --git a/Scale_space_reconstruction_3/examples/Scale_space_reconstruction_3/scale_space_manifold.cpp b/Scale_space_reconstruction_3/examples/Scale_space_reconstruction_3/scale_space_manifold.cpp index cfa6f39723c..abf1920fcd7 100644 --- a/Scale_space_reconstruction_3/examples/Scale_space_reconstruction_3/scale_space_manifold.cpp +++ b/Scale_space_reconstruction_3/examples/Scale_space_reconstruction_3/scale_space_manifold.cpp @@ -30,7 +30,7 @@ int main(int argc, char* argv[]) std::cerr << "Reading " << std::flush; std::vector points; - if(!CGAL::read_points(argv[1], std::back_inserter(points))) + if(!CGAL::IO::read_points(argv[1], std::back_inserter(points))) { std::cerr << "Error: cannot read file" << std::endl; return EXIT_FAILURE; diff --git a/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Segment_Delaunay_graph_2_impl.h b/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Segment_Delaunay_graph_2_impl.h index 846e4ad80a2..43c1ca7b1ef 100644 --- a/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Segment_Delaunay_graph_2_impl.h +++ b/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Segment_Delaunay_graph_2_impl.h @@ -2975,71 +2975,71 @@ file_output(std::ostream& os, const Storage_site_2& t, if ( t.is_point() ) { // 0 for point os << 0; - if ( is_ascii(os) ) { os << ' '; } + if ( IO::is_ascii(os) ) { os << ' '; } if ( t.is_input() ) { // 0 for input os << 0; - if ( is_ascii(os) ) { os << ' '; } + if ( IO::is_ascii(os) ) { os << ' '; } os << P[t.point()]; } else { // 1 for non-input os << 1; - if ( is_ascii(os) ) { os << ' '; } + if ( IO::is_ascii(os) ) { os << ' '; } os << P[t.source_of_supporting_site(0)]; - if ( is_ascii(os) ) { os << ' '; } + if ( IO::is_ascii(os) ) { os << ' '; } os << P[t.target_of_supporting_site(0)]; - if ( is_ascii(os) ) { os << ' '; } + if ( IO::is_ascii(os) ) { os << ' '; } os << P[t.source_of_supporting_site(1)]; - if ( is_ascii(os) ) { os << ' '; } + if ( IO::is_ascii(os) ) { os << ' '; } os << P[t.target_of_supporting_site(1)]; } } else { // t is a segment // 1 for segment os << 1; - if ( is_ascii(os) ) { os << ' '; } + if ( IO::is_ascii(os) ) { os << ' '; } if ( t.is_input() ) { // 0 for input os << 0; - if ( is_ascii(os) ) { os << ' '; } + if ( IO::is_ascii(os) ) { os << ' '; } os << P[t.source_of_supporting_site()]; - if ( is_ascii(os) ) { os << ' '; } + if ( IO::is_ascii(os) ) { os << ' '; } os << P[t.target_of_supporting_site()]; } else if ( t.is_input(0) ) { // 1 for input source os << 1; - if ( is_ascii(os) ) { os << ' '; } + if ( IO::is_ascii(os) ) { os << ' '; } os << P[t.source_of_supporting_site()]; - if ( is_ascii(os) ) { os << ' '; } + if ( IO::is_ascii(os) ) { os << ' '; } os << P[t.target_of_supporting_site()]; - if ( is_ascii(os) ) { os << ' '; } + if ( IO::is_ascii(os) ) { os << ' '; } os << P[t.source_of_crossing_site(1)]; - if ( is_ascii(os) ) { os << ' '; } + if ( IO::is_ascii(os) ) { os << ' '; } os << P[t.target_of_crossing_site(1)]; } else if ( t.is_input(1) ) { // 2 for input target os << 2; - if ( is_ascii(os) ) { os << ' '; } + if ( IO::is_ascii(os) ) { os << ' '; } os << P[t.source_of_supporting_site()]; - if ( is_ascii(os) ) { os << ' '; } + if ( IO::is_ascii(os) ) { os << ' '; } os << P[t.target_of_supporting_site()]; - if ( is_ascii(os) ) { os << ' '; } + if ( IO::is_ascii(os) ) { os << ' '; } os << P[t.source_of_crossing_site(0)]; - if ( is_ascii(os) ) { os << ' '; } + if ( IO::is_ascii(os) ) { os << ' '; } os << P[t.target_of_crossing_site(0)]; } else { // 3 for non-input src & trg os << 3; - if ( is_ascii(os) ) { os << ' '; } + if ( IO::is_ascii(os) ) { os << ' '; } os << P[t.source_of_supporting_site()]; - if ( is_ascii(os) ) { os << ' '; } + if ( IO::is_ascii(os) ) { os << ' '; } os << P[t.target_of_supporting_site()]; - if ( is_ascii(os) ) { os << ' '; } + if ( IO::is_ascii(os) ) { os << ' '; } os << P[t.source_of_crossing_site(0)]; - if ( is_ascii(os) ) { os << ' '; } + if ( IO::is_ascii(os) ) { os << ' '; } os << P[t.target_of_crossing_site(0)]; - if ( is_ascii(os) ) { os << ' '; } + if ( IO::is_ascii(os) ) { os << ' '; } os << P[t.source_of_crossing_site(1)]; - if ( is_ascii(os) ) { os << ' '; } + if ( IO::is_ascii(os) ) { os << ' '; } os << P[t.target_of_crossing_site(1)]; } } @@ -3133,7 +3133,7 @@ file_output(std::ostream& os, Point_handle_mapper& P, CGAL_assertion( n >= 1 ); - if( is_ascii(os) ) { + if( IO::is_ascii(os) ) { os << n << ' ' << m << ' ' << dimension() << std::endl; } else { os << n << m << dimension(); @@ -3141,24 +3141,24 @@ file_output(std::ostream& os, Point_handle_mapper& P, // points in point container and input sites container if ( print_point_container ) { - if ( is_ascii(os) ) { os << std::endl; } + if ( IO::is_ascii(os) ) { os << std::endl; } os << pc_.size(); - if ( is_ascii(os) ) { os << std::endl; } + if ( IO::is_ascii(os) ) { os << std::endl; } for (const_Point_handle ph = pc_.begin(); ph != pc_.end(); ++ph) { os << *ph; - if ( is_ascii(os) ) { os << std::endl; } + if ( IO::is_ascii(os) ) { os << std::endl; } } // print the input sites container - if ( is_ascii(os) ) { os << std::endl; } + if ( IO::is_ascii(os) ) { os << std::endl; } os << isc_.size(); - if ( is_ascii(os) ) { os << std::endl; } + if ( IO::is_ascii(os) ) { os << std::endl; } for (typename Input_sites_container::const_iterator it = isc_.begin(); it != isc_.end(); ++it) { os << P[boost::tuples::get<0>(*it)]; - if ( is_ascii(os) ) { os << " "; } + if ( IO::is_ascii(os) ) { os << " "; } os << P[boost::tuples::get<1>(*it)]; - if ( is_ascii(os) ) { os << std::endl; } + if ( IO::is_ascii(os) ) { os << std::endl; } } } @@ -3170,7 +3170,7 @@ file_output(std::ostream& os, Point_handle_mapper& P, V[infinite_vertex()] = inum++; // finite vertices - if (is_ascii(os)) os << std::endl; + if (IO::is_ascii(os)) os << std::endl; for (Finite_vertices_iterator vit = finite_vertices_begin(); vit != finite_vertices_end(); ++vit) { V[vit] = inum++; @@ -3178,9 +3178,9 @@ file_output(std::ostream& os, Point_handle_mapper& P, file_output(os, vit->storage_site(), P); // write non-combinatorial info of the vertex // os << *vit ; - if ( is_ascii(os) ) { os << std::endl; } + if ( IO::is_ascii(os) ) { os << std::endl; } } - if ( is_ascii(os) ) { os << std::endl; } + if ( IO::is_ascii(os) ) { os << std::endl; } // vertices of the faces inum = 0; @@ -3190,25 +3190,25 @@ file_output(std::ostream& os, Point_handle_mapper& P, F[fit] = inum++; for(int j = 0; j < dim ; ++j) { os << V[ fit->vertex(j) ]; - if( is_ascii(os) ) { os << ' '; } + if( IO::is_ascii(os) ) { os << ' '; } } // write non-combinatorial info of the face // os << *fit ; - if( is_ascii(os) ) { os << std::endl; } + if( IO::is_ascii(os) ) { os << std::endl; } } - if( is_ascii(os) ) { os << std::endl; } + if( IO::is_ascii(os) ) { os << std::endl; } // neighbor pointers of the faces for( All_faces_iterator it = all_faces_begin(); it != all_faces_end(); ++it) { for(int j = 0; j < dimension()+1; ++j){ os << F[ it->neighbor(j) ]; - if( is_ascii(os) ) { os << ' '; } + if( IO::is_ascii(os) ) { os << ' '; } } - if( is_ascii(os) ) { os << std::endl; } + if( IO::is_ascii(os) ) { os << std::endl; } } - if ( is_ascii(os) ) { os << std::endl; } + if ( IO::is_ascii(os) ) { os << std::endl; } } diff --git a/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Segment_Delaunay_graph_hierarchy_2_impl.h b/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Segment_Delaunay_graph_hierarchy_2_impl.h index b145c0b2b7f..14697569e3c 100644 --- a/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Segment_Delaunay_graph_hierarchy_2_impl.h +++ b/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Segment_Delaunay_graph_hierarchy_2_impl.h @@ -1031,10 +1031,10 @@ file_output(std::ostream& os) const // write each level of the hierarchy hierarchy[0]->file_output(os, P, true); - if ( is_ascii(os) ) { os << std::endl << std::endl; } + if ( IO::is_ascii(os) ) { os << std::endl << std::endl; } for (unsigned int i = 1; i < sdg_hierarchy_2__maxlevel; ++i) { hierarchy[i]->file_output(os, P, false); - if ( is_ascii(os) ) { os << std::endl << std::endl; } + if ( IO::is_ascii(os) ) { os << std::endl << std::endl; } } Vertex_map* V = new Vertex_map[sdg_hierarchy_2__maxlevel]; @@ -1070,22 +1070,22 @@ file_output(std::ostream& os) const } // write up and down pointer info - if ( is_ascii(os) ) { os << std::endl << std::endl; } + if ( IO::is_ascii(os) ) { os << std::endl << std::endl; } for (unsigned int i = 0; i < sdg_hierarchy_2__maxlevel; ++i) { os << i; - if ( is_ascii(os) ) { os << " "; } + if ( IO::is_ascii(os) ) { os << " "; } os << hierarchy[i]->number_of_vertices(); - if ( is_ascii(os) ) { os << std::endl; } + if ( IO::is_ascii(os) ) { os << std::endl; } for (Finite_vertices_iterator vit = hierarchy[i]->finite_vertices_begin(); vit != hierarchy[i]->finite_vertices_end(); ++vit) { os << V[i][vit]; - if ( is_ascii(os) ) { os << " "; } + if ( IO::is_ascii(os) ) { os << " "; } os << V_down[i][vit]; - if ( is_ascii(os) ) { os << " "; } + if ( IO::is_ascii(os) ) { os << " "; } os << V_up[i][vit]; - if ( is_ascii(os) ) { os << std::endl; } + if ( IO::is_ascii(os) ) { os << std::endl; } } - if ( is_ascii(os) ) { os << std::endl << std::endl; } + if ( IO::is_ascii(os) ) { os << std::endl << std::endl; } } delete[] V; diff --git a/Segment_Delaunay_graph_Linf_2/include/CGAL/Polychain_2.h b/Segment_Delaunay_graph_Linf_2/include/CGAL/Polychain_2.h index 97c79b448ff..ad110495054 100644 --- a/Segment_Delaunay_graph_Linf_2/include/CGAL/Polychain_2.h +++ b/Segment_Delaunay_graph_Linf_2/include/CGAL/Polychain_2.h @@ -97,7 +97,7 @@ operator<<(std::ostream &os, ::Vertex_const_iterator i; - switch(get_mode(os)) { + switch(IO::get_mode(os)) { case IO::ASCII : os << p.size() << ' '; for (i = p.vertices_begin(); i != p.vertices_end(); ++i) { @@ -268,7 +268,7 @@ operator<<(std::ostream &os, { typename Polychainray_2::Vertex_const_iterator i; - switch(get_mode(os)) { + switch(IO::get_mode(os)) { case IO::ASCII : os << p.size() << ' '; for (i = p.vertices_begin(); i != p.vertices_end(); ++i) { @@ -779,7 +779,7 @@ operator<<(std::ostream &os, { typename Polychainline_2::Vertex_const_iterator i; - switch(get_mode(os)) { + switch(IO::get_mode(os)) { case IO::ASCII : os << p.size() << ' '; os << ", dinc=" << p.get_incoming() << ", "; diff --git a/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2/Segment_Delaunay_graph_Linf_hierarchy_2_impl.h b/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2/Segment_Delaunay_graph_Linf_hierarchy_2_impl.h index 38fbec9d6ab..2dcc22dc739 100644 --- a/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2/Segment_Delaunay_graph_Linf_hierarchy_2_impl.h +++ b/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2/Segment_Delaunay_graph_Linf_hierarchy_2_impl.h @@ -1097,10 +1097,10 @@ file_output(std::ostream& os) const // write each level of the hierarchy hierarchy[0]->file_output(os, P, true); - if ( is_ascii(os) ) { os << std::endl << std::endl; } + if ( IO::is_ascii(os) ) { os << std::endl << std::endl; } for (unsigned int i = 1; i < sdg_hierarchy_2__maxlevel; ++i) { hierarchy[i]->file_output(os, P, false); - if ( is_ascii(os) ) { os << std::endl << std::endl; } + if ( IO::is_ascii(os) ) { os << std::endl << std::endl; } } Vertex_map* V = new Vertex_map[sdg_hierarchy_2__maxlevel]; @@ -1136,22 +1136,22 @@ file_output(std::ostream& os) const } // write up and down pointer info - if ( is_ascii(os) ) { os << std::endl << std::endl; } + if ( IO::is_ascii(os) ) { os << std::endl << std::endl; } for (unsigned int i = 0; i < sdg_hierarchy_2__maxlevel; ++i) { os << i; - if ( is_ascii(os) ) { os << " "; } + if ( IO::is_ascii(os) ) { os << " "; } os << hierarchy[i]->number_of_vertices(); - if ( is_ascii(os) ) { os << std::endl; } + if ( IO::is_ascii(os) ) { os << std::endl; } for (Finite_vertices_iterator vit = hierarchy[i]->finite_vertices_begin(); vit != hierarchy[i]->finite_vertices_end(); ++vit) { os << V[i][vit]; - if ( is_ascii(os) ) { os << " "; } + if ( IO::is_ascii(os) ) { os << " "; } os << V_down[i][vit]; - if ( is_ascii(os) ) { os << " "; } + if ( IO::is_ascii(os) ) { os << " "; } os << V_up[i][vit]; - if ( is_ascii(os) ) { os << std::endl; } + if ( IO::is_ascii(os) ) { os << std::endl; } } - if ( is_ascii(os) ) { os << std::endl << std::endl; } + if ( IO::is_ascii(os) ) { os << std::endl << std::endl; } } delete[] V; diff --git a/Shape_detection/benchmark/Shape_detection/benchmark_region_growing_on_point_set_2.cpp b/Shape_detection/benchmark/Shape_detection/benchmark_region_growing_on_point_set_2.cpp index f6e20bd24fe..f1886f0d286 100644 --- a/Shape_detection/benchmark/Shape_detection/benchmark_region_growing_on_point_set_2.cpp +++ b/Shape_detection/benchmark/Shape_detection/benchmark_region_growing_on_point_set_2.cpp @@ -90,7 +90,7 @@ int main(int argc, char *argv[]) { // Load xyz data either from a local folder or a user-provided file. std::ifstream in(argc > 1 ? argv[1] : "data/point_set_2.xyz"); - CGAL::set_ascii_mode(in); + CGAL::IO::set_ascii_mode(in); if (!in) { std::cout << diff --git a/Shape_detection/benchmark/Shape_detection/benchmark_region_growing_on_point_set_3.cpp b/Shape_detection/benchmark/Shape_detection/benchmark_region_growing_on_point_set_3.cpp index 8ab4ef6e56d..2660463dbc0 100644 --- a/Shape_detection/benchmark/Shape_detection/benchmark_region_growing_on_point_set_3.cpp +++ b/Shape_detection/benchmark/Shape_detection/benchmark_region_growing_on_point_set_3.cpp @@ -126,7 +126,7 @@ int main(int argc, char *argv[]) { // Load xyz data either from a local folder or a user-provided file. std::ifstream in(argc > 1 ? argv[1] : "data/point_set_3.xyz"); - CGAL::set_ascii_mode(in); + CGAL::IO::set_ascii_mode(in); if (!in) { std::cout << diff --git a/Shape_detection/examples/Shape_detection/efficient_RANSAC_and_plane_regularization.cpp b/Shape_detection/examples/Shape_detection/efficient_RANSAC_and_plane_regularization.cpp index aa7022bbcf4..08d3d5d79e4 100644 --- a/Shape_detection/examples/Shape_detection/efficient_RANSAC_and_plane_regularization.cpp +++ b/Shape_detection/examples/Shape_detection/efficient_RANSAC_and_plane_regularization.cpp @@ -30,7 +30,7 @@ int main(int argc, char** argv) { Pwn_vector points; - if (!CGAL::read_points( + if (!CGAL::IO::read_points( (argc > 1 ? argv[1] : "data/cube.pwn"), std::back_inserter(points), CGAL::parameters::point_map(Point_map()). diff --git a/Shape_detection/examples/Shape_detection/efficient_RANSAC_basic.cpp b/Shape_detection/examples/Shape_detection/efficient_RANSAC_basic.cpp index 548229e42b6..f6e422702ea 100644 --- a/Shape_detection/examples/Shape_detection/efficient_RANSAC_basic.cpp +++ b/Shape_detection/examples/Shape_detection/efficient_RANSAC_basic.cpp @@ -35,7 +35,7 @@ int main (int argc, char** argv) { // Load point set from a file. - if (!CGAL::read_points( + if (!CGAL::IO::read_points( filename, std::back_inserter(points), CGAL::parameters::point_map(Point_map()). diff --git a/Shape_detection/examples/Shape_detection/efficient_RANSAC_with_callback.cpp b/Shape_detection/examples/Shape_detection/efficient_RANSAC_with_callback.cpp index 2a946a3c312..e17aae6482b 100644 --- a/Shape_detection/examples/Shape_detection/efficient_RANSAC_with_callback.cpp +++ b/Shape_detection/examples/Shape_detection/efficient_RANSAC_with_callback.cpp @@ -62,7 +62,7 @@ int main (int argc, char** argv) { Pwn_vector points; - if (!CGAL::read_points( + if (!CGAL::IO::read_points( filename, std::back_inserter(points), CGAL::parameters::point_map(Point_map()). diff --git a/Shape_detection/examples/Shape_detection/efficient_RANSAC_with_custom_shape.cpp b/Shape_detection/examples/Shape_detection/efficient_RANSAC_with_custom_shape.cpp index cc9e6b1f5b8..4bd26cb2169 100644 --- a/Shape_detection/examples/Shape_detection/efficient_RANSAC_with_custom_shape.cpp +++ b/Shape_detection/examples/Shape_detection/efficient_RANSAC_with_custom_shape.cpp @@ -28,9 +28,9 @@ int main(int argc, char** argv) { // Load point set from a file. - if (!CGAL::read_points(((argc > 1) ? argv[1] : "data/cube.pwn"), std::back_inserter(points), - CGAL::parameters::point_map(Point_map()) - .normal_map(Normal_map()))) + if (!CGAL::IO::read_points(((argc > 1) ? argv[1] : "data/cube.pwn"), std::back_inserter(points), + CGAL::parameters::point_map(Point_map()) + .normal_map(Normal_map()))) { std::cerr << "Error: cannot read input file!" << std::endl; return EXIT_FAILURE; diff --git a/Shape_detection/examples/Shape_detection/efficient_RANSAC_with_parameters.cpp b/Shape_detection/examples/Shape_detection/efficient_RANSAC_with_parameters.cpp index 18da3c0fa59..2d0280be98a 100644 --- a/Shape_detection/examples/Shape_detection/efficient_RANSAC_with_parameters.cpp +++ b/Shape_detection/examples/Shape_detection/efficient_RANSAC_with_parameters.cpp @@ -32,7 +32,7 @@ int main(int argc, char** argv) { // Load point set from a file. - if (!CGAL::read_points( + if (!CGAL::IO::read_points( ((argc > 1) ? argv[1] : "data/cube.pwn"), std::back_inserter(points), CGAL::parameters::point_map(Point_map()). diff --git a/Shape_detection/examples/Shape_detection/efficient_RANSAC_with_point_access.cpp b/Shape_detection/examples/Shape_detection/efficient_RANSAC_with_point_access.cpp index 1feda5d0684..21e2ef6e531 100644 --- a/Shape_detection/examples/Shape_detection/efficient_RANSAC_with_point_access.cpp +++ b/Shape_detection/examples/Shape_detection/efficient_RANSAC_with_point_access.cpp @@ -29,7 +29,7 @@ int main(int argc, char** argv) { // Load point set from a file. - if (!CGAL::read_points( + if (!CGAL::IO::read_points( ((argc > 1) ? argv[1] : "data/cube.pwn"), std::back_inserter(points), CGAL::parameters::point_map(Point_map()). diff --git a/Shape_detection/examples/Shape_detection/region_growing_on_point_set_2.cpp b/Shape_detection/examples/Shape_detection/region_growing_on_point_set_2.cpp index a7359da29ee..a5c34a74897 100644 --- a/Shape_detection/examples/Shape_detection/region_growing_on_point_set_2.cpp +++ b/Shape_detection/examples/Shape_detection/region_growing_on_point_set_2.cpp @@ -55,7 +55,7 @@ namespace CGAL { std::ostream& operator()(std::ostream& out) const { - if (is_ascii(out)) + if (IO::is_ascii(out)) out << int(c[0]) << " " << int(c[1]) << " " << int(c[2]); else out.write(reinterpret_cast(&c), sizeof(c)); @@ -78,7 +78,7 @@ int main(int argc, char *argv[]) { // Load xyz data either from a local folder or a user-provided file. std::ifstream in(argc > 1 ? argv[1] : "data/point_set_2.xyz"); - CGAL::set_ascii_mode(in); + CGAL::IO::set_ascii_mode(in); if (!in) { std::cout << @@ -161,8 +161,8 @@ int main(int argc, char *argv[]) { std::ofstream out(fullpath); - CGAL::set_ascii_mode(out); - CGAL::write_PLY_with_properties( + CGAL::IO::set_ascii_mode(out); + CGAL::IO::write_PLY_with_properties( out, pwc, CGAL::make_ply_point_writer(PLY_Point_map()), std::make_tuple( diff --git a/Shape_detection/examples/Shape_detection/region_growing_on_point_set_3.cpp b/Shape_detection/examples/Shape_detection/region_growing_on_point_set_3.cpp index 10b6a9ab006..cea02376e11 100644 --- a/Shape_detection/examples/Shape_detection/region_growing_on_point_set_3.cpp +++ b/Shape_detection/examples/Shape_detection/region_growing_on_point_set_3.cpp @@ -109,7 +109,7 @@ int main(int argc, char *argv[]) { // Load xyz data either from a local folder or a user-provided file. std::ifstream in(argc > 1 ? argv[1] : "data/point_set_3.xyz"); - CGAL::set_ascii_mode(in); + CGAL::IO::set_ascii_mode(in); if (!in) { std::cout << diff --git a/Shape_detection/examples/Shape_detection/region_growing_on_polygon_mesh.cpp b/Shape_detection/examples/Shape_detection/region_growing_on_polygon_mesh.cpp index 9fd7ff44639..152b8826889 100644 --- a/Shape_detection/examples/Shape_detection/region_growing_on_polygon_mesh.cpp +++ b/Shape_detection/examples/Shape_detection/region_growing_on_polygon_mesh.cpp @@ -25,7 +25,7 @@ using Kernel = CGAL::Exact_predicates_exact_constructions_kernel; using FT = typename Kernel::FT; using Point_3 = typename Kernel::Point_3; -using Color = CGAL::Color; +using Color = CGAL::IO::Color; // Choose the type of a container for a polygon mesh. #define USE_SURFACE_MESH @@ -65,7 +65,7 @@ int main(int argc, char *argv[]) { // Load off data either from a local folder or a user-provided file. std::ifstream in(argc > 1 ? argv[1] : "data/polygon_mesh.off"); - CGAL::set_ascii_mode(in); + CGAL::IO::set_ascii_mode(in); if (!in) { std::cout << diff --git a/Shape_detection/examples/Shape_detection/shape_detection_basic_deprecated.cpp b/Shape_detection/examples/Shape_detection/shape_detection_basic_deprecated.cpp index 531709d4ec5..a134f355f0b 100644 --- a/Shape_detection/examples/Shape_detection/shape_detection_basic_deprecated.cpp +++ b/Shape_detection/examples/Shape_detection/shape_detection_basic_deprecated.cpp @@ -41,10 +41,10 @@ int run(const char* filename) { // read_points takes an OutputIterator for storing the points // and a property map to store the normal vector with each point. - if (!CGAL::read_points(filename, - std::back_inserter(points), - CGAL::parameters::point_map(Point_map()). - normal_map(Normal_map()))) { + if (!CGAL::IO::read_points(filename, + std::back_inserter(points), + CGAL::parameters::point_map(Point_map()). + normal_map(Normal_map()))) { std::cout << "Error: cannot read the file cube.pwn" << std::endl; return EXIT_FAILURE; diff --git a/Shape_detection/test/Shape_detection/test_efficient_RANSAC_scene.cpp b/Shape_detection/test/Shape_detection/test_efficient_RANSAC_scene.cpp index ff2e341b93d..d46cffbaa61 100644 --- a/Shape_detection/test/Shape_detection/test_efficient_RANSAC_scene.cpp +++ b/Shape_detection/test/Shape_detection/test_efficient_RANSAC_scene.cpp @@ -36,7 +36,7 @@ bool test_scene(int argc, char** argv) { // and a property map to store the normal vector with each point. const char* filename = (argc > 1) ? argv[1] : "data/cube.pwn"; - if (!CGAL::read_points(filename, std::back_inserter(points), + if (!CGAL::IO::read_points(filename, std::back_inserter(points), CGAL::parameters::point_map(Point_map()) .normal_map(Normal_map()))) { diff --git a/Shape_detection/test/Shape_detection/test_region_growing_basic.cpp b/Shape_detection/test/Shape_detection/test_region_growing_basic.cpp index ddb88052d49..0a91ffefc76 100644 --- a/Shape_detection/test/Shape_detection/test_region_growing_basic.cpp +++ b/Shape_detection/test/Shape_detection/test_region_growing_basic.cpp @@ -35,7 +35,7 @@ int main(int argc, char *argv[]) { // Load data. std::ifstream in(argc > 1 ? argv[1] : "data/point_set_2.xyz"); - CGAL::set_ascii_mode(in); + CGAL::IO::set_ascii_mode(in); if (!in) { std::cout << diff --git a/Shape_detection/test/Shape_detection/test_region_growing_on_cube.cpp b/Shape_detection/test/Shape_detection/test_region_growing_on_cube.cpp index b91d80fdaec..e3ea45870ad 100644 --- a/Shape_detection/test/Shape_detection/test_region_growing_on_cube.cpp +++ b/Shape_detection/test/Shape_detection/test_region_growing_on_cube.cpp @@ -40,7 +40,7 @@ bool test_region_growing_on_cube(int argc, char *argv[]) { // Load data. std::ifstream in(argc > 1 ? argv[1] : "data/cube.off"); - CGAL::set_ascii_mode(in); + CGAL::IO::set_ascii_mode(in); if (!in) { std::cout << diff --git a/Shape_detection/test/Shape_detection/test_region_growing_on_degenerated_mesh.cpp b/Shape_detection/test/Shape_detection/test_region_growing_on_degenerated_mesh.cpp index 70fddd80347..155db88d445 100644 --- a/Shape_detection/test/Shape_detection/test_region_growing_on_degenerated_mesh.cpp +++ b/Shape_detection/test/Shape_detection/test_region_growing_on_degenerated_mesh.cpp @@ -39,7 +39,7 @@ bool test_region_growing_on_degenerated_mesh(int argc, char *argv[]) { // Load data. std::ifstream in(argc > 1 ? argv[1] : "data/degenerated.off"); - CGAL::set_ascii_mode(in); + CGAL::IO::set_ascii_mode(in); if (!in) { std::cout << diff --git a/Shape_detection/test/Shape_detection/test_region_growing_on_point_set_2.cpp b/Shape_detection/test/Shape_detection/test_region_growing_on_point_set_2.cpp index e43ec1d60d0..ec1061d85cd 100644 --- a/Shape_detection/test/Shape_detection/test_region_growing_on_point_set_2.cpp +++ b/Shape_detection/test/Shape_detection/test_region_growing_on_point_set_2.cpp @@ -44,7 +44,7 @@ bool test_region_growing_on_point_set_2(int argc, char *argv[]) { // Load data. std::ifstream in(argc > 1 ? argv[1] : "data/point_set_2.xyz"); - CGAL::set_ascii_mode(in); + CGAL::IO::set_ascii_mode(in); if (!in) { std::cout << diff --git a/Shape_detection/test/Shape_detection/test_region_growing_on_point_set_2_with_sorting.cpp b/Shape_detection/test/Shape_detection/test_region_growing_on_point_set_2_with_sorting.cpp index 27bf5584907..902e3f9b9a0 100644 --- a/Shape_detection/test/Shape_detection/test_region_growing_on_point_set_2_with_sorting.cpp +++ b/Shape_detection/test/Shape_detection/test_region_growing_on_point_set_2_with_sorting.cpp @@ -39,7 +39,7 @@ int main(int argc, char *argv[]) { // Load data. std::ifstream in(argc > 1 ? argv[1] : "data/point_set_2.xyz"); - CGAL::set_ascii_mode(in); + CGAL::IO::set_ascii_mode(in); if (!in) { std::cout << diff --git a/Shape_detection/test/Shape_detection/test_region_growing_on_point_set_3.cpp b/Shape_detection/test/Shape_detection/test_region_growing_on_point_set_3.cpp index 95a49104927..b8b2e804b9a 100644 --- a/Shape_detection/test/Shape_detection/test_region_growing_on_point_set_3.cpp +++ b/Shape_detection/test/Shape_detection/test_region_growing_on_point_set_3.cpp @@ -43,7 +43,7 @@ bool test_region_growing_on_point_set_3(int argc, char *argv[]) { // Load data. std::ifstream in(argc > 1 ? argv[1] : "data/point_set_3.xyz"); - CGAL::set_ascii_mode(in); + CGAL::IO::set_ascii_mode(in); if (!in) { std::cout << diff --git a/Shape_detection/test/Shape_detection/test_region_growing_on_point_set_3_with_sorting.cpp b/Shape_detection/test/Shape_detection/test_region_growing_on_point_set_3_with_sorting.cpp index 8b23d9acc50..029a7072dd7 100644 --- a/Shape_detection/test/Shape_detection/test_region_growing_on_point_set_3_with_sorting.cpp +++ b/Shape_detection/test/Shape_detection/test_region_growing_on_point_set_3_with_sorting.cpp @@ -39,7 +39,7 @@ int main(int argc, char *argv[]) { // Load data. std::ifstream in(argc > 1 ? argv[1] : "data/point_set_3.xyz"); - CGAL::set_ascii_mode(in); + CGAL::IO::set_ascii_mode(in); if (!in) { std::cout << diff --git a/Shape_detection/test/Shape_detection/test_region_growing_on_polygon_mesh.cpp b/Shape_detection/test/Shape_detection/test_region_growing_on_polygon_mesh.cpp index c3e6142f6f9..e7cf528ef18 100644 --- a/Shape_detection/test/Shape_detection/test_region_growing_on_polygon_mesh.cpp +++ b/Shape_detection/test/Shape_detection/test_region_growing_on_polygon_mesh.cpp @@ -38,7 +38,7 @@ bool test_region_growing_on_polygon_mesh(int argc, char *argv[]) { // Load data. std::ifstream in(argc > 1 ? argv[1] : "data/polygon_mesh.off"); - CGAL::set_ascii_mode(in); + CGAL::IO::set_ascii_mode(in); if (!in) { std::cout << diff --git a/Shape_detection/test/Shape_detection/test_region_growing_on_polygon_mesh_with_sorting.cpp b/Shape_detection/test/Shape_detection/test_region_growing_on_polygon_mesh_with_sorting.cpp index 44e457460af..ff8b20ccae9 100644 --- a/Shape_detection/test/Shape_detection/test_region_growing_on_polygon_mesh_with_sorting.cpp +++ b/Shape_detection/test/Shape_detection/test_region_growing_on_polygon_mesh_with_sorting.cpp @@ -36,7 +36,7 @@ int main(int argc, char *argv[]) { // Load data. std::ifstream in(argc > 1 ? argv[1] : "data/polygon_mesh.off"); - CGAL::set_ascii_mode(in); + CGAL::IO::set_ascii_mode(in); if (!in) { std::cout << diff --git a/Shape_detection/test/Shape_detection/test_validity_sampled_data.cpp b/Shape_detection/test/Shape_detection/test_validity_sampled_data.cpp index eccb69cd07d..e13aae67dfc 100644 --- a/Shape_detection/test/Shape_detection/test_validity_sampled_data.cpp +++ b/Shape_detection/test/Shape_detection/test_validity_sampled_data.cpp @@ -49,7 +49,7 @@ int main (int argc, char** argv) std::ifstream ifile(ifilename); if (!ifile || - !CGAL::read_XYZ( + !CGAL::IO::read_XYZ( ifile, std::back_inserter(points), CGAL::parameters::point_map(Point_map()). diff --git a/Skin_surface_3/include/CGAL/Skin_surface_base_3.h b/Skin_surface_3/include/CGAL/Skin_surface_base_3.h index 108b8ff2b25..836671a496b 100644 --- a/Skin_surface_3/include/CGAL/Skin_surface_base_3.h +++ b/Skin_surface_3/include/CGAL/Skin_surface_base_3.h @@ -24,7 +24,7 @@ #include #include #include -#include +#include // Used for the triangulated mixed complex / Voronoi diagram #include @@ -93,7 +93,7 @@ private: public: typedef Anchor_point Vertex_info; - typedef std::pair > Cell_info; + typedef std::pair > Cell_info; private: // Triangulated_mixed_complex: diff --git a/Skin_surface_3/include/CGAL/Triangulated_mixed_complex_observer_3.h b/Skin_surface_3/include/CGAL/Triangulated_mixed_complex_observer_3.h index baf74b7e19c..c519448c672 100644 --- a/Skin_surface_3/include/CGAL/Triangulated_mixed_complex_observer_3.h +++ b/Skin_surface_3/include/CGAL/Triangulated_mixed_complex_observer_3.h @@ -18,7 +18,7 @@ #include #include -#include +#include namespace CGAL { @@ -163,7 +163,7 @@ public: FT shrink; Rt_Simplex prev_s; - boost::shared_ptr surf; + std::shared_ptr surf; // c is the center of the orthogonal sphere // w is the weight of the orthogonal sphere @@ -179,14 +179,14 @@ public: Q[1] = Q[3] = Q[4] = 0; Q[0] = Q[2] = Q[5] = orient; - surf = boost::shared_ptr(new Quadratic_surface(Q, c, s*w, (orient==1? 0 : 3))); + surf = std::shared_ptr(new Quadratic_surface(Q, c, s*w, (orient==1? 0 : 3))); } else { // Multiply with 1-s to make the function defining the // skin surface implicitly continuous Q[1] = Q[3] = Q[4] = 0; Q[0] = Q[2] = Q[5] = orient*(1-s); - surf = boost::shared_ptr(new Quadratic_surface(Q, c, s*(1-s)*w, (orient==1? 0 : 3))); + surf = std::shared_ptr(new Quadratic_surface(Q, c, s*(1-s)*w, (orient==1? 0 : 3))); } } @@ -207,7 +207,7 @@ public: Q[4] = orient*(-2*t.z()*t.y()/den); Q[5] = orient*(- t.z()*t.z()/den + (1-s)); - surf = boost::shared_ptr(new Quadratic_surface(Q, c, s*(1-s)*w, (orient==1? 1 : 2))); + surf = std::shared_ptr(new Quadratic_surface(Q, c, s*(1-s)*w, (orient==1? 1 : 2))); } Surface_RT Q[6]; diff --git a/Solver_interface/include/CGAL/Eigen_solver_traits.h b/Solver_interface/include/CGAL/Eigen_solver_traits.h index ecedf0ed89b..c7efdfda81d 100644 --- a/Solver_interface/include/CGAL/Eigen_solver_traits.h +++ b/Solver_interface/include/CGAL/Eigen_solver_traits.h @@ -29,7 +29,7 @@ #include #include -#include +#include namespace CGAL { namespace internal { @@ -226,7 +226,7 @@ public: protected: const typename Matrix::EigenType* m_mat; - boost::shared_ptr m_solver_sptr; + std::shared_ptr m_solver_sptr; }; // Specialization of the solver for BiCGSTAB as for surface parameterization, @@ -275,7 +275,7 @@ public: } protected: - boost::shared_ptr m_solver_sptr; + std::shared_ptr m_solver_sptr; }; } // namespace CGAL diff --git a/Spatial_searching/benchmark/Spatial_searching/binary.cpp b/Spatial_searching/benchmark/Spatial_searching/binary.cpp index 00ec5cc97ad..fa04ed04b2c 100644 --- a/Spatial_searching/benchmark/Spatial_searching/binary.cpp +++ b/Spatial_searching/benchmark/Spatial_searching/binary.cpp @@ -20,7 +20,7 @@ int main(int argc, char* argv[]) std::ifstream ascii(argv[1]); ascii >> d >> N; std::ofstream binary(argv[2], std::ios::out | std::ios::binary); - CGAL::set_binary_mode(binary); + CGAL::IO::set_binary_mode(binary); CGAL::write(binary, d); CGAL::write(binary, N); for(int i=0; i < N; i++){ @@ -36,8 +36,8 @@ int main(int argc, char* argv[]) std::ifstream binary(argv[1], std::ios::in | std::ios::binary); std::ofstream bbox(argv[2], std::ios::out | std::ios::binary); - CGAL::set_binary_mode(binary); - CGAL::set_binary_mode(bbox); + CGAL::IO::set_binary_mode(binary); + CGAL::IO::set_binary_mode(bbox); CGAL::read(binary,d); CGAL::read(binary,N); CGAL::write(bbox, d); @@ -74,7 +74,7 @@ int main(int argc, char* argv[]) std::ifstream binary(argv[1], std::ios::in | std::ios::binary); std::ofstream ascii(argv[2]); - CGAL::set_binary_mode(binary); + CGAL::IO::set_binary_mode(binary); CGAL::read(binary,d); CGAL::read(binary,N); ascii << d << std::endl << N << std::endl; diff --git a/Spatial_searching/benchmark/Spatial_searching/nn3cgal.cpp b/Spatial_searching/benchmark/Spatial_searching/nn3cgal.cpp index 5df37fe8632..58fba65de4d 100644 --- a/Spatial_searching/benchmark/Spatial_searching/nn3cgal.cpp +++ b/Spatial_searching/benchmark/Spatial_searching/nn3cgal.cpp @@ -39,7 +39,7 @@ void read(Points& points, char* argv) #else std::ifstream data(argv, std::ios::in | std::ios::binary); - CGAL::set_binary_mode(data); + CGAL::IO::set_binary_mode(data); CGAL::read(data,d); CGAL::read(data,n); diff --git a/Spatial_searching/benchmark/Spatial_searching/nn3nanoflan.cpp b/Spatial_searching/benchmark/Spatial_searching/nn3nanoflan.cpp index a2510e2187b..63da87f0128 100644 --- a/Spatial_searching/benchmark/Spatial_searching/nn3nanoflan.cpp +++ b/Spatial_searching/benchmark/Spatial_searching/nn3nanoflan.cpp @@ -90,7 +90,7 @@ void kdtree_demo(int argc, char** argv) // Generate points: std::ifstream input(argv[1], std::ios::in | std::ios::binary); - CGAL::set_binary_mode(input); + CGAL::IO::set_binary_mode(input); // input >> n >> n; // dimension and # of points CGAL::read(input,n); CGAL::read(input,n); @@ -98,7 +98,7 @@ void kdtree_demo(int argc, char** argv) std::vector > queries; std::ifstream queries_stream(argv[2], std::ios::in | std::ios::binary); - CGAL::set_binary_mode(queries_stream); + CGAL::IO::set_binary_mode(queries_stream); CGAL::read(queries_stream,n); CGAL::read(queries_stream,n); // queries_stream >> n >> n; diff --git a/Spatial_searching/examples/Spatial_searching/searching_surface_mesh_vertices.cpp b/Spatial_searching/examples/Spatial_searching/searching_surface_mesh_vertices.cpp index b9faabfeb64..b377bf083ec 100644 --- a/Spatial_searching/examples/Spatial_searching/searching_surface_mesh_vertices.cpp +++ b/Spatial_searching/examples/Spatial_searching/searching_surface_mesh_vertices.cpp @@ -28,7 +28,7 @@ int main(int argc, char* argv[]) const char* filename = (argc>1) ? argv[1] : "data/tripod.off"; Mesh mesh; - if(!CGAL::read_polygon_mesh(filename, mesh)) + if(!CGAL::IO::read_polygon_mesh(filename, mesh)) { std::cerr << "Invalid input." << std::endl; return 1; diff --git a/Spatial_searching/include/CGAL/Manhattan_distance_iso_box_point.h b/Spatial_searching/include/CGAL/Manhattan_distance_iso_box_point.h index 16ffe439eaa..cd348d178e3 100644 --- a/Spatial_searching/include/CGAL/Manhattan_distance_iso_box_point.h +++ b/Spatial_searching/include/CGAL/Manhattan_distance_iso_box_point.h @@ -17,7 +17,6 @@ #include -#include #include #include #include diff --git a/Spatial_searching/include/CGAL/Search_traits_adapter.h b/Spatial_searching/include/CGAL/Search_traits_adapter.h index d3c6b49fd60..7fc4c174572 100644 --- a/Spatial_searching/include/CGAL/Search_traits_adapter.h +++ b/Spatial_searching/include/CGAL/Search_traits_adapter.h @@ -142,7 +142,7 @@ public: typedef typename boost::property_traits::value_type Point; - boost::shared_ptr point; + std::shared_ptr point; std::size_t idx; public: @@ -157,18 +157,18 @@ public: void increment() { ++idx; - CGAL_assertion(point != boost::shared_ptr()); + CGAL_assertion(point != std::shared_ptr()); } void decrement() { --idx; - CGAL_assertion(point != boost::shared_ptr()); + CGAL_assertion(point != std::shared_ptr()); } void advance(std::ptrdiff_t n) { idx += n; - CGAL_assertion(point != boost::shared_ptr()); + CGAL_assertion(point != std::shared_ptr()); } std::ptrdiff_t distance_to(const No_lvalue_iterator& other) const diff --git a/Straight_skeleton_2/include/CGAL/IO/Dxf_stream.h b/Straight_skeleton_2/include/CGAL/IO/Dxf_stream.h index 78a29f7f1d3..ed0dceb3efe 100644 --- a/Straight_skeleton_2/include/CGAL/IO/Dxf_stream.h +++ b/Straight_skeleton_2/include/CGAL/IO/Dxf_stream.h @@ -63,23 +63,23 @@ protected: Dxf_writer mWriter ; int mDefaultDxfColor; int mDxfColor; - Color mCgalColor ; + IO::Color mCgalColor ; std::string mLayer ; struct Color_less { - bool operator() ( Color const& a, Color const& b ) const + bool operator() ( IO::Color const& a, IO::Color const& b ) const { return Color_value(a) < Color_value(b); } - static int Color_value ( Color const& c ) + static int Color_value ( IO::Color const& c ) { return ( int(c.r()) << 16 ) + ( int(c.g()) << 8 ) + ( int(c.b()) ) ; } } ; - typedef std::map Color_table ; + typedef std::map Color_table ; typedef typename Color_table::const_iterator Color_table_iterator ; Color_table mColorTable ; @@ -103,7 +103,7 @@ public: mWriter (out) ,mDefaultDxfColor (255) ,mDxfColor (255) - ,mCgalColor (white()) + ,mCgalColor (IO::white()) ,mLayer ("0") { setup_initial_color_table(); @@ -126,7 +126,7 @@ public: /*! * Get the current CGAL color. */ - Color color () const { return mCgalColor ; } + IO::Color color () const { return mCgalColor ; } /*! * Get the current DXF color. @@ -152,7 +152,7 @@ public: * Set the current color. * \pre The color must be defined. */ - void set_color ( Color aColor ) + void set_color ( IO::Color aColor ) { mCgalColor = aColor ; @@ -177,7 +177,7 @@ public: * \param aCgalColor The CGAL color. * \param aDxfColor The DXF color. */ - void define_color ( Color const& aCgalColor, int aDxfColor ) + void define_color ( IO::Color const& aCgalColor, int aDxfColor ) { mColorTable.insert( std::make_pair(aCgalColor,aDxfColor) ) ; } @@ -265,7 +265,7 @@ public: /*! * Set the current color. */ - Dxf_stream& operator<< ( Color const& aColor ) + Dxf_stream& operator<< ( IO::Color const& aColor ) { set_color (aColor); return (*this); @@ -300,15 +300,15 @@ protected: void setup_initial_color_table() { - define_color(black(),0); - define_color(red(),1); - define_color(yellow(),2); - define_color(green(),3); - define_color(purple(),4); - define_color(blue(),5); - define_color(violet(),6); - define_color(white(),7); - define_color(gray(),8); + define_color(IO::black(),0); + define_color(IO::red(),1); + define_color(IO::yellow(),2); + define_color(IO::green(),3); + define_color(IO::purple(),4); + define_color(IO::blue(),5); + define_color(IO::violet(),6); + define_color(IO::white(),7); + define_color(IO::gray(),8); } }; diff --git a/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/Straight_skeleton_aux.h b/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/Straight_skeleton_aux.h index 7e642e8b10b..e22b0bbe422 100644 --- a/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/Straight_skeleton_aux.h +++ b/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/Straight_skeleton_aux.h @@ -164,7 +164,7 @@ private: Ref_counted_base& operator=( Ref_counted_base const &); protected: Ref_counted_base(): mCount(0) {} - virtual ~Ref_counted_base() CGAL_NOEXCEPT(CGAL_NO_ASSERTIONS_BOOL) {} + virtual ~Ref_counted_base() noexcept(!CGAL_ASSERTIONS_ENABLED) {} public: void AddRef() const { ++mCount; } void Release() const diff --git a/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h b/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h index 02956b3d686..8bf2a8bf393 100644 --- a/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h +++ b/Straight_skeleton_2/include/CGAL/draw_straight_skeleton_2.h @@ -28,7 +28,7 @@ namespace CGAL { struct DefaultColorFunctorSS2 { template - static CGAL::Color run(const SS2&, + static CGAL::IO::Color run(const SS2&, const typename SS2::Finite_faces_iterator fh) { CGAL::Random random((unsigned int)(std::size_t)(&*fh)); @@ -65,7 +65,7 @@ protected: /* void compute_face(Facet_const_handle fh) { - CGAL::Color c=m_fcolor.run(ss2, fh); + CGAL::IO::Color c=m_fcolor.run(ss2, fh); face_begin(c); add_point_in_face(fh->vertex(0)->point()); @@ -78,9 +78,9 @@ protected: void compute_edge(Halfedge_const_handle eh) { if(eh->is_bisector()) - add_segment(eh->opposite()->vertex()->point(), eh->vertex()->point(), CGAL::red()); + add_segment(eh->opposite()->vertex()->point(), eh->vertex()->point(), CGAL::IO::red()); else - add_segment(eh->opposite()->vertex()->point(), eh->vertex()->point(), CGAL::black()); + add_segment(eh->opposite()->vertex()->point(), eh->vertex()->point(), CGAL::IO::black()); } void print_halfedge_labels(Halfedge_const_handle h) { @@ -93,11 +93,11 @@ protected: void compute_vertex(Vertex_const_handle vh) { if(vh->is_split()) - add_point(vh->point(), CGAL::Color(10,10,180)); // blue, but not flashy + add_point(vh->point(), CGAL::IO::Color(10,10,180)); // blue, but not flashy else if(vh->has_infinite_time()) - add_point(vh->point(), CGAL::orange()); + add_point(vh->point(), CGAL::IO::orange()); else - add_point(vh->point(), CGAL::Color(10,180,10)); // green, but not flashy + add_point(vh->point(), CGAL::IO::Color(10,180,10)); // green, but not flashy } void print_vertex_label(Vertex_const_handle vh) { diff --git a/Straight_skeleton_2/test/Straight_skeleton_2/test_sls.cpp b/Straight_skeleton_2/test/Straight_skeleton_2/test_sls.cpp index 6cf6dbb2f7d..709158ffbc2 100644 --- a/Straight_skeleton_2/test/Straight_skeleton_2/test_sls.cpp +++ b/Straight_skeleton_2/test/Straight_skeleton_2/test_sls.cpp @@ -121,6 +121,7 @@ typedef CGAL::Dxf_stream DxfStream ; using namespace std ; using namespace CGAL ; +using namespace CGAL::IO ; inline string to_string( double n ) { ostringstream ss ; ss << n ; return ss.str(); } inline bool is_even ( int n ) { return n % 2 == 0 ; } @@ -222,7 +223,7 @@ IRegionPtr load_region( string file, int aShift, int& rStatus ) ifstream in(file.c_str()); if ( in ) { - CGAL::set_ascii_mode(in); + CGAL::IO::set_ascii_mode(in); rRegion = IRegionPtr( new IRegion() ) ; @@ -458,7 +459,7 @@ void dump_to_eps ( TestCase const& aCase ) } template -void dump_polygon_to_dxf( Polygon const& aPolygon, Color aColor, string aLayer, DxfStream& rDXF ) +void dump_polygon_to_dxf( Polygon const& aPolygon, IO::Color aColor, string aLayer, DxfStream& rDXF ) { rDXF << aColor << Dxf_layer(aLayer) ; @@ -467,7 +468,7 @@ void dump_polygon_to_dxf( Polygon const& aPolygon, Color aColor, string aLayer, template -void dump_region_to_dxf( Region const& aRegion, Color aColor, string aBaseLayer, DxfStream& rDXF ) +void dump_region_to_dxf( Region const& aRegion, IO::Color aColor, string aBaseLayer, DxfStream& rDXF ) { int lN = 0 ; for ( typename Region::const_iterator bit = aRegion.begin() ; bit != aRegion.end() ; ++ bit ) @@ -480,10 +481,10 @@ void dump_region_to_dxf( Region const& aRegion, Color aColor, string aBaseLayer, } void dump_skeleton_to_dxf( ISls const& aSkeleton - , Color aContourBisectorColor - , Color aSkeletonBisectorColor - , Color aPeakBisectorColor - , Color /*aInfiniteBisectorColor*/ + , IO::Color aContourBisectorColor + , IO::Color aSkeletonBisectorColor + , IO::Color aPeakBisectorColor + , IO::Color /*aInfiniteBisectorColor*/ , string aLayer , DxfStream& rDXF ) diff --git a/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_offset.cpp b/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_offset.cpp index 240bc06ab49..0bbfd140895 100644 --- a/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_offset.cpp +++ b/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_offset.cpp @@ -833,7 +833,7 @@ void test_offset(const char* filename) std::ifstream in(filename); assert(in); - CGAL::set_ascii_mode(in); + CGAL::IO::set_ascii_mode(in); std::vector points; std::vector polys; diff --git a/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_simple.cpp b/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_simple.cpp index 3153eae74e4..4bddf279d39 100644 --- a/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_simple.cpp +++ b/Straight_skeleton_2/test/Straight_skeleton_2/test_sls_simple.cpp @@ -141,7 +141,7 @@ void test_skeleton(const char* filename, std::ifstream in(filename); assert(in); - CGAL::set_ascii_mode(in); + CGAL::IO::set_ascii_mode(in); std::vector polys; diff --git a/Stream_lines_2/include/CGAL/Regular_grid_2.h b/Stream_lines_2/include/CGAL/Regular_grid_2.h index 4cce300d35a..57b69a00e41 100644 --- a/Stream_lines_2/include/CGAL/Regular_grid_2.h +++ b/Stream_lines_2/include/CGAL/Regular_grid_2.h @@ -19,7 +19,7 @@ #include #include -#include +#include #include @@ -39,7 +39,7 @@ public: typedef typename StreamLinesTraits_2::Point_2 Point_2; typedef typename StreamLinesTraits_2::Vector_2 Vector_2; protected: - boost::shared_ptr< std::vector > vector_field; + std::shared_ptr< std::vector > vector_field; inline int get_index(int i,int j) const; int number_of_samples_x; int number_of_samples_y; @@ -118,7 +118,7 @@ Regular_grid_2::Regular_grid_2(int m, number_of_samples_y = n; domain_size_x = x; domain_size_y = y; - vector_field = boost::shared_ptr >(new std::vector(number_of_samples_x*number_of_samples_y* 2)); + vector_field = std::shared_ptr >(new std::vector(number_of_samples_x*number_of_samples_y* 2)); } diff --git a/Stream_lines_2/include/CGAL/Stream_lines_2.h b/Stream_lines_2/include/CGAL/Stream_lines_2.h index 25458c7aa08..a000bbf684f 100644 --- a/Stream_lines_2/include/CGAL/Stream_lines_2.h +++ b/Stream_lines_2/include/CGAL/Stream_lines_2.h @@ -32,7 +32,7 @@ #include // undocumented class #include #include -#include +#include namespace CGAL { @@ -96,8 +96,8 @@ protected: Point_2 seed_point; int samp_step; unsigned int _number_of_lines; - boost::shared_ptr vf_2; - boost::shared_ptr int_2; + std::shared_ptr vf_2; + std::shared_ptr int_2; public: void set_separating_distance(FT new_value){separating_distance = new_value;} void set_saturation_ratio(FT new_value){ saturation_ratio = new_value;} @@ -241,8 +241,8 @@ vector_field_2, const Integrator_2 & m_integrator, const FT & m_separating_dista m_DT.insert(pPoint); } _number_of_lines = 0; - vf_2 = boost::shared_ptr(new Vector_field_2(vector_field_2)); - int_2 = boost::shared_ptr(new Integrator_2(m_integrator)); + vf_2 = std::shared_ptr(new Vector_field_2(vector_field_2)); + int_2 = std::shared_ptr(new Integrator_2(m_integrator)); samp_step = sampling_step; stl_container.clear(); place_stream_lines(vector_field_2, m_integrator, diff --git a/Stream_support/benchmark/Stream_support/read_doubles.cpp b/Stream_support/benchmark/Stream_support/read_doubles.cpp index ce14a76f97e..52014f67637 100644 --- a/Stream_support/benchmark/Stream_support/read_doubles.cpp +++ b/Stream_support/benchmark/Stream_support/read_doubles.cpp @@ -76,7 +76,7 @@ int main(int argc, char* argv[]) std::cerr << "iformat"<< std::endl; t.start(); for(int i=0; i> CGAL::iformat(d); + in >> CGAL::IO::iformat(d); sum+= d; } t.stop(); diff --git a/Stream_support/doc/Stream_support/File_formats/Supported_file_formats.txt b/Stream_support/doc/Stream_support/File_formats/Supported_file_formats.txt index d0644f0d513..a29b2c915be 100644 --- a/Stream_support/doc/Stream_support/File_formats/Supported_file_formats.txt +++ b/Stream_support/doc/Stream_support/File_formats/Supported_file_formats.txt @@ -43,62 +43,62 @@ The following table lists some \cgal data structures that have I/O functions com Input Polygon Mesh `CGAL::Surface_mesh` - \link PkgSurfaceMeshIOFuncOFF CGAL::read_OFF(const char*, CGAL::Surface_mesh&)\endlink + \link PkgSurfaceMeshIOFuncOFF CGAL::IO::read_OFF(const char*, CGAL::Surface_mesh&)\endlink `CGAL::Polyhedron_3` - \link PkgPolyhedronIOFunc CGAL::read_OFF(const char*, CGAL::Polyhedron_3&)\endlink + \link PkgPolyhedronIOFunc CGAL::IO::read_OFF(const char*, CGAL::Polyhedron_3&)\endlink Any model of `MutableFaceGraph` - \link PkgBGLIoFuncsOFF CGAL::read_OFF(const char*, Graph&)\endlink + \link PkgBGLIoFuncsOFF CGAL::IO::read_OFF(const char*, Graph&)\endlink Point Set `CGAL::Point_set_3` - \link PkgPointSet3IOOFF CGAL::read_OFF(const char*, CGAL::Point_set_3&)\endlink + \link PkgPointSet3IOOFF CGAL::IO::read_OFF(const char*, CGAL::Point_set_3&)\endlink Any point range - \link PkgPointSetProcessing3IOOff CGAL::read_OFF(const char*, PointRange&)\endlink + \link PkgPointSetProcessing3IOOff CGAL::IO::read_OFF(const char*, PointRange&)\endlink Polygon Soup Any point + polygon range - \link PkgStreamSupportIoFuncsOFF CGAL::read_OFF(const char*, PointRange&, PolygonRange&)\endlink + \link PkgStreamSupportIoFuncsOFF CGAL::IO::read_OFF(const char*, PointRange&, PolygonRange&)\endlink Output Polygon Mesh `CGAL::Surface_mesh` - \link PkgSurfaceMeshIOFuncOFF CGAL::write_OFF(const char*, CGAL::Surface_mesh&)\endlink + \link PkgSurfaceMeshIOFuncOFF CGAL::IO::write_OFF(const char*, CGAL::Surface_mesh&)\endlink `CGAL::Polyhedron_3` - \link PkgPolyhedronIOFunc CGAL::write_OFF(const char*, CGAL::Polyhedron_3&)\endlink + \link PkgPolyhedronIOFunc CGAL::IO::write_OFF(const char*, CGAL::Polyhedron_3&)\endlink Any model of `FaceGraph` - \link PkgBGLIoFuncsOFF CGAL::write_OFF(const char*, Graph&)\endlink + \link PkgBGLIoFuncsOFF CGAL::IO::write_OFF(const char*, Graph&)\endlink Point Set `CGAL::Point_set_3` - \link PkgPointSet3IOOFF CGAL::write_OFF(const char*, CGAL::Point_set_3&)\endlink + \link PkgPointSet3IOOFF CGAL::IO::write_OFF(const char*, CGAL::Point_set_3&)\endlink Any point range - \link PkgPointSetProcessing3IOOff CGAL::write_OFF(const char*, PointRange&)\endlink + \link PkgPointSetProcessing3IOOff CGAL::IO::write_OFF(const char*, PointRange&)\endlink Polygon Soup Any point + polygon range - \link PkgStreamSupportIoFuncsOFF CGAL::write_OFF(const char*, PointRange&, PolygonRange&)\endlink + \link PkgStreamSupportIoFuncsOFF CGAL::IO::write_OFF(const char*, PointRange&, PolygonRange&)\endlink If the data of a polygon mesh cannot be read in a `FaceGraph` due to bad orientation or -manifoldness issues, consider using \link PMP_IO_grp `CGAL::Polygon_mesh_processing::read_polygon_mesh()` \endlink, +manifoldness issues, consider using \link PMP_IO_grp `CGAL::Polygon_mesh_processing::IO::read_polygon_mesh()` \endlink, which offers combinatorial repairing while reading bad inputs. @@ -117,28 +117,28 @@ A precise specification of the format is available Input Polygon Mesh Any model of `MutableFaceGraph` - \link PkgBGLIoFuncsOBJ CGAL::read_OBJ(const char*, Graph&)\endlink + \link PkgBGLIoFuncsOBJ CGAL::IO::read_OBJ(const char*, Graph&)\endlink Polygon Soup Any point + polygon range - \link PkgStreamSupportIoFuncsOBJ CGAL::read_OBJ(const char*, PointRange&, PolygonRange&)\endlink + \link PkgStreamSupportIoFuncsOBJ CGAL::IO::read_OBJ(const char*, PointRange&, PolygonRange&)\endlink Output Polygon Mesh Any model of `FaceGraph` - \link PkgBGLIoFuncsOBJ CGAL::write_OBJ(const char*, Graph&)\endlink + \link PkgBGLIoFuncsOBJ CGAL::IO::write_OBJ(const char*, Graph&)\endlink Polygon Soup Any point + polygon range - \link PkgStreamSupportIoFuncsOBJ CGAL::write_OBJ(const char*, PointRange&, PolygonRange&)\endlink + \link PkgStreamSupportIoFuncsOBJ CGAL::IO::write_OBJ(const char*, PointRange&, PolygonRange&)\endlink If the data of a polygon mesh cannot be read in a `FaceGraph` due to bad orientation or -manifoldness issues, consider using \link PMP_IO_grp `CGAL::Polygon_mesh_processing::read_polygon_mesh()` \endlink, +manifoldness issues, consider using \link PMP_IO_grp `CGAL::Polygon_mesh_processing::IO::read_polygon_mesh()` \endlink, which offers combinatorial repairing while reading bad inputs. @@ -158,23 +158,23 @@ A precise specification of those formats is available Input Polygon Mesh Any model of `MutableFaceGraph` - \link PkgBGLIoFuncsSTL CGAL::read_STL(const char*, Graph&)\endlink + \link PkgBGLIoFuncsSTL CGAL::IO::read_STL(const char*, Graph&)\endlink Polygon Soup Any point + polygon range - \link PkgStreamSupportIoFuncsSTL CGAL::read_STL(const char*, PointRange&, TriangleRange&)\endlink + \link PkgStreamSupportIoFuncsSTL CGAL::IO::read_STL(const char*, PointRange&, TriangleRange&)\endlink Output Polygon Mesh Any model of `FaceGraph` - \link PkgBGLIoFuncsSTL CGAL::write_STL(const char*, Graph&)\endlink + \link PkgBGLIoFuncsSTL CGAL::IO::write_STL(const char*, Graph&)\endlink Polygon Soup Any point + polygon range - \link PkgStreamSupportIoFuncsSTL CGAL::write_STL(const char*, PointRange&, TriangleRange&)\endlink + \link PkgStreamSupportIoFuncsSTL CGAL::IO::write_STL(const char*, PointRange&, TriangleRange&)\endlink @@ -182,7 +182,7 @@ Note that the STL file format exports triangular faces as geometric triangles an combinatorial information is lost. If the data of a polygon mesh cannot be read in a `FaceGraph` due to bad orientation or -manifoldness issues, consider using \link PMP_IO_grp `CGAL::Polygon_mesh_processing::read_polygon_mesh()` \endlink, +manifoldness issues, consider using \link PMP_IO_grp `CGAL::Polygon_mesh_processing::IO::read_polygon_mesh()` \endlink, which offers combinatorial repairing while reading bad inputs. @@ -202,54 +202,54 @@ A precise specification of those formats is available Input Polygon Mesh `CGAL::Surface_mesh` - \link PkgSurfaceMeshIOFuncPLY CGAL::read_PLY(const char*, CGAL::Surface_mesh&)\endlink + \link PkgSurfaceMeshIOFuncPLY CGAL::IO::read_PLY(const char*, CGAL::Surface_mesh&)\endlink Any model of `MutableFaceGraph` - \link PkgBGLIoFuncsPLY CGAL::read_PLY(const char*, Graph&)\endlink + \link PkgBGLIoFuncsPLY CGAL::IO::read_PLY(const char*, Graph&)\endlink Point Set `CGAL::Point_set_3` - \link PkgPointSet3IOPLY CGAL::read_PLY(const char*, CGAL::Point_set_3&)\endlink + \link PkgPointSet3IOPLY CGAL::IO::read_PLY(const char*, CGAL::Point_set_3&)\endlink Any point range - \link PkgPointSetProcessing3IOPly CGAL::read_PLY(const char*, PointRange&)\endlink + \link PkgPointSetProcessing3IOPly CGAL::IO::read_PLY(const char*, PointRange&)\endlink Polygon Soup Any point + polygon range - \link PkgStreamSupportIoFuncsPLY CGAL::read_PLY(const char*, PointRange&, PolygonRange&)\endlink + \link PkgStreamSupportIoFuncsPLY CGAL::IO::read_PLY(const char*, PointRange&, PolygonRange&)\endlink Output Polygon Mesh `CGAL::Surface_mesh` - \link PkgSurfaceMeshIOFuncPLY CGAL::write_PLY(const char*, CGAL::Surface_mesh&)\endlink + \link PkgSurfaceMeshIOFuncPLY CGAL::IO::write_PLY(const char*, CGAL::Surface_mesh&)\endlink Any model of `FaceGraph` - \link PkgBGLIoFuncsPLY CGAL::write_PLY(const char*, Graph&)\endlink + \link PkgBGLIoFuncsPLY CGAL::IO::write_PLY(const char*, Graph&)\endlink Point Set `CGAL::Point_set_3` - \link PkgPointSet3IOPLY CGAL::write_PLY(const char*, CGAL::Point_set_3&)\endlink + \link PkgPointSet3IOPLY CGAL::IO::write_PLY(const char*, CGAL::Point_set_3&)\endlink Any point range - \link PkgPointSetProcessing3IOPly CGAL::write_PLY(const char*, PointRange&)\endlink + \link PkgPointSetProcessing3IOPly CGAL::IO::write_PLY(const char*, PointRange&)\endlink Polygon Soup Any point + polygon range - \link PkgStreamSupportIoFuncsPLY CGAL::write_PLY(const char*, PointRange&, PolygonRange&)\endlink + \link PkgStreamSupportIoFuncsPLY CGAL::IO::write_PLY(const char*, PointRange&, PolygonRange&)\endlink If the data of a polygon mesh cannot be read in a `FaceGraph` due to bad orientation or -manifoldness issues, consider using \link PMP_IO_grp `CGAL::Polygon_mesh_processing::read_polygon_mesh()` \endlink, +manifoldness issues, consider using \link PMP_IO_grp `CGAL::Polygon_mesh_processing::IO::read_polygon_mesh()` \endlink, which offers combinatorial repairing while reading bad inputs. @@ -270,21 +270,21 @@ A precise specification of those formats is available Input Point Set `CGAL::Point_set_3` - \link PkgPointSet3IOLAS CGAL::read_LAS(const char*, CGAL::Point_set_3&)\endlink + \link PkgPointSet3IOLAS CGAL::IO::read_LAS(const char*, CGAL::Point_set_3&)\endlink Any point range - \link PkgPointSetProcessing3IOLas CGAL::read_LAS(const char*, PointRange&)\endlink + \link PkgPointSetProcessing3IOLas CGAL::IO::read_LAS(const char*, PointRange&)\endlink Output Point Set `CGAL::Point_set_3` - \link PkgPointSet3IOLAS CGAL::write_LAS(const char*, CGAL::Point_set_3&)\endlink + \link PkgPointSet3IOLAS CGAL::IO::write_LAS(const char*, CGAL::Point_set_3&)\endlink Any point range - \link PkgPointSetProcessing3IOLas CGAL::write_LAS(const char*, PointRange&)\endlink + \link PkgPointSetProcessing3IOLas CGAL::IO::write_LAS(const char*, PointRange&)\endlink @@ -303,21 +303,21 @@ of its coordinates and other properties. Only coordinates and normals are curren Input Point Set `CGAL::Point_set_3` - \link PkgPointSet3IOXYZ CGAL::read_XYZ(const char*, CGAL::Point_set_3&)\endlink + \link PkgPointSet3IOXYZ CGAL::IO::read_XYZ(const char*, CGAL::Point_set_3&)\endlink Any point range - \link PkgPointSetProcessing3IOXyz CGAL::read_XYZ(const char*, PointRange&)\endlink + \link PkgPointSetProcessing3IOXyz CGAL::IO::read_XYZ(const char*, PointRange&)\endlink Output Point Set `CGAL::Point_set_3` - \link PkgPointSet3IOXYZ CGAL::write_XYZ(const char*, CGAL::Point_set_3&)\endlink + \link PkgPointSet3IOXYZ CGAL::IO::write_XYZ(const char*, CGAL::Point_set_3&)\endlink Any point range - \link PkgPointSetProcessing3IOXyz CGAL::write_XYZ(const char*, PointRange&)\endlink + \link PkgPointSetProcessing3IOXyz CGAL::IO::write_XYZ(const char*, PointRange&)\endlink @@ -337,28 +337,28 @@ A precise specification of the format is available Input Polygon Mesh Any model of `MutableFaceGraph` - \link PkgBGLIoFuncsGOCAD CGAL::read_GOCAD(const char*, Graph&)\endlink + \link PkgBGLIoFuncsGOCAD CGAL::IO::read_GOCAD(const char*, Graph&)\endlink Polygon Soup Any point + polygon range - \link PkgStreamSupportIoFuncsGOCAD CGAL::read_GOCAD(const char*, PointRange&, PolygonRange&)\endlink + \link PkgStreamSupportIoFuncsGOCAD CGAL::IO::read_GOCAD(const char*, PointRange&, PolygonRange&)\endlink Output Polygon Mesh Any model of `FaceGraph` - \link PkgBGLIoFuncsGOCAD CGAL::write_GOCAD(const char*, Graph&)\endlink + \link PkgBGLIoFuncsGOCAD CGAL::IO::write_GOCAD(const char*, Graph&)\endlink Polygon Soup Any point + polygon range - \link PkgStreamSupportIoFuncsGOCAD CGAL::write_GOCAD(const char*, PointRange&, PolygonRange&)\endlink + \link PkgStreamSupportIoFuncsGOCAD CGAL::IO::write_GOCAD(const char*, PointRange&, PolygonRange&)\endlink If the data of a polygon mesh cannot be read in a `FaceGraph` due to bad orientation or -manifoldness issues, consider using \link PMP_IO_grp `CGAL::Polygon_mesh_processing::read_polygon_mesh()` \endlink, +manifoldness issues, consider using \link PMP_IO_grp `CGAL::Polygon_mesh_processing::IO::read_polygon_mesh()` \endlink, which offers combinatorial repairing while reading bad inputs. @@ -381,28 +381,28 @@ note that only versions `1.x` are currently supported in \cgal. Input Polygon Mesh `CGAL::Surface_mesh` - \link PkgSurfaceMeshIOFunc3MF CGAL::read_3MF(const char*, Surface_meshRange&)\endlink + \link PkgSurfaceMeshIOFunc3MF CGAL::IO::read_3MF(const char*, Surface_meshRange&)\endlink Polygon Soup Any point + polygon range - \link PkgStreamSupportIoFuncs3MF CGAL::read_3MF(const char*, PointRanges&, PolygonRanges&)\endlink + \link PkgStreamSupportIoFuncs3MF CGAL::IO::read_3MF(const char*, PointRanges&, PolygonRanges&)\endlink Output Polygon Mesh Any model of `FaceGraph` - \link PkgBGLIoFuncs3MF CGAL::write_3MF(const char*, GraphRange&)\endlink + \link PkgBGLIoFuncs3MF CGAL::IO::write_3MF(const char*, GraphRange&)\endlink Polygon Soup Any point + polygon range - \link PkgStreamSupportIoFuncs3MF CGAL::write_3MF(const char*, PointRanges&, PolygonRanges&)\endlink + \link PkgStreamSupportIoFuncs3MF CGAL::IO::write_3MF(const char*, PointRanges&, PolygonRanges&)\endlink If the data of a polygon mesh cannot be read in a `FaceGraph` due to bad orientation or -manifoldness issues, consider using \link PMP_IO_grp `CGAL::Polygon_mesh_processing::read_polygon_mesh()` \endlink, +manifoldness issues, consider using \link PMP_IO_grp `CGAL::Polygon_mesh_processing::IO::read_polygon_mesh()` \endlink, which offers combinatorial repairing while reading bad inputs. @@ -422,7 +422,7 @@ A precise specification of the format is available Output Polygon Mesh Any model of `FaceGraph` - \link PkgBGLIoFuncsWRL CGAL::write_WRL(const char*, Graph&)\endlink + \link PkgBGLIoFuncsWRL CGAL::IO::write_WRL(const char*, Graph&)\endlink @@ -451,30 +451,30 @@ A precise specification of those formats is available at Input Polygon Mesh Any model of `MutableFaceGraph` - \link PkgBGLIoFuncsVTP CGAL::read_VTP(const char*, Graph&)\endlink + \link PkgBGLIoFuncsVTP CGAL::IO::read_VTP(const char*, Graph&)\endlink Polygon Soup Any point + polygon range - \link PkgStreamSupportIoFuncsVTP CGAL::read_VTP(const char*, PointRange&, PolygonRange&)\endlink + \link PkgStreamSupportIoFuncsVTP CGAL::IO::read_VTP(const char*, PointRange&, PolygonRange&)\endlink Output Polygon Mesh Any model of `FaceGraph` - \link PkgBGLIoFuncsVTP CGAL::write_VTP(const char*, Graph&)\endlink + \link PkgBGLIoFuncsVTP CGAL::IO::write_VTP(const char*, Graph&)\endlink Polygon Soup Any point + polygon range - \link PkgStreamSupportIoFuncsVTP CGAL::write_VTP(const char*, PointRange&, PolygonRange&)\endlink + \link PkgStreamSupportIoFuncsVTP CGAL::IO::write_VTP(const char*, PointRange&, PolygonRange&)\endlink The following \cgal data structures can be exported into the `.VTU` file format: -- `CGAL::Mesh_complex_3_in_triangulation_3`, using \link PkgMesh3IOFunctions `CGAL::output_to_vtu()` \endlink -- `CGAL::Constrained_Delaunay_triangulation_2`, using the function \link PkgMesh2IO `CGAL::write_vtu()` \endlink +- `CGAL::Mesh_complex_3_in_triangulation_3`, using \link PkgMesh3IOFunctions `CGAL::IO::output_to_vtu()` \endlink +- `CGAL::Constrained_Delaunay_triangulation_2`, using the function \link PkgMesh2IO `CGAL::IO::write_VTU()` \endlink \section IOStreamAvizo Avizo File Format @@ -483,7 +483,7 @@ The AmiraMesh format, using file extension `.am`, is used by the Avizo software to read 3D geometry. A single \cgal data structure, `CGAL::Mesh_complex_3_in_triangulation_3`, can be exported into `.am` files. -This can be done using the function `CGAL::output_to_avizo()`. +This can be done using the function `CGAL::IO::output_to_avizo()`. A precise specification of the format is available in this guide. @@ -497,7 +497,7 @@ A precise specification of the format is available Ascii mode. \code{.cpp} IO::Mode set_mode(std::ios& s, IO::Mode m); -IO::Mode set_ascii_mode(std::ios& s); -IO::Mode set_binary_mode(std::ios& s); -IO::Mode set_pretty_mode(std::ios& s); +IO::Mode IO::set_ascii_mode(std::ios& s); +IO::Mode IO::set_binary_mode(std::ios& s); +IO::Mode IO::set_pretty_mode(std::ios& s); \endcode The following functions enable testing whether a stream is in a certain mode: @@ -120,11 +120,11 @@ main() Point p, q; Segment s; - CGAL::set_ascii_mode(std::cin); + CGAL::IO::set_ascii_mode(std::cin); std::cin >> p >> q; std::ifstream f("data.txt"); - CGAL::set_binary_mode(f); + CGAL::IO::set_binary_mode(f); f >> s >> p; return 1; @@ -161,11 +161,11 @@ int main() Point p(0,1), q(2,2); Segment s(p,q); - CGAL::set_pretty_mode(std::cout); + CGAL::IO::set_pretty_mode(std::cout); std::cout << p << std::endl << q << std::endl; std::ofstream f("data.txt"); - CGAL::set_binary_mode(f); + CGAL::IO::set_binary_mode(f); f << s << p ; return 1; @@ -181,12 +181,12 @@ For types with a `Output_rep` specialization, the respective output routine of ` will be called by `oformat()`. Otherwise, the stream output operator will be called. \code{.cpp} -std::cout << CGAL::oformat( myobject ); +std::cout << CGAL::IO::oformat( myobject ); \endcode Optionally, you can provide a second template parameter `F` as a formatting tag: \code{.cpp} -std::cout << CGAL::oformat( myobject, My_formatting_tag() ); +std::cout << CGAL::IO::oformat( myobject, My_formatting_tag() ); \endcode For a list of formatting tags supported by the type `T`, please @@ -448,7 +448,7 @@ See the reference manual of each data structure for more information. The functions above require the input to represent a 2-manifold surface (possibly with boundaries). If this is not the case, the package \ref PkgPolygonMeshProcessing offers the function -\link PMP_IO_grp `CGAL::Polygon_mesh_processing::read_polygon_mesh()` \endlink +\link PMP_IO_grp `CGAL::Polygon_mesh_processing::IO::read_polygon_mesh()` \endlink which can perform some combinatorial repairing to ensure the input data is a 2-manifold. \subsection IOstream2DGeo Simple 2D Geometry IO diff --git a/Stream_support/doc/Stream_support/PackageDescription.txt b/Stream_support/doc/Stream_support/PackageDescription.txt index ce937e817f1..cb40fcd8607 100644 --- a/Stream_support/doc/Stream_support/PackageDescription.txt +++ b/Stream_support/doc/Stream_support/PackageDescription.txt @@ -67,7 +67,7 @@ the printing mode. - \link PkgStreamSupportEnumRef `CGAL::IO::Mode` \endlink \cgalCRPSection{Classes} -- `CGAL::Color` +- `CGAL::IO::Color` - `CGAL::Istream_iterator` - `CGAL::Ostream_iterator` - `CGAL::Verbose_ostream` @@ -75,22 +75,22 @@ the printing mode. - `CGAL::Output_rep` \cgalCRPSection{Functions} -- `CGAL::get_mode()` -- `CGAL::is_ascii()` -- `CGAL::is_binary()` -- `CGAL::is_pretty()` -- `CGAL::set_mode()` -- `CGAL::set_ascii_mode()` -- `CGAL::set_binary_mode()` -- `CGAL::set_pretty_mode()` +- `CGAL::IO::get_mode()` +- `CGAL::IO::is_ascii()` +- `CGAL::IO::is_binary()` +- `CGAL::IO::is_pretty()` +- `CGAL::IO::set_mode()` +- `CGAL::IO::set_ascii_mode()` +- `CGAL::IO::set_binary_mode()` +- `CGAL::IO::set_pretty_mode()` - \link IOstreamOperators `CGAL::operator>>()` \endlink - \link IOstreamOperators `CGAL::operator<<()` \endlink -- `CGAL::iformat()` -- `CGAL::oformat()` +- `CGAL::IO::iformat()` +- `CGAL::IO::oformat()` \cgalCRPSection{I/O Functions} -- `CGAL::read_polygon_soup()` -- `CGAL::write_polygon_soup()` +- `CGAL::IO::read_polygon_soup()` +- `CGAL::IO::write_polygon_soup()` - \link PkgStreamSupportIoFuncsSTL I/O for STL files \endlink - \link PkgStreamSupportIoFuncsPLY I/O for PLY files \endlink - \link PkgStreamSupportIoFuncsOBJ I/O for OBJ files \endlink diff --git a/Stream_support/examples/Stream_support/Linestring_WKT.cpp b/Stream_support/examples/Stream_support/Linestring_WKT.cpp index 6988a1d0ad7..597f871353b 100644 --- a/Stream_support/examples/Stream_support/Linestring_WKT.cpp +++ b/Stream_support/examples/Stream_support/Linestring_WKT.cpp @@ -23,7 +23,7 @@ int main(int argc, char* argv[]) LineString ls; { std::ifstream is((argc>1)?argv[1]:"data/linestring.wkt"); - CGAL::read_linestring_WKT(is, ls); + CGAL::IO::read_linestring_WKT(is, ls); is.close(); } for(Point p : ls) @@ -32,7 +32,7 @@ int main(int argc, char* argv[]) MultiLineString mls; { std::ifstream is((argc>2)?argv[2]:"data/multilinestring.wkt"); - CGAL::read_multi_linestring_WKT(is, mls); + CGAL::IO::read_multi_linestring_WKT(is, mls); is.close(); } for(LineString l : mls) diff --git a/Stream_support/examples/Stream_support/Point_WKT.cpp b/Stream_support/examples/Stream_support/Point_WKT.cpp index ce6020f4e23..768b3d20099 100644 --- a/Stream_support/examples/Stream_support/Point_WKT.cpp +++ b/Stream_support/examples/Stream_support/Point_WKT.cpp @@ -21,7 +21,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); + CGAL::IO::read_multi_point_WKT(is, mp); for(const Point& p : mp) { std::cout<2)?argv[2]:"data/multipolygon.wkt"); MultiPolygon mp; - CGAL::read_multi_polygon_WKT(is, mp); + CGAL::IO::read_multi_polygon_WKT(is, mp); for(Polygon p : mp) std::cout< colors(all_triangles[id].size()); + std::vector colors(all_triangles[id].size()); IO::write_mesh_to_model(all_points[id], all_triangles[id], colors, name, &pMeshObject, pModel); } @@ -502,13 +504,15 @@ bool write_3MF(const std::string& fname, template bool write_3MF(const std::string& fname, const PointRange& points, const TriangleRange& triangles, - typename boost::enable_if >::type* = nullptr) + typename boost::enable_if >::type* = nullptr) { return write_triangle_soup_to_3mf(fname, points, triangles, "anonymous"); } /// \endcond +} // namespace IO + } // namespace CGAL #endif // defined(CGAL_LINKED_WITH_3MF) || defined(DOXYGEN_RUNNING) diff --git a/Stream_support/include/CGAL/IO/3MF/read_3mf.h b/Stream_support/include/CGAL/IO/3MF/read_3mf.h index 6c81f124380..ca4d64af3d0 100644 --- a/Stream_support/include/CGAL/IO/3MF/read_3mf.h +++ b/Stream_support/include/CGAL/IO/3MF/read_3mf.h @@ -128,7 +128,7 @@ bool extract_soups (NMR::PLib3MFModelMeshObject *pMeshObject, NMR::MODELMESH_TRIANGLECOLOR_SRGB pColor; NMR::lib3mf_propertyhandler_getcolor(pPropertyHandler, pid, &pColor); NMR::MODELMESHCOLOR_SRGB mColor = pColor.m_Colors[0]; - colors[pid]=CGAL::Color(mColor.m_Red, mColor.m_Green, + colors[pid]=CGAL::IO::Color(mColor.m_Red, mColor.m_Green, mColor.m_Blue, mColor.m_Alpha); } diff --git a/Stream_support/include/CGAL/IO/Color.h b/Stream_support/include/CGAL/IO/Color.h index 10754d9979a..12bdd320e28 100644 --- a/Stream_support/include/CGAL/IO/Color.h +++ b/Stream_support/include/CGAL/IO/Color.h @@ -27,6 +27,7 @@ namespace CGAL { +namespace IO { /*! \ingroup PkgStreamSupportRef @@ -350,6 +351,22 @@ inline Color white() { return Color(255,255,255); } */ inline Color yellow() { return Color(255,255,0); } +} //namespace IO + +#ifndef CGAL_NO_DEPRECATED_CODE +using IO::Color; +using IO::black; +using IO::blue; +using IO::deep_blue; +using IO::gray; +using IO::green; +using IO::orange; +using IO::purple; +using IO::red; +using IO::violet; +using IO::white; +using IO::yellow; +#endif } //namespace CGAL diff --git a/Stream_support/include/CGAL/IO/GOCAD.h b/Stream_support/include/CGAL/IO/GOCAD.h index 104a3c6cc54..bf5af235cb3 100644 --- a/Stream_support/include/CGAL/IO/GOCAD.h +++ b/Stream_support/include/CGAL/IO/GOCAD.h @@ -32,6 +32,8 @@ namespace CGAL { +namespace IO { + //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// // Read @@ -192,7 +194,7 @@ bool read_GOCAD(std::istream& is, PolygonRange& polygons, const CGAL_BGL_NP_CLASS& np #ifndef DOXYGEN_RUNNING - , typename boost::enable_if >::type* = nullptr + , typename boost::enable_if >::type* = nullptr #endif ) { @@ -204,7 +206,7 @@ bool read_GOCAD(std::istream& is, template bool read_GOCAD(std::istream& is, PointRange& points, PolygonRange& polygons, - typename boost::enable_if >::type* = nullptr) + typename boost::enable_if >::type* = nullptr) { std::pair dummy; return read_GOCAD(is, dummy, points, polygons, parameters::all_default()); @@ -249,12 +251,12 @@ bool read_GOCAD(const std::string& fname, PolygonRange& polygons, const CGAL_BGL_NP_CLASS& np #ifndef DOXYGEN_RUNNING - , typename boost::enable_if >::type* = nullptr + , typename boost::enable_if >::type* = nullptr #endif ) { std::ifstream is(fname); - CGAL::set_mode(is, CGAL::IO::ASCII); + CGAL::IO::set_mode(is, CGAL::IO::ASCII); std::pair dummy; return read_GOCAD(is, dummy, points, polygons, np); } @@ -263,7 +265,7 @@ bool read_GOCAD(const std::string& fname, template bool read_GOCAD(const std::string& fname, PointRange& points, PolygonRange& polygons, - typename boost::enable_if >::type* = nullptr) + typename boost::enable_if >::type* = nullptr) { return read_GOCAD(fname, points, polygons, parameters::all_default()); } @@ -274,7 +276,6 @@ bool read_GOCAD(const std::string& fname, PointRange& points, PolygonRange& poly //////////////////////////////////////////////////////////////////////////////////////////////////// // Write -namespace IO { namespace internal { template >::type* = nullptr + , typename boost::enable_if >::type* = nullptr #endif ) { - return IO::internal::write_GOCAD(os, "anonymous", points, polygons, np); + return internal::write_GOCAD(os, "anonymous", points, polygons, np); } /// \cond SKIP_IN_MANUAL template bool write_GOCAD(std::ostream& os, const PointRange& points, const PolygonRange& polygons, - typename boost::enable_if >::type* = nullptr) + typename boost::enable_if >::type* = nullptr) { - return IO::internal::write_GOCAD(os, "anonymous", points, polygons, parameters::all_default()); + return internal::write_GOCAD(os, "anonymous", points, polygons, parameters::all_default()); } /// \endcond @@ -423,13 +423,13 @@ bool write_GOCAD(const std::string& fname, const PolygonRange& polygons, const CGAL_BGL_NP_CLASS& np #ifndef DOXYGEN_RUNNING - , typename boost::enable_if >::type* = nullptr + , typename boost::enable_if >::type* = nullptr #endif ) { std::ofstream os(fname); - CGAL::set_mode(os, CGAL::IO::ASCII); - return IO::internal::write_GOCAD(os, fname.c_str(), points, polygons, np); + CGAL::IO::set_mode(os, CGAL::IO::ASCII); + return internal::write_GOCAD(os, fname.c_str(), points, polygons, np); } /// \cond SKIP_IN_MANUAL @@ -437,13 +437,15 @@ bool write_GOCAD(const std::string& fname, template bool write_GOCAD(const std::string& fname, const PointRange& points, const PolygonRange& polygons, - typename boost::enable_if >::type* = nullptr) + typename boost::enable_if >::type* = nullptr) { return write_GOCAD(fname, points, polygons, parameters::all_default()); } /// \endcond +} // namespace IO + } // namespace CGAL #endif // CGAL_IO_GOCAD_H diff --git a/Stream_support/include/CGAL/IO/OBJ.h b/Stream_support/include/CGAL/IO/OBJ.h index ea3abc8075f..c886fd69c9a 100644 --- a/Stream_support/include/CGAL/IO/OBJ.h +++ b/Stream_support/include/CGAL/IO/OBJ.h @@ -181,7 +181,6 @@ bool read_OBJ(std::istream& is, } } // namespace internal -} // namespace IO /// \ingroup PkgStreamSupportIoFuncsOBJ /// @@ -218,22 +217,22 @@ bool read_OBJ(std::istream& is, PolygonRange& polygons, const CGAL_BGL_NP_CLASS& np #ifndef DOXYGEN_RUNNING - , typename boost::enable_if >::type* = nullptr + , typename boost::enable_if >::type* = nullptr #endif ) { const bool verbose = parameters::choose_parameter(parameters::get_parameter(np, internal_np::verbose), false); - return IO::internal::read_OBJ(is, points, polygons, - CGAL::Emptyset_iterator(), CGAL::Emptyset_iterator(), - verbose); + return internal::read_OBJ(is, points, polygons, + CGAL::Emptyset_iterator(), CGAL::Emptyset_iterator(), + verbose); } /// \cond SKIP_IN_MANUAL template bool read_OBJ(std::istream& is, PointRange& points, PolygonRange& polygons, - typename boost::enable_if >::type* = nullptr) + typename boost::enable_if >::type* = nullptr) { return read_OBJ(is, points, polygons, parameters::all_default()); } @@ -274,12 +273,12 @@ bool read_OBJ(const std::string& fname, PolygonRange& polygons, const CGAL_BGL_NP_CLASS& np #ifndef DOXYGEN_RUNNING - , typename boost::enable_if >::type* = nullptr + , typename boost::enable_if >::type* = nullptr #endif ) { std::ifstream is(fname); - CGAL::set_mode(is, CGAL::IO::ASCII); + CGAL::IO::set_mode(is, CGAL::IO::ASCII); return read_OBJ(is, points, polygons, np); } @@ -287,7 +286,7 @@ bool read_OBJ(const std::string& fname, template bool read_OBJ(const std::string& fname, PointRange& points, PolygonRange& polygons, - typename boost::enable_if >::type* = nullptr) + typename boost::enable_if >::type* = nullptr) { return read_OBJ(fname, points, polygons, parameters::all_default()); } @@ -333,7 +332,7 @@ bool write_OBJ(std::ostream& os, const PolygonRange& polygons, const CGAL_BGL_NP_CLASS& np #ifndef DOXYGEN_RUNNING - , typename boost::enable_if >::type* = nullptr + , typename boost::enable_if >::type* = nullptr #endif ) { @@ -346,7 +345,7 @@ bool write_OBJ(std::ostream& os, template bool write_OBJ(std::ostream& os, const PointRange& points, const PolygonRange& polygons, - typename boost::enable_if >::type* = nullptr) + typename boost::enable_if >::type* = nullptr) { return write_OBJ(os, points, polygons, parameters::all_default()); } @@ -388,12 +387,12 @@ bool write_OBJ(const std::string& fname, const PolygonRange& polygons, const CGAL_BGL_NP_CLASS& np #ifndef DOXYGEN_RUNNING - , typename boost::enable_if >::type* = nullptr + , typename boost::enable_if >::type* = nullptr #endif ) { std::ofstream os(fname); - CGAL::set_mode(os, CGAL::IO::ASCII); + CGAL::IO::set_mode(os, CGAL::IO::ASCII); return write_OBJ(os, points, polygons, np); } @@ -402,13 +401,15 @@ bool write_OBJ(const std::string& fname, template bool write_OBJ(const std::string& fname, const PointRange& points, const PolygonRange& polygons, - typename boost::enable_if >::type* = nullptr) + typename boost::enable_if >::type* = nullptr) { return write_OBJ(fname, points, polygons, parameters::all_default()); } /// \endcond +} // namespace IO + } // namespace CGAL #endif // CGAL_IO_OBJ_H diff --git a/Stream_support/include/CGAL/IO/OBJ/File_writer_wavefront.h b/Stream_support/include/CGAL/IO/OBJ/File_writer_wavefront.h index 4736a201753..941fc1d9eae 100644 --- a/Stream_support/include/CGAL/IO/OBJ/File_writer_wavefront.h +++ b/Stream_support/include/CGAL/IO/OBJ/File_writer_wavefront.h @@ -56,11 +56,11 @@ public: void write_footer() const { out() << "\n# End of Wavefront obj format #" << std::endl; } void write_vertex(const double x, const double y, const double z) { - out() << "v " << oformat(x) << ' ' << oformat(y) << ' ' << oformat(z) << '\n'; + out() << "v " << IO::oformat(x) << ' ' << IO::oformat(y) << ' ' << IO::oformat(z) << '\n'; } void write_vertex_normal(const double x, const double y, const double z) { - out() << "vn " << oformat(x) << ' ' << oformat(y) << ' ' << oformat(z) << '\n'; + out() << "vn " << IO::oformat(x) << ' ' << IO::oformat(y) << ' ' << IO::oformat(z) << '\n'; } void write_vertex_color(const double, const double, const double) { } diff --git a/Stream_support/include/CGAL/IO/OFF.h b/Stream_support/include/CGAL/IO/OFF.h index 645ecf6e15f..ceb9d7db40b 100644 --- a/Stream_support/include/CGAL/IO/OFF.h +++ b/Stream_support/include/CGAL/IO/OFF.h @@ -72,7 +72,7 @@ bool read_OFF(std::istream& is, typedef typename Kernel::Point_2 Texture; typedef typename Kernel::Vector_3 Normal; typedef typename Kernel::FT FT; - typedef CGAL::Color Color; + typedef CGAL::IO::Color Color; if(!is.good()){ @@ -92,7 +92,7 @@ bool read_OFF(std::istream& is, double x(0), y(0), z(0), w(0); scanner.scan_vertex(x, y, z, w); CGAL_assertion(w != 0); - IO::internal::fill_point(x, y, z, w, points[i]); + internal::fill_point(x, y, z, w, points[i]); if(scanner.has_normals()) { @@ -153,7 +153,6 @@ bool read_OFF(std::istream& is, } } // namespace internal -} // namespace IO /*! * \ingroup PkgStreamSupportIoFuncsOFF @@ -190,30 +189,30 @@ bool read_OFF(std::istream& is, PolygonRange& polygons, const CGAL_BGL_NP_CLASS& np #ifndef DOXYGEN_RUNNING - , typename boost::enable_if >::type* = nullptr + , typename boost::enable_if >::type* = nullptr #endif ) { using parameters::choose_parameter; using parameters::get_parameter; - return IO::internal::read_OFF(is, points, polygons, - choose_parameter(get_parameter(np, internal_np::vertex_normal_output_iterator), - CGAL::Emptyset_iterator()), - choose_parameter(get_parameter(np, internal_np::vertex_color_output_iterator), - CGAL::Emptyset_iterator()), - choose_parameter(get_parameter(np, internal_np::vertex_texture_output_iterator), - CGAL::Emptyset_iterator()), - choose_parameter(get_parameter(np, internal_np::face_color_output_iterator), - CGAL::Emptyset_iterator()), - choose_parameter(get_parameter(np, internal_np::verbose), true)); + return internal::read_OFF(is, points, polygons, + choose_parameter(get_parameter(np, internal_np::vertex_normal_output_iterator), + CGAL::Emptyset_iterator()), + choose_parameter(get_parameter(np, internal_np::vertex_color_output_iterator), + CGAL::Emptyset_iterator()), + choose_parameter(get_parameter(np, internal_np::vertex_texture_output_iterator), + CGAL::Emptyset_iterator()), + choose_parameter(get_parameter(np, internal_np::face_color_output_iterator), + CGAL::Emptyset_iterator()), + choose_parameter(get_parameter(np, internal_np::verbose), true)); } /// \cond SKIP_IN_MANUAL template bool read_OFF(std::istream& is, PointRange& points, PolygonRange& polygons, - typename boost::enable_if >::type* = nullptr) + typename boost::enable_if >::type* = nullptr) { return read_OFF(is, points, polygons, parameters::all_default()); } @@ -254,7 +253,7 @@ bool read_OFF(const std::string& fname, PolygonRange& polygons, const CGAL_BGL_NP_CLASS& np #ifndef DOXYGEN_RUNNING - , typename boost::enable_if >::type* = nullptr + , typename boost::enable_if >::type* = nullptr #endif ) { @@ -266,7 +265,7 @@ bool read_OFF(const std::string& fname, template bool read_OFF(const std::string& fname, PointRange& points, PolygonRange& polygons, - typename boost::enable_if >::type* = nullptr) + typename boost::enable_if >::type* = nullptr) { return read_OFF(fname, points, polygons, parameters::all_default()); } @@ -310,7 +309,7 @@ bool write_OFF(std::ostream& os, const PolygonRange& polygons, const CGAL_BGL_NP_CLASS& np #ifndef DOXYGEN_RUNNING - , typename boost::enable_if >::type* = nullptr + , typename boost::enable_if >::type* = nullptr #endif ) { @@ -322,7 +321,7 @@ bool write_OFF(std::ostream& os, template bool write_OFF(std::ostream& os, const PointRange& points, const PolygonRange& polygons - , typename boost::enable_if >::type* = nullptr) + , typename boost::enable_if >::type* = nullptr) { return write_OFF(os, points, polygons, parameters::all_default()); } @@ -362,7 +361,7 @@ bool write_OFF(const std::string& fname, const PolygonRange& polygons, const CGAL_BGL_NP_CLASS& np #ifndef DOXYGEN_RUNNING - , typename boost::enable_if >::type* = nullptr + , typename boost::enable_if >::type* = nullptr #endif ) { @@ -375,13 +374,15 @@ bool write_OFF(const std::string& fname, template bool write_OFF(const std::string& fname, const PointRange& points, const PolygonRange& polygons, - typename boost::enable_if >::type* = nullptr) + typename boost::enable_if >::type* = nullptr) { return write_OFF(fname, points, polygons, parameters::all_default()); } /// \endcond +} // namespace IO + } // namespace CGAL #endif // CGAL_IO_OFF_H diff --git a/Stream_support/include/CGAL/IO/OFF/File_scanner_OFF.h b/Stream_support/include/CGAL/IO/OFF/File_scanner_OFF.h index 89bb14656ef..90c1ed4305f 100644 --- a/Stream_support/include/CGAL/IO/OFF/File_scanner_OFF.h +++ b/Stream_support/include/CGAL/IO/OFF/File_scanner_OFF.h @@ -90,7 +90,7 @@ public: std::istringstream issline(line); entries.clear(); double d; - while(issline >> iformat(d)){ + while(issline >> IO::iformat(d)){ entries.push_back(d); } @@ -372,163 +372,163 @@ public: z = static_cast(dz); } - static const Color& get_indexed_color(int id) + static const IO::Color& get_indexed_color(int id) { - static const Color color[149] = { - Color(255, 255, 255, 191), - Color(255, 255, 255, 191), - Color(255, 255, 255, 191), - Color(255, 255, 255, 191), - Color(255, 255, 255, 191), - Color(255, 255, 255, 191), - Color(178, 38, 25, 191), - Color(51, 51, 204, 191), - Color(229, 153, 5, 191), - Color(25, 76, 204, 191), - Color(25, 178, 51, 191), - Color(204, 204, 102, 191), - Color(178, 178, 0, 191), - Color(178, 0, 178, 191), - Color(0, 178, 178, 191), - Color(229, 0, 51, 191), - Color(51, 229, 0, 191), - Color(0, 51, 229, 191), - Color(191, 191, 191, 191), - Color(204, 102, 0, 191), - Color(204, 102, 0, 191), - Color(0, 102, 204, 191), - Color(0, 102, 204, 191), - Color(0, 204, 102, 191), - Color(0, 204, 102, 191), - Color(102, 0, 204, 191), - Color(102, 0, 204, 191), - Color(204, 0, 102, 191), - Color(204, 0, 102, 191), - Color(178, 127, 51, 191), - Color(178, 127, 51, 191), - Color(178, 178, 0, 191), - Color(178, 0, 178, 191), - Color(0, 178, 178, 191), - Color(229, 0, 0, 191), - Color(0, 229, 0, 191), - Color(0, 0, 229, 191), - Color(191, 191, 191, 191), - Color(204, 102, 0, 191), - Color(102, 204, 0, 191), - Color(0, 102, 204, 191), - Color(0, 204, 102, 191), - Color(102, 0, 204, 191), - Color(204, 0, 102, 191), - Color(178, 178, 0, 191), - Color(178, 0, 178, 191), - Color(0, 178, 178, 191), - Color(229, 0, 0, 191), - Color(0, 229, 0, 191), - Color(0, 0, 229, 191), - Color(191, 191, 191, 191), - Color(204, 102, 0, 191), - Color(102, 204, 0, 191), - Color(0, 102, 204, 191), - Color(0, 204, 102, 191), - Color(102, 0, 204, 191), - Color(204, 0, 102, 191), - Color(178, 178, 0, 191), - Color(178, 0, 178, 191), - Color(0, 178, 178, 191), - Color(229, 0, 0, 191), - Color(0, 229, 0, 191), - Color(0, 0, 229, 191), - Color(191, 191, 191, 191), - Color(204, 102, 0, 191), - Color(102, 204, 0, 191), - Color(0, 102, 204, 191), - Color(0, 204, 102, 191), - Color(102, 0, 204, 191), - Color(204, 0, 102, 191), - Color(255, 255, 255, 191), - Color(255, 255, 255, 191), - Color(255, 255, 255, 191), - Color(255, 255, 255, 191), - Color(255, 255, 255, 191), - Color(255, 255, 255, 191), - Color(12, 76, 25, 191), - Color(178, 2, 25, 191), - Color(51, 12, 153, 191), - Color(229, 229, 5, 191), - Color(0, 51, 102, 191), - Color(25, 102, 102, 191), - Color(204, 204, 204, 191), - Color(178, 178, 0, 191), - Color(178, 178, 0, 191), - Color(178, 0, 178, 191), - Color(178, 0, 178, 191), - Color(0, 178, 178, 191), - Color(0, 178, 178, 191), - Color(229, 0, 0, 191), - Color(229, 0, 0, 191), - Color(0, 229, 0, 191), - Color(0, 229, 0, 191), - Color(0, 0, 229, 191), - Color(0, 0, 229, 191), - Color(191, 191, 191, 191), - Color(191, 191, 191, 191), - Color(204, 102, 0, 191), - Color(204, 102, 0, 191), - Color(0, 102, 204, 191), - Color(0, 102, 204, 191), - Color(0, 204, 102, 191), - Color(0, 204, 102, 191), - Color(102, 0, 204, 191), - Color(102, 0, 204, 191), - Color(204, 0, 102, 191), - Color(204, 0, 102, 191), - Color(178, 127, 51, 191), - Color(178, 127, 51, 191), - Color(178, 178, 0, 191), - Color(178, 0, 178, 191), - Color(0, 178, 178, 191), - Color(229, 0, 0, 191), - Color(0, 229, 0, 191), - Color(0, 0, 229, 191), - Color(191, 191, 191, 191), - Color(204, 102, 0, 191), - Color(102, 204, 0, 191), - Color(0, 102, 204, 191), - Color(0, 204, 102, 191), - Color(102, 0, 204, 191), - Color(204, 0, 102, 191), - Color(178, 178, 0, 191), - Color(178, 0, 178, 191), - Color(0, 178, 178, 191), - Color(229, 0, 0, 191), - Color(0, 229, 0, 191), - Color(0, 0, 229, 191), - Color(191, 191, 191, 191), - Color(204, 102, 0, 191), - Color(102, 204, 0, 191), - Color(0, 102, 204, 191), - Color(0, 204, 102, 191), - Color(102, 0, 204, 191), - Color(204, 0, 102, 191), - Color(178, 178, 0, 191), - Color(178, 0, 178, 191), - Color(0, 178, 178, 191), - Color(229, 0, 0, 191), - Color(0, 229, 0, 191), - Color(0, 0, 229, 191), - Color(191, 191, 191, 191), - Color(204, 102, 0, 191), - Color(102, 204, 0, 191), - Color(0, 102, 204, 191), - Color(0, 204, 102, 191), - Color(102, 0, 204, 191), - Color(204, 0, 102, 191), - Color(120, 120, 120, 120) }; + static const IO::Color color[149] = { + IO::Color(255, 255, 255, 191), + IO::Color(255, 255, 255, 191), + IO::Color(255, 255, 255, 191), + IO::Color(255, 255, 255, 191), + IO::Color(255, 255, 255, 191), + IO::Color(255, 255, 255, 191), + IO::Color(178, 38, 25, 191), + IO::Color(51, 51, 204, 191), + IO::Color(229, 153, 5, 191), + IO::Color(25, 76, 204, 191), + IO::Color(25, 178, 51, 191), + IO::Color(204, 204, 102, 191), + IO::Color(178, 178, 0, 191), + IO::Color(178, 0, 178, 191), + IO::Color(0, 178, 178, 191), + IO::Color(229, 0, 51, 191), + IO::Color(51, 229, 0, 191), + IO::Color(0, 51, 229, 191), + IO::Color(191, 191, 191, 191), + IO::Color(204, 102, 0, 191), + IO::Color(204, 102, 0, 191), + IO::Color(0, 102, 204, 191), + IO::Color(0, 102, 204, 191), + IO::Color(0, 204, 102, 191), + IO::Color(0, 204, 102, 191), + IO::Color(102, 0, 204, 191), + IO::Color(102, 0, 204, 191), + IO::Color(204, 0, 102, 191), + IO::Color(204, 0, 102, 191), + IO::Color(178, 127, 51, 191), + IO::Color(178, 127, 51, 191), + IO::Color(178, 178, 0, 191), + IO::Color(178, 0, 178, 191), + IO::Color(0, 178, 178, 191), + IO::Color(229, 0, 0, 191), + IO::Color(0, 229, 0, 191), + IO::Color(0, 0, 229, 191), + IO::Color(191, 191, 191, 191), + IO::Color(204, 102, 0, 191), + IO::Color(102, 204, 0, 191), + IO::Color(0, 102, 204, 191), + IO::Color(0, 204, 102, 191), + IO::Color(102, 0, 204, 191), + IO::Color(204, 0, 102, 191), + IO::Color(178, 178, 0, 191), + IO::Color(178, 0, 178, 191), + IO::Color(0, 178, 178, 191), + IO::Color(229, 0, 0, 191), + IO::Color(0, 229, 0, 191), + IO::Color(0, 0, 229, 191), + IO::Color(191, 191, 191, 191), + IO::Color(204, 102, 0, 191), + IO::Color(102, 204, 0, 191), + IO::Color(0, 102, 204, 191), + IO::Color(0, 204, 102, 191), + IO::Color(102, 0, 204, 191), + IO::Color(204, 0, 102, 191), + IO::Color(178, 178, 0, 191), + IO::Color(178, 0, 178, 191), + IO::Color(0, 178, 178, 191), + IO::Color(229, 0, 0, 191), + IO::Color(0, 229, 0, 191), + IO::Color(0, 0, 229, 191), + IO::Color(191, 191, 191, 191), + IO::Color(204, 102, 0, 191), + IO::Color(102, 204, 0, 191), + IO::Color(0, 102, 204, 191), + IO::Color(0, 204, 102, 191), + IO::Color(102, 0, 204, 191), + IO::Color(204, 0, 102, 191), + IO::Color(255, 255, 255, 191), + IO::Color(255, 255, 255, 191), + IO::Color(255, 255, 255, 191), + IO::Color(255, 255, 255, 191), + IO::Color(255, 255, 255, 191), + IO::Color(255, 255, 255, 191), + IO::Color(12, 76, 25, 191), + IO::Color(178, 2, 25, 191), + IO::Color(51, 12, 153, 191), + IO::Color(229, 229, 5, 191), + IO::Color(0, 51, 102, 191), + IO::Color(25, 102, 102, 191), + IO::Color(204, 204, 204, 191), + IO::Color(178, 178, 0, 191), + IO::Color(178, 178, 0, 191), + IO::Color(178, 0, 178, 191), + IO::Color(178, 0, 178, 191), + IO::Color(0, 178, 178, 191), + IO::Color(0, 178, 178, 191), + IO::Color(229, 0, 0, 191), + IO::Color(229, 0, 0, 191), + IO::Color(0, 229, 0, 191), + IO::Color(0, 229, 0, 191), + IO::Color(0, 0, 229, 191), + IO::Color(0, 0, 229, 191), + IO::Color(191, 191, 191, 191), + IO::Color(191, 191, 191, 191), + IO::Color(204, 102, 0, 191), + IO::Color(204, 102, 0, 191), + IO::Color(0, 102, 204, 191), + IO::Color(0, 102, 204, 191), + IO::Color(0, 204, 102, 191), + IO::Color(0, 204, 102, 191), + IO::Color(102, 0, 204, 191), + IO::Color(102, 0, 204, 191), + IO::Color(204, 0, 102, 191), + IO::Color(204, 0, 102, 191), + IO::Color(178, 127, 51, 191), + IO::Color(178, 127, 51, 191), + IO::Color(178, 178, 0, 191), + IO::Color(178, 0, 178, 191), + IO::Color(0, 178, 178, 191), + IO::Color(229, 0, 0, 191), + IO::Color(0, 229, 0, 191), + IO::Color(0, 0, 229, 191), + IO::Color(191, 191, 191, 191), + IO::Color(204, 102, 0, 191), + IO::Color(102, 204, 0, 191), + IO::Color(0, 102, 204, 191), + IO::Color(0, 204, 102, 191), + IO::Color(102, 0, 204, 191), + IO::Color(204, 0, 102, 191), + IO::Color(178, 178, 0, 191), + IO::Color(178, 0, 178, 191), + IO::Color(0, 178, 178, 191), + IO::Color(229, 0, 0, 191), + IO::Color(0, 229, 0, 191), + IO::Color(0, 0, 229, 191), + IO::Color(191, 191, 191, 191), + IO::Color(204, 102, 0, 191), + IO::Color(102, 204, 0, 191), + IO::Color(0, 102, 204, 191), + IO::Color(0, 204, 102, 191), + IO::Color(102, 0, 204, 191), + IO::Color(204, 0, 102, 191), + IO::Color(178, 178, 0, 191), + IO::Color(178, 0, 178, 191), + IO::Color(0, 178, 178, 191), + IO::Color(229, 0, 0, 191), + IO::Color(0, 229, 0, 191), + IO::Color(0, 0, 229, 191), + IO::Color(191, 191, 191, 191), + IO::Color(204, 102, 0, 191), + IO::Color(102, 204, 0, 191), + IO::Color(0, 102, 204, 191), + IO::Color(0, 204, 102, 191), + IO::Color(102, 0, 204, 191), + IO::Color(204, 0, 102, 191), + IO::Color(120, 120, 120, 120) }; if(id > 148) id =148; return color[id]; } - static CGAL::Color get_color_from_line(std::istream &is) + static CGAL::IO::Color get_color_from_line(std::istream &is) { std::string color_info; bool is_float = false; @@ -573,7 +573,7 @@ public: if(index == 3) break; } - CGAL::Color color; + CGAL::IO::Color color; //if there were only one number, fetch the color in the color map if(index < 2) { @@ -581,7 +581,7 @@ public: //else create the color with the 3 values; } else{ - color = CGAL::Color(rgb[0], rgb[1], rgb[2]); + color = CGAL::IO::Color(rgb[0], rgb[1], rgb[2]); } std::iostream::pos_type ss_pos = iss.tellg(); if(ss_pos != std::iostream::pos_type(-1)) @@ -607,7 +607,7 @@ public: } else { - CGAL::Color color; + CGAL::IO::Color color; if(color_entries == 1){ color = get_indexed_color(static_cast(entries[first_color_index])); // the index in the color map r = color.red(); @@ -704,7 +704,7 @@ public: std::istringstream issline(line); entries.clear(); double d; - while(issline >> iformat(d)){ + while(issline >> IO::iformat(d)){ entries.push_back(d); } if(entries.empty()) diff --git a/Stream_support/include/CGAL/IO/OFF/File_writer_OFF.h b/Stream_support/include/CGAL/IO/OFF/File_writer_OFF.h index 56edbf80fdf..91860254f47 100644 --- a/Stream_support/include/CGAL/IO/OFF/File_writer_OFF.h +++ b/Stream_support/include/CGAL/IO/OFF/File_writer_OFF.h @@ -73,7 +73,7 @@ public: } else { - out() << '\n' << oformat(x) << ' ' << oformat(y) << ' ' << oformat(z); + out() << '\n' << IO::oformat(x) << ' ' << IO::oformat(y) << ' ' << IO::oformat(z); } } @@ -87,7 +87,7 @@ public: } else { - out() << ' ' << ' ' << oformat(x) << ' ' << oformat(y) << ' ' << oformat(z); + out() << ' ' << ' ' << IO::oformat(x) << ' ' << IO::oformat(y) << ' ' << IO::oformat(z); } } @@ -101,7 +101,7 @@ public: } else { - out() << ' ' << ' ' << oformat(r) << ' ' << oformat(g) << ' ' << oformat(b); + out() << ' ' << ' ' << IO::oformat(r) << ' ' << IO::oformat(g) << ' ' << IO::oformat(b); } } @@ -114,7 +114,7 @@ public: } else { - out() << ' ' << ' ' << oformat(tx) << ' ' << oformat(ty); + out() << ' ' << ' ' << IO::oformat(tx) << ' ' << IO::oformat(ty); } } diff --git a/Stream_support/include/CGAL/IO/OI/File_writer_inventor.h b/Stream_support/include/CGAL/IO/OI/File_writer_inventor.h index 587e4f14800..c10a9b7df9a 100644 --- a/Stream_support/include/CGAL/IO/OI/File_writer_inventor.h +++ b/Stream_support/include/CGAL/IO/OI/File_writer_inventor.h @@ -60,7 +60,7 @@ public: void write_vertex( const double x, const double y, const double z) { - out() << " " << oformat(x) << ' ' << oformat(y) << ' ' << oformat(z) << ',' <<'\n'; + out() << " " << IO::oformat(x) << ' ' << IO::oformat(y) << ' ' << IO::oformat(z) << ',' <<'\n'; } void write_vertex_normal(const double, const double, const double) { } diff --git a/Stream_support/include/CGAL/IO/PLY.h b/Stream_support/include/CGAL/IO/PLY.h index bfcebbf8d7c..6c38859388d 100644 --- a/Stream_support/include/CGAL/IO/PLY.h +++ b/Stream_support/include/CGAL/IO/PLY.h @@ -60,7 +60,7 @@ bool read_PLY(std::istream& is, typename std::enable_if::value>::type* = nullptr) { typedef typename boost::range_value::type Point_3; - typedef CGAL::Color Color_rgb; + typedef CGAL::IO::Color Color_rgb; if(!is.good()) { @@ -69,7 +69,7 @@ bool read_PLY(std::istream& is, return false; } - IO::internal::PLY_reader reader(verbose); + internal::PLY_reader reader(verbose); if(!(reader.init(is))) { @@ -79,7 +79,7 @@ bool read_PLY(std::istream& is, for(std::size_t i=0; iget(is); if(is.fail()) @@ -114,21 +114,21 @@ bool read_PLY(std::istream& is, std::tuple new_vertex; if(has_colors) { - IO::internal::process_properties(element, new_vertex, - make_ply_point_reader(CGAL::make_nth_of_tuple_property_map<0>(new_vertex)), - std::make_pair(CGAL::make_nth_of_tuple_property_map<1>(new_vertex), - PLY_property(rtag.c_str())), - std::make_pair(CGAL::make_nth_of_tuple_property_map<2>(new_vertex), - PLY_property(gtag.c_str())), - std::make_pair(CGAL::make_nth_of_tuple_property_map<3>(new_vertex), - PLY_property(btag.c_str()))); + internal::process_properties(element, new_vertex, + make_ply_point_reader(CGAL::make_nth_of_tuple_property_map<0>(new_vertex)), + std::make_pair(CGAL::make_nth_of_tuple_property_map<1>(new_vertex), + PLY_property(rtag.c_str())), + std::make_pair(CGAL::make_nth_of_tuple_property_map<2>(new_vertex), + PLY_property(gtag.c_str())), + std::make_pair(CGAL::make_nth_of_tuple_property_map<3>(new_vertex), + PLY_property(btag.c_str()))); *vc_out++ = Color_rgb(get<1>(new_vertex), get<2>(new_vertex), get<3>(new_vertex)); } else { - IO::internal::process_properties(element, new_vertex, - make_ply_point_reader(CGAL::make_nth_of_tuple_property_map<0>(new_vertex))); + internal::process_properties(element, new_vertex, + make_ply_point_reader(CGAL::make_nth_of_tuple_property_map<0>(new_vertex))); } points.push_back(get<0>(new_vertex)); @@ -138,19 +138,19 @@ bool read_PLY(std::istream& is, { if(element.has_property >("vertex_indices")) { - IO::internal::read_PLY_faces(is, element, polygons, fc_out, "vertex_indices"); + internal::read_PLY_faces(is, element, polygons, fc_out, "vertex_indices"); } else if(element.has_property >("vertex_indices")) { - IO::internal::read_PLY_faces(is, element, polygons, fc_out, "vertex_indices"); + internal::read_PLY_faces(is, element, polygons, fc_out, "vertex_indices"); } else if(element.has_property >("vertex_index")) { - IO::internal::read_PLY_faces(is, element, polygons, fc_out, "vertex_index"); + internal::read_PLY_faces(is, element, polygons, fc_out, "vertex_index"); } else if(element.has_property >("vertex_index")) { - IO::internal::read_PLY_faces(is, element, polygons, fc_out, "vertex_index"); + internal::read_PLY_faces(is, element, polygons, fc_out, "vertex_index"); } else { @@ -176,7 +176,7 @@ bool read_PLY(std::istream& is, { for(std::size_t k=0; kget(is); if(is.fail()) @@ -185,26 +185,26 @@ bool read_PLY(std::istream& is, if(has_uv) { - IO::internal::process_properties(element, new_hedge, - std::make_pair(CGAL::make_nth_of_tuple_property_map<0>(new_hedge), - PLY_property(stag.c_str())), - std::make_pair(CGAL::make_nth_of_tuple_property_map<1>(new_hedge), - PLY_property(ttag.c_str())), - std::make_pair(CGAL::make_nth_of_tuple_property_map<2>(new_hedge), - PLY_property(utag.c_str())), - std::make_pair(CGAL::make_nth_of_tuple_property_map<3>(new_hedge), - PLY_property(vtag.c_str()))); + internal::process_properties(element, new_hedge, + std::make_pair(CGAL::make_nth_of_tuple_property_map<0>(new_hedge), + PLY_property(stag.c_str())), + std::make_pair(CGAL::make_nth_of_tuple_property_map<1>(new_hedge), + PLY_property(ttag.c_str())), + std::make_pair(CGAL::make_nth_of_tuple_property_map<2>(new_hedge), + PLY_property(utag.c_str())), + std::make_pair(CGAL::make_nth_of_tuple_property_map<3>(new_hedge), + PLY_property(vtag.c_str()))); *hedges_out++ = std::make_pair(get<0>(new_hedge), get<1>(new_hedge)); *huvs_out++ = std::make_pair(get<2>(new_hedge), get<3>(new_hedge)); } else { - IO::internal::process_properties(element, new_hedge, - std::make_pair(CGAL::make_nth_of_tuple_property_map<0>(new_hedge), - PLY_property(stag.c_str())), - std::make_pair(CGAL::make_nth_of_tuple_property_map<1>(new_hedge), - PLY_property(ttag.c_str()))); + internal::process_properties(element, new_hedge, + std::make_pair(CGAL::make_nth_of_tuple_property_map<0>(new_hedge), + PLY_property(stag.c_str())), + std::make_pair(CGAL::make_nth_of_tuple_property_map<1>(new_hedge), + PLY_property(ttag.c_str()))); } } } @@ -214,7 +214,7 @@ bool read_PLY(std::istream& is, { for(std::size_t k=0; kget(is); if(is.fail()) return false; @@ -226,7 +226,6 @@ bool read_PLY(std::istream& is, } } // namespace internal -} // namespace IO /// \cond SKIP_IN_MANUAL @@ -239,14 +238,14 @@ bool read_PLY(std::istream& is, ColorRange& vcolors, HUVRange& huvs, const bool verbose = false, - typename boost::enable_if >::type* = nullptr) + typename boost::enable_if >::type* = nullptr) { - return IO::internal::read_PLY(is, points, polygons, - std::back_inserter(hedges), - std::back_inserter(fcolors), - std::back_inserter(vcolors), - std::back_inserter(huvs), - verbose); + return internal::read_PLY(is, points, polygons, + std::back_inserter(hedges), + std::back_inserter(fcolors), + std::back_inserter(vcolors), + std::back_inserter(huvs), + verbose); } template @@ -260,12 +259,12 @@ bool read_PLY(std::istream& is, std::vector > dummy_pui; std::vector > dummy_pf; - 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); + return 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); } /// \endcond @@ -315,7 +314,7 @@ bool read_PLY(std::istream& is, PolygonRange& polygons, const CGAL_BGL_NP_CLASS& np #ifndef DOXYGEN_RUNNING - , typename boost::enable_if >::type* = nullptr + , typename boost::enable_if >::type* = nullptr #endif ) { @@ -325,20 +324,20 @@ bool read_PLY(std::istream& is, std::vector > dummy_pui; std::vector > dummy_pf; - return IO::internal::read_PLY(is, points, polygons, std::back_inserter(dummy_pui), - choose_parameter(get_parameter(np, internal_np::face_color_output_iterator), - CGAL::Emptyset_iterator()), - choose_parameter(get_parameter(np, internal_np::vertex_color_output_iterator), - CGAL::Emptyset_iterator()), - std::back_inserter(dummy_pf), - choose_parameter(get_parameter(np, internal_np::verbose), true)); + return internal::read_PLY(is, points, polygons, std::back_inserter(dummy_pui), + choose_parameter(get_parameter(np, internal_np::face_color_output_iterator), + CGAL::Emptyset_iterator()), + choose_parameter(get_parameter(np, internal_np::vertex_color_output_iterator), + CGAL::Emptyset_iterator()), + std::back_inserter(dummy_pf), + choose_parameter(get_parameter(np, internal_np::verbose), true)); } /// \cond SKIP_IN_MANUAL template bool read_PLY(std::istream& is, PointRange& points, PolygonRange& polygons, - typename boost::enable_if >::type* = nullptr) + typename boost::enable_if >::type* = nullptr) { return read_PLY(is, points, polygons, parameters::all_default()); } @@ -386,7 +385,7 @@ bool read_PLY(const std::string& fname, PolygonRange& polygons, const CGAL_BGL_NP_CLASS& np #ifndef DOXYGEN_RUNNING - , typename boost::enable_if >::type* = nullptr + , typename boost::enable_if >::type* = nullptr #endif ) { @@ -394,13 +393,13 @@ bool read_PLY(const std::string& fname, if(binary) { std::ifstream is(fname, std::ios::binary); - CGAL::set_mode(is, CGAL::IO::BINARY); + CGAL::IO::set_mode(is, CGAL::IO::BINARY); return read_PLY(is, points, polygons, np); } else { std::ifstream is(fname); - CGAL::set_mode(is, CGAL::IO::ASCII); + CGAL::IO::set_mode(is, CGAL::IO::ASCII); return read_PLY(is, points, polygons, np); } } @@ -409,7 +408,7 @@ bool read_PLY(const std::string& fname, template bool read_PLY(const std::string& fname, PointRange& points, PolygonRange& polygons, - typename boost::enable_if >::type* = nullptr) + typename boost::enable_if >::type* = nullptr) { return read_PLY(fname, points, polygons, parameters::all_default()); } @@ -458,7 +457,7 @@ bool write_PLY(std::ostream& out, const PolygonRange& polygons, const CGAL_BGL_NP_CLASS& np #ifndef DOXYGEN_RUNNING - , typename boost::enable_if >::type* = nullptr + , typename boost::enable_if >::type* = nullptr #endif ) { @@ -472,27 +471,27 @@ bool write_PLY(std::ostream& out, // Write header out << "ply" << std::endl - << ((get_mode(out) == IO::BINARY) ? "format binary_little_endian 1.0" : "format ascii 1.0") << std::endl + << ((get_mode(out) == BINARY) ? "format binary_little_endian 1.0" : "format ascii 1.0") << std::endl << "comment Generated by the CGAL library" << std::endl << "element vertex " << points.size() << std::endl; - IO::internal::output_property_header(out, make_ply_point_writer(CGAL::Identity_property_map())); + internal::output_property_header(out, make_ply_point_writer(CGAL::Identity_property_map())); out << "element face " << polygons.size() << std::endl; - IO::internal::output_property_header(out, std::make_pair(CGAL::Identity_property_map(), - PLY_property >("vertex_indices"))); + internal::output_property_header(out, std::make_pair(CGAL::Identity_property_map(), + PLY_property >("vertex_indices"))); out << "end_header" << std::endl; for(std::size_t i=0; i())); + internal::output_properties(out, points.begin() + i, + make_ply_point_writer(CGAL::Identity_property_map())); for(std::size_t i=0; i(), - PLY_property >("vertex_indices"))); + internal::output_properties(out, polygons.begin() + i, + std::make_pair(CGAL::Identity_property_map(), + PLY_property >("vertex_indices"))); return out.good(); } @@ -501,7 +500,7 @@ bool write_PLY(std::ostream& out, template bool write_PLY(std::ostream& out, const PointRange& points, const PolygonRange& polygons, - typename boost::enable_if >::type* = nullptr) + typename boost::enable_if >::type* = nullptr) { return write_PLY(out, points, polygons, parameters::all_default()); } @@ -548,7 +547,7 @@ bool write_PLY(const std::string& fname, const PolygonRange& polygons, const CGAL_BGL_NP_CLASS& np #ifndef DOXYGEN_RUNNING - , typename boost::enable_if >::type* = nullptr + , typename boost::enable_if >::type* = nullptr #endif ) { @@ -556,13 +555,13 @@ bool write_PLY(const std::string& fname, if(binary) { std::ofstream os(fname, std::ios::binary); - CGAL::set_mode(os, CGAL::IO::BINARY); + CGAL::IO::set_mode(os, CGAL::IO::BINARY); return write_PLY(os, points, polygons, np); } else { std::ofstream os(fname); - CGAL::set_mode(os, CGAL::IO::ASCII); + CGAL::IO::set_mode(os, CGAL::IO::ASCII); return write_PLY(os, points, polygons, np); } } @@ -571,13 +570,15 @@ bool write_PLY(const std::string& fname, template bool write_PLY(const std::string& fname, const PointRange& points, const PolygonRange& polygons, - typename boost::enable_if >::type* = nullptr) + typename boost::enable_if >::type* = nullptr) { return write_PLY(fname, points, polygons, parameters::all_default()); } /// \endcond +} // namespace IO + } // namespace CGAL #endif // CGAL_IO_PLY_H diff --git a/Stream_support/include/CGAL/IO/PLY/PLY_reader.h b/Stream_support/include/CGAL/IO/PLY/PLY_reader.h index 62330c24e60..98c2fc0268d 100644 --- a/Stream_support/include/CGAL/IO/PLY/PLY_reader.h +++ b/Stream_support/include/CGAL/IO/PLY/PLY_reader.h @@ -46,6 +46,8 @@ namespace CGAL { +namespace IO { + /// \cond SKIP_IN_MANUAL // PLY types: @@ -135,7 +137,6 @@ make_ply_normal_writer(VectorMap normal_map) PLY_property::type>("nz")); } -namespace IO { namespace internal { class PLY_read_number @@ -194,7 +195,7 @@ public: void read_ascii(std::istream& stream, float& t) const { - if(!(stream >> iformat(t))) + if(!(stream >> IO::iformat(t))) stream.clear(std::ios::badbit); } @@ -707,7 +708,7 @@ bool read_PLY_faces(std::istream& in, CGAL::is_iterator::value >::type* = nullptr) { - typedef CGAL::Color Color_rgb; + typedef CGAL::IO::Color Color_rgb; bool has_colors = false; std::string rtag = "r", gtag = "g", btag = "b"; @@ -784,6 +785,14 @@ bool read_PLY_faces(std::istream& in, } // namespace PLY } // namespace internal +#ifndef CGAL_NO_DEPREACTED_CODE +using IO::PLY_property; +using IO::make_ply_normal_reader; +using IO::make_ply_normal_writer; +using IO::make_ply_point_reader; +using IO::make_ply_point_writer; +#endif + /// \endcond } // namespace CGAL diff --git a/Stream_support/include/CGAL/IO/PLY/PLY_writer.h b/Stream_support/include/CGAL/IO/PLY/PLY_writer.h index 901fdd63044..225aa740a3f 100644 --- a/Stream_support/include/CGAL/IO/PLY/PLY_writer.h +++ b/Stream_support/include/CGAL/IO/PLY/PLY_writer.h @@ -116,7 +116,7 @@ template void property_write(std::ostream& stream, ForwardIterator it, PropertyMap map) { - stream << CGAL::oformat(get(map, *it)); + stream << CGAL::IO::oformat(get(map, *it)); } template @@ -132,7 +132,7 @@ void simple_property_write(std::ostream& stream, ForwardIterator it, std::pair > map) { - if(CGAL::get_mode(stream) == CGAL::IO::ASCII) + if(CGAL::IO::get_mode(stream) == CGAL::IO::ASCII) stream << no_char_character(get(map.first, *it)); else { @@ -150,7 +150,7 @@ void simple_property_write(std::ostream& stream, { const typename PropertyMap::reference value = get(map.first, *it); - if(CGAL::get_mode(stream) == CGAL::IO::ASCII) + if(CGAL::IO::get_mode(stream) == CGAL::IO::ASCII) { stream << value.size(); for(std::size_t i = 0; i < value.size(); ++ i) @@ -176,7 +176,7 @@ void output_properties(std::ostream& stream, std::tuple... >&& current) { property_write(stream, it, std::get<0>(current)); - if(get_mode(stream) == CGAL::IO::ASCII) + if(CGAL::IO::get_mode(stream) == CGAL::IO::ASCII) stream << std::endl; } diff --git a/Stream_support/include/CGAL/IO/STL.h b/Stream_support/include/CGAL/IO/STL.h index 009e90b1ad4..52507655d33 100644 --- a/Stream_support/include/CGAL/IO/STL.h +++ b/Stream_support/include/CGAL/IO/STL.h @@ -36,6 +36,8 @@ namespace CGAL { +namespace IO { + //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// // Read @@ -77,7 +79,7 @@ bool read_STL(std::istream& is, TriangleRange& facets, const CGAL_BGL_NP_CLASS& np #ifndef DOXYGEN_RUNNING - , typename boost::enable_if >::type* = nullptr + , typename boost::enable_if >::type* = nullptr #endif ) { @@ -114,7 +116,7 @@ bool read_STL(std::istream& is, { if(binary) return false; - return IO::internal::parse_ASCII_STL(is, points, facets, verbose); + return internal::parse_ASCII_STL(is, points, facets, verbose); } // We are within the first 80 characters, both ASCII and binary are possible @@ -141,7 +143,7 @@ bool read_STL(std::istream& is, // If the first word is not 'solid', the file must be binary if(s != "solid" || (word[5] !='\n' && word[5] !='\r' && word[5] != ' ')) { - if(IO::internal::parse_binary_STL(is, points, facets, verbose)) + if(internal::parse_binary_STL(is, points, facets, verbose)) { return true; } @@ -151,14 +153,14 @@ bool read_STL(std::istream& is, // The file does not start with 'solid' anyway, so it's fine to reset it. is.clear(); is.seekg(0, std::ios::beg); - return IO::internal::parse_ASCII_STL(is, points, facets, verbose); + return internal::parse_ASCII_STL(is, points, facets, verbose); } } // Now, we have found the keyword "solid" which is supposed to indicate that the file is ASCII is.clear(); is.seekg(0, std::ios::beg); // the parser needs to read all "solid" to work correctly. - if(IO::internal::parse_ASCII_STL(is, points, facets, verbose)) + if(internal::parse_ASCII_STL(is, points, facets, verbose)) { // correctly read the input as an ASCII file return true; @@ -166,7 +168,7 @@ bool read_STL(std::istream& is, else// Failed to read the ASCII file { // It might have actually have been a binary file... ? - return IO::internal::parse_binary_STL(is, points, facets, verbose); + return internal::parse_binary_STL(is, points, facets, verbose); } } @@ -174,7 +176,7 @@ bool read_STL(std::istream& is, template bool read_STL(std::istream& is, PointRange& points, TriangleRange& facets, - typename boost::enable_if >::type* = nullptr) + typename boost::enable_if >::type* = nullptr) { return read_STL(is, points, facets, parameters::all_default()); } @@ -222,7 +224,7 @@ bool read_STL(const std::string& fname, TriangleRange& facets, const CGAL_BGL_NP_CLASS& np #ifndef DOXYGEN_RUNNING - , typename boost::enable_if >::type* = nullptr + , typename boost::enable_if >::type* = nullptr #endif ) { @@ -232,7 +234,7 @@ bool read_STL(const std::string& fname, if(binary) { std::ifstream is(fname, std::ios::binary); - CGAL::set_mode(is, CGAL::IO::BINARY); + CGAL::IO::set_mode(is, BINARY); if(read_STL(is, points, facets, np)) { return true; @@ -241,7 +243,7 @@ bool read_STL(const std::string& fname, facets.clear(); } std::ifstream is(fname); - CGAL::set_mode(is, CGAL::IO::ASCII); + CGAL::IO::set_mode(is, CGAL::IO::ASCII); bool v = choose_parameter(get_parameter(np, internal_np::verbose), false); return read_STL(is, points, facets, CGAL::parameters::verbose(v).use_binary_mode(false)); @@ -251,7 +253,7 @@ bool read_STL(const std::string& fname, template bool read_STL(const std::string& fname, PointRange& points, TriangleRange& facets, - typename boost::enable_if >::type* = nullptr) + typename boost::enable_if >::type* = nullptr) { return read_STL(fname, points, facets, parameters::all_default()); } @@ -297,7 +299,7 @@ bool write_STL(std::ostream& os, const TriangleRange& facets, const CGAL_BGL_NP_CLASS& np #ifndef DOXYGEN_RUNNING - , typename boost::enable_if >::type* = nullptr + , typename boost::enable_if >::type* = nullptr #endif ) { @@ -319,7 +321,7 @@ bool write_STL(std::ostream& os, set_stream_precision_from_NP(os, np); - if(get_mode(os) == IO::BINARY) + if(get_mode(os) == BINARY) { os << "FileType: Binary "; const boost::uint32_t N32 = static_cast(facets.size()); @@ -369,7 +371,7 @@ bool write_STL(std::ostream& os, template bool write_STL(std::ostream& os, const PointRange& points, const TriangleRange& facets, - typename boost::enable_if >::type* = nullptr) + typename boost::enable_if >::type* = nullptr) { return write_STL(os, points, facets, parameters::all_default()); } @@ -417,7 +419,7 @@ bool write_STL(const std::string& fname, const TriangleRange& facets, const CGAL_BGL_NP_CLASS& np #ifndef DOXYGEN_RUNNING - , typename boost::enable_if >::type* = nullptr + , typename boost::enable_if >::type* = nullptr #endif ) { @@ -425,13 +427,13 @@ bool write_STL(const std::string& fname, if(binary) { std::ofstream os(fname, std::ios::binary); - CGAL::set_mode(os, CGAL::IO::BINARY); + CGAL::IO::set_mode(os, CGAL::IO::BINARY); return write_STL(os, points, facets, np); } else { std::ofstream os(fname); - CGAL::set_mode(os, CGAL::IO::ASCII); + CGAL::IO::set_mode(os, CGAL::IO::ASCII); return write_STL(os, points, facets, np); } } @@ -440,13 +442,15 @@ bool write_STL(const std::string& fname, template bool write_STL(const std::string& fname, const PointRange& points, const TriangleRange& facets, - typename boost::enable_if >::type* = nullptr) + typename boost::enable_if >::type* = nullptr) { return write_STL(fname, points, facets, parameters::all_default()); } /// \endcond +} // namespace IO + } // namespace CGAL #endif // CGAL_IO_STL_H diff --git a/Stream_support/include/CGAL/IO/STL/STL_reader.h b/Stream_support/include/CGAL/IO/STL/STL_reader.h index 09aaf71f4ab..919ceeddd56 100644 --- a/Stream_support/include/CGAL/IO/STL/STL_reader.h +++ b/Stream_support/include/CGAL/IO/STL/STL_reader.h @@ -84,7 +84,7 @@ bool read_ASCII_facet(std::istream& is, } else { - IO::internal::fill_point(x, y, z, 1 /*w*/, p); + fill_point(x, y, z, 1 /*w*/, p); typename std::map::iterator iti = index_map.insert(std::make_pair(p, -1)).first; if(iti->second == -1) @@ -252,7 +252,7 @@ bool parse_binary_STL(std::istream& is, } Point p; - IO::internal::fill_point(x, y, z, 1 /*w*/, p); + fill_point(x, y, z, 1 /*w*/, p); typename std::map::iterator iti = index_map.insert(std::make_pair(p, -1)).first; diff --git a/Stream_support/include/CGAL/IO/VRML/File_writer_VRML_2.h b/Stream_support/include/CGAL/IO/VRML/File_writer_VRML_2.h index 48e58fa64ec..e95c5c2467d 100644 --- a/Stream_support/include/CGAL/IO/VRML/File_writer_VRML_2.h +++ b/Stream_support/include/CGAL/IO/VRML/File_writer_VRML_2.h @@ -74,7 +74,7 @@ public: void write_vertex( const double x, const double y, const double z) { out() << " " - << oformat(x) << ' ' << oformat(y) << ' ' << oformat(z) << ',' << '\n'; + << IO::oformat(x) << ' ' << IO::oformat(y) << ' ' << IO::oformat(z) << ',' << '\n'; } void write_vertex_normal(const double, const double, const double) { } void write_vertex_color(const double, const double, const double) { } diff --git a/Stream_support/include/CGAL/IO/VRML/VRML_2_ostream.h b/Stream_support/include/CGAL/IO/VRML/VRML_2_ostream.h index d200643068d..d664810e8ee 100644 --- a/Stream_support/include/CGAL/IO/VRML/VRML_2_ostream.h +++ b/Stream_support/include/CGAL/IO/VRML/VRML_2_ostream.h @@ -30,7 +30,7 @@ class VRML_2_ostream public: VRML_2_ostream() : m_os(nullptr) {} VRML_2_ostream(std::ostream& o) : m_os(&o) { header(); } - ~VRML_2_ostream() CGAL_NOEXCEPT(CGAL_NO_ASSERTIONS_BOOL) + ~VRML_2_ostream() noexcept(!CGAL_ASSERTIONS_ENABLED) { CGAL_destructor_assertion_catch( close(); diff --git a/Stream_support/include/CGAL/IO/VTK.h b/Stream_support/include/CGAL/IO/VTK.h index d56dd2f0d11..68fed07bef2 100644 --- a/Stream_support/include/CGAL/IO/VTK.h +++ b/Stream_support/include/CGAL/IO/VTK.h @@ -89,7 +89,6 @@ bool vtkPointSet_to_polygon_soup(vtkPointSet* poly_data, return true; } } // namespace internal -} // namespace IO //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -109,14 +108,14 @@ bool read_VTP(const std::string& fname, } vtkSmartPointer data; - vtkSmartPointer obs = - vtkSmartPointer::New(); + vtkSmartPointer obs = + vtkSmartPointer::New(); - data = vtkPolyData::SafeDownCast(IO::internal::read_vtk_file(fname, obs)->GetOutput()); + data = vtkPolyData::SafeDownCast(internal::read_vtk_file(fname, obs)->GetOutput()); if (obs->GetError()) return false; - return IO::internal::vtkPointSet_to_polygon_soup(data, points, polygons, np); + return internal::vtkPointSet_to_polygon_soup(data, points, polygons, np); } /*! @@ -150,7 +149,6 @@ bool read_VTP(const std::string& fname, PointRange& points, PolygonRange& polygo //////////////////////////////////////////////////////////////////////////////////////////////////// // Write -namespace IO { namespace internal { // writes the polys appended data at the end of the .vtp file @@ -345,7 +343,6 @@ void write_soup_polys_points(std::ostream& os, } } // namespace internal -} // namespace IO /*! * \ingroup PkgStreamSupportIoFuncsVTP @@ -421,16 +418,16 @@ bool write_VTP(std::ostream& os, const bool binary = choose_parameter(get_parameter(np, internal_np::use_binary_mode), true); std::vector size_map; std::vector cell_type; - IO::internal::write_soup_points_tag(os, points, binary, offset); - IO::internal::write_soup_polys_tag(os, polygons, binary, offset, size_map, cell_type); + internal::write_soup_points_tag(os, points, binary, offset); + internal::write_soup_polys_tag(os, polygons, binary, offset, size_map, cell_type); os << " \n" << " \n"; if(binary) { os << "\n_"; - IO::internal::write_soup_polys_points(os, points); - IO::internal::write_soup_polys(os, polygons,size_map, cell_type); + internal::write_soup_polys_points(os, points); + internal::write_soup_polys(os, polygons,size_map, cell_type); } os << "" << std::endl; } @@ -488,13 +485,13 @@ bool write_VTP(const std::string& fname, if(binary) { std::ofstream os(fname, std::ios::binary); - CGAL::set_mode(os, CGAL::IO::BINARY); + CGAL::IO::set_mode(os, CGAL::IO::BINARY); return write_VTP(os, points, polygons, np); } else { std::ofstream os(fname); - CGAL::set_mode(os, CGAL::IO::ASCII); + CGAL::IO::set_mode(os, CGAL::IO::ASCII); return write_VTP(os, points, polygons, np); } } @@ -509,6 +506,8 @@ bool write_VTP(const std::string& fname, const PointRange& points, const Polygon /// \endcond +} // namespace IO + } // namespace CGAL #endif // defined(CGAL_USE_VTK) || defined(DOXYGEN_RUNNING) diff --git a/Stream_support/include/CGAL/IO/WKT.h b/Stream_support/include/CGAL/IO/WKT.h index 9f81d43f7a9..3c1cadc849d 100644 --- a/Stream_support/include/CGAL/IO/WKT.h +++ b/Stream_support/include/CGAL/IO/WKT.h @@ -39,6 +39,7 @@ #include namespace CGAL { +namespace IO { namespace internal { template @@ -127,7 +128,7 @@ bool read_multi_point_WKT(std::istream& in, if(!in.good()) return false; - internal::Geometry_container gc(mp); + CGAL::internal::Geometry_container gc(mp); std::string line; while(std::getline(in, line)) { @@ -173,7 +174,7 @@ bool read_linestring_WKT(std::istream& in, if(!in.good()) return false; - internal::Geometry_container gc(polyline); + CGAL::internal::Geometry_container gc(polyline); std::string line; while(std::getline(in, line)) { @@ -218,10 +219,10 @@ bool read_multi_linestring_WKT(std::istream& in, return false; typedef typename MultiLineString::value_type PointRange; - typedef internal::Geometry_container LineString; + typedef CGAL::internal::Geometry_container LineString; std::vector pr_range; - internal::Geometry_container, boost::geometry::multi_linestring_tag> gc(pr_range); + CGAL::internal::Geometry_container, boost::geometry::multi_linestring_tag> gc(pr_range); std::string line; while(std::getline(in, line)) { @@ -316,7 +317,7 @@ bool read_multi_polygon_WKT(std::istream& in, if(!in.good()) return false; - internal::Geometry_container gc(polygons); + CGAL::internal::Geometry_container gc(polygons); std::string line; while(std::getline(in, line)) { @@ -336,7 +337,7 @@ bool read_multi_polygon_WKT(std::istream& in, return false; }; - for(typename internal::Geometry_container::iterator it = gc.begin(); it != gc.end(); ++it) + for(typename CGAL::internal::Geometry_container::iterator it = gc.begin(); it != gc.end(); ++it) internal::pop_back_if_equal_to_front(*it); break; @@ -402,7 +403,7 @@ std::ostream& write_linestring_WKT(std::ostream& out, if(!out.good()) return out; - internal::Geometry_container gc(ls); + CGAL::internal::Geometry_container gc(ls); out << boost::geometry::wkt(gc) << std::endl; return out; } @@ -423,7 +424,7 @@ std::ostream& write_multi_point_WKT(std::ostream& out, if(!out.good()) return out; - internal::Geometry_container gc(mp); + CGAL::internal::Geometry_container gc(mp); out << boost::geometry::wkt(gc) << std::endl; return out; } @@ -444,7 +445,7 @@ std::ostream& write_multi_polygon_WKT(std::ostream& out, if(!out.good()) return out; - internal::Geometry_container gc(polygons); + CGAL::internal::Geometry_container gc(polygons); out << boost::geometry::wkt(gc) << std::endl; return out; } @@ -457,7 +458,7 @@ std::ostream& write_multi_polygon_WKT(std::ostream& out, //! //! \attention Only Cartesian Kernels with double or float as `FT` are supported. //! -//! \see `CGAL::write_linestring_WKT()` +//! \see `CGAL::IO::write_linestring_WKT()` template std::ostream& write_multi_linestring_WKT(std::ostream& out, MultiLineString& mls) @@ -466,7 +467,7 @@ std::ostream& write_multi_linestring_WKT(std::ostream& out, return out; typedef typename MultiLineString::value_type PointRange; - typedef internal::Geometry_container LineString; + typedef CGAL::internal::Geometry_container LineString; std::vector pr_range; for(PointRange& pr : mls) @@ -475,7 +476,7 @@ std::ostream& write_multi_linestring_WKT(std::ostream& out, pr_range.push_back(ls); } - internal::Geometry_container, boost::geometry::multi_linestring_tag> gc(pr_range); + CGAL::internal::Geometry_container, boost::geometry::multi_linestring_tag> gc(pr_range); out << boost::geometry::wkt(gc) << std::endl; return out; @@ -492,7 +493,7 @@ std::ostream& write_multi_linestring_WKT(std::ostream& out, //! //! \attention Only Cartesian Kernels with double or float as `FT` are supported. //! -//! \see `CGAL::read_linestring_WKT()` +//! \see `CGAL::IO::read_linestring_WKT()` template @@ -531,40 +532,40 @@ bool read_WKT(std::istream& is, if(type == "POINT") { Point p; - CGAL::read_point_WKT(is, p); + CGAL::IO::read_point_WKT(is, p); points.push_back(p); } else if(type == "LINESTRING") { LineString l; - CGAL::read_linestring_WKT(is, l); + CGAL::IO::read_linestring_WKT(is, l); polylines.push_back(l); } else if(type == "POLYGON") { Polygon p; - CGAL::read_polygon_WKT(is, p); + CGAL::IO::read_polygon_WKT(is, p); if(!p.outer_boundary().is_empty()) polygons.push_back(p); } else if(type == "MULTIPOINT") { MultiPoint mp; - CGAL::read_multi_point_WKT(is, mp); + CGAL::IO::read_multi_point_WKT(is, mp); for(const Point& point : mp) points.push_back(point); } else if(type == "MULTILINESTRING") { MultiLineString mls; - CGAL::read_multi_linestring_WKT(is, mls); + CGAL::IO::read_multi_linestring_WKT(is, mls); for(const LineString& ls : mls) polylines.push_back(ls); } else if(type == "MULTIPOLYGON") { MultiPolygon mp; - CGAL::read_multi_polygon_WKT(is, mp); + CGAL::IO::read_multi_polygon_WKT(is, mp); for(const Polygon& poly : mp) polygons.push_back(poly); } @@ -574,6 +575,24 @@ bool read_WKT(std::istream& is, return !is.fail(); } +} // namespace IO + +#ifndef CGAL_NO_DEPRECATED_CODE +using IO::read_linestring_WKT; +using IO::read_multi_linestring_WKT; +using IO::read_multi_point_WKT; +using IO::read_multi_polygon_WKT; +using IO::read_point_WKT; +using IO::read_polygon_WKT; +using IO::read_WKT; +using IO::write_linestring_WKT; +using IO::write_multi_linestring_WKT; +using IO::write_multi_point_WKT; +using IO::write_multi_polygon_WKT; +using IO::write_point_WKT; +using IO::write_polygon_WKT; +#endif + } // namespace CGAL #endif // BOOST VERSION CHECKS diff --git a/Stream_support/include/CGAL/IO/io.h b/Stream_support/include/CGAL/IO/io.h index 9de4c84e962..7b103f9b9cf 100644 --- a/Stream_support/include/CGAL/IO/io.h +++ b/Stream_support/include/CGAL/IO/io.h @@ -70,14 +70,14 @@ would be `PointC2(0.0, 0.0)`. At the moment \cgal does not provide input operations for pretty printed data. By default a stream is in Ascii mode. -\sa `CGAL::set_mode()` -\sa `CGAL::set_ascii_mode()` -\sa `CGAL::set_binary_mode()` -\sa `CGAL::set_pretty_mode()` -\sa `CGAL::get_mode()` -\sa `CGAL::is_ascii()` -\sa `CGAL::is_binary()` -\sa `CGAL::is_pretty()` +\sa `CGAL::IO::set_mode()` +\sa `CGAL::IO::set_ascii_mode()` +\sa `CGAL::IO::set_binary_mode()` +\sa `CGAL::IO::set_pretty_mode()` +\sa `CGAL::IO::get_mode()` +\sa `CGAL::IO::is_ascii()` +\sa `CGAL::IO::is_binary()` +\sa `CGAL::IO::is_pretty()` */ enum Mode {ASCII = 0, PRETTY, BINARY}; @@ -94,14 +94,14 @@ as `cout` or `cerr`, as well as to `std::ostringstream` and `std::ofstream`. The output operator is defined for all classes in the \cgal `Kernel` and for the class `Color` as well. -\sa `CGAL::set_mode()` -\sa `CGAL::set_ascii_mode()` -\sa `CGAL::set_binary_mode()` -\sa `CGAL::set_pretty_mode()` -\sa `CGAL::get_mode()` -\sa `CGAL::is_ascii()` -\sa `CGAL::is_binary()` -\sa `CGAL::is_pretty()` +\sa `CGAL::IO::set_mode()` +\sa `CGAL::IO::set_ascii_mode()` +\sa `CGAL::IO::set_binary_mode()` +\sa `CGAL::IO::set_pretty_mode()` +\sa `CGAL::IO::get_mode()` +\sa `CGAL::IO::is_ascii()` +\sa `CGAL::IO::is_binary()` +\sa `CGAL::IO::is_pretty()` */ ostream& operator<<(ostream& os, Class c); @@ -113,14 +113,14 @@ from the class `istream`. This allows to read from istreams as `std::cin`, as well as from `std::istringstream` and `std::ifstream`. The input operator is defined for all classes in the \cgal `Kernel`. -\sa `CGAL::set_mode()` -\sa `CGAL::set_ascii_mode()` -\sa `CGAL::set_binary_mode()` -\sa `CGAL::set_pretty_mode()` -\sa `CGAL::get_mode()` -\sa `CGAL::is_ascii()` -\sa `CGAL::is_binary()` -\sa `CGAL::is_pretty()` +\sa `CGAL::IO::set_mode()` +\sa `CGAL::IO::set_ascii_mode()` +\sa `CGAL::IO::set_binary_mode()` +\sa `CGAL::IO::set_pretty_mode()` +\sa `CGAL::IO::get_mode()` +\sa `CGAL::IO::is_ascii()` +\sa `CGAL::IO::is_binary()` +\sa `CGAL::IO::is_pretty()` */ istream& operator>>(istream& is, Class c); #endif @@ -199,6 +199,8 @@ public: template std::ostream& operator<<( std::ostream& out, Output_rep rep) { return rep( out); } +namespace IO { + /*! \ingroup PkgStreamSupportRef @@ -219,6 +221,8 @@ Generic IO for type `T` with formatting tag. template Output_rep oformat( const T& t, F) { return Output_rep(t); } +} // namespace IO + /*! \ingroup PkgStreamSupportRef @@ -394,6 +398,8 @@ The input operator is defined for all classes in the \cgal `Kernel`. template std::istream& operator>>( std::istream& in, Input_rep rep) { return rep(in); } +namespace IO { + /*! \ingroup PkgStreamSupportRef @@ -402,6 +408,8 @@ The definition of this function is completely symmetric to `oformat()`. template Input_rep iformat( T& t) { return Input_rep(t); } +} // namespace IO + template class Benchmark_rep { @@ -420,6 +428,8 @@ public: template std::ostream& operator<<( std::ostream& out, Benchmark_rep rep) { return rep( out); } +namespace IO { + template Benchmark_rep bmformat( const T& t) { return Benchmark_rep(t); } @@ -432,82 +442,82 @@ Benchmark_rep bmformat( const T& t, F) { return Benchmark_rep(t); } returns the printing mode of the %IO stream `s`. \link PkgStreamSupportEnumRef `CGAL::IO::Mode`\endlink -\sa `CGAL::set_mode()` -\sa `CGAL::set_ascii_mode()` -\sa `CGAL::set_binary_mode()` -\sa `CGAL::set_pretty_mode()` -\sa `CGAL::is_ascii()` -\sa `CGAL::is_binary()` -\sa `CGAL::is_pretty()` +\sa `CGAL::IO::set_mode()` +\sa `CGAL::IO::set_ascii_mode()` +\sa `CGAL::IO::set_binary_mode()` +\sa `CGAL::IO::set_pretty_mode()` +\sa `CGAL::IO::is_ascii()` +\sa `CGAL::IO::is_binary()` +\sa `CGAL::IO::is_pretty()` */ -inline IO::Mode get_mode(std::ios& i) +inline Mode get_mode(std::ios& i) { - return static_cast(i.iword(IO::Static::get_mode())); + return static_cast(i.iword(Static::get_mode())); } /*! \ingroup PkgStreamSupportRef -sets the mode of the %IO stream `s` to be the `IO::ASCII` mode. +sets the mode of the %IO stream `s` to be the `ASCII` mode. Returns the previous mode of `s`. \link PkgStreamSupportEnumRef `CGAL::IO::Mode`\endlink -\sa `CGAL::set_mode()` -\sa `CGAL::set_binary_mode()` -\sa `CGAL::set_pretty_mode()` -\sa `CGAL::get_mode()` -\sa `CGAL::is_ascii()` -\sa `CGAL::is_binary()` -\sa `CGAL::is_pretty()` +\sa `CGAL::IO::set_mode()` +\sa `CGAL::IO::set_binary_mode()` +\sa `CGAL::IO::set_pretty_mode()` +\sa `CGAL::IO::get_mode()` +\sa `CGAL::IO::is_ascii()` +\sa `CGAL::IO::is_binary()` +\sa `CGAL::IO::is_pretty()` */ -inline IO::Mode set_ascii_mode(std::ios& i) +inline Mode set_ascii_mode(std::ios& i) { - IO::Mode m = get_mode(i); - i.iword(IO::Static::get_mode()) = IO::ASCII; + Mode m = get_mode(i); + i.iword(Static::get_mode()) = ASCII; return m; } /*! \ingroup PkgStreamSupportRef -sets the mode of the %IO stream `s` to be the `IO::BINARY` mode. +sets the mode of the %IO stream `s` to be the `BINARY` mode. Returns the previous mode of `s`. \link PkgStreamSupportEnumRef `CGAL::IO::Mode`\endlink -\sa `CGAL::set_mode()` -\sa `CGAL::set_ascii_mode()` -\sa `CGAL::set_pretty_mode()` -\sa `CGAL::get_mode()` -\sa `CGAL::is_ascii()` -\sa `CGAL::is_binary()` -\sa `CGAL::is_pretty()` +\sa `CGAL::IO::set_mode()` +\sa `CGAL::IO::set_ascii_mode()` +\sa `CGAL::IO::set_pretty_mode()` +\sa `CGAL::IO::get_mode()` +\sa `CGAL::IO::is_ascii()` +\sa `CGAL::IO::is_binary()` +\sa `CGAL::IO::is_pretty()` */ -inline IO::Mode set_binary_mode(std::ios& i) +inline Mode set_binary_mode(std::ios& i) { - IO::Mode m = get_mode(i); - i.iword(IO::Static::get_mode()) = IO::BINARY; + Mode m = get_mode(i); + i.iword(Static::get_mode()) = BINARY; return m; } /*! \ingroup PkgStreamSupportRef -sets the mode of the %IO stream `s` to be the `IO::PRETTY` mode. +sets the mode of the %IO stream `s` to be the `PRETTY` mode. Returns the previous mode of `s`. \link PkgStreamSupportEnumRef `CGAL::IO::Mode`\endlink -\sa `CGAL::set_mode()` -\sa `CGAL::set_ascii_mode()` -\sa `CGAL::set_binary_mode()` -\sa `CGAL::get_mode()` -\sa `CGAL::is_ascii()` -\sa `CGAL::is_binary()` -\sa `CGAL::is_pretty()` +\sa `CGAL::IO::set_mode()` +\sa `CGAL::IO::set_ascii_mode()` +\sa `CGAL::IO::set_binary_mode()` +\sa `CGAL::IO::get_mode()` +\sa `CGAL::IO::is_ascii()` +\sa `CGAL::IO::is_binary()` +\sa `CGAL::IO::is_pretty()` */ -inline IO::Mode set_pretty_mode(std::ios& i) +inline Mode set_pretty_mode(std::ios& i) { - IO::Mode m = get_mode(i); - i.iword(IO::Static::get_mode()) = IO::PRETTY; + Mode m = get_mode(i); + i.iword(Static::get_mode()) = PRETTY; return m; } @@ -517,68 +527,70 @@ inline IO::Mode set_pretty_mode(std::ios& i) sets the printing mode of the %IO stream `s`. \link PkgStreamSupportEnumRef `CGAL::IO::Mode`\endlink -\sa `CGAL::set_ascii_mode()` -\sa `CGAL::set_binary_mode()` -\sa `CGAL::set_pretty_mode()` -\sa `CGAL::get_mode()` -\sa `CGAL::is_ascii()` -\sa `CGAL::is_binary()` -\sa `CGAL::is_pretty()` +\sa `CGAL::IO::set_ascii_mode()` +\sa `CGAL::IO::set_binary_mode()` +\sa `CGAL::IO::set_pretty_mode()` +\sa `CGAL::IO::get_mode()` +\sa `CGAL::IO::is_ascii()` +\sa `CGAL::IO::is_binary()` +\sa `CGAL::IO::is_pretty()` */ -inline IO::Mode set_mode(std::ios& i, IO::Mode m) +inline Mode set_mode(std::ios& i, Mode m) { - IO::Mode old = get_mode(i); - i.iword(IO::Static::get_mode()) = m; + Mode old = get_mode(i); + i.iword(Static::get_mode()) = m; return old; } /*! \ingroup PkgStreamSupportRef -checks if the %IO stream `s` is in `IO::PRETTY` mode. +checks if the %IO stream `s` is in `PRETTY` mode. \link PkgStreamSupportEnumRef `CGAL::IO::Mode`\endlink -\sa `CGAL::set_mode()` -\sa `CGAL::set_ascii_mode()` -\sa `CGAL::set_binary_mode()` -\sa `CGAL::set_pretty_mode()` -\sa `CGAL::get_mode()` -\sa `CGAL::is_ascii()` -\sa `CGAL::is_binary()` +\sa `CGAL::IO::set_mode()` +\sa `CGAL::IO::set_ascii_mode()` +\sa `CGAL::IO::set_binary_mode()` +\sa `CGAL::IO::set_pretty_mode()` +\sa `CGAL::IO::get_mode()` +\sa `CGAL::IO::is_ascii()` +\sa `CGAL::IO::is_binary()` */ -inline bool is_pretty(std::ios& i) { return i.iword(IO::Static::get_mode()) == IO::PRETTY; } +inline bool is_pretty(std::ios& i) { return i.iword(Static::get_mode()) == PRETTY; } /*! \ingroup PkgStreamSupportRef -checks if the %IO stream `s` is in `IO::ASCII` mode. +checks if the %IO stream `s` is in `ASCII` mode. \link PkgStreamSupportEnumRef `CGAL::IO::Mode`\endlink -\sa `CGAL::set_mode()` -\sa `CGAL::set_ascii_mode()` -\sa `CGAL::set_binary_mode()` -\sa `CGAL::set_pretty_mode()` -\sa `CGAL::get_mode()` -\sa `CGAL::is_binary()` -\sa `CGAL::is_pretty()` +\sa `CGAL::IO::set_mode()` +\sa `CGAL::IO::set_ascii_mode()` +\sa `CGAL::IO::set_binary_mode()` +\sa `CGAL::IO::set_pretty_mode()` +\sa `CGAL::IO::get_mode()` +\sa `CGAL::IO::is_binary()` +\sa `CGAL::IO::is_pretty()` */ -inline bool is_ascii(std::ios& i) { return i.iword(IO::Static::get_mode()) == IO::ASCII; } +inline bool is_ascii(std::ios& i) { return i.iword(Static::get_mode()) == ASCII; } /*! \ingroup PkgStreamSupportRef -checks if the %IO stream `s` is in `IO::BINARY` mode. +checks if the %IO stream `s` is in `BINARY` mode. \link PkgStreamSupportEnumRef `CGAL::IO::Mode`\endlink -\sa `CGAL::set_mode()` -\sa `CGAL::set_ascii_mode()` -\sa `CGAL::set_binary_mode()` -\sa `CGAL::set_pretty_mode()` -\sa `CGAL::get_mode()` -\sa `CGAL::is_ascii()` -\sa `CGAL::is_pretty()` +\sa `CGAL::IO::set_mode()` +\sa `CGAL::IO::set_ascii_mode()` +\sa `CGAL::IO::set_binary_mode()` +\sa `CGAL::IO::set_pretty_mode()` +\sa `CGAL::IO::get_mode()` +\sa `CGAL::IO::is_ascii()` +\sa `CGAL::IO::is_pretty()` */ -inline bool is_binary(std::ios& i) { return i.iword(IO::Static::get_mode()) == IO::BINARY; } +inline bool is_binary(std::ios& i) { return i.iword(Static::get_mode()) == BINARY; } + +} // namespace IO template < class T > inline void write(std::ostream& os, const T& t, const io_Read_write&) @@ -589,7 +601,7 @@ inline void write(std::ostream& os, const T& t, const io_Read_write&) template < class T > inline void write(std::ostream& os, const T& t, const io_Operator&) { - os << oformat(t); + os << IO::oformat(t); } template < class T > @@ -613,7 +625,7 @@ inline void read(std::istream& is, T& t, const io_Read_write&) template < class T > inline void read(std::istream& is, T& t, const io_Operator&) { - is >> iformat(t); + is >> IO::iformat(t); } template < class T > @@ -628,16 +640,18 @@ inline void read(std::istream& is, T& t) read(is, t, typename Io_traits::Io_tag()); } +namespace IO { + inline std::ostream& operator<<( std::ostream& out, const Color& col) { switch(get_mode(out)) { - case IO::ASCII : + case ASCII : return out << static_cast(col.red()) << ' ' << static_cast(col.green()) << ' ' << static_cast(col.blue()) << ' ' << static_cast(col.alpha()); - case IO::BINARY : + case BINARY : out.write(reinterpret_cast(col.to_rgba().data()), 4); return out; default: @@ -655,14 +669,14 @@ inline std::istream &operator>>(std::istream &is, Color& col) switch(get_mode(is)) { - case IO::ASCII : + case ASCII : is >> ir >> ig >> ib >> ia; r = (unsigned char)ir; g = (unsigned char)ig; b = (unsigned char)ib; a = (unsigned char)ia; break; - case IO::BINARY : + case BINARY : read(is, r); read(is, g); read(is, b); @@ -685,6 +699,23 @@ inline const char* mode_name( IO::Mode m ) return names[m]; } +} // IO namespace + +#ifndef CGAL_NO_DEPRECATED_CODE +using IO::oformat; +using IO::iformat; +using IO::bmformat; +using IO::get_mode; +using IO::set_ascii_mode; +using IO::set_binary_mode; +using IO::set_pretty_mode; +using IO::set_mode; +using IO::is_pretty; +using IO::is_ascii; +using IO::is_binary; +using IO::mode_name; +#endif + // From polynomial.h TODO: Where to put this? inline void swallow(std::istream &is, char d) { diff --git a/Stream_support/include/CGAL/IO/polygon_soup_io.h b/Stream_support/include/CGAL/IO/polygon_soup_io.h index 718e95f317a..4934720e26a 100644 --- a/Stream_support/include/CGAL/IO/polygon_soup_io.h +++ b/Stream_support/include/CGAL/IO/polygon_soup_io.h @@ -30,6 +30,8 @@ namespace CGAL { +namespace IO { + //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// // Read @@ -79,7 +81,7 @@ bool read_polygon_soup(const std::string& fname, { const bool verbose = parameters::choose_parameter(parameters::get_parameter(np, internal_np::verbose), false); - const std::string ext = IO::internal::get_file_extension(fname); + const std::string ext = internal::get_file_extension(fname); if(ext == std::string()) { if(verbose) @@ -169,7 +171,7 @@ bool write_polygon_soup(const std::string& fname, { const bool verbose = parameters::choose_parameter(parameters::get_parameter(np, internal_np::verbose), false); - const std::string ext = IO::internal::get_file_extension(fname); + const std::string ext = internal::get_file_extension(fname); if(ext == std::string()) { if(verbose) @@ -215,6 +217,8 @@ bool write_polygon_soup(const std::string& fname, PointRange& points, PolygonRan /// \endcond +} // namespace IO + } // namespace CGAL #endif // CGAL_IO_READ_POLYGON_SOUP_H diff --git a/Stream_support/test/Stream_support/test_GOCAD.cpp b/Stream_support/test/Stream_support/test_GOCAD.cpp index 5d5838651fc..3ea0044bdb3 100644 --- a/Stream_support/test/Stream_support/test_GOCAD.cpp +++ b/Stream_support/test/Stream_support/test_GOCAD.cpp @@ -18,7 +18,7 @@ int main(int argc, char** argv) std::vector points; std::vector polygons; - bool ok = CGAL::read_GOCAD(gocad_file, points, polygons); + bool ok = CGAL::IO::read_GOCAD(gocad_file, points, polygons); assert(ok); std::cout << points.size() << " points and " << polygons.size() << " polygons" << std::endl; @@ -28,37 +28,37 @@ int main(int argc, char** argv) points.clear(); polygons.clear(); std::string gocad_string(gocad_file); - ok = CGAL::read_GOCAD(gocad_string, points, polygons); + ok = CGAL::IO::read_GOCAD(gocad_string, points, polygons); assert(ok); points.clear(); polygons.clear(); std::ifstream is(gocad_file); - ok = CGAL::read_GOCAD(is, points, polygons); + ok = CGAL::IO::read_GOCAD(is, points, polygons); assert(ok); is.close(); - ok = CGAL::write_GOCAD(gocad_file, points, polygons); + ok = CGAL::IO::write_GOCAD(gocad_file, points, polygons); assert(ok); std::ofstream os("tmp.ts"); - ok = CGAL::write_GOCAD(os, points, polygons); + ok = CGAL::IO::write_GOCAD(os, points, polygons); assert(ok); os.close(); - ok = CGAL::write_GOCAD("tmp.ts", points, polygons); + ok = CGAL::IO::write_GOCAD("tmp.ts", points, polygons); assert(ok); const std::size_t ptn = points.size(); const std::size_t pln = polygons.size(); - ok = CGAL::write_polygon_soup("tmp.ts", points, polygons); + ok = CGAL::IO::write_polygon_soup("tmp.ts", points, polygons); assert(ok); points.clear(); polygons.clear(); - ok = CGAL::read_polygon_soup("tmp.ts", points, polygons); + ok = CGAL::IO::read_polygon_soup("tmp.ts", points, polygons); assert(ok); assert(points.size() == ptn); diff --git a/Stream_support/test/Stream_support/test_OBJ.cpp b/Stream_support/test/Stream_support/test_OBJ.cpp index 1d37863dca5..e72960ecf43 100644 --- a/Stream_support/test/Stream_support/test_OBJ.cpp +++ b/Stream_support/test/Stream_support/test_OBJ.cpp @@ -18,7 +18,7 @@ int main(int argc, char** argv) std::vector points; std::vector polygons; - bool ok = CGAL::read_OBJ(obj_file, points, polygons, CGAL::parameters::verbose(true)); + bool ok = CGAL::IO::read_OBJ(obj_file, points, polygons, CGAL::parameters::verbose(true)); assert(ok); std::cout << points.size() << " points and " << polygons.size() << " polygons" << std::endl; @@ -28,40 +28,40 @@ int main(int argc, char** argv) points.clear(); polygons.clear(); std::string obj_string(obj_file); - ok = CGAL::read_OBJ(obj_string, points, polygons); + ok = CGAL::IO::read_OBJ(obj_string, points, polygons); assert(ok); points.clear(); polygons.clear(); std::ifstream is(obj_file); - ok = CGAL::read_OBJ(is, points, polygons); + ok = CGAL::IO::read_OBJ(is, points, polygons); assert(ok); is.close(); is.open(obj_file, std::ios::binary); - ok = CGAL::read_OBJ(is, points, polygons); + ok = CGAL::IO::read_OBJ(is, points, polygons); assert(ok); is.close(); std::ofstream os("tmp.obj"); - ok = CGAL::write_OBJ(os, points, polygons); + ok = CGAL::IO::write_OBJ(os, points, polygons); assert(ok); os.close(); - ok = CGAL::write_OBJ("tmp.obj", points, polygons); + ok = CGAL::IO::write_OBJ("tmp.obj", points, polygons); assert(ok); std::vector pts_backup = points; std::vector pls_backup = polygons; - ok = CGAL::write_polygon_soup("tmp.obj", points, polygons); + ok = CGAL::IO::write_polygon_soup("tmp.obj", points, polygons); assert(ok); points.clear(); polygons.clear(); - ok = CGAL::read_polygon_soup("tmp.obj", points, polygons); + ok = CGAL::IO::read_polygon_soup("tmp.obj", points, polygons); assert(ok); assert(points.size() == pts_backup.size()); diff --git a/Stream_support/test/Stream_support/test_OFF.cpp b/Stream_support/test/Stream_support/test_OFF.cpp index c0e21adc399..fe38b75e6dc 100644 --- a/Stream_support/test/Stream_support/test_OFF.cpp +++ b/Stream_support/test/Stream_support/test_OFF.cpp @@ -18,7 +18,7 @@ int main(int argc, char** argv) std::vector points; std::vector polygons; - bool ok = CGAL::read_OFF(off_file, points, polygons); + bool ok = CGAL::IO::read_OFF(off_file, points, polygons); assert(ok); std::cout << points.size() << " points and " << polygons.size() << " polygons" << std::endl; @@ -28,41 +28,41 @@ int main(int argc, char** argv) points.clear(); polygons.clear(); std::string off_string(off_file); - ok = CGAL::read_OFF(off_string, points, polygons); + ok = CGAL::IO::read_OFF(off_string, points, polygons); assert(ok); points.clear(); polygons.clear(); std::ifstream is(off_file); - ok = CGAL::read_OFF(is, points, polygons); + ok = CGAL::IO::read_OFF(is, points, polygons); assert(ok); is.close(); points.clear(); polygons.clear(); is.open(off_file, std::ios::binary); - ok = CGAL::read_OFF(is, points, polygons); + ok = CGAL::IO::read_OFF(is, points, polygons); assert(ok); is.close(); std::ofstream os("tmp.off", std::ios::binary); - ok = CGAL::write_OFF(os, points, polygons); + ok = CGAL::IO::write_OFF(os, points, polygons); assert(ok); os.close(); - ok = CGAL::write_OFF("tmp.off", points, polygons); + ok = CGAL::IO::write_OFF("tmp.off", points, polygons); assert(ok); std::vector pts_backup = points; std::vector pls_backup = polygons; - ok = CGAL::write_polygon_soup("tmp.off", points, polygons); + ok = CGAL::IO::write_polygon_soup("tmp.off", points, polygons); assert(ok); points.clear(); polygons.clear(); - ok = CGAL::read_polygon_soup("tmp.off", points, polygons); + ok = CGAL::IO::read_polygon_soup("tmp.off", points, polygons); assert(ok); assert(points.size() == pts_backup.size()); diff --git a/Stream_support/test/Stream_support/test_PLY.cpp b/Stream_support/test/Stream_support/test_PLY.cpp index f33d307ecb7..6a727f2dbbb 100644 --- a/Stream_support/test/Stream_support/test_PLY.cpp +++ b/Stream_support/test/Stream_support/test_PLY.cpp @@ -18,7 +18,7 @@ int main(int argc, char** argv) std::vector points; std::vector polygons; - bool ok = CGAL::read_PLY(ply_file, points, polygons); + bool ok = CGAL::IO::read_PLY(ply_file, points, polygons); assert(ok); std::cout << points.size() << " points and " << polygons.size() << " polygons" << std::endl; @@ -28,33 +28,33 @@ int main(int argc, char** argv) points.clear(); polygons.clear(); std::string ply_string(ply_file); - ok = CGAL::read_PLY(ply_string, points, polygons); + ok = CGAL::IO::read_PLY(ply_string, points, polygons); assert(ok); points.clear(); polygons.clear(); std::ifstream is(ply_file); - ok = CGAL::read_PLY(is, points, polygons); + ok = CGAL::IO::read_PLY(is, points, polygons); assert(ok); is.close(); points.clear(); polygons.clear(); is.open(ply_file, std::ios::binary); - ok = CGAL::read_PLY(is, points, polygons); + ok = CGAL::IO::read_PLY(is, points, polygons); assert(ok); is.close(); - ok = CGAL::write_PLY("tmp.ply", points, polygons); + ok = CGAL::IO::write_PLY("tmp.ply", points, polygons); assert(ok); - ok = CGAL::write_polygon_soup("tmp.ply", points, polygons); + ok = CGAL::IO::write_polygon_soup("tmp.ply", points, polygons); assert(ok); std::ofstream os("tmp.ply"); - CGAL::set_binary_mode(os); - ok = CGAL::write_PLY(os, points, polygons); + CGAL::IO::set_binary_mode(os); + ok = CGAL::IO::write_PLY(os, points, polygons); assert(ok); os.close(); @@ -63,7 +63,7 @@ int main(int argc, char** argv) points.clear(); polygons.clear(); - ok = CGAL::read_polygon_soup("tmp.ply", points, polygons); + ok = CGAL::IO::read_polygon_soup("tmp.ply", points, polygons); assert(ok); assert(points.size() == pts_backup.size()); diff --git a/Stream_support/test/Stream_support/test_STL.cpp b/Stream_support/test/Stream_support/test_STL.cpp index 4e201eb0882..9fd3dffe5f0 100644 --- a/Stream_support/test/Stream_support/test_STL.cpp +++ b/Stream_support/test/Stream_support/test_STL.cpp @@ -27,7 +27,7 @@ void read(const char* fname, std::size_t v, std::size_t f, std::vector points; std::vector faces; - bool ok = CGAL::read_STL(input, points, faces, CGAL::parameters::use_binary_mode(is_binary)); + bool ok = CGAL::IO::read_STL(input, points, faces, CGAL::parameters::use_binary_mode(is_binary)); assert(ok != should_fail); if(!should_fail) { @@ -75,7 +75,7 @@ int main(int argc, char** argv) std::vector points; std::vector polygons; - bool ok = CGAL::read_STL(stl_file, points, polygons, CGAL::parameters::verbose(true)); + bool ok = CGAL::IO::read_STL(stl_file, points, polygons, CGAL::parameters::verbose(true)); assert(ok); std::cout << points.size() << " points and " << polygons.size() << " polygons" << std::endl; @@ -85,31 +85,31 @@ int main(int argc, char** argv) points.clear(); polygons.clear(); std::string stl_string(stl_file); - ok = CGAL::read_STL(stl_string, points, polygons); + ok = CGAL::IO::read_STL(stl_string, points, polygons); assert(ok); points.clear(); polygons.clear(); std::ifstream is(stl_file); - ok = CGAL::read_STL(is, points, polygons); + ok = CGAL::IO::read_STL(is, points, polygons); assert(ok); points.clear(); polygons.clear(); is.clear(); is.seekg(0, is.beg); - ok = CGAL::read_STL(is, points, polygons, CGAL::parameters::use_binary_mode(false)); + ok = CGAL::IO::read_STL(is, points, polygons, CGAL::parameters::use_binary_mode(false)); assert(ok); is.close(); - ok = CGAL::write_STL("tmp.stl", points, polygons); + ok = CGAL::IO::write_STL("tmp.stl", points, polygons); assert(ok); - ok = CGAL::write_polygon_soup("tmp.stl", points, polygons); + ok = CGAL::IO::write_polygon_soup("tmp.stl", points, polygons); assert(ok); std::ofstream os("tmp.stl"); - CGAL::set_binary_mode(os); - ok = CGAL::write_STL(os, points, polygons); + CGAL::IO::set_binary_mode(os); + ok = CGAL::IO::write_STL(os, points, polygons); assert(ok); os.close(); @@ -119,7 +119,7 @@ int main(int argc, char** argv) points.clear(); polygons.clear(); - ok = CGAL::read_polygon_soup("tmp.stl", points, polygons); + ok = CGAL::IO::read_polygon_soup("tmp.stl", points, polygons); assert(ok); assert(points.size() == pts_backup.size()); diff --git a/Stream_support/test/Stream_support/test_WKT.cpp b/Stream_support/test/Stream_support/test_WKT.cpp index 426469bff3b..31171b7e822 100644 --- a/Stream_support/test/Stream_support/test_WKT.cpp +++ b/Stream_support/test/Stream_support/test_WKT.cpp @@ -29,42 +29,42 @@ bool test_read_WKT() Point p; { std::ifstream in("data/point.wkt"); - if(!CGAL::read_point_WKT(in, p)) + if(!CGAL::IO::read_point_WKT(in, p)) return false; CGAL_assertion(p == Point(2,3)); } { std::ifstream in("data/linestring.wkt"); Linestring ls; - if(!CGAL::read_linestring_WKT(in, ls)) + if(!CGAL::IO::read_linestring_WKT(in, ls)) return false; CGAL_assertion(ls.size() == 3); } { Poly poly; std::ifstream in("data/polygon.wkt"); - if(!CGAL::read_polygon_WKT(in, poly)) + if(!CGAL::IO::read_polygon_WKT(in, poly)) return false; CGAL_assertion(poly.outer_boundary().size() == 3); } { MultiPoint pees; std::ifstream in("data/multipoint.wkt"); - if(!CGAL::read_multi_point_WKT(in, pees)) + if(!CGAL::IO::read_multi_point_WKT(in, pees)) return false; CGAL_assertion(pees.size() == 4); } { std::ifstream in("data/multilinestring.wkt"); MultiLinestring mls; - if(!CGAL::read_multi_linestring_WKT(in, mls)) + if(!CGAL::IO::read_multi_linestring_WKT(in, mls)) return false; CGAL_assertion(mls.size() == 2); } { MultiPolygon polies; std::ifstream in("data/multipolygon.wkt"); - if(!CGAL::read_multi_polygon_WKT(in, polies)) + if(!CGAL::IO::read_multi_polygon_WKT(in, polies)) return false; CGAL_assertion(polies.size() == 2); } @@ -176,13 +176,13 @@ bool test_write_WKT() { std::ofstream os("test.wkt"); os.precision(17); - CGAL::write_point_WKT(os, p); + CGAL::IO::write_point_WKT(os, p); os.close(); } Point test_p; { std::ifstream is("test.wkt"); - CGAL::read_point_WKT(is, test_p); + CGAL::IO::read_point_WKT(is, test_p); is.close(); } CGAL_assertion(p == test_p); @@ -191,13 +191,13 @@ bool test_write_WKT() { std::ofstream os("test.wkt"); os.precision(17); - CGAL::write_linestring_WKT(os, ls); + CGAL::IO::write_linestring_WKT(os, ls); os.close(); } Linestring test_ls; { std::ifstream is("test.wkt"); - CGAL::read_linestring_WKT(is, test_ls); + CGAL::IO::read_linestring_WKT(is, test_ls); is.close(); } CGAL_assertion(ls == test_ls); @@ -206,13 +206,13 @@ bool test_write_WKT() { std::ofstream os("test.wkt"); os.precision(17); - CGAL::write_polygon_WKT(os, poly); + CGAL::IO::write_polygon_WKT(os, poly); os.close(); } Poly test_poly; { std::ifstream is("test.wkt"); - CGAL::read_polygon_WKT(is, test_poly); + CGAL::IO::read_polygon_WKT(is, test_poly); is.close(); } @@ -222,13 +222,13 @@ bool test_write_WKT() { std::ofstream os("test.wkt"); os.precision(17); - CGAL::write_multi_point_WKT(os, pees); + CGAL::IO::write_multi_point_WKT(os, pees); os.close(); } MultiPoint test_pees; { std::ifstream is("test.wkt"); - CGAL::read_multi_point_WKT(is, test_pees); + CGAL::IO::read_multi_point_WKT(is, test_pees); is.close(); } CGAL_assertion(pees== test_pees); @@ -237,13 +237,13 @@ bool test_write_WKT() { std::ofstream os("test.wkt"); os.precision(17); - CGAL::write_multi_linestring_WKT(os, mls); + CGAL::IO::write_multi_linestring_WKT(os, mls); os.close(); } MultiLinestring test_mls; { std::ifstream is("test.wkt"); - CGAL::read_multi_linestring_WKT(is, test_mls); + CGAL::IO::read_multi_linestring_WKT(is, test_mls); is.close(); } bool ok = true; @@ -255,13 +255,13 @@ bool test_write_WKT() { std::ofstream os("test.wkt"); os.precision(17); - CGAL::write_multi_polygon_WKT(os, polies); + CGAL::IO::write_multi_polygon_WKT(os, polies); os.close(); } MultiPolygon test_polies; { std::ifstream is("test.wkt"); - CGAL::read_multi_polygon_WKT(is, test_polies); + CGAL::IO::read_multi_polygon_WKT(is, test_polies); is.close(); } CGAL_assertion(polies == test_polies); diff --git a/Stream_support/test/Stream_support/test_ioformat.cpp b/Stream_support/test/Stream_support/test_ioformat.cpp index 6c4ba850e80..e4e4e13e67e 100644 --- a/Stream_support/test/Stream_support/test_ioformat.cpp +++ b/Stream_support/test/Stream_support/test_ioformat.cpp @@ -36,9 +36,9 @@ void test_io(const NT& x){ assert( x == tmp ); }{ std::ostringstream os; - os << ::CGAL::oformat(x); + os << ::CGAL::IO::oformat(x); std::istringstream is(os.str()); - is >> ::CGAL::iformat(tmp); + is >> ::CGAL::IO::iformat(tmp); assert( x == tmp ); }{ std::ostringstream os; diff --git a/Stream_support/test/Stream_support/test_support.cpp b/Stream_support/test/Stream_support/test_support.cpp index 46fe0e01560..95548ee2d5e 100644 --- a/Stream_support/test/Stream_support/test_support.cpp +++ b/Stream_support/test/Stream_support/test_support.cpp @@ -38,24 +38,24 @@ int main() typedef CGAL::Istream_iterator IteratorI; { std::ostringstream out; - CGAL::set_ascii_mode( out); - assert( CGAL::is_ascii( out)); + CGAL::IO::set_ascii_mode( out); + assert( CGAL::IO::is_ascii( out)); out << Point( 1, 2) << '\0'; std::istringstream in( out.str() ); - CGAL::set_ascii_mode(in); - assert( CGAL::is_ascii(in)); + CGAL::IO::set_ascii_mode(in); + assert( CGAL::IO::is_ascii(in)); Point p; in >> p; assert( p == Point( 1, 2)); } { std::ostringstream out; - CGAL::set_ascii_mode( out); + CGAL::IO::set_ascii_mode( out); IteratorO o(out); *o = Point( 1, 2); out << '\0'; std::istringstream in( out.str() ); - CGAL::set_ascii_mode( in); + CGAL::IO::set_ascii_mode( in); IteratorI i(in); Point p = *i; assert( p == Point( 1, 2)); diff --git a/Surface_mesh/benchmark/lcc_performance_2.h b/Surface_mesh/benchmark/lcc_performance_2.h index 849467b27d5..a230cac75db 100644 --- a/Surface_mesh/benchmark/lcc_performance_2.h +++ b/Surface_mesh/benchmark/lcc_performance_2.h @@ -95,7 +95,7 @@ private: virtual bool write_mesh(const char* _filename) { std::ofstream ofs(_filename); - CGAL::write_off(lcc, ofs); + CGAL::IO::write_OFF(lcc, ofs); return true; } diff --git a/Surface_mesh/benchmark/surface_mesh_performance.h b/Surface_mesh/benchmark/surface_mesh_performance.h index e114d73c45e..9ab57e28c9a 100644 --- a/Surface_mesh/benchmark/surface_mesh_performance.h +++ b/Surface_mesh/benchmark/surface_mesh_performance.h @@ -53,7 +53,7 @@ private: virtual bool read_mesh(const char* _filename) { CGAL::Memory_sizer ms; - bool b = CGAL::read_OFF(mesh, _filename); + bool b = CGAL::IO::read_OFF(mesh, _filename); std::cout << "memory consumption: " << ms.virtual_size() << " " << ms.resident_size() << std::endl; return b; } @@ -61,7 +61,7 @@ private: virtual bool write_mesh(const char* _filename) { - return CGAL::write_OFF(mesh, _filename); + return CGAL::IO::write_OFF(mesh, _filename); } @@ -283,7 +283,7 @@ private: namespace SMS = CGAL::Surface_mesh_simplification ; mesh.clear(); - bool b = CGAL::read_OFF(_filename, mesh); + bool b = CGAL::IO::read_OFF(_filename, mesh); SMS::Count_ratio_stop_predicate stop(0.1); int r = SMS::edge_collapse(mesh, stop); } diff --git a/Surface_mesh/examples/Surface_mesh/draw_surface_mesh.cpp b/Surface_mesh/examples/Surface_mesh/draw_surface_mesh.cpp index 60e390b95c8..143501a70f6 100644 --- a/Surface_mesh/examples/Surface_mesh/draw_surface_mesh.cpp +++ b/Surface_mesh/examples/Surface_mesh/draw_surface_mesh.cpp @@ -14,7 +14,7 @@ int main(int argc, char* argv[]) const char* filename = (argc>1) ? argv[1] : "data/elephant.off"; Mesh sm; - if(!CGAL::read_polygon_mesh(filename, sm)) + if(!CGAL::IO::read_polygon_mesh(filename, sm)) { std::cerr << "Invalid input file." << std::endl; return EXIT_FAILURE; diff --git a/Surface_mesh/examples/Surface_mesh/draw_surface_mesh_small_faces.h b/Surface_mesh/examples/Surface_mesh/draw_surface_mesh_small_faces.h index a574c2d738d..39a89eac77c 100644 --- a/Surface_mesh/examples/Surface_mesh/draw_surface_mesh_small_faces.h +++ b/Surface_mesh/examples/Surface_mesh/draw_surface_mesh_small_faces.h @@ -78,7 +78,7 @@ protected: bool issmall=false; // Default color of faces - CGAL::Color c(75,160,255); + CGAL::IO::Color c(75,160,255); // Compare the size of the face with the % m_threshold bool exist; @@ -89,7 +89,7 @@ protected: // It it is smaller, color the face in red. if (get(faces_size, fh)::vertex_descriptor vertex_descriptor; int main(int /* argc */, char* argv[]) { Mesh sm; - if(!CGAL::read_polygon_mesh(argv[1], sm)) + if(!CGAL::IO::read_polygon_mesh(argv[1], sm)) { std::cerr << "Invalid input file." << std::endl; return EXIT_FAILURE; diff --git a/Surface_mesh/examples/Surface_mesh/sm_do_intersect.cpp b/Surface_mesh/examples/Surface_mesh/sm_do_intersect.cpp index c6583404588..974394a27dc 100644 --- a/Surface_mesh/examples/Surface_mesh/sm_do_intersect.cpp +++ b/Surface_mesh/examples/Surface_mesh/sm_do_intersect.cpp @@ -113,7 +113,7 @@ int main(int argc, char* argv[]) std::cout.precision(17); Mesh P, Q; - if(!CGAL::read_polygon_mesh(argv[1], P) || !CGAL::read_polygon_mesh(argv[2], Q)) + if(!CGAL::IO::read_polygon_mesh(argv[1], P) || !CGAL::IO::read_polygon_mesh(argv[2], Q)) { std::cerr << "Invalid input files." << std::endl; return EXIT_FAILURE; diff --git a/Surface_mesh/examples/Surface_mesh/sm_draw_small_faces.cpp b/Surface_mesh/examples/Surface_mesh/sm_draw_small_faces.cpp index a243b14e4f3..694e0cd995d 100644 --- a/Surface_mesh/examples/Surface_mesh/sm_draw_small_faces.cpp +++ b/Surface_mesh/examples/Surface_mesh/sm_draw_small_faces.cpp @@ -17,7 +17,7 @@ int main(int argc, char* argv[]) const char* filename = (argc>1) ? argv[1] : "data/elephant.off"; Mesh sm; - if(!CGAL::read_polygon_mesh(filename, sm)) + if(!CGAL::IO::read_polygon_mesh(filename, sm)) { std::cerr << "Invalid input file." << std::endl; return EXIT_FAILURE; diff --git a/Surface_mesh/examples/Surface_mesh/sm_join.cpp b/Surface_mesh/examples/Surface_mesh/sm_join.cpp index 187c816e142..12770121943 100644 --- a/Surface_mesh/examples/Surface_mesh/sm_join.cpp +++ b/Surface_mesh/examples/Surface_mesh/sm_join.cpp @@ -16,7 +16,7 @@ int main(int argc, char* argv[]) const char* filename2 = (argc>2) ? argv[2] : "data/quad.off"; Mesh sm1, sm2; - if(!CGAL::read_polygon_mesh(filename1, sm1) || !CGAL::read_polygon_mesh(filename2, sm2)) + if(!CGAL::IO::read_polygon_mesh(filename1, sm1) || !CGAL::IO::read_polygon_mesh(filename2, sm2)) { std::cerr << "Invalid input files." << std::endl; return EXIT_FAILURE; @@ -33,5 +33,5 @@ int main(int argc, char* argv[]) for(vertex_descriptor vd : vertices(sm1)) std::cerr << vd << " " << name1[vd] < CGAL_DEPRECATED bool read_mesh(Surface_mesh& sm, const std::string& filename) { - return read_polygon_mesh(filename, sm); + return IO::read_polygon_mesh(filename, sm); } /*! \ingroup PkgSurfaceMeshIOFuncDeprecated - \deprecated This function is deprecated since \cgal 5.2, `CGAL::write_polygon_mesh()` should be used instead. + \deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::write_polygon_mesh()` should be used instead. */ template CGAL_DEPRECATED bool write_mesh(const Surface_mesh& mesh, const std::string& filename) { - return write_polygon_mesh(filename, mesh); + return IO::write_polygon_mesh(filename, mesh); } #endif // CGAL_NO_DEPRECATED_CODE diff --git a/Surface_mesh/include/CGAL/Surface_mesh/IO/3MF.h b/Surface_mesh/include/CGAL/Surface_mesh/IO/3MF.h index 2f0b1d83f0c..227d0c9ec06 100644 --- a/Surface_mesh/include/CGAL/Surface_mesh/IO/3MF.h +++ b/Surface_mesh/include/CGAL/Surface_mesh/IO/3MF.h @@ -30,6 +30,8 @@ namespace CGAL { +namespace IO { + // @todo generalize it to any model of `FaceGraph` and put it in BGL/IO (see read_OFF for the face color map) /*! @@ -60,9 +62,9 @@ bool read_3MF(const std::string& filename, std::vector all_points; std::vector all_triangles; std::vector names; - std::vector > all_colors; + std::vector > all_colors; - const bool success = CGAL::read_3MF(filename, all_points, all_triangles, all_colors, names); + const bool success = CGAL::IO::read_3MF(filename, all_points, all_triangles, all_colors, names); if(!success) { std::cerr << "Error in reading meshes." << std::endl; @@ -79,7 +81,7 @@ bool read_3MF(const std::string& filename, SMesh sm; TriangleRange triangles = all_triangles[i]; PointRange points = all_points[i]; - std::vector colors = all_colors[i]; + std::vector colors = all_colors[i]; // Create the surface mesh from scratch std::size_t n(points.size()); @@ -119,8 +121,8 @@ bool read_3MF(const std::string& filename, if(need_pmap) { - typename SMesh::template Property_map fcolor = - sm.template add_property_map("f:color", first).first; + typename SMesh::template Property_map fcolor = + sm.template add_property_map("f:color", first).first; for(std::size_t pid=0, cs=colors.size(); pid CGAL_DEPRECATED int read_3mf(const std::string& filename, std::vector >& output) { - return read_3MF(filename, output); + return IO::read_3MF(filename, output); } #endif // CGAL_NO_DEPRECATED_CODE diff --git a/Surface_mesh/include/CGAL/Surface_mesh/IO/OFF.h b/Surface_mesh/include/CGAL/Surface_mesh/IO/OFF.h index d8200a7592e..eea075e92ac 100644 --- a/Surface_mesh/include/CGAL/Surface_mesh/IO/OFF.h +++ b/Surface_mesh/include/CGAL/Surface_mesh/IO/OFF.h @@ -36,9 +36,8 @@ namespace CGAL { //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// // Read - -namespace internal { namespace IO { +namespace internal { template > @@ -60,7 +59,7 @@ template DefaultMap; + CGAL::IO::Color> DefaultMap; typedef DefaultMap DefaultMap_const; public: typedef typename internal_np::Lookup_named_param_def DefaultMap; + CGAL::IO::Color> DefaultMap; typedef DefaultMap DefaultMap_const; public: @@ -107,9 +106,9 @@ bool read_OFF_with_or_without_fcolors(std::istream& is, { typedef Surface_mesh Mesh; typedef typename Mesh::Face_index Face_index; - typedef CGAL::Color Color; + typedef CGAL::IO::Color Color; - typedef typename CGAL::internal::IO::GetFaceColorMap::type FCM; + typedef typename GetFaceColorMap::type FCM; using parameters::choose_parameter; using parameters::is_default_parameter; @@ -148,7 +147,7 @@ bool read_OFF_with_or_without_vtextures(std::istream& is, typedef typename GetK, CGAL_BGL_NP_CLASS>::Kernel K; typedef typename K::Point_2 Texture; - typedef typename CGAL::internal::IO::GetVertexTextureMap::type VTM; + typedef typename GetVertexTextureMap::type VTM; using parameters::choose_parameter; using parameters::is_default_parameter; @@ -185,8 +184,8 @@ bool read_OFF_with_or_without_vcolors(std::istream& is, typedef Surface_mesh Mesh; typedef typename Mesh::Vertex_index Vertex_index; - typedef CGAL::Color Color; - typedef typename CGAL::internal::IO::GetVertexColorMap::type VCM; + typedef CGAL::IO::Color Color; + typedef typename GetVertexColorMap::type VCM; using parameters::choose_parameter; using parameters::is_default_parameter; @@ -225,7 +224,7 @@ bool read_OFF_with_or_without_vnormals(std::istream& is, typedef typename GetK, CGAL_BGL_NP_CLASS>::Kernel K; typedef typename K::Vector_3 Normal; - typedef typename CGAL::internal::IO::GetVertexNormalMap::type VNM; + typedef typename GetVertexNormalMap::type VNM; using parameters::choose_parameter; using parameters::is_default_parameter; @@ -253,7 +252,6 @@ bool read_OFF_with_or_without_vnormals(std::istream& is, } } -} // namespace IO } // namespace internal /// \ingroup PkgSurfaceMeshIOFuncOFF @@ -301,7 +299,7 @@ bool read_OFF_with_or_without_vnormals(std::istream& is, /// \cgalParamNBegin{vertex_color_map} /// \cgalParamDescription{a property map associating colors to the vertices of `sm`} /// \cgalParamType{a class model of `WritablePropertyMap` with `Surface_mesh::Vertex_index` -/// as key type and `CGAL::Color` as value type} +/// as key type and `CGAL::IO::Color` as value type} /// \cgalParamDefault{If this parameter is unsused, vertex colors (if they exist) /// will be written in an internal property map called `v:color`.} /// \cgalParamNEnd @@ -317,7 +315,7 @@ bool read_OFF_with_or_without_vnormals(std::istream& is, /// \cgalParamNBegin{face_color_map} /// \cgalParamDescription{a property map associating colors to the faces of `sm`} /// \cgalParamType{a class model of `WritablePropertyMap` with `Surface_mesh::Face_index` -/// as key type and `CGAL::Color` as value type} +/// as key type and `CGAL::IO::Color` as value type} /// \cgalParamDefault{If this parameter is unsused, face colors (if they exist) /// will be written in an internal property map called `f:color`.} /// \cgalParamNEnd @@ -340,43 +338,70 @@ bool read_OFF(std::istream& is, CGAL::File_scanner_OFF scanner(is, false); is.seekg(pos); - bool res = internal::IO::read_OFF_with_or_without_vnormals(is, sm, scanner, np); + bool res = internal::read_OFF_with_or_without_vnormals(is, sm, scanner, np); if(!res) sm.clear(); return res; } -#ifndef CGAL_NO_DEPRECATED_CODE - -/*! - \ingroup PkgSurfaceMeshIOFuncDeprecated - \deprecated This function is deprecated since \cgal 5.2, `CGAL::read_OFF(std::istream&, const Surface_mesh&)` should be used instead. -*/ -template -CGAL_DEPRECATED bool read_off(std::istream& is, Surface_mesh& sm, const CGAL_BGL_NP_CLASS& np) -{ - return read_OFF(is, sm, np); -} - -/*! - \ingroup PkgSurfaceMeshIOFuncDeprecated - \deprecated This function is deprecated since \cgal 5.2, `CGAL::read_OFF(std::istream&, const Surface_mesh&)` should be used instead. -*/ template -CGAL_DEPRECATED bool read_off(std::istream& is, Surface_mesh& sm) +bool read_OFF(std::istream& is, + Surface_mesh& sm) { return read_OFF(is, sm, parameters::all_default()); } +template +bool read_OFF(const std::string& fname, + Surface_mesh& sm, + const CGAL_BGL_NP_CLASS& np) +{ + std::ifstream in(fname.c_str()); + return read_OFF(in, sm, np); +} + +template +bool read_OFF(const std::string& fname, + Surface_mesh& sm) +{ + return read_OFF(fname, sm, parameters::all_default()); +} + +} // namespace IO + +#ifndef CGAL_NO_DEPRECATED_CODE + /*! \ingroup PkgSurfaceMeshIOFuncDeprecated - \deprecated This function is deprecated since \cgal 5.2, `CGAL::read_OFF(std::istream&, const Surface_mesh&)` should be used instead. + \deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::read_OFF(std::istream&, const Surface_mesh&)` should be used instead. +*/ +template +CGAL_DEPRECATED bool read_off(std::istream& is, Surface_mesh& sm, const CGAL_BGL_NP_CLASS& np) +{ + return IO::read_OFF(is, sm, np); +} + +/*! + \ingroup PkgSurfaceMeshIOFuncDeprecated + \deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::read_OFF(std::istream&, const Surface_mesh&)` should be used instead. +*/ +template +CGAL_DEPRECATED bool read_off(std::istream& is, Surface_mesh& sm) +{ + return IO::read_OFF(is, sm, parameters::all_default()); +} + +/*! + \ingroup PkgSurfaceMeshIOFuncDeprecated + \deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::read_OFF(std::istream&, const Surface_mesh&)` should be used instead. */ template CGAL_DEPRECATED bool read_off(Surface_mesh& sm, const std::string& filename) { - return read_OFF(filename, sm, parameters::all_default()); + return IO::read_OFF(filename, sm, parameters::all_default()); } #endif // CGAL_NO_DEPRECATED_CODE @@ -395,7 +420,7 @@ bool write_OFF_with_or_without_fcolors(std::ostream& os, { typedef Surface_mesh Mesh; typedef typename Mesh::Face_index Face_index; - typedef CGAL::Color Color; + typedef CGAL::IO::Color Color; using parameters::choose_parameter; using parameters::is_default_parameter; @@ -405,7 +430,7 @@ bool write_OFF_with_or_without_fcolors(std::ostream& os, typename Mesh::template Property_map fcolors; bool has_internal_fcolors; - std::tie(fcolors, has_internal_fcolors) = sm.template property_map("f:color"); + std::tie(fcolors, has_internal_fcolors) = sm.template property_map("f:color"); if(!has_fcolors && has_internal_fcolors && std::distance(fcolors.begin(), fcolors.end()) > 0) return write_OFF_BGL(os, sm, np.face_color_map(fcolors)); @@ -447,7 +472,7 @@ bool write_OFF_with_or_without_vcolors(std::ostream& os, { typedef Surface_mesh Mesh; typedef typename Mesh::Vertex_index Vertex_index; - typedef CGAL::Color Color; + typedef CGAL::IO::Color Color; using parameters::choose_parameter; using parameters::is_default_parameter; @@ -457,7 +482,7 @@ bool write_OFF_with_or_without_vcolors(std::ostream& os, typename Mesh::template Property_map vcolors; bool has_internal_vcolors; - std::tie(vcolors, has_internal_vcolors) = sm.template property_map("v:color"); + std::tie(vcolors, has_internal_vcolors) = sm.template property_map("v:color"); if(!has_vcolors && has_internal_vcolors && std::distance(vcolors.begin(), vcolors.end()) > 0) return write_OFF_with_or_without_vtextures(os, sm, np.vertex_color_map(vcolors)); @@ -493,7 +518,6 @@ bool write_OFF_with_or_without_vnormals(std::ostream& os, } } // namespace internal -} // namespace IO /// \ingroup PkgSurfaceMeshIOFuncOFF /// @@ -535,7 +559,7 @@ bool write_OFF_with_or_without_vnormals(std::ostream& os, /// \cgalParamNBegin{vertex_color_map} /// \cgalParamDescription{a property map associating colors to the vertices of `sm`} /// \cgalParamType{a class model of `ReadablePropertyMap` with `Surface_mesh::Vertex_index` -/// as key type and `CGAL::Color` as value type} +/// as key type and `CGAL::IO::Color` as value type} /// \cgalParamDefault{vertex colors will be output using the internal property map, if it exists.} /// \cgalParamNEnd /// @@ -549,7 +573,7 @@ bool write_OFF_with_or_without_vnormals(std::ostream& os, /// \cgalParamNBegin{face_color_map} /// \cgalParamDescription{a property map associating colors to the faces of `sm`} /// \cgalParamType{a class model of `ReadablePropertyMap` with `Surface_mesh::Face_index` -/// as key type and `CGAL::Color` as value type} +/// as key type and `CGAL::IO::Color` as value type} /// \cgalParamDefault{face colors will be output using the internal property map, if it exists.} /// \cgalParamNEnd /// @@ -573,41 +597,43 @@ bool write_OFF(std::ostream& os, const bool has_vpoints = !(is_default_parameter(get_parameter(np, internal_np::vertex_point))); if(has_vpoints) - return IO::internal::write_OFF_with_or_without_vnormals(os, sm, np); + return internal::write_OFF_with_or_without_vnormals(os, sm, np); - return IO::internal::write_OFF_with_or_without_vnormals(os, sm, np.vertex_point_map(get_const_property_map(CGAL::vertex_point, sm))); + return internal::write_OFF_with_or_without_vnormals(os, sm, np.vertex_point_map(get_const_property_map(CGAL::vertex_point, sm))); } +} // namespace IO + #ifndef CGAL_NO_DEPRECATED_CODE /*! \ingroup PkgSurfaceMeshIOFuncDeprecated - \deprecated This function is deprecated since \cgal 5.2, `CGAL::write_OFF(std::ostream&, const Surface_mesh&)` should be used instead. + \deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::write_OFF(std::ostream&, const Surface_mesh&)` should be used instead. */ template CGAL_DEPRECATED bool write_off(std::ostream& os, const Surface_mesh& sm, const CGAL_BGL_NP_CLASS& np) { - return write_OFF(os, sm, np); + return IO::write_OFF(os, sm, np); } /*! \ingroup PkgSurfaceMeshIOFuncDeprecated - \deprecated This function is deprecated since \cgal 5.2, `CGAL::write_OFF(std::ostream&, const Surface_mesh&)` should be used instead. + \deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::write_OFF(std::ostream&, const Surface_mesh&)` should be used instead. */ template CGAL_DEPRECATED bool write_off(std::ostream& os, const Surface_mesh& sm) { - return write_OFF(os, sm, parameters::all_default()); + return IO::write_OFF(os, sm, parameters::all_default()); } /*! \ingroup PkgSurfaceMeshIOFuncDeprecated - \deprecated This function is deprecated since \cgal 5.2, `CGAL::write_OFF(std::ostream&, const Surface_mesh&)` should be used instead. + \deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::write_OFF(std::ostream&, const Surface_mesh&)` should be used instead. */ template CGAL_DEPRECATED bool write_off(const Surface_mesh& sm, const std::string& filename) { - return write_OFF(filename, sm, parameters::all_default()); + return IO::write_OFF(filename, sm, parameters::all_default()); } #endif // CGAL_NO_DEPRECATED_CODE diff --git a/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h b/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h index f19a3b9d9b2..b6196d5908c 100644 --- a/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h +++ b/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h @@ -89,9 +89,9 @@ private: int m_normals; typename Surface_mesh::template Property_map m_normal_map; int m_vcolors; - typename Surface_mesh::template Property_map m_vcolor_map; + typename Surface_mesh::template Property_map m_vcolor_map; int m_fcolors; - typename Surface_mesh::template Property_map m_fcolor_map; + typename Surface_mesh::template Property_map m_fcolor_map; bool m_use_int32_t; std::string m_index_tag; std::vector m_vertex_properties; @@ -116,7 +116,7 @@ public: delete m_halfedge_properties[i]; } - bool has_simplex_specific_property(IO::internal::PLY_read_number* property, Vertex_index) + bool has_simplex_specific_property(internal::PLY_read_number* property, Vertex_index) { const std::string& name = property->name(); if(name == "x" || @@ -142,13 +142,13 @@ public: { ++ m_vcolors; if(m_vcolors == 3) - m_vcolor_map = m_mesh.template add_property_map("v:color").first; + m_vcolor_map = m_mesh.template add_property_map("v:color").first; return true; } return false; } - bool has_simplex_specific_property(IO::internal::PLY_read_number* property, Face_index) + bool has_simplex_specific_property(internal::PLY_read_number* property, Face_index) { const std::string& name = property->name(); if(name == "vertex_indices" || name == "vertex_index") @@ -165,14 +165,14 @@ public: { ++ m_fcolors; if(m_fcolors == 3) - m_fcolor_map = m_mesh.template add_property_map("f:color").first; + m_fcolor_map = m_mesh.template add_property_map("f:color").first; return true; } return false; } - bool has_simplex_specific_property(IO::internal::PLY_read_number* property, Edge_index) + bool has_simplex_specific_property(internal::PLY_read_number* property, Edge_index) { const std::string& name = property->name(); if(name == "v0" || name == "v1") @@ -180,7 +180,7 @@ public: return false; } - bool has_simplex_specific_property(IO::internal::PLY_read_number* property, Halfedge_index) + bool has_simplex_specific_property(internal::PLY_read_number* property, Halfedge_index) { const std::string& name = property->name(); if(name == "source" || name == "target") @@ -215,7 +215,7 @@ public: { for(std::size_t j = 0; j < element.number_of_properties(); ++ j) { - IO::internal::PLY_read_number* property = element.property(j); + internal::PLY_read_number* property = element.property(j); if(has_simplex_specific_property(property, Simplex())) continue; @@ -297,7 +297,7 @@ public: element.assign(r, "red"); element.assign(g, "green"); element.assign(b, "blue"); - m_vcolor_map[vi] = CGAL::Color(r, g, b); + m_vcolor_map[vi] = CGAL::IO::Color(r, g, b); } } @@ -339,7 +339,7 @@ public: element.assign(r, "red"); element.assign(g, "green"); element.assign(b, "blue"); - m_fcolor_map[fi] = CGAL::Color(r, g, b); + m_fcolor_map[fi] = CGAL::IO::Color(r, g, b); } } @@ -612,7 +612,7 @@ void fill_header(std::ostream& os, const Surface_mesh& sm, if(okay) { os << "property char " << name << std::endl; - printers.push_back(new IO::internal::Char_property_printer(pmap)); + printers.push_back(new internal::Char_property_printer(pmap)); continue; } } @@ -622,7 +622,7 @@ void fill_header(std::ostream& os, const Surface_mesh& sm, if(okay) { os << "property uchar " << name << std::endl; - printers.push_back(new IO::internal::Char_property_printer(pmap)); + printers.push_back(new internal::Char_property_printer(pmap)); continue; } } @@ -632,7 +632,7 @@ void fill_header(std::ostream& os, const Surface_mesh& sm, if(okay) { os << "property short " << name << std::endl; - printers.push_back(new IO::internal::Simple_property_printer(pmap)); + printers.push_back(new internal::Simple_property_printer(pmap)); continue; } } @@ -642,7 +642,7 @@ void fill_header(std::ostream& os, const Surface_mesh& sm, if(okay) { os << "property ushort " << name << std::endl; - printers.push_back(new IO::internal::Simple_property_printer(pmap)); + printers.push_back(new internal::Simple_property_printer(pmap)); continue; } } @@ -652,7 +652,7 @@ void fill_header(std::ostream& os, const Surface_mesh& sm, if(okay) { os << "property int " << name << std::endl; - printers.push_back(new IO::internal::Simple_property_printer(pmap)); + printers.push_back(new internal::Simple_property_printer(pmap)); continue; } } @@ -662,7 +662,7 @@ void fill_header(std::ostream& os, const Surface_mesh& sm, if(okay) { os << "property uint " << name << std::endl; - printers.push_back(new IO::internal::Simple_property_printer(pmap)); + printers.push_back(new internal::Simple_property_printer(pmap)); continue; } } @@ -672,7 +672,7 @@ void fill_header(std::ostream& os, const Surface_mesh& sm, if(okay) { os << "property int " << name << std::endl; - printers.push_back(new IO::internal::Simple_property_printer(pmap)); + printers.push_back(new internal::Simple_property_printer(pmap)); continue; } } @@ -682,7 +682,7 @@ void fill_header(std::ostream& os, const Surface_mesh& sm, if(okay) { os << "property uint " << name << std::endl; - printers.push_back(new IO::internal::Simple_property_printer(pmap)); + printers.push_back(new internal::Simple_property_printer(pmap)); continue; } } @@ -692,7 +692,7 @@ void fill_header(std::ostream& os, const Surface_mesh& sm, if(okay) { os << "property float " << name << std::endl; - printers.push_back(new IO::internal::Simple_property_printer(pmap)); + printers.push_back(new internal::Simple_property_printer(pmap)); continue; } } @@ -702,7 +702,7 @@ void fill_header(std::ostream& os, const Surface_mesh& sm, if(okay) { os << "property double " << name << std::endl; - printers.push_back(new IO::internal::Simple_property_printer(pmap)); + printers.push_back(new internal::Simple_property_printer(pmap)); continue; } } @@ -710,7 +710,6 @@ void fill_header(std::ostream& os, const Surface_mesh& sm, } } // namespace internal -} // namespace IO /// \ingroup PkgSurfaceMeshIOFuncPLY /// @@ -765,8 +764,8 @@ bool read_PLY(std::istream& is, return false; } - IO::internal::PLY_reader reader(verbose); - IO::internal::Surface_mesh_filler

filler(sm); + internal::PLY_reader reader(verbose); + internal::Surface_mesh_filler

filler(sm); if(!(reader.init(is))) { @@ -778,7 +777,7 @@ bool read_PLY(std::istream& is, for(std::size_t i = 0; i < reader.number_of_elements(); ++ i) { - IO::internal::PLY_element& element = reader.element(i); + internal::PLY_element& element = reader.element(i); bool is_vertex =(element.name() == "vertex" || element.name() == "vertices"); bool is_face = false; @@ -816,7 +815,7 @@ bool read_PLY(std::istream& is, { for(std::size_t k = 0; k < element.number_of_properties(); ++ k) { - IO::internal::PLY_read_number* property = element.property(k); + internal::PLY_read_number* property = element.property(k); property->get(is); if(is.fail()) return false; @@ -853,16 +852,18 @@ bool read_PLY(std::istream& is, Surface_mesh

& sm) /// \endcond +} // namespace IO + #ifndef CGAL_NO_DEPRECATED_CODE /*! \ingroup PkgSurfaceMeshIOFuncDeprecated - \deprecated This function is deprecated since \cgal 5.2, `CGAL::read_PLY(std::ostream&, const Surface_mesh&)` should be used instead. + \deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::read_PLY(std::ostream&, const Surface_mesh&)` should be used instead. */ template CGAL_DEPRECATED bool read_ply(std::istream& is, Surface_mesh

& sm, std::string& comments) { - return read_PLY(is, sm, comments); + return IO::read_PLY(is, sm, comments); } #endif // CGAL_NO_DEPRECATED_CODE @@ -871,6 +872,8 @@ CGAL_DEPRECATED bool read_ply(std::istream& is, Surface_mesh

& sm, std::string //////////////////////////////////////////////////////////////////////////////////////////////////// // Write +namespace IO { + /// \ingroup PkgSurfaceMeshIOFuncPLY /// /// \brief inserts the surface mesh in an output stream in the \ref IOStreamPLY. @@ -924,7 +927,7 @@ bool write_PLY(std::ostream& os, set_stream_precision_from_NP(os, np); os << "ply" << std::endl - << ((get_mode(os) == IO::BINARY) ? "format binary_little_endian 1.0" : "format ascii 1.0") << std::endl + << ((get_mode(os) == BINARY) ? "format binary_little_endian 1.0" : "format ascii 1.0") << std::endl << "comment Generated by the CGAL library" << std::endl; if(comments != std::string()) @@ -940,20 +943,20 @@ bool write_PLY(std::ostream& os, os << "element vertex " << sm.number_of_vertices() << std::endl; - std::vector*> vprinters; - IO::internal::fill_header(os, sm, vprinters); + std::vector*> vprinters; + internal::fill_header(os, sm, vprinters); os << "element face " << sm.number_of_faces() << std::endl; os << "property list uchar int vertex_indices" << std::endl; - std::vector*> fprinters; - IO::internal::fill_header(os, sm, fprinters); + std::vector*> fprinters; + internal::fill_header(os, sm, fprinters); - std::vector*> eprinters; + std::vector*> eprinters; if(sm.template properties().size() > 1) { std::ostringstream oss; - IO::internal::fill_header(oss, sm, eprinters); + internal::fill_header(oss, sm, eprinters); if(!eprinters.empty()) { @@ -964,11 +967,11 @@ bool write_PLY(std::ostream& os, } } - std::vector*> hprinters; + std::vector*> hprinters; if(sm.template properties().size() > 1) { std::ostringstream oss; - IO::internal::fill_header(oss, sm, hprinters); + internal::fill_header(oss, sm, hprinters); if(!hprinters.empty()) { @@ -989,10 +992,10 @@ bool write_PLY(std::ostream& os, for(std::size_t i = 0; i < vprinters.size(); ++ i) { vprinters[i]->print(os, vi); - if(get_mode(os) == IO::ASCII) + if(get_mode(os) == ASCII) os << " "; } - if(get_mode(os) == IO::ASCII) + if(get_mode(os) == ASCII) os << std::endl; reindex[std::size_t(vi)] = n++; @@ -1007,7 +1010,7 @@ bool write_PLY(std::ostream& os, for(VIndex vi : CGAL::vertices_around_face(sm.halfedge(fi), sm)) polygon.push_back(reindex[std::size_t(vi)]); - if(get_mode(os) == IO::ASCII) + if(get_mode(os) == ASCII) { os << polygon.size() << " "; for(std::size_t i = 0; i < polygon.size(); ++ i) @@ -1027,11 +1030,11 @@ bool write_PLY(std::ostream& os, for(std::size_t i = 0; i < fprinters.size(); ++ i) { fprinters[i]->print(os, fi); - if(get_mode(os) == IO::ASCII) + if(get_mode(os) == ASCII) os << " "; } - if(get_mode(os) == IO::ASCII) + if(get_mode(os) == ASCII) os << std::endl; } @@ -1041,7 +1044,7 @@ bool write_PLY(std::ostream& os, { int v0 = reindex[std::size_t(sm.vertex(ei, 0))]; int v1 = reindex[std::size_t(sm.vertex(ei, 1))]; - if(get_mode(os) == IO::ASCII) + if(get_mode(os) == ASCII) { os << v0 << " " << v1 << " "; } @@ -1054,11 +1057,11 @@ bool write_PLY(std::ostream& os, for(std::size_t i = 0; i < eprinters.size(); ++ i) { eprinters[i]->print(os, ei); - if(get_mode(os) == IO::ASCII) + if(get_mode(os) == ASCII) os << " "; } - if(get_mode(os) == IO::ASCII) + if(get_mode(os) == ASCII) os << std::endl; } } @@ -1069,7 +1072,7 @@ bool write_PLY(std::ostream& os, { int source = reindex[std::size_t(sm.source(hi))]; int target = reindex[std::size_t(sm.target(hi))]; - if(get_mode(os) == IO::ASCII) + if(get_mode(os) == ASCII) { os << source << " " << target << " "; } @@ -1082,11 +1085,11 @@ bool write_PLY(std::ostream& os, for(std::size_t i = 0; i < hprinters.size(); ++ i) { hprinters[i]->print(os, hi); - if(get_mode(os) == IO::ASCII) + if(get_mode(os) == ASCII) os << " "; } - if(get_mode(os) == IO::ASCII) + if(get_mode(os) == ASCII) os << std::endl; } } @@ -1127,19 +1130,26 @@ bool write_PLY(std::ostream& os, const Surface_mesh

& sm) /// \endcond +} // namespace IO + #ifndef CGAL_NO_DEPRECATED_CODE /*! \ingroup PkgSurfaceMeshIOFuncDeprecated - \deprecated This function is deprecated since \cgal 5.2, `CGAL::write_PLY(std::ostream&, const Surface_mesh&)` should be used instead. + \deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::write_PLY(std::ostream&, const Surface_mesh&)` should be used instead. */ template CGAL_DEPRECATED bool write_ply(std::ostream& os, const Surface_mesh

& sm, const std::string& comments) { - return write_PLY(os, sm, comments); + return IO::write_PLY(os, sm, comments); } +template +CGAL_DEPRECATED bool write_ply(std::ostream& os, const Surface_mesh

& sm) +{ + return write_PLY(os, sm, ""); +} #endif // CGAL_NO_DEPRECATED_CODE } // namespace CGAL diff --git a/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h b/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h index da54a33d7a4..75a01cc8be5 100644 --- a/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h +++ b/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h @@ -2171,7 +2171,7 @@ private: //------------------------------------------------------- private data template std::ostream& operator<<(std::ostream& os, const Surface_mesh

& sm) { - write_OFF(os, sm); + IO::write_OFF(os, sm); return os; } @@ -2183,7 +2183,7 @@ private: //------------------------------------------------------- private data template std::istream& operator>>(std::istream& is, Surface_mesh

& sm) { - read_OFF(is, sm); + IO::read_OFF(is, sm); return is; } diff --git a/Surface_mesh/test/Surface_mesh/SM_common.h b/Surface_mesh/test/Surface_mesh/SM_common.h index 1dc68f0094d..f0f9d1e0988 100644 --- a/Surface_mesh/test/Surface_mesh/SM_common.h +++ b/Surface_mesh/test/Surface_mesh/SM_common.h @@ -117,7 +117,7 @@ struct Surface_fixture_3 { struct Cube_fixture { - Cube_fixture() { CGAL::read_polygon_mesh("cube.off", m); } + Cube_fixture() { CGAL::IO::read_polygon_mesh("cube.off", m); } Sm m; diff --git a/Surface_mesh/test/Surface_mesh/sm_open_colored_off.cpp b/Surface_mesh/test/Surface_mesh/sm_open_colored_off.cpp index b76191918d7..35ff58cafb9 100644 --- a/Surface_mesh/test/Surface_mesh/sm_open_colored_off.cpp +++ b/Surface_mesh/test/Surface_mesh/sm_open_colored_off.cpp @@ -31,20 +31,20 @@ void OpenOFF(int i) CGAL_assertion(in && !surface_mesh.is_empty()); - SMesh::Property_map fcolors = - surface_mesh.property_map("f:color").first; + SMesh::Property_map fcolors = + surface_mesh.property_map("f:color").first; - SMesh::Property_map vcolors = - surface_mesh.property_map("v:color").first; - CGAL::Color c = fcolors[*(surface_mesh.faces().begin())]; - CGAL_assertion(c== CGAL::Color(229,0,0)); + SMesh::Property_map vcolors = + surface_mesh.property_map("v:color").first; + CGAL::IO::Color c = fcolors[*(surface_mesh.faces().begin())]; + CGAL_assertion(c== CGAL::IO::Color(229,0,0)); c = fcolors[*(--surface_mesh.faces().end())]; - CGAL_assertion(c== CGAL::Color(0,0,229)); + CGAL_assertion(c== CGAL::IO::Color(0,0,229)); c = vcolors[*(surface_mesh.vertices().begin())]; - CGAL_assertion((c== CGAL::Color(229,0,0))); + CGAL_assertion((c== CGAL::IO::Color(229,0,0))); c = vcolors[*(--surface_mesh.vertices().end())]; - CGAL_assertion((c== CGAL::Color(0,0,229))); + CGAL_assertion((c== CGAL::IO::Color(0,0,229))); } diff --git a/Surface_mesh/test/Surface_mesh/sm_ply_io.cpp b/Surface_mesh/test/Surface_mesh/sm_ply_io.cpp index 942fe50b965..d26aca67d68 100644 --- a/Surface_mesh/test/Surface_mesh/sm_ply_io.cpp +++ b/Surface_mesh/test/Surface_mesh/sm_ply_io.cpp @@ -16,7 +16,7 @@ int main() { std::ifstream in("colored_tetra.ply"); SMesh mesh; - CGAL::read_PLY(in, mesh); + CGAL::IO::read_PLY(in, mesh); std::cerr << "Read mesh with " << mesh.number_of_vertices() << " vertices and " << mesh.number_of_faces() << " faces" << std::endl; @@ -37,11 +37,11 @@ int main() // Append second mesh std::ifstream in2("tetra.ply"); - CGAL::read_PLY(in2, mesh); + CGAL::IO::read_PLY(in2, mesh); std::ofstream out("out.ply"); -// CGAL::set_binary_mode(out); - CGAL::write_PLY(out, mesh); +// CGAL::IO::set_binary_mode(out); + CGAL::IO::write_PLY(out, mesh); return 0; } diff --git a/Surface_mesh_approximation/examples/Surface_mesh_approximation/vsa_approximation_2_example.cpp b/Surface_mesh_approximation/examples/Surface_mesh_approximation/vsa_approximation_2_example.cpp index 30781891e59..8f2687ffe69 100644 --- a/Surface_mesh_approximation/examples/Surface_mesh_approximation/vsa_approximation_2_example.cpp +++ b/Surface_mesh_approximation/examples/Surface_mesh_approximation/vsa_approximation_2_example.cpp @@ -20,7 +20,7 @@ int main(int argc, char** argv) // read input surface triangle mesh Mesh mesh; - if(!CGAL::Polygon_mesh_processing::read_polygon_mesh(filename, mesh) || + if(!CGAL::Polygon_mesh_processing::IO::read_polygon_mesh(filename, mesh) || !CGAL::is_triangle_mesh(mesh)) { std::cerr << "Invalid input file." << std::endl; diff --git a/Surface_mesh_approximation/examples/Surface_mesh_approximation/vsa_approximation_example.cpp b/Surface_mesh_approximation/examples/Surface_mesh_approximation/vsa_approximation_example.cpp index bf12a72cc6f..ebaa4be8582 100644 --- a/Surface_mesh_approximation/examples/Surface_mesh_approximation/vsa_approximation_example.cpp +++ b/Surface_mesh_approximation/examples/Surface_mesh_approximation/vsa_approximation_example.cpp @@ -23,7 +23,7 @@ int main(int argc, char** argv) // read input surface triangle mesh Mesh mesh; - if(!CGAL::Polygon_mesh_processing::read_polygon_mesh(filename, mesh) || + if(!CGAL::Polygon_mesh_processing::IO::read_polygon_mesh(filename, mesh) || !CGAL::is_triangle_mesh(mesh)) { std::cerr << "Invalid input file." << std::endl; diff --git a/Surface_mesh_approximation/examples/Surface_mesh_approximation/vsa_class_interface_example.cpp b/Surface_mesh_approximation/examples/Surface_mesh_approximation/vsa_class_interface_example.cpp index 2a61fab2f81..885bfcd3de9 100644 --- a/Surface_mesh_approximation/examples/Surface_mesh_approximation/vsa_class_interface_example.cpp +++ b/Surface_mesh_approximation/examples/Surface_mesh_approximation/vsa_class_interface_example.cpp @@ -24,7 +24,7 @@ int main(int argc, char** argv) // reads input surface triangle mesh Mesh mesh; - if(!CGAL::Polygon_mesh_processing::read_polygon_mesh(filename, mesh) || + if(!CGAL::Polygon_mesh_processing::IO::read_polygon_mesh(filename, mesh) || !CGAL::is_triangle_mesh(mesh)) { std::cerr << "Invalid input file." << std::endl; diff --git a/Surface_mesh_approximation/examples/Surface_mesh_approximation/vsa_isotropic_metric_example.cpp b/Surface_mesh_approximation/examples/Surface_mesh_approximation/vsa_isotropic_metric_example.cpp index 116f53dfbd9..f2a62bf1fac 100644 --- a/Surface_mesh_approximation/examples/Surface_mesh_approximation/vsa_isotropic_metric_example.cpp +++ b/Surface_mesh_approximation/examples/Surface_mesh_approximation/vsa_isotropic_metric_example.cpp @@ -79,7 +79,7 @@ int main(int argc, char** argv) // reads input surface triangle mesh Mesh mesh; - if(!CGAL::Polygon_mesh_processing::read_polygon_mesh(filename, mesh) || + if(!CGAL::Polygon_mesh_processing::IO::read_polygon_mesh(filename, mesh) || !CGAL::is_triangle_mesh(mesh)) { std::cerr << "Invalid input file." << std::endl; diff --git a/Surface_mesh_approximation/examples/Surface_mesh_approximation/vsa_segmentation_example.cpp b/Surface_mesh_approximation/examples/Surface_mesh_approximation/vsa_segmentation_example.cpp index dc3c5a57b8a..ef6af2112c2 100644 --- a/Surface_mesh_approximation/examples/Surface_mesh_approximation/vsa_segmentation_example.cpp +++ b/Surface_mesh_approximation/examples/Surface_mesh_approximation/vsa_segmentation_example.cpp @@ -20,7 +20,7 @@ int main(int argc, char** argv) // reads input surface triangle mesh Mesh mesh; - if(!CGAL::Polygon_mesh_processing::read_polygon_mesh(filename, mesh) || + if(!CGAL::Polygon_mesh_processing::IO::read_polygon_mesh(filename, mesh) || !CGAL::is_triangle_mesh(mesh)) { std::cerr << "Invalid input file." << std::endl; diff --git a/Surface_mesh_approximation/examples/Surface_mesh_approximation/vsa_simple_approximation_example.cpp b/Surface_mesh_approximation/examples/Surface_mesh_approximation/vsa_simple_approximation_example.cpp index 81f326e4573..8baa4f1b6a3 100644 --- a/Surface_mesh_approximation/examples/Surface_mesh_approximation/vsa_simple_approximation_example.cpp +++ b/Surface_mesh_approximation/examples/Surface_mesh_approximation/vsa_simple_approximation_example.cpp @@ -18,7 +18,7 @@ int main(int argc, char** argv) // reads input surface triangle mesh Mesh mesh; - if(!CGAL::Polygon_mesh_processing::read_polygon_mesh(filename, mesh) || + if(!CGAL::Polygon_mesh_processing::IO::read_polygon_mesh(filename, mesh) || !CGAL::is_triangle_mesh(mesh)) { std::cerr << "Invalid input file." << std::endl; diff --git a/Surface_mesh_deformation/examples/Surface_mesh_deformation/all_roi_assign_example_Surface_mesh.cpp b/Surface_mesh_deformation/examples/Surface_mesh_deformation/all_roi_assign_example_Surface_mesh.cpp index a66e4152b3c..e7e97aaa051 100644 --- a/Surface_mesh_deformation/examples/Surface_mesh_deformation/all_roi_assign_example_Surface_mesh.cpp +++ b/Surface_mesh_deformation/examples/Surface_mesh_deformation/all_roi_assign_example_Surface_mesh.cpp @@ -18,7 +18,7 @@ int main(int argc, char** argv) const char* filename = (argc > 1) ? argv[1] : "data/plane.off"; Mesh mesh; - if(!CGAL::read_polygon_mesh(filename, mesh)) + if(!CGAL::IO::read_polygon_mesh(filename, mesh)) { std::cerr << "Invalid input file." << std::endl; return EXIT_FAILURE; diff --git a/Surface_mesh_deformation/examples/Surface_mesh_deformation/k_ring_roi_translate_rotate_Surface_mesh.cpp b/Surface_mesh_deformation/examples/Surface_mesh_deformation/k_ring_roi_translate_rotate_Surface_mesh.cpp index a881936c32b..6d807a09ce2 100644 --- a/Surface_mesh_deformation/examples/Surface_mesh_deformation/k_ring_roi_translate_rotate_Surface_mesh.cpp +++ b/Surface_mesh_deformation/examples/Surface_mesh_deformation/k_ring_roi_translate_rotate_Surface_mesh.cpp @@ -49,7 +49,7 @@ int main(int argc, char** argv) const char* filename = (argc>1) ? argv[1] : "data/plane.off"; Mesh mesh; - if(!CGAL::read_polygon_mesh(filename, mesh)) + if(!CGAL::IO::read_polygon_mesh(filename, mesh)) { std::cerr<< "Cannot open data/plane.off"; return 1; diff --git a/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/discrete_authalic.cpp b/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/discrete_authalic.cpp index 1f71c6e1d69..6ed0453a3f4 100644 --- a/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/discrete_authalic.cpp +++ b/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/discrete_authalic.cpp @@ -31,7 +31,7 @@ int main(int argc, char** argv) const char* filename = (argc>1) ? argv[1] : "data/three_peaks.off"; SurfaceMesh sm; - if(!CGAL::read_polygon_mesh(filename, sm)) + if(!CGAL::IO::read_polygon_mesh(filename, sm)) { std::cerr << "Invalid input file." << std::endl; return EXIT_FAILURE; diff --git a/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/lscm.cpp b/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/lscm.cpp index 43fb06a8785..e44f6545017 100644 --- a/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/lscm.cpp +++ b/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/lscm.cpp @@ -41,7 +41,7 @@ int main(int argc, char** argv) const char* filename = (argc>1) ? argv[1] : "data/lion.off"; SurfaceMesh sm; - if(!CGAL::read_polygon_mesh(filename, sm)) + if(!CGAL::IO::read_polygon_mesh(filename, sm)) { std::cerr << "Invalid input file." << std::endl; return EXIT_FAILURE; diff --git a/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/orbifold.cpp b/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/orbifold.cpp index 44eaf8f6ec5..ce1610568d4 100644 --- a/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/orbifold.cpp +++ b/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/orbifold.cpp @@ -48,7 +48,7 @@ int main(int argc, char** argv) const char* filename = (argc>1) ? argv[1] : "data/bear.off"; SurfaceMesh sm; - if(!CGAL::read_polygon_mesh(filename, sm)) + if(!CGAL::IO::read_polygon_mesh(filename, sm)) { std::cerr << "Invalid input file." << std::endl; return EXIT_FAILURE; diff --git a/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/simple_parameterization.cpp b/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/simple_parameterization.cpp index b40a8bf48cc..c9eabe71a45 100644 --- a/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/simple_parameterization.cpp +++ b/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/simple_parameterization.cpp @@ -26,7 +26,7 @@ int main(int argc, char** argv) const char* filename = (argc>1) ? argv[1] : "data/nefertiti.off"; SurfaceMesh sm; - if(!CGAL::read_polygon_mesh(filename, sm)) + if(!CGAL::IO::read_polygon_mesh(filename, sm)) { std::cerr << "Invalid input file." << std::endl; return EXIT_FAILURE; diff --git a/Surface_mesh_parameterization/test/Surface_mesh_parameterization/extensive_parameterization_test.cpp b/Surface_mesh_parameterization/test/Surface_mesh_parameterization/extensive_parameterization_test.cpp index 79187d8c4d7..d25e1b83954 100644 --- a/Surface_mesh_parameterization/test/Surface_mesh_parameterization/extensive_parameterization_test.cpp +++ b/Surface_mesh_parameterization/test/Surface_mesh_parameterization/extensive_parameterization_test.cpp @@ -79,7 +79,7 @@ typedef boost::graph_traits::halfedge_descriptor SM_SE_halfedge int main(int, char**) { std::cout.precision(17); - CGAL::set_pretty_mode(std::cout); + CGAL::IO::set_pretty_mode(std::cout); // *************************************************************************** // Default case diff --git a/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/extract_segmentation_into_mesh_example.cpp b/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/extract_segmentation_into_mesh_example.cpp index 189f068b136..74d48718f72 100644 --- a/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/extract_segmentation_into_mesh_example.cpp +++ b/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/extract_segmentation_into_mesh_example.cpp @@ -20,7 +20,7 @@ int main(int argc, char** argv ) const char* filename = (argc > 1) ? argv[1] : "data/cactus.off"; SM mesh; - if(!CGAL::Polygon_mesh_processing::read_polygon_mesh(filename, mesh) || + if(!CGAL::Polygon_mesh_processing::IO::read_polygon_mesh(filename, mesh) || !CGAL::is_triangle_mesh(mesh)) { std::cerr << "Invalid input file." << std::endl; diff --git a/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/segmentation_from_sdf_values_LCC_example.cpp b/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/segmentation_from_sdf_values_LCC_example.cpp index 543e8563155..b21941ac293 100644 --- a/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/segmentation_from_sdf_values_LCC_example.cpp +++ b/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/segmentation_from_sdf_values_LCC_example.cpp @@ -21,7 +21,7 @@ int main(int argc, char** argv) // create and read LCC LCC mesh; - if(!CGAL::Polygon_mesh_processing::read_polygon_mesh(filename, mesh) || + if(!CGAL::Polygon_mesh_processing::IO::read_polygon_mesh(filename, mesh) || !CGAL::is_triangle_mesh(mesh)) { std::cerr << "Invalid input file." << std::endl; diff --git a/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/segmentation_from_sdf_values_SM_example.cpp b/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/segmentation_from_sdf_values_SM_example.cpp index 9aebc8cb0fa..2d8391fa781 100644 --- a/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/segmentation_from_sdf_values_SM_example.cpp +++ b/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/segmentation_from_sdf_values_SM_example.cpp @@ -21,7 +21,7 @@ int main(int argc, char** argv ) const char* filename = (argc > 1) ? argv[1] : "data/cactus.off"; Mesh mesh; - if(!CGAL::Polygon_mesh_processing::read_polygon_mesh(filename, mesh) || + if(!CGAL::Polygon_mesh_processing::IO::read_polygon_mesh(filename, mesh) || !CGAL::is_triangle_mesh(mesh)) { std::cerr << "Invalid input file." << std::endl; diff --git a/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/shortest_path_sequence.cpp b/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/shortest_path_sequence.cpp index 512b2882ae0..e4d6b38763b 100644 --- a/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/shortest_path_sequence.cpp +++ b/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/shortest_path_sequence.cpp @@ -82,7 +82,7 @@ int main(int argc, char** argv) const char* filename = (argc>1) ? argv[1] : "data/elephant.off"; Triangle_mesh tmesh; - if(!CGAL::read_polygon_mesh(filename, tmesh) || + if(!CGAL::IO::read_polygon_mesh(filename, tmesh) || !CGAL::is_triangle_mesh(tmesh)) { std::cerr << "Invalid input file." << std::endl; diff --git a/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/shortest_path_with_locate.cpp b/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/shortest_path_with_locate.cpp index 5ce5baa5733..12bc9c64b95 100644 --- a/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/shortest_path_with_locate.cpp +++ b/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/shortest_path_with_locate.cpp @@ -37,7 +37,7 @@ int main(int argc, char** argv) const char* filename = (argc>1) ? argv[1] : "data/elephant.off"; Triangle_mesh tmesh; - if(!CGAL::read_polygon_mesh(filename, tmesh) || + if(!CGAL::IO::read_polygon_mesh(filename, tmesh) || !CGAL::is_triangle_mesh(tmesh)) { std::cerr << "Invalid input file." << std::endl; diff --git a/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/shortest_paths.cpp b/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/shortest_paths.cpp index 14109508355..09fa0cd6ac9 100644 --- a/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/shortest_paths.cpp +++ b/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/shortest_paths.cpp @@ -23,7 +23,7 @@ int main(int argc, char** argv) const char* filename = (argc>1) ? argv[1] : "data/elephant.off"; Triangle_mesh tmesh; - if(!CGAL::read_polygon_mesh(filename, tmesh) || + if(!CGAL::IO::read_polygon_mesh(filename, tmesh) || !CGAL::is_triangle_mesh(tmesh)) { std::cerr << "Invalid input file." << std::endl; diff --git a/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/shortest_paths_multiple_sources.cpp b/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/shortest_paths_multiple_sources.cpp index d543da6abde..38143178e3c 100644 --- a/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/shortest_paths_multiple_sources.cpp +++ b/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/shortest_paths_multiple_sources.cpp @@ -24,7 +24,7 @@ int main(int argc, char** argv) const char* filename = (argc>1) ? argv[1] : "data/elephant.off"; Triangle_mesh tmesh; - if(!CGAL::read_polygon_mesh(filename, tmesh) || + if(!CGAL::IO::read_polygon_mesh(filename, tmesh) || !CGAL::is_triangle_mesh(tmesh)) { std::cerr << "Invalid input file." << std::endl; diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_bounded_normal_change.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_bounded_normal_change.cpp index 70f9e16be24..cf15718d3df 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_bounded_normal_change.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_bounded_normal_change.cpp @@ -71,7 +71,7 @@ int main(int argc, char** argv) .get_placement(Placement())); std::cout << t.time() << " sec" << std::endl; - CGAL::write_polygon_mesh((argc > 3) ? argv[3] : "out.off", surface_mesh, CGAL::parameters::stream_precision(17)); + CGAL::IO::write_polygon_mesh((argc > 3) ? argv[3] : "out.off", surface_mesh, CGAL::parameters::stream_precision(17)); return EXIT_SUCCESS; } diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_constrained_border_surface_mesh.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_constrained_border_surface_mesh.cpp index eaba77051d5..04c59231c85 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_constrained_border_surface_mesh.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_constrained_border_surface_mesh.cpp @@ -90,7 +90,7 @@ int main(int argc, char** argv) std::cout << "\nFinished!\n" << r << " edges removed.\n" << surface_mesh.number_of_edges() << " final edges.\n"; - CGAL::write_polygon_mesh((argc > 2) ? argv[2] : "out.off", surface_mesh, CGAL::parameters::stream_precision(17)); + CGAL::IO::write_polygon_mesh((argc > 2) ? argv[2] : "out.off", surface_mesh, CGAL::parameters::stream_precision(17)); // now check! for(halfedge_descriptor hd : halfedges(surface_mesh)) diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_garland_heckbert.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_garland_heckbert.cpp index 338a17aed37..b7fe2fe732e 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_garland_heckbert.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_garland_heckbert.cpp @@ -68,7 +68,7 @@ int main(int argc, char** argv) std::cout << "\nFinished!\n" << r << " edges removed.\n" << surface_mesh.number_of_edges() << " final edges.\n"; - CGAL::write_polygon_mesh((argc > 3) ? argv[3] : "out.off", surface_mesh, CGAL::parameters::stream_precision(17)); + CGAL::IO::write_polygon_mesh((argc > 3) ? argv[3] : "out.off", surface_mesh, CGAL::parameters::stream_precision(17)); return EXIT_SUCCESS; } diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_linear_cell_complex.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_linear_cell_complex.cpp index 8fbc1763b86..c9551fc0419 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_linear_cell_complex.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_linear_cell_complex.cpp @@ -24,7 +24,7 @@ int main(int argc, char** argv) LCC lcc; const char* filename = (argc > 1) ? argv[1] : "data/cube-meshed.off"; - if(!CGAL::read_polygon_mesh(filename, lcc)) + if(!CGAL::IO::read_polygon_mesh(filename, lcc)) { std::cerr << "Failed to read input mesh: " << filename << std::endl; return EXIT_FAILURE; @@ -60,7 +60,7 @@ int main(int argc, char** argv) lcc.display_characteristics(std::cout) << ", is_valid=" << CGAL::is_valid(lcc) << std::endl; - CGAL::write_polygon_mesh((argc > 3 ? argv[3] : "out.off"), lcc); + CGAL::IO::write_polygon_mesh((argc > 3 ? argv[3] : "out.off"), lcc); return EXIT_SUCCESS; } diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_surface_mesh.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_surface_mesh.cpp index 063e6fd63c1..b40ae60efcc 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_surface_mesh.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_surface_mesh.cpp @@ -45,7 +45,7 @@ int main(int argc, char** argv) std::cout << "\nFinished!\n" << r << " edges removed.\n" << surface_mesh.number_of_edges() << " final edges.\n"; std::cout << "Time elapsed: " << std::chrono::duration_cast(end_time - start_time).count() << "ms" << std::endl; - CGAL::write_polygon_mesh((argc > 3) ? argv[3] : "out.off", surface_mesh, CGAL::parameters::stream_precision(17)); + CGAL::IO::write_polygon_mesh((argc > 3) ? argv[3] : "out.off", surface_mesh, CGAL::parameters::stream_precision(17)); return EXIT_SUCCESS; } diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_visitor_surface_mesh.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_visitor_surface_mesh.cpp index ffbe9574fe2..a85bab7aa0a 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_visitor_surface_mesh.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_visitor_surface_mesh.cpp @@ -136,7 +136,7 @@ int main(int argc, char** argv) std::cout << "\nFinished!\n" << r << " edges removed.\n" << surface_mesh.number_of_edges() << " final edges.\n"; - CGAL::write_polygon_mesh((argc > 3) ? argv[3] : "out.off", surface_mesh, CGAL::parameters::stream_precision(17)); + CGAL::IO::write_polygon_mesh((argc > 3) ? argv[3] : "out.off", surface_mesh, CGAL::parameters::stream_precision(17)); return EXIT_SUCCESS; } diff --git a/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_Polyhedron_3.cpp b/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_Polyhedron_3.cpp index 1c84930d608..ca29638a015 100644 --- a/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_Polyhedron_3.cpp +++ b/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_Polyhedron_3.cpp @@ -17,7 +17,7 @@ #include "basics.h" #include "test_self_intersection.h" -#include +#include //#define TEST_TEST_TRACE_ENABLED @@ -48,7 +48,7 @@ namespace SMS = CGAL::Surface_mesh_simplification; typedef SMS::Edge_profile Profile; -typedef boost::shared_ptr SurfaceSP; +typedef std::shared_ptr SurfaceSP; // Constructs a flat polyhedron containing just the link of an edge or vertex. class Link_builder : public CGAL::Modifier_base diff --git a/Surface_mesh_skeletonization/examples/Surface_mesh_skeletonization/MCF_Skeleton_LCC_example.cpp b/Surface_mesh_skeletonization/examples/Surface_mesh_skeletonization/MCF_Skeleton_LCC_example.cpp index 881faad7fe7..491ebf21d91 100644 --- a/Surface_mesh_skeletonization/examples/Surface_mesh_skeletonization/MCF_Skeleton_LCC_example.cpp +++ b/Surface_mesh_skeletonization/examples/Surface_mesh_skeletonization/MCF_Skeleton_LCC_example.cpp @@ -24,7 +24,7 @@ typedef Skeleton::edge_descriptor Skeleton_edge; int main() { LCC lcc; - CGAL::read_polygon_mesh("data/elephant.off", lcc); + CGAL::IO::read_polygon_mesh("data/elephant.off", lcc); Skeleton skeleton; Skeletonization mcs(lcc); diff --git a/Surface_mesh_skeletonization/examples/Surface_mesh_skeletonization/simple_mcfskel_LCC_example.cpp b/Surface_mesh_skeletonization/examples/Surface_mesh_skeletonization/simple_mcfskel_LCC_example.cpp index dca0967772e..81169ddea8d 100644 --- a/Surface_mesh_skeletonization/examples/Surface_mesh_skeletonization/simple_mcfskel_LCC_example.cpp +++ b/Surface_mesh_skeletonization/examples/Surface_mesh_skeletonization/simple_mcfskel_LCC_example.cpp @@ -53,7 +53,7 @@ struct Display_polylines{ int main() { LCC lcc; - CGAL::read_polygon_mesh("data/elephant.off", lcc); + CGAL::IO::read_polygon_mesh("data/elephant.off", lcc); Skeleton skeleton; diff --git a/Surface_mesh_topology/examples/Surface_mesh_topology/draw_facewidth.h b/Surface_mesh_topology/examples/Surface_mesh_topology/draw_facewidth.h index 520fffe69cf..c23906f10b3 100644 --- a/Surface_mesh_topology/examples/Surface_mesh_topology/draw_facewidth.h +++ b/Surface_mesh_topology/examples/Surface_mesh_topology/draw_facewidth.h @@ -19,18 +19,18 @@ struct Facewidth_draw_functor : public CGAL::DefaultDrawingFunctorLCC { return alcc.is_marked(dh, m_vertex_mark); } template - CGAL::Color vertex_color(const LCC& /* alcc */, + CGAL::IO::Color vertex_color(const LCC& /* alcc */, typename LCC::Dart_const_handle /* dh */) const - { return CGAL::Color(0, 255, 0); } + { return CGAL::IO::Color(0, 255, 0); } template bool colored_edge(const LCC& /*alcc*/, typename LCC::Dart_const_handle /*dh*/) const { return false; } template - CGAL::Color edge_color(const LCC& /* alcc*/, + CGAL::IO::Color edge_color(const LCC& /* alcc*/, typename LCC::Dart_const_handle /* dh */) const - { return CGAL::Color(0, 0, 255); } + { return CGAL::IO::Color(0, 0, 255); } template bool colored_face(const LCC& /* alcc */, @@ -38,9 +38,9 @@ struct Facewidth_draw_functor : public CGAL::DefaultDrawingFunctorLCC {return true;} template - CGAL::Color face_color(const LCC& alcc, typename LCC::Dart_const_handle dh) const - { return alcc.is_marked(dh, m_face_mark)?CGAL::Color(255, 0, 0) - :CGAL::Color(211, 211, 211); } + CGAL::IO::Color face_color(const LCC& alcc, typename LCC::Dart_const_handle dh) const + { return alcc.is_marked(dh, m_face_mark)?CGAL::IO::Color(255, 0, 0) + :CGAL::IO::Color(211, 211, 211); } template bool colored_volume(const LCC& /* alcc */, diff --git a/Surface_mesh_topology/examples/Surface_mesh_topology/edgewidth_surface_mesh.cpp b/Surface_mesh_topology/examples/Surface_mesh_topology/edgewidth_surface_mesh.cpp index a78ffce8e4f..ce80de070e5 100644 --- a/Surface_mesh_topology/examples/Surface_mesh_topology/edgewidth_surface_mesh.cpp +++ b/Surface_mesh_topology/examples/Surface_mesh_topology/edgewidth_surface_mesh.cpp @@ -35,7 +35,7 @@ int main(int argc, char* argv[]) bool draw=(argc<3?false:(std::string(argv[2])=="-draw")); Mesh sm; - if(!CGAL::read_polygon_mesh(filename, sm)) + if(!CGAL::IO::read_polygon_mesh(filename, sm)) { std::cout<<"Cannot read file '"< - CGAL::Color vertex_color(const LCC& /* alcc */, + CGAL::IO::Color vertex_color(const LCC& /* alcc */, typename LCC::Dart_const_handle /* dh */) const - { return CGAL::Color(0,255,0); } + { return CGAL::IO::Color(0,255,0); } template bool colored_edge(const LCC& alcc, typename LCC::Dart_const_handle dh) const { return alcc.is_marked(dh, belong_to_cycle); } template - CGAL::Color edge_color(const LCC& /* alcc*/, + CGAL::IO::Color edge_color(const LCC& /* alcc*/, typename LCC::Dart_const_handle /* dh */) const - { return CGAL::Color(0, 0, 255); } + { return CGAL::IO::Color(0, 0, 255); } template bool colored_face(const LCC& /* alcc */, typename LCC::Dart_const_handle /* dh */) const {return true;} template - CGAL::Color face_color(const LCC& /* alcc */, + CGAL::IO::Color face_color(const LCC& /* alcc */, typename LCC::Dart_const_handle /* dh */) const - {return CGAL::Color(211, 211, 211);} + {return CGAL::IO::Color(211, 211, 211);} template bool colored_volume(const LCC& /* alcc */, diff --git a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h index 726cf03efd1..981cc54ca22 100644 --- a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h +++ b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h @@ -148,7 +148,7 @@ protected: if (m_current_dart!=lcc.darts().end()) { // We want to draw only one dart Dart_const_handle selected_dart=m_current_dart; //lcc.dart_handle(m_current_dart); - compute_edge(selected_dart, CGAL::Color(255,0,0)); + compute_edge(selected_dart, CGAL::IO::Color(255,0,0)); lcc.template mark_cell<1>(selected_dart, markedges); compute_vertex(selected_dart); @@ -217,7 +217,7 @@ protected: } while(cur!=dh); - // CGAL::Color c=m_fcolor.run(*lcc, dh); + // CGAL::IO::Color c=m_fcolor.run(*lcc, dh); face_begin(); //c); cur=dh; @@ -241,13 +241,13 @@ protected: { if (m_draw_marked_darts && m_amark!=LCC::INVALID_MARK && (lcc.is_marked(dh, m_amark) || lcc.is_marked(lcc.opposite2(dh), m_amark))) - { add_segment(p1, get_point(d2), CGAL::Color(0, 0, 255)); } + { add_segment(p1, get_point(d2), CGAL::IO::Color(0, 0, 255)); } else { add_segment(p1, get_point(d2)); } } } - void compute_edge(Dart_const_handle dh, const CGAL::Color& color) + void compute_edge(Dart_const_handle dh, const CGAL::IO::Color& color) { Point p1 = get_point(dh); Dart_const_handle d2 = lcc.other_extremity(dh); @@ -367,7 +367,7 @@ protected: { return; } CGAL::Random random(static_cast(i)); - CGAL::Color color=get_random_color(random); + CGAL::IO::Color color=get_random_color(random); add_point(get_point((*m_paths)[i].get_ith_dart(0)), color); for (std::size_t j=0; j<(*m_paths)[i].length(); ++j) diff --git a/Surface_mesher/archive/include/CGAL/Polyhedral_surface_3.h b/Surface_mesher/archive/include/CGAL/Polyhedral_surface_3.h index 2ef3e333cce..4ba75cb5959 100644 --- a/Surface_mesher/archive/include/CGAL/Polyhedral_surface_3.h +++ b/Surface_mesher/archive/include/CGAL/Polyhedral_surface_3.h @@ -31,7 +31,7 @@ #include #include -#include +#include #include #include @@ -274,8 +274,8 @@ public: typedef Intersection_data_structure_3 Subsegments_tree; #endif - typedef boost::shared_ptr Subfacets_tree_ptr; - typedef boost::shared_ptr Subsegments_tree_ptr; + typedef std::shared_ptr Subfacets_tree_ptr; + typedef std::shared_ptr Subsegments_tree_ptr; // typedef typename Subsegments_tree::Point_with_index // Intersection_point; @@ -1252,13 +1252,13 @@ public: Subfacets_tree_ptr subfacets_tree_ptr; Subsegments_tree_ptr subsegments_tree_ptr; typedef std::set Input_vertices; - boost::shared_ptr input_vertices_ptr; + std::shared_ptr input_vertices_ptr; typedef std::vector Corner_vertices; - boost::shared_ptr corner_vertices_ptr; + std::shared_ptr corner_vertices_ptr; typedef std::vector Edges_vertices; - boost::shared_ptr edges_vertices_ptr; + std::shared_ptr edges_vertices_ptr; #ifdef CGAL_SURFACE_MESHER_POLYHEDRAL_SURFACE_USE_PINPOLYHEDRON - typedef boost::shared_ptr PointInPolyhedron_ptr; + typedef std::shared_ptr PointInPolyhedron_ptr; PointInPolyhedron_ptr pinpolyhedron_ptr; #endif diff --git a/Surface_mesher/archive/include/CGAL/builder.h b/Surface_mesher/archive/include/CGAL/builder.h index fc0cd01ab6b..7984469e674 100644 --- a/Surface_mesher/archive/include/CGAL/builder.h +++ b/Surface_mesher/archive/include/CGAL/builder.h @@ -175,7 +175,7 @@ public: CGAL_assertion_code(check_protocoll = 0;) } - ~Enriched_polyhedron_incremental_builder_3() CGAL_NOEXCEPT(CGAL_NO_ASSERTIONS_BOOL) + ~Enriched_polyhedron_incremental_builder_3() noexcept(!CGAL_ASSERTIONS_ENABLED) { CGAL_destructor_assertion( check_protocoll == 0); } diff --git a/Surface_mesher/include/CGAL/AABB_polyhedral_oracle.h b/Surface_mesher/include/CGAL/AABB_polyhedral_oracle.h index 04c0d90ceaa..a57dc122563 100644 --- a/Surface_mesher/include/CGAL/AABB_polyhedral_oracle.h +++ b/Surface_mesher/include/CGAL/AABB_polyhedral_oracle.h @@ -25,7 +25,7 @@ #include #include -#include +#include namespace CGAL { @@ -50,7 +50,7 @@ namespace CGAL { typedef AABB_tree Tree; typedef typename AABB_traits::Bounding_box Bounding_box; - typedef boost::shared_ptr Tree_shared_ptr; + typedef std::shared_ptr Tree_shared_ptr; Tree_shared_ptr m_pTree; public: diff --git a/Surface_mesher/include/CGAL/Complex_2_in_triangulation_cell_base_3.h b/Surface_mesher/include/CGAL/Complex_2_in_triangulation_cell_base_3.h index bf6d2c30049..af757f8365e 100644 --- a/Surface_mesher/include/CGAL/Complex_2_in_triangulation_cell_base_3.h +++ b/Surface_mesher/include/CGAL/Complex_2_in_triangulation_cell_base_3.h @@ -120,7 +120,7 @@ operator>>(std::istream &is, Complex_2_in_triangulation_cell_base_3 &c) is >> static_cast(c); for(int i = 0; i < 4; ++i) { - if(is_ascii(is)) + if(IO::is_ascii(is)) is >> b; else { @@ -142,7 +142,7 @@ operator<<(std::ostream &os, os << static_cast(c); for(int i = 0; i < 4; ++i) { - if(is_ascii(os)) + if(IO::is_ascii(os)) os << ' ' << c.is_facet_on_surface(i); else write(os, static_cast(c.is_facet_on_surface(i))); diff --git a/Surface_mesher/include/CGAL/Gray_level_image_3.h b/Surface_mesher/include/CGAL/Gray_level_image_3.h index c9e7df7954b..5cf37cd2c28 100644 --- a/Surface_mesher/include/CGAL/Gray_level_image_3.h +++ b/Surface_mesher/include/CGAL/Gray_level_image_3.h @@ -19,7 +19,7 @@ #include -#include +#include #ifdef CGAL_SURFACE_MESHER_DEBUG_GRAY_LEVEL_IMAGE_3_CONSTRUCTOR #include diff --git a/Surface_mesher/include/CGAL/Point_with_psc_localisation.h b/Surface_mesher/include/CGAL/Point_with_psc_localisation.h index 830ccae8b56..24122b515cc 100644 --- a/Surface_mesher/include/CGAL/Point_with_psc_localisation.h +++ b/Surface_mesher/include/CGAL/Point_with_psc_localisation.h @@ -116,7 +116,7 @@ std::ostream& operator<<(std::ostream &os, const Point_with_psc_localisation& p) { os << static_cast(p); - if(is_ascii(os)) + if(IO::is_ascii(os)) os << ' ' << p.dimension() << ' ' << p.element_index(); else { write(os, p.dimension()); @@ -131,7 +131,7 @@ operator>>(std::istream &is, Point_with_psc_localisation& p) { is >> static_cast(p); int index, dim; - if(is_ascii(is)) + if(IO::is_ascii(is)) is >> dim >> index; else { read(is, dim); diff --git a/Surface_mesher/include/CGAL/Point_with_surface_index.h b/Surface_mesher/include/CGAL/Point_with_surface_index.h index 7a9df119c60..a4adc974429 100644 --- a/Surface_mesher/include/CGAL/Point_with_surface_index.h +++ b/Surface_mesher/include/CGAL/Point_with_surface_index.h @@ -64,7 +64,7 @@ std::ostream& operator<<(std::ostream &os, const Point_with_surface_index& p) { os << static_cast(p); - if(is_ascii(os)) + if(IO::is_ascii(os)) os << ' ' << p.surface_index(); else write(os, p.surface_index()); @@ -77,7 +77,7 @@ operator>>(std::istream &is, Point_with_surface_index& p) { is >> static_cast(p); int index; - if(is_ascii(is)) + if(IO::is_ascii(is)) is >> index; else read(is, index); diff --git a/TDS_2/include/CGAL/Triangulation_data_structure_2.h b/TDS_2/include/CGAL/Triangulation_data_structure_2.h index 2d7dbc59261..6f32473c744 100644 --- a/TDS_2/include/CGAL/Triangulation_data_structure_2.h +++ b/TDS_2/include/CGAL/Triangulation_data_structure_2.h @@ -2113,7 +2113,7 @@ file_output( std::ostream& os, Vertex_handle v, bool skip_first) const size_type n = number_of_vertices(); size_type m = number_of_full_dim_faces(); - if(is_ascii(os)) os << n << ' ' << m << ' ' << dimension() << std::endl; + if(IO::is_ascii(os)) os << n << ' ' << m << ' ' << dimension() << std::endl; else os << n << m << dimension(); if (n==0) return; @@ -2128,7 +2128,7 @@ file_output( std::ostream& os, Vertex_handle v, bool skip_first) const if( ! skip_first){ // os << v->point(); os << *v ; - if(is_ascii(os)) os << std::endl; + if(IO::is_ascii(os)) os << std::endl; } } @@ -2138,10 +2138,10 @@ file_output( std::ostream& os, Vertex_handle v, bool skip_first) const V[vit] = inum++; // os << vit->point(); os << *vit; - if(is_ascii(os)) os << "\n"; + if(IO::is_ascii(os)) os << "\n"; } } - if(is_ascii(os)) os << "\n"; + if(IO::is_ascii(os)) os << "\n"; // vertices of the faces inum = 0; @@ -2151,21 +2151,21 @@ file_output( std::ostream& os, Vertex_handle v, bool skip_first) const F[ib] = inum++; for(int j = 0; j < dim ; ++j) { os << V[ib->vertex(j)]; - if(is_ascii(os)) os << " "; + if(IO::is_ascii(os)) os << " "; } os << *ib ; - if(is_ascii(os)) os << "\n"; + if(IO::is_ascii(os)) os << "\n"; } - if(is_ascii(os)) os << "\n"; + if(IO::is_ascii(os)) os << "\n"; // neighbor pointers of the faces for( Face_iterator it = face_iterator_base_begin(); it != face_iterator_base_end(); ++it) { for(int j = 0; j < dimension()+1; ++j){ os << F[it->neighbor(j)]; - if(is_ascii(os)) os << " "; + if(IO::is_ascii(os)) os << " "; } - if(is_ascii(os)) os << "\n"; + if(IO::is_ascii(os)) os << "\n"; } return ; diff --git a/TDS_2/test/TDS_2/include/CGAL/_test_cls_tds_2.h b/TDS_2/test/TDS_2/include/CGAL/_test_cls_tds_2.h index 619b959937e..0545aa79748 100644 --- a/TDS_2/test/TDS_2/include/CGAL/_test_cls_tds_2.h +++ b/TDS_2/test/TDS_2/include/CGAL/_test_cls_tds_2.h @@ -465,48 +465,48 @@ _test_cls_tds_2( const Tds &) std::cout << " output to a file" << std::endl; std::ofstream of0("file_tds0"); - CGAL::set_ascii_mode(of0); + CGAL::IO::set_ascii_mode(of0); of0 << tds0 ; of0.close(); std::ofstream of1("file_tds1"); - CGAL::set_ascii_mode(of1); + CGAL::IO::set_ascii_mode(of1); of1 << tds1 ; of1.close(); std::ofstream of2("file_tds2"); - CGAL::set_ascii_mode(of2); + CGAL::IO::set_ascii_mode(of2); of2 << tds2 ; of2.close(); std::ofstream of3("file_tds3"); - CGAL::set_ascii_mode(of3); + CGAL::IO::set_ascii_mode(of3); of3 << tds3 ; of3.close(); std::ofstream of4("file_tds4"); - CGAL::set_ascii_mode(of4); + CGAL::IO::set_ascii_mode(of4); of4 << tds4 ; of4.close(); std::cout << " input from a file" << std::endl; - std::ifstream if0("file_tds0"); CGAL::set_ascii_mode(if0); + std::ifstream if0("file_tds0"); CGAL::IO::set_ascii_mode(if0); Tds tds0f; if0 >> tds0f ; assert( tds0f.is_valid()); - std::ifstream if1("file_tds1"); CGAL::set_ascii_mode(if1); + std::ifstream if1("file_tds1"); CGAL::IO::set_ascii_mode(if1); Tds tds1f; if1 >> tds1f; assert( tds1f.is_valid()); std::ifstream if2("file_tds2"); - CGAL::set_ascii_mode(if2); + CGAL::IO::set_ascii_mode(if2); Tds tds2f; if2 >> tds2f ; assert( tds2f.is_valid()); std::ifstream if3("file_tds3"); - CGAL::set_ascii_mode(if3); + CGAL::IO::set_ascii_mode(if3); Tds tds3f; if3 >> tds3f ; assert( tds3f.is_valid()); std::ifstream if4("file_tds4"); - CGAL::set_ascii_mode(if4); + CGAL::IO::set_ascii_mode(if4); Tds tds4f; if4 >> tds4f ; assert( tds4f.is_valid()); // vrml input-output std::ofstream os("vrml_tds4"); - CGAL::set_ascii_mode(os); + CGAL::IO::set_ascii_mode(os); tds4.vrml_output(os); // test destructor and return diff --git a/TDS_3/include/CGAL/Triangulation_data_structure_3.h b/TDS_3/include/CGAL/Triangulation_data_structure_3.h index b3927cf03ae..0e937ef4cee 100644 --- a/TDS_3/include/CGAL/Triangulation_data_structure_3.h +++ b/TDS_3/include/CGAL/Triangulation_data_structure_3.h @@ -1626,7 +1626,7 @@ public: std::size_t n; int d; - if(is_ascii(is)) + if(IO::is_ascii(is)) is >> d >> n; else { read(is, d); @@ -1924,7 +1924,7 @@ create_star_2(Vertex_handle v, Cell_handle c, int li ) // pnew is null at the first iteration v1->set_cell(cnew); //pnew->set_neighbor( cw(pnew->index(v1)), cnew ); - if (pnew != Cell_handle()) { pnew->set_neighbor( 1, cnew );} + if (pnew != nullptr) { pnew->set_neighbor( 1, cnew );} bound = cur; i1 = ccw(i1); @@ -1957,7 +1957,7 @@ operator>>(std::istream& is, Triangulation_data_structure_3& tds) std::size_t n; int d; - if(is_ascii(is)) + if(IO::is_ascii(is)) is >> d >> n; else { read(is, n); @@ -2008,7 +2008,7 @@ operator<<(std::ostream& os, const Triangulation_data_structure_3 &tds // outputs dimension and number of vertices size_type n = tds.number_of_vertices(); - if (is_ascii(os)) + if (IO::is_ascii(os)) os << tds.dimension() << std::endl << n << std::endl; else { @@ -2524,7 +2524,7 @@ read_cells(std::istream& is, const std::vector< Vertex_handle > &V, case 2: case 1: { - if(is_ascii(is)) + if(IO::is_ascii(is)) is >> m; else read(is, m); @@ -2535,7 +2535,7 @@ read_cells(std::istream& is, const std::vector< Vertex_handle > &V, Cell_handle c = create_cell(); for (int k=0; k<=dimension(); ++k) { std::size_t ik; - if(is_ascii(is)) + if(IO::is_ascii(is)) is >> ik; else read(is, ik); @@ -2548,7 +2548,7 @@ read_cells(std::istream& is, const std::vector< Vertex_handle > &V, Cell_handle c = C[j]; for (int k=0; k<=dimension(); ++k) { std::size_t ik; - if(is_ascii(is)) + if(IO::is_ascii(is)) is >> ik; else read(is, ik); @@ -2598,7 +2598,7 @@ print_cells(std::ostream& os, const Unique_hash_map case 3: { std::size_t m = number_of_cells(); - if(is_ascii(os)) + if(IO::is_ascii(os)) os << m << std::endl; else write(os, m); @@ -2608,7 +2608,7 @@ print_cells(std::ostream& os, const Unique_hash_map for(it = cells_begin(); it != cells_end(); ++it) { C[it] = i++; for(int j = 0; j < 4; j++){ - if(is_ascii(os)) { + if(IO::is_ascii(os)) { os << V[it->vertex(j)]; if ( j==3 ) os << '\n'; @@ -2624,7 +2624,7 @@ print_cells(std::ostream& os, const Unique_hash_map // write the neighbors for(it = cells_begin(); it != cells_end(); ++it) { for (int j = 0; j < 4; j++) { - if(is_ascii(os)){ + if(IO::is_ascii(os)){ os << C[it->neighbor(j)]; if(j==3) os << '\n'; @@ -2640,7 +2640,7 @@ print_cells(std::ostream& os, const Unique_hash_map case 2: { size_type m = number_of_facets(); - if(is_ascii(os)) + if(IO::is_ascii(os)) os << m << '\n'; else write(os, m); @@ -2650,7 +2650,7 @@ print_cells(std::ostream& os, const Unique_hash_map for(it = facets_begin(); it != facets_end(); ++it) { C[(*it).first] = i++; for(int j = 0; j < 3; j++){ - if(is_ascii(os)) { + if(IO::is_ascii(os)) { os << V[(*it).first->vertex(j)]; if ( j==2 ) os << '\n'; @@ -2667,7 +2667,7 @@ print_cells(std::ostream& os, const Unique_hash_map // write the neighbors for(it = facets_begin(); it != facets_end(); ++it) { for (int j = 0; j < 3; j++) { - if(is_ascii(os)){ + if(IO::is_ascii(os)){ os << C[(*it).first->neighbor(j)]; if(j==2) os << '\n'; @@ -2684,7 +2684,7 @@ print_cells(std::ostream& os, const Unique_hash_map case 1: { size_type m = number_of_edges(); - if(is_ascii(os)) + if(IO::is_ascii(os)) os << m << '\n'; else write(os, m); @@ -2693,7 +2693,7 @@ print_cells(std::ostream& os, const Unique_hash_map for(it = edges_begin(); it != edges_end(); ++it) { C[(*it).first] = i++; for(int j = 0; j < 2; j++){ - if(is_ascii(os)) { + if(IO::is_ascii(os)) { os << V[(*it).first->vertex(j)]; if ( j==1 ) os << '\n'; @@ -2710,7 +2710,7 @@ print_cells(std::ostream& os, const Unique_hash_map // write the neighbors for(it = edges_begin(); it != edges_end(); ++it) { for (int j = 0; j < 2; j++) { - if(is_ascii(os)){ + if(IO::is_ascii(os)){ os << C[(*it).first->neighbor(j)]; if(j==1) os << '\n'; diff --git a/Tetrahedral_remeshing/examples/Tetrahedral_remeshing/tetrahedral_remeshing_from_mesh.cpp b/Tetrahedral_remeshing/examples/Tetrahedral_remeshing/tetrahedral_remeshing_from_mesh.cpp index 83565e56341..4ea0c1ddc54 100644 --- a/Tetrahedral_remeshing/examples/Tetrahedral_remeshing/tetrahedral_remeshing_from_mesh.cpp +++ b/Tetrahedral_remeshing/examples/Tetrahedral_remeshing/tetrahedral_remeshing_from_mesh.cpp @@ -19,12 +19,12 @@ int main(int argc, char* argv[]) Remeshing_triangulation tr; std::ifstream is(filename, std::ios_base::in); - CGAL::read_MEDIT(is, tr); + CGAL::IO::read_MEDIT(is, tr); CGAL::tetrahedral_isotropic_remeshing(tr, target_edge_length); std::ofstream os("after_remeshing.mesh"); - CGAL::write_MEDIT(os, tr); + CGAL::IO::write_MEDIT(os, tr); return EXIT_SUCCESS; } diff --git a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/tetrahedral_remeshing_helpers.h b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/tetrahedral_remeshing_helpers.h index 5a1ca163d67..2b348e4574b 100644 --- a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/tetrahedral_remeshing_helpers.h +++ b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/tetrahedral_remeshing_helpers.h @@ -1671,7 +1671,7 @@ template void dump_binary(const C3t3& c3t3, const char* filename) { std::ofstream os(filename, std::ios::binary | std::ios::out); - CGAL::Mesh_3::save_binary_file(os, c3t3); + CGAL::IO::save_binary_file(os, c3t3); os.close(); } diff --git a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/tetrahedral_remeshing_io.h b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/tetrahedral_remeshing_io.h index d09a0f42edf..3d3b7c142f1 100644 --- a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/tetrahedral_remeshing_io.h +++ b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/tetrahedral_remeshing_io.h @@ -35,8 +35,8 @@ bool load_triangulation(std::istream& is, T3& t3) return false; std::getline(is, s); - if (binary) CGAL::set_binary_mode(is); - else CGAL::set_ascii_mode(is); + if (binary) CGAL::IO::set_binary_mode(is); + else CGAL::IO::set_ascii_mode(is); is >> t3; return bool(is); } @@ -45,7 +45,7 @@ template bool save_binary_triangulation(std::ostream& os, const T3& t3) { os << "binary CGAL c3t3\n"; - CGAL::set_binary_mode(os); + CGAL::IO::set_binary_mode(os); return !!(os << t3); } @@ -53,7 +53,7 @@ template bool save_ascii_triangulation(std::ostream& os, const T3& t3) { os << "CGAL c3t3\n"; - CGAL::set_ascii_mode(os); + CGAL::IO::set_ascii_mode(os); return !!(os << t3); } diff --git a/Triangulation/include/CGAL/Triangulation.h b/Triangulation/include/CGAL/Triangulation.h index d59eba33c8c..dc3f062c16f 100644 --- a/Triangulation/include/CGAL/Triangulation.h +++ b/Triangulation/include/CGAL/Triangulation.h @@ -1336,7 +1336,7 @@ operator>>(std::istream & is, Triangulation & tr) // read current dimension and number of vertices size_t n; int cd; - if( is_ascii(is) ) + if( IO::is_ascii(is) ) is >> cd >> n; else { @@ -1388,7 +1388,7 @@ operator<<(std::ostream & os, const Triangulation & tr) // outputs dimensions and number of vertices size_t n = tr.number_of_vertices(); - if( is_ascii(os) ) + if( IO::is_ascii(os) ) os << tr.current_dimension() << std::endl << n << std::endl; else { @@ -1405,7 +1405,7 @@ operator<<(std::ostream & os, const Triangulation & tr) // infinite vertex has index 0 (among all the vertices) index_of_vertex[tr.infinite_vertex()] = i++; - if(is_ascii(os)) + if(IO::is_ascii(os)) os << *tr.infinite_vertex() <<"\n"; else write(os, *tr.infinite_vertex()); @@ -1414,7 +1414,7 @@ operator<<(std::ostream & os, const Triangulation & tr) { if( tr.is_infinite(it) ) continue; - if(is_ascii(os)) + if(IO::is_ascii(os)) os << *it <<"\n"; // write the vertex else write(os, *it); diff --git a/Triangulation/include/CGAL/Triangulation_data_structure.h b/Triangulation/include/CGAL/Triangulation_data_structure.h index 1a43794f47a..7dd775a42cf 100644 --- a/Triangulation/include/CGAL/Triangulation_data_structure.h +++ b/Triangulation/include/CGAL/Triangulation_data_structure.h @@ -1342,7 +1342,7 @@ Triangulation_data_structure std::size_t m; // number of full_cells int index; const int cd = current_dimension(); - if( is_ascii(is) ) + if( IO::is_ascii(is) ) is >> m; else read(is, m, io_Read_write()); @@ -1359,7 +1359,7 @@ Triangulation_data_structure full_cells.push_back(s); for( int j = 0; j <= cd; ++j ) { - if( is_ascii(is) ) + if( IO::is_ascii(is) ) is >> index; else read(is, index); @@ -1372,7 +1372,7 @@ Triangulation_data_structure // read the neighbors of each full_cell i = 0; - if( is_ascii(is) ) + if( IO::is_ascii(is) ) while( i < m ) { for( int j = 0; j <= cd; ++j ) @@ -1423,7 +1423,7 @@ Triangulation_data_structure std::size_t m = number_of_full_cells(); - if( is_ascii(os) ) + if( IO::is_ascii(os) ) os << std::endl << m; else write(os, m, io_Read_write()); @@ -1434,11 +1434,11 @@ Triangulation_data_structure for( Full_cell_const_iterator it = full_cells_begin(); it != full_cells_end(); ++it ) { index_of_full_cell[it] = i++; - if( is_ascii(os) ) + if( IO::is_ascii(os) ) os << std::endl; for( int j = 0; j <= cur_dim; ++j ) { - if( is_ascii(os) ) + if( IO::is_ascii(os) ) os << ' ' << index_of_vertex[it->vertex(j)]; else write(os, index_of_vertex[it->vertex(j)]); @@ -1450,7 +1450,7 @@ Triangulation_data_structure CGAL_assertion( (std::size_t) i == m ); // write the neighbors of each full_cell - if( is_ascii(os) ) + if( IO::is_ascii(os) ) for( Full_cell_const_iterator it = full_cells_begin(); it != full_cells_end(); ++it ) { os << std::endl; @@ -1489,7 +1489,7 @@ operator>>(std::istream & is, Triangulation_data_structure & tr) // read current dimension and number of vertices std::size_t n; int cd; - if( is_ascii(is) ) + if( IO::is_ascii(is) ) is >> cd >> n; else { @@ -1539,7 +1539,7 @@ operator<<(std::ostream & os, const Triangulation_data_structure // outputs dimension and number of vertices std::size_t n = tr.number_of_vertices(); - if( is_ascii(os) ) + if( IO::is_ascii(os) ) os << tr.current_dimension() << std::endl << n; else { @@ -1556,7 +1556,7 @@ operator<<(std::ostream & os, const Triangulation_data_structure for( Vertex_iterator it = tr.vertices_begin(); it != tr.vertices_end(); ++it, ++i ) { os << *it; // write the vertex - if (is_ascii(os)) + if (IO::is_ascii(os)) os << std::endl; index_of_vertex[it] = i; } diff --git a/Triangulation/include/CGAL/Triangulation_ds_full_cell.h b/Triangulation/include/CGAL/Triangulation_ds_full_cell.h index 83b48a441d5..cf897825b6e 100644 --- a/Triangulation/include/CGAL/Triangulation_ds_full_cell.h +++ b/Triangulation/include/CGAL/Triangulation_ds_full_cell.h @@ -259,7 +259,7 @@ template < typename TDS, typename SSP > std::ostream & operator<<(std::ostream & O, const Triangulation_ds_full_cell &) /* Concept */ { - /*if( is_ascii(O) ) + /*if( IO::is_ascii(O) ) { // os << '\n'; } @@ -271,7 +271,7 @@ template < typename TDS, typename SSP > std::istream & operator>>(std::istream & I, Triangulation_ds_full_cell &) /* Concept */ { - /*if( is_ascii(I) ) + /*if( IO::is_ascii(I) ) {} else {}*/ return I; diff --git a/Triangulation/include/CGAL/Triangulation_ds_vertex.h b/Triangulation/include/CGAL/Triangulation_ds_vertex.h index aaa1e2067fc..3ed1ef48786 100644 --- a/Triangulation/include/CGAL/Triangulation_ds_vertex.h +++ b/Triangulation/include/CGAL/Triangulation_ds_vertex.h @@ -112,7 +112,7 @@ template < class TDS > std::istream & operator>>(std::istream & is, Triangulation_ds_vertex &) /* Concept */ { - /*if( is_ascii(is) ) + /*if( IO::is_ascii(is) ) {} else {}*/ return is; @@ -122,7 +122,7 @@ template< class TDS > std::ostream & operator<<(std::ostream & os, const Triangulation_ds_vertex &) /* Concept */ { - /*if( is_ascii(os) ) + /*if( IO::is_ascii(os) ) { os << '\n'; } diff --git a/Triangulation/include/CGAL/Triangulation_full_cell.h b/Triangulation/include/CGAL/Triangulation_full_cell.h index b806ab6baf4..18792172ce3 100644 --- a/Triangulation/include/CGAL/Triangulation_full_cell.h +++ b/Triangulation/include/CGAL/Triangulation_full_cell.h @@ -119,7 +119,7 @@ template < typename TDS, typename Data, typename SSP > std::ostream & operator<<(std::ostream & O, const Triangulation_full_cell & s) { - /*if( is_ascii(O) ) + /*if( IO::is_ascii(O) ) { // os << '\n'; } @@ -132,7 +132,7 @@ template < typename TDS, typename Data, typename SSP > std::istream & operator>>(std::istream & I, Triangulation_full_cell & s) { - /*if( is_ascii(I) ) + /*if( IO::is_ascii(I) ) {} else {}*/ I >> s.data(); diff --git a/Triangulation/test/Triangulation/test_tds.cpp b/Triangulation/test/Triangulation/test_tds.cpp index 30774f94e5b..e1d4ceeb54b 100644 --- a/Triangulation/test/Triangulation/test_tds.cpp +++ b/Triangulation/test/Triangulation/test_tds.cpp @@ -95,13 +95,13 @@ void test(const int d, const string & type) // TEST File I/O std::ofstream fo((string("output-tds-")+type).c_str()); if( d % 2 ) - CGAL::set_binary_mode(fo); + CGAL::IO::set_binary_mode(fo); fo << tds; fo.close(); std::ifstream fi((string("output-tds-")+type).c_str()); if( d % 2 ) - CGAL::set_binary_mode(fi); + CGAL::IO::set_binary_mode(fi); TDS input_tds(d); fi >> input_tds; fi.close(); diff --git a/Triangulation_2/examples/Triangulation_2/colored_face.cpp b/Triangulation_2/examples/Triangulation_2/colored_face.cpp index 820daa4cfe5..0f290a796be 100644 --- a/Triangulation_2/examples/Triangulation_2/colored_face.cpp +++ b/Triangulation_2/examples/Triangulation_2/colored_face.cpp @@ -6,7 +6,7 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef CGAL::Triangulation_vertex_base_2 Vb; -typedef CGAL::Triangulation_face_base_with_info_2 Fb; +typedef CGAL::Triangulation_face_base_with_info_2 Fb; typedef CGAL::Triangulation_data_structure_2 Tds; typedef CGAL::Triangulation_2 Triangulation; @@ -21,11 +21,11 @@ int main() { t.insert(Point(2,2)); for(Face_handle f : t.finite_face_handles()) - f->info() = CGAL::blue(); + f->info() = CGAL::IO::blue(); Point p(0.5,0.5); Face_handle fh = t.locate(p); - fh->info() = CGAL::red(); + fh->info() = CGAL::IO::red(); return 0; } diff --git a/Triangulation_2/include/CGAL/Constrained_triangulation_2.h b/Triangulation_2/include/CGAL/Constrained_triangulation_2.h index 32317818174..00490b338a8 100644 --- a/Triangulation_2/include/CGAL/Constrained_triangulation_2.h +++ b/Triangulation_2/include/CGAL/Constrained_triangulation_2.h @@ -1544,7 +1544,7 @@ file_output(std::ostream& os) const for(int j = 0; j < 3; ++j){ if (ib->is_constrained(j)) { os << "C";} else { os << "N";} - if(is_ascii(os)){ + if(IO::is_ascii(os)){ if(j==2) { os << "\n"; } else { diff --git a/Triangulation_2/include/CGAL/draw_triangulation_2.h b/Triangulation_2/include/CGAL/draw_triangulation_2.h index fef579d2ff0..3561dbbc04a 100644 --- a/Triangulation_2/include/CGAL/draw_triangulation_2.h +++ b/Triangulation_2/include/CGAL/draw_triangulation_2.h @@ -28,7 +28,7 @@ namespace CGAL struct DefaultColorFunctorT2 { template - static CGAL::Color run(const T2&, + static CGAL::IO::Color run(const T2&, const typename T2::Finite_faces_iterator fh) { CGAL::Random random((unsigned int)(std::size_t)(&*fh)); @@ -68,7 +68,7 @@ public: protected: void compute_face(Facet_const_handle fh) { - CGAL::Color c=m_fcolor.run(t2, fh); + CGAL::IO::Color c=m_fcolor.run(t2, fh); face_begin(c); add_point_in_face(fh->vertex(0)->point()); diff --git a/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_constrained_triangulation_2.h b/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_constrained_triangulation_2.h index fb62d70e19b..7aab8e70ff0 100644 --- a/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_constrained_triangulation_2.h +++ b/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_constrained_triangulation_2.h @@ -223,52 +223,52 @@ _test_cls_constrained_triangulation(const Triang &) std::cout << "output to a file" << std::endl; std::ofstream of0_1("T01.triangulation", std::ios::out); - CGAL::set_ascii_mode(of0_1); + CGAL::IO::set_ascii_mode(of0_1); of0_1 << T0_1; of0_1.close(); std::ofstream of0_2("T02.triangulation"); - CGAL::set_ascii_mode(of0_2); + CGAL::IO::set_ascii_mode(of0_2); of0_2 << T0_2; of0_2.close(); std::ofstream of1_1("T11.triangulation"); - CGAL::set_ascii_mode(of1_1); + CGAL::IO::set_ascii_mode(of1_1); of1_1 << T1_1; of1_1.close(); std::ofstream of1_2("T12.triangulation"); - CGAL::set_ascii_mode(of1_2); + CGAL::IO::set_ascii_mode(of1_2); of1_2 << T1_2; of1_2.close(); std::ofstream of2_1("T21.triangulation"); - CGAL::set_ascii_mode(of2_1); + CGAL::IO::set_ascii_mode(of2_1); of2_1 << T2_1; of2_1.close(); std::ofstream of2_2("T22.triangulation"); - CGAL::set_ascii_mode(of2_2); + CGAL::IO::set_ascii_mode(of2_2); of2_2 << T2_2; of2_2.close(); std::cout << "input from a file" << std::endl; - std::ifstream if0_1("T01.triangulation"); CGAL::set_ascii_mode(if0_1); + std::ifstream if0_1("T01.triangulation"); CGAL::IO::set_ascii_mode(if0_1); Triang T0_1_copy; if0_1 >> T0_1_copy; - std::ifstream if0_2("T02.triangulation"); CGAL::set_ascii_mode(if0_2); + std::ifstream if0_2("T02.triangulation"); CGAL::IO::set_ascii_mode(if0_2); Triang T0_2_copy; if0_2 >> T0_2_copy; - std::ifstream if1_1("T11.triangulation"); CGAL::set_ascii_mode(if1_1); + std::ifstream if1_1("T11.triangulation"); CGAL::IO::set_ascii_mode(if1_1); Triang T1_1_copy; if1_1 >> T1_1_copy; - std::ifstream if1_2("T12.triangulation"); CGAL::set_ascii_mode(if1_2); + std::ifstream if1_2("T12.triangulation"); CGAL::IO::set_ascii_mode(if1_2); Triang T1_2_copy; if1_2 >> T1_2_copy; - std::ifstream if2_1("T21.triangulation"); CGAL::set_ascii_mode(if2_1); + std::ifstream if2_1("T21.triangulation"); CGAL::IO::set_ascii_mode(if2_1); Triang T2_1_copy; if2_1 >> T2_1_copy; - std::ifstream if2_2("T22.triangulation"); CGAL::set_ascii_mode(if2_2); + std::ifstream if2_2("T22.triangulation"); CGAL::IO::set_ascii_mode(if2_2); Triang T2_2_copy; if2_2 >> T2_2_copy; // test copy of constrained Triangulation Triang T2_4(T2_2); std::ofstream of2_2_bis("T22.triangulation"); - CGAL::set_ascii_mode(of2_2_bis); + CGAL::IO::set_ascii_mode(of2_2_bis); of2_2_bis << T2_4; of2_2_bis.close(); All_faces_iterator fit2 = T2_2.all_faces_begin(); All_faces_iterator fit2_bis = T2_4.all_faces_begin(); diff --git a/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_regular_hierarchy_2.h b/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_regular_hierarchy_2.h index 3a60570bd00..16c98935104 100644 --- a/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_regular_hierarchy_2.h +++ b/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_regular_hierarchy_2.h @@ -20,7 +20,7 @@ _test_cls_regular_hierarchy_2( const Rh & ) Regular_hierarchy rh; CGAL::Random rand; - // std::ofstream output("data"); CGAL::set_binary_mode(output); + // std::ofstream output("data"); CGAL::IO::set_binary_mode(output); for(int i = 0; i < nn ; i++){ Bare_point p( rand.get_double(), rand.get_double()); Weighted_point wp(p, (rand.get_double())*100); @@ -32,7 +32,7 @@ _test_cls_regular_hierarchy_2( const Rh & ) std::cerr << std::endl; rh.is_valid(true); -// std::ifstream input("data"); CGAL::set_binary_mode(input); +// std::ifstream input("data"); CGAL::IO::set_binary_mode(input); // Weighted_point wp; // int inr = 0; // while(input) { diff --git a/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_regular_triangulation_2.h b/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_regular_triangulation_2.h index e189e4b8cb8..26c097e2f91 100644 --- a/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_regular_triangulation_2.h +++ b/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_regular_triangulation_2.h @@ -477,7 +477,7 @@ _test_cls_regular_triangulation_2( const Triangulation & ) // tr.clear(); // Cls tr; // Weighted_point wp; -// std::ifstream input("data"); CGAL::set_ascii_mode(input); +// std::ifstream input("data"); CGAL::IO::set_ascii_mode(input); // int in = 0; // while(input){ // in = in+1; @@ -750,22 +750,22 @@ _test_cls_regular_triangulation_2( const Triangulation & ) // so they do not input output hidden vertices std::cout << " output to a file" << std::endl; std::ofstream of1_5("T15.triangulation"); - CGAL::set_ascii_mode(of1_5); + CGAL::IO::set_ascii_mode(of1_5); of1_5 << T1_5; of1_5.close(); std::ofstream of2_3("T23.triangulation"); - CGAL::set_ascii_mode(of2_3); + CGAL::IO::set_ascii_mode(of2_3); of2_3 << T2_3; of2_3.close(); // std::cout << " input from a file" << std::endl; -// std::ifstream if1_5("T15.triangulation"); CGAL::set_ascii_mode(if1_5); +// std::ifstream if1_5("T15.triangulation"); CGAL::IO::set_ascii_mode(if1_5); // Cls T1_5_copy; if1_5 >> T1_5_copy; // assert( T1_5_copy.is_valid(verbose) && // T1_5_copy.number_of_vertices() == // T1_5.number_of_vertices() - T1_5.number_of_hidden_vertices()); -// std::ifstream if2_3("T23.triangulation"); CGAL::set_ascii_mode(if2_3); +// std::ifstream if2_3("T23.triangulation"); CGAL::IO::set_ascii_mode(if2_3); // Cls T2_3_copy; if2_3 >> T2_3_copy; // assert( T2_3_copy.is_valid(verbose) && // T2_3_copy.number_of_vertices() == diff --git a/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_triangulation_2.h b/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_triangulation_2.h index b14c998d5a9..c8c982b38bc 100644 --- a/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_triangulation_2.h +++ b/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_triangulation_2.h @@ -775,67 +775,67 @@ _test_cls_triangulation_2( const Triangul & ) /******** I/O *******/ std::cout << " output to a file" << std::endl; std::ofstream of0_0("T00.triangulation", std::ios::out); - CGAL::set_ascii_mode(of0_0); + CGAL::IO::set_ascii_mode(of0_0); of0_0 << T0_0; of0_0.close(); std::ofstream of0_1("T01.triangulation"); - CGAL::set_ascii_mode(of0_1); + CGAL::IO::set_ascii_mode(of0_1); of0_1 << T0_1; of0_1.close(); std::ofstream of1_2("T12.triangulation"); - CGAL::set_ascii_mode(of1_2); + CGAL::IO::set_ascii_mode(of1_2); of1_2 << T1_2; of1_2.close(); std::ofstream of1_5("T15.triangulation"); - CGAL::set_ascii_mode(of1_5); + CGAL::IO::set_ascii_mode(of1_5); of1_5 << T1_5; of1_5.close(); std::ofstream of1_6("T16.triangulation"); - CGAL::set_ascii_mode(of1_6); + CGAL::IO::set_ascii_mode(of1_6); of1_6 << T1_6; of1_6.close(); std::ofstream of2_1("T21.triangulation"); - CGAL::set_ascii_mode(of2_1); + CGAL::IO::set_ascii_mode(of2_1); of2_1 << T2_1; of2_1.close(); std::ofstream of2_3("T23.triangulation"); - CGAL::set_ascii_mode(of2_3); + CGAL::IO::set_ascii_mode(of2_3); of2_3 << T2_3; of2_3.close(); std::ofstream of2_5("T25.triangulation"); - CGAL::set_ascii_mode(of2_5); + CGAL::IO::set_ascii_mode(of2_5); of2_5 << T2_5; of2_5.close(); std::ofstream of2_6("T26.triangulation"); - CGAL::set_ascii_mode(of2_6); + CGAL::IO::set_ascii_mode(of2_6); of2_6 << T2_6; of2_6.close(); std::cout << " input from a file" << std::endl; - std::ifstream if0_0("T00.triangulation"); CGAL::set_ascii_mode(if0_0); + std::ifstream if0_0("T00.triangulation"); CGAL::IO::set_ascii_mode(if0_0); Triangul T0_0_copy; if0_0 >> T0_0_copy; assert( T0_0_copy.is_valid() && T0_0_copy.number_of_vertices() == T0_0.number_of_vertices() ); - std::ifstream if0_1("T01.triangulation"); CGAL::set_ascii_mode(if0_1); + std::ifstream if0_1("T01.triangulation"); CGAL::IO::set_ascii_mode(if0_1); Triangul T0_1_copy; if0_1 >> T0_1_copy; assert( T0_1_copy.is_valid() && T0_1_copy.number_of_vertices() == T0_1.number_of_vertices() ); - std::ifstream if1_2("T12.triangulation"); CGAL::set_ascii_mode(if1_2); + std::ifstream if1_2("T12.triangulation"); CGAL::IO::set_ascii_mode(if1_2); Triangul T1_2_copy; if1_2 >> T1_2_copy; assert( T1_2_copy.is_valid() && T1_2_copy.number_of_vertices() == T1_2.number_of_vertices() ); - std::ifstream if1_5("T15.triangulation"); CGAL::set_ascii_mode(if1_5); + std::ifstream if1_5("T15.triangulation"); CGAL::IO::set_ascii_mode(if1_5); Triangul T1_5_copy; if1_5 >> T1_5_copy; assert( T1_5_copy.is_valid() && T1_5_copy.number_of_vertices() == T1_5.number_of_vertices() ); - std::ifstream if1_6("T16.triangulation"); CGAL::set_ascii_mode(if1_6); + std::ifstream if1_6("T16.triangulation"); CGAL::IO::set_ascii_mode(if1_6); Triangul T1_6_copy; if1_6 >> T1_6_copy; assert( T1_6_copy.is_valid() && T1_6_copy.number_of_vertices() == T1_6.number_of_vertices() ); - std::ifstream if2_1("T21.triangulation"); CGAL::set_ascii_mode(if2_1); + std::ifstream if2_1("T21.triangulation"); CGAL::IO::set_ascii_mode(if2_1); Triangul T2_1_copy; if2_1 >> T2_1_copy; assert( T2_1_copy.is_valid() && T2_1_copy.number_of_vertices() == T2_1.number_of_vertices() ); - std::ifstream if2_3("T23.triangulation"); CGAL::set_ascii_mode(if2_3); + std::ifstream if2_3("T23.triangulation"); CGAL::IO::set_ascii_mode(if2_3); Triangul T2_3_copy; if2_3 >> T2_3_copy; assert( T2_3_copy.is_valid() && T2_3_copy.number_of_vertices() == T2_3.number_of_vertices() ); - std::ifstream if2_5("T25.triangulation"); CGAL::set_ascii_mode(if2_5); + std::ifstream if2_5("T25.triangulation"); CGAL::IO::set_ascii_mode(if2_5); Triangul T2_5_copy; if2_5 >> T2_5_copy; assert( T2_5_copy.is_valid() && T2_5_copy.number_of_vertices() == T2_5.number_of_vertices() ); - std::ifstream if2_6("T26.triangulation"); CGAL::set_ascii_mode(if2_6); + std::ifstream if2_6("T26.triangulation"); CGAL::IO::set_ascii_mode(if2_6); Triangul T2_6_copy; if2_6 >> T2_6_copy; assert( T2_6_copy.is_valid() && T2_6_copy.number_of_vertices() == T2_6.number_of_vertices() ); diff --git a/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_triangulation_short_2.h b/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_triangulation_short_2.h index bb5bbd8a603..61fbb042389 100644 --- a/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_triangulation_short_2.h +++ b/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_triangulation_short_2.h @@ -477,21 +477,21 @@ _test_cls_triangulation_short_2( const Triangul &) /******** I/O *******/ std::cout << " output to a file" << std::endl; std::ofstream of1_5("T15.triangulation"); - CGAL::set_ascii_mode(of1_5); + CGAL::IO::set_ascii_mode(of1_5); of1_5 << T1_5; of1_5.close(); std::ofstream of2_3("T23.triangulation"); - CGAL::set_ascii_mode(of2_3); + CGAL::IO::set_ascii_mode(of2_3); of2_3 << T2_3; of2_3.close(); std::cout << " input from a file" << std::endl; - std::ifstream if1_5("T15.triangulation"); CGAL::set_ascii_mode(if1_5); + std::ifstream if1_5("T15.triangulation"); CGAL::IO::set_ascii_mode(if1_5); Triangul T1_5_copy; if1_5 >> T1_5_copy; assert( T1_5_copy.is_valid() && T1_5_copy.number_of_vertices() == T1_5.number_of_vertices() ); - std::ifstream if2_3("T23.triangulation"); CGAL::set_ascii_mode(if2_3); + std::ifstream if2_3("T23.triangulation"); CGAL::IO::set_ascii_mode(if2_3); Triangul T2_3_copy; if2_3 >> T2_3_copy; assert( T2_3_copy.is_valid() && T2_3_copy.number_of_vertices() == T2_3.number_of_vertices() ); diff --git a/Triangulation_3/demo/Triangulation_3/Scene.cpp b/Triangulation_3/demo/Triangulation_3/Scene.cpp index dfab5a6d210..c56c3cd269b 100644 --- a/Triangulation_3/demo/Triangulation_3/Scene.cpp +++ b/Triangulation_3/demo/Triangulation_3/Scene.cpp @@ -123,12 +123,12 @@ void Scene::loadPointsOFF(const char* filename) void Scene::loadPointsXYZ(const char* filename) { - /* Use CGAL::read_XYZ to read in data -- tested */ + /* Use CGAL::IO::read_XYZ to read in data -- tested */ /* Note: this function reads in points only (normals are ignored) */ /* Note: this function can NOT omit comments (starting with '#') */ list pts; - if( !CGAL::read_XYZ( filename, // input ifstream - back_inserter(pts) ) ) { // output iterator over points + if( !CGAL::IO::read_XYZ( filename, // input ifstream + back_inserter(pts) ) ) { // output iterator over points showError( QObject::tr("Error: cannot read file %1.").arg(filename) ); } @@ -199,11 +199,11 @@ void Scene::savePointsXYZ(const char* filename) return; } - /* Use CGAL::write_xyz_points to write out data */ + /* Use CGAL::IO::write_xyz_points to write out data */ /* Note: this function writes out points only (normals are ignored) */ - if( !CGAL::write_XYZ( fout, // output ofstream - CGAL::make_range( m_dt.points_begin(), // first output point - m_dt.points_end()) ) ) { // past-the-end output point + if( !CGAL::IO::write_XYZ( fout, // output ofstream + CGAL::make_range( m_dt.points_begin(), // first output point + m_dt.points_end()) ) ) { // past-the-end output point showError( QObject::tr("Error: cannot read file %1.").arg(filename) ); } } diff --git a/Triangulation_3/demo/Triangulation_3/Scene.h b/Triangulation_3/demo/Triangulation_3/Scene.h index 45d2e1887d1..4588fae8475 100644 --- a/Triangulation_3/demo/Triangulation_3/Scene.h +++ b/Triangulation_3/demo/Triangulation_3/Scene.h @@ -16,7 +16,7 @@ public: public: inline void setViewer(CGAL::QGLViewer* v) { m_viewer = v; } inline void showError(const QString & msg) { - if(!m_viewer) m_viewer->displayMessage( msg ); + if(m_viewer != nullptr) m_viewer->displayMessage( msg ); } inline bool isDTEmpty() { return m_dt.number_of_vertices()==0; } inline void eraseOldData() { m_dt.clear(); m_vhArray.clear(); } diff --git a/Triangulation_3/demo/Triangulation_3_Geomview_demos/Triangulation_3_color_demo.cpp b/Triangulation_3/demo/Triangulation_3_Geomview_demos/Triangulation_3_color_demo.cpp index f5f8f09b9ba..010bf0465d8 100644 --- a/Triangulation_3/demo/Triangulation_3_Geomview_demos/Triangulation_3_color_demo.cpp +++ b/Triangulation_3/demo/Triangulation_3_Geomview_demos/Triangulation_3_color_demo.cpp @@ -31,7 +31,7 @@ int main() typedef CGAL::Exact_predicates_inexact_constructions_kernel K; -typedef CGAL::Triangulation_vertex_base_with_info_3 Vb; +typedef CGAL::Triangulation_vertex_base_with_info_3 Vb; typedef CGAL::Delaunay_triangulation_cell_base_3 Cb; typedef CGAL::Triangulation_data_structure_3 Tds; typedef CGAL::Delaunay_triangulation_3 Delaunay; @@ -41,7 +41,7 @@ typedef Delaunay::Point Point; int main() { CGAL::Geomview_stream gv(CGAL::Bbox_3(0,0,0, 2, 2, 2)); - gv.set_bg_color(CGAL::Color(0, 200, 200)); + gv.set_bg_color(CGAL::IO::Color(0, 200, 200)); gv.clear(); Delaunay T; @@ -57,7 +57,7 @@ int main() Delaunay::Finite_vertices_iterator vit; for (vit = T.finite_vertices_begin(); vit != T.finite_vertices_end(); ++vit) if (T.degree(vit) == 6) - vit->info() = CGAL::red(); + vit->info() = CGAL::IO::red(); std::cout << " Visualization of T" << std::endl; gv.set_wired(true); diff --git a/Triangulation_3/demo/Triangulation_3_Geomview_demos/Triangulation_3_demo.cpp b/Triangulation_3/demo/Triangulation_3_Geomview_demos/Triangulation_3_demo.cpp index f552d48c5cf..b34b666422d 100644 --- a/Triangulation_3/demo/Triangulation_3_Geomview_demos/Triangulation_3_demo.cpp +++ b/Triangulation_3/demo/Triangulation_3_Geomview_demos/Triangulation_3_demo.cpp @@ -95,7 +95,7 @@ void visu_vertex(CGAL::Geomview_stream & os, const TRIANGULATION & T, int main() { CGAL::Geomview_stream gv(CGAL::Bbox_3(0,0,0, 2, 2, 2)); - gv.set_bg_color(CGAL::Color(0, 200, 200)); + gv.set_bg_color(CGAL::IO::Color(0, 200, 200)); gv.clear(); Triangulation T; diff --git a/Triangulation_3/demo/Triangulation_3_Geomview_demos/Triangulation_3_remove_demo.cpp b/Triangulation_3/demo/Triangulation_3_Geomview_demos/Triangulation_3_remove_demo.cpp index 538a33b8bf3..4b1ab9e2f08 100644 --- a/Triangulation_3/demo/Triangulation_3_Geomview_demos/Triangulation_3_remove_demo.cpp +++ b/Triangulation_3/demo/Triangulation_3_Geomview_demos/Triangulation_3_remove_demo.cpp @@ -94,7 +94,7 @@ void visu_vertex(CGAL::Geomview_stream & os, const TRIANGULATION & T, int main() { CGAL::Geomview_stream gv(CGAL::Bbox_3(0,0,0, 5, 5, 5)); - gv.set_bg_color(CGAL::Color(0, 200, 200)); + gv.set_bg_color(CGAL::IO::Color(0, 200, 200)); gv.set_wired(true); gv.clear(); diff --git a/Triangulation_3/demo/Triangulation_3_Geomview_demos/Triangulation_3_voronoi_demo.cpp b/Triangulation_3/demo/Triangulation_3_Geomview_demos/Triangulation_3_voronoi_demo.cpp index e2d52232cf6..3fccb43099e 100644 --- a/Triangulation_3/demo/Triangulation_3_Geomview_demos/Triangulation_3_voronoi_demo.cpp +++ b/Triangulation_3/demo/Triangulation_3_Geomview_demos/Triangulation_3_voronoi_demo.cpp @@ -47,7 +47,7 @@ typedef Triangulation::Point Point; int main() { CGAL::Geomview_stream gv(CGAL::Bbox_3(0,0,0, 3, 3, 3)); - gv.set_bg_color(CGAL::Color(0, 200, 200)); + gv.set_bg_color(CGAL::IO::Color(0, 200, 200)); gv.clear(); Triangulation T; @@ -65,7 +65,7 @@ int main() gv << T; std::cout <<" Visualizing the Voronoi edges" << std::endl; - gv << CGAL::red(); + gv << CGAL::IO::red(); T.draw_dual(gv); char ch; diff --git a/Triangulation_3/examples/Triangulation_3/color.cpp b/Triangulation_3/examples/Triangulation_3/color.cpp index c61bf335689..88be5a11a23 100644 --- a/Triangulation_3/examples/Triangulation_3/color.cpp +++ b/Triangulation_3/examples/Triangulation_3/color.cpp @@ -8,7 +8,7 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel K; -typedef CGAL::Triangulation_vertex_base_with_info_3 Vb; +typedef CGAL::Triangulation_vertex_base_with_info_3 Vb; typedef CGAL::Delaunay_triangulation_cell_base_3 Cb; typedef CGAL::Triangulation_data_structure_3 Tds; typedef CGAL::Delaunay_triangulation_3 Delaunay; @@ -30,7 +30,7 @@ int main() Delaunay::Finite_vertices_iterator vit; for (Delaunay::Vertex_handle v : T.finite_vertex_handles()) if (T.degree(v) == 6) - v->info() = CGAL::red(); + v->info() = CGAL::IO::red(); return 0; } diff --git a/Triangulation_3/examples/Triangulation_3/segment_cell_traverser_3.cpp b/Triangulation_3/examples/Triangulation_3/segment_cell_traverser_3.cpp index e9a675ff7e0..cb0eb2c855d 100644 --- a/Triangulation_3/examples/Triangulation_3/segment_cell_traverser_3.cpp +++ b/Triangulation_3/examples/Triangulation_3/segment_cell_traverser_3.cpp @@ -25,7 +25,7 @@ int main(int argc, char* argv[]) const char* fname = (argc>1) ? argv[1] : "data/blobby.xyz"; std::vector points; - if (!CGAL::read_points(fname, std::back_inserter(points))) + if (!CGAL::IO::read_points(fname, std::back_inserter(points))) { std::cerr << "Error: cannot read file " << fname << std::endl; return EXIT_FAILURE; diff --git a/Triangulation_3/examples/Triangulation_3/segment_simplex_traverser_3.cpp b/Triangulation_3/examples/Triangulation_3/segment_simplex_traverser_3.cpp index 14c2fb7a7b2..f32ad6859bd 100644 --- a/Triangulation_3/examples/Triangulation_3/segment_simplex_traverser_3.cpp +++ b/Triangulation_3/examples/Triangulation_3/segment_simplex_traverser_3.cpp @@ -27,7 +27,7 @@ int main(int argc, char* argv[]) std::vector points; std::ifstream stream(fname); if (!stream || - !CGAL::read_XYZ(stream, std::back_inserter(points))) + !CGAL::IO::read_XYZ(stream, std::back_inserter(points))) { std::cerr << "Error: cannot read file " << fname << std::endl; return EXIT_FAILURE; diff --git a/Triangulation_3/include/CGAL/Regular_triangulation_3.h b/Triangulation_3/include/CGAL/Regular_triangulation_3.h index 34186b034a0..c65d42e9bf8 100644 --- a/Triangulation_3/include/CGAL/Regular_triangulation_3.h +++ b/Triangulation_3/include/CGAL/Regular_triangulation_3.h @@ -38,7 +38,6 @@ #include #include #include -#include #ifndef CGAL_TRIANGULATION_3_DONT_INSERT_RANGE_OF_POINTS_WITH_INFO #include diff --git a/Triangulation_3/include/CGAL/Triangulation_3.h b/Triangulation_3/include/CGAL/Triangulation_3.h index df69bf1f1b6..c59b5508a2f 100644 --- a/Triangulation_3/include/CGAL/Triangulation_3.h +++ b/Triangulation_3/include/CGAL/Triangulation_3.h @@ -2313,7 +2313,7 @@ public: std::size_t n; int d; - if(is_ascii(is)) + if(IO::is_ascii(is)) is >> d >> n; else { read(is, d); @@ -2375,7 +2375,7 @@ std::istream& operator>> (std::istream& is, Triangulation_3& tr) std::size_t n; int d; - if(is_ascii(is)) + if(IO::is_ascii(is)) { is >> d >> n; } @@ -2435,7 +2435,7 @@ std::ostream& operator<< (std::ostream& os, const Triangulation_3& // outputs dimension and number of vertices size_type n = tr.number_of_vertices(); - if(is_ascii(os)) + if(IO::is_ascii(os)) { os << tr.dimension() << std::endl << n << std::endl; } @@ -2464,7 +2464,7 @@ std::ostream& operator<< (std::ostream& os, const Triangulation_3& { os << *TV[i]; V[TV[i]] = i; - if(is_ascii(os)) + if(IO::is_ascii(os)) os << std::endl; } @@ -2482,7 +2482,7 @@ std::ostream& operator<< (std::ostream& os, const Triangulation_3& for(Cell_iterator it = tr.cells_begin(), end = tr.cells_end(); it != end; ++it) { os << *it; // other information - if(is_ascii(os)) + if(IO::is_ascii(os)) os << std::endl; } break; @@ -2492,7 +2492,7 @@ std::ostream& operator<< (std::ostream& os, const Triangulation_3& for(Facet_iterator it = tr.facets_begin(), end = tr.facets_end(); it != end; ++it) { os << *((*it).first); // other information - if(is_ascii(os)) + if(IO::is_ascii(os)) os << std::endl; } break; @@ -2502,7 +2502,7 @@ std::ostream& operator<< (std::ostream& os, const Triangulation_3& for(Edge_iterator it = tr.edges_begin(), end = tr.edges_end(); it != end; ++it) { os << *((*it).first); // other information - if(is_ascii(os)) + if(IO::is_ascii(os)) os << std::endl; } break; diff --git a/Triangulation_3/include/CGAL/draw_triangulation_3.h b/Triangulation_3/include/CGAL/draw_triangulation_3.h index 0c778ca08a7..3e5bbaec9f5 100644 --- a/Triangulation_3/include/CGAL/draw_triangulation_3.h +++ b/Triangulation_3/include/CGAL/draw_triangulation_3.h @@ -28,11 +28,11 @@ namespace CGAL struct DefaultColorFunctorT3 { template - static CGAL::Color run(const T3&, + static CGAL::IO::Color run(const T3&, const typename T3::Finite_facets_iterator* fh) { if (fh==nullptr) // use to get the mono color - return CGAL::Color(100, 125, 200); // R G B between 0-255 + return CGAL::IO::Color(100, 125, 200); // R G B between 0-255 CGAL::Random random((unsigned int)((std::size_t)(&*((*fh)->first))+ (std::size_t)((*fh)->second))); @@ -74,7 +74,7 @@ public: protected: void compute_face(Facet_const_handle fh) { - CGAL::Color c=m_fcolor.run(t3, &fh); + CGAL::IO::Color c=m_fcolor.run(t3, &fh); face_begin(c); add_point_in_face(fh->first->vertex((fh->second+1)%4)->point()); diff --git a/Triangulation_3/test/Triangulation_3/include/CGAL/_test_cls_triangulation_3.h b/Triangulation_3/test/Triangulation_3/include/CGAL/_test_cls_triangulation_3.h index a2afe749131..8c63a6cd09b 100644 --- a/Triangulation_3/test/Triangulation_3/include/CGAL/_test_cls_triangulation_3.h +++ b/Triangulation_3/test/Triangulation_3/include/CGAL/_test_cls_triangulation_3.h @@ -63,11 +63,11 @@ _test_cls_triangulation_3_input_output(const Triangulation & T, std::cout << " I/O (binary)" << std::endl; { std::ofstream oFileBin(filename2, std::ios::out|std::ios::binary); - CGAL::set_binary_mode(oFileBin); + CGAL::IO::set_binary_mode(oFileBin); oFileBin << T; } std::ifstream iFileBin(filename2, std::ios::in|std::ios::binary); - CGAL::set_binary_mode(iFileBin); + CGAL::IO::set_binary_mode(iFileBin); Triangulation Tfromfile_binary; iFileBin >> Tfromfile_binary; assert(Tfromfile_binary.is_valid()); diff --git a/Triangulation_3/test/Triangulation_3/test_simplex_iterator_3.cpp b/Triangulation_3/test/Triangulation_3/test_simplex_iterator_3.cpp index 9ef1b068212..a2340ade3dd 100644 --- a/Triangulation_3/test/Triangulation_3/test_simplex_iterator_3.cpp +++ b/Triangulation_3/test/Triangulation_3/test_simplex_iterator_3.cpp @@ -333,7 +333,7 @@ int main(int argc, char* argv[]) std::vector points; std::ifstream stream(fname); if (!stream || - !CGAL::read_XYZ(stream, std::back_inserter(points))) + !CGAL::IO::read_XYZ(stream, std::back_inserter(points))) { std::cerr << "Error: cannot read file " << fname << std::endl; return EXIT_FAILURE; diff --git a/Triangulation_on_sphere_2/examples/Triangulation_on_sphere_2/triang_on_sphere.cpp b/Triangulation_on_sphere_2/examples/Triangulation_on_sphere_2/triang_on_sphere.cpp index ca161c357f1..05a9135b26c 100644 --- a/Triangulation_on_sphere_2/examples/Triangulation_on_sphere_2/triang_on_sphere.cpp +++ b/Triangulation_on_sphere_2/examples/Triangulation_on_sphere_2/triang_on_sphere.cpp @@ -40,7 +40,7 @@ int main(int, char**) std::cout << dtos.number_of_ghost_faces() << " ghost faces\n" << std::endl; } - CGAL::write_OFF("result.off", dtos, CGAL::parameters::stream_precision(17)); + CGAL::IO::write_OFF("result.off", dtos, CGAL::parameters::stream_precision(17)); return EXIT_SUCCESS; } diff --git a/Triangulation_on_sphere_2/examples/Triangulation_on_sphere_2/triang_on_sphere_geo.cpp b/Triangulation_on_sphere_2/examples/Triangulation_on_sphere_2/triang_on_sphere_geo.cpp index 5f3d9c21040..a4989188773 100644 --- a/Triangulation_on_sphere_2/examples/Triangulation_on_sphere_2/triang_on_sphere_geo.cpp +++ b/Triangulation_on_sphere_2/examples/Triangulation_on_sphere_2/triang_on_sphere_geo.cpp @@ -57,7 +57,7 @@ int main(int argc, char** argv) std::cout << dtos.number_of_faces() << " solid faces" << std::endl; std::cout << dtos.number_of_ghost_faces() << " ghost faces" << std::endl; - CGAL::write_OFF("result.off", dtos, CGAL::parameters::stream_precision(17)); + CGAL::IO::write_OFF("result.off", dtos, CGAL::parameters::stream_precision(17)); return EXIT_SUCCESS; } diff --git a/Triangulation_on_sphere_2/examples/Triangulation_on_sphere_2/triang_on_sphere_proj.cpp b/Triangulation_on_sphere_2/examples/Triangulation_on_sphere_2/triang_on_sphere_proj.cpp index a50f6fde1e5..814c36b7089 100644 --- a/Triangulation_on_sphere_2/examples/Triangulation_on_sphere_2/triang_on_sphere_proj.cpp +++ b/Triangulation_on_sphere_2/examples/Triangulation_on_sphere_2/triang_on_sphere_proj.cpp @@ -40,7 +40,7 @@ int main(int, char**) std::cout << dtos.number_of_ghost_faces() << " ghost faces" << std::endl; } - CGAL::write_OFF("result.off", dtos, CGAL::parameters::stream_precision(17)); + CGAL::IO::write_OFF("result.off", dtos, CGAL::parameters::stream_precision(17)); return EXIT_SUCCESS; } diff --git a/Triangulation_on_sphere_2/examples/Triangulation_on_sphere_2/triang_on_sphere_range.cpp b/Triangulation_on_sphere_2/examples/Triangulation_on_sphere_2/triang_on_sphere_range.cpp index 7ae1621c3c1..d3a9137fee3 100644 --- a/Triangulation_on_sphere_2/examples/Triangulation_on_sphere_2/triang_on_sphere_range.cpp +++ b/Triangulation_on_sphere_2/examples/Triangulation_on_sphere_2/triang_on_sphere_range.cpp @@ -40,7 +40,7 @@ int main(int argc, char** argv) std::cout << dtos.number_of_vertices() << " vertices" << std::endl; std::cout << dtos.number_of_faces() << " solid faces" << std::endl; - CGAL::write_OFF("result.off", dtos, CGAL::parameters::stream_precision(17)); + CGAL::IO::write_OFF("result.off", dtos, CGAL::parameters::stream_precision(17)); return EXIT_SUCCESS; } diff --git a/Triangulation_on_sphere_2/include/CGAL/Delaunay_triangulation_on_sphere_2.h b/Triangulation_on_sphere_2/include/CGAL/Delaunay_triangulation_on_sphere_2.h index b883507a5e0..33a14b828e7 100644 --- a/Triangulation_on_sphere_2/include/CGAL/Delaunay_triangulation_on_sphere_2.h +++ b/Triangulation_on_sphere_2/include/CGAL/Delaunay_triangulation_on_sphere_2.h @@ -1051,7 +1051,7 @@ Delaunay_triangulation_on_sphere_2:: circumcenter_on_sphere(const Face_handle f) const { CGAL_precondition(dimension() == 2); - CGAL_precondition(!is_ghost(f)); +// CGAL_precondition(!is_ghost(f)); return circumcenter_on_sphere(point(f, 0), point(f, 1), point(f, 2)); } @@ -1062,7 +1062,7 @@ Delaunay_triangulation_on_sphere_2:: dual_on_sphere(const Face_handle f) const { CGAL_precondition(dimension() == 2); - CGAL_precondition(!is_ghost(f)); +// CGAL_precondition(!is_ghost(f)); return circumcenter_on_sphere(f); } @@ -1073,7 +1073,7 @@ Delaunay_triangulation_on_sphere_2:: dual_on_sphere(const Edge& e) const { CGAL_precondition(dimension() == 2); - CGAL_precondition(!is_ghost(e)); +// CGAL_precondition(!is_ghost(e)); return geom_traits().construct_arc_on_sphere_2_object()(dual_on_sphere(e.first), dual_on_sphere(e.first->neighbor(e.second))); diff --git a/Triangulation_on_sphere_2/include/CGAL/Delaunay_triangulation_on_sphere_traits_2.h b/Triangulation_on_sphere_2/include/CGAL/Delaunay_triangulation_on_sphere_traits_2.h index 5e452819cd3..95c12831583 100644 --- a/Triangulation_on_sphere_2/include/CGAL/Delaunay_triangulation_on_sphere_traits_2.h +++ b/Triangulation_on_sphere_2/include/CGAL/Delaunay_triangulation_on_sphere_traits_2.h @@ -305,6 +305,17 @@ public: initialize_bounds(); } + friend void swap(Self& l, Self& r) + { + using std::swap; + swap(static_cast(l), static_cast(r)); + swap(static_cast(l), static_cast(r)); + swap(l._center, r._center); + swap(l._radius, r._radius); + l.initialize_bounds(); + r.initialize_bounds(); + } + public: const LK& lk() const { return static_cast(*this); } const SK& sk() const { return static_cast(*this); } diff --git a/Triangulation_on_sphere_2/include/CGAL/Triangulation_on_sphere_2.h b/Triangulation_on_sphere_2/include/CGAL/Triangulation_on_sphere_2.h index 6f449381eac..9d8aac545a7 100644 --- a/Triangulation_on_sphere_2/include/CGAL/Triangulation_on_sphere_2.h +++ b/Triangulation_on_sphere_2/include/CGAL/Triangulation_on_sphere_2.h @@ -200,12 +200,23 @@ public: return is_contour(e.first, e.second); } + template + bool is_infinite(const T&, int = 0) const + { + return false; + } + //-----------------------TRAVERSING : ITERATORS AND CIRCULATORS----------------------------------- typedef typename Tds::Vertex_iterator Vertices_iterator; + typedef typename Tds::Vertex_iterator All_vertices_iterator; typedef typename Tds::Edge_iterator All_edges_iterator; typedef typename Tds::Face_iterator All_faces_iterator; + typedef typename Tds::Vertex_iterator Finite_vertices_iterator; + typedef typename Tds::Edge_iterator Finite_edges_iterator; + typedef typename Tds::Face_iterator Finite_faces_iterator; + typedef typename Tds::Vertex_circulator Vertex_circulator; typedef typename Tds::Edge_circulator Edge_circulator; typedef typename Tds::Face_circulator Face_circulator; @@ -267,14 +278,18 @@ public: typedef boost::transform_iterator Point_iterator; typedef Iterator_range Points; + // -- faces All_faces_iterator all_faces_begin() const { return _tds.faces_begin(); } All_faces_iterator all_faces_end() const { return _tds.faces_end(); } + Finite_faces_iterator finite_faces_begin() const { return _tds.faces_begin(); } + Finite_faces_iterator finite_faces_end() const { return _tds.faces_end(); } All_face_handles all_face_handles() const { return make_prevent_deref_range(all_faces_begin(), all_faces_end()); } + // -- edges Contour_edges_iterator contour_edges_begin() const { if(dimension() < 1) @@ -326,10 +341,19 @@ public: All_edges_iterator all_edges_begin() const { return _tds.edges_begin(); } All_edges_iterator all_edges_end() const { return _tds.edges_end(); } + Finite_edges_iterator finite_edges_begin() const { return _tds.edges_begin(); } + Finite_edges_iterator finite_edges_end() const { return _tds.edges_end(); } + All_edges all_edges() const { return _tds.edges(); } + // -- vertices Vertices_iterator vertices_begin() const { return _tds.vertices_begin(); } Vertices_iterator vertices_end() const { return _tds.vertices_end(); } + All_vertices_iterator all_vertices_begin() const { return _tds.vertices_begin(); } + All_vertices_iterator all_vertices_end() const { return _tds.vertices_end(); } + Finite_vertices_iterator finite_vertices_begin() const { return _tds.vertices_begin(); } + Finite_vertices_iterator finite_vertices_end() const { return _tds.vertices_end(); } + Vertex_handles vertex_handles() const { return make_prevent_deref_range(vertices_begin(), vertices_end()); @@ -491,8 +515,9 @@ void Triangulation_on_sphere_2:: swap(Triangulation_on_sphere_2& tr) { + using std::swap; _tds.swap(tr._tds); - std::swap(tr.geom_traits(), geom_traits()); + swap(_gt, tr._gt); } template diff --git a/Triangulation_on_sphere_2/include/CGAL/Triangulation_on_sphere_2/IO/OFF.h b/Triangulation_on_sphere_2/include/CGAL/Triangulation_on_sphere_2/IO/OFF.h index 13fc0a329ab..b939db6e843 100644 --- a/Triangulation_on_sphere_2/include/CGAL/Triangulation_on_sphere_2/IO/OFF.h +++ b/Triangulation_on_sphere_2/include/CGAL/Triangulation_on_sphere_2/IO/OFF.h @@ -43,6 +43,8 @@ class Triangulation_on_sphere_2; //////////////////////////////////////////////////////////////////////////////////////////////////// // Write +namespace IO { + /*! \ingroup PkgPointSet3IOOFF @@ -187,6 +189,6 @@ bool write_OFF(const std::string& fname, const CGAL::Triangulation_on_sphere_2 -#ifdef CGAL_EIGEN3_ENABLED +#include +#include +#ifdef CGAL_EIGEN3_ENABLED #include +#endif #include #include @@ -26,16 +29,35 @@ namespace CGAL { namespace Triangulations_on_sphere_2 { namespace internal { -template -double get_theta( typename Kernel::Point_3& pt, - typename Kernel::Vector_3& V1, - typename Kernel::Vector_3& V2, - typename Kernel::Vector_3& V3) +template +double get_theta(typename Kernel::Point_3& pt, + typename Kernel::Vector_3& V1, + typename Kernel::Vector_3& V2, + typename Kernel::Vector_3& V3) { typedef typename Kernel::FT FT; - typedef Eigen::Matrix Matrix; - typedef Eigen::Matrix Col; + typedef typename Default::Get +#else + EigenlessDefault +#endif + >::type Matrix; + + typedef typename Default::Get +#else + EigenlessDefault +#endif + >::type Col; + + CGAL_static_assertion_msg(!(std::is_same::value), + "Eigen is required to perform arc subsampling!"); auto V1c = V1.cartesian_begin(), V2c = V2.cartesian_begin(), V3c = V3.cartesian_begin(); @@ -154,6 +176,4 @@ void subsample_arc_on_sphere_2(const ArcOnSphere& arc, } // namespace Triangulations_on_sphere_2 } // namespace CGAL -#endif // CGAL_EIGEN3_ENABLED - #endif // CGAL_TOS2_INTERNAL_ARC_ON_SPHERE_SUBSAMPLING_H diff --git a/Triangulation_on_sphere_2/test/Triangulation_on_sphere_2/test_dtos.cpp b/Triangulation_on_sphere_2/test/Triangulation_on_sphere_2/test_dtos.cpp index 9cec6e8b2ac..e3c66570792 100644 --- a/Triangulation_on_sphere_2/test/Triangulation_on_sphere_2/test_dtos.cpp +++ b/Triangulation_on_sphere_2/test/Triangulation_on_sphere_2/test_dtos.cpp @@ -79,7 +79,7 @@ int main(int, char**) assert(tr.geom_traits().radius() == 1); tr.insert(points.begin(), points.end()); - write_OFF("test_dtos.off", tr); + CGAL::IO::write_OFF("test_dtos.off", tr); assert(tr.is_valid()); ////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/Triangulation_on_sphere_2/test/Triangulation_on_sphere_2/test_dtos_dual.cpp b/Triangulation_on_sphere_2/test/Triangulation_on_sphere_2/test_dtos_dual.cpp index bd617d65e10..7acf8ae61f2 100644 --- a/Triangulation_on_sphere_2/test/Triangulation_on_sphere_2/test_dtos_dual.cpp +++ b/Triangulation_on_sphere_2/test/Triangulation_on_sphere_2/test_dtos_dual.cpp @@ -33,7 +33,7 @@ void test(const PointRange& points) dt.insert(points.begin(), points.end()); // The triangulation, using straight edges - write_OFF("result.off", dt, CGAL::parameters::stream_precision(17)); + CGAL::IO::write_OFF("result.off", dt, CGAL::parameters::stream_precision(17)); std::ofstream out_primal("edges_primal.polylines.cgal"); out_primal.precision(17); diff --git a/Union_find/test/Union_find/include/CGAL/test_macros.h b/Union_find/test/Union_find/include/CGAL/test_macros.h index 7ba8334b2f1..369323eab84 100644 --- a/Union_find/test/Union_find/include/CGAL/test_macros.h +++ b/Union_find/test/Union_find/include/CGAL/test_macros.h @@ -14,7 +14,7 @@ else {} #define CGAL_IO_TEST(datao,datai,iomode) { \ std::stringstream S; \ - CGAL::set_mode(S,iomode); \ + CGAL::IO::set_mode(S,iomode); \ S << datao; \ if ( iomode != CGAL::IO::BINARY) \ S << '\n'; \ diff --git a/Visibility_2/include/CGAL/Triangular_expansion_visibility_2.h b/Visibility_2/include/CGAL/Triangular_expansion_visibility_2.h index 43a66c0fbd0..f8a723265d5 100644 --- a/Visibility_2/include/CGAL/Triangular_expansion_visibility_2.h +++ b/Visibility_2/include/CGAL/Triangular_expansion_visibility_2.h @@ -18,7 +18,7 @@ #include -#include +#include #include #include #include @@ -151,7 +151,7 @@ private: // May change during visibility computation mutable Observer observer; - mutable boost::shared_ptr p_cdt; + mutable std::shared_ptr p_cdt; mutable std::vector needles; // Copy constructor and assignment not supported @@ -696,7 +696,7 @@ private: Make_constraint()); //std::cout << "init_cdt new CDT" << std::endl; - p_cdt = boost::shared_ptr(new CDT(begin, end)); + p_cdt = std::shared_ptr(new CDT(begin, end)); observer.has_changed = false; //std::cout << "init_cdt done" << std::endl; //std::cout << std::endl; diff --git a/Voronoi_diagram_2/include/CGAL/Delaunay_triangulation_on_sphere_adaptation_traits_2.h b/Voronoi_diagram_2/include/CGAL/Delaunay_triangulation_on_sphere_adaptation_traits_2.h new file mode 100644 index 00000000000..3a4023d7455 --- /dev/null +++ b/Voronoi_diagram_2/include/CGAL/Delaunay_triangulation_on_sphere_adaptation_traits_2.h @@ -0,0 +1,61 @@ +// Copyright (c) 2021 GeometryFactory +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org). +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial +// +// +// Author(s) : Mael Rouxel-Labbé + +#ifndef CGAL_DELAUNAY_TRIANGULATION_ADAPTATION_TRAITS_2_H +#define CGAL_DELAUNAY_TRIANGULATION_ADAPTATION_TRAITS_2_H 1 + +#include + +#include +#include +#include +#include + +namespace CGAL { + +template +struct Delaunay_triangulation_on_sphere_adaptation_traits_2 +{ +public: + typedef DToS2 Delaunay_graph; + typedef typename DToS2::Geom_traits Geom_traits; + typedef typename Geom_traits::Point_on_sphere_2 Point_2; + typedef Point_2 Site_2; + + typedef CGAL_VORONOI_DIAGRAM_2_INS::Point_accessor Access_site_2; + typedef CGAL_VORONOI_DIAGRAM_2_INS::DToS2_Voronoi_point_2 Construct_Voronoi_point_2; + + typedef typename Delaunay_graph::Vertex_handle Delaunay_vertex_handle; + typedef typename Delaunay_graph::Edge Delaunay_edge; + typedef typename Delaunay_graph::Face_handle Delaunay_face_handle; + + typedef CGAL::Tag_false Has_nearest_site_2; + typedef CGAL_VORONOI_DIAGRAM_2_INS::Null_functor Nearest_site_2; + + Delaunay_triangulation_on_sphere_adaptation_traits_2(const Geom_traits& gt) : gt(gt) { } + + Access_site_2 access_site_2_object() const + { return Access_site_2(gt); } + + Construct_Voronoi_point_2 construct_Voronoi_point_2_object() const + { return Construct_Voronoi_point_2(gt); } + + Nearest_site_2 nearest_site_2_object() const + { return Nearest_site_2(); } + +private: + const Geom_traits gt; // intentional copy +}; + +} //namespace CGAL + +#endif // CGAL_DELAUNAY_TRIANGULATION_ADAPTATION_TRAITS_2_H diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Construct_dual_points.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Construct_dual_points.h index 993dacbeae9..a0ff91ad5d5 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Construct_dual_points.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Construct_dual_points.h @@ -77,6 +77,31 @@ public: //========================================================================= +template +struct DToS2_Voronoi_point_2 +{ +private: + typedef typename DToS2::Geom_traits Geom_traits; + typedef typename Geom_traits::Point_on_sphere_2 Point_on_sphere_2; + +public: + typedef typename DToS2::Face_handle Face_handle; + typedef Point_on_sphere_2 result_type; + + DToS2_Voronoi_point_2(const Geom_traits& gt) : gt(gt) { } + + result_type operator()(const Face_handle f) const + { + return gt.construct_circumcenter_on_sphere_2_object()( + f->vertex(0)->point(), f->vertex(1)->point(), f->vertex(2)->point()); + } + +private: + const Geom_traits& gt; +}; + +//========================================================================= + template class Segment_Voronoi_diagram_Voronoi_point_2 { diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Identity_rejectors.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Identity_rejectors.h index 4bbf7c67b44..5e1e2903af4 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Identity_rejectors.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Identity_rejectors.h @@ -53,22 +53,12 @@ struct Identity_edge_rejector return false; } - bool operator()(const Delaunay_graph& , const Edge& ) const { - return false; - } + // handles Edge, All_edges_iterator, Finite_edges_iterator, Edge_circulator... + // use a single template in case some of these types (typically All_edges_iterator + // and Finite_edges_iterator) are equal - bool operator()(const Delaunay_graph& , - const All_edges_iterator& ) const { - return false; - } - - bool operator()(const Delaunay_graph& , - const Finite_edges_iterator& ) const { - return false; - } - - bool operator()(const Delaunay_graph& , - const Edge_circulator& ) const { + template + bool operator()(const Delaunay_graph& , const E& ) const { return false; } }; diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Site_accessors.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Site_accessors.h index 50f7a347f56..fdf92ffa573 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Site_accessors.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Site_accessors.h @@ -15,12 +15,11 @@ #include - #include namespace CGAL { - -namespace VoronoiDiagram_2 { namespace Internal { +namespace VoronoiDiagram_2 { +namespace Internal { //========================================================================= //========================================================================= @@ -70,11 +69,10 @@ struct Point_accessor } }; -//========================================================================= //========================================================================= -} } //namespace VoronoiDiagram_2::Internal - -} //namespace CGAL +} // namespace Internal +} // namespace VoronoiDiagram_2 +} // namespace CGAL #endif // CGAL_VORONOI_DIAGRAM_2_SITE_ACCESSORS_H diff --git a/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h b/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h index 66f7d364293..3ccb450b14f 100644 --- a/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h +++ b/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h @@ -32,10 +32,10 @@ namespace CGAL { struct DefaultColorFunctorV2 { template - static CGAL::Color run(const V2 &, const typename V2::Face_iterator /*fh*/) { + static CGAL::IO::Color run(const V2 &, const typename V2::Face_iterator /*fh*/) { //CGAL::Random random((unsigned int)(std::size_t)(&*fh)); //return get_random_color(random); - return CGAL::Color(73, 250, 117); + return CGAL::IO::Color(73, 250, 117); } }; @@ -88,7 +88,7 @@ protected: void compute_dual_vertex(Dual_vertices_iterator vi) { - add_point(vi->point(), CGAL::Color(50, 100, 180)); + add_point(vi->point(), CGAL::IO::Color(50, 100, 180)); } void add_segments_and_update_bounding_box(Halfedge_handle he) @@ -187,7 +187,7 @@ protected: if (he->is_ray()) { if (he->has_source()) { // add_ray_segment(he->source()->point(), get_second_point(he)); - add_ray(he->source()->point(), direction, CGAL::Color(100, 0, 0)); + add_ray(he->source()->point(), direction, CGAL::IO::Color(100, 0, 0)); } } else if (he->is_bisector()) { Kernel::Point_2 pointOnLine((v1->point().x() + v2->point().x()) / 2, @@ -198,7 +198,7 @@ protected: void compute_face(Face_const_handle fh) { - CGAL::Color c = m_fcolor.run(v2, fh); + CGAL::IO::Color c = m_fcolor.run(v2, fh); Ccb_halfedge_circulator ec_start = fh->ccb(); Ccb_halfedge_circulator ec = ec_start;