OpenMesh::IO::_IOManager_ Class Reference

This is the real IOManager class that is later encapsulated by SingletonT to enforce its uniqueness. More...

`#include <OpenMesh/Core/IO/IOManager.hh>`

## Public Member Functions

bool | read (const std::string &_filename, BaseImporter &_bi, Options &_opt)
| Read a mesh from file _filename. More...
bool | read (std::istream &_filename, const std::string &_ext, BaseImporter &_bi, Options &_opt)
| Read a mesh from open std::istream _is. More...
bool | write (const std::string &_filename, BaseExporter &_be, Options _opt=Options::Default, std::streamsize _precision=6)
| Write a mesh to file _filename. More...
bool | write (std::ostream &_filename, const std::string &_ext, BaseExporter &_be, Options _opt=Options::Default, std::streamsize _precision=6)
| Write a mesh to open std::ostream _os. More...
bool | can_read (const std::string &_format) const
| Returns true if the format is supported by one of the reader modules.
bool | can_write (const std::string &_format) const
| Returns true if the format is supported by one of the writer modules.
size_t | binary_size (const std::string &_format, BaseExporter &_be, Options _opt=Options::Default)
const std::string & | qt_read_filters () const
| Returns all readable file extension + descriptions in one string. More...
const std::string & | qt_write_filters () const
| Returns all writeable file extension + descriptions in one string. More...
bool | register_module (BaseReader *_bl)
| Registers a new reader module. More...
bool | register_module (BaseWriter *_bw)
| Registers a new writer module. More...

## Friends

_IOManager_ & | IOManager ()
| Declare the singleton getter function as friend to access the private constructor and destructor.

## Detailed Description

This is the real IOManager class that is later encapsulated by SingletonT to enforce its uniqueness.

IOManager is not meant to be used directly by the programmer - the IOManager alias exists for this task.

All reader/writer modules register themselves at this class. For reading or writing data all modules are asked to do the job. If no suitable module is found, an error is returned.

For the sake of reading, the target data structure is hidden behind the BaseImporter interface that takes care of adding vertices or faces.

Writing from a source structure is encapsulate similarly behind a BaseExporter interface, providing iterators over vertices/faces to the writer modules.

See also
  Read and write meshes from files

## Member Function Documentation

## qt_read_filters()

const std::string& OpenMesh::IO::_IOManager_::qt_read_filters | ( |  | ) | const

inline

Returns all readable file extension + descriptions in one string.

File formats are separated by `;;`. Convenience function for Qt file dialogs.

## qt_write_filters()

const std::string& OpenMesh::IO::_IOManager_::qt_write_filters | ( |  | ) | const

inline

Returns all writeable file extension + descriptions in one string.

File formats are separated by `;;`. Convenience function for Qt file dialogs.

## read() [1/2]

bool OpenMesh::IO::_IOManager_::read | ( | const std::string & | _filename,
|  | BaseImporter & | _bi,
|  | Options & | _opt
| ) |  |

Read a mesh from file _filename.

The target data structure is specified by the given BaseImporter. The `read` method consecutively queries all of its reader modules. True is returned upon success, false if all reader modules failed to interprete _filename.

## read() [2/2]

bool OpenMesh::IO::_IOManager_::read | ( | std::istream & | _filename,
|  | const std::string & | _ext,
|  | BaseImporter & | _bi,
|  | Options & | _opt
| ) |  |

Read a mesh from open std::istream _is.

The target data structure is specified by the given BaseImporter. The `sread` method consecutively queries all of its reader modules. True is returned upon success, false if all reader modules failed to use _is.

## register_module() [1/2]

bool OpenMesh::IO::_IOManager_::register_module | ( | BaseReader * | _bl | ) |

inline

Registers a new reader module.

A call to this function should be implemented in the constructor of all classes derived from BaseReader.

## register_module() [2/2]

bool OpenMesh::IO::_IOManager_::register_module | ( | BaseWriter * | _bw | ) |

inline

Registers a new writer module.

A call to this function should be implemented in the constructor of all classed derived from BaseWriter.

## write() [1/2]

bool OpenMesh::IO::_IOManager_::write | ( | const std::string & | _filename,
|  | BaseExporter & | _be,
|  | Options | _opt = `Options::Default`,
|  | std::streamsize | _precision = `6`
| ) |  |

Write a mesh to file _filename.

The source data structure is specified by the given BaseExporter. The `save` method consecutively queries all of its writer modules. True is returned upon success, false if all writer modules failed to write the requested format. Options is determined by _filename's extension.

## write() [2/2]

bool OpenMesh::IO::_IOManager_::write | ( | std::ostream & | _filename,
|  | const std::string & | _ext,
|  | BaseExporter & | _be,
|  | Options | _opt = `Options::Default`,
|  | std::streamsize | _precision = `6`
| ) |  |

Write a mesh to open std::ostream _os.

The source data structure is specified by the given BaseExporter. The `save` method consecutively queries all of its writer modules. True is returned upon success, false if all writer modules failed to write the requested format. Options is determined by _filename's extension.

The documentation for this class was generated from the following files:

- OpenMesh/Core/IO/IOManager.hh
- OpenMesh/Core/IO/IOManager.cc