diff --git a/Point_set_3/include/CGAL/Point_set_3/point_set_io.h b/Point_set_3/include/CGAL/Point_set_3/point_set_io.h index 0d3379fc0e6..3363b62402c 100644 --- a/Point_set_3/include/CGAL/Point_set_3/point_set_io.h +++ b/Point_set_3/include/CGAL/Point_set_3/point_set_io.h @@ -17,31 +17,61 @@ namespace CGAL { + template + typename Vector, + typename NamedParameters> bool read_point_set(const std::string& fname, - CGAL::Point_set_3& ps) + CGAL::Point_set_3& ps, + const NamedParameters& np) { if (fname.find(".xyz") != std::string::npos) { - return read_XYZ(fname, ps); + return read_XYZ(fname, ps, np); } if (fname.find(".off") != std::string::npos) { - return read_OFF(fname, ps); + return read_OFF(fname, ps, np); } if (fname.find(".ply") != std::string::npos) { - return read_PLY(fname, ps); + return read_PLY(fname, ps, np); } #ifdef CGAL_LINKED_WITH_LASLIB if (fname.find(".las") != std::string::npos) { - return read_LAS(fname, ps); + return read_LAS(fname, ps, np); } #endif return false; } +template +bool read_point_set(const std::string& fname, + CGAL::Point_set_3& ps) +{ + return read_point_set(fname, ps, parameters::all_default()); +} + +template +bool read_point_set(const char* fname, + CGAL::Point_set_3& ps, + const NamedParameters& np) +{ + return read_point_set(std::string(fname), + ps, + np); +} + +template +bool read_point_set(const char* fname, + CGAL::Point_set_3& ps) +{ + return read_point_set(fname, ps, parameters::all_default()); +} template 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 767f1ead43a..30b1d640192 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 @@ -470,7 +470,24 @@ bool read_LAS(std::istream& stream, } /// \cond SKIP_IN_MANUAL -// variant with default NP +template < typename OutputIterator, + #ifdef DOXYGEN_RUNNING + typename NamedParameters + #else + typename CGAL_BGL_NP_TEMPLATE_PARAMETERS + #endif + > +bool read_LAS(std::istream& stream, + OutputIterator output, + #ifdef DOXYGEN_RUNNING + const NamedParameters& np) +#else + const CGAL_BGL_NP_CLASS& np) +#endif +{ + return read_LAS_with_properties(stream, output, np); +} +// variants with default NP template bool @@ -482,7 +499,23 @@ read_LAS( (stream, output, CGAL::parameters::all_default()); } -// variant with default output iterator value type +template < typename OutputIteratorValueType, + typename OutputIterator> +bool read_LAS(const std::string& fname, + OutputIterator output) +{ + return read_LAS(fname, output, parameters::all_default()); +} + +template < typename OutputIteratorValueType, + typename OutputIterator> +bool read_LAS(const char* fname, + OutputIterator output) +{ + return read_LAS(fname, output, parameters::all_default()); +} + +// variants with default output iterator value type template bool @@ -495,20 +528,119 @@ read_LAS( (stream, output, np); } -// variant with default NP and output iterator value type +template +bool read_LAS(const char* fname, + OutputIterator output, + const CGAL_BGL_NP_CLASS& np) +{ + std::ifstream is(fname); + return read_LAS::type>(is, output, np); +} + +template +bool read_LAS(const std::string& fname, + OutputIterator output, + const CGAL_BGL_NP_CLASS& np) +{ + return read_LAS::type>(fname.c_str(), output, np); +} + +// variants with default NP and output iterator value type template bool read_LAS( std::istream& stream, ///< input stream. - OutputIterator output, - typename boost::enable_if< - typename CGAL::is_iterator - >::type* =0) + OutputIterator output) { return read_LAS::type> (stream, output, CGAL::parameters::all_default()); } +template < typename OutputIterator> +bool read_LAS(const std::string& fname, + OutputIterator output) +{ + return read_LAS::type>(fname, output, parameters::all_default()); +} + +template +bool read_LAS(const char* fname, + OutputIterator output) +{ + return read_LAS::type>(fname, output, parameters::all_default()); +} + + +/** + \ingroup PkgPointSetProcessing3IOLas + Reads points (position only) from a .las or .laz file. + Potential additional properties are ignored. + + \tparam OutputIteratorValueType type of objects that can be put in `OutputIterator`. + It is default to `value_type_traits::%type` and can be omitted when the default is fine. + \tparam OutputIterator iterator over output points. + + \param stream input stream. + \param output output iterator over points. + + \param np optional sequence of \ref psp_namedparameters "Named Parameters" among the ones listed below. + + \cgalNamedParamsBegin + \cgalParamBegin{point_map} a model of `WritablePropertyMap` with value type `geom_traits::Point_3`. + If this parameter is omitted, `CGAL::Identity_property_map` is used.\cgalParamEnd + \cgalParamBegin{geom_traits} an instance of a geometric traits class, model of `Kernel`\cgalParamEnd + \cgalNamedParamsEnd + + \return true on success. + + \cgalRequiresCPP11 +*/ +template < typename OutputIteratorValueType, + typename OutputIterator, + #ifdef DOXYGEN_RUNNING + typename NamedParameters + #else + typename CGAL_BGL_NP_TEMPLATE_PARAMETERS + #endif + > +bool read_LAS(const char* fname, + OutputIterator output, + #ifdef DOXYGEN_RUNNING + const NamedParameters& np) +#else + const CGAL_BGL_NP_CLASS& np) +#endif +{ + std::ifstream is(fname); + return read_LAS(is, output, np); +} + +template < typename OutputIteratorValueType, + typename OutputIterator> +bool read_LAS(const char* fname, + OutputIterator output) +{ + return read_LAS(fname, output, parameters::all_default()); +} + +template < typename OutputIteratorValueType, + typename OutputIterator, + typename CGAL_BGL_NP_TEMPLATE_PARAMETERS> +bool read_LAS(const std::string& fname, + OutputIterator output, + const CGAL_BGL_NP_CLASS& np) +{ + return read_LAS(fname.c_str(), output, np); +} + +template < typename OutputIteratorValueType, + typename OutputIterator> +bool read_LAS(const std::string& fname, + OutputIterator output) +{ + return read_LAS(fname, output, parameters::all_default()); +} + #ifndef CGAL_NO_DEPRECATED_CODE // deprecated API template < typename OutputIteratorValueType, 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 7f94bd0c25a..317faf6c726 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 @@ -185,47 +185,147 @@ read_OFF( return true; } + +/** + \ingroup PkgPointSetProcessing3IO + Reads points (positions + normals, if available) from a .off ASCII file. + The function expects for each point a line with the x y z position, + optionally followed by the nx ny nz normal. + Faces are ignored. + + \tparam OutputIteratorValueType type of objects that can be put in `OutputIterator`. + It is default to `value_type_traits::%type` and can be omitted when the default is fine. + \tparam OutputIterator iterator over output points. + + \param stream input stream. + \param output output iterator over points. + \param np optional sequence of \ref psp_namedparameters "Named Parameters" among the ones listed below. + + \cgalNamedParamsBegin + \cgalParamBegin{point_map} a model of `WritablePropertyMap` with value type `geom_traits::Point_3`. + If this parameter is omitted, `CGAL::Identity_property_map` is used.\cgalParamEnd + \cgalParamBegin{normal_map} a model of `ReadWritePropertyMap` with value type + `geom_traits::Vector_3`. If this parameter is omitted, normals in the input stream are + ignored.\cgalParamEnd + \cgalParamBegin{geom_traits} an instance of a geometric traits class, model of `Kernel`\cgalParamEnd + \cgalNamedParamsEnd + + \return true on success. +*/ +template < typename OutputIteratorValueType, + typename OutputIterator, + #ifdef DOXYGEN_RUNNING + typename NamedParameters + #else + typename CGAL_BGL_NP_TEMPLATE_PARAMETERS + #endif + > +bool read_OFF(const char* fname, + OutputIterator output, + #ifdef DOXYGEN_RUNNING + const NamedParameters& np) +#else + const CGAL_BGL_NP_CLASS& np) +#endif +{ + std::ifstream is(fname); + return read_OFF(is, output, np); +} + +template < typename OutputIteratorValueType, + typename OutputIterator, + typename CGAL_BGL_NP_TEMPLATE_PARAMETERS> +bool read_OFF(const std::string& fname, + OutputIterator output, + const CGAL_BGL_NP_CLASS& np) +{ + return read_OFF(fname.c_str(), output, np); +} + + + /// \cond SKIP_IN_MANUAL -// variant with default NP +// variants with default NP template bool read_OFF( - std::istream& stream, ///< input stream. - OutputIterator output) ///< output iterator over points. + std::istream& stream, ///< input stream. + OutputIterator output) ///< output iterator over points. { return read_OFF - (stream, output, CGAL::parameters::all_default()); + (stream, output, CGAL::parameters::all_default()); } -// variant with default output iterator value type +template < typename OutputIteratorValueType, + typename OutputIterator> +bool read_OFF(const std::string& fname, + OutputIterator output) +{ + return read_OFF(fname, output, parameters::all_default()); +} + +template < typename OutputIteratorValueType, + typename OutputIterator> +bool read_OFF(const char* fname, + OutputIterator output) +{ + return read_OFF(fname, output, parameters::all_default()); +} + +// variants with default output iterator value type template bool read_OFF( - std::istream& stream, ///< input stream. - OutputIterator output, - const CGAL_BGL_NP_CLASS& np, - typename boost::enable_if< - CGAL::is_iterator - >::type* =0) + std::istream& stream, ///< input stream. + OutputIterator output, + const CGAL_BGL_NP_CLASS& np) { return read_OFF::type> - (stream, output, np); + (stream, output, np); } -// variant with default NP and output iterator value type +template +bool read_OFF(const char* fname, + OutputIterator output, + const CGAL_BGL_NP_CLASS& np) +{ + std::ifstream is(fname); + return read_OFF::type>(is, output, np); +} + +template +bool read_OFF(const std::string& fname, + OutputIterator output, + const CGAL_BGL_NP_CLASS& np) +{ + return read_OFF::type>(fname.c_str(), output, np); +} + +// variants with default NP and output iterator value type template bool read_OFF( std::istream& stream, ///< input stream. - OutputIterator output, - typename std::enable_if< - CGAL::is_iterator::value - >::type* =0) + OutputIterator output) { return read_OFF::type> - (stream, output, CGAL::parameters::all_default()); + (stream, output, CGAL::parameters::all_default()); +} + +template < typename OutputIterator> +bool read_OFF(const std::string& fname, + OutputIterator output) +{ + return read_OFF::type>(fname, output, parameters::all_default()); +} + +template +bool read_OFF(const char* fname, + OutputIterator output) +{ + return read_OFF::type>(fname, output, parameters::all_default()); } #ifndef CGAL_NO_DEPRECATED_CODE 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 9e2af3ff171..bae313af0cc 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 @@ -140,7 +140,7 @@ bool read_PLY_with_properties (std::istream& stream, return false; } - IO::internal::PLY_reader reader; + IO::internal::PLY_reader reader(true); if (!(reader.init (stream))) { @@ -256,9 +256,65 @@ bool read_PLY(std::istream& stream, make_ply_point_reader (point_map)); } +/** + \ingroup PkgPointSetProcessing3IOPly + Reads points (positions + normals, if available) from a .ply + file (ASCII or binary). + Potential additional point properties and faces are ignored. + + \tparam OutputIteratorValueType type of objects that can be put in `OutputIterator`. + It is default to `value_type_traits::%type` and can be omitted when the default is fine. + \tparam OutputIterator iterator over output points. + + \param stream input stream. + \param output output iterator over points. + \param np optional sequence of \ref psp_namedparameters "Named Parameters" among the ones listed below. + + \cgalNamedParamsBegin + \cgalParamBegin{point_map} a model of `WritablePropertyMap` with value type `geom_traits::Point_3`. + If this parameter is omitted, `CGAL::Identity_property_map` is used.\cgalParamEnd + \cgalParamBegin{normal_map} a model of `ReadWritePropertyMap` with value type + `geom_traits::Vector_3`. If this parameter is omitted, normals in the input stream are + ignored.\cgalParamEnd + \cgalParamBegin{geom_traits} an instance of a geometric traits class, model of `Kernel`\cgalParamEnd + \cgalNamedParamsEnd + + \return true on success. + + \cgalRequiresCPP11 +*/ +template < typename OutputIteratorValueType, + typename OutputIterator, + #ifdef DOXYGEN_RUNNING + typename NamedParameters + #else + typename CGAL_BGL_NP_TEMPLATE_PARAMETERS + #endif + > +bool read_PLY(const char* fname, + OutputIterator output, + #ifdef DOXYGEN_RUNNING + const NamedParameters& np) +#else + const CGAL_BGL_NP_CLASS& np) +#endif +{ + std::ifstream is(fname); + return read_PLY(is, output, np); +} + +template < typename OutputIteratorValueType, + typename OutputIterator, + typename CGAL_BGL_NP_TEMPLATE_PARAMETERS> +bool read_PLY(const std::string& fname, + OutputIterator output, + const CGAL_BGL_NP_CLASS& np) +{ + return read_PLY(fname.c_str(), output, np); +} /// \cond SKIP_IN_MANUAL -// variant with default NP +// variants with default NP template bool @@ -270,7 +326,23 @@ read_PLY( (stream, output, CGAL::parameters::all_default()); } -// variant with default output iterator value type +template < typename OutputIteratorValueType, + typename OutputIterator> +bool read_PLY(const std::string& fname, + OutputIterator output) +{ + return read_PLY(fname, output, parameters::all_default()); +} + +template < typename OutputIteratorValueType, + typename OutputIterator> +bool read_PLY(const char* fname, + OutputIterator output) +{ + return read_PLY(fname, output, parameters::all_default()); +} + +// variants with default output iterator value type template bool @@ -283,7 +355,24 @@ read_PLY( (stream, output, np); } -// variant with default NP and output iterator value type +template +bool read_PLY(const char* fname, + OutputIterator output, + const CGAL_BGL_NP_CLASS& np) +{ + std::ifstream is(fname); + return read_PLY::type>(is, output, np); +} + +template +bool read_PLY(const std::string& fname, + OutputIterator output, + const CGAL_BGL_NP_CLASS& np) +{ + return read_PLY::type>(fname.c_str(), output, np); +} + +// variants with default NP and output iterator value type template bool read_PLY( @@ -294,6 +383,20 @@ read_PLY( (stream, output, CGAL::parameters::all_default()); } +template < typename OutputIterator> +bool read_PLY(const std::string& fname, + OutputIterator output) +{ + return read_PLY::type>(fname, output, parameters::all_default()); +} + +template +bool read_PLY(const char* fname, + OutputIterator output) +{ + return read_PLY::type>(fname, output, parameters::all_default()); +} + #ifndef CGAL_NO_DEPRECATED_CODE // deprecated API template < typename OutputIteratorValueType, diff --git a/Point_set_processing_3/include/CGAL/IO/read_points.h b/Point_set_processing_3/include/CGAL/IO/read_points.h new file mode 100644 index 00000000000..a13c1d1c65b --- /dev/null +++ b/Point_set_processing_3/include/CGAL/IO/read_points.h @@ -0,0 +1,115 @@ +// Copyright (c) 2020 Geometry Factory +// 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 +#ifndef CGAL_READ_POINTS_H +#define CGAL_READ_POINTS_H + +#ifdef CGAL_LINKED_WITH_LASLIB +#include +#endif +#include +#include +#include + +namespace CGAL { + +template +bool read_points(const std::string& fname, + OutputIterator output, + const NamedParameters& np) +{ + if (fname.find(".xyz") != std::string::npos) { + return read_XYZ(fname, output, np); + } + + if (fname.find(".off") != std::string::npos) { + return read_OFF(fname, output, np); + } + + if (fname.find(".ply") != std::string::npos) { + return read_PLY(fname, output, np); + } + +#ifdef CGAL_LINKED_WITH_LASLIB + if (fname.find(".las") != std::string::npos) { + return read_LASfname, output, np); + } +#endif + return false; +} + +//variant with default OutputIteratorType +template +bool read_points(const std::string& fname, + OutputIterator output, + const NamedParameters& np) +{ + return read_points::type>(fname, output, np); +} + +//variant with default np +template +bool read_points(const std::string& fname, + OutputIterator output) +{ + return read_points(fname, output, parameters::all_default()); +} + +//variant with all default +template +bool read_points(const std::string& fname, + OutputIterator output) +{ + return read_points::type>(fname, output, parameters::all_default()); +} + + +//variants with char* + +template +bool read_points(const char* fname, + OutputIterator output, + const NamedParameters& np) +{ + return read_points(std::string(fname), output, np); +} + +template +bool read_points(const char* fname, + OutputIterator output, + const NamedParameters& np) +{ + return read_points::type>(fname, output, np); +} + +template +bool read_points(const char* fname, + OutputIterator output) +{ + return read_points(fname, output, parameters::all_default()); +} + +template +bool read_points(const char* fname, + OutputIterator output) +{ + return read_points::type>(fname, output, parameters::all_default()); +} +}//end CGAL + +#endif // CGAL_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 ed627dc1c02..86088d934ee 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 @@ -174,44 +174,145 @@ read_XYZ( return true; } +/** + \ingroup PkgPointSetProcessing3IO + Reads points (positions + normals, if available) from a .xyz ASCII file. + The function expects for each point a line with the x y z position, + optionally followed by the nx ny nz normal. + The first line may contain the number of points in the file. + Empty lines and comments starting by # character are allowed. + + \tparam OutputIteratorValueType type of objects that can be put in `OutputIterator`. + It is default to `value_type_traits::%type` and can be omitted when the default is fine. + \tparam OutputIterator iterator over output points. + + \param stream input stream. + \param output output iterator over points. + \param np optional sequence of \ref psp_namedparameters "Named Parameters" among the ones listed below. + + \cgalNamedParamsBegin + \cgalParamBegin{point_map} a model of `WritablePropertyMap` with value type `geom_traits::Point_3`. + If this parameter is omitted, `CGAL::Identity_property_map` is used.\cgalParamEnd + \cgalParamBegin{normal_map} a model of `ReadWritePropertyMap` with value type + `geom_traits::Vector_3`. If this parameter is omitted, normals in the input stream are + ignored.\cgalParamEnd + \cgalParamBegin{geom_traits} an instance of a geometric traits class, model of `Kernel`\cgalParamEnd + \cgalNamedParamsEnd + + \return true on success. +*/ +template < typename OutputIteratorValueType, + typename OutputIterator, + #ifdef DOXYGEN_RUNNING + typename NamedParameters + #else + typename CGAL_BGL_NP_TEMPLATE_PARAMETERS + #endif + > +bool read_XYZ(const char* fname, + OutputIterator output, + #ifdef DOXYGEN_RUNNING + const NamedParameters& np) +#else + const CGAL_BGL_NP_CLASS& np) +#endif +{ + std::ifstream is(fname); + return read_XYZ(is, output, np); +} + /// \cond SKIP_IN_MANUAL -// variant with default NP +template < typename OutputIteratorValueType, + typename OutputIterator, + typename CGAL_BGL_NP_TEMPLATE_PARAMETERS + > +bool read_XYZ(const std::string& fname, + OutputIterator output, + const CGAL_BGL_NP_CLASS& np) +{ + return read_XYZ(fname.c_str(), output, np); +} +// variants with default NP template bool read_XYZ( - std::istream& stream, ///< input stream. - OutputIterator output) ///< output iterator over points. + std::istream& stream, ///< input stream. + OutputIterator output) ///< output iterator over points. { return read_XYZ - (stream, output, CGAL::parameters::all_default()); + (stream, output, CGAL::parameters::all_default()); } -// variant with default output iterator value type +template < typename OutputIteratorValueType, + typename OutputIterator> +bool read_XYZ(const std::string& fname, + OutputIterator output) +{ + return read_XYZ(fname, output, parameters::all_default()); +} + +template < typename OutputIteratorValueType, + typename OutputIterator> +bool read_XYZ(const char* fname, + OutputIterator output) +{ + return read_XYZ(fname, output, parameters::all_default()); +} + +// variants with default output iterator value type template bool read_XYZ( - std::istream& stream, ///< input stream. - OutputIterator output, - const CGAL_BGL_NP_CLASS& np) + std::istream& stream, ///< input stream. + OutputIterator output, + const CGAL_BGL_NP_CLASS& np) { return read_XYZ::type> - (stream, output, np); + (stream, output, np); } -// variant with default NP and output iterator value type +template +bool read_XYZ(const char* fname, + OutputIterator output, + const CGAL_BGL_NP_CLASS& np) +{ + std::ifstream is(fname); + return read_XYZ::type>(is, output, np); +} + +template +bool read_XYZ(const std::string& fname, + OutputIterator output, + const CGAL_BGL_NP_CLASS& np) +{ + return read_XYZ::type>(fname.c_str(), output, np); +} + +// variants with default NP and output iterator value type template bool read_XYZ( - std::istream& stream, ///< input stream. - OutputIterator output, - typename boost::enable_if< - CGAL::is_iterator - >::type* =0) + std::istream& stream, ///< input stream. + OutputIterator output) { return read_XYZ::type> - (stream, output, CGAL::parameters::all_default()); + (stream, output, CGAL::parameters::all_default()); +} + +template < typename OutputIterator> +bool read_XYZ(const std::string& fname, + OutputIterator output) +{ + return read_XYZ::type>(fname, output, parameters::all_default()); +} + +template +bool read_XYZ(const char* fname, + OutputIterator output) +{ + return read_XYZ::type>(fname, output, parameters::all_default()); } #ifndef CGAL_NO_DEPRECATED_CODE diff --git a/Point_set_processing_3/test/Point_set_processing_3/data/read_test/pig_points.las b/Point_set_processing_3/test/Point_set_processing_3/data/read_test/pig_points.las new file mode 100644 index 00000000000..07904d3c5c1 Binary files /dev/null and b/Point_set_processing_3/test/Point_set_processing_3/data/read_test/pig_points.las differ 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 de346c56ef1..ffab5efefc2 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 @@ -3,9 +3,11 @@ #include #include #include +#include #include -#include +#include +#include #include #include @@ -62,6 +64,15 @@ bool read_ply (std::string s, normal_map(CGAL::Second_of_pair_property_map())); } +bool read_ps(std::string s) +{ + std::vector pv_pairs; + return 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())); +} + int main() { std::cerr << "### There should be three errors following this line...\n"; @@ -110,5 +121,12 @@ int main() assert(pv_pairs[1] == std::make_pair(Point_3(3,3,3), Vector_3(4,4,4))); assert(pv_pairs[2] == std::make_pair(Point_3(5,5,5), Vector_3(6,6,6))); + assert(read_ps("data/read_test/ok_1.xyz")); + assert(read_ps("data/read_test/ok_1.off")); + assert(read_ps("data/read_test/simple.ply")); + #ifdef CGAL_LINKED_WITH_LASLIB + assert(read_ps("data/read_test/pig_points.las")); +#endif + return 0; } diff --git a/Stream_support/include/CGAL/IO/PLY.h b/Stream_support/include/CGAL/IO/PLY.h index 68c3315c0ba..69ad33210b7 100644 --- a/Stream_support/include/CGAL/IO/PLY.h +++ b/Stream_support/include/CGAL/IO/PLY.h @@ -381,7 +381,13 @@ bool read_PLY(const char* fname, template bool read_PLY(const char* fname, PointRange& points, - PolygonRange& polygons) + PolygonRange& polygons + #ifndef DOXYGEN_RUNNING + ,typename std::enable_if< + CGAL::is_iterator::value + >::type* =0 + #endif + ) { return read_PLY(fname, points, polygons, parameters::all_default()); } @@ -399,7 +405,13 @@ bool read_PLY(const std::string& fname, template bool read_PLY(const std::string fname, PointRange& points, - PolygonRange& polygons) + PolygonRange& polygons + #ifndef DOXYGEN_RUNNING + ,typename std::enable_if< + CGAL::is_iterator::value + >::type* =0 + #endif + ) { return read_PLY(fname, points, polygons, parameters::all_default()); }