GemaMesh
The GeMA Mesh Plugin
Loading...
Searching...
No Matches
gmpNodeSet.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
34class GmMesh;
35
37class GMP_GEMAMESH_API_EXPORT GmpNodeSet : public GmNodeSet
38{
39public:
40 GmpNodeSet(QString id, GmMesh* mesh, int numNodes, int* nodes);
41
42 virtual ~GmpNodeSet();
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(GmpNodeSet) + _numNodes * sizeof(int); }
60
61 virtual void clear();
62
63private:
64 template <template <class> class Vector> friend class GmpNodeDataDump; // Needed for the state dumping code to have access to the address of the _nodes/_numNodes attributes
65
68 int* _nodes;
70};
71
72
73#endif
74
virtual QString id() const=0
virtual size_t usedMemory() const=0
virtual int node(int i) const=0
virtual int numNodes() const=0
virtual bool setNodeData(int numNodes, int *nodeList)
virtual GmMesh * mesh() const=0
A helper class to implement state dump operations for a GmpNodeMeshData<Vector> object.
Definition gmpNodeDataDump.h:40
A simple concrete implementation of the GmNodeSet interface.
Definition gmpNodeSet.h:38
int _numNodes
The number of nodes stored in this set.
Definition gmpNodeSet.h:67
QString _id
The set name.
Definition gmpNodeSet.h:66
int * _nodes
The nodes vector.
Definition gmpNodeSet.h:68
GmMesh * _mesh
The mesh that we belong to.
Definition gmpNodeSet.h:69
Declaration of useful configuration definitions for the plugin library.