GL Studio SCECpp Runtime Library
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
GlsGroup Class Reference

#include <gls_group.h>

Inheritance diagram for GlsGroup:
GlsCompositeObject GlsDisplayObject GlsOdometer

Classes

struct  InitParameters
 

Public Member Functions

 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

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

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
 

Additional Inherited Members

- Public Types inherited from GlsDisplayObject
enum  ObjectType { OBJECT_TYPE_COMPOSITE, OBJECT_TYPE_RENDERABLE }
 
enum  PickMode { PICK_MODE_NEVER, PICK_MODE_FIRST, PICK_MODE_ALWAYS }
 

Detailed Description

This class implements a group of display objects.

Invariant
base class invariant, _objects.Invariant()

Constructor & Destructor Documentation

GlsGroup::GlsGroup ( 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 GlsGroup::~GlsGroup ( )
protectedvirtual

Destructor - shall never be called

Precondition
none
Postcondition
none

Member Function Documentation

virtual void GlsGroup::Calculate ( const GlsFloat64  time)
virtual

Provides a mechanism for performing regular calculations, separate from drawing.

Parameters
timeThe elaspsed time in seconds since program start
Precondition
time >= 0.0
Postcondition
calculations (if any) completed for all contained objects

Reimplemented from GlsDisplayObject.

virtual void GlsGroup::Draw ( GlsStateManager gl,
const GlsFloat64  time 
)
virtual

Draws the objects in the group.

Parameters
glGL State manager for OpenGL into which object is drawn
timethe elaspsed time in seconds since program start
Precondition
time >= 0.0
Postcondition
contained objects are drawn to OpenGL if visible and not blinked off

Implements GlsDisplayObject.

virtual GlsDisplayObject* GlsGroup::PickTest ( const GlsVector2D windowCoord,
GlsInputManager inputManager,
const GlsMatrixAffineD::GLMatrixAffineF parentDrawMatrix 
)
virtual

Perform a pick test of the given point in window coordinates against this object

Parameters
windowCoordpoint in question
inputManagerinput manager managing input for this object
parentDrawMatrixdraw matrix used when rendering parent object
Returns
object that is picked by given window coordinate else GLS_NULL
Precondition
windowCoord.IsValid(), GLMatrixAffineFIsValid( parentDrawMatrix )
Postcondition
none

Reimplemented from GlsDisplayObject.

virtual void GlsGroup::SetChildrenAlphaMode ( const GlsAlphaMode  alphaMode)
virtual

Set the alpha mode of the contained objects

Parameters
alphaModedesired alpha mode
Precondition
GlsAlphaModeIsValid( alphaMode )
Postcondition
contained objects have new alpha mode

Implements GlsCompositeObject.

virtual void GlsGroup::SetChildrenFillColor ( const GlsColor fillColor)
virtual

Set the fill color of the contained objects

Parameters
fillColordesired fill color
Precondition
fillColor.IsValid()
Postcondition
contained objects have new fill color

Implements GlsCompositeObject.

virtual void GlsGroup::SetChildrenLineColor ( const GlsColor lineColor)
virtual

Set the line color of the contained objects

Parameters
lineColordesired line color
Precondition
lineColor.IsValid()
Postcondition
contained objects have new line color

Implements GlsCompositeObject.

virtual void GlsGroup::SetChildrenLineWidth ( const GlsFloat32  lineWidth)
virtual

Set the line width of the contained objects

Parameters
lineWidthnew line width, GlsRenderObject::LINE_WIDTH_MIN <= lineWidth <= GlsRenderObject::LINE_WIDTH_MAX
Precondition
GlsLineWidthIsValid( lineWidth )
Postcondition
contained objects have new line width

Implements GlsCompositeObject.

virtual void GlsGroup::SetChildrenPolygonMode ( const GlsPolygonMode  polygonMode)
virtual

Set the polygon mode of the contained objects

Parameters
polygonModenew polygon mode
Precondition
GlsPolygonModeIsValid( polygonMode )
Postcondition
contained objects have new polygon mode

Implements GlsCompositeObject.

Member Data Documentation

GlsDisplayObjectArray GlsGroup::_objects
protected

array of display objects