diff --git a/BGL/include/CGAL/boost/graph/IO/GOCAD.h b/BGL/include/CGAL/boost/graph/IO/GOCAD.h index 29cc93d5fec..7f3fb302bab 100644 --- a/BGL/include/CGAL/boost/graph/IO/GOCAD.h +++ b/BGL/include/CGAL/boost/graph/IO/GOCAD.h @@ -77,26 +77,6 @@ public: std::string color; }; -template -bool read_GOCAD(std::istream& in, - std::pair& name_and_color, - FaceGraph& g, - const CGAL_BGL_NP_CLASS& np, - bool verbose = true) -{ - typedef typename CGAL::GetVertexPointMap::type VPM; - typedef typename boost::property_traits::value_type Point; - - IO::internal::GOCAD_builder builder(in, verbose); - if(!builder(g, np)) - return false; - - name_and_color.first = builder.name; - name_and_color.second = builder.color; - - return is_valid(g); // @fixme keep validity check? -} - } // namespace internal } // namespace IO @@ -108,6 +88,7 @@ bool read_GOCAD(std::istream& in, /// \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" /// /// \param in the input stream +/// \param name_and_color name and color of the mesh /// \param g the graph to be built from the input data /// \param verbose whether extra information is printed when an incident occurs during reading /// \param np optional \ref bgl_namedparameters "Named Parameters" described below @@ -128,12 +109,29 @@ bool read_GOCAD(std::istream& in, /// \see \ref IOStreamGocad template bool read_GOCAD(std::istream& in, + std::pair& name_and_color, FaceGraph& g, const CGAL_BGL_NP_CLASS& np, bool verbose = true) +{ + typedef typename CGAL::GetVertexPointMap::type VPM; + typedef typename boost::property_traits::value_type Point; + + IO::internal::GOCAD_builder builder(in, verbose); + if(!builder(g, np)) + return false; + + name_and_color.first = builder.name; + name_and_color.second = builder.color; + + return is_valid(g); // @fixme keep validity check? +} + +template +bool read_GOCAD(std::istream& in, FaceGraph& g, const CGAL_BGL_NP_CLASS& np, bool verbose = true) { std::pair dummy; - return IO::internal::read_GOCAD(in, dummy, g, np, verbose); + return read_GOCAD(in, dummy, g, np, verbose); } template @@ -141,7 +139,7 @@ bool read_GOCAD(std::istream& in, std::pair& name_and_color, FaceGraph& g) { - return IO::internal::read_GOCAD(in, name_and_color, g, parameters::all_default()); + return read_GOCAD(in, name_and_color, g, parameters::all_default()); } /// \ingroup PkgBGLIOFct @@ -152,6 +150,7 @@ bool read_GOCAD(std::istream& in, /// \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters" /// /// \param fname the name of the input file +/// \param name_and_color name and color of the mesh /// \param g the graph to be built from the input data /// \param verbose whether extra information is printed when an incident occurs during reading /// \param np optional \ref bgl_namedparameters "Named Parameters" described below @@ -169,12 +168,21 @@ bool read_GOCAD(std::istream& in, /// /// \see \ref IOStreamGOCAD template -bool read_GOCAD(const char* fname, FaceGraph& g, const CGAL_BGL_NP_CLASS& np, bool verbose = true) +bool read_GOCAD(const char* fname, + std::pair& name_and_color, + FaceGraph& g, + const CGAL_BGL_NP_CLASS& np, + bool verbose = true) { std::ifstream in(fname); - std::pair dummy; + return read_GOCAD(in, name_and_color, g, np, verbose); +} - return IO::internal::read_GOCAD(in, dummy, g, np, verbose); +template +bool read_GOCAD(const char* fname, FaceGraph& g, const CGAL_BGL_NP_CLASS& np, bool verbose = true) +{ + std::pair dummy; + return read_GOCAD(fname, dummy, g, np, verbose); } template