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 26addc335c9..49023179e2f 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 @@ -416,9 +416,7 @@ bool read_LAS_with_properties(std::istream& is, OutputIterator output, PropertyHandler&& ... properties) { - typedef typename value_type_traits::type OutputValueType; - - return read_LAS_with_properties(is, output, std::forward(properties)...); + return read_LAS_with_properties::type>(is, output, std::forward(properties)...); } /// \endcond @@ -625,9 +623,7 @@ CGAL_DEPRECATED bool read_las_points_with_properties(std::istream& is, OutputIterator output, PropertyHandler&& ... properties) { - typedef typename value_type_traits::type OutputValueType; - - return read_LAS_with_properties(is, output, std::forward(properties)...); + return read_LAS_with_properties::type>(is, output, std::forward(properties)...); } /// \endcond @@ -647,9 +643,7 @@ CGAL_DEPRECATED bool read_las_points(std::istream& is, using parameters::choose_parameter; using parameters::get_parameter; - typedef Point_set_processing_3::Fake_point_range PointRange; - - typedef typename CGAL::GetPointMap::type PointMap; + typedef typename CGAL::GetPointMap, CGAL_BGL_NP_CLASS>::type PointMap; PointMap point_map = choose_parameter(get_parameter(np, internal_np::point_map)); return read_LAS(is, output, make_las_point_reader(point_map)); diff --git a/Point_set_processing_3/include/CGAL/IO/read_off_points.h b/Point_set_processing_3/include/CGAL/IO/read_off_points.h index b1a9e0e9410..1d4182cf431 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 @@ -99,6 +99,7 @@ bool read_OFF(std::istream& is, typedef typename CGAL::GetPointMap::type PointMap; typedef typename Point_set_processing_3::GetNormalMap::type NormalMap; typedef typename Point_set_processing_3::GetK::Kernel Kernel; + typedef typename Kernel::FT FT; bool has_normals = !(boost::is_same::NoMap>::value); @@ -167,14 +168,15 @@ bool read_OFF(std::istream& is, double nx,ny,nz; if (iss >> iformat(x) >> iformat(y) >> iformat(z)) { - Point point(x,y,z); + FT fx(x), fy(y), fz(z); + Point point(fx, fy, fz); Vector normal = CGAL::NULL_VECTOR; // ... + normal... if (iss >> iformat(nx)) { // In case we could read one number, we expect that there are two more if(iss >> iformat(ny) >> iformat(nz)){ - normal = Vector(nx,ny,nz); + normal = Vector(FT(nx),FT(ny),FT(nz)); } else { std::cerr << "Error line " << lineNumber << " of file" << std::endl; return false; diff --git a/Polyhedron/include/CGAL/IO/Polyhedron_scan_OFF.h b/Polyhedron/include/CGAL/IO/Polyhedron_scan_OFF.h index d496284ced4..1914c177a09 100644 --- a/Polyhedron/include/CGAL/IO/Polyhedron_scan_OFF.h +++ b/Polyhedron/include/CGAL/IO/Polyhedron_scan_OFF.h @@ -124,8 +124,10 @@ void Polyhedron_scan_OFF:: operator()(HDS& target) for(std::size_t j=0; j(dx); y = static_cast(dy); @@ -148,7 +148,7 @@ public: void scan_vertex(int& x, int& y, int& z, int& w) { - double dx, dy, dz, dw; + double dx(0), dy(0), dz(0), dw(0); scan_vertex(dx, dy, dz, dw); x = static_cast(dx); y = static_cast(dy); @@ -158,7 +158,7 @@ public: void scan_vertex(double& x, double& y, double& z) { - double dx, dy, dz, dw; + double dx(0), dy(0), dz(0), dw(0); scan_vertex(dx, dy, dz, dw); x = dx / dw; y = dy / dw; @@ -167,7 +167,7 @@ public: void scan_vertex(float& x, float& y, float& z) { - double dx, dy, dz; + double dx(0), dy(0), dz(0); scan_vertex(dx, dy, dz); x = static_cast(dx); y = static_cast(dy); @@ -176,7 +176,7 @@ public: void scan_vertex(int& x, int& y, int& z) { - double dx, dy, dz; + double dx(0), dy(0), dz(0); scan_vertex(dx, dy, dz); x = static_cast(dx); y = static_cast(dy); @@ -322,7 +322,7 @@ public: void scan_normal(float& x, float& y, float& z, float& w) { - double dx, dy, dz, dw; + double dx(0), dy(0), dz(0), dw(0); scan_normal(dx, dy, dz, dw); x = static_cast(dx); y = static_cast(dy); @@ -332,7 +332,7 @@ public: void scan_normal(int& x, int& y, int& z, int& w) { - double dx, dy, dz, dw; + double dx(0), dy(0), dz(0), dw(0); scan_normal(dx, dy, dz, dw); x = static_cast(dx); y = static_cast(dy); @@ -342,7 +342,7 @@ public: void scan_normal(double& x, double& y, double& z) { - double dx, dy, dz, dw; + double dx(0), dy(0), dz(0), dw(0); scan_normal(dx, dy, dz, dw); x = dx / dw; y = dy / dw; @@ -351,7 +351,7 @@ public: void scan_normal(float& x, float& y, float& z) { - double dx, dy, dz; + double dx(0), dy(0), dz(0); scan_normal(dx, dy, dz); x = static_cast(dx); y = static_cast(dy); @@ -360,7 +360,7 @@ public: void scan_normal(int& x, int& y, int& z) { - double dx, dy, dz; + double dx(0), dy(0), dz(0); scan_normal(dx, dy, dz); x = static_cast(dx); y = static_cast(dy); @@ -853,7 +853,7 @@ Point& file_scan_vertex(File_scanner_OFF& scanner, Point& p) { typedef typename Point::R R; typedef typename R::RT RT; - double x, y, z, w; + double x(0), y(0), z(0), w(0); scanner.scan_vertex(x, y, z, w); @@ -882,7 +882,7 @@ file_scan_normal(File_scanner_OFF& scanner, Vector& v) typedef typename Vector::R R; typedef typename R::RT RT; - double x, y, z, w; + double x(0), y(0), z(0), w(0); scanner.scan_normal(x, y, z, w); if(w == 1) v = Vector(RT(x), RT(y), RT(z)); diff --git a/Stream_support/include/CGAL/IO/helpers.h b/Stream_support/include/CGAL/IO/helpers.h index f261337bacd..ead5a86c456 100644 --- a/Stream_support/include/CGAL/IO/helpers.h +++ b/Stream_support/include/CGAL/IO/helpers.h @@ -30,7 +30,8 @@ namespace internal { template void fill_point(const double x, const double y, const double z, const double w, CGAL::Point_3& pt) { - pt = CGAL::Point_3(x, y, z, w); + typedef typename Kernel::FT FT; + pt = CGAL::Point_3(FT(x/w), FT(y/w), FT(z/w)); } template