Om  1.0.0
A universal framework for multimedia simulation
Public Member Functions | Static Public Attributes | List of all members
om::graphics::scenes::GraphicsScene Class Reference

A class that contains all of the information necessary to draw a complete graphics scene. More...

#include <omGraphicsScene.h>

Inheritance diagram for om::graphics::scenes::GraphicsScene:
om::graphics::base::Renderable om::graphics::devices::GraphicsContextObject

Public Member Functions

 GraphicsScene ()
 Create a new empty graphics scene with the default initial state. More...
 
 GraphicsScene (const GraphicsScene &other)
 Create a copy of another scene with the same contents. More...
 
virtual ~GraphicsScene ()
 Destroy this scene, releasing all resources. More...
 
GraphicsSceneoperator= (const GraphicsScene &other)
 Assign the contents of another scene to this one. More...
 
virtual void update (const Time &dt)
 Update the scene from its previous state using the specified time step. More...
 
Size getObjectCount () const
 Return the number of objects that there are in this graphics scene. More...
 
GraphicsObjectgetObject (Index objectIndex) const
 Return a pointer to the object at the specified index in this scene. More...
 
Bool setObject (Index objectIndex, GraphicsObject *newObject)
 Set a pointer to the object at the specified index in this scene. More...
 
Bool addObject (GraphicsObject *object)
 Add a new object to this scene. More...
 
void addObjects (const GraphicsScene &other)
 Add all of the objects from another scene to this one. More...
 
Bool removeObject (Index objectIndex)
 Remove the object at the specified index from this scene. More...
 
Bool removeObject (const GraphicsObject *object)
 Remove the specified object from this scene. More...
 
void clearObjects ()
 Remove all objects from this scene. More...
 
Size getShapeCount () const
 Return the number of shapes that are part of this scene. More...
 
GraphicsShapegetShape (Index shapeIndex) const
 Return a pointer to the shape at the specified index in this scene. More...
 
Bool setShape (Index shapeIndex, GraphicsShape *newShape)
 Set a pointer to the shape at the specified index in this scene. More...
 
Bool addShape (GraphicsShape *shape)
 Add a new shape to this scene. More...
 
void addShapes (const GraphicsScene &other)
 Add all of the shapes from another scene to this one. More...
 
Bool removeShape (Index shapeIndex)
 Remove the shape at the specified index from this scene. More...
 
Bool removeShape (const GraphicsShape *shape)
 Remove the specified shape from this scene. More...
 
void clearShapes ()
 Remove all shapes from this scene. More...
 
Size getCameraCount () const
 Return the number of cameras that are part of this scene. More...
 
CameragetCamera (Index cameraIndex) const
 Return a pointer to the camera in this scene at the specified index. More...
 
Bool setCamera (Index cameraIndex, Camera *newCamera)
 Set a pointer to the camera at the specified index in this scene. More...
 
Bool addCamera (Camera *camera)
 Add a new camera to this scene. More...
 
void addCameras (const GraphicsScene &other)
 Add all of the cameras from another scene to this one. More...
 
Bool removeCamera (Index cameraIndex)
 Remove the specified camera from this scene. More...
 
Bool removeCamera (const Camera *camera)
 Remove the specified camera from this scene. More...
 
void clearCameras ()
 Remove all cameras from this scene. More...
 
void addAll (const GraphicsScene &other)
 Add all of the objects, shapes, cameras, etc. from another scene to this one. More...
 
void setContext (devices::GraphicsContext *context)
 Prepare this scene and its objects for rendering with the specified context. More...
 
virtual void upload (UploadRequest &request)
 Upload this scene's current CPU representation to the GPU device. More...
 
virtual void download (DownloadRequest &request)
 Download the scene's GPU representation to CPU memory. More...
 
virtual void getRenderables (const shapes::RenderRequest &request, const Transform3 &worldTransform, shapes::RenderQueue &outputQueue) const
 Process the renderable and add all child renderable objects to the output render queue. More...
 
virtual void intersectRay (GraphicsRay &ray) const
 Trace a ray through this scene and compute the closest intersection. More...
 
virtual void testRay (GraphicsRay &ray) const
 Trace a ray through this scene and determine if any intersection exist along the ray. More...
 
- Public Member Functions inherited from om::graphics::base::Renderable
 Renderable ()
 Create a new renderable object with the default renderable flags. More...
 
 Renderable (const RenderableFlags &newFlags)
 Create a new renderable object with the specified renderable flags. More...
 
RenderableFlagsgetFlags ()
 Return a reference to an object that contains boolean parameters of the renderable. More...
 
