GemaCoreLib
The GeMA Core library
gmStateVar.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 
23 #ifndef _GEMA_STATE_VAR_H_
24 #define _GEMA_STATE_VAR_H_
25 
26 #include "gmCoreConfig.h"
27 #include "gmValueInfo.h"
28 
29 #include <QString>
30 #include <unit.h>
31 
41 {
42 public:
43  GmStateVar(GmValueInfo* info);
44  ~GmStateVar();
45 
47  const GmValueInfo* info() const { return _info; }
48 
50  GmValueInfo* info() { return _info; }
51 
53  QString id() const { return _info->id(); }
54 
56  QString description() const { return _info->description(); }
57 
59  Unit unit() const { return _info->unit(); }
60 
66  int dim() const { return _info->size(); }
67 
72  int isScalar() const { return _info->isScalar(); }
73 
75  int baseDof() const { return _dof; }
76 
78  int groupId() const { return _groupId; }
79 
81  QString groupName() const { return _groupName; }
82 
84  void setBaseDof(int dof) { _dof = dof; }
85 
87  void setGroupId(QString name, int groupId) { _groupName = name, _groupId = groupId; }
88 
90  void setGroupId(int groupId) { _groupId = groupId; }
91 
96  void setGroupName(QString name) { _groupName = name; }
97 
98 private:
99 
101  int _dof;
102  int _groupId;
104 };
105 
106 
107 #endif
108 
109 
Auxiliar class used to store the definition of a value. It can be used to store informations about st...
Definition: gmValueInfo.h:126
int _dof
The base degree of freedom (dof) number associated to this state variable.
Definition: gmStateVar.h:101
int groupId() const
Returns the state variable group id.
Definition: gmStateVar.h:78
Declaration of usefull configuration definitions for the Core library.
const GmValueInfo * info() const
Returns the info object associated to this state variable.
Definition: gmStateVar.h:47
Declaration of the GmValueInfo class.
void setBaseDof(int dof)
Sets the base degree of freedom associated with this state variable.
Definition: gmStateVar.h:84
void setGroupName(QString name)
Sets the state var group name. Should be used only before the state var has been added to the model....
Definition: gmStateVar.h:96
Auxiliar class used to store the definition of a state variable.
Definition: gmStateVar.h:40
int baseDof() const
Returns the base degree of freedom associated to this state variable.
Definition: gmStateVar.h:75
void setGroupId(QString name, int groupId)
Sets the state var group name and id.
Definition: gmStateVar.h:87
GmValueInfo * info()
Returns the info object associated to this state variable.
Definition: gmStateVar.h:50
int dim() const
Returns the number of dimensions for the state var.
Definition: gmStateVar.h:66
int _groupId
Group identifier allowing several state vars to be treated equally, for example, when applying calcul...
Definition: gmStateVar.h:102
#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
Unit unit() const
Returns the unit in which values of the state variable are expressed.
Definition: gmStateVar.h:59
QString _groupName
Group name.
Definition: gmStateVar.h:103
QString description() const
Returns the state variable description.
Definition: gmStateVar.h:56
QString groupName() const
Returns the state variable group name.
Definition: gmStateVar.h:81
QString id() const
Returns the state variable id.
Definition: gmStateVar.h:53
GmValueInfo * _info
State var information.
Definition: gmStateVar.h:100
int isScalar() const
Returns true if the state var is scalar. Notice that being a scalar cant be inferred by dim() == 1 si...
Definition: gmStateVar.h:72
void setGroupId(int groupId)
Sets the state var group id. Should not be used by general code, only by the ModelData class.
Definition: gmStateVar.h:90