GL Studio SCECpp Runtime Library
|
#include <gls_display_object.h>
Classes | |
struct | InitParameters |
struct | PickRegion |
Public Types | |
enum | ObjectType { OBJECT_TYPE_COMPOSITE, OBJECT_TYPE_RENDERABLE } |
enum | PickMode { PICK_MODE_NEVER, PICK_MODE_FIRST, PICK_MODE_ALWAYS } |
Public Member Functions | |
virtual void | Draw (GlsStateManager &gl, const GlsFloat64 time)=0 |
virtual void | Calculate (const GlsFloat64 time) |
virtual GlsDisplayObject * | PickTest (const GlsVector2D &windowCoord, GlsInputManager &inputManager, const GlsMatrixAffineD::GLMatrixAffineF &parentDrawMatrix) |
GlsDisplayObject * | HandleEvent (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 | |
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 |
Base Class for all graphical objects. It is an abstract class. All drawn objects are derived from this class.
Enumeration for possible base object types
Enumerator | |
---|---|
OBJECT_TYPE_COMPOSITE |
Object is derived from GlsCompositeObject |
OBJECT_TYPE_RENDERABLE |
Object is dervied from GlsRenderObject |
Enumeration for possible pick modes
|
protected |
Constructor for display objects. Invoked by constructors of derived classes.
initParameters | initialization parameters |
objectType | object type for this object |
eventDispatcher | event dispatcher for this object else GLS_NULL |
|
protectedvirtual |
Destructor - shall never be called
|
protected |
Recalculates the _drawMatrix if needed If _dynamicRotation, _dynamicScale, or _dynamicTranslate change you must call CalcDrawMatrix()
additionalTransform | additional transform to apply to calculated draw matrix else GLS_NULL for no addition transform |
includeLocation | GLS_TRUE to include contribution from _location else GLS_FALSE |
|
virtual |
Provides a mechanism for performing regular calculations, separate from drawing. In a standalone applicaton Calculate is recursively called by the main loop before the objects are drawn.
time | The elaspsed time in seconds since program start |
Reimplemented in GlsComponentBase, and GlsGroup.
|
protectedvirtual |
Recalculates the window picking region if needed
inputManager | input manager managing input for this object |
parentDrawMatrix | draw matrix used when rendering parent object |
|
pure virtual |
Draws this object. Pure virtual method
gl | GL State manager for OpenGL into which object is drawn |
time | the elaspsed time in seconds since program start |
Implemented in GlsText, GlsTriangleMesh, GlsComponentBase, GlsGroup, and GlsPolygon.
ObjectType GlsDisplayObject::GetObjectType | ( | void | ) | const |
Get the type of this object
GlsDisplayObject* GlsDisplayObject::HandleEvent | ( | GlsEvent & | event | ) |
Handle an event
event | event in question |
void GlsDisplayObject::InvalidatePickCache | ( | void | ) |
Invalidate cached picking screen coordinates
|
protected |
Determine if the object is in an "off" blink cycle (invisible)
time | elapsed time in seconds since program start |
GlsBool GlsDisplayObject::NeedCalculate | ( | void | ) | const |
Determine if Calculate() needs to be called on this object
|
virtual |
Perform a pick test of the given point in window coordinates against this object
windowCoord | point in question |
inputManager | input manager managing input for this object |
parentDrawMatrix | draw matrix used when rendering parent object |
Reimplemented in GlsComponentBase, and GlsGroup.
void GlsDisplayObject::SetBlinking | ( | const GlsBool | blinking | ) |
Set the blinking state for this object
blinking | Whether or not to blink this object ( GLS_TRUE, GLS_FALSE ) |
void GlsDisplayObject::SetBlinkRate | ( | const GlsFloat32 | blinkRate | ) |
Set the blinking rate for this object
blinkRate | Number of times per second to blink this object |
void GlsDisplayObject::SetDynamicRotation | ( | const GlsVector3D & | dynamicRotation | ) |
Sets the dynamic rotations to the specified value for all axes (in degrees)
dynamicRotation | Vector containing the new dynamic rotation angles for each axis |
void GlsDisplayObject::SetDynamicScale | ( | const GlsVector3D & | dynamicScale | ) |
Sets the dynamic scale values for each axis
dynamicScale | The new dynamic scale for the object |
void GlsDisplayObject::SetDynamicTranslation | ( | const GlsVector3D & | dynamicTranslation | ) |
Sets the dynamic translation to the specified value for all axes (in logical units)
dynamicTranslation | The new dynamic translation for the X, Y, and Z axes |
void GlsDisplayObject::SetParent | ( | GlsDisplayObject *const | parent | ) |
Set the parent object for this object
parent | parent object for this object |
void GlsDisplayObject::SetPickMode | ( | const PickMode | pickMode | ) |
Set the pick mode for this object
pickMode | new pick mode |
void GlsDisplayObject::SetVisibility | ( | const GlsBool | visible | ) |
Set the visiblity state for this object
visible | GLS_TRUE to enable this object for drawing else GLS_FALSE |
|
protected |
GLS_TRUE if blinking is turned on else GLS_FALSE )
|
protected |
Number of times per second the object will blink (>0.0)
|
protected |
The dynamic coordinate system. The Dynamic changes to rotation, scale, and translate will be modified by this and applied to the _drawMatrix.
|
protected |
inverse of _dcsMatrix
|
protected |
GLS_TRUE if _dscMatrix is identity else GLS_FALSE
|
protected |
The objects contribution to the OpenGL draw matrix. This will be multiplied by the current matrix at draw time. If identity, this object has no contribution (it is not dynamic)
|
protected |
The current (dynamic) rotation of the object, in degrees and relative to the object's rotation point. Order of rotation is x, then y, then z
|
protected |
The current (dynamic) scale of the object
|
protected |
GLS_TRUE if _dynamic scale is unity on all three axes
|
protected |
The current (dynamic) translation of the object, in logical units and relative to the object's DCS.
|
protected |
dispatcher for received events else GLS_NULL
|
protected |
The location of the origin point for this object, in the world coordinate system.
|
protected |
GLS_TRUE if CalcDrawMatrix() needs to be called on this object else GLS_FALSE.
|
protected |
GLS_TRUE if Calculate() needs be called on this object else GLS_FALSE.
|
protected |
OBJECT_TYPE_RENDERABLE or OBJECT_TYPE_COMPOSITE
|
protected |
parent of this object else GLS_NULL
|
protected |
matrix used to transform window pick region if _windowPickRegionValid == GLS_TRUE
|
protected |
pick mode for object
|
protected |
pick region for object
|
protected |
The location, in the object coordinate system, of the point to rotate this object around when the object is dynamically rotated. So when we want to rotate this object (not just rotate the view), this is the point to rotate about. This point is relative to the _location, which makes in in the objects coordinate system.
|
protected |
GLS_TRUE if object drawing is enabled else GLS_FALSE
|
protected |
lower left coord of pick region in window coords if _windowPickRegionValid == GLS_TRUE
|
protected |
lower right coord of pick region in window coords if _windowPickRegionValid == GLS_TRUE
|
protected |
GLS_TRUE if cached window pick region values are valid
|
protected |
upper left coord of pick region in window coords if _windowPickRegionValid == GLS_TRUE
|
protected |
upper right coord of pick region in window coords if _windowPickRegionValid == GLS_TRUE