GL Studio C++ Runtime API
GlsRSOInterfaceImpl Class Reference

#include <gls_rso_interface_impl.h>

Inheritance diagram for GlsRSOInterfaceImpl:
RSOInterface5 GlsPainter RSOInterface4 RSOInterface3 RSOInterface2 RSOInterface1

Public Member Functions

void Calculate (double time) override
 The RSO Interface methods. More...
 
RsoImplBaseInterfaceCloneObject () override
 
void DeleteInstance () override
 Safely delete the object.
 
void Draw () override
 
bool SetEmittedEventHandler (RsoImplBaseInterface::EmittedEventHandler *handler) override
 
bool GetBoundingSphere (RsoImplBaseInterface::Vector *center, float *radius) override
 
bool GetBoundingBox (RsoImplBaseInterface::Vector *min, RsoImplBaseInterface::Vector *max, const RSOMatrixT *transform=NULL) override
 
bool HandleInput (RsoImplBaseInterface::Event *lci1_ev) override
 
bool HandleMultiTouchInput (RsoImplMultiTouchInterface::MouseMultiTouchEvent *lci3_ev) override
 
bool Pick3D (const RsoImplBaseInterface::Vector &winLoc, const RsoImplBaseInterface::Vector &logicalCoords, float scale, const RsoImplBaseInterface::Vector &directionVector, RsoImplBaseInterface::Vector &collisionWinLoc, const RsoImplBaseInterface::OpenGLMatrices &drawnMatrices) override
 Pick3D returns true if the RSO was picked.
 
void PreDraw (const RsoImplBaseInterface::OpenGLMatrices &parentMatrices, RsoImplBaseInterface::Culler &culler) override
 
void SetResource (const char *resourceName, const char *resourceVal) override
 Set the string value for a given named resource.
 
const char * GetResource (const char *resourceName) override
 Get the string value for the given resource.
 
const char * GetResources (RsoImplBaseInterface::ResourceFilter *filter=NULL) override
 
ResourceHandle CreateResourceHandle (const char *resourceName) override
 
void ReleaseResourceHandle (ResourceHandle resourceHandle) override
 Disposes of a resource handle.
 
bool IsResourceHandleValid (ResourceHandle resourceHandle) override
 Checks if a given resource handle is valid.
 
void SetResource (ResourceHandle resourceHandle, const char *resourceVal) override
 Set the string value for a resource specified by handle.
 
const char * GetResource (ResourceHandle resourceHandle) override
 Get the string value for a resource specified by handle.
 
void SetIntResource (const char *resourceName, long resourceVal) override
 Set the value as an integer for a given named resource.
 
long GetIntResource (const char *resourceName) override
 Get the value as an integer for a given named resource.
 
void SetIntResource (ResourceHandle resourceHandle, long resourceVal) override
 Set the value as an integer for a resource specified by handle.
 
long GetIntResource (ResourceHandle resourceHandle) override
 Set the value as an integer for a resource specified by handle.
 
void SetFloatResource (const char *resourceName, double resourceVal) override
 Set the value as a float for a given named resource.
 
double GetFloatResource (const char *resourceName) override
 Get the value as a float for a given named resource.
 
void SetFloatResource (ResourceHandle resourceHandle, double resourceVal) override
 Set the value as a float for a resource specified by handle.
 
double GetFloatResource (ResourceHandle resourceHandle) override
 Set the value as a float for a resource specified by handle.
 
CallbackID RegisterResourceObserver (ResourceHandle resourceHandle, ResourceObserver *obs) override
 
void UnregisterResourceObserver (ResourceHandle resourceHandle, CallbackID id) override
 
void Invalidate () override
 
bool IsInvalidated () const override
 
void SetPainter (RSOPainterT *painter) override
 

Additional Inherited Members

- Public Types inherited from RSOInterface4
typedef unsigned int CallbackID
 Type for unique identifiers.
 
- Protected Member Functions inherited from RSOInterface5
virtual ~RSOInterface5 ()
 Protected destructor so it can't be deleted directly.
 
- Protected Member Functions inherited from RSOInterface4
virtual ~RSOInterface4 ()
 Protected destructor so it can't be deleted directly.
 
- Protected Member Functions inherited from RSOInterface3
virtual ~RSOInterface3 ()
 Protected destructor so it can't be deleted directly.
 
- Protected Member Functions inherited from RSOInterface2
virtual ~RSOInterface2 ()
 Protected destructor so it can't be deleted directly.
 
- Protected Member Functions inherited from RSOInterface1
virtual ~RSOInterface1 ()
 Protected destructor so it can't be deleted directly.
 

