GemaCoreLib
The GeMA Core library
gmMeditFileReader.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_MEDIT_FILE_READER_H_
25 #define _GEMA_MEDIT_FILE_READER_H_
26 
27 #include "gmFileReader.h"
28 #include "gmMeditFileFormat.h"
29 
30 #include "gmValueInfo.h"
31 #include <stdio.h>
32 
35 {
36 public:
37  GmMeditFileReader(const GmLogCategory& logger);
38 
39  virtual ~GmMeditFileReader();
40 
41  virtual bool openFiles(QString fileName, int numNodeValues, int numElemValues);
42  virtual bool initializeMesh(GmMesh* mesh, const QStringList& nodeValues, const QList<Unit>& nodeUnits,
43  const QStringList& elementValues, const QList<Unit>& elementUnits);
44  virtual bool readNodeCoordinates(GmMesh* mesh, Unit coordUnit);
45  virtual bool readCellGeometry(GmCellMesh* cellmesh);
46  virtual bool readNodeData(GmMesh* mesh, const QStringList& nodeValues, const QList<Unit>& nodeUnits);
47  virtual bool readCellData(GmCellMesh* cellmesh, const QStringList& elementValues, const QList<Unit>& elementUnits);
48  virtual bool closeFiles();
49 
50  virtual GmFileFormat* fileFormat() { return this; }
51 
52 private:
53  int nlin(GmDimType t, int ndim) const { return (t == GM_SCALAR_VALUE ? 1 : ndim); }
54  int ncol(GmDimType t, int ndim) const { return (t != GM_MATRIX_VALUE ? 1 : ndim); }
55 
58  FILE* _meshFile;
59  FILE* _solFile;
60 };
61 
62 
63 #endif
A file deserializer for reading data in the "Medit" file format.
Definition: gmMeditFileReader.h:34
Declaration of the GmMeditFileFormat class (old GmMeditFileData class)
QString _meshFileName
The mesh file name.
Definition: gmMeditFileReader.h:56
virtual bool readNodeData(GmMesh *mesh, const QStringList &nodeValues, const QList< Unit > &nodeUnits)
See comments on the base class.
Definition: gmMeditFileReader.cpp:319
Basic interface for file deserializers.
Definition: gmFileReader.h:40
virtual bool readCellGeometry(GmCellMesh *cellmesh)
See comments on the base class.
Definition: gmMeditFileReader.cpp:267
File format specifications for the "Medit" file format.
Definition: gmMeditFileFormat.h:30
FILE * _solFile
The sol file handle or NULL if not needed.
Definition: gmMeditFileReader.h:59
GmDimType
Value dimension type.
Definition: gmValueInfo.h:66
virtual bool initializeMesh(GmMesh *mesh, const QStringList &nodeValues, const QList< Unit > &nodeUnits, const QStringList &elementValues, const QList< Unit > &elementUnits)
See comments on the base class.
Definition: gmMeditFileReader.cpp:82
Declaration of the GmValueInfo class.
FILE * _meshFile
The mesh file handle.
Definition: gmMeditFileReader.h:58
virtual bool closeFiles()
See comments on the base class.
Definition: gmMeditFileReader.cpp:437
Base interface class for CellMesh type plugins.
Definition: gmCellMesh.h:39
virtual bool openFiles(QString fileName, int numNodeValues, int numElemValues)
See comments on the base class.
Definition: gmMeditFileReader.cpp:49
virtual GmFileFormat * fileFormat()
Returns the file format of the deserializer.
Definition: gmMeditFileReader.h:50
GmMeditFileReader(const GmLogCategory &logger)
Default constructor.
Definition: gmMeditFileReader.cpp:34
virtual bool readCellData(GmCellMesh *cellmesh, const QStringList &elementValues, const QList< Unit > &elementUnits)
See comments on the base class.
Definition: gmMeditFileReader.cpp:376
Class representing a category with multiple logging levels.
Definition: gmLog.h:58
Means that the value is a 2D matrix of numbers.
Definition: gmValueInfo.h:70
QString _solFileName
The sol file name or empty if not needed.
Definition: gmMeditFileReader.h:57
Declaration of the GmFileReader class (old GmFileDataDeserializer class)
virtual ~GmMeditFileReader()
Destructor.
Definition: gmMeditFileReader.cpp:42
Basic interface for describing high level file format capabilities.
Definition: gmFileFormat.h:34
Base interface class for Mesh type plugins.
Definition: gmMesh.h:44
virtual bool readNodeCoordinates(GmMesh *mesh, Unit coordUnit)
See comments on the base class.
Definition: gmMeditFileReader.cpp:223
Means that the value is a scalar number.
Definition: gmValueInfo.h:68