50 #include <OpenMesh/Core/System/config.h>
52 #if defined (OPENMESH_TRIMESH_ARRAY_KERNEL_HH) || \
53 defined (OPENMESH_POLYMESH_ARRAY_KERNEL_HH)
54 # error "Include MeshIO.hh before including a mesh type!"
57 #include <OpenMesh/Core/IO/SR_store.hh>
58 #include <OpenMesh/Core/IO/IOManager.hh>
59 #include <OpenMesh/Core/IO/importer/ImporterT.hh>
60 #include <OpenMesh/Core/IO/exporter/ExporterT.hh>
98 const std::string& _filename)
101 return read_mesh(_mesh, _filename, opt,
true);
125 template <
class Mesh>
128 const std::string& _filename,
132 if (_clear) _mesh.clear();
134 return IOManager().
read(_filename, importer, _opt);
157 template <
class Mesh>
161 const std::string& _ext,
165 if (_clear) _mesh.clear();
167 return IOManager().
read(_is,_ext, importer, _opt);
191 template <
class Mesh>
193 const std::string& _filename,
195 std::streamsize _precision = 6)
198 return IOManager().
write(_filename, exporter, _opt, _precision);
223 template <
class Mesh>
226 const std::string& _ext,
228 std::streamsize _precision = 6)
231 return IOManager().
write(_os,_ext, exporter, _opt, _precision);
252 template <
class Mesh>
254 const std::string& _ext,
258 return IOManager().binary_size(_ext, exporter, _opt);
271 #if defined(OM_STATIC_BUILD) || defined(ARCH_DARWIN)
272 # include <OpenMesh/Core/IO/IOInstances.hh>
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:192
No options.
Definition: Options.hh:97
Set options for reader/writer modules.
Definition: Options.hh:88
bool read(const std::string &_filename, BaseImporter &_bi, Options &_opt)
Read a mesh from file _filename.
Definition: IOManager.cc:84
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition: MeshItems.hh:56
This class template provides an importer module for OpenMesh meshes.
Definition: ImporterT.hh:78
size_t binary_size(const Mesh &_mesh, const std::string &_ext, Options _opt=Options::Default)
Get binary size of data.
Definition: MeshIO.hh:253
This class template provides an exporter module for OpenMesh meshes.
Definition: ExporterT.hh:80
bool read_mesh(Mesh &_mesh, const std::string &_filename)
Read a mesh from file _filename.
Definition: MeshIO.hh:97
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:134