Detailed Description

Implementation of RSOInterface.

Member Function Documentation

void Calculate ( double  time)
overridevirtual

The RSO Interface methods.

Perform component simulation. Any non-drawing activities can be performed here. Call this before PreDraw()

Implements RSOInterface1.

RsoImplBaseInterface* CloneObject ( )
overridevirtual

Returns a new instance of the RSO that is a clone of this object or NULL if not possible.

Implements RSOInterface1.

ResourceHandle CreateResourceHandle ( const char *  resourceName)
overridevirtual

Obtains a resource handle to a given named resource This handle must be disposed of with the ReleaseResourceHandle method once it is no longer needed. If this method fails, the return value will not be a valid handle; this can be determined by calling IsResourceHandleValid.

Implements RSOInterface2.

void Draw ( )
overridevirtual

Draw the object via OpenGL Call this after PreDraw()

Implements RSOInterface1.

bool GetBoundingBox ( RsoImplBaseInterface::Vector min,
RsoImplBaseInterface::Vector max,
const RSOMatrixT transform = NULL 
)
overridevirtual

Get the extents of the component when drawn with the given transformation matrix, as a coordinate system-aligned box

Parameters
minIf the method returns true, contains the point corresponding with the 1st corner of the box. If the method returns false, value is undefined.
maxIf the method returns true, contains the point corresponding with the 2nd corner of the box. If the method returns false, value is undefined.
transformTransformation matrix from A to B where A is the component's coordinate system and B is the coordinate system to compute the bounding box in. (If NULL then identity matrix is assumed)
Returns
true if the extents were calculated, false if the extents could not be calculated.

Implements RSOInterface1.

bool GetBoundingSphere ( RsoImplBaseInterface::Vector center,
float *  radius 
)
overridevirtual

Get the bounding sphere for the component in the components coordinate system

Parameters
centerIf the method returns true, contains the center point of the sphere. If the method returns false, value is undefined.
radiusIf the method returns true, contains the radius of the sphere. If the method returns false, value is undefined.
Returns
true if the bounding sphere was returned, false if the bounding sphere is not available.

Implements RSOInterface1.

const char* GetResources ( RsoImplBaseInterface::ResourceFilter filter = NULL)
overridevirtual

Get a list of the resources for the component. Each resource is separated by a newline ('
') with the output controlled by filter. filter may be NULL in which case the default values are used.

Implements RSOInterface1.

bool HandleInput ( RsoImplBaseInterface::Event ev)
overridevirtual

Allow the object to handle an event Returns true if the event was handled by the component

Implements RSOInterface1.

bool HandleMultiTouchInput ( RsoImplMultiTouchInterface::MouseMultiTouchEvent ev)
overridevirtual

Allow the object to handle a multitouch event. Returns true if the event was handled by the component

Implements RSOInterface3.

void Invalidate ( )
overridevirtual

Calls Invalidate on the parent's painter, causing the scene to redraw in conditional rendering.

Implements GlsPainter.

bool IsInvalidated ( ) const
overridevirtual

Returns whether or not the parent's painter has already been invalidated

Implements GlsPainter.

void PreDraw ( const RsoImplBaseInterface::OpenGLMatrices current,
RsoImplBaseInterface::Culler culler 
)
overridevirtual

Calculate transformations and perform culling Call this before Draw()

Implements RSOInterface1.

CallbackID RegisterResourceObserver ( ResourceHandle  resourceHandle,
ResourceObserver observer 
)
overridevirtual

Register a resource observer to be notified when a resource changes *

Parameters
resourceHandlethe resource handle
observerthe observer to be notified. The RSO takes ownership of the observer and will call Destroy to delete it when needed.
Returns
the id used to unregister the observer in combination with the original resourceHandle

Implements RSOInterface4.

bool SetEmittedEventHandler ( RsoImplBaseInterface::EmittedEventHandler handler)
overridevirtual

Allow for handling events from inside the object. The emitted event handler will be passed events that are from inside the component

Parameters
handlerpointer to the EmittedEventHandler object to use or NULL to remove the current event handler.
Returns
true if this component may emit events, false if this component will never emit events.

Implements RSOInterface1.

void SetPainter ( RSOPainterT painter)
overridevirtual

Assigns a parent painter to this RSO which will be updated when any RSO child object causes invalidation.

Implements RSOInterface5.

void UnregisterResourceObserver ( ResourceHandle  resourceHandle,
CallbackID  id 
)
overridevirtual

Unregister a resource observer

Parameters
resourceHandlethe resource handle used to register the observer
idthe id used to register the resource observer

Implements RSOInterface4.


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