Developer Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
OpenVolumeMesh::IO::FileManager Class Reference

Read/Write mesh data from/to files. More...

#include <libs_required/OpenVolumeMesh/src/OpenVolumeMesh/FileManager/FileManager.hh>

Public Member Functions

 FileManager ()
 Default constructor.
 
 ~FileManager ()
 Default destructor.
 
template<class MeshT >
bool readFile (const std::string &_filename, MeshT &_mesh, bool _topologyCheck=true, bool _computeBottomUpIncidences=true) const
 Read a mesh from a file. More...
 
template<class MeshT >
bool writeFile (const std::string &_filename, const MeshT &_mesh) const
 Write a mesh to a file. More...
 
bool isHexahedralMesh (const std::string &_filename) const
 Test whether given file contains a hexahedral mesh.
 
bool isTetrahedralMesh (const std::string &_filename) const
 Test whether given file contains a tetrahedral mesh.
 

Private Member Functions

template<class MeshT >
void readProperty (std::istream &_iff, MeshT &_mesh) const
 
template<class PropT , class MeshT >
void generateGenericProperty (const std::string &_entity_t, const std::string &_name, std::istream &_iff, MeshT &_mesh) const
 
template<class IteratorT >
void writeProps (std::ostream &_ostr, const IteratorT &_begin, const IteratorT &_end) const
 
void trimString (std::string &_string) const
 
void extractQuotedText (std::string &_string) const
 
bool getCleanLine (std::istream &ifs, std::string &_string, bool _skipEmptyLines=true) const
 

Detailed Description

Read/Write mesh data from/to files.

Todo:
Implement binary file support

Definition at line 60 of file FileManager.hh.

Member Function Documentation

template<class MeshT >
bool OpenVolumeMesh::IO::FileManager::readFile ( const std::string &  _filename,
MeshT &  _mesh,
bool  _topologyCheck = true,
bool  _computeBottomUpIncidences = true 
) const

Read a mesh from a file.

Returns true if the file was successfully read. The mesh is stored in parameter _mesh. If something goes wrong, this function returns false.

Parameters
_filenameThe file that is to be read
_meshA reference to an OpenVolumeMesh instance
_topologyCheckPass true if you want to perform a topology check each time an entity is added (slower performance)
_computeBottomUpIncidencesPass true if you want the file manager to directly compute the bottom-up incidences for the mesh. (Note: These are needed for some iterators to work, see documentation)

Definition at line 66 of file FileManagerT.cc.

template<class MeshT >
bool OpenVolumeMesh::IO::FileManager::writeFile ( const std::string &  _filename,
const MeshT &  _mesh 
) const

Write a mesh to a file.

Returns true if the file was successfully written. The mesh is passed as parameter _mesh. If something goes wrong, this function returns false.

Parameters
_filenameThe file that is to be stored
_meshA const reference to an OpenVolumeMesh instance

Definition at line 399 of file FileManagerT.cc.


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