GemaMesh
The GeMA Mesh Plugin
gmpGemaMeshData.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_GEMA_MESH_DATA_H_
25 #define _GEMA_PLUGIN_GEMA_MESH_DATA_H_
26 
27 #include "gmpMeshData.h"
28 
30 template <template <class> class Vector>
31 struct GMP_GEMAMESH_API_EXPORT GmpGemaMeshData : public GmpMeshData<Vector>
32 {
33  GmpGemaMeshData(GmMesh* mesh);
34 
36  virtual ~GmpGemaMeshData() { releaseMeshNodes(); }
37 
38  virtual int addFirstNodes(GmMesh* mesh, int numAddedNodes, int numGhostNodes, QList<GmValueInfo*> infoList = QList<GmValueInfo*>());
39  virtual int addNewNodes (GmMesh* mesh, int numAddedNodes);
40  virtual void clear (GmMesh* mesh);
41 
42  // See comments on the base class
43  virtual void releaseMemory()
44  {
46  releaseMeshNodes();
47  }
48 
49  virtual int numNodes() const { return _numNodes; }
50 
52  virtual size_t nodeMemory() const { return _coordinates.usedMemory() + _ghostCoordinates.usedMemory(); }
53 
54  //---------------------------------------
55  // State dump control functions
56  //---------------------------------------
57 
58  virtual bool addStateGeometryData(GmStateDump* state, int groupId);
59 
60  virtual bool fillDumpControlMapData(GmMesh* mesh, QVariantMap* map, const GmLogCategory& logger);
61  virtual bool dumpControlMapDataLoaded(GmMesh* mesh, QVariantMap* map, const GmLogCategory& logger);
62 
63  int _numNodes;
64  Vector<double> _coordinates;
65 
66 private:
67  void releaseMeshNodes();
68 };
69 
70 #endif
71 
int _numNodes
Number of nodes in the mesh.
Definition: gmpGemaMeshData.h:63
virtual ~GmpGemaMeshData()
Virtual destructor.
Definition: gmpGemaMeshData.h:36
virtual bool dumpControlMapDataLoaded(GmMesh *mesh, QVariantMap *map, const GmLogCategory &logger)
Loads the map data into the object + adjusts vector sizes if necessary.
Definition: gmpMeshData.cpp:324
virtual bool addStateGeometryData(GmStateDump *state, int groupId)
Adds to the state dump an item storing node set nodes followed by an item storing node coordinates.
Definition: gmpMeshData.cpp:263
Vector< double > _coordinates
Coordinate vector. Size = _coordInfo->size() * _numNodes. Values stored by node.
Definition: gmpGemaMeshData.h:64
virtual void releaseMemory()
Releases all the memory DIRECTLY owned by the object.
Definition: gmpGemaMeshData.h:43
Auxiliar structure used to share data between GmpXxxMeshBase and GmpMeshLoader.
Definition: gmpMeshData.h:43
virtual size_t nodeMemory() const
Returns the approximate memory used for storing mesh nodes.
Definition: gmpGemaMeshData.h:52
Declaration of the GmpMeshData structure.
virtual void releaseMemory()
Releases all the memory DIRECTLY owned by the object.
Definition: gmpMeshData.cpp:224
Auxiliar structure used to share data between GmpGemaMesh and GmpMeshLoader.
Definition: gmpGemaMeshData.h:31
virtual void clear(GmMesh *mesh)
Removes all mesh nodes + removes all values from node based value sets, preserving object state so th...
Definition: gmpMeshData.cpp:205
virtual bool fillDumpControlMapData(GmMesh *mesh, QVariantMap *map, const GmLogCategory &logger)
Stores the mesh data control info on the stored map.
Definition: gmpMeshData.cpp:300