|
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 *ev) override |
| bool | HandleMultiTouchInput (RsoImplMultiTouchInterface::MouseMultiTouchEvent *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 ¤t, 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 handle, 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 handle, double resourceVal) override |
| double | GetFloatResource (ResourceHandle resourceHandle) override |
| CallbackID | RegisterResourceObserver (ResourceHandle resourceHandle, ResourceObserver *observer) override |
| void | UnregisterResourceObserver (ResourceHandle resourceHandle, CallbackID id) override |
| unsigned int | GetMaxNumLights () |
| void | SetLightData (unsigned int numLights, LightData *lightData) |
| unsigned int | GetMaxClipPlanes () |
| void | SetClipPlaneData (unsigned int numClipPlanes, float **equations) |
| void | SetMatrix (int type, const float *matrix) |
| void | SetDefaultOpenGLState () |
| Restores the state manager back to its default state. | |
| void | Invalidate () override |
| bool | IsInvalidated () const override |
| void | SetPainter (RSOPainterT *painter) override |
| 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) |
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 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. | |
Implementation of RSOInterface.
|
protected |
Protected constructor - Call CreateInstance instead
| component | The component object to wrap. |
|
override |
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. |
|
override |
|
static |
| component | The component object to wrap. |
|
override |
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. |
|
override |
Safely delete the object.
|
override |
Draw the object via OpenGL Call this after PreDraw()
|
protected |
| handle | The external id for the desired runtime attribute. |
|
override |
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) |
|
override |
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. |
|
override |
| resourceName | The name to return the float value for. |
|
override |
| resourceHandle | The handle to return the integer value for. |
|
override |
| resourceName | The name to return the integer value for. |
|
override |
| resourceHandle | The handle to return the integer value for. |
| unsigned int GetMaxClipPlanes | ( | ) |
| unsigned int GetMaxNumLights | ( | ) |
|
override |
Get the string value for the given resource
| resourceName | The name of the resource whose value is to be returned. |
|
override |
| resourceHandle | The handle to return the string value for. |
|
override |
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. |
|
override |
Allow the object to handle an event
| ev | The event to handle. |
|
override |
Allow the object to handle a multitouch event.
| ev | The event to handle. |
|
overridevirtual |
Notify the painter that the scene needs to be redrawn
Implements GlsPainter.
|
overridevirtual |
Implements GlsPainter.
|
override |
Checks if a given resource handle is valid.
| resourceHandle | The resource handle to check. |
| 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. |
|
override |
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. |
|
override |
Calculate transformations and perform culling Call this before Draw()
| current | The current state of the OpenGL matrices. |
| culler | The current culler state. |
|
override |
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. |
|
override |
Disposes of a resource handle.
| resourceHandle | The resource handle to release. |
| void SetClipPlaneData | ( | unsigned int | numClipPlanes, |
| float ** | equations | ||
| ) |
Activates and updates the clip planes in the state manager.
| [in] | numClipPlanes | Determines how many planes are defined in the equations array. |
| [in] | equations | An array of floats that define each plane where each equation is defined by four floats. equations[numClipPlanes][4]. |
|
override |
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. |
|
override |
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. |
|
override |
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. |
|
override |
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. |
|
override |
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. |
| void SetLightData | ( | unsigned int | numLights, |
| LightData * | lightData | ||
| ) |
Updates the state manager to set various light parameters.
| numLights | The number of lights within the lightData. |
| lightData | An array of data where each element contains a collection of light properties. |
| void SetMatrix | ( | int | type, |
| const float * | matrix | ||
| ) |
Updates the state manager's top matrix based on the type.
| [in] | type | If it's equal to RSO_MODELVIEW_MATRIX, it'll load the model view matrix. If it's RSO_PROJECTION_MATRIX, then it'll retrieve the ProjectionMatrix instead. |
| [in] | matrix | The matrix to push to the top of the stack. |
|
override |
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. |
|
override |
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. |
|
override |
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. |
|
override |
Unregister a resource observer
| resourceHandle | the resource handle used to register the observer |
| id | the id used to register the resource observer |
|
protected |
Reference to the component being wrapped. GlsRSOInterface1Impl will delete this object.