Developer Documentation
|
#include <OpenFlipper/libs_required/OpenMesh/src/OpenMesh/Core/IO/IOManager.hh>
Public Member Functions | |
bool | read (const std::string &_filename, BaseImporter &_bi, Options &_opt) |
bool | read (std::istream &_filename, const std::string &_ext, BaseImporter &_bi, Options &_opt) |
bool | write (const std::string &_filename, BaseExporter &_be, Options _opt=Options::Default, std::streamsize _precision=6) |
bool | write (std::ostream &_filename, const std::string &_ext, BaseExporter &_be, Options _opt=Options::Default, std::streamsize _precision=6) |
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 |
const std::string & | qt_write_filters () const |
bool | register_module (BaseReader *_bl) |
bool | register_module (BaseWriter *_bw) |
Private Member Functions | |
_IOManager_ () | |
Constructor has nothing todo for the Manager. | |
~_IOManager_ () | |
Destructor has nothing todo for the Manager. | |
void | update_read_filters () |
void | update_write_filters () |
const BaseWriter * | find_writer (const std::string &_format) |
Private Attributes | |
std::set< BaseReader * > | reader_modules_ |
std::set< BaseWriter * > | writer_modules_ |
std::string | read_filters_ |
std::string | write_filters_ |
Friends | |
OPENMESHDLLEXPORT _IOManager_ & | IOManager () |
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.
Definition at line 102 of file IOManager.hh.
|
inline |
Returns all readable file extension + descriptions in one string. File formats are separated by ;;
. Convenience function for Qt file dialogs.
Definition at line 189 of file IOManager.hh.
|
inline |
Returns all writeable file extension + descriptions in one string. File formats are separated by ;;
. Convenience function for Qt file dialogs.
Definition at line 196 of file IOManager.hh.
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.
Definition at line 87 of file IOManager.cc.
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.
Definition at line 118 of file IOManager.cc.
|
inline |
Registers a new reader module. A call to this function should be implemented in the constructor of all classes derived from BaseReader.
Definition at line 217 of file IOManager.hh.
|
inline |
Registers a new writer module. A call to this function should be implemented in the constructor of all classed derived from BaseWriter.
Definition at line 229 of file IOManager.hh.
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.
Definition at line 143 of file IOManager.cc.
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.
Definition at line 172 of file IOManager.cc.
|
friend |
Declare the singleton getter function as friend to access the private constructor and destructor
Definition at line 72 of file IOManager.cc.