57 #include <OpenMesh/Core/System/config.h>
59 #if defined (OPENMESH_TRIMESH_ARRAY_KERNEL_HH) || \
60 defined (OPENMESH_POLYMESH_ARRAY_KERNEL_HH)
61 # error "Include MeshIO.hh before including a mesh type!"
64 #include <OpenMesh/Core/IO/SR_store.hh>
65 #include <OpenMesh/Core/IO/IOManager.hh>
66 #include <OpenMesh/Core/IO/importer/ImporterT.hh>
67 #include <OpenMesh/Core/IO/exporter/ExporterT.hh>
102 template <
class Mesh>
105 const std::string& _filename)
108 return read_mesh(_mesh, _filename, opt,
true);
132 template <
class Mesh>
135 const std::string& _filename,
139 if (_clear) _mesh.clear();
141 return IOManager().
read(_filename, importer, _opt);
164 template <
class Mesh>
168 const std::string& _ext,
172 if (_clear) _mesh.clear();
174 return IOManager().
read(_is,_ext, importer, _opt);
198 template <
class Mesh>
200 const std::string& _filename,
202 std::streamsize _precision = 6)
205 return IOManager().
write(_filename, exporter, _opt, _precision);
230 template <
class Mesh>
233 const std::string& _ext,
235 std::streamsize _precision = 6)
238 return IOManager().
write(_os,_ext, exporter, _opt, _precision);
259 template <
class Mesh>
261 const std::string& _ext,
265 return IOManager().binary_size(_ext, exporter, _opt);
278 #if defined(OM_STATIC_BUILD) || defined(ARCH_DARWIN)
279 # include <OpenMesh/Core/IO/IOInstances.hh>
This class template provides an importer module for OpenMesh meshes.
Definition: ImporterT.hh:85
Set options for reader/writer modules.
Definition: Options.hh:95
bool read(const std::string &_filename, BaseImporter &_bi, Options &_opt)
Read a mesh from file _filename.
Definition: IOManager.cc:92
bool read_mesh(Mesh &_mesh, const std::string &_filename)
Read a mesh from file _filename.
Definition: MeshIO.hh:104
No options.
Definition: Options.hh:104
bool write(const std::string &_filename, BaseExporter &_be, Options _opt=Options::Default, std::streamsize _precision=6)
Write a mesh to file _filename.
Definition: IOManager.cc:142
This class template provides an exporter module for OpenMesh meshes.
Definition: ExporterT.hh:87
bool write_mesh(const Mesh &_mesh, const std::string &_filename, Options _opt=Options::Default, std::streamsize _precision=6)
Write a mesh to the file _filename.
Definition: MeshIO.hh:199
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition: MeshItems.hh:64
size_t binary_size(const Mesh &_mesh, const std::string &_ext, Options _opt=Options::Default)
Get binary size of data.
Definition: MeshIO.hh:260