Clean code

This commit is contained in:
Mael Rouxel-Labbé 2020-01-25 18:18:31 +01:00
parent 9247fdab02
commit 9e2289c63d
9 changed files with 279 additions and 229 deletions

View File

@ -57,7 +57,6 @@ bool write_WRL(const char* fname, const FaceGraph& g) { return write_WRL(fname,
template <typename FaceGraph> template <typename FaceGraph>
bool write_WRL(const std::string& fname, const FaceGraph& g) { return write_WRL(fname, g, parameters::all_default()); } bool write_WRL(const std::string& fname, const FaceGraph& g) { return write_WRL(fname, g, parameters::all_default()); }
} // namespace CGAL } // namespace CGAL
#endif // CGAL_BGL_IO_WRL_H #endif // CGAL_BGL_IO_WRL_H

View File

@ -18,65 +18,71 @@
#define CGAL_IO_GENERIC_WRITER_H #define CGAL_IO_GENERIC_WRITER_H
#include <CGAL/basic.h> #include <CGAL/basic.h>
#include <iterator> #include <iterator>
namespace CGAL { namespace CGAL {
template <class Writer> template <class Writer>
class I_Generic_writer_vertex_proxy { class I_Generic_writer_vertex_proxy
Writer& m_writer; {
Writer& m_writer;
public: public:
typedef typename Writer::Point Point; typedef typename Writer::Point Point;
I_Generic_writer_vertex_proxy( Writer& w) : m_writer(w) {} I_Generic_writer_vertex_proxy(Writer& w) : m_writer(w) {}
void operator= ( const Point& p) { m_writer.write_vertex(p); } void operator=(const Point& p) { m_writer.write_vertex(p); }
}; };
template <class Writer> template <class Writer>
class I_Generic_writer_vertex_iterator class I_Generic_writer_vertex_iterator
{ {
Writer& m_writer; Writer& m_writer;
public: public:
typedef std::output_iterator_tag iterator_category; typedef std::output_iterator_tag iterator_category;
typedef typename Writer::Point value_type; typedef typename Writer::Point value_type;
typedef std::ptrdiff_t difference_type; typedef std::ptrdiff_t difference_type;
typedef value_type* pointer; typedef value_type* pointer;
typedef value_type& reference; typedef value_type& reference;
typedef I_Generic_writer_vertex_proxy< Writer> Proxy; typedef I_Generic_writer_vertex_proxy< Writer> Proxy;
typedef I_Generic_writer_vertex_iterator< Writer> Self; typedef I_Generic_writer_vertex_iterator< Writer> Self;
I_Generic_writer_vertex_iterator( Writer& w) : m_writer(w) {} I_Generic_writer_vertex_iterator(Writer& w) : m_writer(w) {}
Self& operator++() { return *this; } Self& operator++() { return *this; }
Self& operator++(int) { return *this; } Self& operator++(int) { return *this; }
Proxy operator*() const { return Proxy( m_writer); } Proxy operator*() const { return Proxy(m_writer); }
}; };
template <class Writer> template <class Writer>
class I_Generic_writer_facet_proxy { class I_Generic_writer_facet_proxy
Writer& m_writer; {
Writer& m_writer;
public: public:
I_Generic_writer_facet_proxy( Writer& w) : m_writer(w) {} I_Generic_writer_facet_proxy(Writer& w) : m_writer(w) { }
void operator= ( std::size_t i) { m_writer.write_facet_index(i); } void operator= (std::size_t i) { m_writer.write_facet_index(i); }
}; };
template <class Writer> template <class Writer>
class I_Generic_writer_facet_iterator class I_Generic_writer_facet_iterator
{ {
Writer& m_writer; Writer& m_writer;
public: public:
typedef std::output_iterator_tag iterator_category; typedef std::output_iterator_tag iterator_category;
typedef std::size_t value_type; typedef std::size_t value_type;
typedef std::ptrdiff_t difference_type; typedef std::ptrdiff_t difference_type;
typedef value_type* pointer; typedef value_type* pointer;
typedef value_type& reference; typedef value_type& reference;
typedef I_Generic_writer_facet_proxy<Writer> Proxy; typedef I_Generic_writer_facet_proxy<Writer> Proxy;
typedef I_Generic_writer_facet_iterator<Writer> Self; typedef I_Generic_writer_facet_iterator<Writer> Self;
I_Generic_writer_facet_iterator( Writer& w) : m_writer(w) {} I_Generic_writer_facet_iterator(Writer& w) : m_writer(w) { }
Self& operator++() { return *this; } Self& operator++() { return *this; }
Self& operator++(int) { return *this; } Self& operator++(int) { return *this; }
Proxy operator*() const { return Proxy( m_writer); } Proxy operator*() const { return Proxy(m_writer); }
}; };
// The Generic_writer class contains also the state necessary for all // The Generic_writer class contains also the state necessary for all
@ -86,76 +92,93 @@ public:
// the situation where the iterators are copied by value. // the situation where the iterators are copied by value.
template < class Writer, class Pt > template < class Writer, class Pt >
class Generic_writer { class Generic_writer
Writer m_writer; {
std::size_t m_vertices; Writer m_writer;
std::size_t m_halfedges; std::size_t m_vertices;
std::size_t m_facets; std::size_t m_halfedges;
std::size_t m_facets;
std::size_t m_vcnt;
std::size_t m_fcnt;
std::size_t m_icnt;
std::size_t m_vcnt;
std::size_t m_fcnt;
std::size_t m_icnt;
public: public:
typedef Pt Point; typedef Pt Point;
typedef Generic_writer< Writer, Pt> Self; typedef Generic_writer< Writer, Pt> Self;
typedef I_Generic_writer_vertex_iterator<Self> Vertex_iterator; typedef I_Generic_writer_vertex_iterator<Self> Vertex_iterator;
typedef I_Generic_writer_facet_iterator<Self> Facet_iterator; typedef I_Generic_writer_facet_iterator<Self> Facet_iterator;
Generic_writer( const Writer& writer, std::ostream& out, Generic_writer(const Writer& writer, std::ostream& out,
std::size_t v, std::size_t h, std::size_t f) std::size_t v, std::size_t h, std::size_t f)
: m_writer( writer), m_vertices(v), m_halfedges(h), m_facets(f), :
m_vcnt(0), m_fcnt(0), m_icnt(0) m_writer(writer),
m_vertices(v), m_halfedges(h), m_facets(f),
m_vcnt(0), m_fcnt(0), m_icnt(0)
{
m_writer.write_header(out, v, h, f);
}
const Writer& writer() const { return m_writer; }
std::size_t size_of_vertices() const { return m_vertices; }
std::size_t size_of_halfedges() const { return m_halfedges; }
std::size_t size_of_facets() const { return m_facets; }
Vertex_iterator vertices_begin() { return Vertex_iterator(*this); }
Facet_iterator facets_begin()
{
if(m_vcnt != m_vertices)
{ {
m_writer.write_header( out, v, h, f); std::cerr << "error: Generic_writer: wrong number of vertices written, "
} << m_vcnt << " instead of " << m_vertices << "." << std::endl;
const Writer& writer() const { return m_writer; } m_writer.out().clear(std::ios::badbit);
std::size_t size_of_vertices() const { return m_vertices; }
std::size_t size_of_halfedges() const { return m_halfedges; }
std::size_t size_of_facets() const { return m_facets; }
Vertex_iterator vertices_begin() { return Vertex_iterator( *this); }
Facet_iterator facets_begin() {
if ( m_vcnt != m_vertices) {
std::cerr << "error: Generic_writer: wrong number of "
"vertices written, " << m_vcnt << " instead of "
<< m_vertices << "." << std::endl;
m_writer.out().clear( std::ios::badbit);
}
m_writer.write_facet_header();
if ( m_facets == 0)
m_writer.write_footer();
return Facet_iterator( *this);
} }
// Interface used by the iterators and their proxies. m_writer.write_facet_header();
void write_vertex( const Point& p) { if(m_facets == 0)
++m_vcnt; m_writer.write_footer();
m_writer.write_vertex( ::CGAL::to_double( p.x()),
::CGAL::to_double( p.y()), return Facet_iterator(*this);
::CGAL::to_double( p.z())); }
// Interface used by the iterators and their proxies.
void write_vertex(const Point& p)
{
++m_vcnt;
m_writer.write_vertex(::CGAL::to_double(p.x()),
::CGAL::to_double(p.y()),
::CGAL::to_double(p.z()));
}
void write_facet_index(std::size_t i)
{
if(m_fcnt > m_facets)
{
std::cerr << "error: Generic_writer: too many facets written."
<< std::endl;
m_writer.out().clear(std::ios::badbit);
} }
void write_facet_index( std::size_t i) {
if ( m_fcnt > m_facets) { if(m_icnt == 0)
std::cerr << "error: Generic_writer: too many facets written." {
<< std::endl; m_writer.write_facet_begin(i);
m_writer.out().clear( std::ios::badbit); m_icnt = i;
}
if ( m_icnt == 0) {
m_writer.write_facet_begin( i);
m_icnt = i;
} else {
m_writer.write_facet_vertex_index( i);
m_icnt --;
if ( m_icnt == 0) {
m_writer.write_facet_end();
m_fcnt ++;
if (m_fcnt == m_facets)
m_writer.write_footer();
}
}
} }
else
{
m_writer.write_facet_vertex_index(i);
m_icnt--;
if(m_icnt == 0)
{
m_writer.write_facet_end();
m_fcnt++;
if(m_fcnt == m_facets)
m_writer.write_footer();
}
}
}
}; };
} //namespace CGAL } //namespace CGAL
#endif // CGAL_IO_GENERIC_WRITER_H //
// EOF // #endif // CGAL_IO_GENERIC_WRITER_H

View File

@ -47,7 +47,7 @@ public:
void write_footer() const { out() << "\n# End of Wavefront obj format #" << std::endl; } void write_footer() const { out() << "\n# End of Wavefront obj format #" << std::endl; }
void write_vertex(const double& x, const double& y, const double& z) { void write_vertex(const double x, const double y, const double z) {
out() << "v " << x << ' ' << y << ' ' << z << '\n'; out() << "v " << x << ' ' << y << ' ' << z << '\n';
} }

View File

@ -179,8 +179,8 @@ bool read_OFF(std::istream& in,
*/ */
template <class Point_3, class Polygon_3> template <class Point_3, class Polygon_3>
bool write_OFF(std::ostream& out, bool write_OFF(std::ostream& out,
std::vector< Point_3 >& points, std::vector<Point_3>& points,
std::vector< Polygon_3 >& polygons) std::vector<Polygon_3>& polygons)
{ {
CGAL::File_writer_OFF writer; CGAL::File_writer_OFF writer;
writer.write_header(out, points.size(), 0, polygons.size()); writer.write_header(out, points.size(), 0, polygons.size());

View File

@ -25,86 +25,111 @@
namespace CGAL { namespace CGAL {
class CGAL_EXPORT File_writer_OFF { class File_writer_OFF
std::ostream* m_out; {
File_header_OFF m_header; std::ostream* m_out;
File_header_OFF m_header;
public: public:
File_writer_OFF( bool verbose = false) : m_header( verbose) {} File_writer_OFF(bool verbose = false) : m_header(verbose) {}
File_writer_OFF( const File_header_OFF& h) : m_header( h) {} File_writer_OFF(const File_header_OFF& h) : m_header(h) {}
std::ostream& out() { return *m_out; } std::ostream& out() { return *m_out; }
File_header_OFF& header() { return m_header; } File_header_OFF& header() { return m_header; }
const File_header_OFF& header() const { return m_header; } const File_header_OFF& header() const { return m_header; }
void write_header(std::ostream& out, void write_header(std::ostream& out,
std::size_t vertices, std::size_t vertices,
std::size_t /*halfedges*/, std::size_t /*halfedges*/,
std::size_t facets, std::size_t facets,
bool normals = false) bool normals = false)
{
m_out = &o;
m_header.set_vertices(vertices);
m_header.set_facets(facets);
m_header.set_normals(normals);
// Print header.
out() << m_header;
}
void write_footer()
{
if(m_header.ascii() && m_header.comments())
out() << "\n\n# End of OFF #";
out() << std::endl;
}
void write_vertex(const double x, const double y, const double z)
{
if(m_header.binary())
{ {
m_out = &o; I_Binary_write_big_endian_float32(out(), float(x));
I_Binary_write_big_endian_float32(out(), float(y));
I_Binary_write_big_endian_float32(out(), float(z));
}
else
{
out() << '\n' << x << ' ' << y << ' ' << z;
}
}
m_header.set_vertices(vertices); void write_normal(const double x, const double y, const double z)
m_header.set_facets(facets); {
m_header.set_normals(normals); if(m_header.binary())
{
I_Binary_write_big_endian_float32(out(), float(x));
I_Binary_write_big_endian_float32(out(), float(y));
I_Binary_write_big_endian_float32(out(), float(z));
}
else
{
out() << ' ' << ' ' << x << ' ' << y << ' ' << z;
}
}
// Print header. void write_facet_header()
out() << m_header; {
if(m_header.ascii())
{
if(m_header.no_comments())
{
out() << '\n';
}
else
{
out() << "\n\n# " << m_header.size_of_facets()
<< " facets\n";
out() << "# ------------------------------------------"
"\n\n";
}
} }
}
void write_footer() { void write_facet_begin(std::size_t no)
if ( m_header.ascii() && m_header.comments()) {
out() << "\n\n# End of OFF #"; if(m_header.binary())
out() << std::endl; I_Binary_write_big_endian_integer32(out(), static_cast<boost::int32_t>(no));
} else
void write_vertex( const double& x, const double& y, const double& z) { out() << no << ' ';
if ( m_header.binary()) { }
I_Binary_write_big_endian_float32( out(), float(x));
I_Binary_write_big_endian_float32( out(), float(y)); void write_facet_vertex_index(std::size_t index)
I_Binary_write_big_endian_float32( out(), float(z)); {
} else { if(m_header.binary())
out() << '\n' << x << ' ' << y << ' ' << z; I_Binary_write_big_endian_integer32(out(), static_cast<boost::int32_t>(index));
} else
} out() << ' ' << index;
void write_normal( const double& x, const double& y, const double& z) { }
if ( m_header.binary()) {
I_Binary_write_big_endian_float32( out(), float(x)); void write_facet_end()
I_Binary_write_big_endian_float32( out(), float(y)); {
I_Binary_write_big_endian_float32( out(), float(z)); if(m_header.binary())
} else { I_Binary_write_big_endian_integer32(out(), 0);
out() << ' ' << ' ' << x << ' ' << y << ' ' << z; else
} out() << '\n';
} }
void write_facet_header() {
if ( m_header.ascii()) {
if ( m_header.no_comments())
out() << '\n';
else {
out() << "\n\n# " << m_header.size_of_facets()
<< " facets\n";
out() << "# ------------------------------------------"
"\n\n";
}
}
}
void write_facet_begin( std::size_t no) {
if ( m_header.binary())
I_Binary_write_big_endian_integer32( out(), static_cast<boost::int32_t>(no));
else
out() << no << ' ';
}
void write_facet_vertex_index( std::size_t index) {
if ( m_header.binary())
I_Binary_write_big_endian_integer32( out(), static_cast<boost::int32_t>(index));
else
out() << ' ' << index;
}
void write_facet_end() {
if ( m_header.binary())
I_Binary_write_big_endian_integer32( out(), 0);
else
out() << '\n';
}
}; };
} //namespace CGAL } //namespace CGAL

View File

@ -15,7 +15,7 @@
// Author(s) : Lutz Kettner <kettner@mpi-sb.mpg.de> // Author(s) : Lutz Kettner <kettner@mpi-sb.mpg.de>
#ifndef CGAL_IO_FILE_WRITER_INVENTOR_H #ifndef CGAL_IO_FILE_WRITER_INVENTOR_H
#define CGAL_IO_FILE_WRITER_INVENTOR_H 1 #define CGAL_IO_FILE_WRITER_INVENTOR_H
#include <CGAL/IO/OI/Inventor_ostream.h> #include <CGAL/IO/OI/Inventor_ostream.h>
@ -25,24 +25,24 @@ namespace CGAL {
class File_writer_inventor class File_writer_inventor
{ {
std::ostream* m_out; Inventor_ostream_base* m_out;
std::size_t m_facets; std::size_t m_facets;
public: public:
File_writer_inventor() {} File_writer_inventor() {}
std::ostream& out() const { return *m_out; } std::ostream& out() const { return m_out->os(); }
void write_header(Inventor_ostream_base& o, void write_header(Inventor_ostream_base& o,
std::size_t vertices, std::size_t vertices,
std::size_t halfedges, std::size_t halfedges,
std::size_t facets) std::size_t facets)
{ {
m_out = &(o.os()); m_out = &o;
m_facets = facets; m_facets = facets;
out() << "# " << vertices << " vertices\n"; out() << "# " << vertices << " vertices\n";
out() << "# " << halfedges << " halfedges\n"; out() << "# " << halfedges << " halfedges\n";
out() << "# " << facets << " facets\n\n"; out() << "# " << facets << " facets\n\n";
out() << "Separator {\n" out() << "Separator {\n"
" Coordinate3 {\n" " Coordinate3 {\n"
" point [" << std::endl; " point [" << std::endl;
@ -55,7 +55,8 @@ public:
"} #Separator" << std::endl; "} #Separator" << std::endl;
} }
void write_vertex( const double& x, const double& y, const double& z) { void write_vertex( const double x, const double y, const double z)
{
out() << " " << x << ' ' << y << ' ' << z << ',' <<'\n'; out() << " " << x << ' ' << y << ' ' << z << ',' <<'\n';
} }
@ -73,6 +74,6 @@ public:
void write_facet_end() { out() << "-1,\n"; } void write_facet_end() { out() << "-1,\n"; }
}; };
} //namespace CGAL } // namespace CGAL
#endif // CGAL_IO_FILE_WRITER_INVENTOR_H #endif // CGAL_IO_FILE_WRITER_INVENTOR_H

View File

@ -28,25 +28,25 @@ namespace CGAL {
class File_writer_VRML_2 class File_writer_VRML_2
{ {
std::ostream* m_out; VRML_2_ostream* m_out;
std::size_t m_facets; std::size_t m_facets;
public: public:
File_writer_VRML_2() {} File_writer_VRML_2() {}
std::ostream& out() const { return *m_out; } std::ostream& out() const { return m_out->os(); }
void write_header(VRML_2_ostream& o, void write_header(VRML_2_ostream& o,
std::size_t vertices, std::size_t vertices,
std::size_t halfedges, std::size_t halfedges,
std::size_t facets) std::size_t facets)
{ {
m_out = &o.os(); m_out = &o;
m_facets = facets; m_facets = facets;
out() << " #-- Begin of Polygon Mesh\n"; out() << " #-- Begin of Polygon Mesh\n";
out() << " # " << vertices << " vertices\n"; out() << " # " << vertices << " vertices\n";
out() << " # " << halfedges << " halfedges\n"; out() << " # " << halfedges << " halfedges\n";
out() << " # " << facets << " facets\n"; out() << " # " << facets << " facets\n";
out() << " Group {\n" out() << " Group {\n"
" children [\n" " children [\n"
" Shape {\n" " Shape {\n"
@ -67,10 +67,12 @@ public:
" } #Group" << std::endl; " } #Group" << std::endl;
} }
void write_vertex( const double& x, const double& y, const double& z) { void write_vertex( const double& x, const double& y, const double& z)
{
out() << " " out() << " "
<< x << ' ' << y << ' ' << z << ',' << '\n'; << x << ' ' << y << ' ' << z << ',' << '\n';
} }
void write_facet_header() const void write_facet_header() const
{ {
out() << " ] #point\n" out() << " ] #point\n"
@ -78,9 +80,7 @@ public:
" coordIndex [" << std::endl; " coordIndex [" << std::endl;
} }
void write_facet_begin( std::size_t) { void write_facet_begin( std::size_t) { out() << " "; }
out() << " ";
}
void write_facet_vertex_index( std::size_t idx) { out() << idx << ',';} void write_facet_vertex_index( std::size_t idx) { out() << idx << ',';}
void write_facet_end() { out() << "-1,\n"; } void write_facet_end() { out() << "-1,\n"; }
}; };

View File

@ -26,80 +26,80 @@ namespace CGAL {
inline void inline void
I_Binary_write_integer32(std::ostream& out, boost::int32_t i) { I_Binary_write_integer32(std::ostream& out, boost::int32_t i) {
out.write( (char*)(&i), 4); out.write( (char*)(&i), 4);
} }
inline void inline void
I_Binary_write_float32(std::ostream& out, float f) { I_Binary_write_float32(std::ostream& out, float f) {
out.write( (char*)(&f), 4); out.write( (char*)(&f), 4);
} }
inline void inline void
I_Binary_read_integer32(std::istream& in, boost::int32_t& i) { I_Binary_read_integer32(std::istream& in, boost::int32_t& i) {
in.read( (char*)(&i), 4); in.read( (char*)(&i), 4);
} }
inline void inline void
I_Binary_read_float32(std::istream& in, float& f) { I_Binary_read_float32(std::istream& in, float& f) {
in.read( (char*)(&f), 4); in.read( (char*)(&f), 4);
} }
inline void inline void
I_swap_to_big_endian( boost::uint32_t& u) { I_swap_to_big_endian( boost::uint32_t& u) {
(void) u; (void) u;
#ifdef CGAL_LITTLE_ENDIAN #ifdef CGAL_LITTLE_ENDIAN
u = ((u >> 24) | (u << 24) | ((u >> 8) & 0xff00) | ((u << 8) & 0xff0000)); u = ((u >> 24) | (u << 24) | ((u >> 8) & 0xff00) | ((u << 8) & 0xff0000));
#endif #endif
} }
inline void inline void
I_swap_to_big_endian( boost::int32_t& i) { I_swap_to_big_endian( boost::int32_t& i) {
// We need to use a union instead of the 2 lines below, // We need to use a union instead of the 2 lines below,
// otherwise we get aliasing issues. // otherwise we get aliasing issues.
// boost::uint32_t& u = (boost::uint32_t&)i; // boost::uint32_t& u = (boost::uint32_t&)i;
// I_swap_to_big_endian( u); // I_swap_to_big_endian( u);
union { union {
boost::int32_t in; boost::int32_t in;
boost::uint32_t ui; boost::uint32_t ui;
} u; } u;
u.in = i; u.in = i;
I_swap_to_big_endian(u.ui); I_swap_to_big_endian(u.ui);
i = u.in; i = u.in;
} }
inline void inline void
I_swap_to_big_endian( float& f) { I_swap_to_big_endian( float& f) {
// We need to use a union instead of the 2 lines below, // We need to use a union instead of the 2 lines below,
// otherwise we get aliasing issues. // otherwise we get aliasing issues.
// boost::uint32_t& u = (boost::uint32_t&)f; // boost::uint32_t& u = (boost::uint32_t&)f;
// I_swap_to_big_endian( u); // I_swap_to_big_endian( u);
union { union {
boost::uint32_t ui; boost::uint32_t ui;
float fl; float fl;
} u; } u;
u.fl = f; u.fl = f;
I_swap_to_big_endian(u.ui); I_swap_to_big_endian(u.ui);
f = u.fl; f = u.fl;
} }
inline void inline void
I_Binary_write_big_endian_integer32(std::ostream& out, boost::int32_t i) { I_Binary_write_big_endian_integer32(std::ostream& out, boost::int32_t i) {
I_swap_to_big_endian( i); I_swap_to_big_endian( i);
out.write( (char*)(&i), 4); out.write( (char*)(&i), 4);
} }
inline void inline void
I_Binary_write_big_endian_float32(std::ostream& out, float f) { I_Binary_write_big_endian_float32(std::ostream& out, float f) {
I_swap_to_big_endian( f); I_swap_to_big_endian( f);
out.write( (char*)(&f), 4); out.write( (char*)(&f), 4);
} }
inline void inline void
I_Binary_read_big_endian_integer32(std::istream& in, boost::int32_t& i) { I_Binary_read_big_endian_integer32(std::istream& in, boost::int32_t& i) {
in.read( (char*)(&i), 4); in.read( (char*)(&i), 4);
I_swap_to_big_endian( i); I_swap_to_big_endian( i);
} }
inline void inline void
I_Binary_read_big_endian_float32(std::istream& in, float& f) { I_Binary_read_big_endian_float32(std::istream& in, float& f) {
in.read( (char*)(&f), 4); in.read( (char*)(&f), 4);
I_swap_to_big_endian( f); I_swap_to_big_endian( f);
} }
} //namespace CGAL } //namespace CGAL

View File

@ -13,10 +13,12 @@
#ifndef CGAL_SURFACE_MESH_IO_3MF_H #ifndef CGAL_SURFACE_MESH_IO_3MF_H
#define CGAL_SURFACE_MESH_IO_3MF_H #define CGAL_SURFACE_MESH_IO_3MF_H
#include <iostream>
#include <CGAL/IO/read_3mf.h>
#include <CGAL/Surface_mesh.h> #include <CGAL/Surface_mesh.h>
#include <CGAL/IO/3MF.h>
#include <iostream>
namespace CGAL{ namespace CGAL{
/*! /*!
* Extracts the surface meshes from an input 3mf file and appends it to `output`. * Extracts the surface meshes from an input 3mf file and appends it to `output`.