GemaMesh
The GeMA Mesh Plugin
gmpGemaNodeSet.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_NODE_SET_H_
25 #define _GEMA_PLUGIN_GEMA_NODE_SET_H_
26 
27 #include "gmpGemaMeshConfig.h"
28 
29 #include <gmNodeSet.h>
30 #include <assert.h>
31 
32 #include <QString>
33 
34 class GmMesh;
35 
37 class GMP_GEMAMESH_API_EXPORT GmpGemaNodeSet : public GmNodeSet
38 {
39 public:
40  GmpGemaNodeSet(QString id, GmMesh* mesh, int numNodes, int* nodes);
41 
42  virtual ~GmpGemaNodeSet();
43 
44  // Comments on the base class
45  virtual QString id() const { return _id; }
46 
47  // Comments on the base class
48  virtual GmMesh* mesh() const { return _mesh; }
49 
50  // Comments on the base class
51  virtual int numNodes() const { return _numNodes; }
52 
53  // Comments on the base class
54  virtual int node(int i) const { assert(i >= 0 && i < _numNodes); return _nodes[i]; }
55 
56  virtual bool setNodeData(int numNodes, int* nodeList);
57 
58  // Comments on the base class
59  virtual size_t usedMemory() const { return sizeof(GmpGemaNodeSet) + _numNodes * sizeof(int); }
60 
61  virtual void clear();
62 
63 private:
64  template <template <class> class Vector> friend struct GmpMeshData; // Needed for the state dumping code to have access to the address of the _nodes/_numNodes attributes
65 
67  int _numNodes;
68  int* _nodes;
70 };
71 
72 
73 #endif
74 
A simple concrete implementation of the GmNodeSet interface.
Definition: gmpGemaNodeSet.h:37
virtual int numNodes() const=0
int * _nodes
The nodes vector.
Definition: gmpGemaNodeSet.h:68
virtual GmMesh * mesh() const=0
virtual int node(int i) const=0
QString _id
The set name.
Definition: gmpGemaNodeSet.h:66
virtual size_t usedMemory() const=0
int _numNodes
The number of nodes stored in this set.
Definition: gmpGemaNodeSet.h:67
virtual QString id() const=0
Auxiliar structure used to share data between GmpXxxMeshBase and GmpMeshLoader.
Definition: gmpMeshData.h:43
Declaration of usefull configuration definitions for the plugin library.
virtual bool setNodeData(int numNodes, int *nodeList)
GmMesh * _mesh
The mesh that we belong to.
Definition: gmpGemaNodeSet.h:69