ork::SceneManager Class Reference
[scenegraph]

A manager to manage a scene graph. More...

#include <SceneManager.h>

Inheritance diagram for ork::SceneManager:
ork::Object

List of all members.

Public Types

enum  visibility {
  FULLY_VISIBLE,
  PARTIALLY_VISIBLE,
  INVISIBLE
}
 

The visibility of a bounding box in a frustum.

More...
typedef MultiMapIterator
< string, ptr< SceneNode > > 
NodeIterator
 An iterator over a map of SceneNode.

Public Member Functions

 SceneManager ()
 Creates an empty SceneManager.
virtual ~SceneManager ()
 Deletes this SceneManager.
ptr< SceneNodegetRoot ()
 Returns the root node of the scene graph managed by this manager.
void setRoot (ptr< SceneNode > root)
 Sets the root node of the scene graph managed by this manager.
ptr< SceneNodegetCameraNode ()
 Returns the camera node of the scene graph managed by this manager.
void setCameraNode (const string &node)
 Sets the camera node of the scene graph managed by this manager.
string getCameraMethod ()
 Returns the name of the camera node method to be called to draw the scene.
void setCameraMethod (const string &method)
 Sets the name of the camera node method to be called to draw the scene.
NodeIterator getNodes (const string &flag)
 Returns the nodes of the scene graph that have the given flag.
ptr< SceneNodegetNodeVar (const string &name)
 Returns the SceneNode currently bound to the given loop variable.
void setNodeVar (const string &name, ptr< SceneNode > node)
 Sets the node currently bound to the given loop variable.
ptr< ResourceManagergetResourceManager ()
 Returns the ResourceManager used to manage the resources of the scene graph.
void setResourceManager (ptr< ResourceManager > resourceManager)
 Sets the ResourceManager used to manage the resources of the scene graph.
ptr< SchedulergetScheduler ()
 Returns the Scheduler used to schedule the Task to draw the scene.
void setScheduler (ptr< Scheduler > scheduler)
 Sets the Scheduler to schedule the Task to draw the scene.
mat4d getCameraToScreen ()
 Returns the transformation from camera space to screen space.
void setCameraToScreen (const mat4d &cameraToScreen)
 Sets the transformation from camera space to screen space.
mat4d getWorldToScreen ()
 Returns the transformation from world space to screen space.
bool isVisible (const vec3d &worldPoint)
 Returns true if the given point is visible from the camera node.
visibility getVisibility (const box3d &worldBounds)
 Returns the visibility of the given bounding box from the camera node.
void update (double t, double dt)
 Updates all the transformation matrices in the scene graph.
void draw ()
 Executes the getCameraMethod of the getCameraNode node.
unsigned int getFrameNumber ()
 Returns the current frame number.
double getTime ()
 Returns the time of the current frame in micro-seconds.
double getElapsedTime ()
 Returns the elapsed time of between the two previous frames.

Static Public Member Functions

static visibility getVisibility (const vec4d frustumPlanes[6], const box3d &b)
 Returns the visibility of the given bounding box in the given frustum.
static void getFrustumPlanes (const mat4d &toScreen, vec4d frustumPlanes[6])
 Returns the frustum plane equations from a projection matrix.
static ptr< FrameBuffergetCurrentFrameBuffer ()
 Returns the current FrameBuffer.
static void setCurrentFrameBuffer (ptr< FrameBuffer > fb)
 Sets the current FrameBuffer.
static ptr< ProgramgetCurrentProgram ()
 Returns the current Program.
static void setCurrentProgram (ptr< Program > prog)
 Sets the current GLSL Program.

Detailed Description

A manager to manage a scene graph.


Member Typedef Documentation

An iterator over a map of SceneNode.


Member Enumeration Documentation

The visibility of a bounding box in a frustum.

Enumerator:
FULLY_VISIBLE 

The bounding box is fully visible.

PARTIALLY_VISIBLE 

The bounding box is partially visible.

INVISIBLE 

The bounding box is invisible.


Constructor & Destructor Documentation

ork::SceneManager::SceneManager (  ) 

Creates an empty SceneManager.

virtual ork::SceneManager::~SceneManager (  )  [virtual]

Deletes this SceneManager.


Member Function Documentation

void ork::SceneManager::draw (  ) 

Executes the getCameraMethod of the getCameraNode node.

string ork::SceneManager::getCameraMethod (  ) 

Returns the name of the camera node method to be called to draw the scene.

ptr<SceneNode> ork::SceneManager::getCameraNode (  ) 

Returns the camera node of the scene graph managed by this manager.

