From 6d011a62ae6179e3d9b4dfb75634856063299207 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 23 Oct 2025 08:52:04 +0100 Subject: [PATCH 01/25] Point_set: move IO code to Stream_support --- Point_set_3/include/CGAL/Point_set_3/IO/LAS.h | 4 ++-- Point_set_3/include/CGAL/Point_set_3/IO/OFF.h | 4 ++-- Point_set_3/include/CGAL/Point_set_3/IO/XYZ.h | 4 ++-- .../test/Point_set_3/point_set_test_join.cpp | 1 - .../include/CGAL/IO/read_points.h | 8 ++++---- .../include/CGAL/IO/write_points.h | 8 ++++---- .../include/CGAL/IO/LAS}/read_las_points.h | 15 ++++++-------- .../include/CGAL/IO/LAS}/write_las_points.h | 9 +++------ .../include/CGAL/IO/OFF}/read_off_points.h | 19 ++++++++++-------- .../include/CGAL/IO/OFF}/write_off_points.h | 20 ++++++++++--------- .../include/CGAL/IO/PLY}/read_ply_points.h | 14 ++++++------- .../include/CGAL/IO/PLY}/write_ply_points.h | 20 ++++++++++--------- .../include/CGAL/IO/XYZ}/read_xyz_points.h | 20 ++++++++++--------- .../include/CGAL/IO/XYZ}/write_xyz_points.h | 14 +++++++------ 14 files changed, 81 insertions(+), 79 deletions(-) rename {Point_set_processing_3/include/CGAL/IO => Stream_support/include/CGAL/IO/LAS}/read_las_points.h (98%) rename {Point_set_processing_3/include/CGAL/IO => Stream_support/include/CGAL/IO/LAS}/write_las_points.h (98%) rename {Point_set_processing_3/include/CGAL/IO => Stream_support/include/CGAL/IO/OFF}/read_off_points.h (95%) rename {Point_set_processing_3/include/CGAL/IO => Stream_support/include/CGAL/IO/OFF}/write_off_points.h (93%) rename {Point_set_processing_3/include/CGAL/IO => Stream_support/include/CGAL/IO/PLY}/read_ply_points.h (97%) rename {Point_set_processing_3/include/CGAL/IO => Stream_support/include/CGAL/IO/PLY}/write_ply_points.h (95%) rename {Point_set_processing_3/include/CGAL/IO => Stream_support/include/CGAL/IO/XYZ}/read_xyz_points.h (94%) rename {Point_set_processing_3/include/CGAL/IO => Stream_support/include/CGAL/IO/XYZ}/write_xyz_points.h (94%) 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 aa2de169bf2..896e1a8aadf 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 @@ -14,8 +14,8 @@ #include #ifdef CGAL_LINKED_WITH_LASLIB -#include -#include +#include +#include #endif // LAS #include 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 e364ca3b9a7..5da17d39a29 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 @@ -16,8 +16,8 @@ #include #include #include -#include -#include +#include +#include #include #include 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 965d11ff960..7d80a60b15a 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 @@ -15,8 +15,8 @@ #include #include -#include -#include +#include +#include #include #include diff --git a/Point_set_3/test/Point_set_3/point_set_test_join.cpp b/Point_set_3/test/Point_set_3/point_set_test_join.cpp index bcd39c531bb..d2f5c703376 100644 --- a/Point_set_3/test/Point_set_3/point_set_test_join.cpp +++ b/Point_set_3/test/Point_set_3/point_set_test_join.cpp @@ -1,7 +1,6 @@ #include #include -#include #include #include 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 b9ca990d21a..dca5c575483 100644 --- a/Point_set_processing_3/include/CGAL/IO/read_points.h +++ b/Point_set_processing_3/include/CGAL/IO/read_points.h @@ -15,12 +15,12 @@ #include #include -#include -#include -#include +#include +#include +#include #ifdef CGAL_LINKED_WITH_LASLIB -#include +#include #endif #include 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 1cdec284475..a9981ee9d98 100644 --- a/Point_set_processing_3/include/CGAL/IO/write_points.h +++ b/Point_set_processing_3/include/CGAL/IO/write_points.h @@ -16,11 +16,11 @@ #include -#include -#include -#include +#include +#include +#include #ifdef CGAL_LINKED_WITH_LASLIB -#include +#include #endif #include diff --git a/Point_set_processing_3/include/CGAL/IO/read_las_points.h b/Stream_support/include/CGAL/IO/LAS/read_las_points.h similarity index 98% rename from Point_set_processing_3/include/CGAL/IO/read_las_points.h rename to Stream_support/include/CGAL/IO/LAS/read_las_points.h index 258a580160c..291a479933e 100644 --- a/Point_set_processing_3/include/CGAL/IO/read_las_points.h +++ b/Stream_support/include/CGAL/IO/LAS/read_las_points.h @@ -1,18 +1,15 @@ -// Copyright (c) 2017 Geometry Factory -// All rights reserved. +// Copyright (c) 2017 GeometryFactory // -// This file is part of CGAL (www.cgal.org). +// This file is part of CGAL (www.cgal.org); // // $URL$ // $Id$ -// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Simon Giraudot -#ifndef CGAL_POINT_SET_PROCESSING_READ_LAS_POINTS_H -#define CGAL_POINT_SET_PROCESSING_READ_LAS_POINTS_H - -#include +#ifndef CGAL_IO_LAS_READ_LAS_POINTS_H +#define CGAL_IO_LAS_READ_LAS_POINTS_H #include @@ -549,4 +546,4 @@ bool read_LAS(const std::string& fname, OutputIterator output, const CGAL_NP_CLA } // namespace CGAL -#endif // CGAL_POINT_SET_PROCESSING_READ_LAS_POINTS_H +#endif // CGAL_IO_LAS_READ_LAS_POINTS_H diff --git a/Point_set_processing_3/include/CGAL/IO/write_las_points.h b/Stream_support/include/CGAL/IO/LAS/write_las_points.h similarity index 98% rename from Point_set_processing_3/include/CGAL/IO/write_las_points.h rename to Stream_support/include/CGAL/IO/LAS/write_las_points.h index 1d9408a0b88..9c89be56b1a 100644 --- a/Point_set_processing_3/include/CGAL/IO/write_las_points.h +++ b/Stream_support/include/CGAL/IO/LAS/write_las_points.h @@ -1,19 +1,16 @@ -// Copyright (c) 2017 Geometry Factory -// All rights reserved. +// Copyright (c) 2017 GeometryFactory // -// This file is part of CGAL (www.cgal.org). +// This file is part of CGAL (www.cgal.org); // // $URL$ // $Id$ -// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Simon Giraudot #ifndef CGAL_POINT_SET_PROCESSING_WRITE_LAS_POINTS_H #define CGAL_POINT_SET_PROCESSING_WRITE_LAS_POINTS_H -#include - #include #include diff --git a/Point_set_processing_3/include/CGAL/IO/read_off_points.h b/Stream_support/include/CGAL/IO/OFF/read_off_points.h similarity index 95% rename from Point_set_processing_3/include/CGAL/IO/read_off_points.h rename to Stream_support/include/CGAL/IO/OFF/read_off_points.h index cd752f463c7..1fa73a51588 100644 --- a/Point_set_processing_3/include/CGAL/IO/read_off_points.h +++ b/Stream_support/include/CGAL/IO/OFF/read_off_points.h @@ -1,18 +1,21 @@ -// Copyright (c) 2007-09 INRIA Sophia-Antipolis (France). -// All rights reserved. +// Copyright (c) 1997 +// Utrecht University (The Netherlands), +// ETH Zurich (Switzerland), +// INRIA Sophia-Antipolis (France), +// Max-Planck-Institute Saarbruecken (Germany), +// and Tel-Aviv University (Israel). All rights reserved. // -// This file is part of CGAL (www.cgal.org). +// This file is part of CGAL (www.cgal.org); // // $URL$ // $Id$ -// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Pierre Alliez and Laurent Saboret -#ifndef CGAL_POINT_SET_PROCESSING_READ_OFF_POINTS_H -#define CGAL_POINT_SET_PROCESSING_READ_OFF_POINTS_H +#ifndef CGAL_IO_OFF_READ_OFF_POINTS_H +#define CGAL_IO_OFF_READ_OFF_POINTS_H -#include #include #include @@ -273,4 +276,4 @@ bool read_OFF(const std::string& fname, OutputIterator output, const CGAL_NP_CLA } // namespace CGAL -#endif // CGAL_POINT_SET_PROCESSING_READ_OFF_POINTS_H +#endif // CGAL_IO_OFF_READ_OFF_POINTS_H diff --git a/Point_set_processing_3/include/CGAL/IO/write_off_points.h b/Stream_support/include/CGAL/IO/OFF/write_off_points.h similarity index 93% rename from Point_set_processing_3/include/CGAL/IO/write_off_points.h rename to Stream_support/include/CGAL/IO/OFF/write_off_points.h index 0ef9d0bbcc7..7e2d7ddd8fc 100644 --- a/Point_set_processing_3/include/CGAL/IO/write_off_points.h +++ b/Stream_support/include/CGAL/IO/OFF/write_off_points.h @@ -1,18 +1,20 @@ -// Copyright (c) 2007-09 INRIA Sophia-Antipolis (France). -// All rights reserved. +// Copyright (c) 1997 +// Utrecht University (The Netherlands), +// ETH Zurich (Switzerland), +// INRIA Sophia-Antipolis (France), +// Max-Planck-Institute Saarbruecken (Germany), +// and Tel-Aviv University (Israel). All rights reserved. // -// This file is part of CGAL (www.cgal.org). +// This file is part of CGAL (www.cgal.org); // // $URL$ // $Id$ -// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Pierre Alliez and Laurent Saboret -#ifndef CGAL_POINT_SET_PROCESSING_WRITE_OFF_POINTS_H -#define CGAL_POINT_SET_PROCESSING_WRITE_OFF_POINTS_H - -#include +#ifndef CGAL_IO_PLY_WRITE_OFF_POINTS_H +#define CGAL_IO_PLY_WRITE_OFF_POINTS_H #include #include @@ -200,4 +202,4 @@ bool write_OFF(const std::string& filename, } // namespace CGAL -#endif // CGAL_POINT_SET_PROCESSING_WRITE_OFF_POINTS_H +#endif // CGAL_IO_PLY_WRITE_OFF_POINTS_H diff --git a/Point_set_processing_3/include/CGAL/IO/read_ply_points.h b/Stream_support/include/CGAL/IO/PLY/read_ply_points.h similarity index 97% rename from Point_set_processing_3/include/CGAL/IO/read_ply_points.h rename to Stream_support/include/CGAL/IO/PLY/read_ply_points.h index 69775af74d0..5f204a50400 100644 --- a/Point_set_processing_3/include/CGAL/IO/read_ply_points.h +++ b/Stream_support/include/CGAL/IO/PLY/read_ply_points.h @@ -1,18 +1,16 @@ -// Copyright (c) 2015 Geometry Factory -// All rights reserved. +// Copyright (c) 2017 GeometryFactory // -// This file is part of CGAL (www.cgal.org). +// This file is part of CGAL (www.cgal.org); // // $URL$ // $Id$ -// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Simon Giraudot -#ifndef CGAL_POINT_SET_PROCESSING_READ_PLY_POINTS_H -#define CGAL_POINT_SET_PROCESSING_READ_PLY_POINTS_H +#ifndef CGAL_IO_PLY_READ_PLY_POINTS_H +#define CGAL_IO_PLY_READ_PLY_POINTS_H -#include #include @@ -364,4 +362,4 @@ bool read_PLY(const std::string& fname, OutputIterator output, const CGAL_NP_CLA #undef TRY_TO_GENERATE_SIZED_FACE_PROPERTY #undef TRY_TO_GENERATE_FACE_PROPERTY -#endif // CGAL_POINT_SET_PROCESSING_READ_PLY_POINTS_H +#endif // CGAL_IO_PLY_READ_PLY_POINTS_H diff --git a/Point_set_processing_3/include/CGAL/IO/write_ply_points.h b/Stream_support/include/CGAL/IO/PLY/write_ply_points.h similarity index 95% rename from Point_set_processing_3/include/CGAL/IO/write_ply_points.h rename to Stream_support/include/CGAL/IO/PLY/write_ply_points.h index bdc9c8077e0..8c5beeff7a5 100644 --- a/Point_set_processing_3/include/CGAL/IO/write_ply_points.h +++ b/Stream_support/include/CGAL/IO/PLY/write_ply_points.h @@ -1,18 +1,20 @@ -// Copyright (c) 2015 Geometry Factory -// All rights reserved. +// Copyright (c) 1997 +// Utrecht University (The Netherlands), +// ETH Zurich (Switzerland), +// INRIA Sophia-Antipolis (France), +// Max-Planck-Institute Saarbruecken (Germany), +// and Tel-Aviv University (Israel). All rights reserved. // -// This file is part of CGAL (www.cgal.org). +// This file is part of CGAL (www.cgal.org); // // $URL$ // $Id$ -// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Simon Giraudot -#ifndef CGAL_POINT_SET_PROCESSING_WRITE_PLY_POINTS_H -#define CGAL_POINT_SET_PROCESSING_WRITE_PLY_POINTS_H - -#include +#ifndef CGAL_IO_PLY_WRITE_PLY_POINTS_H +#define CGAL_IO_PLY_WRITE_PLY_POINTS_H #include #include @@ -300,4 +302,4 @@ bool write_PLY(const std::string& filename, } // namespace CGAL -#endif // CGAL_POINT_SET_PROCESSING_WRITE_PLY_POINTS_H +#endif // CGAL_IO_PLY_WRITE_PLY_POINTS_H diff --git a/Point_set_processing_3/include/CGAL/IO/read_xyz_points.h b/Stream_support/include/CGAL/IO/XYZ/read_xyz_points.h similarity index 94% rename from Point_set_processing_3/include/CGAL/IO/read_xyz_points.h rename to Stream_support/include/CGAL/IO/XYZ/read_xyz_points.h index ddf772be51b..aefe76f7d6e 100644 --- a/Point_set_processing_3/include/CGAL/IO/read_xyz_points.h +++ b/Stream_support/include/CGAL/IO/XYZ/read_xyz_points.h @@ -1,18 +1,20 @@ -// Copyright (c) 2007-09 INRIA Sophia-Antipolis (France). -// All rights reserved. +// Copyright (c) 1997 +// Utrecht University (The Netherlands), +// ETH Zurich (Switzerland), +// INRIA Sophia-Antipolis (France), +// Max-Planck-Institute Saarbruecken (Germany), +// and Tel-Aviv University (Israel). All rights reserved. // -// This file is part of CGAL (www.cgal.org). +// This file is part of CGAL (www.cgal.org); // // $URL$ // $Id$ -// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Pierre Alliez and Laurent Saboret -#ifndef CGAL_POINT_SET_PROCESSING_READ_XYZ_POINTS_H -#define CGAL_POINT_SET_PROCESSING_READ_XYZ_POINTS_H - -#include +#ifndef CGAL_IO_PLY_READ_XYZ_POINTS_H +#define CGAL_IO_PLY_READ_XYZ_POINTS_H #include #include @@ -253,4 +255,4 @@ bool read_XYZ(const std::string& fname, OutputIterator output, const CGAL_NP_CLA } // namespace CGAL -#endif // CGAL_POINT_SET_PROCESSING_READ_XYZ_POINTS_H +#endif // CGAL_IO_PLY_READ_XYZ_POINTS_H diff --git a/Point_set_processing_3/include/CGAL/IO/write_xyz_points.h b/Stream_support/include/CGAL/IO/XYZ/write_xyz_points.h similarity index 94% rename from Point_set_processing_3/include/CGAL/IO/write_xyz_points.h rename to Stream_support/include/CGAL/IO/XYZ/write_xyz_points.h index da1c2a402ed..1fd99935fc3 100644 --- a/Point_set_processing_3/include/CGAL/IO/write_xyz_points.h +++ b/Stream_support/include/CGAL/IO/XYZ/write_xyz_points.h @@ -1,19 +1,21 @@ -// Copyright (c) 2007-09 INRIA Sophia-Antipolis (France). -// All rights reserved. +// Copyright (c) 1997 +// Utrecht University (The Netherlands), +// ETH Zurich (Switzerland), +// INRIA Sophia-Antipolis (France), +// Max-Planck-Institute Saarbruecken (Germany), +// and Tel-Aviv University (Israel). All rights reserved. // -// This file is part of CGAL (www.cgal.org). +// This file is part of CGAL (www.cgal.org); // // $URL$ // $Id$ -// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Pierre Alliez and Laurent Saboret #ifndef CGAL_POINT_SET_PROCESSING_WRITE_XYZ_POINTS_H #define CGAL_POINT_SET_PROCESSING_WRITE_XYZ_POINTS_H -#include - #include #include From 7c9b9d15920c34c8c5eeb17b68048612c0ab6683 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 23 Oct 2025 09:47:05 +0100 Subject: [PATCH 02/25] less dependencies --- .../package_info/Kinetic_space_partition/dependencies | 1 - .../package_info/Kinetic_surface_reconstruction/dependencies | 1 - Point_set_3/package_info/Point_set_3/dependencies | 1 - 3 files changed, 3 deletions(-) diff --git a/Kinetic_space_partition/package_info/Kinetic_space_partition/dependencies b/Kinetic_space_partition/package_info/Kinetic_space_partition/dependencies index 831b16749e8..7a6f506d360 100644 --- a/Kinetic_space_partition/package_info/Kinetic_space_partition/dependencies +++ b/Kinetic_space_partition/package_info/Kinetic_space_partition/dependencies @@ -25,7 +25,6 @@ Modular_arithmetic Number_types Orthtree Point_set_3 -Point_set_processing_3 Polygon Polygon_mesh_processing Principal_component_analysis diff --git a/Kinetic_surface_reconstruction/package_info/Kinetic_surface_reconstruction/dependencies b/Kinetic_surface_reconstruction/package_info/Kinetic_surface_reconstruction/dependencies index a746754e7dc..4848ee907f3 100644 --- a/Kinetic_surface_reconstruction/package_info/Kinetic_surface_reconstruction/dependencies +++ b/Kinetic_surface_reconstruction/package_info/Kinetic_surface_reconstruction/dependencies @@ -26,7 +26,6 @@ Modular_arithmetic Number_types Orthtree Point_set_3 -Point_set_processing_3 Polygon Polygon_mesh_processing Principal_component_analysis diff --git a/Point_set_3/package_info/Point_set_3/dependencies b/Point_set_3/package_info/Point_set_3/dependencies index 5b0eb897d7e..0096db674b9 100644 --- a/Point_set_3/package_info/Point_set_3/dependencies +++ b/Point_set_3/package_info/Point_set_3/dependencies @@ -18,7 +18,6 @@ Kernel_d Modular_arithmetic Number_types Point_set_3 -Point_set_processing_3 Polygon Profiling_tools Property_map From 592b8824ec722144daba0506540d8acd3f777589 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 24 Oct 2025 15:49:55 +0100 Subject: [PATCH 03/25] Add forwarding include files --- .../orient_scanlines_example.cpp | 2 +- Stream_support/include/CGAL/IO/read_las_points.h | 12 ++++++++++++ Stream_support/include/CGAL/IO/read_off_points.h | 12 ++++++++++++ Stream_support/include/CGAL/IO/read_ply_points.h | 12 ++++++++++++ Stream_support/include/CGAL/IO/read_xyz_points.h | 12 ++++++++++++ Stream_support/include/CGAL/IO/write_las_points.h | 12 ++++++++++++ Stream_support/include/CGAL/IO/write_off_points.h | 12 ++++++++++++ Stream_support/include/CGAL/IO/write_ply_points.h | 12 ++++++++++++ Stream_support/include/CGAL/IO/write_xyz_points.h | 12 ++++++++++++ 9 files changed, 97 insertions(+), 1 deletion(-) create mode 100644 Stream_support/include/CGAL/IO/read_las_points.h create mode 100644 Stream_support/include/CGAL/IO/read_off_points.h create mode 100644 Stream_support/include/CGAL/IO/read_ply_points.h create mode 100644 Stream_support/include/CGAL/IO/read_xyz_points.h create mode 100644 Stream_support/include/CGAL/IO/write_las_points.h create mode 100644 Stream_support/include/CGAL/IO/write_off_points.h create mode 100644 Stream_support/include/CGAL/IO/write_ply_points.h create mode 100644 Stream_support/include/CGAL/IO/write_xyz_points.h 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 642da49d893..206783c50b9 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 @@ -1,5 +1,5 @@ #include -#include +#include #include #include #include diff --git a/Stream_support/include/CGAL/IO/read_las_points.h b/Stream_support/include/CGAL/IO/read_las_points.h new file mode 100644 index 00000000000..cc3a02348f2 --- /dev/null +++ b/Stream_support/include/CGAL/IO/read_las_points.h @@ -0,0 +1,12 @@ +// Copyright (c) 2017 GeometryFactory +// +// This file is part of CGAL (www.cgal.org); +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// +// Author(s) : Simon Giraudot + +#include + diff --git a/Stream_support/include/CGAL/IO/read_off_points.h b/Stream_support/include/CGAL/IO/read_off_points.h new file mode 100644 index 00000000000..2f067034b69 --- /dev/null +++ b/Stream_support/include/CGAL/IO/read_off_points.h @@ -0,0 +1,12 @@ +// Copyright (c) 2017 GeometryFactory +// +// This file is part of CGAL (www.cgal.org); +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// +// Author(s) : Simon Giraudot + +#include + diff --git a/Stream_support/include/CGAL/IO/read_ply_points.h b/Stream_support/include/CGAL/IO/read_ply_points.h new file mode 100644 index 00000000000..e91b0326d6f --- /dev/null +++ b/Stream_support/include/CGAL/IO/read_ply_points.h @@ -0,0 +1,12 @@ +// Copyright (c) 2017 GeometryFactory +// +// This file is part of CGAL (www.cgal.org); +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// +// Author(s) : Simon Giraudot + +#include + diff --git a/Stream_support/include/CGAL/IO/read_xyz_points.h b/Stream_support/include/CGAL/IO/read_xyz_points.h new file mode 100644 index 00000000000..574f74c5efc --- /dev/null +++ b/Stream_support/include/CGAL/IO/read_xyz_points.h @@ -0,0 +1,12 @@ +// Copyright (c) 2017 GeometryFactory +// +// This file is part of CGAL (www.cgal.org); +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// +// Author(s) : Simon Giraudot + +#include + diff --git a/Stream_support/include/CGAL/IO/write_las_points.h b/Stream_support/include/CGAL/IO/write_las_points.h new file mode 100644 index 00000000000..bed96fed95b --- /dev/null +++ b/Stream_support/include/CGAL/IO/write_las_points.h @@ -0,0 +1,12 @@ +// Copyright (c) 2017 GeometryFactory +// +// This file is part of CGAL (www.cgal.org); +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// +// Author(s) : Simon Giraudot + + +#include diff --git a/Stream_support/include/CGAL/IO/write_off_points.h b/Stream_support/include/CGAL/IO/write_off_points.h new file mode 100644 index 00000000000..bed96fed95b --- /dev/null +++ b/Stream_support/include/CGAL/IO/write_off_points.h @@ -0,0 +1,12 @@ +// Copyright (c) 2017 GeometryFactory +// +// This file is part of CGAL (www.cgal.org); +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// +// Author(s) : Simon Giraudot + + +#include diff --git a/Stream_support/include/CGAL/IO/write_ply_points.h b/Stream_support/include/CGAL/IO/write_ply_points.h new file mode 100644 index 00000000000..7815c1c9127 --- /dev/null +++ b/Stream_support/include/CGAL/IO/write_ply_points.h @@ -0,0 +1,12 @@ +// Copyright (c) 2017 GeometryFactory +// +// This file is part of CGAL (www.cgal.org); +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// +// Author(s) : Simon Giraudot + + +#include diff --git a/Stream_support/include/CGAL/IO/write_xyz_points.h b/Stream_support/include/CGAL/IO/write_xyz_points.h new file mode 100644 index 00000000000..b042e572a82 --- /dev/null +++ b/Stream_support/include/CGAL/IO/write_xyz_points.h @@ -0,0 +1,12 @@ +// Copyright (c) 2017 GeometryFactory +// +// This file is part of CGAL (www.cgal.org); +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// +// Author(s) : Simon Giraudot + + +#include From 37b6a7214dea16de7e3119191520cd9f5f2c153c Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Sat, 25 Oct 2025 09:58:21 +0100 Subject: [PATCH 04/25] R/W for points in OFF format is now in CGAL/IO/OFF.h --- .../File_formats/Supported_file_formats.txt | 4 +- Stream_support/include/CGAL/IO/OFF.h | 207 ++++++++++++++++++ .../include/CGAL/IO/OFF/read_off_points.h | 94 +------- .../include/CGAL/IO/OFF/write_off_points.h | 103 +-------- .../include/CGAL/IO/read_off_points.h | 6 +- 5 files changed, 231 insertions(+), 183 deletions(-) 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 53a1a22b2cf..165c589e139 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 @@ -61,7 +61,7 @@ The following table lists some \cgal data structures that have I/O functions com Any point range - \link PkgPointSetProcessing3IOOff CGAL::IO::read_OFF(const std::string&, PointOutputIterator)\endlink + \link PkgStreamSupportIoFuncsOFF CGAL::IO::read_OFF(const std::string&, PointOutputIterator)\endlink Polygon Soup @@ -89,7 +89,7 @@ The following table lists some \cgal data structures that have I/O functions com Any point range - \link PkgPointSetProcessing3IOOff CGAL::IO::write_OFF(const std::string&, const PointRange&)\endlink + \link PkgStreamSupportIoFuncsOFF CGAL::IO::write_OFF(const std::string&, const PointRange&)\endlink Polygon Soup diff --git a/Stream_support/include/CGAL/IO/OFF.h b/Stream_support/include/CGAL/IO/OFF.h index ff17f202bba..60bd2eaf452 100644 --- a/Stream_support/include/CGAL/IO/OFF.h +++ b/Stream_support/include/CGAL/IO/OFF.h @@ -332,6 +332,213 @@ bool write_OFF(const std::string& fname, return writer(points, polygons, np); } +/** + \ingroup PkgStreamSupportIoFuncsOFF + + \brief reads points (positions + normals, if available), using the \ref IOStreamOFF. + + \tparam OutputIteratorValueType type of objects that can be put in `PointOutputIterator`. + It must be a model of `DefaultConstructible` and defaults to `value_type_traits::%type`. + It can be omitted when the default is fine. + \tparam PointOutputIterator iterator over output points. + \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + + \param is input stream + \param output output iterator over points + \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below + + \cgalNamedParamsBegin + \cgalParamNBegin{point_map} + \cgalParamDescription{a property map associating points to the elements of the point range} + \cgalParamType{a model of `WritablePropertyMap` with value type `geom_traits::Point_3`} + \cgalParamDefault{`CGAL::Identity_property_map`} + \cgalParamNEnd + + \cgalParamNBegin{normal_map} + \cgalParamDescription{a property map associating normals to the elements of the point range} + \cgalParamType{a model of `WritablePropertyMap` with value type `geom_traits::Vector_3`} + \cgalParamDefault{If this parameter is omitted, normals in the input stream are ignored.} + \cgalParamNEnd + + \cgalParamNBegin{geom_traits} + \cgalParamDescription{an instance of a geometric traits class} + \cgalParamType{a model of `Kernel`} + \cgalParamDefault{a \cgal Kernel deduced from the point type, using `CGAL::Kernel_traits`} + \cgalParamNEnd + \cgalNamedParamsEnd + + \returns `true` if reading was successful, `false` otherwise. + + \sa \ref IOStreamOFF +*/ +template +bool read_OFF(std::istream& is, + PointOutputIterator output, + const CGAL_NP_CLASS& np = parameters::default_values() +#ifndef DOXYGEN_RUNNING + , std::enable_if_t::value>* = nullptr +#endif + ); + + + +/** + \ingroup PkgStreamSupportIoFuncsOFF + + \brief reads points (positions + normals, if available), using the \ref IOStreamOFF. + + \tparam OutputIteratorValueType type of objects that can be put in `PointOutputIterator`. + It must be a model of `DefaultConstructible` and defaults to `value_type_traits::%type`. + It can be omitted when the default is fine. + \tparam PointOutputIterator iterator over output points. + \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + + \param fname input file name + \param output output iterator over points + \param np optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below. + + \cgalNamedParamsBegin + \cgalParamNBegin{point_map} + \cgalParamDescription{a property map associating points to the elements of the point range} + \cgalParamType{a model of `WritablePropertyMap` with value type `geom_traits::Point_3`} + \cgalParamDefault{`CGAL::Identity_property_map`} + \cgalParamNEnd + + \cgalParamNBegin{normal_map} + \cgalParamDescription{a property map associating normals to the elements of the point range} + \cgalParamType{a model of `WritablePropertyMap` with value type `geom_traits::Vector_3`} + \cgalParamDefault{If this parameter is omitted, normals in the input stream are ignored.} + \cgalParamNEnd + + \cgalParamNBegin{geom_traits} + \cgalParamDescription{an instance of a geometric traits class} + \cgalParamType{a model of `Kernel`} + \cgalParamDefault{a \cgal Kernel deduced from the point type, using `CGAL::Kernel_traits`} + \cgalParamNEnd + \cgalNamedParamsEnd + + \returns `true` if reading was successful, `false` otherwise. + + \sa \ref IOStreamOFF +*/ +template +bool read_OFF(const std::string& fname, + PointOutputIterator output, + const CGAL_NP_CLASS& np = parameters::default_values() +#ifndef DOXYGEN_RUNNING + , std::enable_if_t::value>* = nullptr +#endif + ); + +/** + \ingroup PkgStreamSupportIoFuncsOFF + + \brief writes the range of `points` (positions + normals, if available), using the \ref IOStreamOFF. + + \tparam PointRange is a model of `ConstRange`. The value type of + its iterator is the key type of the named parameter `point_map`. + \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + + \param os output stream + \param points input point range + \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below + + \cgalNamedParamsBegin + \cgalParamNBegin{point_map} + \cgalParamDescription{a property map associating points to the elements of the point range} + \cgalParamType{a model of `ReadablePropertyMap` with value type `geom_traits::Point_3`} + \cgalParamDefault{`CGAL::Identity_property_map`} + \cgalParamNEnd + + \cgalParamNBegin{normal_map} + \cgalParamDescription{a property map associating normals to the elements of the point range} + \cgalParamType{a model of `ReadablePropertyMap` with value type `geom_traits::Vector_3`} + \cgalParamDefault{If this parameter is omitted, normals are not written in the output stream.} + \cgalParamNEnd + + \cgalParamNBegin{geom_traits} + \cgalParamDescription{an instance of a geometric traits class} + \cgalParamType{a model of `Kernel`} + \cgalParamDefault{a \cgal Kernel deduced from the point type, using `CGAL::Kernel_traits`} + \cgalParamNEnd + + \cgalParamNBegin{stream_precision} + \cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream} + \cgalParamType{int} + \cgalParamDefault{the precision of the stream `os`} + \cgalParamNEnd + \cgalNamedParamsEnd + + \returns `true` if writing was successful, `false` otherwise. +*/ +template +bool write_OFF(std::ostream& os, + const PointRange& points, + const CGAL_NP_CLASS& np = parameters::default_values() +#ifndef DOXYGEN_RUNNING + , std::enable_if_t::value>* = nullptr +#endif + ); + + + +/** + \ingroup PkgStreamSupportIoFuncsOFF + + \brief writes the range of `points` (positions + normals, if available), using the \ref IOStreamOFF. + + \tparam PointRange is a model of `ConstRange`. The value type of + its iterator is the key type of the named parameter `point_map`. + \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + + \param filename the path to the output file + \param points input point range + \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below + + \cgalNamedParamsBegin + \cgalParamNBegin{point_map} + \cgalParamDescription{a property map associating points to the elements of the point range} + \cgalParamType{a model of `ReadablePropertyMap` with value type `geom_traits::Point_3`} + \cgalParamDefault{`CGAL::Identity_property_map`} + \cgalParamNEnd + + \cgalParamNBegin{normal_map} + \cgalParamDescription{a property map associating normals to the elements of the point range} + \cgalParamType{a model of `ReadablePropertyMap` with value type `geom_traits::Vector_3`} + \cgalParamDefault{If this parameter is omitted, normals are not written in the output file.} + \cgalParamNEnd + + \cgalParamNBegin{geom_traits} + \cgalParamDescription{an instance of a geometric traits class} + \cgalParamType{a model of `Kernel`} + \cgalParamDefault{a \cgal Kernel deduced from the point type, using `CGAL::Kernel_traits`} + \cgalParamNEnd + + \cgalParamNBegin{stream_precision} + \cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream} + \cgalParamType{int} + \cgalParamDefault{`6`} + \cgalParamNEnd + \cgalNamedParamsEnd + + \returns `true` if writing was successful, `false` otherwise. + + \sa \ref IOStreamOFF +*/ +template +bool write_OFF(const std::string& filename, + const PointRange& points, + const CGAL_NP_CLASS& np = parameters::default_values() +#ifndef DOXYGEN_RUNNING + , std::enable_if_t::value>* = nullptr +#endif + ); + } // namespace IO } // namespace CGAL diff --git a/Stream_support/include/CGAL/IO/OFF/read_off_points.h b/Stream_support/include/CGAL/IO/OFF/read_off_points.h index 1fa73a51588..325e52f4413 100644 --- a/Stream_support/include/CGAL/IO/OFF/read_off_points.h +++ b/Stream_support/include/CGAL/IO/OFF/read_off_points.h @@ -24,10 +24,12 @@ #include #include #include +#include #include #include + #include #include #include @@ -38,54 +40,14 @@ namespace CGAL { namespace IO { -/** - \ingroup PkgPointSetProcessing3IOOff - - \brief reads points (positions + normals, if available), using the \ref IOStreamOFF. - - \tparam OutputIteratorValueType type of objects that can be put in `PointOutputIterator`. - It must be a model of `DefaultConstructible` and defaults to `value_type_traits::%type`. - It can be omitted when the default is fine. - \tparam PointOutputIterator iterator over output points. - \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" - - \param is input stream - \param output output iterator over points - \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below - - \cgalNamedParamsBegin - \cgalParamNBegin{point_map} - \cgalParamDescription{a property map associating points to the elements of the point range} - \cgalParamType{a model of `WritablePropertyMap` with value type `geom_traits::Point_3`} - \cgalParamDefault{`CGAL::Identity_property_map`} - \cgalParamNEnd - - \cgalParamNBegin{normal_map} - \cgalParamDescription{a property map associating normals to the elements of the point range} - \cgalParamType{a model of `WritablePropertyMap` with value type `geom_traits::Vector_3`} - \cgalParamDefault{If this parameter is omitted, normals in the input stream are ignored.} - \cgalParamNEnd - - \cgalParamNBegin{geom_traits} - \cgalParamDescription{an instance of a geometric traits class} - \cgalParamType{a model of `Kernel`} - \cgalParamDefault{a \cgal Kernel deduced from the point type, using `CGAL::Kernel_traits`} - \cgalParamNEnd - \cgalNamedParamsEnd - - \returns `true` if reading was successful, `false` otherwise. - - \sa \ref IOStreamOFF -*/ +// doxygen in ../OFF.h template bool read_OFF(std::istream& is, PointOutputIterator output, - const CGAL_NP_CLASS& np = parameters::default_values() -#ifndef DOXYGEN_RUNNING - , std::enable_if_t::value>* = nullptr -#endif + const CGAL_NP_CLASS& np, + std::enable_if_t::value>* ) { using parameters::choose_parameter; @@ -197,54 +159,14 @@ bool read_OFF(std::istream& is, return true; } -/** - \ingroup PkgPointSetProcessing3IOOff - - \brief reads points (positions + normals, if available), using the \ref IOStreamOFF. - - \tparam OutputIteratorValueType type of objects that can be put in `PointOutputIterator`. - It must be a model of `DefaultConstructible` and defaults to `value_type_traits::%type`. - It can be omitted when the default is fine. - \tparam PointOutputIterator iterator over output points. - \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" - - \param fname input file name - \param output output iterator over points - \param np optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below. - - \cgalNamedParamsBegin - \cgalParamNBegin{point_map} - \cgalParamDescription{a property map associating points to the elements of the point range} - \cgalParamType{a model of `WritablePropertyMap` with value type `geom_traits::Point_3`} - \cgalParamDefault{`CGAL::Identity_property_map`} - \cgalParamNEnd - - \cgalParamNBegin{normal_map} - \cgalParamDescription{a property map associating normals to the elements of the point range} - \cgalParamType{a model of `WritablePropertyMap` with value type `geom_traits::Vector_3`} - \cgalParamDefault{If this parameter is omitted, normals in the input stream are ignored.} - \cgalParamNEnd - - \cgalParamNBegin{geom_traits} - \cgalParamDescription{an instance of a geometric traits class} - \cgalParamType{a model of `Kernel`} - \cgalParamDefault{a \cgal Kernel deduced from the point type, using `CGAL::Kernel_traits`} - \cgalParamNEnd - \cgalNamedParamsEnd - - \returns `true` if reading was successful, `false` otherwise. - - \sa \ref IOStreamOFF -*/ +// doxygen in ../OFF.h template bool read_OFF(const std::string& fname, PointOutputIterator output, - const CGAL_NP_CLASS& np = parameters::default_values() -#ifndef DOXYGEN_RUNNING - , std::enable_if_t::value>* = nullptr -#endif + const CGAL_NP_CLASS& np, + , std::enable_if_t::value>* ) { std::ifstream is(fname); diff --git a/Stream_support/include/CGAL/IO/OFF/write_off_points.h b/Stream_support/include/CGAL/IO/OFF/write_off_points.h index 7e2d7ddd8fc..4c8539c9aca 100644 --- a/Stream_support/include/CGAL/IO/OFF/write_off_points.h +++ b/Stream_support/include/CGAL/IO/OFF/write_off_points.h @@ -13,8 +13,8 @@ // // Author(s) : Pierre Alliez and Laurent Saboret -#ifndef CGAL_IO_PLY_WRITE_OFF_POINTS_H -#define CGAL_IO_PLY_WRITE_OFF_POINTS_H +#ifndef CGAL_IO_OFF_WRITE_OFF_POINTS_H +#define CGAL_IO_OFF_WRITE_OFF_POINTS_H #include #include @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -87,110 +88,24 @@ bool write_OFF_PSP(std::ostream& os, namespace IO { -/** - \ingroup PkgPointSetProcessing3IOOff - - \brief writes the range of `points` (positions + normals, if available), using the \ref IOStreamOFF. - - \tparam PointRange is a model of `ConstRange`. The value type of - its iterator is the key type of the named parameter `point_map`. - \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" - - \param os output stream - \param points input point range - \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below - - \cgalNamedParamsBegin - \cgalParamNBegin{point_map} - \cgalParamDescription{a property map associating points to the elements of the point range} - \cgalParamType{a model of `ReadablePropertyMap` with value type `geom_traits::Point_3`} - \cgalParamDefault{`CGAL::Identity_property_map`} - \cgalParamNEnd - - \cgalParamNBegin{normal_map} - \cgalParamDescription{a property map associating normals to the elements of the point range} - \cgalParamType{a model of `ReadablePropertyMap` with value type `geom_traits::Vector_3`} - \cgalParamDefault{If this parameter is omitted, normals are not written in the output stream.} - \cgalParamNEnd - - \cgalParamNBegin{geom_traits} - \cgalParamDescription{an instance of a geometric traits class} - \cgalParamType{a model of `Kernel`} - \cgalParamDefault{a \cgal Kernel deduced from the point type, using `CGAL::Kernel_traits`} - \cgalParamNEnd - - \cgalParamNBegin{stream_precision} - \cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream} - \cgalParamType{int} - \cgalParamDefault{the precision of the stream `os`} - \cgalParamNEnd - \cgalNamedParamsEnd - - \returns `true` if writing was successful, `false` otherwise. -*/ +// // doxygen in ../OFF.h template bool write_OFF(std::ostream& os, const PointRange& points, - const CGAL_NP_CLASS& np = parameters::default_values() -#ifndef DOXYGEN_RUNNING - , std::enable_if_t::value>* = nullptr + const CGAL_NP_CLASS& np, + std::enable_if_t::value>* #endif ) { return Point_set_processing_3::internal::write_OFF_PSP(os, points, np); } -/** - \ingroup PkgPointSetProcessing3IOOff - - \brief writes the range of `points` (positions + normals, if available), using the \ref IOStreamOFF. - - \tparam PointRange is a model of `ConstRange`. The value type of - its iterator is the key type of the named parameter `point_map`. - \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" - - \param filename the path to the output file - \param points input point range - \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below - - \cgalNamedParamsBegin - \cgalParamNBegin{point_map} - \cgalParamDescription{a property map associating points to the elements of the point range} - \cgalParamType{a model of `ReadablePropertyMap` with value type `geom_traits::Point_3`} - \cgalParamDefault{`CGAL::Identity_property_map`} - \cgalParamNEnd - - \cgalParamNBegin{normal_map} - \cgalParamDescription{a property map associating normals to the elements of the point range} - \cgalParamType{a model of `ReadablePropertyMap` with value type `geom_traits::Vector_3`} - \cgalParamDefault{If this parameter is omitted, normals are not written in the output file.} - \cgalParamNEnd - - \cgalParamNBegin{geom_traits} - \cgalParamDescription{an instance of a geometric traits class} - \cgalParamType{a model of `Kernel`} - \cgalParamDefault{a \cgal Kernel deduced from the point type, using `CGAL::Kernel_traits`} - \cgalParamNEnd - - \cgalParamNBegin{stream_precision} - \cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream} - \cgalParamType{int} - \cgalParamDefault{`6`} - \cgalParamNEnd - \cgalNamedParamsEnd - - \returns `true` if writing was successful, `false` otherwise. - - \sa \ref IOStreamOFF -*/ +// // doxygen in ../OFF.h template bool write_OFF(const std::string& filename, const PointRange& points, - const CGAL_NP_CLASS& np = parameters::default_values() -#ifndef DOXYGEN_RUNNING - , std::enable_if_t::value>* = nullptr -#endif + const CGAL_NP_CLASS& np, std::enable_if_t::value>* ) { std::ofstream os(filename); @@ -202,4 +117,4 @@ bool write_OFF(const std::string& filename, } // namespace CGAL -#endif // CGAL_IO_PLY_WRITE_OFF_POINTS_H +#endif // CGAL_IO_OFF_WRITE_OFF_POINTS_H diff --git a/Stream_support/include/CGAL/IO/read_off_points.h b/Stream_support/include/CGAL/IO/read_off_points.h index 2f067034b69..24a3edc4716 100644 --- a/Stream_support/include/CGAL/IO/read_off_points.h +++ b/Stream_support/include/CGAL/IO/read_off_points.h @@ -8,5 +8,9 @@ // // Author(s) : Simon Giraudot -#include +#ifndef CGAL_IO_READ_OFF_POINTS_H +#define CGAL_IO_READ_OFF_POINTS_H +#include + +#endif // CGAL_IO_READ_OFF_POINTS_H From 67220b911bffc946d026134a53103afb3c740bf5 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Sat, 25 Oct 2025 10:17:18 +0100 Subject: [PATCH 05/25] fix --- Stream_support/include/CGAL/IO/OFF/write_off_points.h | 1 - Stream_support/include/CGAL/IO/write_off_points.h | 7 ++++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Stream_support/include/CGAL/IO/OFF/write_off_points.h b/Stream_support/include/CGAL/IO/OFF/write_off_points.h index 4c8539c9aca..3d3d9e84d49 100644 --- a/Stream_support/include/CGAL/IO/OFF/write_off_points.h +++ b/Stream_support/include/CGAL/IO/OFF/write_off_points.h @@ -94,7 +94,6 @@ bool write_OFF(std::ostream& os, const PointRange& points, const CGAL_NP_CLASS& np, std::enable_if_t::value>* -#endif ) { return Point_set_processing_3::internal::write_OFF_PSP(os, points, np); diff --git a/Stream_support/include/CGAL/IO/write_off_points.h b/Stream_support/include/CGAL/IO/write_off_points.h index bed96fed95b..29be8d731b1 100644 --- a/Stream_support/include/CGAL/IO/write_off_points.h +++ b/Stream_support/include/CGAL/IO/write_off_points.h @@ -9,4 +9,9 @@ // Author(s) : Simon Giraudot -#include +#ifndef CGAL_IO_WRITE_OFF_POINTS_H +#define CGAL_IO_WRITE_OFF_POINTS_H + +#include + +#endif // CGAL_IO_WRITE_OFF_POINTS_H From 5e26465b2cb4acff26d936c21f1a278a2a8763f2 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Sat, 25 Oct 2025 10:28:36 +0100 Subject: [PATCH 06/25] fix --- Stream_support/include/CGAL/IO/OFF/read_off_points.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Stream_support/include/CGAL/IO/OFF/read_off_points.h b/Stream_support/include/CGAL/IO/OFF/read_off_points.h index 325e52f4413..e42fa672a12 100644 --- a/Stream_support/include/CGAL/IO/OFF/read_off_points.h +++ b/Stream_support/include/CGAL/IO/OFF/read_off_points.h @@ -166,7 +166,7 @@ template ::value>* + std::enable_if_t::value>* ) { std::ifstream is(fname); From f766834601c6f1ef6739de9f17d5b6be983c9471 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Sat, 25 Oct 2025 11:00:50 +0100 Subject: [PATCH 07/25] Use CGAL_NP_TEMPLATE_PARAMETERS_NO_DEFAULT --- Stream_support/include/CGAL/IO/OFF/read_off_points.h | 4 ++-- Stream_support/include/CGAL/IO/OFF/write_off_points.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Stream_support/include/CGAL/IO/OFF/read_off_points.h b/Stream_support/include/CGAL/IO/OFF/read_off_points.h index e42fa672a12..d9df6639d22 100644 --- a/Stream_support/include/CGAL/IO/OFF/read_off_points.h +++ b/Stream_support/include/CGAL/IO/OFF/read_off_points.h @@ -43,7 +43,7 @@ namespace IO { // doxygen in ../OFF.h template + typename CGAL_NP_TEMPLATE_PARAMETERS_NO_DEFAULT> bool read_OFF(std::istream& is, PointOutputIterator output, const CGAL_NP_CLASS& np, @@ -162,7 +162,7 @@ bool read_OFF(std::istream& is, // doxygen in ../OFF.h template + typename CGAL_NP_TEMPLATE_PARAMETERS_NO_DEFAULT> bool read_OFF(const std::string& fname, PointOutputIterator output, const CGAL_NP_CLASS& np, diff --git a/Stream_support/include/CGAL/IO/OFF/write_off_points.h b/Stream_support/include/CGAL/IO/OFF/write_off_points.h index 3d3d9e84d49..11c41651f92 100644 --- a/Stream_support/include/CGAL/IO/OFF/write_off_points.h +++ b/Stream_support/include/CGAL/IO/OFF/write_off_points.h @@ -89,7 +89,7 @@ bool write_OFF_PSP(std::ostream& os, namespace IO { // // doxygen in ../OFF.h -template +template bool write_OFF(std::ostream& os, const PointRange& points, const CGAL_NP_CLASS& np, @@ -101,7 +101,7 @@ bool write_OFF(std::ostream& os, // // doxygen in ../OFF.h template + typename CGAL_NP_TEMPLATE_PARAMETERS_NO_DEFAULT> bool write_OFF(const std::string& filename, const PointRange& points, const CGAL_NP_CLASS& np, std::enable_if_t::value>* From fb748f644247cde3dc483592363d5eafd956ed28 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 30 Oct 2025 14:51:26 +0100 Subject: [PATCH 08/25] Move LAS --- .../read_las_example.cpp | 2 +- Stream_support/include/CGAL/IO/LAS.h | 211 ++++++++++++++++++ .../include/CGAL/IO/LAS/read_las_points.h | 158 +------------ .../include/CGAL/IO/LAS/write_las_points.h | 7 +- .../include/CGAL/IO/read_las_points.h | 8 +- .../include/CGAL/IO/write_las_points.h | 7 +- 6 files changed, 238 insertions(+), 155 deletions(-) create mode 100644 Stream_support/include/CGAL/IO/LAS.h 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 b15265bcb5f..9f2f14325c1 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 @@ -1,7 +1,7 @@ #include #include -#include +#include #include #include diff --git a/Stream_support/include/CGAL/IO/LAS.h b/Stream_support/include/CGAL/IO/LAS.h new file mode 100644 index 00000000000..ed417bd459f --- /dev/null +++ b/Stream_support/include/CGAL/IO/LAS.h @@ -0,0 +1,211 @@ +// Copyright (c) 2017 GeometryFactory +// +// This file is part of CGAL (www.cgal.org); +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// +// Author(s) : Simon Giraudot + +#ifndef CGAL_IO_LAS_H +#define CGAL_IO_LAS_H + +#include +#include + +#include +#include +#include +#include + +namespace CGAL { + +//////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////// +// Read + +namespace IO { + +/** + \ingroup PkgStreamSupportIoFuncsLAS + + generates a %LAS property handler to read 3D points. Points are + constructed from the input the using 3 %LAS properties + `LAS_property::X`, `LAS_property::Y` and `LAS_property::Z`. + + \tparam PointMap the property map used to store points. + + \sa `read_LAS_with_properties()` + \sa \ref IOStreamLAS +*/ +template +std::tuple::Kernel::Construct_point_3, + LAS_property::X, LAS_property::Y, LAS_property::Z > +make_las_point_reader(PointMap point_map); + + +/** + \ingroup PkgStreamSupportIoFuncsLAS + + \brief reads user-selected points properties from a .las or .laz stream. + Potential additional properties are ignored. + + Properties are handled through a variadic list of property + handlers. A `PropertyHandler` can either be: + + - A `std::pair` if the user wants to + read a %LAS property as a scalar value `LAS_property::Tag::type` (for + example, storing an `int` %LAS property into an `int` variable). + + - A `std::tuple` if the user wants to use one or several + %LAS properties to construct a complex object (for example, + storing 4 `unsigned short` %LAS properties into a %Color object + that can for example be a `std::array`). In that case, the second element of the tuple should be a + functor that constructs the value type of `PropertyMap` from N + objects of of type `LAS_property::Tag::type`. + + The %LAS standard defines a fixed set of properties accessible + through the following tag classes: + + - `LAS_property::X` with type `double` + - `LAS_property::Y` with type `double` + - `LAS_property::Z` with type `double` + - `LAS_property::Intensity` with type `unsigned short` + - `LAS_property::Return_number` with type `unsigned char` + - `LAS_property::Number_of_returns` with type `unsigned char` + - `LAS_property::Scan_direction_flag` with type `unsigned char` + - `LAS_property::Edge_of_flight_line` with type `unsigned char` + - `LAS_property::Classification` with type `unsigned char` + - `LAS_property::Synthetic_flag` with type `unsigned char` + - `LAS_property::Keypoint_flag` with type `unsigned char` + - `LAS_property::Withheld_flag` with type `unsigned char` + - `LAS_property::Scan_angle` with type `double` + - `LAS_property::User_data` with type `unsigned char` + - `LAS_property::Point_source_ID` with type `unsigned short` + - `LAS_property::Deleted_flag` with type `unsigned int` + - `LAS_property::GPS_time` with type `double` + - `LAS_property::R` with type `unsigned short` + - `LAS_property::G` with type `unsigned short` + - `LAS_property::B` with type `unsigned short` + - `LAS_property::I` with type `unsigned short` + + \attention To read a binary file, the flag `std::ios::binary` must be set during the creation of the `ifstream`. + + \tparam OutputIteratorValueType type of objects that can be put in `PointOutputIterator`. + It must be a model of `DefaultConstructible` and defaults to `value_type_traits::%type`. + It can be omitted if the default is fine. + \tparam PointOutputIterator iterator over output points. + \tparam PropertyHandler handlers to recover properties. + + \returns `true` if reading was successful, `false` otherwise. + + \sa `make_las_point_reader()` + + \sa \ref IOStreamLAS +*/ +template +bool read_LAS_with_properties(std::istream& is, + PointOutputIterator output, + PropertyHandler&& ... properties); + + + +/** + \ingroup PkgStreamSupportIoFuncsLAS + + \brief reads points (position only) using the \ref IOStreamLAS. + + Potential additional properties are ignored. + + \attention To read a binary file, the flag `std::ios::binary` must be set during the creation of the `ifstream`. + + \tparam OutputIteratorValueType type of objects that can be put in `PointOutputIterator`. + It must be a model of `DefaultConstructible` and defaults to `value_type_traits::%type`. + It can be omitted when the default is fine. + \tparam PointOutputIterator iterator over output points. + \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + + \param is input stream + \param output output iterator over points + \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below + + \cgalNamedParamsBegin + \cgalParamNBegin{point_map} + \cgalParamDescription{a property map associating points to the elements of the point range} + \cgalParamType{a model of `WritablePropertyMap` with value type `geom_traits::Point_3`} + \cgalParamDefault{`CGAL::Identity_property_map`} + \cgalParamNEnd + + \cgalParamNBegin{geom_traits} + \cgalParamDescription{an instance of a geometric traits class} + \cgalParamType{a model of `Kernel`} + \cgalParamDefault{a \cgal Kernel deduced from the point type, using `CGAL::Kernel_traits`} + \cgalParamNEnd + \cgalNamedParamsEnd + + \returns `true` if reading was successful, `false` otherwise. + + \sa `read_LAS_with_properties()` +*/ +template +bool read_LAS(std::istream& is, + PointOutputIterator output, + const CGAL_NP_CLASS& np = parameters::default_values()); + + + + +/** + \ingroup PkgStreamSupportIoFuncsLAS + + \brief reads points (position only) using the \ref IOStreamLAS. + + Potential additional properties are ignored. + + \tparam OutputIteratorValueType type of objects that can be put in `PointOutputIterator`. + It must be a model of `DefaultConstructible` and defaults to `value_type_traits::%type`. + It can be omitted when the default is fine. + \tparam PointOutputIterator iterator over output points. + \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + + \param filename name of the input file + \param output output iterator over points + \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below + + \cgalNamedParamsBegin + \cgalParamNBegin{point_map} + \cgalParamDescription{a property map associating points to the elements of the point range} + \cgalParamType{a model of `WritablePropertyMap` with value type `geom_traits::Point_3`} + \cgalParamDefault{`CGAL::Identity_property_map`} + \cgalParamNEnd + + \cgalParamNBegin{geom_traits} + \cgalParamDescription{an instance of a geometric traits class} + \cgalParamType{a model of `Kernel`} + \cgalParamDefault{a \cgal Kernel deduced from the point type, using `CGAL::Kernel_traits`} + \cgalParamNEnd + \cgalNamedParamsEnd + + \returns `true` if reading was successful, `false` otherwise. + + \sa `read_LAS_with_properties()` +*/ +template +bool read_LAS(const std::string& filename, + PointOutputIterator output, + const CGAL_NP_CLASS& np = parameters::default_values()); +} // namespace IO + +} // namespace CGAL + +#endif // CGAL_IO_LAS_H diff --git a/Stream_support/include/CGAL/IO/LAS/read_las_points.h b/Stream_support/include/CGAL/IO/LAS/read_las_points.h index 291a479933e..b588f66fa68 100644 --- a/Stream_support/include/CGAL/IO/LAS/read_las_points.h +++ b/Stream_support/include/CGAL/IO/LAS/read_las_points.h @@ -13,6 +13,7 @@ #include +#include #include #include #include @@ -117,18 +118,7 @@ typedef Base I; } /// \endcond -/** - \ingroup PkgPointSetProcessing3IOLas - - generates a %LAS property handler to read 3D points. Points are - constructed from the input the using 3 %LAS properties - `LAS_property::X`, `LAS_property::Y` and `LAS_property::Z`. - - \tparam PointMap the property map used to store points. - - \sa `read_LAS_with_properties()` - \sa \ref IOStreamLAS -*/ +// documenation in ../LAS.h template std::tuple::Kernel::Construct_point_3, @@ -308,67 +298,7 @@ void process_properties (const LASpoint& reader, OutputValueType& new_element, /// \endcond -/** - \ingroup PkgPointSetProcessing3IOLas - - \brief reads user-selected points properties from a .las or .laz stream. - Potential additional properties are ignored. - - Properties are handled through a variadic list of property - handlers. A `PropertyHandler` can either be: - - - A `std::pair` if the user wants to - read a %LAS property as a scalar value `LAS_property::Tag::type` (for - example, storing an `int` %LAS property into an `int` variable). - - - A `std::tuple` if the user wants to use one or several - %LAS properties to construct a complex object (for example, - storing 4 `unsigned short` %LAS properties into a %Color object - that can for example be a `std::array`). In that case, the second element of the tuple should be a - functor that constructs the value type of `PropertyMap` from N - objects of of type `LAS_property::Tag::type`. - - The %LAS standard defines a fixed set of properties accessible - through the following tag classes: - - - `LAS_property::X` with type `double` - - `LAS_property::Y` with type `double` - - `LAS_property::Z` with type `double` - - `LAS_property::Intensity` with type `unsigned short` - - `LAS_property::Return_number` with type `unsigned char` - - `LAS_property::Number_of_returns` with type `unsigned char` - - `LAS_property::Scan_direction_flag` with type `unsigned char` - - `LAS_property::Edge_of_flight_line` with type `unsigned char` - - `LAS_property::Classification` with type `unsigned char` - - `LAS_property::Synthetic_flag` with type `unsigned char` - - `LAS_property::Keypoint_flag` with type `unsigned char` - - `LAS_property::Withheld_flag` with type `unsigned char` - - `LAS_property::Scan_angle` with type `double` - - `LAS_property::User_data` with type `unsigned char` - - `LAS_property::Point_source_ID` with type `unsigned short` - - `LAS_property::Deleted_flag` with type `unsigned int` - - `LAS_property::GPS_time` with type `double` - - `LAS_property::R` with type `unsigned short` - - `LAS_property::G` with type `unsigned short` - - `LAS_property::B` with type `unsigned short` - - `LAS_property::I` with type `unsigned short` - - \attention To read a binary file, the flag `std::ios::binary` must be set during the creation of the `ifstream`. - - \tparam OutputIteratorValueType type of objects that can be put in `PointOutputIterator`. - It must be a model of `DefaultConstructible` and defaults to `value_type_traits::%type`. - It can be omitted if the default is fine. - \tparam PointOutputIterator iterator over output points. - \tparam PropertyHandler handlers to recover properties. - - \returns `true` if reading was successful, `false` otherwise. - - \sa `make_las_point_reader()` - - \sa \ref IOStreamLAS -*/ +// documenation in ../LAS.h template @@ -417,49 +347,13 @@ bool read_LAS_with_properties(std::istream& is, /// \endcond -/** - \ingroup PkgPointSetProcessing3IOLas - - \brief reads points (position only) using the \ref IOStreamLAS. - - Potential additional properties are ignored. - - \attention To read a binary file, the flag `std::ios::binary` must be set during the creation of the `ifstream`. - - \tparam OutputIteratorValueType type of objects that can be put in `PointOutputIterator`. - It must be a model of `DefaultConstructible` and defaults to `value_type_traits::%type`. - It can be omitted when the default is fine. - \tparam PointOutputIterator iterator over output points. - \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" - - \param is input stream - \param output output iterator over points - \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below - - \cgalNamedParamsBegin - \cgalParamNBegin{point_map} - \cgalParamDescription{a property map associating points to the elements of the point range} - \cgalParamType{a model of `WritablePropertyMap` with value type `geom_traits::Point_3`} - \cgalParamDefault{`CGAL::Identity_property_map`} - \cgalParamNEnd - - \cgalParamNBegin{geom_traits} - \cgalParamDescription{an instance of a geometric traits class} - \cgalParamType{a model of `Kernel`} - \cgalParamDefault{a \cgal Kernel deduced from the point type, using `CGAL::Kernel_traits`} - \cgalParamNEnd - \cgalNamedParamsEnd - - \returns `true` if reading was successful, `false` otherwise. - - \sa `read_LAS_with_properties()` -*/ +// documenation in ../LAS.h template + typename CGAL_NP_TEMPLATE_PARAMETERS_NO_DEFAULT> bool read_LAS(std::istream& is, PointOutputIterator output, - const CGAL_NP_CLASS& np = parameters::default_values()) + const CGAL_NP_CLASS& np) { using parameters::choose_parameter; using parameters::get_parameter; @@ -483,47 +377,13 @@ bool read_LAS(std::istream& is, OutputIterator output, const CGAL_NP_CLASS& np = /// \endcond -/** - \ingroup PkgPointSetProcessing3IOLas - - \brief reads points (position only) using the \ref IOStreamLAS. - - Potential additional properties are ignored. - - \tparam OutputIteratorValueType type of objects that can be put in `PointOutputIterator`. - It must be a model of `DefaultConstructible` and defaults to `value_type_traits::%type`. - It can be omitted when the default is fine. - \tparam PointOutputIterator iterator over output points. - \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" - - \param filename name of the input file - \param output output iterator over points - \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below - - \cgalNamedParamsBegin - \cgalParamNBegin{point_map} - \cgalParamDescription{a property map associating points to the elements of the point range} - \cgalParamType{a model of `WritablePropertyMap` with value type `geom_traits::Point_3`} - \cgalParamDefault{`CGAL::Identity_property_map`} - \cgalParamNEnd - - \cgalParamNBegin{geom_traits} - \cgalParamDescription{an instance of a geometric traits class} - \cgalParamType{a model of `Kernel`} - \cgalParamDefault{a \cgal Kernel deduced from the point type, using `CGAL::Kernel_traits`} - \cgalParamNEnd - \cgalNamedParamsEnd - - \returns `true` if reading was successful, `false` otherwise. - - \sa `read_LAS_with_properties()` -*/ +// documentation in ../LAS.h template + typename CGAL_NP_TEMPLATE_PARAMETERS_NO_DEFAULT> bool read_LAS(const std::string& filename, PointOutputIterator output, - const CGAL_NP_CLASS& np = parameters::default_values()) + const CGAL_NP_CLASS& np) { std::ifstream is(filename, std::ios::binary); CGAL::IO::set_mode(is, CGAL::IO::BINARY); diff --git a/Stream_support/include/CGAL/IO/LAS/write_las_points.h b/Stream_support/include/CGAL/IO/LAS/write_las_points.h index 9c89be56b1a..e3f8c9fcc3b 100644 --- a/Stream_support/include/CGAL/IO/LAS/write_las_points.h +++ b/Stream_support/include/CGAL/IO/LAS/write_las_points.h @@ -8,11 +8,12 @@ // // Author(s) : Simon Giraudot -#ifndef CGAL_POINT_SET_PROCESSING_WRITE_LAS_POINTS_H -#define CGAL_POINT_SET_PROCESSING_WRITE_LAS_POINTS_H +#ifndef CGAL_IO_LAS_WRITE_LAS_POINTS_H +#define CGAL_IO_LAS_WRITE_LAS_POINTS_H #include +#include #include #include #include @@ -384,4 +385,4 @@ bool write_LAS(const std::string& filename, } // namespace CGAL -#endif // CGAL_POINT_SET_PROCESSING_WRITE_LAS_POINTS_H +#endif // CGAL_IO_LAS_WRITE_LAS_POINTS_H diff --git a/Stream_support/include/CGAL/IO/read_las_points.h b/Stream_support/include/CGAL/IO/read_las_points.h index cc3a02348f2..0043d7ea269 100644 --- a/Stream_support/include/CGAL/IO/read_las_points.h +++ b/Stream_support/include/CGAL/IO/read_las_points.h @@ -8,5 +8,11 @@ // // Author(s) : Simon Giraudot -#include + +#ifndef CGAL_IO_READ_LAS_POINTS_H +#define CGAL_IO_READ_LAS_POINTS_H + +#include + +#endif // CGAL_IO_READ_LAS_POINTS_H diff --git a/Stream_support/include/CGAL/IO/write_las_points.h b/Stream_support/include/CGAL/IO/write_las_points.h index bed96fed95b..aad6f7090b8 100644 --- a/Stream_support/include/CGAL/IO/write_las_points.h +++ b/Stream_support/include/CGAL/IO/write_las_points.h @@ -9,4 +9,9 @@ // Author(s) : Simon Giraudot -#include +#ifndef CGAL_IO_WRITE_LAS_POINTS_H +#define CGAL_IO_WRITE_LAS_POINTS_H + +#include + +#endif // CGAL_IO_WRITE_LAS_POINTS_H From e70e2109f4db8fab2ad087743c9a39e081b4ac4a Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 30 Oct 2025 15:05:58 +0100 Subject: [PATCH 09/25] XYZ --- .../File_formats/Supported_file_formats.txt | 10 +- Stream_support/include/CGAL/IO/XYZ.h | 211 ++++++++++++++++++ .../include/CGAL/IO/XYZ/read_xyz_points.h | 89 +------- .../include/CGAL/IO/read_xyz_points.h | 8 +- .../include/CGAL/IO/write_xyz_points.h | 7 +- 5 files changed, 236 insertions(+), 89 deletions(-) create mode 100644 Stream_support/include/CGAL/IO/XYZ.h 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 165c589e139..209f3480a8b 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 @@ -17,7 +17,7 @@ each specific format. - \ref IOStreamGocad - \ref IOStream3MF - \ref IOStreamWRL -- \ref IOStreamLAS +- \ref IOStreamPkgStreamSupportIoFuncsLas - \ref IOStreamAvizo - \ref IOStreamMedit - \ref IOStreamTetgen @@ -298,7 +298,7 @@ A precise specification of those formats is available Any point range - \link PkgPointSetProcessing3IOLas CGAL::IO::read_LAS(const std::string&, PointRange&)\endlink + \link PkgStreamSupportIoFuncsLas CGAL::IO::read_LAS(const std::string&, PointRange&)\endlink Output @@ -308,7 +308,7 @@ A precise specification of those formats is available Any point range - \link PkgPointSetProcessing3IOLas CGAL::IO::write_LAS(const std::string&, const PointRange&)\endlink + \link PkgStreamSupportIoFuncsLas CGAL::IO::write_LAS(const std::string&, const PointRange&)\endlink @@ -331,7 +331,7 @@ of its coordinates and other properties. Only coordinates and normals are curren Any point range - \link PkgPointSetProcessing3IOXyz CGAL::IO::read_XYZ(const std::string&, PointRange&)\endlink + \link PkgStreamSupportIoFuncsIOXyz CGAL::IO::read_XYZ(const std::string&, PointRange&)\endlink Output @@ -341,7 +341,7 @@ of its coordinates and other properties. Only coordinates and normals are curren Any point range - \link PkgPointSetProcessing3IOXyz CGAL::IO::write_XYZ(const std::string&, const PointRange&)\endlink + \link PkgStreamSupportIoFuncsIOXyz CGAL::IO::write_XYZ(const std::string&, const PointRange&)\endlink diff --git a/Stream_support/include/CGAL/IO/XYZ.h b/Stream_support/include/CGAL/IO/XYZ.h new file mode 100644 index 00000000000..ed417bd459f --- /dev/null +++ b/Stream_support/include/CGAL/IO/XYZ.h @@ -0,0 +1,211 @@ +// Copyright (c) 2017 GeometryFactory +// +// This file is part of CGAL (www.cgal.org); +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// +// Author(s) : Simon Giraudot + +#ifndef CGAL_IO_LAS_H +#define CGAL_IO_LAS_H + +#include +#include + +#include +#include +#include +#include + +namespace CGAL { + +//////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////// +// Read + +namespace IO { + +/** + \ingroup PkgStreamSupportIoFuncsLAS + + generates a %LAS property handler to read 3D points. Points are + constructed from the input the using 3 %LAS properties + `LAS_property::X`, `LAS_property::Y` and `LAS_property::Z`. + + \tparam PointMap the property map used to store points. + + \sa `read_LAS_with_properties()` + \sa \ref IOStreamLAS +*/ +template +std::tuple::Kernel::Construct_point_3, + LAS_property::X, LAS_property::Y, LAS_property::Z > +make_las_point_reader(PointMap point_map); + + +/** + \ingroup PkgStreamSupportIoFuncsLAS + + \brief reads user-selected points properties from a .las or .laz stream. + Potential additional properties are ignored. + + Properties are handled through a variadic list of property + handlers. A `PropertyHandler` can either be: + + - A `std::pair` if the user wants to + read a %LAS property as a scalar value `LAS_property::Tag::type` (for + example, storing an `int` %LAS property into an `int` variable). + + - A `std::tuple` if the user wants to use one or several + %LAS properties to construct a complex object (for example, + storing 4 `unsigned short` %LAS properties into a %Color object + that can for example be a `std::array`). In that case, the second element of the tuple should be a + functor that constructs the value type of `PropertyMap` from N + objects of of type `LAS_property::Tag::type`. + + The %LAS standard defines a fixed set of properties accessible + through the following tag classes: + + - `LAS_property::X` with type `double` + - `LAS_property::Y` with type `double` + - `LAS_property::Z` with type `double` + - `LAS_property::Intensity` with type `unsigned short` + - `LAS_property::Return_number` with type `unsigned char` + - `LAS_property::Number_of_returns` with type `unsigned char` + - `LAS_property::Scan_direction_flag` with type `unsigned char` + - `LAS_property::Edge_of_flight_line` with type `unsigned char` + - `LAS_property::Classification` with type `unsigned char` + - `LAS_property::Synthetic_flag` with type `unsigned char` + - `LAS_property::Keypoint_flag` with type `unsigned char` + - `LAS_property::Withheld_flag` with type `unsigned char` + - `LAS_property::Scan_angle` with type `double` + - `LAS_property::User_data` with type `unsigned char` + - `LAS_property::Point_source_ID` with type `unsigned short` + - `LAS_property::Deleted_flag` with type `unsigned int` + - `LAS_property::GPS_time` with type `double` + - `LAS_property::R` with type `unsigned short` + - `LAS_property::G` with type `unsigned short` + - `LAS_property::B` with type `unsigned short` + - `LAS_property::I` with type `unsigned short` + + \attention To read a binary file, the flag `std::ios::binary` must be set during the creation of the `ifstream`. + + \tparam OutputIteratorValueType type of objects that can be put in `PointOutputIterator`. + It must be a model of `DefaultConstructible` and defaults to `value_type_traits::%type`. + It can be omitted if the default is fine. + \tparam PointOutputIterator iterator over output points. + \tparam PropertyHandler handlers to recover properties. + + \returns `true` if reading was successful, `false` otherwise. + + \sa `make_las_point_reader()` + + \sa \ref IOStreamLAS +*/ +template +bool read_LAS_with_properties(std::istream& is, + PointOutputIterator output, + PropertyHandler&& ... properties); + + + +/** + \ingroup PkgStreamSupportIoFuncsLAS + + \brief reads points (position only) using the \ref IOStreamLAS. + + Potential additional properties are ignored. + + \attention To read a binary file, the flag `std::ios::binary` must be set during the creation of the `ifstream`. + + \tparam OutputIteratorValueType type of objects that can be put in `PointOutputIterator`. + It must be a model of `DefaultConstructible` and defaults to `value_type_traits::%type`. + It can be omitted when the default is fine. + \tparam PointOutputIterator iterator over output points. + \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + + \param is input stream + \param output output iterator over points + \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below + + \cgalNamedParamsBegin + \cgalParamNBegin{point_map} + \cgalParamDescription{a property map associating points to the elements of the point range} + \cgalParamType{a model of `WritablePropertyMap` with value type `geom_traits::Point_3`} + \cgalParamDefault{`CGAL::Identity_property_map`} + \cgalParamNEnd + + \cgalParamNBegin{geom_traits} + \cgalParamDescription{an instance of a geometric traits class} + \cgalParamType{a model of `Kernel`} + \cgalParamDefault{a \cgal Kernel deduced from the point type, using `CGAL::Kernel_traits`} + \cgalParamNEnd + \cgalNamedParamsEnd + + \returns `true` if reading was successful, `false` otherwise. + + \sa `read_LAS_with_properties()` +*/ +template +bool read_LAS(std::istream& is, + PointOutputIterator output, + const CGAL_NP_CLASS& np = parameters::default_values()); + + + + +/** + \ingroup PkgStreamSupportIoFuncsLAS + + \brief reads points (position only) using the \ref IOStreamLAS. + + Potential additional properties are ignored. + + \tparam OutputIteratorValueType type of objects that can be put in `PointOutputIterator`. + It must be a model of `DefaultConstructible` and defaults to `value_type_traits::%type`. + It can be omitted when the default is fine. + \tparam PointOutputIterator iterator over output points. + \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + + \param filename name of the input file + \param output output iterator over points + \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below + + \cgalNamedParamsBegin + \cgalParamNBegin{point_map} + \cgalParamDescription{a property map associating points to the elements of the point range} + \cgalParamType{a model of `WritablePropertyMap` with value type `geom_traits::Point_3`} + \cgalParamDefault{`CGAL::Identity_property_map`} + \cgalParamNEnd + + \cgalParamNBegin{geom_traits} + \cgalParamDescription{an instance of a geometric traits class} + \cgalParamType{a model of `Kernel`} + \cgalParamDefault{a \cgal Kernel deduced from the point type, using `CGAL::Kernel_traits`} + \cgalParamNEnd + \cgalNamedParamsEnd + + \returns `true` if reading was successful, `false` otherwise. + + \sa `read_LAS_with_properties()` +*/ +template +bool read_LAS(const std::string& filename, + PointOutputIterator output, + const CGAL_NP_CLASS& np = parameters::default_values()); +} // namespace IO + +} // namespace CGAL + +#endif // CGAL_IO_LAS_H diff --git a/Stream_support/include/CGAL/IO/XYZ/read_xyz_points.h b/Stream_support/include/CGAL/IO/XYZ/read_xyz_points.h index aefe76f7d6e..4bb3e417372 100644 --- a/Stream_support/include/CGAL/IO/XYZ/read_xyz_points.h +++ b/Stream_support/include/CGAL/IO/XYZ/read_xyz_points.h @@ -16,6 +16,7 @@ #ifndef CGAL_IO_PLY_READ_XYZ_POINTS_H #define CGAL_IO_PLY_READ_XYZ_POINTS_H +#include #include #include #include @@ -34,51 +35,13 @@ namespace CGAL { namespace IO { -/** - \ingroup PkgPointSetProcessing3IOXyz - - \brief reads points (positions + normals, if available), using the \ref IOStreamXYZ. - - \tparam OutputIteratorValueType type of objects that can be put in `OutputIterator`. - It must be a model of `DefaultConstructible` and defaults to `value_type_traits::%type`. - It can be omitted when the default is fine. - \tparam OutputIterator iterator over output points. - \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" - - \param is input stream. - \param output output iterator over points. - \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below - - \cgalNamedParamsBegin - \cgalParamNBegin{point_map} - \cgalParamDescription{a property map associating points to the elements of the point range} - \cgalParamType{a model of `WritablePropertyMap` with value type `geom_traits::Point_3`} - \cgalParamDefault{`CGAL::Identity_property_map`} - \cgalParamNEnd - - \cgalParamNBegin{normal_map} - \cgalParamDescription{a property map associating normals to the elements of the point range} - \cgalParamType{a model of `WritablePropertyMap` with value type `geom_traits::Vector_3`} - \cgalParamDefault{If this parameter is omitted, normals in the input stream are ignored.} - \cgalParamNEnd - - \cgalParamNBegin{geom_traits} - \cgalParamDescription{an instance of a geometric traits class} - \cgalParamType{a model of `Kernel`} - \cgalParamDefault{a \cgal Kernel deduced from the point type, using `CGAL::Kernel_traits`} - \cgalParamNEnd - \cgalNamedParamsEnd - - \returns `true` if reading was successful, `false` otherwise. - - \sa \ref IOStreamXYZ -*/ +// doxygen in ../XYZ.h template + typename CGAL_NP_TEMPLATE_PARAMETERS_NO_DEFAULT> bool read_XYZ(std::istream& is, OutputIterator output, - const CGAL_NP_CLASS& np = parameters::default_values()) + const CGAL_NP_CLASS& np) { using parameters::choose_parameter; using parameters::get_parameter; @@ -180,51 +143,13 @@ bool read_XYZ(std::istream& is, return true; } -/** - \ingroup PkgPointSetProcessing3IOXyz - - \brief reads points (positions + normals, if available), using the \ref IOStreamXYZ. - - \tparam OutputIteratorValueType type of objects that can be put in `OutputIterator`. - It must be a model of `DefaultConstructible` and defaults to `value_type_traits::%type`. - It can be omitted when the default is fine. - \tparam OutputIterator iterator over output points. - \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" - - \param fname input file name. - \param output output iterator over points. - \param np optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below. - - \cgalNamedParamsBegin - \cgalParamNBegin{point_map} - \cgalParamDescription{a property map associating points to the elements of the point range} - \cgalParamType{a model of `WritablePropertyMap` with value type `geom_traits::Point_3`} - \cgalParamDefault{`CGAL::Identity_property_map`} - \cgalParamNEnd - - \cgalParamNBegin{normal_map} - \cgalParamDescription{a property map associating normals to the elements of the point range} - \cgalParamType{a model of `WritablePropertyMap` with value type `geom_traits::Vector_3`} - \cgalParamDefault{If this parameter is omitted, normals in the input stream are ignored.} - \cgalParamNEnd - - \cgalParamNBegin{geom_traits} - \cgalParamDescription{an instance of a geometric traits class} - \cgalParamType{a model of `Kernel`} - \cgalParamDefault{a \cgal Kernel deduced from the point type, using `CGAL::Kernel_traits`} - \cgalParamNEnd - \cgalNamedParamsEnd - - \returns `true` if reading was successful, `false` otherwise. - - \sa \ref IOStreamXYZ -*/ +// documentation in ../XYZ.h template + typename CGAL_NP_TEMPLATE_PARAMETERS_NO_DEFAULT> bool read_XYZ(const std::string& fname, OutputIterator output, - const CGAL_NP_CLASS& np = parameters::default_values()) + const CGAL_NP_CLASS& np) { std::ifstream is(fname); return read_XYZ(is, output, np); diff --git a/Stream_support/include/CGAL/IO/read_xyz_points.h b/Stream_support/include/CGAL/IO/read_xyz_points.h index 574f74c5efc..200c738de91 100644 --- a/Stream_support/include/CGAL/IO/read_xyz_points.h +++ b/Stream_support/include/CGAL/IO/read_xyz_points.h @@ -8,5 +8,11 @@ // // Author(s) : Simon Giraudot -#include + +#ifndef CGAL_IO_READ_XYZ_POINTS_H +#define CGAL_IO_READ_XYZ_POINTS_H + +#include + +#endif // CGAL_IO_READ_XYZ_POINTS_H diff --git a/Stream_support/include/CGAL/IO/write_xyz_points.h b/Stream_support/include/CGAL/IO/write_xyz_points.h index b042e572a82..9884f00f833 100644 --- a/Stream_support/include/CGAL/IO/write_xyz_points.h +++ b/Stream_support/include/CGAL/IO/write_xyz_points.h @@ -9,4 +9,9 @@ // Author(s) : Simon Giraudot -#include +#ifndef CGAL_IO_WRITE_XYZ_POINTS_H +#define CGAL_IO_WRITE_XYZ_POINTS_H + +#include + +#endif // CGAL_IO_WRITE_XYZ_POINTS_H From 25060734a083d63fb48ec7bb7958956cc92c7a00 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 30 Oct 2025 17:46:45 +0100 Subject: [PATCH 10/25] forward declarations must come first --- .../Classification/example_classification.cpp | 2 +- .../orient_scanlines_example.cpp | 3 +- .../read_ply_points_with_colors_example.cpp | 2 +- .../write_ply_points_example.cpp | 2 +- .../File_formats/Supported_file_formats.txt | 4 +- Stream_support/include/CGAL/IO/LAS.h | 20 +- .../include/CGAL/IO/LAS/Las_property.h | 94 +++++ .../include/CGAL/IO/LAS/read_las_points.h | 73 +--- .../include/CGAL/IO/LAS/write_las_points.h | 2 +- Stream_support/include/CGAL/IO/PLY.h | 367 +++++++++++++++++- .../include/CGAL/IO/PLY/PLY_reader.h | 1 + .../include/CGAL/IO/PLY/read_ply_points.h | 151 +------ .../include/CGAL/IO/PLY/write_ply_points.h | 137 +------ Stream_support/include/CGAL/IO/XYZ.h | 171 +++----- .../include/CGAL/IO/XYZ/read_xyz_points.h | 2 +- .../include/CGAL/IO/read_ply_points.h | 6 +- 16 files changed, 549 insertions(+), 488 deletions(-) create mode 100644 Stream_support/include/CGAL/IO/LAS/Las_property.h diff --git a/Classification/examples/Classification/example_classification.cpp b/Classification/examples/Classification/example_classification.cpp index 2926a11fb85..b25e8c83bf5 100644 --- a/Classification/examples/Classification/example_classification.cpp +++ b/Classification/examples/Classification/example_classification.cpp @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include 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 206783c50b9..2be25070f65 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 @@ -1,6 +1,7 @@ #include #include -#include +#include +#include #include #include 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 e96f07a547b..ce135038ad5 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 @@ -1,7 +1,7 @@ #include #include -#include +#include #include #include 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 13e7af3c633..69e5a8a2f97 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 @@ -1,7 +1,7 @@ #include #include -#include +#include #include #include 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 209f3480a8b..6bdd298b6bc 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 @@ -239,7 +239,7 @@ A precise specification of those formats is available Any point range - \link PkgPointSetProcessing3IOPly CGAL::IO::write_PLY(const std::string&, const PointRange&)\endlink + \link PkgStreamSupportIoFuncsPLY CGAL::IO::write_PLY(const std::string&, const PointRange&)\endlink Polygon Soup diff --git a/Stream_support/include/CGAL/IO/LAS.h b/Stream_support/include/CGAL/IO/LAS.h index ed417bd459f..65fea06a7b1 100644 --- a/Stream_support/include/CGAL/IO/LAS.h +++ b/Stream_support/include/CGAL/IO/LAS.h @@ -11,13 +11,14 @@ #ifndef CGAL_IO_LAS_H #define CGAL_IO_LAS_H -#include -#include - #include #include #include #include +#include +#include +#include +#include namespace CGAL { @@ -28,7 +29,7 @@ namespace CGAL { namespace IO { /** - \ingroup PkgStreamSupportIoFuncsLAS + \ingroup PkgStreamSupportIoFuncsLas generates a %LAS property handler to read 3D points. Points are constructed from the input the using 3 %LAS properties @@ -47,7 +48,7 @@ make_las_point_reader(PointMap point_map); /** - \ingroup PkgStreamSupportIoFuncsLAS + \ingroup PkgStreamSupportIoFuncsLas \brief reads user-selected points properties from a .las or .laz stream. Potential additional properties are ignored. @@ -117,7 +118,7 @@ bool read_LAS_with_properties(std::istream& is, /** - \ingroup PkgStreamSupportIoFuncsLAS + \ingroup PkgStreamSupportIoFuncsLas \brief reads points (position only) using the \ref IOStreamLAS. @@ -164,7 +165,7 @@ bool read_LAS(std::istream& is, /** - \ingroup PkgStreamSupportIoFuncsLAS + \ingroup PkgStreamSupportIoFuncsLas \brief reads points (position only) using the \ref IOStreamLAS. @@ -208,4 +209,9 @@ bool read_LAS(const std::string& filename, } // namespace CGAL + +#include +#include + + #endif // CGAL_IO_LAS_H diff --git a/Stream_support/include/CGAL/IO/LAS/Las_property.h b/Stream_support/include/CGAL/IO/LAS/Las_property.h new file mode 100644 index 00000000000..0c0555ce066 --- /dev/null +++ b/Stream_support/include/CGAL/IO/LAS/Las_property.h @@ -0,0 +1,94 @@ +// Copyright (c) 2017 GeometryFactory +// +// This file is part of CGAL (www.cgal.org); +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// +// Author(s) : Simon Giraudot + +#ifndef CGAL_IO_LAS_LAS_PROPERTY_H +#define CGAL_IO_LAS_LAS_PROPERTY_H + +namespace CGAL { + namespace IO { + +/// \cond SKIP_IN_MANUAL +namespace LAS_property { +namespace Id { + +enum Id +{ + X, + Y, + Z, + Intensity, + Return_number, + Number_of_returns, + Scan_direction_flag, + Edge_of_flight_line, + Classification, + Synthetic_flag, + Keypoint_flag, + Withheld_flag, + Scan_angle, + User_data, + Point_source_ID, + Deleted_flag, + GPS_time, + R, + G, + B, + I +}; + +} // namespace Id + +template +struct Base +{ + typedef T type; +}; + +typedef Base X; +typedef Base Y; +typedef Base Z; +typedef Base Intensity; +typedef Base Return_number; +typedef Base Number_of_returns; +typedef Base Scan_direction_flag; +typedef Base Edge_of_flight_line; +typedef Base Classification; +typedef Base Synthetic_flag; +typedef Base Keypoint_flag; +typedef Base Withheld_flag; +typedef Base Scan_angle; +typedef Base User_data; +typedef Base Point_source_ID; +typedef Base Deleted_flag; +typedef Base GPS_time; +typedef Base R; +typedef Base G; +typedef Base B; +typedef Base I; +} // namespace LAS_property +/// \endcond + +// documenation in ../LAS.h +template +std::tuple::Kernel::Construct_point_3, + LAS_property::X, LAS_property::Y, LAS_property::Z > +make_las_point_reader(PointMap point_map) +{ + return std::make_tuple (point_map, typename Kernel_traits::Kernel::Construct_point_3(), + LAS_property::X(), LAS_property::Y(), LAS_property::Z()); +} + +/// \cond SKIP_IN_MANUAL + +} // namespace IO +} // namespace CGAL + +#endif diff --git a/Stream_support/include/CGAL/IO/LAS/read_las_points.h b/Stream_support/include/CGAL/IO/LAS/read_las_points.h index b588f66fa68..84f0fbea0e5 100644 --- a/Stream_support/include/CGAL/IO/LAS/read_las_points.h +++ b/Stream_support/include/CGAL/IO/LAS/read_las_points.h @@ -13,6 +13,7 @@ #include +#include #include #include #include @@ -57,79 +58,7 @@ namespace CGAL { namespace IO { -/// \cond SKIP_IN_MANUAL -namespace LAS_property { -namespace Id { -enum Id -{ - X, - Y, - Z, - Intensity, - Return_number, - Number_of_returns, - Scan_direction_flag, - Edge_of_flight_line, - Classification, - Synthetic_flag, - Keypoint_flag, - Withheld_flag, - Scan_angle, - User_data, - Point_source_ID, - Deleted_flag, - GPS_time, - R, - G, - B, - I -}; - -} // namespace Id - -template -struct Base -{ - typedef T type; -}; - -typedef Base X; -typedef Base Y; -typedef Base Z; -typedef Base Intensity; -typedef Base Return_number; -typedef Base Number_of_returns; -typedef Base Scan_direction_flag; -typedef Base Edge_of_flight_line; -typedef Base Classification; -typedef Base Synthetic_flag; -typedef Base Keypoint_flag; -typedef Base Withheld_flag; -typedef Base Scan_angle; -typedef Base User_data; -typedef Base Point_source_ID; -typedef Base Deleted_flag; -typedef Base GPS_time; -typedef Base R; -typedef Base G; -typedef Base B; -typedef Base I; -} -/// \endcond - -// documenation in ../LAS.h -template -std::tuple::Kernel::Construct_point_3, - LAS_property::X, LAS_property::Y, LAS_property::Z > -make_las_point_reader(PointMap point_map) -{ - return std::make_tuple (point_map, typename Kernel_traits::Kernel::Construct_point_3(), - LAS_property::X(), LAS_property::Y(), LAS_property::Z()); -} - -/// \cond SKIP_IN_MANUAL namespace internal { diff --git a/Stream_support/include/CGAL/IO/LAS/write_las_points.h b/Stream_support/include/CGAL/IO/LAS/write_las_points.h index e3f8c9fcc3b..fee94156c5a 100644 --- a/Stream_support/include/CGAL/IO/LAS/write_las_points.h +++ b/Stream_support/include/CGAL/IO/LAS/write_las_points.h @@ -12,7 +12,7 @@ #define CGAL_IO_LAS_WRITE_LAS_POINTS_H #include - +#include #include #include #include diff --git a/Stream_support/include/CGAL/IO/PLY.h b/Stream_support/include/CGAL/IO/PLY.h index 7f72b37a3f5..510c1fa469c 100644 --- a/Stream_support/include/CGAL/IO/PLY.h +++ b/Stream_support/include/CGAL/IO/PLY.h @@ -14,6 +14,7 @@ #include #include + #include #include @@ -512,7 +513,7 @@ bool write_PLY(const std::string& fname, const CGAL_NP_CLASS& np = parameters::default_values() #ifndef DOXYGEN_RUNNING , std::enable_if_t::value>* = nullptr -#endif +#endif // DOXYGEN_RUNNING ) { const bool binary = CGAL::parameters::choose_parameter(CGAL::parameters::get_parameter(np, internal_np::use_binary_mode), true); @@ -530,8 +531,372 @@ bool write_PLY(const std::string& fname, } } + + +#ifdef DOXYGEN_RUNNING +/** + \ingroup PkgStreamSupportIoFuncsPLY + + Class used to identify a %PLY property as a type and a name. + + \sa `read_PLY_with_properties()` +*/ +template +struct PLY_property +{ + typedef T type; + const char* name; + PLY_property(const char* name) : name(name) { } +}; + +/** + \ingroup PkgStreamSupportIoFuncsPLY + + Generates a %PLY property handler to read 3D points. Points are + constructed from the input using 3 %PLY properties of type `FT` + and named `x`, `y` and `z`. `FT` is `float` if the points use + `CGAL::Simple_cartesian` and `double` otherwise. + + \tparam PointMap the property map used to store points. + + \sa `read_PLY_with_properties()` + \sa \ref IOStreamPLY +*/ +template +std::tuple::Kernel::Construct_point_3, + PLY_property, PLY_property, PLY_property > +make_ply_point_reader(PointMap point_map); + +/** + \ingroup PkgStreamSupportIoFuncsPLY + + Generates a %PLY property handler to read 3D normal + vectors. Vectors are constructed from the input using 3 PLY + properties of type `FT` and named `nx`, `ny` and `nz`. `FT` + is `float` if the points use `CGAL::Simple_cartesian` and + `double` otherwise. + + \tparam VectorMap the property map used to store vectors. + + \sa `read_PLY_with_properties()` + \sa \ref IOStreamPLY +*/ +template +std::tuple::Kernel::Construct_vector_3, + PLY_property, PLY_property, PLY_property > +make_ply_normal_reader(VectorMap normal_map); + +#endif // DOXYGEN_RUNNING + +/** + \ingroup PkgStreamSupportIoFuncsPLY + + \brief reads user-selected points properties from a .ply stream (ASCII or binary). + + Potential additional point properties and faces are ignored. + + Properties are handled through a variadic list of property + handlers. A `PropertyHandler` can either be: + + - A `std::pair >` if the user wants + to read a %PLY property as a scalar value T (for example, storing + an `int` %PLY property into an `int` variable). + + - A `std::tuple...>` if the user wants to use one or several PLY + properties to construct a complex object (for example, storing 3 + `uchar` %PLY properties into a %Color object that can for example + be a `std::array`). In that case, the + second element of the tuple should be a functor that constructs + the value type of `PropertyMap` from N objects of types `T`. + + \attention To read a binary file, the flag `std::ios::binary` must be set during the creation of the `ifstream`. + + \tparam OutputIteratorValueType type of objects that can be put in `PointOutputIterator`. + It must be a model of `DefaultConstructible` and defaults to `value_type_traits::%type`. + It can be omitted when the default is fine. + \tparam PointOutputIterator iterator over output points. + \tparam PropertyHandler handlers to recover properties. + + \returns `true` if reading was successful, `false` otherwise. + + \sa \ref IOStreamPLY + \sa `make_ply_point_reader()` + \sa `make_ply_normal_reader()` +*/ +template +bool read_PLY_with_properties(std::istream& is, + PointOutputIterator output, + PropertyHandler&& ... properties); + + + +/** + \ingroup PkgStreamSupportIoFuncsPLY + + \brief reads points (positions + normals, if available), using the \ref IOStreamPLY. + + Potential additional point properties and faces are ignored. + + \tparam OutputIteratorValueType type of objects that can be put in `PointOutputIterator`. + It must be a model of `DefaultConstructible` and defaults to `value_type_traits::%type`. + It can be omitted when the default is fine. + \tparam PointOutputIterator iterator over output points. + \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + + \param fname input file name. + \param output output iterator over points. + \param np optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below. + + \cgalNamedParamsBegin + \cgalParamNBegin{use_binary_mode} + \cgalParamDescription{indicates whether data should be read in binary (`true`) or in \ascii (`false`)} + \cgalParamType{Boolean} + \cgalParamDefault{`true`} + \cgalParamNEnd + + \cgalParamNBegin{point_map} + \cgalParamDescription{a property map associating points to the elements of the point range} + \cgalParamType{a model of `WritablePropertyMap` with value type `geom_traits::Point_3`} + \cgalParamDefault{`CGAL::Identity_property_map`} + \cgalParamNEnd + + \cgalParamNBegin{normal_map} + \cgalParamDescription{a property map associating normals to the elements of the point range} + \cgalParamType{a model of `WritablePropertyMap` with value type `geom_traits::Vector_3`} + \cgalParamDefault{If this parameter is omitted, normals in the input stream are ignored.} + \cgalParamNEnd + + \cgalParamNBegin{geom_traits} + \cgalParamDescription{an instance of a geometric traits class} + \cgalParamType{a model of `Kernel`} + \cgalParamDefault{a \cgal Kernel deduced from the point type, using `CGAL::Kernel_traits`} + \cgalParamNEnd + \cgalNamedParamsEnd + + \returns `true` if reading was successful, `false` otherwise. + + \sa \ref IOStreamPLY + \sa `read_PLY_with_properties()` +*/ +template +bool read_PLY(const std::string& fname, + PointOutputIterator output, + const CGAL_NP_CLASS& np = parameters::default_values() + #ifndef DOXYGEN_RUNNING + , std::enable_if_t::value>* = nullptr + #endif + ); + + + +#ifdef DOXYGEN_RUNNING // Document some parts from Stream_support here for convenience + /** + \ingroup PkgStreamSupportIoFuncsPLY + + Generates a %PLY property handler to write 3D points. Points are + written as 3 %PLY properties of type `FT` and named `x`, `y` and + `z`. `FT` is `float` if the points use + `CGAL::Simple_cartesian` and `double` otherwise. + + \tparam PointMap the property map used to store points. + + \sa `write_PLY_with_properties()` + \sa \ref IOStreamPLY + */ + template + std::tuple, PLY_property, PLY_property > + make_ply_point_writer(PointMap point_map); + + /** + \ingroup PkgStreamSupportIoFuncsPLY + + Generates a %PLY property handler to write 3D normal + vectors. Vectors are written as 3 %PLY properties of type `FT` + and named `nx`, `ny` and `nz`. `FT` is `float` if the vectors use + `CGAL::Simple_cartesian` and `double` otherwise. + + \tparam VectorMap the property map used to store vectors. + + \sa `write_PLY_with_properties()` + \sa \ref IOStreamPLY + */ + template + std::tuple, PLY_property, PLY_property > + make_ply_normal_writer(VectorMap normal_map); +#endif + + +/** + \ingroup PkgStreamSupportIoFuncsPLY + + \brief writes the range of `points` with properties using \ref IOStreamPLY. + + Properties are handled through a variadic list of property + handlers. A `PropertyHandler` can either be: + + - A `std::pair >` if the user wants + to write a scalar value T as a %PLY property (for example, writing + an `int` variable as an `int` %PLY property). + + - A `std::tuple...>` if the + 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::IO::get_mode()`). + + \attention To write to a binary file, the flag `std::ios::binary` must be set during the creation + of the `ofstream`, and the \link PkgStreamSupportEnumRef `IO::Mode` \endlink + of the stream must be set to `BINARY`. + + \tparam PointRange is a model of `ConstRange`. The value type of + its iterator is the key type of the `PropertyMap` objects provided + within the `PropertyHandler` parameter. + \tparam PropertyHandler handlers to recover properties. + + \returns `true` if writing was successful, `false` otherwise. + + \sa \ref IOStreamPLY + \sa `make_ply_point_writer()` + \sa `make_ply_normal_writer()` +*/ +template + bool write_PLY_with_properties(std::ostream& os, ///< output stream. + const PointRange& points, ///< input point range. + PropertyHandler&& ... properties); ///< parameter pack of property handlers + + + +/** + \ingroup PkgStreamSupportIoFuncsPLY + + \brief writes the range of `points` (positions + normals, if available) using \ref IOStreamPLY. + + \attention To write to a binary file, the flag `std::ios::binary` must be set during the creation + of the `ofstream`, and the \link PkgStreamSupportEnumRef `IO::Mode` \endlink + of the stream must be set to `BINARY`. + + \tparam PointRange is a model of `ConstRange`. The value type of + its iterator is the key type of the named parameter `point_map`. + \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + + \param os output stream + \param points input point range + \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below + + \cgalNamedParamsBegin + \cgalParamNBegin{point_map} + \cgalParamDescription{a property map associating points to the elements of the point range} + \cgalParamType{a model of `ReadablePropertyMap` with value type `geom_traits::Point_3`} + \cgalParamDefault{`CGAL::Identity_property_map`} + \cgalParamNEnd + + \cgalParamNBegin{normal_map} + \cgalParamDescription{a property map associating normals to the elements of the point range} + \cgalParamType{a model of `ReadablePropertyMap` with value type `geom_traits::Vector_3`} + \cgalParamDefault{If this parameter is omitted, normals are not written in the output stream.} + \cgalParamNEnd + + \cgalParamNBegin{geom_traits} + \cgalParamDescription{an instance of a geometric traits class} + \cgalParamType{a model of `Kernel`} + \cgalParamDefault{a \cgal Kernel deduced from the point type, using `CGAL::Kernel_traits`} + \cgalParamNEnd + + \cgalParamNBegin{stream_precision} + \cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream} + \cgalParamType{int} + \cgalParamDefault{the precision of the stream `os`} + \cgalParamExtra{This parameter is only meaningful while using \ascii encoding.} + \cgalParamNEnd + \cgalNamedParamsEnd + + \returns `true` if writing was successful, `false` otherwise. + + \sa `write_PLY_with_properties()` +*/ +template +bool write_PLY(std::ostream& os, + const PointRange& points, + const CGAL_NP_CLASS& np = parameters::default_values() +#ifndef DOXYGEN_RUNNING + , std::enable_if_t::value>* = nullptr +#endif + ); + + +/** + \ingroup PkgStreamSupportIoFuncsPLY + + \brief writes the range of `points` (positions + normals, if available) using \ref IOStreamPLY. + + \tparam PointRange is a model of `ConstRange`. The value type of + its iterator is the key type of the named parameter `point_map`. + \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + + \param filename the path to the output file + \param points input point range + \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below + + \cgalNamedParamsBegin + \cgalParamNBegin{use_binary_mode} + \cgalParamDescription{indicates whether data should be written in binary (`true`) or in \ascii (`false`)} + \cgalParamType{Boolean} + \cgalParamDefault{`true`} + \cgalParamNEnd + + \cgalParamNBegin{point_map} + \cgalParamDescription{a property map associating points to the elements of the point range} + \cgalParamType{a model of `ReadablePropertyMap` with value type `geom_traits::Point_3`} + \cgalParamDefault{`CGAL::Identity_property_map`} + \cgalParamNEnd + + \cgalParamNBegin{normal_map} + \cgalParamDescription{a property map associating normals to the elements of the point range} + \cgalParamType{a model of `ReadablePropertyMap` with value type `geom_traits::Vector_3`} + \cgalParamDefault{If this parameter is omitted, normals are not written in the output file.} + \cgalParamNEnd + + \cgalParamNBegin{geom_traits} + \cgalParamDescription{an instance of a geometric traits class} + \cgalParamType{a model of `Kernel`} + \cgalParamDefault{a \cgal Kernel deduced from the point type, using `CGAL::Kernel_traits`} + \cgalParamNEnd + + \cgalParamNBegin{stream_precision} + \cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream} + \cgalParamType{int} + \cgalParamDefault{`6`} + \cgalParamExtra{This parameter is only meaningful while using \ascii encoding.} + \cgalParamNEnd + \cgalNamedParamsEnd + + \returns `true` if writing was successful, `false` otherwise. + + \sa `write_PLY_with_properties()` +*/ +template +bool write_PLY(const std::string& filename, + const PointRange& points, + const CGAL_NP_CLASS& np = parameters::default_values() +#ifndef DOXYGEN_RUNNING + , std::enable_if_t::value>* = nullptr +#endif + ); + } // namespace IO } // namespace CGAL +#include +#include + + #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 c35bc6d4141..2e9962d086b 100644 --- a/Stream_support/include/CGAL/IO/PLY/PLY_reader.h +++ b/Stream_support/include/CGAL/IO/PLY/PLY_reader.h @@ -11,6 +11,7 @@ #ifndef CGAL_IO_PLY_PLY_READER_H #define CGAL_IO_PLY_PLY_READER_H +#include #include #include #include diff --git a/Stream_support/include/CGAL/IO/PLY/read_ply_points.h b/Stream_support/include/CGAL/IO/PLY/read_ply_points.h index 5f204a50400..f9c6f7c0697 100644 --- a/Stream_support/include/CGAL/IO/PLY/read_ply_points.h +++ b/Stream_support/include/CGAL/IO/PLY/read_ply_points.h @@ -36,99 +36,7 @@ namespace CGAL { namespace IO { -#ifdef DOXYGEN_RUNNING // Document some parts from Stream_support here for convenience -/** - \ingroup PkgPointSetProcessing3IOPly - - Class used to identify a %PLY property as a type and a name. - - \sa `read_PLY_with_properties()` -*/ -template -struct PLY_property -{ - typedef T type; - const char* name; - PLY_property(const char* name) : name(name) { } -}; - -/** - \ingroup PkgPointSetProcessing3IOPly - - Generates a %PLY property handler to read 3D points. Points are - constructed from the input using 3 %PLY properties of type `FT` - and named `x`, `y` and `z`. `FT` is `float` if the points use - `CGAL::Simple_cartesian` and `double` otherwise. - - \tparam PointMap the property map used to store points. - - \sa `read_PLY_with_properties()` - \sa \ref IOStreamPLY -*/ -template -std::tuple::Kernel::Construct_point_3, - PLY_property, PLY_property, PLY_property > -make_ply_point_reader(PointMap point_map); - -/** - \ingroup PkgPointSetProcessing3IOPly - - Generates a %PLY property handler to read 3D normal - vectors. Vectors are constructed from the input using 3 PLY - properties of type `FT` and named `nx`, `ny` and `nz`. `FT` - is `float` if the points use `CGAL::Simple_cartesian` and - `double` otherwise. - - \tparam VectorMap the property map used to store vectors. - - \sa `read_PLY_with_properties()` - \sa \ref IOStreamPLY -*/ -template -std::tuple::Kernel::Construct_vector_3, - PLY_property, PLY_property, PLY_property > -make_ply_normal_reader(VectorMap normal_map); - -#endif // DOXYGEN_RUNNING - -/** - \ingroup PkgPointSetProcessing3IOPly - - \brief reads user-selected points properties from a .ply stream (ASCII or binary). - - Potential additional point properties and faces are ignored. - - Properties are handled through a variadic list of property - handlers. A `PropertyHandler` can either be: - - - A `std::pair >` if the user wants - to read a %PLY property as a scalar value T (for example, storing - an `int` %PLY property into an `int` variable). - - - A `std::tuple...>` if the user wants to use one or several PLY - properties to construct a complex object (for example, storing 3 - `uchar` %PLY properties into a %Color object that can for example - be a `std::array`). In that case, the - second element of the tuple should be a functor that constructs - the value type of `PropertyMap` from N objects of types `T`. - - \attention To read a binary file, the flag `std::ios::binary` must be set during the creation of the `ifstream`. - - \tparam OutputIteratorValueType type of objects that can be put in `PointOutputIterator`. - It must be a model of `DefaultConstructible` and defaults to `value_type_traits::%type`. - It can be omitted when the default is fine. - \tparam PointOutputIterator iterator over output points. - \tparam PropertyHandler handlers to recover properties. - - \returns `true` if reading was successful, `false` otherwise. - - \sa \ref IOStreamPLY - \sa `make_ply_point_reader()` - \sa `make_ply_normal_reader()` -*/ +// documentation in ../PLY.h template @@ -261,63 +169,14 @@ bool read_PLY(std::istream& is, make_ply_normal_reader(normal_map)); } -/** - \ingroup PkgPointSetProcessing3IOPly - - \brief reads points (positions + normals, if available), using the \ref IOStreamPLY. - - Potential additional point properties and faces are ignored. - - \tparam OutputIteratorValueType type of objects that can be put in `PointOutputIterator`. - It must be a model of `DefaultConstructible` and defaults to `value_type_traits::%type`. - It can be omitted when the default is fine. - \tparam PointOutputIterator iterator over output points. - \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" - - \param fname input file name. - \param output output iterator over points. - \param np optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below. - - \cgalNamedParamsBegin - \cgalParamNBegin{use_binary_mode} - \cgalParamDescription{indicates whether data should be read in binary (`true`) or in \ascii (`false`)} - \cgalParamType{Boolean} - \cgalParamDefault{`true`} - \cgalParamNEnd - - \cgalParamNBegin{point_map} - \cgalParamDescription{a property map associating points to the elements of the point range} - \cgalParamType{a model of `WritablePropertyMap` with value type `geom_traits::Point_3`} - \cgalParamDefault{`CGAL::Identity_property_map`} - \cgalParamNEnd - - \cgalParamNBegin{normal_map} - \cgalParamDescription{a property map associating normals to the elements of the point range} - \cgalParamType{a model of `WritablePropertyMap` with value type `geom_traits::Vector_3`} - \cgalParamDefault{If this parameter is omitted, normals in the input stream are ignored.} - \cgalParamNEnd - - \cgalParamNBegin{geom_traits} - \cgalParamDescription{an instance of a geometric traits class} - \cgalParamType{a model of `Kernel`} - \cgalParamDefault{a \cgal Kernel deduced from the point type, using `CGAL::Kernel_traits`} - \cgalParamNEnd - \cgalNamedParamsEnd - - \returns `true` if reading was successful, `false` otherwise. - - \sa \ref IOStreamPLY - \sa `read_PLY_with_properties()` -*/ +// documentation in ../PLY.h template + typename CGAL_NP_TEMPLATE_PARAMETERS_NO_DEFAULT> bool read_PLY(const std::string& fname, PointOutputIterator output, - const CGAL_NP_CLASS& np = parameters::default_values() -#ifndef DOXYGEN_RUNNING - , std::enable_if_t::value>* = nullptr -#endif + const CGAL_NP_CLASS& np, + std::enable_if_t::value>* ) { const bool binary = CGAL::parameters::choose_parameter(CGAL::parameters::get_parameter(np, internal_np::use_binary_mode), true); diff --git a/Stream_support/include/CGAL/IO/PLY/write_ply_points.h b/Stream_support/include/CGAL/IO/PLY/write_ply_points.h index 8c5beeff7a5..d84424119b2 100644 --- a/Stream_support/include/CGAL/IO/PLY/write_ply_points.h +++ b/Stream_support/include/CGAL/IO/PLY/write_ply_points.h @@ -38,76 +38,8 @@ namespace CGAL { namespace IO { -#ifdef DOXYGEN_RUNNING // Document some parts from Stream_support here for convenience - /** - \ingroup PkgPointSetProcessing3IOPly - - Generates a %PLY property handler to write 3D points. Points are - written as 3 %PLY properties of type `FT` and named `x`, `y` and - `z`. `FT` is `float` if the points use - `CGAL::Simple_cartesian` and `double` otherwise. - - \tparam PointMap the property map used to store points. - - \sa `write_PLY_with_properties()` - \sa \ref IOStreamPLY - */ - template - std::tuple, PLY_property, PLY_property > - make_ply_point_writer(PointMap point_map); - - /** - \ingroup PkgPointSetProcessing3IOPly - - Generates a %PLY property handler to write 3D normal - vectors. Vectors are written as 3 %PLY properties of type `FT` - and named `nx`, `ny` and `nz`. `FT` is `float` if the vectors use - `CGAL::Simple_cartesian` and `double` otherwise. - - \tparam VectorMap the property map used to store vectors. - - \sa `write_PLY_with_properties()` - \sa \ref IOStreamPLY - */ - template - std::tuple, PLY_property, PLY_property > - make_ply_normal_writer(VectorMap normal_map); -#endif - -/** - \ingroup PkgPointSetProcessing3IOPly - - \brief writes the range of `points` with properties using \ref IOStreamPLY. - - Properties are handled through a variadic list of property - handlers. A `PropertyHandler` can either be: - - - A `std::pair >` if the user wants - to write a scalar value T as a %PLY property (for example, writing - an `int` variable as an `int` %PLY property). - - - A `std::tuple...>` if the - 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::IO::get_mode()`). - - \attention To write to a binary file, the flag `std::ios::binary` must be set during the creation - of the `ofstream`, and the \link PkgStreamSupportEnumRef `IO::Mode` \endlink - of the stream must be set to `BINARY`. - - \tparam PointRange is a model of `ConstRange`. The value type of - its iterator is the key type of the `PropertyMap` objects provided - within the `PropertyHandler` parameter. - \tparam PropertyHandler handlers to recover properties. - - \returns `true` if writing was successful, `false` otherwise. - - \sa \ref IOStreamPLY - \sa `make_ply_point_writer()` - \sa `make_ply_normal_writer()` -*/ -template bool write_PLY_with_properties(std::ostream& os, ///< output stream. const PointRange& points, ///< input point range. @@ -138,61 +70,12 @@ template `} - \cgalParamNEnd - - \cgalParamNBegin{normal_map} - \cgalParamDescription{a property map associating normals to the elements of the point range} - \cgalParamType{a model of `ReadablePropertyMap` with value type `geom_traits::Vector_3`} - \cgalParamDefault{If this parameter is omitted, normals are not written in the output stream.} - \cgalParamNEnd - - \cgalParamNBegin{geom_traits} - \cgalParamDescription{an instance of a geometric traits class} - \cgalParamType{a model of `Kernel`} - \cgalParamDefault{a \cgal Kernel deduced from the point type, using `CGAL::Kernel_traits`} - \cgalParamNEnd - - \cgalParamNBegin{stream_precision} - \cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream} - \cgalParamType{int} - \cgalParamDefault{the precision of the stream `os`} - \cgalParamExtra{This parameter is only meaningful while using \ascii encoding.} - \cgalParamNEnd - \cgalNamedParamsEnd - - \returns `true` if writing was successful, `false` otherwise. - - \sa `write_PLY_with_properties()` -*/ -template +// documented in ../PLY.h +template bool write_PLY(std::ostream& os, const PointRange& points, - const CGAL_NP_CLASS& np = parameters::default_values() -#ifndef DOXYGEN_RUNNING - , std::enable_if_t::value>* = nullptr -#endif + const CGAL_NP_CLASS& np + , std::enable_if_t::value>* ) { using parameters::choose_parameter; @@ -274,13 +157,11 @@ bool write_PLY(std::ostream& os, \sa `write_PLY_with_properties()` */ -template +template bool write_PLY(const std::string& filename, const PointRange& points, - const CGAL_NP_CLASS& np = parameters::default_values() -#ifndef DOXYGEN_RUNNING - , std::enable_if_t::value>* = nullptr -#endif + const CGAL_NP_CLASS& np, + std::enable_if_t::value>* ) { const bool binary = CGAL::parameters::choose_parameter(CGAL::parameters::get_parameter(np, internal_np::use_binary_mode), true); diff --git a/Stream_support/include/CGAL/IO/XYZ.h b/Stream_support/include/CGAL/IO/XYZ.h index ed417bd459f..db73ab31b0f 100644 --- a/Stream_support/include/CGAL/IO/XYZ.h +++ b/Stream_support/include/CGAL/IO/XYZ.h @@ -8,16 +8,17 @@ // // Author(s) : Simon Giraudot -#ifndef CGAL_IO_LAS_H -#define CGAL_IO_LAS_H +#ifndef CGAL_IO_XYZ_H +#define CGAL_IO_XYZ_H -#include -#include #include #include #include #include +#include +#include +#include namespace CGAL { @@ -28,111 +29,18 @@ namespace CGAL { namespace IO { /** - \ingroup PkgStreamSupportIoFuncsLAS + \ingroup PkgStreamSupportIoFuncsIOXyz - generates a %LAS property handler to read 3D points. Points are - constructed from the input the using 3 %LAS properties - `LAS_property::X`, `LAS_property::Y` and `LAS_property::Z`. + \brief reads points (positions + normals, if available), using the \ref IOStreamXYZ. - \tparam PointMap the property map used to store points. - - \sa `read_LAS_with_properties()` - \sa \ref IOStreamLAS -*/ -template -std::tuple::Kernel::Construct_point_3, - LAS_property::X, LAS_property::Y, LAS_property::Z > -make_las_point_reader(PointMap point_map); - - -/** - \ingroup PkgStreamSupportIoFuncsLAS - - \brief reads user-selected points properties from a .las or .laz stream. - Potential additional properties are ignored. - - Properties are handled through a variadic list of property - handlers. A `PropertyHandler` can either be: - - - A `std::pair` if the user wants to - read a %LAS property as a scalar value `LAS_property::Tag::type` (for - example, storing an `int` %LAS property into an `int` variable). - - - A `std::tuple` if the user wants to use one or several - %LAS properties to construct a complex object (for example, - storing 4 `unsigned short` %LAS properties into a %Color object - that can for example be a `std::array`). In that case, the second element of the tuple should be a - functor that constructs the value type of `PropertyMap` from N - objects of of type `LAS_property::Tag::type`. - - The %LAS standard defines a fixed set of properties accessible - through the following tag classes: - - - `LAS_property::X` with type `double` - - `LAS_property::Y` with type `double` - - `LAS_property::Z` with type `double` - - `LAS_property::Intensity` with type `unsigned short` - - `LAS_property::Return_number` with type `unsigned char` - - `LAS_property::Number_of_returns` with type `unsigned char` - - `LAS_property::Scan_direction_flag` with type `unsigned char` - - `LAS_property::Edge_of_flight_line` with type `unsigned char` - - `LAS_property::Classification` with type `unsigned char` - - `LAS_property::Synthetic_flag` with type `unsigned char` - - `LAS_property::Keypoint_flag` with type `unsigned char` - - `LAS_property::Withheld_flag` with type `unsigned char` - - `LAS_property::Scan_angle` with type `double` - - `LAS_property::User_data` with type `unsigned char` - - `LAS_property::Point_source_ID` with type `unsigned short` - - `LAS_property::Deleted_flag` with type `unsigned int` - - `LAS_property::GPS_time` with type `double` - - `LAS_property::R` with type `unsigned short` - - `LAS_property::G` with type `unsigned short` - - `LAS_property::B` with type `unsigned short` - - `LAS_property::I` with type `unsigned short` - - \attention To read a binary file, the flag `std::ios::binary` must be set during the creation of the `ifstream`. - - \tparam OutputIteratorValueType type of objects that can be put in `PointOutputIterator`. - It must be a model of `DefaultConstructible` and defaults to `value_type_traits::%type`. - It can be omitted if the default is fine. - \tparam PointOutputIterator iterator over output points. - \tparam PropertyHandler handlers to recover properties. - - \returns `true` if reading was successful, `false` otherwise. - - \sa `make_las_point_reader()` - - \sa \ref IOStreamLAS -*/ -template -bool read_LAS_with_properties(std::istream& is, - PointOutputIterator output, - PropertyHandler&& ... properties); - - - -/** - \ingroup PkgStreamSupportIoFuncsLAS - - \brief reads points (position only) using the \ref IOStreamLAS. - - Potential additional properties are ignored. - - \attention To read a binary file, the flag `std::ios::binary` must be set during the creation of the `ifstream`. - - \tparam OutputIteratorValueType type of objects that can be put in `PointOutputIterator`. - It must be a model of `DefaultConstructible` and defaults to `value_type_traits::%type`. + \tparam OutputIteratorValueType type of objects that can be put in `OutputIterator`. + It must be a model of `DefaultConstructible` and defaults to `value_type_traits::%type`. It can be omitted when the default is fine. - \tparam PointOutputIterator iterator over output points. + \tparam OutputIterator iterator over output points. \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" - \param is input stream - \param output output iterator over points + \param is input stream. + \param output output iterator over points. \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below \cgalNamedParamsBegin @@ -142,6 +50,12 @@ bool read_LAS_with_properties(std::istream& is, \cgalParamDefault{`CGAL::Identity_property_map`} \cgalParamNEnd + \cgalParamNBegin{normal_map} + \cgalParamDescription{a property map associating normals to the elements of the point range} + \cgalParamType{a model of `WritablePropertyMap` with value type `geom_traits::Vector_3`} + \cgalParamDefault{If this parameter is omitted, normals in the input stream are ignored.} + \cgalParamNEnd + \cgalParamNBegin{geom_traits} \cgalParamDescription{an instance of a geometric traits class} \cgalParamType{a model of `Kernel`} @@ -151,34 +65,32 @@ bool read_LAS_with_properties(std::istream& is, \returns `true` if reading was successful, `false` otherwise. - \sa `read_LAS_with_properties()` + \sa \ref IOStreamXYZ */ template -bool read_LAS(std::istream& is, - PointOutputIterator output, +bool read_XYZ(std::istream& is, + OutputIterator output, const CGAL_NP_CLASS& np = parameters::default_values()); /** - \ingroup PkgStreamSupportIoFuncsLAS + \ingroup PkgStreamSupportIoFuncsIOXyz - \brief reads points (position only) using the \ref IOStreamLAS. + \brief reads points (positions + normals, if available), using the \ref IOStreamXYZ. - Potential additional properties are ignored. - - \tparam OutputIteratorValueType type of objects that can be put in `PointOutputIterator`. - It must be a model of `DefaultConstructible` and defaults to `value_type_traits::%type`. + \tparam OutputIteratorValueType type of objects that can be put in `OutputIterator`. + It must be a model of `DefaultConstructible` and defaults to `value_type_traits::%type`. It can be omitted when the default is fine. - \tparam PointOutputIterator iterator over output points. + \tparam OutputIterator iterator over output points. \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" - \param filename name of the input file - \param output output iterator over points - \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below + \param fname input file name. + \param output output iterator over points. + \param np optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below. \cgalNamedParamsBegin \cgalParamNBegin{point_map} @@ -187,6 +99,12 @@ bool read_LAS(std::istream& is, \cgalParamDefault{`CGAL::Identity_property_map`} \cgalParamNEnd + \cgalParamNBegin{normal_map} + \cgalParamDescription{a property map associating normals to the elements of the point range} + \cgalParamType{a model of `WritablePropertyMap` with value type `geom_traits::Vector_3`} + \cgalParamDefault{If this parameter is omitted, normals in the input stream are ignored.} + \cgalParamNEnd + \cgalParamNBegin{geom_traits} \cgalParamDescription{an instance of a geometric traits class} \cgalParamType{a model of `Kernel`} @@ -196,16 +114,19 @@ bool read_LAS(std::istream& is, \returns `true` if reading was successful, `false` otherwise. - \sa `read_LAS_with_properties()` + \sa \ref IOStreamXYZ */ template -bool read_LAS(const std::string& filename, - PointOutputIterator output, + typename OutputIterator, + typename CGAL_NP_TEMPLATE_PARAMETERS> +bool read_XYZ(const std::string& fname, + OutputIterator output, const CGAL_NP_CLASS& np = parameters::default_values()); } // namespace IO - } // namespace CGAL -#endif // CGAL_IO_LAS_H + +#include +#include + +#endif // CGAL_IO_XYZ_H diff --git a/Stream_support/include/CGAL/IO/XYZ/read_xyz_points.h b/Stream_support/include/CGAL/IO/XYZ/read_xyz_points.h index 4bb3e417372..cb97992be45 100644 --- a/Stream_support/include/CGAL/IO/XYZ/read_xyz_points.h +++ b/Stream_support/include/CGAL/IO/XYZ/read_xyz_points.h @@ -16,7 +16,7 @@ #ifndef CGAL_IO_PLY_READ_XYZ_POINTS_H #define CGAL_IO_PLY_READ_XYZ_POINTS_H -#include +#include #include #include #include diff --git a/Stream_support/include/CGAL/IO/read_ply_points.h b/Stream_support/include/CGAL/IO/read_ply_points.h index e91b0326d6f..fb249658f1f 100644 --- a/Stream_support/include/CGAL/IO/read_ply_points.h +++ b/Stream_support/include/CGAL/IO/read_ply_points.h @@ -8,5 +8,9 @@ // // Author(s) : Simon Giraudot -#include +#ifndef CGAL_IO_READ_PLY_POINTS_H +#define CGAL_IO_READ_PLY_POINTS_H +#include + +#endif // CGAL_IO_READ_PLY_POINTS_H From 44306e981a8f2d2a0707852fb0ad12cbcb92be98 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 30 Oct 2025 18:11:15 +0100 Subject: [PATCH 11/25] doc --- .../File_formats/Supported_file_formats.txt | 8 ++++---- .../doc/Stream_support/PackageDescription.txt | 10 ++++++++++ Stream_support/include/CGAL/IO/LAS.h | 8 ++++---- Stream_support/include/CGAL/IO/LAS/Las_property.h | 1 - Stream_support/include/CGAL/IO/LAS/read_las_points.h | 1 - Stream_support/include/CGAL/IO/XYZ.h | 4 ++-- 6 files changed, 20 insertions(+), 12 deletions(-) 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 6bdd298b6bc..03bb6c54905 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 @@ -17,7 +17,7 @@ each specific format. - \ref IOStreamGocad - \ref IOStream3MF - \ref IOStreamWRL -- \ref IOStreamPkgStreamSupportIoFuncsLas +- \ref IOStreamLAS - \ref IOStreamAvizo - \ref IOStreamMedit - \ref IOStreamTetgen @@ -298,7 +298,7 @@ A precise specification of those formats is available Any point range - \link PkgStreamSupportIoFuncsLas CGAL::IO::read_LAS(const std::string&, PointRange&)\endlink + \link PkgStreamSupportIoFuncsLAS CGAL::IO::read_LAS(const std::string&, PointRange&)\endlink Output @@ -331,7 +331,7 @@ of its coordinates and other properties. Only coordinates and normals are curren Any point range - \link PkgStreamSupportIoFuncsIOXyz CGAL::IO::read_XYZ(const std::string&, PointRange&)\endlink + \link PkgStreamSupportIoFuncsIoXYZ CGAL::IO::read_XYZ(const std::string&, PointRange&)\endlink Output @@ -341,7 +341,7 @@ of its coordinates and other properties. Only coordinates and normals are curren Any point range - \link PkgStreamSupportIoFuncsIOXyz CGAL::IO::write_XYZ(const std::string&, const PointRange&)\endlink + \link PkgStreamSupportIoFuncsIOX CGAL::IO::write_XYZ(const std::string&, const PointRange&)\endlink diff --git a/Stream_support/doc/Stream_support/PackageDescription.txt b/Stream_support/doc/Stream_support/PackageDescription.txt index 2d97d36e3c1..de2dfbc7439 100644 --- a/Stream_support/doc/Stream_support/PackageDescription.txt +++ b/Stream_support/doc/Stream_support/PackageDescription.txt @@ -36,6 +36,14 @@ /// I/O Functions for the \ref IOStream3MF /// \ingroup IOstreamFunctions +/// \defgroup PkgStreamSupportIoFuncsLAS LAS I/O Functions +/// I/O Functions for the \ref IOStreamLAS +/// \ingroup IOstreamFunctions + +/// \defgroup PkgStreamSupportIoFuncsXYZ XYZ I/O Functions +/// I/O Functions for the \ref IOStreamXYZ +/// \ingroup IOstreamFunctions + /// \defgroup PkgStreamSupportEnumRef I/O Enums /// \ingroup PkgStreamSupportRef @@ -99,5 +107,7 @@ the printing mode. - \link PkgStreamSupportIoFuncsVTK I/O for VTK files \endlink - \link PkgStreamSupportIoFuncs3MF I/O for 3MF files \endlink - \link PkgStreamSupportIoFuncsWKT I/O for WKT files \endlink +- \link PkgStreamSupportIoFuncsLAS I/O for LAS files \endlink +- \link PkgStreamSupportIoFuncsXYZ I/O for XYZ files \endlink */ diff --git a/Stream_support/include/CGAL/IO/LAS.h b/Stream_support/include/CGAL/IO/LAS.h index 65fea06a7b1..2c27c196732 100644 --- a/Stream_support/include/CGAL/IO/LAS.h +++ b/Stream_support/include/CGAL/IO/LAS.h @@ -29,7 +29,7 @@ namespace CGAL { namespace IO { /** - \ingroup PkgStreamSupportIoFuncsLas + \ingroup PkgStreamSupportIoFuncsLAS generates a %LAS property handler to read 3D points. Points are constructed from the input the using 3 %LAS properties @@ -48,7 +48,7 @@ make_las_point_reader(PointMap point_map); /** - \ingroup PkgStreamSupportIoFuncsLas + \ingroup PkgStreamSupportIoFuncsLAS \brief reads user-selected points properties from a .las or .laz stream. Potential additional properties are ignored. @@ -118,7 +118,7 @@ bool read_LAS_with_properties(std::istream& is, /** - \ingroup PkgStreamSupportIoFuncsLas + \ingroup PkgStreamSupportIoFuncsLAS \brief reads points (position only) using the \ref IOStreamLAS. @@ -165,7 +165,7 @@ bool read_LAS(std::istream& is, /** - \ingroup PkgStreamSupportIoFuncsLas + \ingroup PkgStreamSupportIoFuncsLAS \brief reads points (position only) using the \ref IOStreamLAS. diff --git a/Stream_support/include/CGAL/IO/LAS/Las_property.h b/Stream_support/include/CGAL/IO/LAS/Las_property.h index 0c0555ce066..58f4eacca78 100644 --- a/Stream_support/include/CGAL/IO/LAS/Las_property.h +++ b/Stream_support/include/CGAL/IO/LAS/Las_property.h @@ -73,7 +73,6 @@ typedef Base G; typedef Base B; typedef Base I; } // namespace LAS_property -/// \endcond // documenation in ../LAS.h template diff --git a/Stream_support/include/CGAL/IO/LAS/read_las_points.h b/Stream_support/include/CGAL/IO/LAS/read_las_points.h index 84f0fbea0e5..19dd476bf3d 100644 --- a/Stream_support/include/CGAL/IO/LAS/read_las_points.h +++ b/Stream_support/include/CGAL/IO/LAS/read_las_points.h @@ -225,7 +225,6 @@ void process_properties (const LASpoint& reader, OutputValueType& new_element, } // namespace LAS } // namespace internal -/// \endcond // documenation in ../LAS.h template Date: Thu, 30 Oct 2025 22:26:00 +0100 Subject: [PATCH 12/25] doc links --- .../Stream_support/File_formats/Supported_file_formats.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 03bb6c54905..af3409c4f3a 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 @@ -308,7 +308,7 @@ A precise specification of those formats is available Any point range - \link PkgStreamSupportIoFuncsLas CGAL::IO::write_LAS(const std::string&, const PointRange&)\endlink + \link PkgStreamSupportIoFuncsLAS CGAL::IO::write_LAS(const std::string&, const PointRange&)\endlink @@ -331,7 +331,7 @@ of its coordinates and other properties. Only coordinates and normals are curren Any point range - \link PkgStreamSupportIoFuncsIoXYZ CGAL::IO::read_XYZ(const std::string&, PointRange&)\endlink + \link PkgStreamSupportIoFuncsXYZ CGAL::IO::read_XYZ(const std::string&, PointRange&)\endlink Output @@ -341,7 +341,7 @@ of its coordinates and other properties. Only coordinates and normals are curren Any point range - \link PkgStreamSupportIoFuncsIOX CGAL::IO::write_XYZ(const std::string&, const PointRange&)\endlink + \link PkgStreamSupportIoFuncsXYZ CGAL::IO::write_XYZ(const std::string&, const PointRange&)\endlink From 7c3b2302b50c0ecd83292194f58761667914ede0 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 30 Oct 2025 22:28:15 +0100 Subject: [PATCH 13/25] doc links --- Stream_support/include/CGAL/IO/LAS/Las_property.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/Stream_support/include/CGAL/IO/LAS/Las_property.h b/Stream_support/include/CGAL/IO/LAS/Las_property.h index 58f4eacca78..d5d767d6406 100644 --- a/Stream_support/include/CGAL/IO/LAS/Las_property.h +++ b/Stream_support/include/CGAL/IO/LAS/Las_property.h @@ -14,7 +14,6 @@ namespace CGAL { namespace IO { -/// \cond SKIP_IN_MANUAL namespace LAS_property { namespace Id { @@ -85,7 +84,6 @@ make_las_point_reader(PointMap point_map) LAS_property::X(), LAS_property::Y(), LAS_property::Z()); } -/// \cond SKIP_IN_MANUAL } // namespace IO } // namespace CGAL From 2fb9a2d832ebd565da65cff7695b89680e9f0586 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 30 Oct 2025 22:44:47 +0100 Subject: [PATCH 14/25] doc links --- Stream_support/include/CGAL/IO/LAS/read_las_points.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Stream_support/include/CGAL/IO/LAS/read_las_points.h b/Stream_support/include/CGAL/IO/LAS/read_las_points.h index 19dd476bf3d..01267cb32a0 100644 --- a/Stream_support/include/CGAL/IO/LAS/read_las_points.h +++ b/Stream_support/include/CGAL/IO/LAS/read_las_points.h @@ -58,7 +58,7 @@ namespace CGAL { namespace IO { - +/// \cond SKIP_IN_MANUAL namespace internal { @@ -226,6 +226,8 @@ void process_properties (const LASpoint& reader, OutputValueType& new_element, } // namespace internal +/// \endcond + // documenation in ../LAS.h template Date: Fri, 31 Oct 2025 09:40:05 +0100 Subject: [PATCH 15/25] cleanup --- Point_set_3/doc/Point_set_3/Doxyfile.in | 5 + .../doc/Point_set_3/PackageDescription.txt | 3 - Stream_support/include/CGAL/IO/LAS.h | 139 ++++++++++++++++++ .../include/CGAL/IO/LAS/write_las_points.h | 122 ++------------- Stream_support/include/CGAL/IO/PLY.h | 58 +++++++- .../include/CGAL/IO/PLY/read_ply_points.h | 53 +------ .../include/CGAL/IO/PLY/write_ply_points.h | 51 +------ Stream_support/include/CGAL/IO/XYZ.h | 104 +++++++++++++ .../include/CGAL/IO/XYZ/write_xyz_points.h | 101 ++----------- 9 files changed, 330 insertions(+), 306 deletions(-) diff --git a/Point_set_3/doc/Point_set_3/Doxyfile.in b/Point_set_3/doc/Point_set_3/Doxyfile.in index 7b3039d1612..814f12c628d 100644 --- a/Point_set_3/doc/Point_set_3/Doxyfile.in +++ b/Point_set_3/doc/Point_set_3/Doxyfile.in @@ -1,2 +1,7 @@ @INCLUDE = ${CGAL_DOC_PACKAGE_DEFAULTS} PROJECT_NAME = "CGAL ${CGAL_DOC_VERSION} - 3D Point Set" + +EXTRACT_ALL = false +HIDE_UNDOC_MEMBERS = true +HIDE_UNDOC_CLASSES = true + diff --git a/Point_set_3/doc/Point_set_3/PackageDescription.txt b/Point_set_3/doc/Point_set_3/PackageDescription.txt index 8072d6cb02b..84a20643ddc 100644 --- a/Point_set_3/doc/Point_set_3/PackageDescription.txt +++ b/Point_set_3/doc/Point_set_3/PackageDescription.txt @@ -43,9 +43,6 @@ /// I/O Functions for the \ref IOStreamXYZ /// \ingroup PkgPointSet3IO -/// \defgroup PkgPointSet3IODeprecated Input/Output (Deprecated) -/// \ingroup PkgPointSet3IO -/// These I/O functions are deprecated and newer versions should be used. /*! \addtogroup PkgPointSet3Ref diff --git a/Stream_support/include/CGAL/IO/LAS.h b/Stream_support/include/CGAL/IO/LAS.h index 2c27c196732..583340e82b5 100644 --- a/Stream_support/include/CGAL/IO/LAS.h +++ b/Stream_support/include/CGAL/IO/LAS.h @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -205,6 +206,144 @@ template +std::tuple +make_las_point_writer(PointMap point_map); + +/** + \ingroup PkgStreamSupportIoFuncsLAS + + \brief writes the range of `points` with properties to a .las stream. + + Properties are handled through a variadic list of property + handlers. A `PropertyHandle` is a `std::pair` used to write a scalar value + `LAS_property::Tag::type` as a %LAS property (for example, + writing an `int` variable as an `int` %LAS property). An exception + is used for points that are written using a `std::tuple` object. + + See documentation of `read_LAS_with_properties()` for the + list of available `LAS_property::Tag` classes. + + \attention To write to a binary file, the flag `std::ios::binary` must be set during the creation of the `ofstream`. + + \tparam PointRange is a model of `ConstRange`. The value type of + its iterator is the key type of the named parameter `point_map`. + \tparam PointMap is a model of `ReadablePropertyMap` with a value_type = `CGAL::Point_3`. + \tparam PropertyHandler handlers to recover properties. + + \returns `true` if writing was successful, `false` otherwise. + + \sa `make_las_point_writer()` + \sa \ref IOStreamLAS +*/ +template +bool write_LAS_with_properties(std::ostream& os, ///< output stream. + const PointRange& points, ///< input point range. + std::tuple point_property, ///< property handler for points + PropertyHandler&& ... properties); + +/** + \ingroup PkgStreamSupportIoFuncsLAS + + \brief writes the range of `points` (positions only), using the \ref IOStreamLAS. + + \attention To write to a binary file, the flag `std::ios::binary` must be set during the creation of the `ofstream`. + + \tparam PointRange is a model of `ConstRange`. The value type of + its iterator is the key type of the named parameter `point_map`. + \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + + \param os output stream + \param points input point range + \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below + + \cgalNamedParamsBegin + \cgalParamNBegin{point_map} + \cgalParamDescription{a property map associating points to the elements of the point range} + \cgalParamType{a model of `ReadablePropertyMap` with value type `geom_traits::Point_3`} + \cgalParamDefault{`CGAL::Identity_property_map`} + \cgalParamNEnd + + \cgalParamNBegin{geom_traits} + \cgalParamDescription{an instance of a geometric traits class} + \cgalParamType{a model of `Kernel`} + \cgalParamDefault{a \cgal Kernel deduced from the point type, using `CGAL::Kernel_traits`} + \cgalParamNEnd + \cgalNamedParamsEnd + + \returns `true` if writing was successful, `false` otherwise. + + \sa \ref IOStreamLAS + \sa `write_LAS_with_properties()` +*/ +template +bool write_LAS(std::ostream& os, + const PointRange& points, + const CGAL_NP_CLASS& np = parameters::default_values() +#ifndef DOXYGEN_RUNNING + , std::enable_if_t::value>* = nullptr +#endif + ); + + +/** + \ingroup PkgStreamSupportIoFuncsLAS + + writes the range of `points` (positions only), using the \ref IOStreamLAS. + + \tparam PointRange is a model of `ConstRange`. The value type of + its iterator is the key type of the named parameter `point_map`. + \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + + \param filename the path the output file + \param points input point range + \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below + + \cgalNamedParamsBegin + \cgalParamNBegin{point_map} + \cgalParamDescription{a property map associating points to the elements of the point range} + \cgalParamType{a model of `ReadablePropertyMap` with value type `geom_traits::Point_3`} + \cgalParamDefault{`CGAL::Identity_property_map`} + \cgalParamNEnd + + \cgalParamNBegin{geom_traits} + \cgalParamDescription{an instance of a geometric traits class} + \cgalParamType{a model of `Kernel`} + \cgalParamDefault{a \cgal Kernel deduced from the point type, using `CGAL::Kernel_traits`} + \cgalParamNEnd + \cgalNamedParamsEnd + + \returns `true` if writing was successful, `false` otherwise. + + \sa `write_LAS_with_properties()` +*/ +template +bool write_LAS(const std::string& filename, + const PointRange& points, + const CGAL_NP_CLASS& np = parameters::default_values() +#ifndef DOXYGEN_RUNNING + , std::enable_if_t::value>* = nullptr +#endif + ); + } // namespace IO } // namespace CGAL diff --git a/Stream_support/include/CGAL/IO/LAS/write_las_points.h b/Stream_support/include/CGAL/IO/LAS/write_las_points.h index fee94156c5a..773713f0ba7 100644 --- a/Stream_support/include/CGAL/IO/LAS/write_las_points.h +++ b/Stream_support/include/CGAL/IO/LAS/write_las_points.h @@ -60,16 +60,7 @@ namespace CGAL { namespace IO { -/** - \ingroup PkgPointSetProcessing3IOLas - - \brief generates a %LAS property handler to write 3D points. - - \tparam PointMap the property map used to store points. - - \sa `write_LAS()` - \sa \ref IOStreamLAS -*/ +// documented in ../LAS.h template std::tuple make_las_point_writer(PointMap point_map) @@ -190,33 +181,7 @@ namespace LAS { /// \endcond -/** - \ingroup PkgPointSetProcessing3IOLas - - \brief writes the range of `points` with properties to a .las stream. - - Properties are handled through a variadic list of property - handlers. A `PropertyHandle` is a `std::pair` used to write a scalar value - `LAS_property::Tag::type` as a %LAS property (for example, - writing an `int` variable as an `int` %LAS property). An exception - is used for points that are written using a `std::tuple` object. - - See documentation of `read_LAS_with_properties()` for the - list of available `LAS_property::Tag` classes. - - \attention To write to a binary file, the flag `std::ios::binary` must be set during the creation of the `ofstream`. - - \tparam PointRange is a model of `ConstRange`. The value type of - its iterator is the key type of the named parameter `point_map`. - \tparam PointMap is a model of `ReadablePropertyMap` with a value_type = `CGAL::Point_3`. - \tparam PropertyHandler handlers to recover properties. - - \returns `true` if writing was successful, `false` otherwise. - - \sa `make_las_point_writer()` - \sa \ref IOStreamLAS -*/ +// documented in ../LAS.h template @@ -278,47 +243,12 @@ bool write_LAS_with_properties(std::ostream& os, ///< output stream. return !os.fail(); } -/** - \ingroup PkgPointSetProcessing3IOLas - - \brief writes the range of `points` (positions only), using the \ref IOStreamLAS. - - \attention To write to a binary file, the flag `std::ios::binary` must be set during the creation of the `ofstream`. - - \tparam PointRange is a model of `ConstRange`. The value type of - its iterator is the key type of the named parameter `point_map`. - \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" - - \param os output stream - \param points input point range - \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below - - \cgalNamedParamsBegin - \cgalParamNBegin{point_map} - \cgalParamDescription{a property map associating points to the elements of the point range} - \cgalParamType{a model of `ReadablePropertyMap` with value type `geom_traits::Point_3`} - \cgalParamDefault{`CGAL::Identity_property_map`} - \cgalParamNEnd - - \cgalParamNBegin{geom_traits} - \cgalParamDescription{an instance of a geometric traits class} - \cgalParamType{a model of `Kernel`} - \cgalParamDefault{a \cgal Kernel deduced from the point type, using `CGAL::Kernel_traits`} - \cgalParamNEnd - \cgalNamedParamsEnd - - \returns `true` if writing was successful, `false` otherwise. - - \sa \ref IOStreamLAS - \sa `write_LAS_with_properties()` -*/ -template +// documented in ../LAS.h +template bool write_LAS(std::ostream& os, const PointRange& points, - const CGAL_NP_CLASS& np = parameters::default_values() -#ifndef DOXYGEN_RUNNING - , std::enable_if_t::value>* = nullptr -#endif + const CGAL_NP_CLASS& np, + std::enable_if_t::value>* ) { using parameters::choose_parameter; @@ -336,44 +266,12 @@ bool write_LAS(std::ostream& os, return write_LAS_with_properties(os, points, make_las_point_writer(point_map)); } -/** - \ingroup PkgPointSetProcessing3IOLas - - writes the range of `points` (positions only), using the \ref IOStreamLAS. - - \tparam PointRange is a model of `ConstRange`. The value type of - its iterator is the key type of the named parameter `point_map`. - \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" - - \param filename the path the output file - \param points input point range - \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below - - \cgalNamedParamsBegin - \cgalParamNBegin{point_map} - \cgalParamDescription{a property map associating points to the elements of the point range} - \cgalParamType{a model of `ReadablePropertyMap` with value type `geom_traits::Point_3`} - \cgalParamDefault{`CGAL::Identity_property_map`} - \cgalParamNEnd - - \cgalParamNBegin{geom_traits} - \cgalParamDescription{an instance of a geometric traits class} - \cgalParamType{a model of `Kernel`} - \cgalParamDefault{a \cgal Kernel deduced from the point type, using `CGAL::Kernel_traits`} - \cgalParamNEnd - \cgalNamedParamsEnd - - \returns `true` if writing was successful, `false` otherwise. - - \sa `write_LAS_with_properties()` -*/ -template +// documented in ../LAS.h +template bool write_LAS(const std::string& filename, const PointRange& points, - const CGAL_NP_CLASS& np = parameters::default_values() -#ifndef DOXYGEN_RUNNING - , std::enable_if_t::value>* = nullptr -#endif + const CGAL_NP_CLASS& np, + std::enable_if_t::value>* ) { std::ofstream os(filename, std::ios::binary); diff --git a/Stream_support/include/CGAL/IO/PLY.h b/Stream_support/include/CGAL/IO/PLY.h index 510c1fa469c..e60f9b53a5b 100644 --- a/Stream_support/include/CGAL/IO/PLY.h +++ b/Stream_support/include/CGAL/IO/PLY.h @@ -16,7 +16,6 @@ #include #include - #include #include #include @@ -533,6 +532,7 @@ bool write_PLY(const std::string& fname, + #ifdef DOXYGEN_RUNNING /** \ingroup PkgStreamSupportIoFuncsPLY @@ -635,6 +635,62 @@ bool read_PLY_with_properties(std::istream& is, + +/** + \ingroup PkgStreamSupportFuncsIoPLY + + \brief reads points (positions + normals, if available), using the \ref IOStreamPLY. + + Potential additional point properties and faces are ignored. + + \attention To read a binary file, the flag `std::ios::binary` must be set during the creation of the `ifstream`. + + \tparam OutputIteratorValueType type of objects that can be put in `PointOutputIterator`. + It must be a model of `DefaultConstructible` and defaults to `value_type_traits::%type`. + It can be omitted when the default is fine. + \tparam PointOutputIterator iterator over output points. + \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + + \param is input stream. + \param output output iterator over points. + \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below + + \cgalNamedParamsBegin + \cgalParamNBegin{point_map} + \cgalParamDescription{a property map associating points to the elements of the point range} + \cgalParamType{a model of `WritablePropertyMap` with value type `geom_traits::Point_3`} + \cgalParamDefault{`CGAL::Identity_property_map`} + \cgalParamNEnd + + \cgalParamNBegin{normal_map} + \cgalParamDescription{a property map associating normals to the elements of the point range} + \cgalParamType{a model of `WritablePropertyMap` with value type `geom_traits::Vector_3`} + \cgalParamDefault{If this parameter is omitted, normals in the input stream are ignored.} + \cgalParamNEnd + + \cgalParamNBegin{geom_traits} + \cgalParamDescription{an instance of a geometric traits class} + \cgalParamType{a model of `Kernel`} + \cgalParamDefault{a \cgal Kernel deduced from the point type, using `CGAL::Kernel_traits`} + \cgalParamNEnd + \cgalNamedParamsEnd + + \returns `true` if reading was successful, `false` otherwise. + + \sa `read_PLY_with_properties()` +*/ +template +bool read_PLY(std::istream& is, + PointOutputIterator output, + const CGAL_NP_CLASS& np = parameters::default_values() +#ifndef DOXYGEN_RUNNING + , std::enable_if_t::value>* = nullptr +#endif + ); + + /** \ingroup PkgStreamSupportIoFuncsPLY diff --git a/Stream_support/include/CGAL/IO/PLY/read_ply_points.h b/Stream_support/include/CGAL/IO/PLY/read_ply_points.h index f9c6f7c0697..20b1dea688b 100644 --- a/Stream_support/include/CGAL/IO/PLY/read_ply_points.h +++ b/Stream_support/include/CGAL/IO/PLY/read_ply_points.h @@ -97,58 +97,15 @@ bool read_PLY_with_properties(std::istream& is, /// \endcond -/** - \ingroup PkgPointSetProcessing3IOPly - \brief reads points (positions + normals, if available), using the \ref IOStreamPLY. - - Potential additional point properties and faces are ignored. - - \attention To read a binary file, the flag `std::ios::binary` must be set during the creation of the `ifstream`. - - \tparam OutputIteratorValueType type of objects that can be put in `PointOutputIterator`. - It must be a model of `DefaultConstructible` and defaults to `value_type_traits::%type`. - It can be omitted when the default is fine. - \tparam PointOutputIterator iterator over output points. - \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" - - \param is input stream. - \param output output iterator over points. - \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below - - \cgalNamedParamsBegin - \cgalParamNBegin{point_map} - \cgalParamDescription{a property map associating points to the elements of the point range} - \cgalParamType{a model of `WritablePropertyMap` with value type `geom_traits::Point_3`} - \cgalParamDefault{`CGAL::Identity_property_map`} - \cgalParamNEnd - - \cgalParamNBegin{normal_map} - \cgalParamDescription{a property map associating normals to the elements of the point range} - \cgalParamType{a model of `WritablePropertyMap` with value type `geom_traits::Vector_3`} - \cgalParamDefault{If this parameter is omitted, normals in the input stream are ignored.} - \cgalParamNEnd - - \cgalParamNBegin{geom_traits} - \cgalParamDescription{an instance of a geometric traits class} - \cgalParamType{a model of `Kernel`} - \cgalParamDefault{a \cgal Kernel deduced from the point type, using `CGAL::Kernel_traits`} - \cgalParamNEnd - \cgalNamedParamsEnd - - \returns `true` if reading was successful, `false` otherwise. - - \sa `read_PLY_with_properties()` -*/ +// documented in ../PLY.h template +typename PointOutputIterator, + typename CGAL_NP_TEMPLATE_PARAMETERS_NO_DEFAULT> bool read_PLY(std::istream& is, PointOutputIterator output, - const CGAL_NP_CLASS& np = parameters::default_values() -#ifndef DOXYGEN_RUNNING - , std::enable_if_t::value>* = nullptr -#endif + const CGAL_NP_CLASS& np , + std::enable_if_t::value>* ) { using parameters::choose_parameter; diff --git a/Stream_support/include/CGAL/IO/PLY/write_ply_points.h b/Stream_support/include/CGAL/IO/PLY/write_ply_points.h index d84424119b2..7ab3f993c35 100644 --- a/Stream_support/include/CGAL/IO/PLY/write_ply_points.h +++ b/Stream_support/include/CGAL/IO/PLY/write_ply_points.h @@ -107,56 +107,7 @@ bool write_PLY(std::ostream& os, return write_PLY_with_properties(os, points, make_ply_point_writer(point_map)); } -/** - \ingroup PkgPointSetProcessing3IOPly - - \brief writes the range of `points` (positions + normals, if available) using \ref IOStreamPLY. - - \tparam PointRange is a model of `ConstRange`. The value type of - its iterator is the key type of the named parameter `point_map`. - \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" - - \param filename the path to the output file - \param points input point range - \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below - - \cgalNamedParamsBegin - \cgalParamNBegin{use_binary_mode} - \cgalParamDescription{indicates whether data should be written in binary (`true`) or in \ascii (`false`)} - \cgalParamType{Boolean} - \cgalParamDefault{`true`} - \cgalParamNEnd - - \cgalParamNBegin{point_map} - \cgalParamDescription{a property map associating points to the elements of the point range} - \cgalParamType{a model of `ReadablePropertyMap` with value type `geom_traits::Point_3`} - \cgalParamDefault{`CGAL::Identity_property_map`} - \cgalParamNEnd - - \cgalParamNBegin{normal_map} - \cgalParamDescription{a property map associating normals to the elements of the point range} - \cgalParamType{a model of `ReadablePropertyMap` with value type `geom_traits::Vector_3`} - \cgalParamDefault{If this parameter is omitted, normals are not written in the output file.} - \cgalParamNEnd - - \cgalParamNBegin{geom_traits} - \cgalParamDescription{an instance of a geometric traits class} - \cgalParamType{a model of `Kernel`} - \cgalParamDefault{a \cgal Kernel deduced from the point type, using `CGAL::Kernel_traits`} - \cgalParamNEnd - - \cgalParamNBegin{stream_precision} - \cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream} - \cgalParamType{int} - \cgalParamDefault{`6`} - \cgalParamExtra{This parameter is only meaningful while using \ascii encoding.} - \cgalParamNEnd - \cgalNamedParamsEnd - - \returns `true` if writing was successful, `false` otherwise. - - \sa `write_PLY_with_properties()` -*/ +// documented in ../PLY.h template bool write_PLY(const std::string& filename, const PointRange& points, diff --git a/Stream_support/include/CGAL/IO/XYZ.h b/Stream_support/include/CGAL/IO/XYZ.h index aeb14a5848f..a2568510206 100644 --- a/Stream_support/include/CGAL/IO/XYZ.h +++ b/Stream_support/include/CGAL/IO/XYZ.h @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -122,6 +123,109 @@ template `} + \cgalParamNEnd + + \cgalParamNBegin{normal_map} + \cgalParamDescription{a property map associating normals to the elements of the point range} + \cgalParamType{a model of `ReadablePropertyMap` with value type `geom_traits::Vector_3`} + \cgalParamDefault{If this parameter is omitted, normals are not written in the output stream.} + \cgalParamNEnd + + \cgalParamNBegin{geom_traits} + \cgalParamDescription{an instance of a geometric traits class} + \cgalParamType{a model of `Kernel`} + \cgalParamDefault{a \cgal Kernel deduced from the point type, using `CGAL::Kernel_traits`} + \cgalParamNEnd + + \cgalParamNBegin{stream_precision} + \cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream} + \cgalParamType{int} + \cgalParamDefault{the precision of the stream `os`} + \cgalParamNEnd + \cgalNamedParamsEnd + + \returns `true` if writing was successful, `false` otherwise. +*/ +template +bool write_XYZ(std::ostream& os, + const PointRange& points, + const CGAL_NP_CLASS& np = parameters::default_values() +#ifndef DOXYGEN_RUNNING + , std::enable_if_t::value>* = nullptr +#endif + ); + + +/** + \ingroup PkgStreamSupportIoFuncsXYZ + + \brief writes the range of `points` (positions + normals, if available), using the \ref IOStreamXYZ. + + \tparam PointRange is a model of `ConstRange`. The value type of + its iterator is the key type of the named parameter `point_map`. + \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" + + \param filename path to the output file + \param points input point range + \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below + + \cgalNamedParamsBegin + \cgalParamNBegin{point_map} + \cgalParamDescription{a property map associating points to the elements of the point range} + \cgalParamType{a model of `ReadablePropertyMap` with value type `geom_traits::Point_3`} + \cgalParamDefault{`CGAL::Identity_property_map`} + \cgalParamNEnd + + \cgalParamNBegin{normal_map} + \cgalParamDescription{a property map associating normals to the elements of the point range} + \cgalParamType{a model of `ReadablePropertyMap` with value type `geom_traits::Vector_3`} + \cgalParamDefault{If this parameter is omitted, normals are not written in the output file.} + \cgalParamNEnd + + \cgalParamNBegin{geom_traits} + \cgalParamDescription{an instance of a geometric traits class} + \cgalParamType{a model of `Kernel`} + \cgalParamDefault{a \cgal Kernel deduced from the point type, using `CGAL::Kernel_traits`} + \cgalParamNEnd + + \cgalParamNBegin{stream_precision} + \cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream} + \cgalParamType{int} + \cgalParamDefault{`6`} + \cgalParamNEnd + \cgalNamedParamsEnd + + \returns `true` if writing was successful, `false` otherwise. +*/ +template +bool write_XYZ(const std::string& filename, + const PointRange& points, + const CGAL_NP_CLASS& np = parameters::default_values() +#ifndef DOXYGEN_RUNNING + , std::enable_if_t::value>* = nullptr +#endif + ); + } // namespace IO } // namespace CGAL diff --git a/Stream_support/include/CGAL/IO/XYZ/write_xyz_points.h b/Stream_support/include/CGAL/IO/XYZ/write_xyz_points.h index 1fd99935fc3..cb04512053a 100644 --- a/Stream_support/include/CGAL/IO/XYZ/write_xyz_points.h +++ b/Stream_support/include/CGAL/IO/XYZ/write_xyz_points.h @@ -18,6 +18,7 @@ #include +#include #include #include #include @@ -82,107 +83,23 @@ bool write_XYZ_PSP(std::ostream& os, namespace IO { -/** - \ingroup PkgPointSetProcessing3IOXyz - - \brief writes the range of `points` (positions + normals, if available), using the \ref IOStreamXYZ. - - \tparam PointRange is a model of `ConstRange`. The value type of - its iterator is the key type of the named parameter `point_map`. - \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" - - \param os output stream - \param points input point range - \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below - - \cgalNamedParamsBegin - \cgalParamNBegin{point_map} - \cgalParamDescription{a property map associating points to the elements of the point range} - \cgalParamType{a model of `ReadablePropertyMap` with value type `geom_traits::Point_3`} - \cgalParamDefault{`CGAL::Identity_property_map`} - \cgalParamNEnd - - \cgalParamNBegin{normal_map} - \cgalParamDescription{a property map associating normals to the elements of the point range} - \cgalParamType{a model of `ReadablePropertyMap` with value type `geom_traits::Vector_3`} - \cgalParamDefault{If this parameter is omitted, normals are not written in the output stream.} - \cgalParamNEnd - - \cgalParamNBegin{geom_traits} - \cgalParamDescription{an instance of a geometric traits class} - \cgalParamType{a model of `Kernel`} - \cgalParamDefault{a \cgal Kernel deduced from the point type, using `CGAL::Kernel_traits`} - \cgalParamNEnd - - \cgalParamNBegin{stream_precision} - \cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream} - \cgalParamType{int} - \cgalParamDefault{the precision of the stream `os`} - \cgalParamNEnd - \cgalNamedParamsEnd - - \returns `true` if writing was successful, `false` otherwise. -*/ -template +// documented in ../XYZ.h +template bool write_XYZ(std::ostream& os, const PointRange& points, - const CGAL_NP_CLASS& np = parameters::default_values() -#ifndef DOXYGEN_RUNNING - , std::enable_if_t::value>* = nullptr -#endif + const CGAL_NP_CLASS& np, + std::enable_if_t::value>* ) { return Point_set_processing_3::internal::write_XYZ_PSP(os, points, np); } -/** - \ingroup PkgPointSetProcessing3IOXyz - - \brief writes the range of `points` (positions + normals, if available), using the \ref IOStreamXYZ. - - \tparam PointRange is a model of `ConstRange`. The value type of - its iterator is the key type of the named parameter `point_map`. - \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" - - \param filename path to the output file - \param points input point range - \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below - - \cgalNamedParamsBegin - \cgalParamNBegin{point_map} - \cgalParamDescription{a property map associating points to the elements of the point range} - \cgalParamType{a model of `ReadablePropertyMap` with value type `geom_traits::Point_3`} - \cgalParamDefault{`CGAL::Identity_property_map`} - \cgalParamNEnd - - \cgalParamNBegin{normal_map} - \cgalParamDescription{a property map associating normals to the elements of the point range} - \cgalParamType{a model of `ReadablePropertyMap` with value type `geom_traits::Vector_3`} - \cgalParamDefault{If this parameter is omitted, normals are not written in the output file.} - \cgalParamNEnd - - \cgalParamNBegin{geom_traits} - \cgalParamDescription{an instance of a geometric traits class} - \cgalParamType{a model of `Kernel`} - \cgalParamDefault{a \cgal Kernel deduced from the point type, using `CGAL::Kernel_traits`} - \cgalParamNEnd - - \cgalParamNBegin{stream_precision} - \cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream} - \cgalParamType{int} - \cgalParamDefault{`6`} - \cgalParamNEnd - \cgalNamedParamsEnd - - \returns `true` if writing was successful, `false` otherwise. -*/ -template +// documented in ../XYZ.h +template bool write_XYZ(const std::string& filename, const PointRange& points, - const CGAL_NP_CLASS& np = parameters::default_values() -#ifndef DOXYGEN_RUNNING - , std::enable_if_t::value>* = nullptr -#endif + const CGAL_NP_CLASS& np, + std::enable_if_t::value>* ) { std::ofstream os(filename); From f28e643ed019ffb05bcd7a85bd237596068434f9 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 31 Oct 2025 10:54:27 +0100 Subject: [PATCH 16/25] move read_points.h --- .../PackageDescription.txt | 17 ----------------- .../include/CGAL/IO/read_points.h | 16 +++++++--------- .../include/CGAL/IO/write_points.h | 15 ++++++--------- 3 files changed, 13 insertions(+), 35 deletions(-) rename {Point_set_processing_3 => Stream_support}/include/CGAL/IO/read_points.h (90%) rename {Point_set_processing_3 => Stream_support}/include/CGAL/IO/write_points.h (90%) 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 f351e426e8f..1548f71cff5 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 @@ -10,23 +10,6 @@ simplification, etc.). \defgroup PkgPointSetProcessing3IO I/O Functions \ingroup PkgPointSetProcessing3Ref -\defgroup PkgPointSetProcessing3IOOff I/O (OFF Formats) -\ingroup PkgPointSetProcessing3Ref - -\defgroup PkgPointSetProcessing3IOXyz I/O (XYZ Formats) -\ingroup PkgPointSetProcessing3Ref - -\defgroup PkgPointSetProcessing3IOPly I/O (PLY Format) -\ingroup PkgPointSetProcessing3Ref - -Read and write points (with or without additional properties) in PLY -format. - -\defgroup PkgPointSetProcessing3IOLas I/O (LAS Format) -\ingroup PkgPointSetProcessing3Ref - -Read and write points (with or without additional properties) in LAS -format. \addtogroup PkgPointSetProcessing3Ref \cgalPkgDescriptionBegin{Point Set Processing,PkgPointSetProcessing3} diff --git a/Point_set_processing_3/include/CGAL/IO/read_points.h b/Stream_support/include/CGAL/IO/read_points.h similarity index 90% rename from Point_set_processing_3/include/CGAL/IO/read_points.h rename to Stream_support/include/CGAL/IO/read_points.h index dca5c575483..32111e08f17 100644 --- a/Point_set_processing_3/include/CGAL/IO/read_points.h +++ b/Stream_support/include/CGAL/IO/read_points.h @@ -1,18 +1,16 @@ -// Copyright (c) 2020 Geometry Factory -// All rights reserved. +// Copyright (c) 2020 Geometry Factory // -// This file is part of CGAL (www.cgal.org). +// This file is part of CGAL (www.cgal.org); // // $URL$ // $Id$ -// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Maxime Gimeno -#ifndef CGAL_POINT_SET_PROCESSING_READ_POINTS_H -#define CGAL_POINT_SET_PROCESSING_READ_POINTS_H +#ifndef CGAL_STREAM_SUPPORT_IO_READ_POINTS_H +#define CGAL_STREAM_SUPPORT_IO_READ_POINTS_H -#include #include #include @@ -31,7 +29,7 @@ namespace CGAL { namespace IO { /** - \ingroup PkgPointSetProcessing3IO + \ingroup IOstreamFunctions \brief reads the point set from an input file. @@ -120,4 +118,4 @@ bool read_points(const std::string& fname, OutputIterator output, const NamedPar } } // namespace CGAL::IO -#endif // CGAL_POINT_SET_PROCESSING_READ_POINTS_H +#endif // CGAL_STREAM_SUPPORT_IO_READ_POINTS_H diff --git a/Point_set_processing_3/include/CGAL/IO/write_points.h b/Stream_support/include/CGAL/IO/write_points.h similarity index 90% rename from Point_set_processing_3/include/CGAL/IO/write_points.h rename to Stream_support/include/CGAL/IO/write_points.h index a9981ee9d98..ffa1a1189e5 100644 --- a/Point_set_processing_3/include/CGAL/IO/write_points.h +++ b/Stream_support/include/CGAL/IO/write_points.h @@ -1,18 +1,15 @@ // Copyright (c) 2020 Geometry Factory -// All rights reserved. // -// This file is part of CGAL (www.cgal.org). +// This file is part of CGAL (www.cgal.org); // // $URL$ // $Id$ -// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Maxime Gimeno -#ifndef CGAL_POINT_SET_PROCESSING_WRITE_POINTS_H -#define CGAL_POINT_SET_PROCESSING_WRITE_POINTS_H - -#include +#ifndef CGAL_STREAM_SUPPORT_IO_WRITE_POINTS_H +#define CGAL_STREAM_SUPPORT_IO_WRITE_POINTS_H #include @@ -31,7 +28,7 @@ namespace CGAL { namespace IO { /** - \ingroup PkgPointSetProcessing3IO + \ingroup IOstreamFunctions \brief writes the range of `points` with properties to a file. @@ -115,4 +112,4 @@ bool write_points(const std::string& fname, } } // namespace CGAL::IO -#endif // CGAL_POINT_SET_PROCESSING_WRITE_POINTS_H +#endif // CGAL_STREAM_SUPPORT_IO_WRITE_POINTS_H From 64e33bd6cbf9b8c97a385b18c440c565a0668c46 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 31 Oct 2025 12:25:24 +0100 Subject: [PATCH 17/25] fix links --- .../PackageDescription.txt | 8 ++++---- Stream_support/doc/Stream_support/IOstream.txt | 16 ++++++++-------- .../include/CGAL/IO/LAS/Las_property.h | 2 ++ 3 files changed, 14 insertions(+), 12 deletions(-) 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 1548f71cff5..f935e3717c5 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 @@ -67,14 +67,14 @@ simplification, etc.). \cgalCRPSection{I/O (XYZ/OFF Formats)} -- \link PkgPointSetProcessing3IOOff OFF I/O Functions (`read_OFF()` and `write_OFF()`)\endlink -- \link PkgPointSetProcessing3IOXyz XYZ I/O Functions (`read_XYZ()` and `write_XYZ()`)\endlink +- \link PkgStreamSupportIoFuncsOFF OFF I/O Functions (`read_OFF()` and `write_OFF()`)\endlink +- \link PkgStreamSupportIoFuncsXYZ XYZ I/O Functions (`read_XYZ()` and `write_XYZ()`)\endlink \cgalCRPSection{I/O (PLY Format)} -- \link PkgPointSetProcessing3IOPly `CGAL::IO::read_PLY()` \endlink +- \link PkgStreamSupportIoFuncsPLY `CGAL::IO::read_PLY()` \endlink - `CGAL::IO::read_PLY_with_properties()` -- \link PkgPointSetProcessing3IOPly `CGAL::IO::write_PLY()` \endlink +- \link PkgStreamSupportIoFuncsPLY `CGAL::IO::write_PLY()` \endlink - `CGAL::IO::write_PLY_with_properties()` - `CGAL::IO::PLY_property` - `CGAL::IO::make_ply_point_reader()` diff --git a/Stream_support/doc/Stream_support/IOstream.txt b/Stream_support/doc/Stream_support/IOstream.txt index 6235996baec..871e205a5a8 100644 --- a/Stream_support/doc/Stream_support/IOstream.txt +++ b/Stream_support/doc/Stream_support/IOstream.txt @@ -306,23 +306,23 @@ The following table shows which file formats can be read from and written for po \ref IOStreamOFF "OFF" - \link PkgPointSetProcessing3IOOff `CGAL::IO::read_OFF()` \endlink - \link PkgPointSetProcessing3IOOff `CGAL::IO::write_OFF()` \endlink + \link PkgStreamSupportIoFuncsOFF `CGAL::IO::read_OFF()` \endlink + \link PkgStreamSupportIoFuncsOFF `CGAL::IO::write_OFF()` \endlink \ref IOStreamXYZ "XYZ" - \link PkgPointSetProcessing3IOXyz `CGAL::IO::read_XYZ()` \endlink - \link PkgPointSetProcessing3IOXyz `CGAL::IO::write_XYZ()` \endlink + \link PkgStreamSupportIoFuncsXYZ `CGAL::IO::read_XYZ()` \endlink + \link PkgStreamSupportIoFuncsXYZ `CGAL::IO::write_XYZ()` \endlink \ref IOStreamPLY "PLY" - \link PkgPointSetProcessing3IOPly `CGAL::IO::read_PLY()` \endlink - \link PkgPointSetProcessing3IOPly `CGAL::IO::write_PLY()` \endlink + \link PkgStreamSupportIoFuncsPLY `CGAL::IO::read_PLY()` \endlink + \link PkgStreamSupportIoFuncsPLY `CGAL::IO::write_PLY()` \endlink \ref IOStreamLAS "LAS" - \link PkgPointSetProcessing3IOLas `CGAL::IO::read_LAS()` \endlink - \link PkgPointSetProcessing3IOLas `CGAL::IO::write_LAS()` \endlink + \link PkgStreamSupportIoFuncsLAS `CGAL::IO::read_LAS()` \endlink + \link PkgStreamSupportIoFuncsLAS `CGAL::IO::write_LAS()` \endlink diff --git a/Stream_support/include/CGAL/IO/LAS/Las_property.h b/Stream_support/include/CGAL/IO/LAS/Las_property.h index d5d767d6406..bb6c0b2fbc5 100644 --- a/Stream_support/include/CGAL/IO/LAS/Las_property.h +++ b/Stream_support/include/CGAL/IO/LAS/Las_property.h @@ -11,6 +11,8 @@ #ifndef CGAL_IO_LAS_LAS_PROPERTY_H #define CGAL_IO_LAS_LAS_PROPERTY_H +#include + namespace CGAL { namespace IO { From eaa25c500b647cfcc63df37e2799f1697e080118 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 31 Oct 2025 12:39:55 +0100 Subject: [PATCH 18/25] fix CI --- Stream_support/include/CGAL/IO/LAS.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Stream_support/include/CGAL/IO/LAS.h b/Stream_support/include/CGAL/IO/LAS.h index 583340e82b5..017e8e02a26 100644 --- a/Stream_support/include/CGAL/IO/LAS.h +++ b/Stream_support/include/CGAL/IO/LAS.h @@ -349,8 +349,9 @@ bool write_LAS(const std::string& filename, } // namespace CGAL +#ifdef CGAL_LINKED_WITH_LASLIB #include #include - +#endif #endif // CGAL_IO_LAS_H From 6bd5ec4f8b27681d2cb8829c661bd1c7e3af6dad Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 31 Oct 2025 13:08:07 +0100 Subject: [PATCH 19/25] Move guards in low level file --- Point_set_3/include/CGAL/Point_set_3/IO/LAS.h | 2 -- Stream_support/include/CGAL/IO/LAS.h | 3 +-- Stream_support/include/CGAL/IO/LAS/Las_property.h | 1 + Stream_support/include/CGAL/IO/LAS/read_las_points.h | 3 +++ Stream_support/include/CGAL/IO/LAS/write_las_points.h | 3 +++ 5 files changed, 8 insertions(+), 4 deletions(-) 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 896e1a8aadf..57c4975d891 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 @@ -13,10 +13,8 @@ #include -#ifdef CGAL_LINKED_WITH_LASLIB #include #include -#endif // LAS #include #include diff --git a/Stream_support/include/CGAL/IO/LAS.h b/Stream_support/include/CGAL/IO/LAS.h index 017e8e02a26..583340e82b5 100644 --- a/Stream_support/include/CGAL/IO/LAS.h +++ b/Stream_support/include/CGAL/IO/LAS.h @@ -349,9 +349,8 @@ bool write_LAS(const std::string& filename, } // namespace CGAL -#ifdef CGAL_LINKED_WITH_LASLIB #include #include -#endif + #endif // CGAL_IO_LAS_H diff --git a/Stream_support/include/CGAL/IO/LAS/Las_property.h b/Stream_support/include/CGAL/IO/LAS/Las_property.h index bb6c0b2fbc5..4ec6fb9b9c9 100644 --- a/Stream_support/include/CGAL/IO/LAS/Las_property.h +++ b/Stream_support/include/CGAL/IO/LAS/Las_property.h @@ -12,6 +12,7 @@ #define CGAL_IO_LAS_LAS_PROPERTY_H #include +#include namespace CGAL { namespace IO { diff --git a/Stream_support/include/CGAL/IO/LAS/read_las_points.h b/Stream_support/include/CGAL/IO/LAS/read_las_points.h index 01267cb32a0..a6a38330c37 100644 --- a/Stream_support/include/CGAL/IO/LAS/read_las_points.h +++ b/Stream_support/include/CGAL/IO/LAS/read_las_points.h @@ -11,6 +11,8 @@ #ifndef CGAL_IO_LAS_READ_LAS_POINTS_H #define CGAL_IO_LAS_READ_LAS_POINTS_H +#ifdef CGAL_LINKED_WITH_LASLIB + #include #include @@ -336,4 +338,5 @@ bool read_LAS(const std::string& fname, OutputIterator output, const CGAL_NP_CLA } // namespace CGAL +#endif CGAL_LINKED_WITH_LASLIB #endif // CGAL_IO_LAS_READ_LAS_POINTS_H diff --git a/Stream_support/include/CGAL/IO/LAS/write_las_points.h b/Stream_support/include/CGAL/IO/LAS/write_las_points.h index 773713f0ba7..736e597900b 100644 --- a/Stream_support/include/CGAL/IO/LAS/write_las_points.h +++ b/Stream_support/include/CGAL/IO/LAS/write_las_points.h @@ -11,6 +11,8 @@ #ifndef CGAL_IO_LAS_WRITE_LAS_POINTS_H #define CGAL_IO_LAS_WRITE_LAS_POINTS_H +#ifdef CGAL_LINKED_WITH_LASLIB + #include #include #include @@ -283,4 +285,5 @@ bool write_LAS(const std::string& filename, } // namespace CGAL +#endif // CGAL_LINKED_WITH_LASLIB #endif // CGAL_IO_LAS_WRITE_LAS_POINTS_H From 25844edf5005f4f7005169819bd0ca127a0337c3 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 31 Oct 2025 16:47:53 +0100 Subject: [PATCH 20/25] examples/tests/demo --- .../read_write_xyz_point_set_example.cpp | 3 +-- .../examples/Point_set_processing_3/write_las_example.cpp | 3 +-- .../test/Shape_detection/test_validity_sampled_data.cpp | 4 ++-- Stream_support/test/Stream_support/issue8155.cpp | 2 +- .../examples/Triangulation_3/segment_simplex_traverser_3.cpp | 2 +- .../test/Triangulation_3/test_simplex_iterator_3.cpp | 2 +- 6 files changed, 7 insertions(+), 9 deletions(-) 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 604235ffae9..efed980dc9f 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 @@ -1,8 +1,7 @@ #include #include -#include -#include +#include #include // defines std::pair #include diff --git a/Point_set_processing_3/examples/Point_set_processing_3/write_las_example.cpp b/Point_set_processing_3/examples/Point_set_processing_3/write_las_example.cpp index 200d31cc7e4..993701a1db7 100644 --- a/Point_set_processing_3/examples/Point_set_processing_3/write_las_example.cpp +++ b/Point_set_processing_3/examples/Point_set_processing_3/write_las_example.cpp @@ -1,8 +1,7 @@ #include #include -#include -#include +#include #include #include 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 6381eda2f67..b5b9c812323 100644 --- a/Shape_detection/test/Shape_detection/test_validity_sampled_data.cpp +++ b/Shape_detection/test/Shape_detection/test_validity_sampled_data.cpp @@ -5,8 +5,8 @@ #include -#include -#include +#include +#include #include diff --git a/Stream_support/test/Stream_support/issue8155.cpp b/Stream_support/test/Stream_support/issue8155.cpp index f92bf9cca84..e29cbb62f90 100644 --- a/Stream_support/test/Stream_support/issue8155.cpp +++ b/Stream_support/test/Stream_support/issue8155.cpp @@ -1,7 +1,7 @@ #include #include -#include +#include #include #include 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 b8f12d340c0..f78c5dc6bb0 100644 --- a/Triangulation_3/examples/Triangulation_3/segment_simplex_traverser_3.cpp +++ b/Triangulation_3/examples/Triangulation_3/segment_simplex_traverser_3.cpp @@ -6,7 +6,7 @@ #include #include -#include +#include #include #define CGAL_TRIANGULATION_3_VERBOSE_TRAVERSER_EXAMPLE 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 8e18a5eeeb4..3bfbe9f3349 100644 --- a/Triangulation_3/test/Triangulation_3/test_simplex_iterator_3.cpp +++ b/Triangulation_3/test/Triangulation_3/test_simplex_iterator_3.cpp @@ -9,7 +9,7 @@ #include #include -#include +#include #include // Define the kernel. From cee9effe099becad136ba09416a291fb85befab0 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 20 Nov 2025 13:56:43 +0000 Subject: [PATCH 21/25] Document a @param --- Stream_support/include/CGAL/IO/LAS.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Stream_support/include/CGAL/IO/LAS.h b/Stream_support/include/CGAL/IO/LAS.h index 583340e82b5..cef92ce637a 100644 --- a/Stream_support/include/CGAL/IO/LAS.h +++ b/Stream_support/include/CGAL/IO/LAS.h @@ -258,7 +258,7 @@ bool write_LAS_with_properties(std::ostream& os, ///< output stream. LAS_property::X, LAS_property::Y, LAS_property::Z> point_property, ///< property handler for points - PropertyHandler&& ... properties); + PropertyHandler&& ... properties); ///< parameter pack of property handlers /** \ingroup PkgStreamSupportIoFuncsLAS From 884e9fc4eea8c948ec7c99e30d4e9a6127a77a6b Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 20 Nov 2025 14:02:31 +0000 Subject: [PATCH 22/25] Document a @param --- Stream_support/include/CGAL/IO/LAS.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Stream_support/include/CGAL/IO/LAS.h b/Stream_support/include/CGAL/IO/LAS.h index cef92ce637a..6b8a547f5e3 100644 --- a/Stream_support/include/CGAL/IO/LAS.h +++ b/Stream_support/include/CGAL/IO/LAS.h @@ -258,7 +258,8 @@ bool write_LAS_with_properties(std::ostream& os, ///< output stream. LAS_property::X, LAS_property::Y, LAS_property::Z> point_property, ///< property handler for points - PropertyHandler&& ... properties); ///< parameter pack of property handlers + PropertyHandler&& ... properties ///< parameter pack of property handlers + ); /** \ingroup PkgStreamSupportIoFuncsLAS From a0c32277d0610a53741e53d082900fc48685ffc5 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 21 Nov 2025 09:08:58 +0000 Subject: [PATCH 23/25] little doc fix in Frechet (not in extra PR) --- Frechet_distance/doc/Frechet_distance/Frechet_distance.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Frechet_distance/doc/Frechet_distance/Frechet_distance.txt b/Frechet_distance/doc/Frechet_distance/Frechet_distance.txt index 0220f74f354..140593130a3 100644 --- a/Frechet_distance/doc/Frechet_distance/Frechet_distance.txt +++ b/Frechet_distance/doc/Frechet_distance/Frechet_distance.txt @@ -123,11 +123,11 @@ In the example below, we can see a query where: -\subsection subsecFrechetDistanceImageCredits Image Credits +\section subsecFrechetDistanceImageCredits Image Credits The character image is a visualization of two data points from the Character Trajectories data set. -\subsection subsecFrechetDistanceImplementation Implementation History +\section subsecFrechetDistanceImplementation Implementation History An initial version using floating point arithmetic was developed by the authors while working at the Max-Planck Institute for Informatics in Saarbrücken, Germany. From 1b3556184acd1f8896253a25c33935c9140013d6 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 25 Nov 2025 07:35:10 +0000 Subject: [PATCH 24/25] Fix warning in read_las_points.h --- Stream_support/include/CGAL/IO/LAS/read_las_points.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Stream_support/include/CGAL/IO/LAS/read_las_points.h b/Stream_support/include/CGAL/IO/LAS/read_las_points.h index a6a38330c37..38d6595c446 100644 --- a/Stream_support/include/CGAL/IO/LAS/read_las_points.h +++ b/Stream_support/include/CGAL/IO/LAS/read_las_points.h @@ -338,5 +338,5 @@ bool read_LAS(const std::string& fname, OutputIterator output, const CGAL_NP_CLA } // namespace CGAL -#endif CGAL_LINKED_WITH_LASLIB +#endif // CGAL_LINKED_WITH_LASLIB #endif // CGAL_IO_LAS_READ_LAS_POINTS_H From 92a896abb9c4817ad13198ae22abcb9edbefb137 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 25 Nov 2025 16:39:10 +0000 Subject: [PATCH 25/25] Fix anchor --- Stream_support/include/CGAL/IO/PLY.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Stream_support/include/CGAL/IO/PLY.h b/Stream_support/include/CGAL/IO/PLY.h index adebab3b51e..d5991a0b339 100644 --- a/Stream_support/include/CGAL/IO/PLY.h +++ b/Stream_support/include/CGAL/IO/PLY.h @@ -674,7 +674,7 @@ bool read_PLY_with_properties(std::istream& is, /** - \ingroup PkgStreamSupportFuncsIoPLY + \ingroup PkgStreamSupportIoFuncsPLY \brief reads points (positions + normals, if available), using the \ref IOStreamPLY.