const RenderableFlagsgetFlags () const
 Return an object that contains boolean parameters of the renderable. More...
 
void setFlags (const RenderableFlags &newFlags)
 Set an object that contains boolean parameters of the renderable. More...
 
Bool flagIsSet (RenderableFlags::Flag flag) const
 Return whether or not the specified boolan flag is set for this renderable. More...
 
Bool flagsAreSet (const RenderableFlags &otherFlags) const
 Return whether or not all of the specified boolan flags are set for this renderable. More...
 
void setFlag (RenderableFlags::Flag flag, Bool newIsSet=true)
 Set whether or not the specified boolan flag is set for this renderable. More...
 
Bool getIsVisible () const
 Get whether or not the renderable and its children are visible in the scene. More...
 
void setIsVisible (Bool newIsVisible)
 Set whether or not the renderable and its children are visible in the scene. More...
 
Bool getShadowsEnabled () const
 Return whether or not this renderable can cast shadows. More...
 
void setShadowsEnabled (Bool newCanCastShadows)
 Set whether or not this renderable can cast shadows. More...
 
- Public Member Functions inherited from om::graphics::devices::GraphicsContextObject
virtual ~GraphicsContextObject ()
 Destory this graphics context object. More...
 
GraphicsContextgetContext () const
 Return a pointer to the graphics context this context object is using to do rendering. More...
 
void clearContext ()
 Clear the previous context from this object. More...
 
void upload ()
 Upload this resource's CPU representation to the GPU device. More...
 
void download ()
 Upload this resource's CPU representation to the GPU device. More...
 
virtual Bool isUploaded () const
 Return whether or not this graphics resource has been successfully created and uploaded to the device. More...
 
virtual Bool isDownloaded () const
 Return whether or not this graphics resource has a copy of its data stored in CPU-side memory. More...
 
virtual Bool isValid () const
 Return whether or not the state of this graphics resource is valid (either on CPU or GPU) and able to be used for rendering. More...
 

Static Public Attributes

static const ResourceType RESOURCE_TYPE
 The resource type for a graphics scene. More...
 

Additional Inherited Members

- Protected Member Functions inherited from om::graphics::devices::GraphicsContextObject
 GraphicsContextObject ()
 Create a new graphics context object that doesn't have an associated graphics context. More...
 
 GraphicsContextObject (GraphicsContext *newContext)
 Create a new graphics context object that uses the specified context for rendering. More...
 
- Protected Attributes inherited from om::graphics::base::Renderable
RenderableFlags flags
 An object containing boolean configuration flags for this renderable. More...
 
- Protected Attributes inherited from om::graphics::devices::GraphicsContextObject
GraphicsContextcontext
 A pointer to the graphics context this object is using. More...
 

Detailed Description

A class that contains all of the information necessary to draw a complete graphics scene.

Constructor & Destructor Documentation

om::graphics::scenes::GraphicsScene::GraphicsScene ( )

Create a new empty graphics scene with the default initial state.

om::graphics::scenes::GraphicsScene::GraphicsScene ( const GraphicsScene other)

Create a copy of another scene with the same contents.

virtual om::graphics::scenes::GraphicsScene::~GraphicsScene ( )
virtual

Destroy this scene, releasing all resources.

Member Function Documentation

GraphicsScene& om::graphics::scenes::GraphicsScene::operator= ( const GraphicsScene other)

Assign the contents of another scene to this one.

virtual void om::graphics::scenes::GraphicsScene::update ( const Time dt)
virtual

Update the scene from its previous state using the specified time step.

This allows the scene to update bounding volumes, animations, etc. with their current states.

Size om::graphics::scenes::GraphicsScene::getObjectCount ( ) const
inline

Return the number of objects that there are in this graphics scene.

GraphicsObject* om::graphics::scenes::GraphicsScene::getObject ( Index  objectIndex) const
inline

Return a pointer to the object at the specified index in this scene.

Bool om::graphics::scenes::GraphicsScene::setObject ( Index  objectIndex,
GraphicsObject newObject 
)
inline

Set a pointer to the object at the specified index in this scene.

Bool om::graphics::scenes::GraphicsScene::addObject ( GraphicsObject object)

Add a new object to this scene.

The method returns whether or not the operation was successful. The method fails if the specified object pointer is NULL.

void om::graphics::scenes::GraphicsScene::addObjects ( const GraphicsScene other)

Add all of the objects from another scene to this one.

Bool om::graphics::scenes::GraphicsScene::removeObject ( Index  objectIndex)

Remove the object at the specified index from this scene.

The method returns whether or not the operation was successful. The method fails if the specified index is out of bounds.

Bool om::graphics::scenes::GraphicsScene::removeObject ( const GraphicsObject object)

