![]() |
GemaCoreLib
The GeMA Core library
|
A deserializer object used to read mesh data from several file formats. More...
#include <gmDataDeserializer.h>
Public Member Functions | |
~GmDataDeserializer () | |
Destructor. | |
bool | loadMeshDataFromFile (GmMesh *mesh, const QStringList &nodeValues, const QList< Unit > &nodeUnits, Unit coordUnit, const QStringList &elementValues, const QList< Unit > &elementUnits, QString fileName, const QVariantMap &options) |
Loads mesh data from the specified file. More... | |
bool | updateMeshData () |
Updates the mesh data from the file. Should be called after a call to loadMeshDataFromFile() | |
Static Public Member Functions | |
static GmDataDeserializer * | createInstance (QString fileType, const GmLogCategory &logger) |
Creates an instance of a GmDataDeserializer object to read files of the given type Returns NULL if fileType is an unsupported type. | |
Private Member Functions | |
GmDataDeserializer (QString fileType, GmFileReader *des, const GmLogCategory &logger) | |
Private constructor. Objects should be instanced by a call to createInstance(). Takes ownership of the supplied deserializer. | |
bool | cleanup () |
Cleans the object state. Returns false as a convenience for error treatment. | |
bool | closeFiles () |
Closes the file(s) opened by the reading process. | |
Private Attributes | |
const GmLogCategory & | _logger |
The logger object used to report errors. | |
GmFileReader * | _deserializer |
The file deserializer used to read data. | |
QString | _fileType |
Deserializer file type for use in error messages. | |
GmMesh * | _mesh |
The destination mesh whose body will be filled. | |
QString | _fileName |
bool | _openFiles |
States if we have an open file or not. | |
A deserializer object used to read mesh data from several file formats.
bool GmDataDeserializer::loadMeshDataFromFile | ( | GmMesh * | mesh, |
const QStringList & | nodeValues, | ||
const QList< Unit > & | nodeUnits, | ||
Unit | coordUnit, | ||
const QStringList & | elementValues, | ||
const QList< Unit > & | elementUnits, | ||
QString | fileName, | ||
const QVariantMap & | options | ||
) |
Loads mesh data from the specified file.
mesh | The mesh that will be filled. |
nodeValues | A list with the names of node state vars and attributes that should be read. |
nodeUnits | A list with the desired unit in which node data will be read. Should be either empty (no unit will be defined) or a list with the same size as nodeValues. |
coordUnit | The unit in which coordinates will be exported. If empty, no unit will be defined. |
elementValues | A list with the names of element attributes that should be read. |
elementUnits | A list with the desired unit in which element data will be read. Should be either empty (no unit will be defined) or a list with the same size as elementValues. |
fileName | The name of the file that will be read. |
options | A set of options specific to the file type |