GemaMesh
The GeMA Mesh Plugin
Loading...
Searching...
No Matches
gmpCellDataDump.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_PLUGIN_CELL_DATA_DUMP_H_
25#define _GEMA_PLUGIN_CELL_DATA_DUMP_H_
26
27#include "gmpGemaMeshConfig.h"
28
29#include <gmCellType.h>
30
31#include <QVariant>
32
34class GmStateDump;
35class GmMesh;
36class GmLogCategory;
37
38template <template <class> class Vector> class GmpCellMeshData;
39
41template <template <class> class Vector>
42class GMP_GEMAMESH_API_EXPORT GmpCellDataDump
43{
44public:
47 : _cd(cd), _state(NULL), _cellDumpTypeActiveData(NULL), _cellDumpGhostData(NULL),
48 _cellDumpTypeActiveDataSize(0), _cellDumpGhostDataSize(0), _cellDumpLoadedMap(NULL) {}
49
51 ~GmpCellDataDump() { releaseDumpMemory(); }
52
53 bool addStateGeometryData(GmSimulationData* simData, GmMesh* mesh, GmStateDump* state, int groupId);
54
55 bool fillDumpControlMapData (GmMesh* mesh, QVariantMap* map, const GmLogCategory& logger);
56 bool dumpControlMapDataLoaded(GmMesh* mesh, QVariantMap* map, const GmLogCategory& logger);
57
58 void releaseDumpMemory();
59
60 void setState(GmStateDump* state) { _state = state; }
61
62private:
63
64 bool fillAuxCellBuffers (int* cellSavedData, int* baseCellType, GmMesh* mesh, const GmLogCategory& logger);
65 bool auxCellBuffersLoaded(GmSimulationData* simData, GmMesh* mesh, const GmLogCategory& logger);
66
69
75 static_assert(GM_NUM_CELL_TYPES <= 127, "Number of cell types exceeds 7 bits");
77
80
87
90
92 QVariantMap* _cellDumpLoadedMap;
93};
94
95#endif
96
A helper class to implement state dump operations for a GmpCellMeshData<Vector> object.
Definition gmpCellDataDump.h:43
GmpCellMeshData< Vector > * _cd
The cell mesh data object being dumped / recovered.
Definition gmpCellDataDump.h:67
unsigned char * _cellDumpTypeActiveData
A vector storing temporary cell types + active data when needed for dumping code. If different from N...
Definition gmpCellDataDump.h:76
QVariantMap * _cellDumpLoadedMap
The map with loaded control data. Filled (different from NULL) only during the load process.
Definition gmpCellDataDump.h:92
GmStateDump * _state
The state dump object when loading mesh data during Lua mesh model loading (always NULL during orches...
Definition gmpCellDataDump.h:68
int * _cellDumpGhostData
A vector storing temporary information about ghost nodes when needed for dumping code....
Definition gmpCellDataDump.h:86
GmpCellDataDump(GmpCellMeshData< Vector > *cd)
Constructor.
Definition gmpCellDataDump.h:46
int _cellDumpTypeActiveDataSize
The size of the vector _cellDumpTypeActiveData. Needed since _numCells is not zero when the vector is...
Definition gmpCellDataDump.h:79
~GmpCellDataDump()
Destructor.
Definition gmpCellDataDump.h:51
int _cellDumpGhostDataSize
The size of the vector _cellDumpGhostData.
Definition gmpCellDataDump.h:89
Auxiliar structure used to share data between GmpCellMesh and GmpMeshLoader. All fields are public si...
Definition gmpCellMeshData.h:121
GM_NUM_CELL_TYPES
Declaration of useful configuration definitions for the plugin library.