diff --git a/Polyhedron/doc/Polyhedron/CGAL/IO/Polyhedron_iostream.h b/Polyhedron/doc/Polyhedron/CGAL/IO/Polyhedron_iostream.h index 8114a141aa7a..a10c0e632bf2 100644 --- a/Polyhedron/doc/Polyhedron/CGAL/IO/Polyhedron_iostream.h +++ b/Polyhedron/doc/Polyhedron/CGAL/IO/Polyhedron_iostream.h @@ -75,7 +75,7 @@ This function overloads the generic function \link PkgBGLIoFuncsOFF `write_OFF(s \sa \link PkgPolyhedronIOFunc `operator>>(std::istream& in, Polyhedron_3& P)` \endlink */ template -bool write_OFF( std::ostream& out, Polyhedron_3& P); +bool write_OFF( std::ostream& out, const Polyhedron_3& P); /*! \relates Polyhedron_3 @@ -83,7 +83,7 @@ bool write_OFF( std::ostream& out, Polyhedron_3& P); \link PkgPolyhedronIOFunc `CGAL::IO::write_OFF(std::ostream&, Polyhedron_3&)` \endlink should be used instead. */ template -bool write_off( std::ostream& out, Polyhedron_3& P); +bool write_off( std::ostream& out, const Polyhedron_3& P); /*! \relates Polyhedron_3 @@ -91,7 +91,6 @@ bool write_off( std::ostream& out, Polyhedron_3& P); calls \link write_OFF() `write_OFF(out, P)` \endlink. */ template -std::ostream& operator<<( std::ostream& out, Polyhedron_3& P); +std::ostream& operator<<( std::ostream& out, const Polyhedron_3& P); } /* namespace CGAL */ - 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 c37ee06bf592..5badcf76a9c8 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 @@ -43,57 +43,57 @@ The following table lists some \cgal data structures that have I/O functions com Input Polygon Mesh `CGAL::Surface_mesh` - \link PkgSurfaceMeshIOFuncOFF CGAL::IO::read_OFF(const char*, CGAL::Surface_mesh&)\endlink + \link PkgSurfaceMeshIOFuncOFF CGAL::IO::read_OFF(const std::string&, CGAL::Surface_mesh&)\endlink `CGAL::Polyhedron_3` - \link PkgPolyhedronIOFunc CGAL::IO::read_OFF(const char*, CGAL::Polyhedron_3&)\endlink + \link PkgPolyhedronIOFunc CGAL::IO::read_OFF(const std::string&, CGAL::Polyhedron_3&)\endlink Any model of `MutableFaceGraph` - \link PkgBGLIoFuncsOFF CGAL::IO::read_OFF(const char*, Graph&)\endlink + \link PkgBGLIoFuncsOFF CGAL::IO::read_OFF(const std::string&, Graph&)\endlink Point Set `CGAL::Point_set_3` - \link PkgPointSet3IOOFF CGAL::IO::read_OFF(const char*, CGAL::Point_set_3&)\endlink + \link PkgPointSet3IOOFF CGAL::IO::read_OFF(const std::string&, CGAL::Point_set_3&)\endlink Any point range - \link PkgPointSetProcessing3IOOff CGAL::IO::read_OFF(const char*, PointRange&)\endlink + \link PkgPointSetProcessing3IOOff CGAL::IO::read_OFF(const std::string&, PointOutputIterator)\endlink Polygon Soup Any point + polygon range - \link PkgStreamSupportIoFuncsOFF CGAL::IO::read_OFF(const char*, PointRange&, PolygonRange&)\endlink + \link PkgStreamSupportIoFuncsOFF CGAL::IO::read_OFF(const std::string&, PointRange&, PolygonRange&)\endlink Output Polygon Mesh `CGAL::Surface_mesh` - \link PkgSurfaceMeshIOFuncOFF CGAL::IO::write_OFF(const char*, CGAL::Surface_mesh&)\endlink + \link PkgSurfaceMeshIOFuncOFF CGAL::IO::write_OFF(const std::string, CGAL::Surface_mesh&)\endlink `CGAL::Polyhedron_3` - \link PkgPolyhedronIOFunc CGAL::IO::write_OFF(const char*, CGAL::Polyhedron_3&)\endlink + \link PkgPolyhedronIOFunc CGAL::IO::write_OFF(const std::string&, const CGAL::Polyhedron_3&)\endlink Any model of `FaceGraph` - \link PkgBGLIoFuncsOFF CGAL::IO::write_OFF(const char*, Graph&)\endlink + \link PkgBGLIoFuncsOFF CGAL::IO::write_OFF(const std::string&, const Graph&)\endlink Point Set `CGAL::Point_set_3` - \link PkgPointSet3IOOFF CGAL::IO::write_OFF(const char*, CGAL::Point_set_3&)\endlink + \link PkgPointSet3IOOFF CGAL::IO::write_OFF(const std::string&, const CGAL::Point_set_3&)\endlink Any point range - \link PkgPointSetProcessing3IOOff CGAL::IO::write_OFF(const char*, PointRange&)\endlink + \link PkgPointSetProcessing3IOOff CGAL::IO::write_OFF(const std::string&, const PointRange&)\endlink Polygon Soup Any point + polygon range - \link PkgStreamSupportIoFuncsOFF CGAL::IO::write_OFF(const char*, PointRange&, PolygonRange&)\endlink + \link PkgStreamSupportIoFuncsOFF CGAL::IO::write_OFF(const std::string&, const PointRange&, const PolygonRange&)\endlink @@ -117,23 +117,23 @@ A precise specification of the format is available Input Polygon Mesh Any model of `MutableFaceGraph` - \link PkgBGLIoFuncsOBJ CGAL::IO::read_OBJ(const char*, Graph&)\endlink + \link PkgBGLIoFuncsOBJ CGAL::IO::read_OBJ(const std::string&, Graph&)\endlink Polygon Soup Any point + polygon range - \link PkgStreamSupportIoFuncsOBJ CGAL::IO::read_OBJ(const char*, PointRange&, PolygonRange&)\endlink + \link PkgStreamSupportIoFuncsOBJ CGAL::IO::read_OBJ(const std::string&, PointRange&, PolygonRange&)\endlink Output Polygon Mesh Any model of `FaceGraph` - \link PkgBGLIoFuncsOBJ CGAL::IO::write_OBJ(const char*, Graph&)\endlink + \link PkgBGLIoFuncsOBJ CGAL::IO::write_OBJ(const std::string&, const Graph&)\endlink Polygon Soup Any point + polygon range - \link PkgStreamSupportIoFuncsOBJ CGAL::IO::write_OBJ(const char*, PointRange&, PolygonRange&)\endlink + \link PkgStreamSupportIoFuncsOBJ CGAL::IO::write_OBJ(const std::string&, const PointRange&, const PolygonRange&)\endlink @@ -158,23 +158,23 @@ A precise specification of those formats is available Input Polygon Mesh Any model of `MutableFaceGraph` - \link PkgBGLIoFuncsSTL CGAL::IO::read_STL(const char*, Graph&)\endlink + \link PkgBGLIoFuncsSTL CGAL::IO::read_STL(const std::string&, Graph&)\endlink Polygon Soup Any point + polygon range - \link PkgStreamSupportIoFuncsSTL CGAL::IO::read_STL(const char*, PointRange&, TriangleRange&)\endlink + \link PkgStreamSupportIoFuncsSTL CGAL::IO::read_STL(const std::string&, PointRange&, TriangleRange&)\endlink Output Polygon Mesh Any model of `FaceGraph` - \link PkgBGLIoFuncsSTL CGAL::IO::write_STL(const char*, Graph&)\endlink + \link PkgBGLIoFuncsSTL CGAL::IO::write_STL(const std::string&, const Graph&)\endlink Polygon Soup Any point + polygon range - \link PkgStreamSupportIoFuncsSTL CGAL::IO::write_STL(const char*, PointRange&, TriangleRange&)\endlink + \link PkgStreamSupportIoFuncsSTL CGAL::IO::write_STL(const std::string&, const PointRange&, const TriangleRange&)\endlink @@ -202,49 +202,49 @@ A precise specification of those formats is available Input Polygon Mesh `CGAL::Surface_mesh` - \link PkgSurfaceMeshIOFuncPLY CGAL::IO::read_PLY(const char*, CGAL::Surface_mesh&)\endlink + \link PkgSurfaceMeshIOFuncPLY CGAL::IO::read_PLY(const std::string&, CGAL::Surface_mesh&)\endlink Any model of `MutableFaceGraph` - \link PkgBGLIoFuncsPLY CGAL::IO::read_PLY(const char*, Graph&)\endlink + \link PkgBGLIoFuncsPLY CGAL::IO::read_PLY(const std::string&, Graph&)\endlink Point Set `CGAL::Point_set_3` - \link PkgPointSet3IOPLY CGAL::IO::read_PLY(const char*, CGAL::Point_set_3&)\endlink + \link PkgPointSet3IOPLY CGAL::IO::read_PLY(const std::string&, CGAL::Point_set_3&)\endlink Any point range - \link PkgPointSetProcessing3IOPly CGAL::IO::read_PLY(const char*, PointRange&)\endlink + \link PkgPointSetProcessing3IOPly CGAL::IO::read_PLY(const std::string&, PointRange&)\endlink Polygon Soup Any point + polygon range - \link PkgStreamSupportIoFuncsPLY CGAL::IO::read_PLY(const char*, PointRange&, PolygonRange&)\endlink + \link PkgStreamSupportIoFuncsPLY CGAL::IO::read_PLY(const std::string&, PointRange&, PolygonRange&)\endlink Output Polygon Mesh `CGAL::Surface_mesh` - \link PkgSurfaceMeshIOFuncPLY CGAL::IO::write_PLY(const char*, CGAL::Surface_mesh&)\endlink + \link PkgSurfaceMeshIOFuncPLY CGAL::IO::write_PLY(const std::string&, const CGAL::Surface_mesh&)\endlink Any model of `FaceGraph` - \link PkgBGLIoFuncsPLY CGAL::IO::write_PLY(const char*, Graph&)\endlink + \link PkgBGLIoFuncsPLY CGAL::IO::write_PLY(const std::string&, const Graph&)\endlink Point Set `CGAL::Point_set_3` - \link PkgPointSet3IOPLY CGAL::IO::write_PLY(const char*, CGAL::Point_set_3&)\endlink + \link PkgPointSet3IOPLY CGAL::IO::write_PLY(const std::string&, const CGAL::Point_set_3&)\endlink Any point range - \link PkgPointSetProcessing3IOPly CGAL::IO::write_PLY(const char*, PointRange&)\endlink + \link PkgPointSetProcessing3IOPly CGAL::IO::write_PLY(const std::string&, const PointRange&)\endlink Polygon Soup Any point + polygon range - \link PkgStreamSupportIoFuncsPLY CGAL::IO::write_PLY(const char*, PointRange&, PolygonRange&)\endlink + \link PkgStreamSupportIoFuncsPLY CGAL::IO::write_PLY(const std::string&, const PointRange&, PolygonRange&)\endlink @@ -270,21 +270,21 @@ A precise specification of those formats is available Input Point Set `CGAL::Point_set_3` - \link PkgPointSet3IOLAS CGAL::IO::read_LAS(const char*, CGAL::Point_set_3&)\endlink + \link PkgPointSet3IOLAS CGAL::IO::read_LAS(const std::string&, CGAL::Point_set_3&)\endlink Any point range - \link PkgPointSetProcessing3IOLas CGAL::IO::read_LAS(const char*, PointRange&)\endlink + \link PkgPointSetProcessing3IOLas CGAL::IO::read_LAS(const std::string&, PointRange&)\endlink Output Point Set `CGAL::Point_set_3` - \link PkgPointSet3IOLAS CGAL::IO::write_LAS(const char*, CGAL::Point_set_3&)\endlink + \link PkgPointSet3IOLAS CGAL::IO::write_LAS(const std::string&, const CGAL::Point_set_3&)\endlink Any point range - \link PkgPointSetProcessing3IOLas CGAL::IO::write_LAS(const char*, PointRange&)\endlink + \link PkgPointSetProcessing3IOLas CGAL::IO::write_LAS(const std::string&, const PointRange&)\endlink @@ -303,21 +303,21 @@ of its coordinates and other properties. Only coordinates and normals are curren Input Point Set `CGAL::Point_set_3` - \link PkgPointSet3IOXYZ CGAL::IO::read_XYZ(const char*, CGAL::Point_set_3&)\endlink + \link PkgPointSet3IOXYZ CGAL::IO::read_XYZ(const std::string&, CGAL::Point_set_3&)\endlink Any point range - \link PkgPointSetProcessing3IOXyz CGAL::IO::read_XYZ(const char*, PointRange&)\endlink + \link PkgPointSetProcessing3IOXyz CGAL::IO::read_XYZ(const std::string&, PointRange&)\endlink Output Point Set `CGAL::Point_set_3` - \link PkgPointSet3IOXYZ CGAL::IO::write_XYZ(const char*, CGAL::Point_set_3&)\endlink + \link PkgPointSet3IOXYZ CGAL::IO::write_XYZ(const std::string&, const CGAL::Point_set_3&)\endlink Any point range - \link PkgPointSetProcessing3IOXyz CGAL::IO::write_XYZ(const char*, PointRange&)\endlink + \link PkgPointSetProcessing3IOXyz CGAL::IO::write_XYZ(const std::string&, const PointRange&)\endlink @@ -337,23 +337,23 @@ A precise specification of the format is available Input Polygon Mesh Any model of `MutableFaceGraph` - \link PkgBGLIoFuncsGOCAD CGAL::IO::read_GOCAD(const char*, Graph&)\endlink + \link PkgBGLIoFuncsGOCAD CGAL::IO::read_GOCAD(const std::string&, Graph&)\endlink Polygon Soup Any point + polygon range - \link PkgStreamSupportIoFuncsGOCAD CGAL::IO::read_GOCAD(const char*, PointRange&, PolygonRange&)\endlink + \link PkgStreamSupportIoFuncsGOCAD CGAL::IO::read_GOCAD(const std::string&, PointRange&, PolygonRange&)\endlink Output Polygon Mesh Any model of `FaceGraph` - \link PkgBGLIoFuncsGOCAD CGAL::IO::write_GOCAD(const char*, Graph&)\endlink + \link PkgBGLIoFuncsGOCAD CGAL::IO::write_GOCAD(const std::string&, const Graph&)\endlink Polygon Soup Any point + polygon range - \link PkgStreamSupportIoFuncsGOCAD CGAL::IO::write_GOCAD(const char*, PointRange&, PolygonRange&)\endlink + \link PkgStreamSupportIoFuncsGOCAD CGAL::IO::write_GOCAD(const std::string&, const PointRange&, const PolygonRange&)\endlink @@ -381,23 +381,23 @@ note that only versions `1.x` are currently supported in \cgal. Input Polygon Mesh `CGAL::Surface_mesh` - \link PkgSurfaceMeshIOFunc3MF CGAL::IO::read_3MF(const char*, Surface_meshRange&)\endlink + \link PkgSurfaceMeshIOFunc3MF CGAL::IO::read_3MF(const std::string&, Surface_meshRange&)\endlink Polygon Soup Any point + polygon range - \link PkgStreamSupportIoFuncs3MF CGAL::IO::read_3MF(const char*, PointRanges&, PolygonRanges&)\endlink + \link PkgStreamSupportIoFuncs3MF CGAL::IO::read_3MF(const std::string&, PointRanges&, PolygonRanges&)\endlink Output Polygon Mesh Any model of `FaceGraph` - \link PkgBGLIoFuncs3MF CGAL::IO::write_3MF(const char*, GraphRange&)\endlink + \link PkgBGLIoFuncs3MF CGAL::IO::write_3MF(const std::string&, const GraphRange&)\endlink Polygon Soup Any point + polygon range - \link PkgStreamSupportIoFuncs3MF CGAL::IO::write_3MF(const char*, PointRanges&, PolygonRanges&)\endlink + \link PkgStreamSupportIoFuncs3MF CGAL::IO::write_3MF(const std::string&, const PointRanges&, const PolygonRanges&)\endlink @@ -416,17 +416,17 @@ A precise specification of the format is available - 3D Manufacturing Format (3MF) + 3D VRML Format (WRL) Output Polygon Mesh Any model of `FaceGraph` - \link PkgBGLIoFuncsWRL CGAL::IO::write_WRL(const char*, Graph&)\endlink + \link PkgBGLIoFuncsWRL CGAL::IO::write_WRL(const std::string&, const Graph&)\endlink -\section IOStreamVTK VTK (VTU / VTP) File Formats +\section IOStreamVTK VTK (VTU / VTP / legacy) File Formats \attention \cgal needs to be configured with the VTK Libraries for this function to be available. @@ -440,36 +440,38 @@ The VTK libraries use different file formats to handle data structures, but we o - The `VTP` format can be used to store collections of points, lines, and triangles. In the VTK Libraries, it is the format - reserved to store `PolyData`, and in \cgal, we use it to store Polygon Meshes. + reserved to store `PolyData`, and in \cgal, we use it to store polygon meshes. + +We additionally provide a read function for the legacy non-XML `VTK` file format for polygon meshes. A precise specification of those formats is available at vtk.org. - + - + - + - + - +
VTK (VTU / VTP) File FormatsVTK (VTU / VTP / legacy) File Formats
Input Polygon Mesh Any model of `MutableFaceGraph`\link PkgBGLIoFuncsVTP CGAL::IO::read_VTP(const char*, Graph&)\endlink\link PkgBGLIoFuncsVTP CGAL::IO::read_VTP(const std::string&, Graph&)\endlink
Polygon Soup Any point + polygon range\link PkgStreamSupportIoFuncsVTP CGAL::IO::read_VTP(const char*, PointRange&, PolygonRange&)\endlink\link PkgStreamSupportIoFuncsVTK CGAL::IO::read_VTP(const std::string&, PointRange&, PolygonRange&)\endlink,
\link PkgStreamSupportIoFuncsVTK CGAL::IO::read_VTK(const std::string&, PointRange&, PolygonRange&)\endlink
Output Polygon Mesh Any model of `FaceGraph`\link PkgBGLIoFuncsVTP CGAL::IO::write_VTP(const char*, Graph&)\endlink\link PkgBGLIoFuncsVTP CGAL::IO::write_VTP(const std::string&, const Graph&)\endlink
Polygon Soup Any point + polygon range\link PkgStreamSupportIoFuncsVTP CGAL::IO::write_VTP(const char*, PointRange&, PolygonRange&)\endlink\link PkgStreamSupportIoFuncsVTK CGAL::IO::write_VTP(const std::string&, const PointRange&, const PolygonRange&)\endlink
diff --git a/Stream_support/doc/Stream_support/IOstream.txt b/Stream_support/doc/Stream_support/IOstream.txt index be0f7ee02a9a..fb4d9fe8afae 100644 --- a/Stream_support/doc/Stream_support/IOstream.txt +++ b/Stream_support/doc/Stream_support/IOstream.txt @@ -305,18 +305,18 @@ The following table shows which file formats can be read from and written for po Input `read_points()` - \link PkgPointSetProcessing3IOOff `read_OFF()` \endlink - \link PkgPointSetProcessing3IOXyz `read_XYZ()` \endlink - \link PkgPointSetProcessing3IOPly `read_PLY()` \endlink - \link PkgPointSetProcessing3IOLas `read_LAS()` \endlink + \link PkgPointSetProcessing3IOOff `CGAL::IO::read_OFF()` \endlink + \link PkgPointSetProcessing3IOXyz `GAL::IO::read_XYZ()` \endlink + \link PkgPointSetProcessing3IOPly `GAL::IO::read_PLY()` \endlink + \link PkgPointSetProcessing3IOLas `GAL::IO::read_LAS()` \endlink Output `write_points()` - \link PkgPointSetProcessing3IOOff `write_OFF()` \endlink - \link PkgPointSetProcessing3IOXyz `write_XYZ()` \endlink - \link PkgPointSetProcessing3IOPly `write_PLY()` \endlink - \link PkgPointSetProcessing3IOLas `write_LAS()` \endlink + \link PkgPointSetProcessing3IOOff `GAL::IO::write_OFF()` \endlink + \link PkgPointSetProcessing3IOXyz `GAL::IO::write_XYZ()` \endlink + \link PkgPointSetProcessing3IOPly `GAL::IO::write_PLY()` \endlink + \link PkgPointSetProcessing3IOLas `GAL::IO::write_LAS()` \endlink @@ -345,19 +345,19 @@ The file formats supported for `CGAL::Point_set_3` are detailed in the table bel Input - `read_point_set()` - \link PkgPointSet3IOOFF `read_OFF()` \endlink - \link PkgPointSet3IOXYZ `read_XYZ()` \endlink - \link PkgPointSet3IOPLY `read_PLY()` \endlink - \link PkgPointSet3IOLAS `read_LAS()` \endlink + `CGAL::IO::read_point_set()` + \link PkgPointSet3IOOFF `GAL::IO::read_OFF()` \endlink + \link PkgPointSet3IOXYZ `GAL::IO::read_XYZ()` \endlink + \link PkgPointSet3IOPLY `GAL::IO::read_PLY()` \endlink + \link PkgPointSet3IOLAS `GAL::IO::read_LAS()` \endlink Output - `write_point_set()` - \link PkgPointSet3IOOFF `write_OFF()` \endlink - \link PkgPointSet3IOXYZ `write_XYZ()` \endlink - \link PkgPointSet3IOPLY `write_PLY()` \endlink - \link PkgPointSet3IOLAS `write_LAS()` \endlink + `CGAL::IO::write_point_set()` + \link PkgPointSet3IOOFF `GAL::IO::write_OFF()` \endlink + \link PkgPointSet3IOXYZ `GAL::IO::write_XYZ()` \endlink + \link PkgPointSet3IOPLY `GAL::IO::write_PLY()` \endlink + \link PkgPointSet3IOLAS `GAL::IO::write_LAS()` \endlink @@ -381,27 +381,27 @@ their indices per face (i.e a vector of 3 integers represent a triangle face). Input - `read_polygon_soup()` - \link PkgStreamSupportIoFuncsOFF `read_OFF()` \endlink - \link PkgStreamSupportIoFuncsOBJ `read_OBJ()` \endlink - \link PkgStreamSupportIoFuncsSTL `read_STL()` \endlink - \link PkgStreamSupportIoFuncsPLY `read_PLY()` \endlink - \link PkgStreamSupportIoFuncsVTP `read_VTP()` \endlink - \link PkgStreamSupportIoFuncsGOCAD `read_GOCAD()` \endlink - \link PkgStreamSupportIoFuncsWKT `read_WKT()` \endlink - \link PkgStreamSupportIoFuncs3MF `read_3MF()` \endlink + `CGAL::IO::read_polygon_soup()` + \link PkgStreamSupportIoFuncsOFF `GAL::IO::read_OFF()` \endlink + \link PkgStreamSupportIoFuncsOBJ `GAL::IO::read_OBJ()` \endlink + \link PkgStreamSupportIoFuncsSTL `GAL::IO::read_STL()` \endlink + \link PkgStreamSupportIoFuncsPLY `GAL::IO::read_PLY()` \endlink + \link PkgStreamSupportIoFuncsVTK `GAL::IO::read_VTP()` \endlink + \link PkgStreamSupportIoFuncsGOCAD `GAL::IO::read_GOCAD()` \endlink + \link PkgStreamSupportIoFuncsWKT `GAL::IO::read_WKT()` \endlink + \link PkgStreamSupportIoFuncs3MF `GAL::IO::read_3MF()` \endlink Output - `write_polygon_soup()` - \link PkgStreamSupportIoFuncsOFF `write_OFF()` \endlink - \link PkgStreamSupportIoFuncsOBJ `write_OBJ()` \endlink - \link PkgStreamSupportIoFuncsSTL `write_STL()` \endlink - \link PkgStreamSupportIoFuncsPLY `write_PLY()` \endlink - \link PkgStreamSupportIoFuncsVTP `write_VTP()` \endlink - \link PkgStreamSupportIoFuncsGOCAD `write_GOCAD()` \endlink - \link PkgStreamSupportIoFuncsWKT `write_WKT()` \endlink - \link PkgStreamSupportIoFuncs3MF `write_3MF()` \endlink + `CGAL::IO::write_polygon_soup()` + \link PkgStreamSupportIoFuncsOFF `GAL::IO::write_OFF()` \endlink + \link PkgStreamSupportIoFuncsOBJ `GAL::IO::write_OBJ()` \endlink + \link PkgStreamSupportIoFuncsSTL `GAL::IO::write_STL()` \endlink + \link PkgStreamSupportIoFuncsPLY `GAL::IO::write_PLY()` \endlink + \link PkgStreamSupportIoFuncsVTK `GAL::IO::write_VTP()` \endlink + \link PkgStreamSupportIoFuncsGOCAD `GAL::IO::write_GOCAD()` \endlink + \link PkgStreamSupportIoFuncsWKT `GAL::IO::write_WKT()` \endlink + \link PkgStreamSupportIoFuncs3MF `GAL::IO::write_3MF()` \endlink @@ -424,23 +424,23 @@ The table above only lists the functions that work with any polygon mesh. Input - `read_polygon_mesh()` - `read_OFF()` - `read_STL()` - `read_VTP()` - `read_OBJ()` - `read_GOCAD()` + `CGAL::IO::read_polygon_mesh()` + `CGAL::IO::read_OFF()` + `CGAL::IO::read_STL()` + `CGAL::IO::read_VTP()` + `CGAL::IO::read_OBJ()` + `CGAL::IO::read_GOCAD()`
-
Output - `write_polygon_mesh()` - `write_OFF()` - `write_STL()` - `write_VTP()` - `write_OBJ()` - `write_GOCAD()` - `write_WRL()` + ``CGAL::IO::write_polygon_mesh()` + `CGAL::IO::write_OFF()` + `CGAL::IO::write_STL()` + `CGAL::IO::write_VTP()` + `CGAL::IO::write_OBJ()` + `CGAL::IO::write_GOCAD()` + `CGAL::IO::write_WRL()` @@ -478,17 +478,17 @@ from the standard \cgal I/O functions. Input -read_WKT() -read_multi_point_WKT() -read_multi_linestring_WKT() -read_multi_polygon_WKT() +`CGAL::IO::read_WKT()` +`CGAL::IO::read_multi_point_WKT()` +`CGAL::IO::read_multi_linestring_WKT()` +`CGAL::IO::read_multi_polygon_WKT()` Output
-
-write_multi_point_WKT() -write_multi_linestring_WKT() -write_multi_polygon_WKT() +`CGAL::IO::write_multi_point_WKT()` +`CGAL::IO::write_multi_linestring_WKT()` +`CGAL::IO::write_multi_polygon_WKT()` diff --git a/Stream_support/doc/Stream_support/PackageDescription.txt b/Stream_support/doc/Stream_support/PackageDescription.txt index 9d993ee47799..0cacc80c6312 100644 --- a/Stream_support/doc/Stream_support/PackageDescription.txt +++ b/Stream_support/doc/Stream_support/PackageDescription.txt @@ -20,7 +20,7 @@ /// I/O Functions for the \ref IOStreamOFF /// \ingroup IOstreamFunctions -/// \defgroup PkgStreamSupportIoFuncsVTP VTP I/O Functions +/// \defgroup PkgStreamSupportIoFuncsVTK VTK I/O Functions /// I/O Functions for the \ref IOStreamVTK /// \ingroup IOstreamFunctions @@ -96,9 +96,8 @@ the printing mode. - \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 PkgStreamSupportIoFuncsVTK I/O for VTK files \endlink - \link PkgStreamSupportIoFuncs3MF I/O for 3MF files \endlink - \link PkgStreamSupportIoFuncsWKT I/O for WKT files \endlink */ - diff --git a/Stream_support/include/CGAL/IO/VTK.h b/Stream_support/include/CGAL/IO/VTK.h index 585cc9d96854..fd8f7accc45d 100644 --- a/Stream_support/include/CGAL/IO/VTK.h +++ b/Stream_support/include/CGAL/IO/VTK.h @@ -26,8 +26,10 @@ #include #include #include +#include #include #include +#include #endif #if defined(CGAL_USE_VTK) || defined(DOXYGEN_RUNNING) @@ -114,14 +116,14 @@ bool read_VTP(const std::string& fname, } /*! - * \ingroup PkgStreamSupportIoFuncsVTP + * \ingroup PkgStreamSupportIoFuncsVTK * * \brief reads the content of the input file into `points` and `polygons`, using the \ref IOStreamVTK. * * \attention The polygon soup is not cleared, and the data from the file are appended. * * \tparam PointRange a model of the concepts `RandomAccessContainer` and `BackInsertionSequence` - * whose value type is the point type + * whose `value_type` is the point type * \tparam PolygonRange a model of the concepts `SequenceContainer` and `BackInsertionSequence` * whose `value_type` is itself a model of the concept `SequenceContainer` * and `BackInsertionSequence` whose `value_type` is an unsigned integer type @@ -140,6 +142,62 @@ bool read_VTP(const std::string& fname, PointRange& points, PolygonRange& polygo return read_VTP(fname, points, polygons, parameters::default_values()); } + +template +bool read_VTK(const std::string& fname, + PointRange& points, + PolygonRange& polygons, + const NamedParameters& np) +{ + std::ifstream test(fname); + if(!test.good()) + { + std::cerr<<"File doesn't exist."< data; + vtkSmartPointer obs = + vtkSmartPointer::New(); + vtkSmartPointer reader = + CGAL::IO::internal::read_vtk_file(fname,obs); + data = vtkPolyData::SafeDownCast(reader->GetOutput()); + if (!data) + data = vtkUnstructuredGrid::SafeDownCast(reader->GetOutput()); + + if (obs->GetError()) + return false; + + return internal::vtkPointSet_to_polygon_soup(data, points, polygons, np); +} + +/*! + * \ingroup PkgStreamSupportIoFuncsVTK + * + * \brief reads the content of the input file into `points` and `polygons`, using the legacy file format of the \ref IOStreamVTK. + * + * \attention The polygon soup is not cleared, and the data from the file are appended. + * + * \tparam PointRange a model of the concepts `RandomAccessContainer` and `BackInsertionSequence` + * whose `value_type` is the point type + * \tparam PolygonRange a model of the concepts `SequenceContainer` and `BackInsertionSequence` + * whose `value_type` is itself a model of the concept `SequenceContainer` + * and `BackInsertionSequence` whose `value_type` is an unsigned integer type + * convertible to `std::size_t` + * + * \param fname the path to the input file + * \param points points of the soup of polygons + * \param polygons a range of polygons. Each element in it describes a polygon + * using the indices of the points in `points`. + * + * \returns `true` if the reading was successful, `false` otherwise. + */ +template +bool read_VTK(const std::string& fname, PointRange& points, PolygonRange& polygons) +{ + return read_VTK(fname, points, polygons, parameters::default_values()); +} + //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// // Write @@ -340,11 +398,11 @@ void write_soup_polys_points(std::ostream& os, } // namespace internal /*! - * \ingroup PkgStreamSupportIoFuncsVTP + * \ingroup PkgStreamSupportIoFuncsVTK * * \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 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 unsigned integer type convertible to `std::size_t` @@ -428,11 +486,11 @@ bool write_VTP(std::ostream& os, } /*! - * \ingroup PkgStreamSupportIoFuncsVTP + * \ingroup PkgStreamSupportIoFuncsVTK * * \brief writes the content of `points` and `polygons` in a file named `fname`, using the \ref IOStreamVTK. * - * \tparam PointRange a model of the concept `RandomAccessContainer` whose value type is the point type + * \tparam PointRange a model of the concept `RandomAccessContainer` whose `valuetype` 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 unsigned integer type convertible to `std::size_t`