CheckableFloat Class Reference

CheckableFloat Class Reference

#include <math.h>

Class Description

A container class that holds a boolean and a float value.

Can be used to to enable/disable the usage of the float value. Typically represented by a checkbox and a slider below that where the state of the checkbox enables or disables the slider.

Definition at line 1622 of file math.h.

Public Member Functions

 CheckableFloat (void)
 
 CheckableFloat (bool bState, float fValue)
 
void SetValue (float f)
 Sets the associated float value. More...
 
float Value (void) const
 Retrieves the associated float value. More...
 
void SetState (bool b)
 Sets the associated boolean value. More...
 
bool State (void) const
 Retrieves the associated boolean value. More...
 
bool operator== (const CheckableFloat &cf) const throw ()
 
bool operator!= (const CheckableFloat &cf) const throw ()
 
CheckableFloatoperator= (const CheckableFloat &cf)
 
void Serialize (Stream &s)
 

Protected Attributes

bool m_bState
 
float m_fValue
 

Constructor & Destructor Documentation

CheckableFloat ( void  )
inline

Definition at line 1625 of file math.h.

1625 { m_bState = true; m_fValue = 0.0f; };
CheckableFloat ( bool  bState,
float  fValue 
)
inline

Definition at line 1626 of file math.h.

1626 { m_bState = bState; m_fValue = fValue; };

Member Function Documentation

void SetValue ( float  f)
inline

Sets the associated float value.

Definition at line 1629 of file math.h.

1629 { m_fValue = f; };
GLclampf f
Definition: GLee.h:9303
float Value ( void  ) const
inline

Retrieves the associated float value.

Definition at line 1632 of file math.h.

1632 { return m_fValue; };
void SetState ( bool  b)
inline

Sets the associated boolean value.

Definition at line 1635 of file math.h.

1635 { m_bState = b; };
GLubyte GLubyte b
Definition: GLee.h:5404
bool State ( void  ) const
inline

Retrieves the associated boolean value.

Definition at line 1638 of file math.h.

1638 { return m_bState; };
bool operator== ( const CheckableFloat cf) const
throw (
)
inline

Definition at line 1640 of file math.h.

1640 { return State() == cf.State() && Value() == cf.Value(); };
float Value(void) const
Retrieves the associated float value.
Definition: math.h:1632
bool State(void) const
Retrieves the associated boolean value.
Definition: math.h:1638
bool operator!= ( const CheckableFloat cf) const
throw (
)
inline

Definition at line 1641 of file math.h.

1641 { return !operator ==( cf ); };
bool operator==(const CheckableFloat &cf) const
Definition: math.h:1640
CheckableFloat& operator= ( const CheckableFloat cf)
inline

Definition at line 1642 of file math.h.

1642 { m_bState = cf.m_bState; m_fValue = cf.m_fValue; return *this; };
void Serialize ( Stream s)
inline

Definition at line 1644 of file math.h.

1645  {
1646  s == m_bState == m_fValue;
1647  };
GLdouble s
Definition: GLee.h:1173

Member Data Documentation

bool m_bState
protected

Definition at line 1647 of file math.h.

float m_fValue
protected

Definition at line 1652 of file math.h.


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