Visualization Library

A lightweight C++ OpenGL middleware for 2D/3D graphics
[Home] [Tutorials] [All Classes] [Grouped Classes]
Public Member Functions | Protected Attributes

vl::ActorEventCallback Class Reference

The ActorEventCallback class defines a callback object to react to Actor-related events. More...

#include <Actor.hpp>

Inheritance diagram for vl::ActorEventCallback:
vl::Object vl::DepthSortCallback vl::EdgeUpdateCallback vl::MorphingCallback vlVolume::SlicedVolume

List of all members.

Public Member Functions

 ActorEventCallback ()
virtual void onActorRenderStarted (Actor *actor, Real frame_clock, const Camera *cam, Renderable *renderable, const Shader *shader, int pass)=0
 Event generated just before an Actor is rendered but after the render states are ready and setup.
virtual void onActorDelete (Actor *actor)=0
 Event notifying that an Actor is being deleted.
void setEnabled (bool enabled)
bool isEnabled () const

Protected Attributes

bool mEnabled

Detailed Description

The ActorEventCallback class defines a callback object to react to Actor-related events.

Usually an ActorEventCallback is used to perform a per-Actor operation like changing some attributes of the Actor itself or of the associated Renderable/Geometry. For example the MorphingCallback class is used to aid the rendering of a MorphingCallback, while the DepthSortCallback class is used to perform per-Actor polygon sorting.

Note:
You can manipulate Uniforms within this class, for more information see vl::GLSLProgram documentation. If you want to update the state of a Uniform variable from here you can simply call glUniform* since the GLSLProgram (if any) has been already activated by the time this function is called. You can also modify the Actor's uniforms using the Actor's uniform manipulation routines Actor::setUniform() Actor::getUniform() etc.

You can test whether the shader has a GLSLProgram bound to it or not by simply testing shader->glslProgram() != NULL. If you update a uniform you must ensure that all the Actor[s] using the same GLSLProgram appropriately setup such uniform.

Note:
An ActorEventCallback::onActorRenderStarted() is called once for every rendering pass, ie. if an Actor's Effect specifies three rendering passes the Actor callbacks will be called three times, once for each rendering pass / shader.
See also:

Constructor & Destructor Documentation

vl::ActorEventCallback::ActorEventCallback (  ) [inline]

Member Function Documentation

virtual void vl::ActorEventCallback::onActorRenderStarted ( Actor actor,
Real  frame_clock,
const Camera cam,
Renderable renderable,
const Shader shader,
int  pass 
) [pure virtual]

Event generated just before an Actor is rendered but after the render states are ready and setup.

Reimplement to react to this event.

Parameters:
actorThe Actor bound to this rendering callback.
frame_clockThe current rendering frame time, usually used for animation purposes.
camThe camera used for the current rendering.
renderableThe currently selected Actor LOD.
shaderThe currently active Shader.
passThe current Actor[s] rendering pass.

Implemented in vl::DepthSortCallback, vl::EdgeUpdateCallback, vl::MorphingCallback, and vlVolume::SlicedVolume.

virtual void vl::ActorEventCallback::onActorDelete ( Actor actor ) [pure virtual]

Event notifying that an Actor is being deleted.

Implemented in vl::DepthSortCallback, vl::EdgeUpdateCallback, vl::MorphingCallback, and vlVolume::SlicedVolume.

void vl::ActorEventCallback::setEnabled ( bool  enabled ) [inline]
bool vl::ActorEventCallback::isEnabled (  ) const [inline]

Member Data Documentation


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

Visualization Library v2010.11.1125 Reference Documentation
Copyright 2005-2009 Michele Bosi. All rights reserved.
Updated on Fri Nov 26 2010 03:13:29.
Permission is granted to use this page to write and publish articles regarding Visualization Library.