diff --git a/BGL/include/CGAL/boost/graph/IO/GOCAD.h b/BGL/include/CGAL/boost/graph/IO/GOCAD.h index 474532aeede..25cdf0ce780 100644 --- a/BGL/include/CGAL/boost/graph/IO/GOCAD.h +++ b/BGL/include/CGAL/boost/graph/IO/GOCAD.h @@ -304,7 +304,7 @@ bool write_GOCAD(std::ostream& os, return false; const int precision = choose_parameter(get_parameter(np, internal_np::stream_precision), 6); - os << std::setprecision(precision); + os.precision(precision); os << "GOCAD TSurf 1\n" "HEADER {\n" 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 a13703ed2be..4ab13c13192 100644 --- a/BGL/include/CGAL/boost/graph/IO/Generic_facegraph_printer.h +++ b/BGL/include/CGAL/boost/graph/IO/Generic_facegraph_printer.h @@ -118,7 +118,7 @@ public: return false; const int precision = choose_parameter(get_parameter(np, internal_np::stream_precision), 6); - m_os << std::setprecision(precision); + m_os.precision(precision); VPM vpm = choose_parameter(get_parameter(np, internal_np::vertex_point), get_const_property_map(CGAL::vertex_point, g)); diff --git a/BGL/include/CGAL/boost/graph/IO/PLY.h b/BGL/include/CGAL/boost/graph/IO/PLY.h index 94673e1bf8f..ff65a977f7b 100644 --- a/BGL/include/CGAL/boost/graph/IO/PLY.h +++ b/BGL/include/CGAL/boost/graph/IO/PLY.h @@ -362,7 +362,7 @@ bool write_PLY(std::ostream& os, return false; const int precision = choose_parameter(get_parameter(np, internal_np::stream_precision), 6); - os << std::setprecision(precision); + os.precision(precision); // Write header os << "ply" << std::endl diff --git a/BGL/include/CGAL/boost/graph/IO/STL.h b/BGL/include/CGAL/boost/graph/IO/STL.h index 5854ce81537..2cd8fac5b44 100644 --- a/BGL/include/CGAL/boost/graph/IO/STL.h +++ b/BGL/include/CGAL/boost/graph/IO/STL.h @@ -251,7 +251,7 @@ bool write_STL(std::ostream& os, return false; const int precision = choose_parameter(get_parameter(np, internal_np::stream_precision), 6); - os << std::setprecision(precision); + os.precision(precision); if(get_mode(os) == IO::BINARY) { diff --git a/BGL/include/CGAL/boost/graph/IO/VTK.h b/BGL/include/CGAL/boost/graph/IO/VTK.h index c572f38d556..0d9084667db 100644 --- a/BGL/include/CGAL/boost/graph/IO/VTK.h +++ b/BGL/include/CGAL/boost/graph/IO/VTK.h @@ -440,7 +440,7 @@ bool write_VTP(std::ostream& os, return false; const int precision = choose_parameter(get_parameter(np, internal_np::stream_precision), 6); - os << std::setprecision(precision); + os.precision(precision); os << "\n" << " id; // used to get a unique ID per type. }; diff --git a/Geomview/include/CGAL/IO/Geomview_stream_impl.h b/Geomview/include/CGAL/IO/Geomview_stream_impl.h index b45459fdcec..08a558043a7 100644 --- a/Geomview/include/CGAL/IO/Geomview_stream_impl.h +++ b/Geomview/include/CGAL/IO/Geomview_stream_impl.h @@ -43,7 +43,7 @@ Geomview_stream::Geomview_stream(const Bbox_3 &bbox, : bb(bbox), vertex_color(black()), edge_color(black()), face_color(black()), wired_flag(false), echo_flag(true), raw_flag(false), trace_flag(false), binary_flag(false), - line_width(1) + line_width(1),prec(6) { setup_geomview(machine, login); frame(bbox); @@ -242,6 +242,7 @@ Geomview_stream::operator<<(int i) } else { // transform the int in a character sequence and put whitespace around std::ostringstream str; + str.precision(prec); str << i << ' ' << std::ends; *this << str.str().c_str(); } @@ -264,6 +265,7 @@ Geomview_stream::operator<<(unsigned int i) } else { // transform the int in a character sequence and put whitespace around std::ostringstream str; + str.precision(prec); str << i << ' ' << std::ends; *this << str.str().c_str(); } @@ -299,6 +301,7 @@ Geomview_stream::operator<<(double d) } else { // 'copy' the float in a string and append a blank std::ostringstream str; + str.precision(prec); str << f << ' ' << std::ends; *this << str.str().c_str(); } 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 6306edd032c..76619129a76 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 @@ -496,7 +496,7 @@ bool write_PLY(std::ostream& os, } const int precision = choose_parameter(get_parameter(np, internal_np::stream_precision), 6); - os << std::setprecision(precision); + os.precision(precision); os << "ply" << std::endl << ((get_mode(os) == IO::BINARY) ? "format binary_little_endian 1.0" : "format ascii 1.0") << std::endl 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 ecb27a5cbfc..c35a500f705 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 @@ -67,7 +67,7 @@ bool write_OFF_PSP(std::ostream& os, } const int precision = choose_parameter(get_parameter(np, internal_np::stream_precision), 6); - os << std::setprecision(precision); + os.precision(precision); // Write header os << "NOFF" << std::endl; 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 73bb00070d0..f4264d4e322 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 @@ -213,7 +213,7 @@ bool write_PLY(std::ostream& os, } const int precision = choose_parameter(get_parameter(np, internal_np::stream_precision), 6); - os << std::setprecision(precision); + os.precision(precision); if (has_normals) return write_PLY_with_properties(os, points, 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 4127d71b966..5fc1d8014e8 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 @@ -68,7 +68,7 @@ bool write_XYZ_PSP(std::ostream& os, } const int precision = choose_parameter(get_parameter(np, internal_np::stream_precision), 6); - os << std::setprecision(precision); + os.precision(precision); // Write positions + normals for(typename PointRange::const_iterator it = points.begin(); it != points.end(); it++) diff --git a/Stream_support/include/CGAL/IO/GOCAD.h b/Stream_support/include/CGAL/IO/GOCAD.h index 1ce4c20f13f..d28f5fe5d9f 100644 --- a/Stream_support/include/CGAL/IO/GOCAD.h +++ b/Stream_support/include/CGAL/IO/GOCAD.h @@ -300,7 +300,7 @@ bool write_GOCAD(std::ostream& os, set_ascii_mode(os); // GOCAD is ASCII only const int precision = choose_parameter(get_parameter(np, internal_np::stream_precision), 6); - os << std::setprecision(precision); + os.precision(precision); os << "GOCAD TSurf 1\n" "HEADER {\n" diff --git a/Stream_support/include/CGAL/IO/Generic_writer.h b/Stream_support/include/CGAL/IO/Generic_writer.h index e396077f420..abf9077c49f 100644 --- a/Stream_support/include/CGAL/IO/Generic_writer.h +++ b/Stream_support/include/CGAL/IO/Generic_writer.h @@ -50,7 +50,7 @@ public: return false; const int precision = choose_parameter(get_parameter(np, internal_np::stream_precision), 6); - m_os << std::setprecision(precision); + m_os.precision(precision); m_writer.write_header(m_os, points.size(), 0, polygons.size()); for(std::size_t i=0, end=points.size(); i\n" << "