Workspace 6.21.5
Public Types | Public Member Functions | Related Functions | List of all members
StateInfo Class Reference

Defines a class to hold info for one particular state. More...

#include <Mesh/DataStructures/stateinfo.h>

Public Types

enum  StateType { StateTypeUndefined , Scalar , Vector , Integer }
 

Public Member Functions

 StateInfo ()
 
 StateInfo (const QString &name)
 
 StateInfo (const QString &name, const Vector3d &defaultVal)
 
 StateInfo (const QString &name, double defaultVal)
 
 StateInfo (const QString &name, long defaultVal)
 
long getDefaultInteger () const
 
double getDefaultScalar () const
 
const Vector3dgetDefaultVector () const
 
int getIndex () const
 
const QString & getName () const
 
StateType getStateType () const
 
bool isDefined () const
 
bool isInteger () const
 
bool isScalar () const
 
bool isVector () const
 
void setDefault (const StateInfo &stateInfo)
 
void setDefaultInteger (long defaultVal)
 
void setDefaultScalar (double defaultVal)
 
void setDefaultVector (const Vector3d &defaultVal)
 
void setIndex (int i)
 
void setName (const QString &name)
 

Related Functions

(Note that these are not member functions.)

bool operator== (const StateInfo &lhs, const StateInfo &rhs)
 

Detailed Description

A state can be either a scalar double, a vector double, or an integer. Vector doubles are always 3-element vectors, designed for use with the Vector3d class.

Member Enumeration Documentation

◆ StateType

enum StateType

Specifies the various supported state types.

Enumerator
StateTypeUndefined 

Not a known state type.

Scalar 

Double precision floating point value.

Vector 

Vector of three double precision floating point values.

Integer 

Integer value.

Constructor & Destructor Documentation

◆ StateInfo() [1/5]

StateInfo ( )

Constructs a null state info object. isDefined() will return false.

◆ StateInfo() [2/5]

StateInfo ( const QString &  name)

Constructs a null state info object except with the name set. This is useful for removal operations. isDefined() will return false.

◆ StateInfo() [3/5]

StateInfo ( const QString &  name,
double  defaultVal 
)

Constructs a scalar state info object.

◆ StateInfo() [4/5]

StateInfo ( const QString &  name,
const Vector3d defaultVal 
)

Constructs a vector state info object.

◆ StateInfo() [5/5]

StateInfo ( const QString &  name,
long  defaultVal 
)

Constructs an integer data state info object.

Member Function Documentation

◆ getDefaultInteger()

long getDefaultInteger ( ) const
inline
Returns
The default value for this state.

◆ getDefaultScalar()

double getDefaultScalar ( ) const
inline
Returns
The default value for this state.

◆ getDefaultVector()

const Vector3d & getDefaultVector ( ) const
inline
Returns
The default value for this state.

◆ getIndex()

int getIndex ( ) const
inline
Returns
The index of the state.

◆ getName()

const QString & getName ( ) const
inline
Returns
The name of the state.

◆ getStateType()

StateType getStateType ( ) const
inline
Returns
The type of the state.

◆ isDefined()

bool isDefined ( ) const
inline
Returns
True if this state is defined. An undefined state is useful to indicate failure of a state-related operation or to indicate that this StateInfo object has not been set up yet.

◆ isInteger()

bool isInteger ( ) const
inline
Returns
True if this is an integer state.

◆ isScalar()

bool isScalar ( ) const
inline
Returns
True if this is a scalar double state.

◆ isVector()

bool isVector ( ) const
inline
Returns
True if this is a vector double state.

◆ setDefault()

void setDefault ( const StateInfo stateInfo)

Copies all the defaults from stateInfo to this object.

◆ setDefaultInteger()

void setDefaultInteger ( long  defaultVal)
Parameters
defaultValThe new default value.

◆ setDefaultScalar()

void setDefaultScalar ( double  defaultVal)
Parameters
defaultValThe new default value.

◆ setDefaultVector()

void setDefaultVector ( const Vector3d defaultVal)
Parameters
defaultValThe new default value.

◆ setIndex()

void setIndex ( int  i)
inline

Sets the index of the state to i.

◆ setName()

void setName ( const QString &  name)
inline

Sets the name of the state to name.

Friends And Related Function Documentation

◆ operator==()

bool operator== ( const StateInfo lhs,
const StateInfo rhs 
)
related
Returns
True if the name and type of state for lhs is the same as rhs. The index and default values are ignored for this comparison.