GL Studio C++ Runtime API
GlsRSOInterfaceImpl Class Reference

#include <gls_rso_interface_impl.h>

Inheritance diagram for GlsRSOInterfaceImpl:
RSOInterface4 RSOInterface3 RSOInterface2 RSOInterface1

Public Member Functions

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

Additional Inherited Members

- Public Types inherited from RSOInterface4
typedef unsigned int CallbackID
 Type for unique identifiers.
 
- 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 RSOInterface4.

Member Function Documentation

void Calculate ( double  time)
virtual

The RSO Interface methods.

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

Implements RSOInterface1.

RsoImplBaseInterface* CloneObject ( )
virtual

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)
virtual

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 ( )
virtual

Draw the object via OpenGL Call this after PreDraw()

Implements RSOInterface1.

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

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 
)
virtual

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)
virtual

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)
virtual

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

Implements RSOInterface1.

bool HandleMultiTouchInput ( RsoImplMultiTouchInterface::MouseMultiTouchEvent ev)
virtual

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

Implements RSOInterface3.

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

Calculate transformations and perform culling Call this before Draw()

Implements RSOInterface1.

CallbackID RegisterResourceObserver ( ResourceHandle  resourceHandle,
ResourceObserver observer 
)
virtual

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)
virtual

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 UnregisterResourceObserver ( ResourceHandle  resourceHandle,
CallbackID  id 
)
virtual

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: