GemaCoreLib
The GeMA Core library
gmDataDeserializer.h
Go to the documentation of this file.
1 /************************************************************************
2 **
3 ** Copyright (C) 2014 by Carlos Augusto Teixera Mendes
4 ** All rights reserved.
5 **
6 ** This file is part of the "GeMA" software. It's use should respect
7 ** the terms in the license agreement that can be found together
8 ** with this source code.
9 ** It is provided AS IS, with NO WARRANTY OF ANY KIND,
10 ** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR
11 ** A PARTICULAR PURPOSE.
12 **
13 ************************************************************************/
14 
24 #ifndef _GEMA_DATA_DESERIALIZER_H_
25 #define _GEMA_DATA_DESERIALIZER_H_
26 
27 #include "gmCoreConfig.h"
28 
29 #include <QStringList>
30 #include <QVariant>
31 
32 class GmFileReader;
33 
34 class GmLogCategory;
35 class GmSimulationData;
36 class GmMesh;
37 class Unit;
38 
42 {
43 public:
45 
46  static GmDataDeserializer* createInstance(QString fileType, const GmLogCategory& logger);
47 
48  bool loadMeshDataFromFile(GmMesh* mesh,
49  const QStringList& nodeValues, const QList<Unit>& nodeUnits,
50  Unit coordUnit, const QStringList& elementValues,
51  const QList<Unit>& elementUnits, QString fileName,
52  const QVariantMap& options);
53 
54  bool updateMeshData();
55 
56 private:
57  GmDataDeserializer(QString fileType, GmFileReader* des, const GmLogCategory& logger);
58 
59  bool cleanup();
60  bool closeFiles();
61 
65 
67  QString _fileName;
68  bool _openFiles;
69 };
70 
71 #endif
Basic interface for file deserializers.
Definition: gmFileReader.h:40
Declaration of usefull configuration definitions for the Core library.
QString _fileType
Deserializer file type for use in error messages.
Definition: gmDataDeserializer.h:64
bool _openFiles
States if we have an open file or not.
Definition: gmDataDeserializer.h:68
Auxiliar class used to store the complete set of simulation data.
Definition: gmSimulationData.h:51
A deserializer object used to read mesh data from several file formats.
Definition: gmDataDeserializer.h:41
GmMesh * _mesh
The destination mesh whose body will be filled.
Definition: gmDataDeserializer.h:66
#define GMC_API_EXPORT
Macro for controling if the class is being exported (GEMA_CORE_LIB defined) or imported (GEMA_CORE_LI...
Definition: gmCoreConfig.h:35
Class representing a category with multiple logging levels.
Definition: gmLog.h:58
const GmLogCategory & _logger
The logger object used to report errors.
Definition: gmDataDeserializer.h:62
Base interface class for Mesh type plugins.
Definition: gmMesh.h:44
GmFileReader * _deserializer
The file deserializer used to read data.
Definition: gmDataDeserializer.h:63