GL Studio Safety Critical Embedded C++ Runtime Library
GlsOdometer Class Reference

#include <gls_odometer.h>

+ Inheritance diagram for GlsOdometer:

Classes

struct  InitParameters
 

Public Types

enum  Behavior { BEHAVIOR_ANALOG, BEHAVIOR_DIGITAL }
 
enum  GeometryType { GEOMETRY_TYPE_2D, GEOMETRY_TYPE_3D }
 
- Public Types inherited from GlsDisplayObject
enum  ObjectType { OBJECT_TYPE_COMPOSITE, OBJECT_TYPE_RENDERABLE }
 
enum  PickMode { PICK_MODE_NEVER, PICK_MODE_FIRST, PICK_MODE_ALWAYS }
 

Public Member Functions

 GlsOdometer (InitParameters &initParameters, GlsEventDispatcher *const eventDispatcher)
 
void SetValue (const GlsFloat32 value)
 
- Public Member Functions inherited from GlsGroup
 GlsGroup (InitParameters &initParameters, GlsEventDispatcher *const eventDispatcher)
 
virtual void Draw (GlsStateManager &gl, const GlsFloat64 time)
 
virtual void Calculate (const GlsFloat64 time)
 
virtual GlsDisplayObjectPickTest (const GlsVector2D &windowCoord, GlsInputManager &inputManager, const GlsMatrixAffineD::GLMatrixAffineF &parentDrawMatrix)
 
virtual void SetChildrenAlphaMode (const GlsAlphaMode alphaMode)
 
virtual void SetChildrenFillColor (const GlsColor &fillColor)
 
virtual void SetChildrenLineColor (const GlsColor &lineColor)
 
virtual void SetChildrenLineWidth (const GlsFloat32 lineWidth)
 
virtual void SetChildrenPolygonMode (const GlsPolygonMode polygonMode)
 
- Public Member Functions inherited from GlsDisplayObject
GlsDisplayObjectHandleEvent (GlsEvent &event)
 
ObjectType GetObjectType (void) const
 
void SetBlinking (const GlsBool blinking)
 
void SetBlinkRate (const GlsFloat32 blinkRate)
 
void SetDynamicRotation (const GlsVector3D &dynamicRotation)
 
void SetDynamicScale (const GlsVector3D &dynamicScale)
 
void SetDynamicTranslation (const GlsVector3D &dynamicTranslation)
 
void SetVisibility (const GlsBool visible)
 
void SetParent (GlsDisplayObject *const parent)
 
void SetPickMode (const PickMode pickMode)
 
GlsBool NeedCalculate (void) const
 
void InvalidatePickCache (void)
 

Protected Member Functions

void UpdateDigits (void)
 
virtual ~GlsOdometer ()
 
- Protected Member Functions inherited from GlsGroup
virtual ~GlsGroup ()
 
- Protected Member Functions inherited from GlsCompositeObject
 GlsCompositeObject (const InitParameters &initParameters, GlsEventDispatcher *const eventDispatcher)
 
virtual ~GlsCompositeObject ()
 
- Protected Member Functions inherited from GlsDisplayObject
 GlsDisplayObject (const InitParameters &initParameters, const ObjectType objectType, GlsEventDispatcher *const eventDispatcher)
 
virtual ~GlsDisplayObject ()
 
GlsBool CalcDrawMatrix (const GlsMatrixAffineD *const additionalTransform, const GlsBool includeLocation)
 
virtual void CalcWindowPickRegion (GlsInputManager &inputManager, const GlsMatrixAffineD::GLMatrixAffineF &parentDrawMatrix)
 
GlsBool IsBlinkedOff (const GlsFloat64 time) const
 

Protected Attributes

const GlsUInt32 _baseSystem
 
const GlsFloat32 _minValue
 
const GlsFloat32 _maxValue
 
const GlsFloat32 _rolloverThreshold
 
const Behavior _behavior
 
const GeometryType _geometryType
 
const GlsFloat32 _degreesPerDigit
 
const GlsFloat32 _textureScale
 
const GlsFloat64 _magnitude
 
const GlsFloat64 _lastMagnitude
 
GlsFloat32 _value
 
GlsFloat32 *const _textureOffsetY
 
- Protected Attributes inherited from GlsGroup
GlsDisplayObjectArray _objects
 
- Protected Attributes inherited from GlsDisplayObject
const GlsMatrixAffineD _dcsMatrix
 
const GlsMatrixAffineD _dcsMatrixInverse
 
const GlsBool _dcsMatrixIsIdentity
 
