& sm)
{
- write_off(os, sm);
+ if(file_format(os) == IO::OFF){
+ write_off(os, sm);
+ } else {
+ std::cerr << "For Surface_mesh we only support the OFF file format" << std::endl;
+ }
return os;
}
@@ -2022,7 +2023,8 @@ private: //------------------------------------------------------- private data
/// @endcond
/// \relates Surface_mesh
- /// Extracts the surface mesh from an input stream in Ascii OFF, COFF, NOFF, CNOFF format.
+ /// Extracts the surface mesh from an input stream in Ascii OFF, COFF, NOFF, CNOFF
+ /// format and appends it to the surface mesh `sm`.
/// The operator reads the point property as well as "v:normal", "v:color", and "f:color".
/// Vertex texture coordinates are ignored.
/// \pre `operator>>(std::istream&,const P&)` must be defined.
@@ -2134,10 +2136,7 @@ private: //------------------------------------------------------- private data
/// \relates Surface_mesh
- /// Extracts the surface mesh from an input stream in Ascii OFF, COFF, NOFF, CNOFF format.
- /// The operator reads the point property as well as "v:normal", "v:color", and "f:color".
- /// Vertex texture coordinates are ignored.
- /// \pre `operator>>(std::istream&,const P&)` must be defined.
+ /// This operator calls `read_off(std::istream& , CGAL::Surface_mesh)`.
template & sm)
{