diff --git a/Circular_kernel_2/include/CGAL/IO/Dxf_reader.h b/Circular_kernel_2/include/CGAL/IO/Dxf_reader.h index 72616c6dbef..e7328f899f3 100644 --- a/Circular_kernel_2/include/CGAL/IO/Dxf_reader.h +++ b/Circular_kernel_2/include/CGAL/IO/Dxf_reader.h @@ -126,13 +126,13 @@ private: is >> n; CGAL_assertion(n == 10); - is >> cx; + is >> iformat(cx); is >> n; CGAL_assertion(n == 20); - is >> cy; + is >> iformat(cy); is >> n; CGAL_assertion(n == 40); - is >> r; + is >> iformat(r); FT rft(r); circ = typename K::Construct_circle_2()(Point_2(cx,cy), rft); } @@ -150,13 +150,13 @@ private: is >> n; CGAL_assertion(n == 10); - is >> cx; + is >> iformat(cx); is >> n; CGAL_assertion(n == 20); - is >> cy; + is >> iformat(cy); is >> n; CGAL_assertion(n == 40); - is >> r; + is >> iformat(r); center = typename K::Construct_point_2()(cx,cy); rft = FT(r); @@ -187,10 +187,10 @@ read_polygon(std::istream& is, Polygon& poly) CGAL_assertion(n == 0); is >> n; CGAL_assertion(n == 10); - is >> x; + is >> iformat(x); is >> n; CGAL_assertion(n == 20); - is >> y; + is >> iformat(y); is >> n; len = 0; if(n == 42){ @@ -252,7 +252,6 @@ void read_entities(std::istream& is, Polygons& polys, Centers_and_radii& car) { int n; - //double x, y; std::string str; is >> n; CGAL_assertion(n == 0); 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 274fcc5f10a..f78a539834d 100644 --- a/Circular_kernel_2/include/CGAL/IO/Dxf_reader_doubles.h +++ b/Circular_kernel_2/include/CGAL/IO/Dxf_reader_doubles.h @@ -129,13 +129,13 @@ private: is >> n; CGAL_assertion(n == 10); - is >> cx; + is >> iformat(cx); is >> n; CGAL_assertion(n == 20); - is >> cy; + is >> iformat(cy); is >> n; CGAL_assertion(n == 40); - is >> r; + is >> iformat(r); FT rft(r); circ = CGAL::make_array(cx,cy,rft); @@ -166,10 +166,10 @@ read_polygon(std::istream& is, Polygon& poly) CGAL_assertion(n == 0); is >> n; CGAL_assertion(n == 10); - is >> x; + is >> iformat(x); is >> n; CGAL_assertion(n == 20); - is >> y; + is >> iformat(y); is >> n; len = 0; if(n == 42){ @@ -194,7 +194,6 @@ void read_entities(std::istream& is, Polygons& polys, Circles& circles) { int n; - //double x, y; std::string str; is >> n; CGAL_assertion(n == 0); diff --git a/Kernel_23/include/CGAL/Bbox_2.h b/Kernel_23/include/CGAL/Bbox_2.h index 7ccfe8300aa..60d48dbbc93 100644 --- a/Kernel_23/include/CGAL/Bbox_2.h +++ b/Kernel_23/include/CGAL/Bbox_2.h @@ -193,7 +193,7 @@ operator>>(std::istream &is, Bbox_2 &b) switch(is.iword(IO::mode)) { case IO::ASCII : - is >> xmin >> ymin >> xmax >> ymax; + is >> iformat(xmin) >> iformat(ymin) >> iformat(xmax) >> 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 6518a4cc704..8be250baa2e 100644 --- a/Kernel_23/include/CGAL/Bbox_3.h +++ b/Kernel_23/include/CGAL/Bbox_3.h @@ -217,7 +217,8 @@ operator>>(std::istream &is, Bbox_3& b) switch(is.iword(IO::mode)) { case IO::ASCII : - is >> xmin >> ymin >> zmin >> xmax >> ymax >> zmax; + is >> iformat(xmin) >> iformat(ymin) >> iformat(zmin) + >> iformat(xmax) >> iformat(ymax) >> 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 70d27c066fa..403af712ef2 100644 --- a/Kernel_23/include/CGAL/Circle_2.h +++ b/Kernel_23/include/CGAL/Circle_2.h @@ -273,7 +273,7 @@ extract(std::istream& is, Circle_2& c) int o; switch(is.iword(IO::mode)) { case IO::ASCII : - is >> center >> squared_radius >> o; + is >> center >> 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 265ff825ff4..08b9e53e32e 100644 --- a/Kernel_23/include/CGAL/Direction_2.h +++ b/Kernel_23/include/CGAL/Direction_2.h @@ -231,7 +231,7 @@ extract(std::istream& is, Direction_2& d, const Cartesian_tag&) typename R::FT x, y; switch(is.iword(IO::mode)) { case IO::ASCII : - is >> x >> y; + is >> iformat(x) >> iformat(y); break; case IO::BINARY : read(is, x); @@ -255,7 +255,7 @@ extract(std::istream& is, Direction_2& d, const Homogeneous_tag&) switch(is.iword(IO::mode)) { case IO::ASCII : - is >> x >> y; + is >> iformat(x) >> 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 91afea14091..0a5118b5595 100644 --- a/Kernel_23/include/CGAL/Direction_3.h +++ b/Kernel_23/include/CGAL/Direction_3.h @@ -188,7 +188,7 @@ extract(std::istream& is, Direction_3& d, const Cartesian_tag&) typename R::FT x, y, z; switch(is.iword(IO::mode)) { case IO::ASCII : - is >> x >> y >> z; + is >> format(x) >> iformat(y) >> iformat(z); break; case IO::BINARY : read(is, x); @@ -213,7 +213,7 @@ extract(std::istream& is, Direction_3& d, const Homogeneous_tag&) switch(is.iword(IO::mode)) { case IO::ASCII : - is >> x >> y >> z; + is >> iformat(x) >> iformat(y) >> iformat(z); break; case IO::BINARY : read(is, x); diff --git a/Kernel_23/include/CGAL/Line_2.h b/Kernel_23/include/CGAL/Line_2.h index 772bbf26987..ab5d800dfa4 100644 --- a/Kernel_23/include/CGAL/Line_2.h +++ b/Kernel_23/include/CGAL/Line_2.h @@ -262,7 +262,7 @@ extract(std::istream& is, Line_2& l) typename R::RT a, b, c; switch(is.iword(IO::mode)) { case IO::ASCII : - is >> a >> b >> c; + is >> iformat(a) >> iformat(b) >> iformat(c); break; case IO::BINARY : read(is, a); diff --git a/Kernel_23/include/CGAL/Plane_3.h b/Kernel_23/include/CGAL/Plane_3.h index 9414daa74eb..cf34773010e 100644 --- a/Kernel_23/include/CGAL/Plane_3.h +++ b/Kernel_23/include/CGAL/Plane_3.h @@ -258,7 +258,7 @@ operator>>(std::istream &is, Plane_3 &p) typename R::RT a, b, c, d; switch(is.iword(IO::mode)) { case IO::ASCII : - is >> a >> b >> c >> d; + is >> iformat(a) >> iformat(b) >> iformat(c) >> 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 1d15459eff3..83c6f1d2bae 100644 --- a/Kernel_23/include/CGAL/Point_2.h +++ b/Kernel_23/include/CGAL/Point_2.h @@ -216,7 +216,7 @@ extract(std::istream& is, Point_2& p, const Cartesian_tag&) typename R::FT x, y; switch(is.iword(IO::mode)) { case IO::ASCII : - is >> x >> y; + is >> iformat(x) >> iformat(y); break; case IO::BINARY : read(is, x); diff --git a/Kernel_23/include/CGAL/Point_3.h b/Kernel_23/include/CGAL/Point_3.h index c595cd9765e..7d17190b511 100644 --- a/Kernel_23/include/CGAL/Point_3.h +++ b/Kernel_23/include/CGAL/Point_3.h @@ -246,7 +246,7 @@ extract(std::istream& is, Point_3& p, const Cartesian_tag&) typename R::FT x, y, z; switch(is.iword(IO::mode)) { case IO::ASCII : - is >> x >> y >> z; + is >> iformat(x) >> iformat(y) >> iformat(z); break; case IO::BINARY : read(is, x); diff --git a/Kernel_23/include/CGAL/Vector_2.h b/Kernel_23/include/CGAL/Vector_2.h index b0418063344..539030b7def 100644 --- a/Kernel_23/include/CGAL/Vector_2.h +++ b/Kernel_23/include/CGAL/Vector_2.h @@ -299,7 +299,7 @@ extract(std::istream& is, Vector_2& v, const Cartesian_tag&) typename R::FT x, y; switch(is.iword(IO::mode)) { case IO::ASCII : - is >> x >> y; + is >> iformat(x) >> iformat(y); break; case IO::BINARY : read(is, x); diff --git a/Kernel_23/include/CGAL/Vector_3.h b/Kernel_23/include/CGAL/Vector_3.h index bb5cd39c114..e76e0a46844 100644 --- a/Kernel_23/include/CGAL/Vector_3.h +++ b/Kernel_23/include/CGAL/Vector_3.h @@ -279,7 +279,7 @@ extract(std::istream& is, Vector_3& v, const Cartesian_tag&) typename R::FT x, y, z; switch(is.iword(IO::mode)) { case IO::ASCII : - is >> x >> y >> z; + is >> iformat(x) >> iformat(y) >> iformat(z); break; case IO::BINARY : read(is, x); 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 c966e21cea2..e7bfb4eac35 100644 --- a/Linear_cell_complex/include/CGAL/Linear_cell_complex_constructors.h +++ b/Linear_cell_complex/include/CGAL/Linear_cell_complex_constructors.h @@ -79,7 +79,7 @@ namespace CGAL { return alcc.null_handle; } - ais >> x >> y; + ais >> iformat(x) >> iformat(y); initVertices.push_back(alcc.create_vertex_attribute (typename LCC::Point(x, y))); testVertices.push_back(std::list()); diff --git a/Mesh_2/include/CGAL/IO/File_poly.h b/Mesh_2/include/CGAL/IO/File_poly.h index 3b13b63e3cf..7837260d74b 100644 --- a/Mesh_2/include/CGAL/IO/File_poly.h +++ b/Mesh_2/include/CGAL/IO/File_poly.h @@ -54,7 +54,7 @@ read_triangle_poly_file(CDT& t, std::istream &f, { unsigned int j; double x, y; - f >> j >> x >> y; + f >> j >> iformat(x) >> iformat(y); Point p(x, y); skip_until_EOL(f); skip_comment_OFF(f); vertices[--j] = t.insert(p); 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 7178f9398f4..a78483b1966 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 @@ -126,15 +126,15 @@ read_off_points_and_normals( // Reads position + normal... double x,y,z; double nx,ny,nz; - if (iss >> x >> y >> z) + if (iss >> iformat(x) >> iformat(y) >> iformat(z)) { Point point(x,y,z); Vector normal = CGAL::NULL_VECTOR; // ... + normal... - if (iss >> nx) + if (iss >> iformat(nx)) { // In case we could read one number, we expect that there are two more - if(iss >> ny >> nz){ + if(iss >> iformat(ny) >> iformat(nz)){ normal = Vector(nx,ny,nz); } else { std::cerr << "Error line " << lineNumber << " of file" << std::endl; 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 5ae301ee30b..d19ec4993f5 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 @@ -113,15 +113,15 @@ read_xyz_points_and_normals( else { iss.clear(); iss.str(line); - if (iss >> x >> y >> z) + if (iss >> iformat(x) >> iformat(y) >> iformat(z) { Point point(x,y,z); Vector normal = CGAL::NULL_VECTOR; // ... + normal... - if (iss >> nx) + if (iss >> iformat(nx)) { // In case we could read one number, we expect that there are two more - if(iss >> ny >> nz){ + if(iss >> iformat(ny) >> iformat(nz)){ normal = Vector(nx,ny,nz); } else { std::cerr << "Error line " << lineNumber << " of file" << std::endl; diff --git a/Stream_support/benchmark/Stream_support/CMakeLists.txt b/Stream_support/benchmark/Stream_support/CMakeLists.txt index 9afa6eed402..d18e998483d 100644 --- a/Stream_support/benchmark/Stream_support/CMakeLists.txt +++ b/Stream_support/benchmark/Stream_support/CMakeLists.txt @@ -58,5 +58,6 @@ include_directories( BEFORE ../../include ) include( CGAL_CreateSingleSourceCGALProgram ) create_single_source_cgal_program( "read_doubles.cpp" ) +create_single_source_cgal_program( "read_points.cpp" ) diff --git a/Stream_support/include/CGAL/IO/File_scanner_OFF.h b/Stream_support/include/CGAL/IO/File_scanner_OFF.h index 9ab83d5747c..7c5d9174f05 100644 --- a/Stream_support/include/CGAL/IO/File_scanner_OFF.h +++ b/Stream_support/include/CGAL/IO/File_scanner_OFF.h @@ -67,10 +67,10 @@ public: } } else { skip_comment(); - m_in >> x >> y >> z; + m_in >> iformat(x) >> iformat(y) >> iformat(z); if ( is_homogeneous()) { float w; - m_in >> w; + m_in >> iformat(w); x /= w; y /= w; z /= w; @@ -94,10 +94,10 @@ public: } } else { skip_comment(); - m_in >> x >> y >> z; + m_in >> iformat(x) >> iformat(y) >> iformat(z); if ( is_homogeneous()) { double w; - m_in >> w; + m_in >> iformat(w); x /= w; y /= w; z /= w; @@ -125,17 +125,17 @@ public: skip_comment(); if ( is_homogeneous()) { double fx, fy, fz, fw; - m_in >> fx >> fy >> fz >> fw; + m_in >> iformat(fx) >> iformat(fy) >> iformat(fz) >> iformat(fw); x = int( fx / fw); y = int( fy / fw); z = int( fz / fw); } else { double d; - m_in >> d; + m_in >> iformat(d); x = int(d); - m_in >> d; + m_in >> iformat(d); y = int(d); - m_in >> d; + m_in >> iformat(d); z = int(d); } } @@ -151,9 +151,9 @@ public: I_Binary_read_big_endian_float32( m_in, w); } else { skip_comment(); - m_in >> x >> y >> z; + m_in >> iformat(x) >> iformat(y) >> iformat(z); if ( is_homogeneous()) - m_in >> w; + m_in >> iformat(w); } } void scan_vertex( double& x, double& y, double& z, double& w) { @@ -172,11 +172,11 @@ public: } } else { skip_comment(); - extract(m_in, x); - extract(m_in, y); - extract(m_in, z); + m_in >> iformat(x); + m_in >> iformat(y); + m_in >> iformat(z); if ( is_homogeneous()) - extract(m_in, w); + m_in >> iformat(w); } } void scan_vertex( int& x, int& y, int& z, int& w) { @@ -196,14 +196,14 @@ public: } else { skip_comment(); double d; - m_in >> d; + m_in >> iformat(d); x = int(d); - m_in >> d; + m_in >> iformat(d); y = int(d); - m_in >> d; + m_in >> iformat(d); z = int(d); if ( is_homogeneous()) { - m_in >> d; + m_in >> iformat(d); w = int(d); } } @@ -224,10 +224,10 @@ public: z /= w; } } else { - m_in >> x >> y >> z; + m_in >> iformat(x) >> iformat(y) >> iformat(z); if ( is_homogeneous()) { float w; - m_in >> w; + m_in >> iformat(w); x /= w; y /= w; z /= w; @@ -257,12 +257,12 @@ public: } else { if ( is_homogeneous()) { float fx, fy, fz, fw; - m_in >> fx >> fy >> fz >> fw; + m_in >> iformat(fx) >> iformat(fy) >> iformat(fz) >> iformat(fw); x = fx / fw; y = fy / fw; z = fz / fw; } else - m_in >> x >> y >> z; + m_in >> iformat(x) >> iformat(y) >> iformat(z); } } } @@ -288,17 +288,17 @@ public: } else { if ( is_homogeneous()) { float fx, fy, fz, fw; - m_in >> fx >> fy >> fz >> fw; + m_in >> iformat(fx) >> iformat(fy) >> iformat(fz) >> iformat(fw); x = int( fx / fw); y = int( fy / fw); z = int( fz / fw); } else { double d; - m_in >> d; + m_in >> iformat(d); x = int(d); - m_in >> d; + m_in >> iformat(d); y = int(d); - m_in >> d; + m_in >> iformat(d); z = int(d); } } @@ -316,9 +316,9 @@ public: if ( is_homogeneous()) I_Binary_read_big_endian_float32( m_in, w); } else { - m_in >> x >> y >> z; + m_in >> iformat(x) >> iformat(y) >> iformat(z); if ( is_homogeneous()) - m_in >> w; + m_in >> iformat(w); } } } @@ -339,9 +339,9 @@ public: w = f; } } else { - m_in >> x >> y >> z; + m_in >> iformat(x) >> iformat(y) >> iformat(z); if ( is_homogeneous()) - m_in >> w; + m_in >> iformat(w); } } } @@ -363,14 +363,14 @@ public: } } else { double d; - m_in >> d; + m_in >> iformat(d); x = int(d); - m_in >> d; + m_in >> iformat(d); y = int(d); - m_in >> d; + m_in >> iformat(d); z = int(d); if ( is_homogeneous()) { - m_in >> d; + m_in >> iformat(d); w = int(d); } }