// Copyright (c) 2015 GeometryFactory (France). All rights reserved. // // This file is part of CGAL (www.cgal.org) // // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Andreas Fabri // Mael Rouxel-Labbé #ifndef CGAL_BGL_IO_WRL_H #define CGAL_BGL_IO_WRL_H #include #include #include #include #include #include namespace CGAL { //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// // Write /*! \ingroup PkgBGLIOFct \brief Writes the graph `g` into the output stream, using the \ref IOStreamWRL (VRML 2.0). \tparam Graph a model of `FaceListGraph` and `HalfedgeListGraph` \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" \param os the output stream \param g the graph to be output \param np optional \ref bgl_namedparameters "Named Parameters" described below \cgalNamedParamsBegin \cgalParamNBegin{vertex_point_map} \cgalParamDescription{a property map associating points to the vertices of `g`} \cgalParamType{a class model of `ReadablePropertyMap` with `boost::graph_traits::%vertex_descriptor` as key type and `%Point_3` as value type} \cgalParamDefault{`boost::get(CGAL::vertex_point, g)`} \cgalParamExtra{If this parameter is omitted, an internal property map for `CGAL::vertex_point_t` must be available in `Graph`.} \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. */ template bool write_WRL(std::ostream& os, const Graph& g, const CGAL_BGL_NP_CLASS& np) { IO::internal::Generic_facegraph_printer printer(os); return printer(g, np); } template bool write_WRL(const std::string& fname, const Graph& g, const CGAL_BGL_NP_CLASS& np) { return write_WRL(fname.c_str(), g, np); } template bool write_WRL(std::ostream& os, const Graph& g) { return write_WRL(os, g, parameters::all_default()); } template bool write_WRL(const char* fname, const Graph& g) { return write_WRL(fname, g, parameters::all_default()); } template bool write_WRL(const std::string& fname, const Graph& g) { return write_WRL(fname, g, parameters::all_default()); } } // namespace CGAL #endif // CGAL_BGL_IO_WRL_H