GemaCoreLib
The GeMA Core library
gmNodeSet.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_NODE_SET_H_
25 #define _GEMA_NODE_SET_H_
26 
27 #include "gmMesh.h"
28 
33 {
34 public:
36  virtual ~GmNodeSet() {}
37 
39  virtual QString id() const = 0;
40 
42  virtual GmMesh* mesh() const = 0;
43 
45  virtual int numNodes() const = 0;
46 
51  virtual int node(int i) const = 0;
52 
60  virtual bool setNodeData(int numNodes, int* nodeList)
61  {
62  Q_UNUSED(numNodes); Q_UNUSED(nodeList);
63  return false;
64  }
65 
67  virtual size_t usedMemory() const = 0;
68 };
69 
70 
73 {
74 public:
76  GmMeshNodeSet(GmMesh* mesh) : _mesh(mesh) {}
77 
78  // Comments on the base class
79  virtual QString id() const { return "mesh wrapper"; }
80 
81  // Comments on the base class
82  virtual GmMesh* mesh() const { return _mesh; }
83 
84  // Comments on the base class
85  virtual int numNodes() const { return _mesh->numNodes(); }
86 
87  // Comments on the base class
88  virtual int node(int i) const { return i; }
89 
90  // Comments on the base class
91  virtual size_t usedMemory() const { return 0; }
92 
93 private:
95 };
96 
97 
98 #endif
99 
virtual int node(int i) const
Returns the node id of the i'th entry stored in this set.
Definition: gmNodeSet.h:88
virtual ~GmNodeSet()
Virtual destructor.
Definition: gmNodeSet.h:36
A node set wrapper over a common mesh. Constant (no support for setNodeData())
Definition: gmNodeSet.h:72
virtual GmMesh * mesh() const
Returns the mesh that this set is tied to.
Definition: gmNodeSet.h:82
This class stores a set of nodes belonging to a mesh. The nodes can belong to the mesh boundary but t...
Definition: gmNodeSet.h:32
virtual size_t usedMemory() const
Returns an estimative of the memory used by the node set in bytes.
Definition: gmNodeSet.h:91
GmMesh * _mesh
The wrapped mesh.
Definition: gmNodeSet.h:94
Declaration of the GmMesh interface class.
virtual int numNodes() const
Returns the number of nodes stored in this set.
Definition: gmNodeSet.h:85
#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
virtual bool setNodeData(int numNodes, int *nodeList)
Updates the node list in the set object.
Definition: gmNodeSet.h:60
virtual QString id() const
Returns the set name.
Definition: gmNodeSet.h:79
Base interface class for Mesh type plugins.
Definition: gmMesh.h:44
GmMeshNodeSet(GmMesh *mesh)
Simple constructor.
Definition: gmNodeSet.h:76