Remove operator>> and << from `File_header_OFF_extended`.

This commit is contained in:
Maxime Gimeno 2021-03-10 13:54:09 +01:00
parent 2d5678bc91
commit ae7559442a
2 changed files with 2 additions and 74 deletions

View File

@ -210,7 +210,6 @@ CGAL_INLINE_FUNCTION
std::ostream& operator<<( std::ostream& out, const File_header_OFF& h) {
if ( h.comments()) {
out << "# Output of a CGAL tool\n";
out << static_cast<const File_header_extended_OFF&>( h);
}
if ( h.has_textures())
out << "ST";
@ -250,12 +249,8 @@ std::istream& operator>>( std::istream& in, File_header_OFF& h) {
h.set_off_header( false);
char c;
while ( (in >> c) && c == '#') {
if ( in.get(c) && c == 'C' &&
in.get(c) && c == 'B' &&
in.get(c) && c == 'P') {
in >> static_cast<File_header_extended_OFF&>( h);
} else if ( c != '\n')
in >> skip_until_EOL;
if ( c != '\n')
in >> skip_until_EOL;
}
if ( ! in )
return in;

View File

@ -133,72 +133,5 @@ operator+=( const File_header_extended_OFF& header) {
return *this;
}
#define CGAL_OUT(item) out << "# " #item " " << h.item() << '\n'
#define CGAL_OUTBOOL(item) out << "# " #item " " <<(h.item() ? '1':'0') << '\n'
// Write extended header incl. CGAL/ENDCBP keywords.
CGAL_INLINE_FUNCTION
std::ostream& operator<<( std::ostream& out,
const File_header_extended_OFF& h) {
out << "#CBP\n";
CGAL_OUTBOOL( polyhedral_surface);
CGAL_OUT( halfedges);
CGAL_OUTBOOL( triangulated);
CGAL_OUTBOOL( non_empty_facets);
CGAL_OUTBOOL( terrain);
CGAL_OUTBOOL( normalized_to_sphere);
CGAL_OUT( radius);
CGAL_OUTBOOL( rounded);
CGAL_OUT( rounded_bits);
out << "# ENDCBP\n" << std::endl;
return out;
}
#undef CGAL_OUT
#undef OUTBOOL
#define CGAL_IN(item,type) \
else if ( std::strcmp( keyword, #item) == 0) { \
type t; \
in >> t; \
h.set_##item( t); \
}
#define CGAL_INBOOL(item) \
else if ( std::strcmp( keyword, #item) == 0) { \
in >> c; \
h.set_##item( c == '1'); \
}
// Scan extended header. The CBP keyword must be read already.
CGAL_INLINE_FUNCTION
std::istream& operator>>( std::istream& in, File_header_extended_OFF& h) {
const int max_keyword = 42;
char c;
char keyword[max_keyword] = "";
in >> keyword;
while ( in && std::strcmp( keyword, "ENDCBP") != 0) {
if ( std::strcmp( keyword, "#") == 0)
;
CGAL_INBOOL( polyhedral_surface)
CGAL_IN( halfedges, int)
CGAL_INBOOL( triangulated)
CGAL_INBOOL( non_empty_facets)
CGAL_INBOOL( terrain)
CGAL_INBOOL( normalized_to_sphere)
CGAL_IN( radius, double)
CGAL_INBOOL( rounded)
CGAL_IN( rounded_bits, int)
else if ( h.verbose()) {
std::cerr << "warning: File_header_extended_OFF: unknown key '"
<< keyword << "'." << std::endl;
}
in >> keyword;
}
in >> skip_until_EOL >> skip_comment_OFF;
return in;
}
#undef CGAL_IN
#undef CGAL_INBOOL
} //namespace CGAL
// EOF //