FemProcess
The GeMA Fem Process Plugin
Public Types | Public Member Functions | Public Attributes | List of all members
GmpFemPhysicsCommon::Attribute Struct Reference

A structure used to define attributes interpreted by the physics. More...

#include <gmpFemPhysicsCommon.h>

Collaboration diagram for GmpFemPhysicsCommon::Attribute:
Collaboration graph
[legend]

Public Types

enum  AttributeType {
  User, Bool, Int, Double,
  String, DoubleList, StringList, Vector,
  Matrix, ScalarOrVector, Enum
}
 Attribute data type. More...
 

Public Member Functions

 Attribute ()
 Default constructor needed to enable storing an Attribute in a QVariant. Builds an invalid Attribute.
 
 Attribute (int id, QString name, AttributeType type, int nlin, int ncol, const RequiredIf &required, QString unit="", QVariant defValue=QVariant())
 Generic attribute constructor for non enum types, given the attribute name, expected type, if its required and default value for optional ones.
 
 Attribute (int id, QString name, AttributeType type, const RequiredIf &required, QString unit="", QVariant defValue=QVariant())
 Generic attribute constructor for non vector/matrix/enum types, given the attribute name, expected type, if its required and default value for optional ones.
 
 Attribute (int id, QString name, AttributeType type, QVariant defValue)
 Attribute constructor for optional attributes with default and no unit.
 
 Attribute (int id, QString name, AttributeType type, int nlin, int ncol, QVariant defValue)
 Attribute constructor for optional vector/amatrix attributes with default and no unit.
 
 Attribute (int id, QString name, const QMap< QString, int > &enumMap, const RequiredIf &required, QString unit="", QVariant defValue=QVariant())
 Attribute constructor for a generic enumerated attribute.
 
 Attribute (int id, QString name, const QMap< QString, int > &enumMap, QVariant defValue)
 Attribute constructor for an optional enumerated attribute with default and no unit.
 
 operator QVariant () const
 Operator to convert an Attribute to a QVariant.
 
int nlin (const GmpFemPhysicsCommon *p) const
 
int ncol (const GmpFemPhysicsCommon *p) const
 

Public Attributes

int _id
 Attribute id storing its intended position in the attributes list.
 
QString _name
 The attribute name.
 
AttributeType _type
 The expected attribute type for validation purposes.
 
Size _size
 The requested number of lines/columns for a vector / matrix.
 
QString _unit
 The attribute unit for double types.
 
QVariant _defVal
 A default value applied to the attribute if not given and optional.
 
QMap< QString, int > _enumMap
 Map for trnslating enum types.
 
RequiredIf _required
 Is the attribute required?
 

Detailed Description

A structure used to define attributes interpreted by the physics.

Member Enumeration Documentation

◆ AttributeType

Attribute data type.

Enumerator
User 

Any value. Checks will be done later.

Bool 

A boolean value. Read variant with toBool().

Int 

An integer number. Read variant with toInt().

Double 

A double value. Read variant with toDouble().

String 

A string (QString). Read variant with toString().

DoubleList 

A list of doubles (QList<double>). Read variant with value< QList<double> >().

StringList 

A list of strings (QStringList). Read variant with toStringList().

Vector 

A GmVector object. Read variant with value<GmVector>().

Matrix 

A GmMatrix object. Read variant with value<GmMatrix>().

ScalarOrVector 

A GmVector object that also accepts a scalar value. Read variant with value<GmVector>().

Enum 

An integer number whose value is equal to an enum option. Read variant with toInt().


The documentation for this struct was generated from the following file: