GemaCoreLib
The GeMA Core library
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
GmDataDeserializer Class Reference

A deserializer object used to read mesh data from several file formats. More...

#include <gmDataDeserializer.h>

Collaboration diagram for GmDataDeserializer:
Collaboration graph
[legend]

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 GmDataDeserializercreateInstance (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.
 

Detailed Description

A deserializer object used to read mesh data from several file formats.

Member Function Documentation

◆ loadMeshDataFromFile()

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.

Parameters
meshThe mesh that will be filled.
nodeValuesA list with the names of node state vars and attributes that should be read.
nodeUnitsA 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.
coordUnitThe unit in which coordinates will be exported. If empty, no unit will be defined.
elementValuesA list with the names of element attributes that should be read.
elementUnitsA 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.
fileNameThe name of the file that will be read.
optionsA set of options specific to the file type
Returns
Returns false on errors.

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