diff --git a/Stream_support/doc/Stream_support/Doxyfile.in b/Stream_support/doc/Stream_support/Doxyfile.in index e88df2c3731..290a4266fcd 100644 --- a/Stream_support/doc/Stream_support/Doxyfile.in +++ b/Stream_support/doc/Stream_support/Doxyfile.in @@ -1,6 +1,5 @@ @INCLUDE = ${CGAL_DOC_PACKAGE_DEFAULTS} - PROJECT_NAME = "CGAL ${CGAL_DOC_VERSION} - IO Streams" EXAMPLE_PATH = ${CGAL_PACKAGE_DIR}/examples @@ -8,3 +7,8 @@ EXTRACT_ALL = false HIDE_UNDOC_MEMBERS = true HIDE_UNDOC_CLASSES = true +MACRO_EXPANSION = YES +EXPAND_ONLY_PREDEF = YES +EXPAND_AS_DEFINED = CGAL_BGL_NP_TEMPLATE_PARAMETERS \ + CGAL_BGL_NP_CLASS + diff --git a/Stream_support/doc/Stream_support/PackageDescription.txt b/Stream_support/doc/Stream_support/PackageDescription.txt index 8b566245a13..f2805e0227d 100644 --- a/Stream_support/doc/Stream_support/PackageDescription.txt +++ b/Stream_support/doc/Stream_support/PackageDescription.txt @@ -4,18 +4,23 @@ /// \defgroup IOstreamFunctions I/O Functions /// \ingroup PkgStreamSupportRef -/// \defgroup StlIoFuncs STL I/O Functions +/// \defgroup PkgStreamSupportIoFuncsSTL STL I/O Functions /// \ingroup IOstreamFunctions -/// \defgroup PlyIoFuncs PLY I/O Functions +/// \defgroup PkgStreamSupportIoFuncsPLY PLY I/O Functions /// \ingroup IOstreamFunctions -/// \defgroup ObjIoFuncs OBJ I/O Functions +/// \defgroup PkgStreamSupportIoFuncsOBJ OBJ I/O Functions /// \ingroup IOstreamFunctions -/// \defgroup OffIoFuncs OFF I/O Functions +/// \defgroup PkgStreamSupportIoFuncsOFF OFF I/O Functions /// \ingroup IOstreamFunctions -/// \defgroup VtpIoFuncs VTP I/O Functions +/// \defgroup PkgStreamSupportIoFuncsVTP VTP I/O Functions /// \ingroup IOstreamFunctions -/// \defgroup GocadIoFuncs GOCAD I/O Functions +/// \defgroup PkgStreamSupportIoFuncsGOCAD GOCAD I/O Functions /// \ingroup IOstreamFunctions +/// \defgroup PkgStreamSupportIoFuncsWKT WKT I/O Functions +/// \ingroup IOstreamFunctions +/// \defgroup PkgStreamSupportIoFuncs3MF 3MF I/O Functions +/// \ingroup IOstreamFunctions + /// \defgroup PkgStreamSupportEnumRef I/O Enums /// \ingroup PkgStreamSupportRef @@ -60,17 +65,18 @@ the printing mode. - `CGAL::iformat()` - `CGAL::oformat()` -\cgalCRPSection{File I/O Functions} -- \link StlIoFuncs I/O for STL files (`CGAL::write_STL()`and `CGAL::read_STL()`)\endlink -- \link PlyIoFuncs I/O for PLY files (`CGAL::write_PLY()`and `CGAL::read_PLY()`)\endlink -- \link ObjIoFuncs I/O for OBJ files (`CGAL::write_OBJ()`and `CGAL::read_OBJ()`)\endlink -- \link OffIoFuncs I/O for OFF files (`CGAL::write_OFF()`and `CGAL::read_OFF()`)\endlink -- \link GocadIoFuncs I/O for GOCAD files (`CGAL::write_GOCAD()`and `CGAL::read_GOCAD()`)\endlink -- \link VtpIoFuncs I/O for VTP files (`CGAL::write_VTP()`and `CGAL::read_VTP()`)\endlink - +\cgalCRPSection{I/O Functions} - `GCAL::read_polygon_soup()` - `GCAL::write_polygon_soup()` +- \link PkgStreamSupportIoFuncsSTL I/O for STL files \endlink +- \link PkgStreamSupportIoFuncsPLY I/O for PLY files \endlink +- \link PkgStreamSupportIoFuncsOBJ I/O for OBJ files \endlink +- \link PkgStreamSupportIoFuncsOFF I/O for OFF files \endlink +- \link PkgStreamSupportIoFuncsGOCAD I/O for GOCAD files \endlink +- \link PkgStreamSupportIoFuncsVTP I/O for VTP files \endlink +- \link PkgStreamSupportIoFuncs3MF I/O for 3MF files \endlink +\cgalCRPSection{I/O Functions (WKT)} - `GCAL::read_WKT()` - `CGAL::read_point_WKT()` - `GCAL::read_multi_point_WKT()` diff --git a/Stream_support/include/CGAL/IO/3MF.h b/Stream_support/include/CGAL/IO/3MF.h index bbc716d9400..5c7d5bc6a75 100644 --- a/Stream_support/include/CGAL/IO/3MF.h +++ b/Stream_support/include/CGAL/IO/3MF.h @@ -11,21 +11,23 @@ #ifndef CGAL_IO_3MF_H #define CGAL_IO_3MF_H -#ifdef CGAL_LINKED_WITH_3MF - #include #include #include #include +#ifdef CGAL_LINKED_WITH_3MF #include +#endif #include #include #include #include +#if defined(CGAL_LINKED_WITH_3MF) || defined(DOXYGEN_RUNNING) + namespace CGAL { //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -368,9 +370,9 @@ int read_from_3mf(const std::string& fname, } /*! - * \ingroup IOstreamFunctions + * \ingroup PkgStreamSupportIoFuncs3MF * - * \brief extracts ranges of points and triangles from a 3mf file. + * \brief Extracts ranges of points and triangles from a 3mf file. * * \tparam PointRanges a model of the concepts `RandomAccessContainer` and * `BackInsertionSequence` whose `value type` is @@ -418,9 +420,9 @@ int read_triangle_soups_from_3mf(const std::string& fname, // Write /*! - * \ingroup IOstreamFunctions + * \ingroup PkgStreamSupportIoFuncs3MF * - * \brief writes the triangle soups contained in `all_points` and + * \brief Writes the triangle soups contained in `all_points` and * `all_polygons` into the 3mf file `fname`. * * \tparam PointRanges a model of the concepts `RandomAccessContainer` and @@ -498,6 +500,6 @@ bool write_3MF(const std::string& fname, } // namespace CGAL -#endif // CGAL_LINKED_WITH_3MF +#endif // defined(CGAL_LINKED_WITH_3MF) || defined(DOXYGEN_RUNNING) #endif // CGAL_IO_3MF_H diff --git a/Stream_support/include/CGAL/IO/GOCAD.h b/Stream_support/include/CGAL/IO/GOCAD.h index cd267ff108c..9b8ecafdfad 100644 --- a/Stream_support/include/CGAL/IO/GOCAD.h +++ b/Stream_support/include/CGAL/IO/GOCAD.h @@ -180,9 +180,9 @@ bool read_GOCAD(const std::string& fname, } /*! - * \ingroup GocadIoFuncs + * \ingroup PkgStreamSupportIoFuncsGOCAD * - * reads the content of `is` into `points` and `polygons`, in the GOCAD format. + * \brief Reads the content of `is` into `points` and `polygons`, using the \ref IOStreamGocad. * * \tparam PointRange a model of the concept `RandomAccessContainer` whose value type is the point type. * \tparam PolygonRange a model of the concept `SequenceContainer` @@ -196,7 +196,6 @@ bool read_GOCAD(const std::string& fname, * using the indices of the points in `points`. * * \returns `true` if the reading was successful, `false` otherwise. - * \see \ref IOStreamGocad */ template bool read_GOCAD(std::istream& is, PointRange& points, PolygonRange& polygons) @@ -206,9 +205,9 @@ bool read_GOCAD(std::istream& is, PointRange& points, PolygonRange& polygons) } /*! - * \ingroup GocadIoFuncs + * \ingroup PkgStreamSupportIoFuncsGOCAD * - * reads the content of the file `fname` into `points` and `polygons`, in the GOCAD format. + * \brief Reads the content of the file `fname` into `points` and `polygons`, using the \ref IOStreamGocad. * * \tparam PointRange a model of the concept `RandomAccessContainer` whose value type is the point type. * \tparam PolygonRange a model of the concept `SequenceContainer` @@ -222,7 +221,6 @@ bool read_GOCAD(std::istream& is, PointRange& points, PolygonRange& polygons) * using the indices of the points in `points`. * * \returns `true` if the reading was successful, `false` otherwise. - * \see \ref IOStreamGocad */ template bool read_GOCAD(const char* fname, PointRange& points, PolygonRange& polygons) @@ -323,9 +321,9 @@ bool write_GOCAD(const char* fname, } /*! - \ingroup GocadIoFuncs + \ingroup PkgStreamSupportIoFuncsGOCAD - * writes the content of `points` and `polygons` in `os`, in the TS format. + * \brief Writes the content of `points` and `polygons` in `os`, using the \ref IOStreamGocad. * * \tparam PointRange a model of the concept `RandomAccessContainer` whose value type is the point type. * \tparam PolygonRange a model of the concept `SequenceContainer` @@ -339,7 +337,6 @@ bool write_GOCAD(const char* fname, * using the indices of the points in `points`. * * \return `true` if the writing was successful, `false` otherwise. - * \see \ref IOStreamGocad */ template bool write_GOCAD(std::ostream& os, const PointRange& points, const PolygonRange& polygons) @@ -348,9 +345,9 @@ bool write_GOCAD(std::ostream& os, const PointRange& points, const PolygonRange& } /*! - \ingroup GocadIoFuncs + \ingroup PkgStreamSupportIoFuncsGOCAD - * writes the content of `points` and `polygons` in `fname`, in the TS format. + * \brief Writes the content of `points` and `polygons` in `fname`, using the \ref IOStreamGocad. * * \tparam PointRange a model of the concept `RandomAccessContainer` whose value type is the point type. * \tparam PolygonRange a model of the concept `SequenceContainer` @@ -364,7 +361,6 @@ bool write_GOCAD(std::ostream& os, const PointRange& points, const PolygonRange& * using the indices of the points in `points`. * * \return `true` if the writing was successful, `false` otherwise. - * \see \ref IOStreamGocad */ template bool write_GOCAD(const char* fname, const PointRange& points, const PolygonRange& polygons) diff --git a/Stream_support/include/CGAL/IO/OBJ.h b/Stream_support/include/CGAL/IO/OBJ.h index c915ebbd57d..d6884b0bc38 100644 --- a/Stream_support/include/CGAL/IO/OBJ.h +++ b/Stream_support/include/CGAL/IO/OBJ.h @@ -203,46 +203,42 @@ bool read_OBJ(const std::string& fname, PointRange& points, PolygonRange& polygo return read_OBJ(fname.c_str(), points, polygons, np, verbose); } -//! \ingroup ObjIoFuncs -//! -/// reads the content of `is` into `points` and `polygons`, using the `OBJ` format. +/// \ingroup PkgStreamSupportIoFuncsOBJ +/// +/// \brief Reads the content of `is` into `points` and `polygons`, using the \ref IOStreamOBJ. /// /// \tparam PointRange a model of the concept `RandomAccessContainer` whose value type is the point type. /// \tparam PolygonRange a model of the concept `SequenceContainer` /// whose value_type is itself a model of the concept `SequenceContainer` /// whose value_type is an integer type. /// -/// /// \param is the input stream /// \param points points of the soup of polygons. /// \param polygons a `PolygonRange`. Each element in it describes a polygon /// using the indices of the points in `points`. /// /// \returns `true` if the reading was successful, `false` otherwise. -/// \see \ref IOStreamOBJ template bool read_OBJ(std::istream& is, PointRange& points, PolygonRange& polygons) { return read_OBJ(is, points, polygons, parameters::all_default()); } -//! \ingroup ObjIoFuncs -//! -/// reads the content of the file `fname` into `points` and `polygons`, using the `OBJ` format. +/// \ingroup PkgStreamSupportIoFuncsOBJ +/// +/// \brief Reads the content of the file `fname` into `points` and `polygons`, using the \ref IOStreamOBJ. /// /// \tparam PointRange a model of the concept `RandomAccessContainer` whose value type is the point type. /// \tparam PolygonRange a model of the concept `SequenceContainer` /// whose value_type is itself a model of the concept `SequenceContainer` /// whose value_type is an integer type. /// -/// /// \param fname the path to the input file /// \param points points of the soup of polygons. /// \param polygons a `PolygonRange`. Each element in it describes a polygon /// using the indices of the points in `points`. /// /// \returns `true` if the reading was successful, `false` otherwise. -/// \see \ref IOStreamOBJ template bool read_OBJ(const char* fname, PointRange& points, PolygonRange& polygons) { @@ -292,15 +288,14 @@ bool write_OBJ(const std::string& fname, const PointRange& points, const Polygon } /*! - * \ingroup ObjIoFuncs + * \ingroup PkgStreamSupportIoFuncsOBJ * - * writes the content of `points` and `polygons` in `os`, in the OBJ format. + * \brief Writes the content of `points` and `polygons` in `os`, using the \ref IOStreamOBJ. * * \tparam PointRange a model of the concept `RandomAccessContainer` whose value type is the point type. * \tparam PolygonRange a model of the concept `SequenceContainer` * whose value_type is itself a model of the concept `SequenceContainer` * whose value_type is an integer type. - * * \param os the output stream * \param points points of the soup of polygons. @@ -308,7 +303,6 @@ bool write_OBJ(const std::string& fname, const PointRange& points, const Polygon * using the indices of the points in `points`. * * \return `true` if the writing was successful, `false` otherwise. - * \see \ref IOStreamOBJ */ template bool write_OBJ(std::ostream& os, const PointRange& points, const PolygonRange& polygons) @@ -317,15 +311,14 @@ bool write_OBJ(std::ostream& os, const PointRange& points, const PolygonRange& p } /*! - * \ingroup ObjIoFuncs + * \ingroup PkgStreamSupportIoFuncsOBJ * - * writes the content of `points` and `polygons` in a file named `fname`, in the OBJ format. + * \brief Writes the content of `points` and `polygons` in a file named `fname`, using the \ref IOStreamOBJ. * * \tparam PointRange a model of the concept `RandomAccessContainer` whose value type is the point type. * \tparam PolygonRange a model of the concept `SequenceContainer` * whose value_type is itself a model of the concept `SequenceContainer` * whose value_type is an integer type. - * * \param fname the path to the output file * \param points points of the soup of polygons. @@ -333,7 +326,6 @@ bool write_OBJ(std::ostream& os, const PointRange& points, const PolygonRange& p * using the indices of the points in `points`. * * \return `true` if the writing was successful, `false` otherwise. - * \see \ref IOStreamOBJ */ template bool write_OBJ(const char* fname, const PointRange& points, const PolygonRange& polygons) diff --git a/Stream_support/include/CGAL/IO/OFF.h b/Stream_support/include/CGAL/IO/OFF.h index 1d82ee3a586..f42735feba1 100644 --- a/Stream_support/include/CGAL/IO/OFF.h +++ b/Stream_support/include/CGAL/IO/OFF.h @@ -200,9 +200,9 @@ bool read_OFF(const std::string& fname, PointRange& points, PolygonRange& polygo } /*! - * \ingroup OffIoFuncs + * \ingroup PkgStreamSupportIoFuncsOFF * - * reads the content of `is` into `points` and `polygons`, in the OFF format. + * \brief Reads the content of `is` into `points` and `polygons`, using the \ref IOStreamOFF. * * \tparam PointRange a model of the concept `RandomAccessContainer` whose value type is the point type. * \tparam PolygonRange a model of the concept `SequenceContainer` @@ -216,7 +216,6 @@ bool read_OFF(const std::string& fname, PointRange& points, PolygonRange& polygo * using the indices of the points in `points`. * * \returns `true` if the reading was successful, `false` otherwise. - * \see \ref IOStreamOFF */ template bool read_OFF(std::istream& is, PointRange& points, PolygonRange& polygons) @@ -225,9 +224,9 @@ bool read_OFF(std::istream& is, PointRange& points, PolygonRange& polygons) } /*! - * \ingroup OffIoFuncs + * \ingroup PkgStreamSupportIoFuncsOFF * - * reads the content of the file `fname` into `points` and `polygons`, in the OFF format. + * \brief Reads the content of the file `fname` into `points` and `polygons`, using the \ref IOStreamOFF. * * \tparam PointRange a model of the concept `RandomAccessContainer` whose value type is the point type. * \tparam PolygonRange a model of the concept `SequenceContainer` @@ -241,7 +240,6 @@ bool read_OFF(std::istream& is, PointRange& points, PolygonRange& polygons) * using the indices of the points in `points`. * * \returns `true` if the reading was successful, `false` otherwise. - * \see \ref IOStreamOFF */ template bool read_OFF(const char* fname, PointRange& points, PolygonRange& polygons) @@ -281,9 +279,9 @@ bool write_OFF(const char* fname, } /*! - * \ingroup OffIoFuncs + * \ingroup PkgStreamSupportIoFuncsOFF * - * writes the content of `points` and `polygons` in `os`, in the OFF format. + * \brief Writes the content of `points` and `polygons` in `os`, using the \ref IOStreamOFF. * * \tparam PointRange a model of the concept `RandomAccessContainer` whose value type is the point type. * \tparam PolygonRange a model of the concept `SequenceContainer` @@ -297,7 +295,6 @@ bool write_OFF(const char* fname, * using the indices of the points in `points`. * * \return `true` if the writing was successful, `false` otherwise. - * \see \ref IOStreamOFF */ template bool write_OFF(std::ostream& os, const PointRange& points, const PolygonRange& polygons @@ -313,15 +310,14 @@ bool write_OFF(std::ostream& os, const PointRange& points, const PolygonRange& p } /*! - * \ingroup OffIoFuncs + * \ingroup PkgStreamSupportIoFuncsOFF * - * writes the content of `points` and `polygons` in the file `fname`, in the OFF format. + * \brief Writes the content of `points` and `polygons` in the file `fname`, using the \ref IOStreamOFF. * * \tparam PointRange a model of the concept `RandomAccessContainer` whose value type is the point type. * \tparam PolygonRange a model of the concept `SequenceContainer` * whose value_type is itself a model of the concept `SequenceContainer` * whose value_type is an integer type. - * * \param fname the path to the output file * \param points points of the soup of polygons. @@ -329,19 +325,16 @@ bool write_OFF(std::ostream& os, const PointRange& points, const PolygonRange& p * using the indices of the points in `points`. * * \return `true` if the writing was successful, `false` otherwise. - * \see \ref IOStreamOFF */ template bool write_OFF(const char* fname, const PointRange& points, const PolygonRange& polygons #ifndef DOXYGEN_RUNNING - , - typename boost::enable_if< - typename boost::has_range_const_iterator::type - >::type* =0 + , typename boost::enable_if< + typename boost::has_range_const_iterator::type>::type* = 0 #endif - ) + ) { return write_OFF(fname, points, polygons, parameters::all_default()); } diff --git a/Stream_support/include/CGAL/IO/PLY.h b/Stream_support/include/CGAL/IO/PLY.h index 8efbc1beaf1..cbb4a3c9e16 100644 --- a/Stream_support/include/CGAL/IO/PLY.h +++ b/Stream_support/include/CGAL/IO/PLY.h @@ -274,9 +274,9 @@ bool read_PLY(std::istream& is, } /*! - * \ingroup PlyIoFuncs + * \ingroup PkgStreamSupportIoFuncsPLY * - * reads the content of `is` into `points` and `polygons`, in the PLY format. + * \brief Reads the content of `is` into `points` and `polygons`, using the \ref IOStreamPLY. * * \tparam PointRange a model of the concept `RandomAccessContainer` whose value type is the point type. * \tparam PolygonRange a model of the concept `SequenceContainer` @@ -288,10 +288,9 @@ bool read_PLY(std::istream& is, * \param points points of the soup of polygons. * \param polygons a `PolygonRange`. Each element in it describes a polygon * using the indices of the points in `points`. - * \param verbose: if `true`, will output warnings and error messages. Default is `false`. + * \param verbose: if `true`, will output warnings and error messages. * * \returns `true` if the reading was successful, `false` otherwise. - * \see \ref IOStreamPLY */ template bool read_PLY(std::istream& is, @@ -398,15 +397,14 @@ bool read_PLY(const char* fname, PointRange& points, PolygonRange& polygons, } /*! - * \ingroup PlyIoFuncs + * \ingroup PkgStreamSupportIoFuncsPLY * - * reads the content of `fname` into `points` and `polygons`, in the PLY format. + * \brief Reads the content of `fname` into `points` and `polygons`, using the \ref IOStreamPLY. * * \tparam PointRange a model of the concept `RandomAccessContainer` whose value type is the point type. * \tparam PolygonRange a model of the concept `SequenceContainer` * whose value_type is itself a model of the concept `SequenceContainer` * whose value_type is an integer type. - * * \param fname the path to the input file * \param points points of the soup of polygons. @@ -414,7 +412,6 @@ bool read_PLY(const char* fname, PointRange& points, PolygonRange& polygons, * using the indices of the points in `points`. * * \returns `true` if the reading was successful, `false` otherwise. - * \see \ref IOStreamPLY */ template bool read_PLY(const char* fname, @@ -507,15 +504,14 @@ bool write_PLY(std::ostream& out, } /*! - * \ingroup PlyIoFuncs + * \ingroup PkgStreamSupportIoFuncsPLY * - * writes the content of `points` and `polygons` in `out`, in the PLY format. + * writes the content of `points` and `polygons` in `out`, using the \ref IOStreamPLY. * * \tparam PointRange a model of the concept `RandomAccessContainer` whose value type is the point type. * \tparam PolygonRange a model of the concept `SequenceContainer` * whose value_type is itself a model of the concept `SequenceContainer` * whose value_type is an integer type. - * * \param out the output stream * \param points points of the soup of polygons. @@ -523,7 +519,6 @@ bool write_PLY(std::ostream& out, * using the indices of the points in `points`. * * \return `true` if the writing was successful, `false` otherwise. - * \see \ref IOStreamPLY */ template bool write_PLY(std::ostream& out, @@ -553,13 +548,14 @@ bool write_PLY(const char* fname, } /*! - * \ingroup PlyIoFuncs + * \ingroup PkgStreamSupportIoFuncsPLY + * + * \brief Writes the content of `points` and `polygons` in the file `fname`, using the \ref IOStreamPLY. * * \tparam PointRange a model of the concept `RandomAccessContainer` whose value type is the point type. * \tparam PolygonRange a model of the concept `SequenceContainer` * whose value_type is itself a model of the concept `SequenceContainer` * whose value_type is an integer type. - * * \param fname the path to the output file * \param points points of the soup of polygons. @@ -567,7 +563,6 @@ bool write_PLY(const char* fname, * using the indices of the points in `points`. * * \return `true` if the writing was successful, `false` otherwise. - * \see \ref IOStreamPLY */ template bool write_PLY(const char* fname, const PointRange& points, const PolygonRange& polygons) diff --git a/Stream_support/include/CGAL/IO/STL.h b/Stream_support/include/CGAL/IO/STL.h index dd7f756e22e..033ac4ab79b 100644 --- a/Stream_support/include/CGAL/IO/STL.h +++ b/Stream_support/include/CGAL/IO/STL.h @@ -28,6 +28,7 @@ #include namespace CGAL { + //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// // Read @@ -122,15 +123,14 @@ bool read_STL(std::istream& is, } /*! - * \ingroup StlIoFuncs + * \ingroup PkgStreamSupportIoFuncsSTL * - * reads the content of `is` into `points` and `facets`, in the STL format. + * \brief Reads the content of `is` into `points` and `facets`, using the \ref IOStreamSTL. * * \tparam PointRange a model of the concept `RandomAccessContainer` whose value type is the point type. * \tparam PolygonRange a model of the concept `SequenceContainer` * whose value_type is itself a model of the concept `SequenceContainer` * whose value_type is an integer type. - * * \param is the input stream * \param points points of the soup of polygons. @@ -138,7 +138,6 @@ bool read_STL(std::istream& is, * using the indices of the points in `points`. * * \returns `true` if the reading was successful, `false` otherwise. - * \see \ref IOStreamSTL */ template bool read_STL(std::istream& is, PointRange& points, TriangleRange& polygons) @@ -161,9 +160,9 @@ bool read_STL(const std::string& fname, PointRange& points, TriangleRange& facet } /*! - * \ingroup StlIoFuncs + * \ingroup PkgStreamSupportIoFuncsSTL * - * reads the content of a file named `fname` into `points` and `polygons`, in the STL format. + * \brief Reads the content of a file named `fname` into `points` and `polygons`, using the \ref IOStreamSTL. * * \tparam PointRange a model of the concept `RandomAccessContainer` whose value type is the point type. * \tparam PolygonRange a model of the concept `SequenceContainer` @@ -177,7 +176,6 @@ bool read_STL(const std::string& fname, PointRange& points, TriangleRange& facet * using the indices of the points in `points`. * * \returns `true` if the reading was successful, `false` otherwise. - * \see \ref IOStreamSTL */ template bool read_STL(const char* fname, PointRange& points, TriangleRange& polygons) @@ -261,15 +259,14 @@ bool write_STL(std::ostream& os, } /*! - * \ingroup StlIoFuncs + * \ingroup PkgStreamSupportIoFuncsSTL * - * writes the content of `points` and `polygons` in `os`, in the STL format. + * writes the content of `points` and `polygons` in `os`, using the \ref IOStreamSTL. * * \tparam PointRange a model of the concept `RandomAccessContainer` whose value type is the point type. * \tparam PolygonRange a model of the concept `SequenceContainer` * whose value_type is itself a model of the concept `SequenceContainer` * whose value_type is an integer type. - * * \param os the output stream * \param points points of the soup of polygons. @@ -277,7 +274,6 @@ bool write_STL(std::ostream& os, * using the indices of the points in `points`. * * \return `true` if the writing was successful, `false` otherwise. - * \see \ref IOStreamSTL */ template bool write_STL(std::ostream& os, const PointRange& points, const TriangleRange& polygons) @@ -294,15 +290,14 @@ bool write_STL(const char* fname, const PointRange& points, const TriangleRange& } /*! - * \ingroup StlIoFuncs + * \ingroup PkgStreamSupportIoFuncsSTL * - * writes the content of `points` and `polygons` in a file named `fname`, in the STL format. + * \brief Writes the content of `points` and `polygons` in a file named `fname`, using the \ref IOStreamSTL. * * \tparam PointRange a model of the concept `RandomAccessContainer` whose value type is the point type. * \tparam PolygonRange a model of the concept `SequenceContainer` * whose value_type is itself a model of the concept `SequenceContainer` * whose value_type is an integer type. - * * \param fname the path to the output file * \param points points of the soup of polygons. @@ -310,7 +305,6 @@ bool write_STL(const char* fname, const PointRange& points, const TriangleRange& * using the indices of the points in `points`. * * \return `true` if the writing was successful, `false` otherwise. - * \see \ref IOStreamSTL */ template bool write_STL(const char* fname, const PointRange& points, const TriangleRange& polygons) diff --git a/Stream_support/include/CGAL/IO/VTK.h b/Stream_support/include/CGAL/IO/VTK.h index cfdc1e8aad8..9d3a57dced1 100644 --- a/Stream_support/include/CGAL/IO/VTK.h +++ b/Stream_support/include/CGAL/IO/VTK.h @@ -27,6 +27,14 @@ #include #include #include +#endif + +#if defined(CGAL_USE_VTK) || defined(DOXYGEN_RUNNING) + +#ifdef DOXYGEN_RUNNING +#define CGAL_BGL_NP_TEMPLATE_PARAMETERS NamedParameters +#define CGAL_BGL_NP_CLASS NamedParameters +#endif namespace CGAL { namespace IO { @@ -124,15 +132,14 @@ bool read_VTP(const std::string& fname, } /*! - * \ingroup VtpIoFuncs + * \ingroup PkgStreamSupportIoFuncsVTP * - * reads the content of `is` into `points` and `polygons`, in the VTPformat. + * \brief Reads the content of `is` into `points` and `polygons`, using the \ref IOStreamVTK. * * \tparam PointRange a model of the concept `RandomAccessContainer` whose value type is the point type. * \tparam PolygonRange a model of the concept `SequenceContainer` * whose value_type is itself a model of the concept `SequenceContainer` * whose value_type is an integer type. - * * \param fname the path to the input file * \param points points of the soup of polygons. @@ -140,7 +147,6 @@ bool read_VTP(const std::string& fname, * using the indices of the points in `points`. * * \returns `true` if the reading was successful, `false` otherwise. - * \see \ref IOStreamVTK */ template bool read_VTP(const char* fname, @@ -358,31 +364,33 @@ void write_soup_polys_points(std::ostream& os, } // namespace internal } // namespace IO + /*! - * \ingroup VtpIoFuncs + * \ingroup PkgStreamSupportIoFuncsVTP * - * writes the content of `points` and `polygons` in `out`, in the VTP format. + * \brief Writes the content of `points` and `polygons` in `out`, using the \ref IOStreamVTK. * * \tparam PointRange a model of the concept `RandomAccessContainer` whose value type is the point type. * \tparam PolygonRange a model of the concept `SequenceContainer` * whose value_type is itself a model of the concept `SequenceContainer` * whose value_type is an integer type. * \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" - * * \param os the output stream * \param points points of the soup of polygons. * \param polygons a `PolygonRange`. Each element in it describes a polygon * using the indices of the points in `points`. * \param np optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below + * * \cgalNamedParamsBegin - * \cgalParamBegin{use_binary_mode} a Boolean indicating if the - * data should be written in binary (`true`, the default) or in ASCII (`false`). - * \cgalParamEnd + * \cgalParamNBegin{use_binary_mode} + * \cgalParamDescription{indicates whether data should be written in binary (`true`) or in ASCII (`false`)} + * \cgalParamType{Boolean} + * \cgalParamDefault{`true`} + * \cgalParamNEnd * \cgalNamedParamsEnd - + * * \return `true` if the writing was successful, `false` otherwise. - * \see \ref IOStreamVTK */ template bool write_VTP(const char* fname, @@ -508,42 +517,7 @@ bool write_VTP(const std::string& fname, } } // namespace CGAL -#elif DOXYGEN_RUNNING -/*! - * \ingroup VtpIoFuncs - * - * reads the content of `is` into `points` and `polygons`, in the VTPformat. - * - * \see \ref IOStreamVTK - */ -template -bool read_VTP(const char* fname, - PointRange& points, - PolygonRange& polygons); +#endif // defined(CGAL_USE_VTK) || defined(DOXYGEN_RUNNING) -/*! - * \ingroup VtpIoFuncs - * - * writes the content of `points` and `polygons` in `out`, in the VTP format. - * \see \ref IOStreamVTK - */ -template -bool write_VTP(std::ostream& os, - const PointRange& points, - const PolygonRange& polygons); - -/*! - * \ingroup VtpIoFuncs - * - * writes the content of `points` and `polygons` in a file named `fname`, in the VTP format. - * - * \see \ref IOStreamVTK - */ -template -bool write_VTP(const char* fname, - const PointRange& points, - const PolygonRange& polygons); - -#endif //CGAL_USE_VTK #endif // CGAL_IO_VTK_H diff --git a/Stream_support/include/CGAL/IO/WKT.h b/Stream_support/include/CGAL/IO/WKT.h index ec33f578dea..b3a30f49672 100644 --- a/Stream_support/include/CGAL/IO/WKT.h +++ b/Stream_support/include/CGAL/IO/WKT.h @@ -60,14 +60,15 @@ void pop_back_if_equal_to_front(CGAL::Polygon_with_holes_2& pwh) } // namespace internal -//! \ingroup PkgStreamSupportRef +//! \ingroup PkgStreamSupportIoFuncsWKT //! -//! \brief `read_point_WKT()` fills a `Point` from a WKT stream. The first line starting with POINT -//! in the stream will be used. +//! \brief Fills a `Point` from a WKT stream. +//! +//! The first line starting with POINT in the stream will be used. //! //! \tparam Point can be a `CGAL::Point_2` or `CGAL::Point_3`. //! -//! \attention Only Cartesian Kernels with double or float as `FT` are supported. +//! \attention Only Cartesian Kernels with double or float as `FT` are supported. //! \attention This function is only available with boost versions starting at 1.56. //! //! \see `CGAL::Point_2` @@ -108,10 +109,9 @@ bool read_point_WKT(std::istream& in, return !in.fail(); } -//! \ingroup PkgStreamSupportRef +//! \ingroup PkgStreamSupportIoFuncsWKT //! -//! \brief `read_multi_point_WKT()` overwrites the content of a `MultiPoint` -//! with the first line starting with MULTIPOINT in the stream. +//! \brief Overwrites the content of a `MultiPoint` with the first line starting with MULTIPOINT in the stream. //! //! \tparam MultiPoint must be a model of `RandomAccessRange` of `CGAL::Point_2` or `CGAL::Point_3`, //! and have: @@ -157,9 +157,10 @@ bool read_multi_point_WKT(std::istream& in, return !in.fail(); } -//! \ingroup PkgStreamSupportRef +//! \ingroup PkgStreamSupportIoFuncsWKT +//! +//! \brief Fills a `Linestring` from a WKT stream. //! -//! \brief `read_linestring_WKT()` fills a `Linestring` from a WKT stream. //! The first line starting with LINESTRING in the stream will be used. //! //! \tparam Linestring must be a model of `RandomAccessRange` of `CGAL::Point_2`, @@ -205,10 +206,9 @@ bool read_linestring_WKT(std::istream& in, return !in.fail(); } -//! \ingroup PkgStreamSupportRef +//! \ingroup PkgStreamSupportIoFuncsWKT //! -//! \brief `read_multi_linestring_WKT()` overwrites the content of a `MultiLineString` -//! with the first line starting with MULTILINESTRING in the stream. +//! \brief Overwrites the content of a `MultiLineString` with the first line starting with MULTILINESTRING in the stream. //! //! \tparam MultiLineString must be a model of `RandomAccessRange` of `Linestring`, //! and have: @@ -265,9 +265,10 @@ bool read_multi_linestring_WKT(std::istream& in, return !in.fail(); } -//! \ingroup PkgStreamSupportRef +//! \ingroup PkgStreamSupportIoFuncsWKT +//! +//! \brief Fills `polygon` from a WKT stream. //! -//! \brief `read_polygon_WKT()` fills `polygon` from a WKT stream. //! The first line starting with POLYGON in the stream will be used. //! //! \tparam Polygon is a `CGAL::General_polygon_with_holes_2`. @@ -312,10 +313,9 @@ bool read_polygon_WKT(std::istream& in, return !in.fail(); } -//! \ingroup PkgStreamSupportRef +//! \ingroup PkgStreamSupportIoFuncsWKT //! -//! \brief `read_multi_polygon_WKT()` overwrites the content of a `MultiPolygon` -//! with the first line starting with MULTIPOLYGON in the stream. +//! \brief Overwrites the content of a `MultiPolygon` with the first line starting with MULTIPOLYGON in the stream. //! //! \tparam MultiPolygon must be a model of `RandomAccessRange` of `CGAL::General_polygon_with_holes_2`, //! and have: @@ -368,9 +368,9 @@ bool read_multi_polygon_WKT(std::istream& in, return !in.fail(); } -//! \ingroup PkgStreamSupportRef +//! \ingroup PkgStreamSupportIoFuncsWKT //! -//! \brief `write_point_WKT()` writes `point` into a WKT stream. +//! \brief Writes `point` into a WKT stream. //! //! \tparam Point is a `CGAL::Point_2` //! @@ -392,11 +392,11 @@ std::ostream& write_point_WKT(std::ostream& out, return out; } -//! \ingroup PkgStreamSupportRef +//! \ingroup PkgStreamSupportIoFuncsWKT //! -//! \brief `write_polygon_WKT()` writes `poly` into a WKT stream. +//! \brief Writes `poly` into a WKT stream. //! -//! \tparam Polygon must be a `CGAL::General_polygon_with_holes_2` +//! \tparam Polygon must be a `CGAL::General_polygon_with_holes_2` //! //! \attention Only Cartesian Kernels with double or float as `FT` are supported. //! \attention This function is only available with boost versions starting at 1.56. @@ -416,9 +416,9 @@ std::ostream& write_polygon_WKT(std::ostream& out, return out; } -//! \ingroup PkgStreamSupportRef +//! \ingroup PkgStreamSupportIoFuncsWKT //! -//! \brief `write_linestring_WKT()` writes the content of `ls` into a WKT stream. +//! \brief Writes the content of `ls` into a WKT stream. //! //! \tparam LineString must be a `RandomAccessRange` of `CGAL::Point_2`. //! @@ -441,9 +441,9 @@ std::ostream& write_linestring_WKT(std::ostream& out, return out; } -//! \ingroup PkgStreamSupportRef +//! \ingroup PkgStreamSupportIoFuncsWKT //! -//! \brief `write_multi_point_WKT()` writes the content of `mp` into a WKT stream. +//! \brief Writes the content of `mp` into a WKT stream. //! //! \tparam MultiPoint must be a `RandomAccessRange` of `CGAL::Point_2`. //! @@ -466,9 +466,9 @@ std::ostream& write_multi_point_WKT(std::ostream& out, return out; } -//! \ingroup PkgStreamSupportRef +//! \ingroup PkgStreamSupportIoFuncsWKT //! -//! \brief `write_multi_polygon_WKT()` writes the content of `polygons` into a WKT stream. +//! \brief Writes the content of `polygons` into a WKT stream. //! //! \tparam MultiPolygon must be a `RandomAccessRange` of `CGAL::General_polygon_with_holes_2`. //! @@ -491,9 +491,9 @@ std::ostream& write_multi_polygon_WKT(std::ostream& out, return out; } -//! \ingroup PkgStreamSupportRef +//! \ingroup PkgStreamSupportIoFuncsWKT //! -//! \brief `write_multi_linestring_WKT()` writes the content of `mls` into a WKT stream. +//! \brief Writes the content of `mls` into a WKT stream. //! //! \tparam MultiLineString must be a `RandomAccessRange` of `LineString`. //! @@ -527,11 +527,10 @@ std::ostream& write_multi_linestring_WKT(std::ostream& out, return out; } -//! \ingroup IOstreamFunctions +//! \ingroup PkgStreamSupportIoFuncsWKT //! -//! reads the content of a WKT stream and fills -//! `points`, `polylines` and `polygons` with all the POINT, MULTIPOINT, -//! LINESTRING, MULTILINESTRING, POLYGON and MULTIPOLYGON it finds in `input`. +//! Reads the content of a WKT stream and fills `points`, `polylines` and `polygons` +//! with all the POINT, MULTIPOINT, LINESTRING, MULTILINESTRING, POLYGON and MULTIPOLYGON it finds in `input`. //! //! \tparam MultiPoint must be a model of `RandomAccessRange` of `CGAL::Point_2` or `CGAL::Point_3`. //! \tparam MultiLineString must be a `RandomAccessRange` of `Linestring`. @@ -619,7 +618,8 @@ bool read_WKT(std::istream& is, return !is.fail(); } -} // namespace CGAL CGAL +} // namespace CGAL #endif // BOOST VERSION CHECKS + #endif // CGAL_IO_WKT_H diff --git a/Stream_support/include/CGAL/IO/polygon_soup_io.h b/Stream_support/include/CGAL/IO/polygon_soup_io.h index ffeb88be77d..1c0ed6712e3 100644 --- a/Stream_support/include/CGAL/IO/polygon_soup_io.h +++ b/Stream_support/include/CGAL/IO/polygon_soup_io.h @@ -54,7 +54,15 @@ std::string get_file_extension(const std::string fname) /*! * \ingroup IOstreamFunctions * - * \brief reads a polygon soup from a file. + * \brief Reads a polygon soup from a file. + * + * Supported file formats are the following: + * - `.off` (\ref IOStreamOFF "OFF file format") + * - `.obj` (\ref IOStreamOBJ "OBJ file format") + * - `.stl` (\ref IOStreamSTL "STL file format") + * - `.ply` (\ref IOStreamPLY "PLY file format") + * - `.ts` (\ref IOStreamGocad "GOCAD file format") + * - `.vtp` (\ref IOStreamVTK "VTK file format") * * \tparam PolygonRange a model of the concept `RandomAccessContainer` * whose value_type is a model of the concept `RandomAccessContainer` @@ -62,18 +70,13 @@ std::string get_file_extension(const std::string fname) * \tparam PointRange a model of the concept `RandomAccessContainer` * whose value type is the point type * - * \param fname the name of the file. Its extension must be one of the following : - * `.off` (\ref IOStreamOFF "OFF file format") , `.obj` (\ref IOStreamOBJ "OBJ file format"), - * `.stl` (\ref IOStreamSTL "STL file format"), `.ply` (\ref IOStreamPLY "PLY file format") - * or `.ts` (\ref IOStreamGocad "GOCAD file format"). + * \param fname the name of the file. * \param polygons each element in the range describes a polygon * using the indices of the vertices. * \param points points of the soup of polygons - * \param verbose: if `true`, will output warnings and error messages. Default is `false`. + * \param verbose: if `true`, will output warnings and error messages. * * \return `true` if reading was successful, `false` otherwise. - * - * \see \ref IOStreamOFF */ template bool read_polygon_soup(const std::string& fname, @@ -116,7 +119,15 @@ bool read_polygon_soup(const std::string& fname, /*! * \ingroup IOstreamFunctions * - * \brief writes a polygon soup in a file. + * \brief Writes the content of `points` and `polygons` in a file. + * + * Supported file formats are the following: + * - `.off` (\ref IOStreamOFF "OFF file format") + * - `.obj` (\ref IOStreamOBJ "OBJ file format") + * - `.stl` (\ref IOStreamSTL "STL file format") + * - `.ply` (\ref IOStreamPLY "PLY file format") + * - `.ts` (\ref IOStreamGocad "GOCAD file format") + * - `.vtp` (\ref IOStreamVTK "VTK file format") * * \tparam PolygonRange a model of the concept `RandomAccessContainer` * whose value_type is a model of the concept `RandomAccessContainer` @@ -124,18 +135,13 @@ bool read_polygon_soup(const std::string& fname, * \tparam PointRange a model of the concept `RandomAccessContainer` * whose value type is the point type * - * \param fname the name of the file. Its extension must be one of the following : - * `.off` (\ref IOStreamOFF "OFF file format") , `.obj` (\ref IOStreamOBJ "OBJ file format"), - * `.stl` (\ref IOStreamSTL "STL file format"), `.ply` (\ref IOStreamPLY "PLY file format") - * or `.ts` (\ref IOStreamGocad "GOCAD file format"). + * \param fname the name of the file. * \param polygons each element in the range describes a polygon * using the indices of the vertices. * \param points points of the soup of polygons - * \param verbose: if `true`, will output warnings and error messages. Default is `false`. + * \param verbose: if `true`, will output warnings and error messages. * * \return `true` if writing was successful, `false` otherwise. - * - * \see \ref IOStreamOFF */ template bool write_polygon_soup(const std::string& fname, @@ -166,7 +172,7 @@ bool write_polygon_soup(const std::string& fname, return write_VTP(fname, points, polygons); #endif #ifdef CGAL_LINKED_WITH_3MF - else if(ext == "ts") + else if(ext == "3mf") return write_3MF(fname, points, polygons); #endif