- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- Class List
- Class Hierarchy
- Class Members

# OpenMesh::IO::_IOManager_ Class Reference

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

`#include <IOManager.hh>`

List of all members.

## Public Member Functions
bool | read (const std::string &_filename, BaseImporter &_bi, Options &_opt)
| Read a mesh from file _filename.
bool | write (const std::string &_filename, BaseExporter &_be, Options _opt=Options::Default)
| Write a mesh to file _filename.
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.
const std::string & | qt_read_filters () const
| Returns all readable file extension + descriptions in one string.
const std::string & | qt_write_filters () const
| Returns all writeable file extension + descriptions in one string.
bool | register_module (BaseReader *_bl)
| Registers a new reader module.
bool | register_module (BaseWriter *_bw)
| Registers a new writer module.

## 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:
  Mesh Input and Output

## Member Function Documentation

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.

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

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.

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 two semi-colons. Convenience function for Qt file dialogs.

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 two semicolons. Convenience function for Qt file dialogs.

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.

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.

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

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