LightSourceUserCallback Class Reference

Callback for users of LightSourceManager;. More...

#include <LightSourceManager.h>

Inheritance diagram for LightSourceUserCallback:

Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual bool onSourceTaken (LightSourceManager *pLightSourceManager, osg::Referenced *pUserObject, UINT lightNumber)
 LightSourceManager calls this method just before the owned light is to be given to another user.
virtual bool onSourceAvailable (LightSourceManager *pLightSourceManager, osg::Referenced *pUserObject, UINT lightNumber)=0
 LightSourceManager calls this method when a light source is available.
virtual void onUserDropped (LightSourceManager *pLightSourceManager, osg::Referenced *pUserObject)=0
 LightSourceManager calls this method when a user is completely dropped (user explicitly removed or manager cleared).


Detailed Description

Callback for users of LightSourceManager;.

Warning:
Enqueued users must have a LightSourceUserCallback in order to be valid. Else they'll be dropped.

Don't forget to call

 if (_nestedCallback.valid()) _nestedCallback->myMethod(myParams...); 
in every method.

Definition at line 48 of file LightSourceManager.h.


Member Function Documentation

virtual bool LightSourceUserCallback::onSourceAvailable ( LightSourceManager pLightSourceManager,
osg::Referenced *  pUserObject,
UINT  lightNumber 
) [pure virtual]

LightSourceManager calls this method when a light source is available.

Returns:
The callback must tell the LightSourceManager if the user object effectively uses the new light source (return true) or not. If yes, the user objects becomes a normal user object; else it is thrown away.

Implemented in Explosion::LSCallback.

virtual bool LightSourceUserCallback::onSourceTaken ( LightSourceManager pLightSourceManager,
osg::Referenced *  pUserObject,
UINT  lightNumber 
) [inline, virtual]

LightSourceManager calls this method just before the owned light is to be given to another user.

Source users may then do some cleanup, and should not try to modify the light or light-affected nodes after this call.

Returns:
The callback must tell the LightSourceManager if the user object wants to be re-enqueued (return true) or not. If yes, the user objects becomes an enqueud user object; else it is thrown away.

Reimplemented in Explosion::LSCallback.

Definition at line 53 of file LightSourceManager.h.

References Util::Callback< LightSourceUserCallback >::_nestedCallback.

virtual void LightSourceUserCallback::onUserDropped ( LightSourceManager pLightSourceManager,
osg::Referenced *  pUserObject 
) [pure virtual]

LightSourceManager calls this method when a user is completely dropped (user explicitly removed or manager cleared).

It is guaranteed that onSourceTaken() is called before if needed.

Implemented in Explosion::LSCallback.


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

Generated on Sun Jan 17 11:39:28 2010 for PVLE (Pro-Vocation Light Engine) by  doxygen 1.5.9