GL Studio C++ Runtime API
RSOInterface1 Class Referenceabstract

#include <rso_interface_1.h>

Inheritance diagram for RSOInterface1:
RSOInterface2 RSOInterface3 RSOInterface4 RSOInterface5 GlsRSOInterfaceImpl

Classes

class  Culler
 
class  EmittedEventHandler
 
class  Event
 
class  KeyboardEvent
 
class  LocationEvent
 
class  MatrixD
 
class  MouseEvent
 
class  ObjectEvent
 
class  OpenGLMatrices
 
class  PlaneClass
 
class  ResourceFilter
 
class  Vector
 

Public Member Functions

virtual void Calculate (double time)=0
 The RSO Interface methods. More...
 
virtual void PreDraw (const OpenGLMatrices &current, Culler &culler)=0
 
virtual void Draw ()=0
 
virtual void SetResource (const char *resourceName, const char *resourceVal)=0
 
virtual const char * GetResource (const char *resourceName)=0
 
virtual const char * GetResources (ResourceFilter *filter=0)=0
 
virtual bool HandleInput (Event *ev)=0
 
virtual bool SetEmittedEventHandler (EmittedEventHandler *handler)=0
 
virtual bool Pick3D (const Vector &winLoc, const Vector &logicalCoords, float scale, const Vector &directionVector, Vector &collisionWinLoc, const OpenGLMatrices &drawnMatrices)=0
 
virtual bool GetBoundingSphere (Vector *center, float *radius)=0
 
virtual bool GetBoundingBox (Vector *min, Vector *max, const MatrixD *transform=0)=0
 
virtual RSOInterface1CloneObject ()=0
 
virtual void DeleteInstance ()=0
 Safely delete the object. More...
 

Static Public Member Functions

static unsigned int strlen (const char *str)
 
static char * strcpy (char *dest, const char *src)
 

Protected Member Functions

virtual ~RSOInterface1 ()
 Protected destructor so it can't be deleted directly.
 

Detailed Description

The RSOInterface1 class defines an abstract interface to an RSO instance.

Member Function Documentation

◆ Calculate()

virtual void Calculate ( double  time)
pure virtual

The RSO Interface methods.

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

Parameters
timeThe current application time in seconds.

Implemented in GlsRSOInterfaceImpl.

◆ CloneObject()

virtual RSOInterface1 * CloneObject ( )
pure virtual
Returns
A new instance of the RSO that is a clone of this object or NULL if not possible.

Implemented in GlsRSOInterfaceImpl.

◆ DeleteInstance()

virtual void DeleteInstance ( )
pure virtual

Safely delete the object.

Implemented in GlsRSOInterfaceImpl.

◆ Draw()

virtual void Draw ( )
pure virtual

Draw the object via OpenGL Call this after PreDraw()

Implemented in GlsRSOInterfaceImpl.

◆ GetBoundingBox()

virtual bool GetBoundingBox ( Vector min,
Vector max,
const MatrixD transform = 0 
)
pure 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.

Implemented in GlsRSOInterfaceImpl.

◆ GetBoundingSphere()

virtual bool GetBoundingSphere ( Vector center,
float *  radius 
)
pure 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.

Implemented in GlsRSOInterfaceImpl.

◆ GetResource()

virtual const char * GetResource ( const char *  resourceName)
pure virtual

Get the string value for the given resource

Parameters
resourceNameThe name of the resource whose value is to be returned.
Returns
The string value for the given resource, or empty string if not found.

Implemented in GlsRSOInterfaceImpl, and RSOInterface2.

◆ GetResources()

virtual const char * GetResources ( ResourceFilter filter = 0)
pure 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.

Parameters
filterThe filter parameters to use.
Returns
A string containing the list of resource data that passes the filter.

Implemented in GlsRSOInterfaceImpl.

◆ HandleInput()

virtual bool HandleInput ( Event ev)
pure virtual

Allow the object to handle an event

Parameters
evThe event to handle.
Returns
True if the event was handled by the component.

Implemented in GlsRSOInterfaceImpl.

◆ Pick3D()

virtual bool Pick3D ( const Vector winLoc,
const Vector logicalCoords,
float  scale,
const Vector directionVector,
Vector collisionWinLoc,
const OpenGLMatrices drawnMatrices 
)
pure virtual

Pick3D returns true if the RSO was picked.

Parameters
winLocDevice coordinates for the mouse click. Z value should be set to 0 to ensure pick ray starts at near clip plane.
logicalCoordsThe start of the pick ray in logical coordinates. Should be calculated from the winLoc using this->WindowToLogical(winLoc, logicalCoords, &directionVector).
scaleCurrent window scale. Affects picking radius of outlines. Initial value should typically be 1.0.
directionVectorThe direction of the pick ray in logical coordinates. Should be calculated from the winLoc using this->WindowToLogical(winLoc, logicalCoords, &directionVector).
collisionWinLocReturns where the pick vector intersects the object that is hit in device coordinates.
drawnMatricesThe matrices used to draw the object, including matrices set by parents that may have dynamically rotated, translated or scaled this object. Initial value should typically be a default OpenGLMatrices() object.
Returns
True if the object was picked.

Implemented in GlsRSOInterfaceImpl.

◆ PreDraw()

virtual void PreDraw ( const OpenGLMatrices current,
Culler culler 
)
pure virtual

Calculate transformations and perform culling Call this before Draw()

Parameters
currentThe current state of the OpenGL matrices.
cullerThe current culler state.

Implemented in GlsRSOInterfaceImpl.

◆ SetEmittedEventHandler()

virtual bool SetEmittedEventHandler ( EmittedEventHandler handler)
pure 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.

Implemented in GlsRSOInterfaceImpl.

◆ SetResource()

virtual void SetResource ( const char *  resourceName,
const char *  resourceVal 
)
pure virtual

Set the string value for a given named resource.

Parameters
resourceNameThe name of the resource to set.
resourceValThe new string value to set for the resource.

Implemented in GlsRSOInterfaceImpl, and RSOInterface2.

◆ strcpy()

static char * strcpy ( char *  dest,
const char *  src 
)
inlinestatic

Copy the given C string from src to dest.

Parameters
destThe destination memory region.
srcThe source memory region.
Returns
The destination memory region.

◆ strlen()

static unsigned int strlen ( const char *  str)
inlinestatic

Return the length of the given C string.

Parameters
strThe string whose length is to be computed.
Returns
The length of the string in bytes.

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