mat4d ork::SceneManager::getCameraToScreen (  ) 

Returns the transformation from camera space to screen space.

static ptr<FrameBuffer> ork::SceneManager::getCurrentFrameBuffer (  )  [static]

Returns the current FrameBuffer.

static ptr<Program> ork::SceneManager::getCurrentProgram (  )  [static]

Returns the current Program.

double ork::SceneManager::getElapsedTime (  ) 

Returns the elapsed time of between the two previous frames.

This time is the one passed as argument to the last call to update.

unsigned int ork::SceneManager::getFrameNumber (  ) 

Returns the current frame number.

This number is incremented after each call to draw.

static void ork::SceneManager::getFrustumPlanes ( const mat4d toScreen,
vec4d  frustumPlanes[6] 
) [static]

Returns the frustum plane equations from a projection matrix.

Parameters:
toScreen a camera to screen projection matrix.
[out] frustumPlanes the frustum plane equations in camera space.
NodeIterator ork::SceneManager::getNodes ( const string &  flag  ) 

Returns the nodes of the scene graph that have the given flag.

Parameters:
flag a SceneNode flag.
ptr<SceneNode> ork::SceneManager::getNodeVar ( const string &  name  ) 

Returns the SceneNode currently bound to the given loop variable.

Parameters:
name a loop variable.
ptr<ResourceManager> ork::SceneManager::getResourceManager (  ) 

Returns the ResourceManager used to manage the resources of the scene graph.

ptr<SceneNode> ork::SceneManager::getRoot (  ) 

Returns the root node of the scene graph managed by this manager.

ptr<Scheduler> ork::SceneManager::getScheduler (  ) 

Returns the Scheduler used to schedule the Task to draw the scene.

double ork::SceneManager::getTime (  ) 

Returns the time of the current frame in micro-seconds.

This time is the one passed as argument to the last call to update.

static visibility ork::SceneManager::getVisibility ( const vec4d  frustumPlanes[6],
const box3d b 
) [static]

Returns the visibility of the given bounding box in the given frustum.

Parameters:
frustumPlanes the frustum plane equations.
b a bounding box, in the same reference frame as the frustum planes.
visibility ork::SceneManager::getVisibility ( const box3d worldBounds  ) 

Returns the visibility of the given bounding box from the camera node.

Parameters:
worldBounds a bounding box in world space.
mat4d ork::SceneManager::getWorldToScreen (  ) 

Returns the transformation from world space to screen space.

bool ork::SceneManager::isVisible ( const vec3d worldPoint  ) 

Returns true if the given point is visible from the camera node.

Parameters:
worldPoint a point in world space.
void ork::SceneManager::setCameraMethod ( const string &  method  ) 

Sets the name of the camera node method to be called to draw the scene.

Parameters:
method a method name.
void ork::SceneManager::setCameraNode ( const string &  node  ) 

Sets the camera node of the scene graph managed by this manager.

This camera node must have a UniformMatrix4f defining the projection from camera space to screen space.

Parameters:
node a SceneNode flag that identifies the camera node.
void ork::SceneManager::setCameraToScreen ( const mat4d cameraToScreen  ) 

Sets the transformation from camera space to screen space.

static void ork::SceneManager::setCurrentFrameBuffer ( ptr< FrameBuffer fb  )  [static]

Sets the current FrameBuffer.

This can then be used in any module to retrieve a target on which the user wants to render to.

static void ork::SceneManager::setCurrentProgram ( ptr< Program prog  )  [static]

Sets the current GLSL Program.

This can then be used in any module to retrieve a given Program for further drawings.

void ork::SceneManager::setNodeVar ( const string &  name,
ptr< SceneNode node 
)

Sets the node currently bound to the given loop variable.

Parameters:
name a loop variable.
node the new node bound to this loop variable.
void ork::SceneManager::setResourceManager ( ptr< ResourceManager resourceManager  ) 

Sets the ResourceManager used to manage the resources of the scene graph.

Parameters:
resourceManager a resource manager.
void ork::SceneManager::setRoot ( ptr< SceneNode root  ) 

Sets the root node of the scene graph managed by this manager.

void ork::SceneManager::setScheduler ( ptr< Scheduler scheduler  ) 

Sets the Scheduler to schedule the Task to draw the scene.

void ork::SceneManager::update ( double  t,
double  dt 
)

Updates all the transformation matrices in the scene graph.

Parameters:
t the current time in micro-seconds.
dt the elapsed time in micro-seconds since the last call to update.

Generated on Mon Oct 18 09:36:11 2010 for ork by  doxygen 1.6.1