|
GL Studio C++ Runtime API
|
#include <gls_rso_interface_impl.h>
Public Member Functions | |
| int | LiveComponentEventHandlerCb (ComponentBase *, disti::DisplayEvent *ev) |
| void | Calculate (double time) override |
| The RSO Interface methods. More... | |
| RsoImplBaseInterface * | CloneObject () override |
| void | DeleteInstance () override |
| Safely delete the object. More... | |
| 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 |
| void | PreDraw (const RsoImplBaseInterface::OpenGLMatrices &parentMatrices, RsoImplBaseInterface::Culler &culler) override |
| void | SetResource (const char *resourceName, const char *resourceVal) override |
| const char * | GetResource (const char *resourceName) override |
| const char * | GetResources (RsoImplBaseInterface::ResourceFilter *filter=NULL) override |
| ResourceHandle | CreateResourceHandle (const char *resourceName) override |
| void | ReleaseResourceHandle (ResourceHandle resourceHandle) override |
| bool | IsResourceHandleValid (ResourceHandle resourceHandle) override |
| void | SetResource (ResourceHandle resourceHandle, const char *resourceVal) override |
| const char * | GetResource (ResourceHandle resourceHandle) override |
| void | SetIntResource (const char *resourceName, long resourceVal) override |
| long | GetIntResource (const char *resourceName) override |
| void | SetIntResource (ResourceHandle resourceHandle, long resourceVal) override |
| long | GetIntResource (ResourceHandle resourceHandle) override |
| void | SetFloatResource (const char *resourceName, double resourceVal) override |
| double | GetFloatResource (const char *resourceName) override |
| void | SetFloatResource (ResourceHandle resourceHandle, double resourceVal) override |
| double | GetFloatResource (ResourceHandle resourceHandle) override |
| CallbackID | RegisterResourceObserver (ResourceHandle resourceHandle, ResourceObserver *obs) override |
| void | UnregisterResourceObserver (ResourceHandle resourceHandle, CallbackID id) override |
| void | Invalidate () override |
| Notify the painter that the scene needs to be redrawn. More... | |
| bool | IsInvalidated () const override |
| void | SetPainter (RSOPainterT *painter) override |
| virtual void | SetPainter (RSOPainter *painter)=0 |
| virtual CallbackID | RegisterResourceObserver (ResourceHandle resourceHandle, ResourceObserver *observer)=0 |
| virtual void | UnregisterResourceObserver (ResourceHandle resourceHandle, CallbackID id)=0 |
| virtual bool | HandleMultiTouchInput (MouseMultiTouchEvent *ev)=0 |
Public Member Functions inherited from RSOInterface2 | |
| virtual ResourceHandle | CreateResourceHandle (const char *resourceName)=0 |
| virtual void | ReleaseResourceHandle (ResourceHandle resourceHandle)=0 |
| virtual bool | IsResourceHandleValid (ResourceHandle resourceHandle)=0 |
| virtual void | SetResource (ResourceHandle resourceHandle, const char *resourceVal)=0 |
| virtual const char * | GetResource (ResourceHandle resourceHandle)=0 |
| virtual void | SetIntResource (const char *resourceName, long resourceVal)=0 |
| virtual long | GetIntResource (const char *resourceName)=0 |
| virtual void | SetIntResource (ResourceHandle handle, long resourceVal)=0 |
| virtual long | GetIntResource (ResourceHandle resourceHandle)=0 |
| virtual void | SetFloatResource (const char *resourceName, double resourceVal)=0 |
| virtual double | GetFloatResource (const char *resourceName)=0 |
| virtual void | SetFloatResource (ResourceHandle handle, double resourceVal)=0 |
| virtual double | GetFloatResource (ResourceHandle resourceHandle)=0 |
| virtual const char * | GetResource (const char *resourceName)=0 |
| virtual void | SetResource (const char *resourceName, const char *resourceVal)=0 |
| virtual void | Calculate (double time)=0 |
| The RSO Interface methods. More... | |
| virtual void | PreDraw (const OpenGLMatrices ¤t, 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 RSOInterface1 * | CloneObject ()=0 |
| virtual void | DeleteInstance ()=0 |
| Safely delete the object. More... | |
| virtual void | Invalidate ()=0 |
| Notify the painter that the scene needs to be redrawn. More... | |
| virtual bool | IsInvalidated () const =0 |
Static Public Member Functions | |
| static GlsRSOInterfaceImpl * | CreateInstance (ComponentBase *component) |
Static Public Member Functions inherited from RSOInterface1 | |
| static unsigned int | strlen (const char *str) |
| static char * | strcpy (char *dest, const char *src) |
Protected Types | |
| typedef std::map< ResourceHandle, DistiAttributeBase * > | ResourceHandleMap |
| Typedef to associate external ids (ResourceHandle) with runtime attributes. | |
Protected Member Functions | |
| DistiAttributeBase & | GetAttribute (ResourceHandle handle) |
| GlsRSOInterfaceImpl (ComponentBase *component) | |
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. | |
Protected Attributes | |
| ComponentBase * | _component |
| RsoImplBaseInterface::EmittedEventHandler * | _emittedEventHandler |
| The container's event handler. | |
| std::string | _resourcesRetVal |
| String to return from Resources methods. | |
| ResourceHandleMap | _resourceHandleMap |
| Mapping of external RSO interface resource ids with runtime attributes. | |
| ResourceHandle | _nextResourceHandle |
| Used to track the highest id, to assign as the next resource handle. | |
| bool | _firstDraw |
| If true, this RSO has not been drawn yet. | |
| RSOPainterT * | _painter |
| Painter object that tracks the conditional rendering state. | |
| bool | _redraw |
| If true, this RSO should redraw itself on the next frame. | |
Additional Inherited Members | |
Public Types inherited from RSOInterface4 | |
| typedef unsigned int | CallbackID |
| Type for unique identifiers. | |
Public Types inherited from RSOInterface2 | |
| typedef unsigned int | ResourceHandle |
| Typedef for a unique resource identifier. | |
Implementation of RSOInterface.
|
protected |
Protected constructor - Call CreateInstance instead
| component | The component object to wrap. |
|
overridevirtual |
The RSO Interface methods.
Perform component simulation. Any non-drawing activities can be performed here. Call this before PreDraw()
| time | The current application time in seconds. |
Implements RSOInterface1.
|
overridevirtual |
Implements RSOInterface1.
|
static |
| component | The component object to wrap. |
|
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.
| resourceName | The resource name to create a handle for. |
Implements RSOInterface2.
|
overridevirtual |
Safely delete the object.
Implements RSOInterface1.
|
overridevirtual |
Draw the object via OpenGL Call this after PreDraw()
Implements RSOInterface1.
|
protected |
| handle | The external id for the desired runtime attribute. |
|
overridevirtual |
Get the extents of the component when drawn with the given transformation matrix, as a coordinate system-aligned box
| min | If the method returns true, contains the point corresponding with the 1st corner of the box. If the method returns false, value is undefined. |
| max | If the method returns true, contains the point corresponding with the 2nd corner of the box. If the method returns false, value is undefined. |
| transform | Transformation 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) |
Implements RSOInterface1.
|
overridevirtual |
Get the bounding sphere for the component in the components coordinate system
| center | If the method returns true, contains the center point of the sphere. If the method returns false, value is undefined. |
| radius | If the method returns true, contains the radius of the sphere. If the method returns false, value is undefined. |
Implements RSOInterface1.
|
overridevirtual |
| resourceName | The name to return the float value for. |
Implements RSOInterface2.
|
overridevirtual |
| resourceHandle | The handle to return the integer value for. |
Implements RSOInterface2.
|
overridevirtual |
| resourceName | The name to return the integer value for. |
Implements RSOInterface2.
|
overridevirtual |
| resourceHandle | The handle to return the integer value for. |
Implements RSOInterface2.
|
overridevirtual |
Get the string value for the given resource
| resourceName | The name of the resource whose value is to be returned. |
Implements RSOInterface1.
|
overridevirtual |
| resourceHandle | The handle to return the string value for. |
Implements RSOInterface2.
|
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.
| filter | The filter parameters to use. |
Implements RSOInterface1.
|
overridevirtual |
Allow the object to handle an event
| ev | The event to handle. |
Implements RSOInterface1.
|
overridevirtual |
Allow the object to handle a multitouch event.
| ev | The event to handle. |
Implements RSOInterface3.
|
overridevirtual |
Notify the painter that the scene needs to be redrawn.
Implements GlsPainter.
|
overridevirtual |
Implements GlsPainter.
|
overridevirtual |
Checks if a given resource handle is valid.
| resourceHandle | The resource handle to check. |
Implements RSOInterface2.
| int LiveComponentEventHandlerCb | ( | ComponentBase * | , |
| disti::DisplayEvent * | ev | ||
| ) |
Pass an event that was emitted from the component to the container.
| ev | The event to pass into the container. |
|
overridevirtual |
Pick3D returns true if the RSO was picked.
| winLoc | Device coordinates for the mouse click. Z value should be set to 0 to ensure pick ray starts at near clip plane. |
| logicalCoords | The start of the pick ray in logical coordinates. Should be calculated from the winLoc using this->WindowToLogical(winLoc, logicalCoords, &directionVector). |
| scale | Current window scale. Affects picking radius of outlines. Initial value should typically be 1.0. |
| directionVector | The direction of the pick ray in logical coordinates. Should be calculated from the winLoc using this->WindowToLogical(winLoc, logicalCoords, &directionVector). |
| collisionWinLoc | Returns where the pick vector intersects the object that is hit in device coordinates. |
| drawnMatrices | The 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. |
Implements RSOInterface1.
|
overridevirtual |
Calculate transformations and perform culling Call this before Draw()
| current | The current state of the OpenGL matrices. |
| culler | The current culler state. |
Implements RSOInterface1.
|
overridevirtual |
Register a resource observer to be notified when a resource changes *
| resourceHandle | the resource handle |
| observer | the observer to be notified. The RSO takes ownership of the observer and will call Destroy to delete it when needed. |
Implements RSOInterface4.
|
overridevirtual |
Disposes of a resource handle.
| resourceHandle | The resource handle to release. |
Implements RSOInterface2.
|
overridevirtual |
Allow for handling events from inside the object. The emitted event handler will be passed events that are from inside the component
| handler | pointer to the EmittedEventHandler object to use or NULL to remove the current event handler. |
Implements RSOInterface1.
|
overridevirtual |
Set the value as a float for a given named resource.
| resourceName | The name of the resource to set. |
| resourceVal | The new float value to set. |
Implements RSOInterface2.
|
overridevirtual |
Set the value as a float for a resource specified by handle.
| handle | The handle of the resource to set. |
| resourceVal | The new float value to set. |
Implements RSOInterface2.
|
overridevirtual |
Set the value as an integer for a given named resource.
| resourceName | The name of the resource to set. |
| resourceVal | The new integer value to set. |
Implements RSOInterface2.
|
overridevirtual |
Set the value as an integer for a resource specified by handle.
| handle | The handle of the resource to set. |
| resourceVal | The new integer value to set. |
Implements RSOInterface2.
|
overridevirtual |
Set the painter for this object, it will manage when this object should be redrawn.
| painter | The new painter to set, or NULL for no painter. |
Implements RSOInterface5.
|
overridevirtual |
Set the string value for a given named resource.
| resourceName | The name of the resource to set. |
| resourceVal | The new string value to set for the resource. |
Implements RSOInterface1.
|
overridevirtual |
Set the string value for a resource specified by handle
| resourceHandle | The handle of the resource to set. |
| resourceVal | The new string value to set. |
Implements RSOInterface2.
|
overridevirtual |
Unregister a resource observer
| resourceHandle | the resource handle used to register the observer |
| id | the id used to register the resource observer |
Implements RSOInterface4.
|
protected |
Reference to the component being wrapped. GlsRSOInterface1Impl will delete this object.