OpenMesh
|
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. | |
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.
|
inline |
Returns all readable file extension + descriptions in one string.
File formats are separated by ;;
. Convenience function for Qt file dialogs.
|
inline |
Returns all writeable file extension + descriptions in one string.
File formats are separated by ;;
. Convenience function for Qt file dialogs.
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_::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.
|
inline |
Registers a new reader module.
A call to this function should be implemented in the constructor of all classes derived from BaseReader.
|
inline |
Registers a new writer module.
A call to this function should be implemented in the constructor of all classed derived from BaseWriter.
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.
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.