50#ifndef __IOMANAGER_HH__
51#define __IOMANAGER_HH__
64#include <OpenMesh/Core/System/config.h>
65#include <OpenMesh/Core/IO/Options.hh>
66#include <OpenMesh/Core/IO/reader/BaseReader.hh>
67#include <OpenMesh/Core/IO/writer/BaseWriter.hh>
68#include <OpenMesh/Core/IO/importer/BaseImporter.hh>
69#include <OpenMesh/Core/IO/exporter/BaseExporter.hh>
70#include <OpenMesh/Core/Utils/SingletonT.hh>
102class OPENMESHDLLEXPORT _IOManager_
115 friend OPENMESHDLLEXPORT _IOManager_&
IOManager();
125 bool read(
const std::string& _filename,
135 bool read(std::istream& _filename,
136 const std::string& _ext,
147 bool write(
const std::string& _filename,
150 std::streamsize _precision = 6);
158 bool write(std::ostream& _filename,
159 const std::string& _ext,
162 std::streamsize _precision = 6);
166 bool can_read(
const std::string& _format )
const;
169 bool can_write(
const std::string& _format )
const;
172 size_t binary_size(
const std::string& _format,
203 void update_read_filters();
207 void update_write_filters();
219 reader_modules_.insert(_bl);
220 update_read_filters();
231 writer_modules_.insert(_bw);
232 update_write_filters();
239 const BaseWriter *find_writer(
const std::string& _format);
242 std::set<BaseReader*> reader_modules_;
245 std::set<BaseWriter*> writer_modules_;
248 std::string read_filters_;
251 std::string write_filters_;
260OPENMESHDLLEXPORT _IOManager_& IOManager();
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition MeshItems.hh:59
This namespace contains functions for reading and writing polygonal meshes and a list of supported fi...
Base class for exporter modules.
Definition BaseExporter.hh:85
Base class for importer modules.
Definition BaseImporter.hh:84
const std::string & qt_read_filters() const
Returns all readable file extension + descriptions in one string.
Definition IOManager.hh:189
bool can_write(const std::string &_format) const
Returns true if the format is supported by one of the writer modules.
Definition IOManager.cc:220
bool register_module(BaseWriter *_bw)
Registers a new writer module.
Definition IOManager.hh:229
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:143
const std::string & qt_write_filters() const
Returns all writeable file extension + descriptions in one string.
Definition IOManager.hh:196
bool read(const std::string &_filename, BaseImporter &_bi, Options &_opt)
Read a mesh from file _filename.
Definition IOManager.cc:87
friend _IOManager_ & IOManager()
Declare the singleton getter function as friend to access the private constructor and destructor.
Definition IOManager.cc:72
bool can_read(const std::string &_format) const
Returns true if the format is supported by one of the reader modules.
Definition IOManager.cc:201
bool register_module(BaseReader *_bl)
Registers a new reader module.
Definition IOManager.hh:217
Set options for reader/writer modules.
Definition Options.hh:92
@ Default
By default write persistent custom properties.
Definition Options.hh:117
Base class for reader modules.
Definition BaseReader.hh:87
Base class for all writer modules.
Definition BaseWriter.hh:84
virtual size_t binary_size(BaseExporter &, const Options &) const
Returns expected size of file if binary format is supported else 0.
Definition BaseWriter.hh:128