// 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_XYZ_H #define CGAL_IO_XYZ_H #include #include #include #include #include #include #include #include namespace CGAL { //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// // Read namespace IO { /** \ingroup PkgStreamSupportIoFuncsXYZ \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 */ template bool read_XYZ(std::istream& is, OutputIterator output, const CGAL_NP_CLASS& np = parameters::default_values()); /** \ingroup PkgStreamSupportIoFuncsXYZ \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 */ template bool read_XYZ(const std::string& fname, OutputIterator output, const CGAL_NP_CLASS& np = parameters::default_values()); /** \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 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_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 #include #include #endif // CGAL_IO_XYZ_H