Remove the specified object from this scene.

The method returns whether or not the object was found and successfully removed.

void om::graphics::scenes::GraphicsScene::clearObjects ( )

Remove all objects from this scene.

Size om::graphics::scenes::GraphicsScene::getShapeCount ( ) const
inline

Return the number of shapes that are part of this scene.

GraphicsShape* om::graphics::scenes::GraphicsScene::getShape ( Index  shapeIndex) const
inline

Return a pointer to the shape at the specified index in this scene.

Bool om::graphics::scenes::GraphicsScene::setShape ( Index  shapeIndex,
GraphicsShape newShape 
)
inline

Set a pointer to the shape at the specified index in this scene.

Bool om::graphics::scenes::GraphicsScene::addShape ( GraphicsShape shape)

Add a new shape to this scene.

The method returns whether or not the operation was successful. The method fails if the specified shape pointer is NULL.

void om::graphics::scenes::GraphicsScene::addShapes ( const GraphicsScene other)

Add all of the shapes from another scene to this one.

Bool om::graphics::scenes::GraphicsScene::removeShape ( Index  shapeIndex)

Remove the shape at the specified index from this scene.

The method returns whether or not the operation was successful. The method fails if the specified index is out of bounds.

Bool om::graphics::scenes::GraphicsScene::removeShape ( const GraphicsShape shape)

Remove the specified shape from this scene.

The method returns whether or not the shape was found and successfully removed.

void om::graphics::scenes::GraphicsScene::clearShapes ( )

Remove all shapes from this scene.

Size om::graphics::scenes::GraphicsScene::getCameraCount ( ) const
inline

Return the number of cameras that are part of this scene.

Camera* om::graphics::scenes::GraphicsScene::getCamera ( Index  cameraIndex) const
inline

Return a pointer to the camera in this scene at the specified index.

Bool om::graphics::scenes::GraphicsScene::setCamera ( Index  cameraIndex,
Camera newCamera 
)
inline

Set a pointer to the camera at the specified index in this scene.

Bool om::graphics::scenes::GraphicsScene::addCamera ( Camera camera)

Add a new camera to this scene.

The method returns whether or not the camera was successfully added. The method can fail if the specified camera pointer is NULL.

void om::graphics::scenes::GraphicsScene::addCameras ( const GraphicsScene other)

Add all of the cameras from another scene to this one.

Bool om::graphics::scenes::GraphicsScene::removeCamera ( Index  cameraIndex)

Remove the specified camera from this scene.

The method returns whether or not the camera was found and successfully removed.

Bool om::graphics::scenes::GraphicsScene::removeCamera ( const Camera camera)

Remove the specified camera from this scene.

The method returns whether or not the camera was found and successfully removed.

void om::graphics::scenes::GraphicsScene::clearCameras ( )

Remove all cameras from this scene.

void om::graphics::scenes::GraphicsScene::addAll ( const GraphicsScene other)

Add all of the objects, shapes, cameras, etc. from another scene to this one.

void om::graphics::scenes::GraphicsScene::setContext ( devices::GraphicsContext context)
virtual

Prepare this scene and its objects for rendering with the specified context.

The method propagates the context to the scene's objects and shapes and regenerates any context-specific data for the new context if the upload flag is TRUE. The method returns whether or not the context can be successfully used for rendering this scene.

Reimplemented from om::graphics::devices::GraphicsContextObject.

virtual void om::graphics::scenes::GraphicsScene::upload ( UploadRequest request)
virtual

Upload this scene's current CPU representation to the GPU device.

Reimplemented from om::graphics::devices::GraphicsContextObject.

virtual void om::graphics::scenes::GraphicsScene::download ( DownloadRequest request)
virtual

Download the scene's GPU representation to CPU memory.

Reimplemented from om::graphics::devices::GraphicsContextObject.

virtual void om::graphics::scenes::GraphicsScene::getRenderables ( const shapes::RenderRequest request,
const Transform3 worldTransform,
shapes::RenderQueue outputQueue 
) const
virtual

Process the renderable and add all child renderable objects to the output render queue.

Implements om::graphics::base::Renderable.

virtual void om::graphics::scenes::GraphicsScene::intersectRay ( GraphicsRay ray) const
virtual

Trace a ray through this scene and compute the closest intersection.

virtual void om::graphics::scenes::GraphicsScene::testRay ( GraphicsRay ray) const
virtual

Trace a ray through this scene and determine if any intersection exist along the ray.

Member Data Documentation

const ResourceType om::graphics::scenes::GraphicsScene::RESOURCE_TYPE
static

The resource type for a graphics scene.


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