const GlsVector3D _location
 
const GlsBool _needCalculate
 
const ObjectType _objectType
 
const PickRegion _pickRegion
 
GlsEventDispatcher *const _eventDispatcher
 
const GlsVector3D _rotationPoint
 
GlsBool _blinking
 
GlsFloat32 _blinkRate
 
GlsMatrixAffineD::GLMatrixAffineF _drawMatrix
 
GlsVector3D _dynamicRotation
 
GlsVector3D _dynamicScale
 
GlsBool _dynamicScaleIsUnity
 
GlsVector3D _dynamicTranslation
 
GlsBool _needCalcDrawMatrix
 
GlsBool _visible
 
PickMode _pickMode
 
GlsBool _windowPickRegionValid
 
GlsVector2D _windowPickLowerLeft
 
GlsVector2D _windowPickUpperRight
 
GlsVector2D _windowPickUpperLeft
 
GlsVector2D _windowPickLowerRight
 
GlsMatrixAffineD::GLMatrixAffineF _pickMatrix
 
GlsDisplayObject_parent
 

Detailed Description

This class facilitates building rolling odometer displays.

Invariant
base class invariant holds, _baseSystem > 0u, _minValue <= _maxValue, _rolloverThreshold > 0.0f, GlsOdometerBehaviorIsValid( _behavior ), GlsOdometerGeometryTypeIsValid( _geometryType ) GlsFloatIsValid( _degreesPerDigit ), GlsFloatIsValid( _textureScale ), _magnitude > 0.0, ( _minValue <= _value ) && ( _value <= _maxValue ), ( ( ( 0u == _objects.GetSize() ) && ( GLS_NULL == _textureOffsetY ) ) || ( ( _objects.GetSize() > 0u ) && ( GLS_NULL != _textureOffsetY ) ) ), _textureOffsetY array contains valid floating point values

Member Enumeration Documentation

odometer behvior mode

Enumerator
BEHAVIOR_ANALOG 

analog odometer

BEHAVIOR_DIGITAL 

digital odometer

odometer geometry types

Enumerator
GEOMETRY_TYPE_2D 

two dimensional geometry

GEOMETRY_TYPE_3D 

three dimensional geometry

Constructor & Destructor Documentation

GlsOdometer::GlsOdometer ( InitParameters initParameters,
GlsEventDispatcher *const  eventDispatcher 
)

Constructor - create an instance

Parameters
initParametersinitialization parameters
eventDispatcherevent dispatcher for this object else GLS_NULL
Precondition
initParameters.IsValid()
Postcondition
instance created
virtual GlsOdometer::~GlsOdometer ( )
protectedvirtual

Destructor - shall never be called

Precondition
none
Postcondition
none

Member Function Documentation

void GlsOdometer::SetValue ( const GlsFloat32  value)

Set the current display value for the odometer

Parameters
valuenew display value
Precondition
_minValue <= value <= _maxValue
Postcondition
odometer has new display value
void GlsOdometer::UpdateDigits ( void  )
protected

Update the odometer digits to display the current value

Precondition
none
Postcondition
current value is reflected in the odometer digits

Member Data Documentation

const GlsUInt32 GlsOdometer::_baseSystem
protected

base of number system for display ( >0 )

const Behavior GlsOdometer::_behavior
protected

odometer behavior mode

const GlsFloat32 GlsOdometer::_degreesPerDigit
protected

rotation in degrees for one digit when in 3D geometry mode

const GeometryType GlsOdometer::_geometryType
protected

odometer geometry type

const GlsFloat64 GlsOdometer::_lastMagnitude
protected

magnitude of last (least significant) digit in odometer

const GlsFloat64 GlsOdometer::_magnitude
protected

magnitude of most significant digit on odometer

const GlsFloat32 GlsOdometer::_maxValue
protected

maximum display value for odometer ( maxValue >= minValue )

const GlsFloat32 GlsOdometer::_minValue
protected

minimum display value for odometer ( minValue <= maxValue )

const GlsFloat32 GlsOdometer::_rolloverThreshold
protected

threshold determining when digit rollover occurs ( >0.0f )

GlsFloat32* const GlsOdometer::_textureOffsetY
protected

array of y texture offsets for each digit in odometer else GLS_NULL if no digits

const GlsFloat32 GlsOdometer::_textureScale
protected

amount to slide texture when in 2D geometry mode

GlsFloat32 GlsOdometer::_value
protected

current display value for odometer ( minValue <= initialValue <= maxValue )