Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

nvsg::Scene Class Reference

Shrink wrap class to subsume all scene related information. More...

#include <Scene.h>

Inheritance diagram for nvsg::Scene:

Inheritance graph
[legend]
Collaboration diagram for nvsg::Scene:

Collaboration graph
[legend]
List of all members.

Public Member Functions

NVSG_API void setBackColor (const nvmath::Vec3f &color)
 Set the background color.
NVSG_API const nvmath::Vec3fgetBackColor (void) const
 Get the background color.
NVSG_API void addCamera (const Camera *pCamera)
 Add a camera to this scene.
NVSG_API void removeCamera (size_t index)
 Remove a camera from the scene.
NVSG_API const CameragetCamera (size_t index=0) const
 Get a camera of the scene.
NVSG_API size_t getNumberOfCameras (void) const
 Get the number of cameras in the scene.
NVSG_API size_t getNumberOfCameraAnimations (void) const
 Get the number of camera animations in the scene.
NVSG_API void addCameraAnimation (const Animation< nvmath::Trafo > *pAnimation)
 Add a camera animation to this scene.
NVSG_API const Animation<
nvmath::Trafo > * 
getCameraAnimation (size_t index=0) const
 Get a camera animation of the scene.
NVSG_API void removeCameraAnimation (size_t index)
 Remove a camera animation from the scene.
NVSG_API size_t getNumberOfFrames (void) const
 Get the number of animation frames.
NVSG_API void setRootNode (const Node *root)
 Set the root node.
NVSG_API const NodegetRootNode (void) const
 Get the root node of the scene tree.
NVSG_API void setDefaultStateSet (const StateSet *pStateSet)
 Set the default state set.
NVSG_API const StateSetgetDefaultStateSet (void) const
 Get the default state set of the scene.
NVSG_API void setOverrideStateSet (const StateSet *pStateSet)
 Set the override state set.
NVSG_API const StateSetgetOverrideStateSet (void) const
 Get the override state set of the scene.
NVSG_API bool containsCgFx (void) const
 Ask if this Scene contains any CgFx attribute.
NVSG_API bool containsLight (void) const
 Ask if this Scene contains any LightSource.
NVSG_API bool containsTransparentMaterial (void) const
 Ask if this Scene contains any transparent Material attribute.
NVSG_API bool containsTransparentTexture (void) const
 Ask if this Scene contains any transparent Texture.
NVSG_API bool waitToRead (size_t milliseconds=0xFFFFFFFF) const
 Acquire read access in a multithreaded environment.
NVSG_API void doneReading (void) const
 Signal finished reading the object.
NVSG_API bool waitToWrite (size_t milliseconds=0xFFFFFFFF) const
 Acquire write access in a multithreaded enviroment.
NVSG_API void doneWriting (void) const
 Signal when finished writing the object.

Static Public Member Functions

static NVSG_API const Scenecreate (void)
 Create a Scene.

Protected Member Functions

NVSG_API Scene (void)
 Constructor.
virtual NVSG_API ~Scene (void)
 Protected destructor to prevent explicit creation on stack.

Detailed Description

Shrink wrap class to subsume all scene related information.


Constructor & Destructor Documentation

NVSG_API nvsg::Scene::Scene void   )  [protected]
 

Constructor.

virtual NVSG_API nvsg::Scene::~Scene void   )  [protected, virtual]
 

Protected destructor to prevent explicit creation on stack.


Member Function Documentation

static NVSG_API const Scene* nvsg::Scene::create void   )  [static]
 

Create a Scene.

Returns:
a constant pointer to a Scene.

void nvsg::Scene::setBackColor const nvmath::Vec3f color  )  [inline]
 

Set the background color.

Parameters:
color  color to use as background color

const nvmath::Vec3f & nvsg::Scene::getBackColor void   )  const [inline]
 

Get the background color.

void nvsg::Scene::addCamera const Camera pCamera  )  [inline]
 

Add a camera to this scene.

A scene holds a list of cameras from which one can be selected for viewing. The reference count for the camera is incremented.

Parameters:
pCamera  camera to add

void nvsg::Scene::removeCamera size_t  index  )  [inline]
 

Remove a camera from the scene.

Parameters:
index  Index of the camera to remocve

const Camera * nvsg::Scene::getCamera size_t  index = 0  )  const [inline]
 

Get a camera of the scene.

Returns:
A constant pointer to the camera at position index, or NULL if this doesn't exist
Parameters:
index  index of camera to get

size_t nvsg::Scene::getNumberOfCameras void   )  const [inline]
 

Get the number of cameras in the scene.

A scene holds a list of cameras from which one can be selected for viewing.

Returns:
The number of cameras in the scene

size_t nvsg::Scene::getNumberOfCameraAnimations void   )  const [inline]
 

Get the number of camera animations in the scene.

A scene holds a list of camera animations from which one can be selected (independently from the camera) for animated viewing.

Returns:
The number of camera animations in the scene

void nvsg::Scene::addCameraAnimation const Animation< nvmath::Trafo > *  pAnimation  )  [inline]
 

Add a camera animation to this scene.

A scene holds a list of camera animations from which one can be selected (independently from the camera) for animated viewing. The reference count for the animation is incremented.

Parameters:
pAnimation  animation to add

const Animation< nvmath::Trafo > * nvsg::Scene::getCameraAnimation size_t  index = 0  )  const [inline]
 

Get a camera animation of the scene.

Returns:
A constant pointer the animation at position index, or NULL if this doesn't exist
Parameters:
index  index of animation to get

void nvsg::Scene::removeCameraAnimation size_t  index  )  [inline]
 

Remove a camera animation from the scene.

Parameters:
index  Index of the camera animation to remove

size_t nvsg::Scene::getNumberOfFrames void   )  const [inline]
 

Get the number of animation frames.

All animations in a scene must have the same number of steps. This number is queried here.

Returns:
The number of animation frames (of every animation in the scene)

NVSG_API void nvsg::Scene::setRootNode const Node root  ) 
 

Set the root node.

If there already is a root node, it is dereferenced; the reference count of the new root node is incremented.

Parameters:
root  new root node

const Node * nvsg::Scene::getRootNode void   )  const [inline]
 

Get the root node of the scene tree.

Returns:
A constant pointer to the root node of the scene tree, or NULL if there isn't any

NVSG_API void nvsg::Scene::setDefaultStateSet const StateSet pStateSet  ) 
 

Set the default state set.

If a geometry in this scene doesn't have a StateAttribute of a special kind, but there is one in this default StateSet, the default one is used. If there is already a defaul StateSet, it is dereferenced; the reference count of this StateSet is incremented.

Parameters:
pStateSet  StateSet to set as the default one

const StateSet * nvsg::Scene::getDefaultStateSet void   )  const [inline]
 

Get the default state set of the scene.

If a geometry in this scene doesn't have a StateAttribute of a special kind, but there is one in this default StateSet, the default one (if there is one) is used.

NVSG_API void nvsg::Scene::setOverrideStateSet const StateSet pStateSet  ) 
 

Set the override state set.

If there is an override state set in the scene, all geometries are rendered using that state set, ignoring any other state set in the scene.

Parameters:
pStateSet  StateSet to set as the override one

const StateSet * nvsg::Scene::getOverrideStateSet void   )  const [inline]
 

Get the override state set of the scene.

If there is an override state set in the scene, all geometries are rendered using that state set, ignoring any other state set in the scene.

bool nvsg::Scene::containsCgFx void   )  const [inline]
 

Ask if this Scene contains any CgFx attribute.

Returns:
true, if the Scene contains a CgFx attribute in its scene tree, otherwise false.

bool nvsg::Scene::containsLight void   )  const [inline]
 

Ask if this Scene contains any LightSource.

Returns:
true, if the Scene contains a LightSource in its scene tree, otherwise false.

bool nvsg::Scene::containsTransparentMaterial void   )  const [inline]
 

Ask if this Scene contains any transparent Material attribute.

Returns:
true, if the Scene contains a transparent Material attribute in its scene tree, otherwise false.

bool nvsg::Scene::containsTransparentTexture void   )  const [inline]
 

Ask if this Scene contains any transparent Texture.

Returns:
true, if the Scene contains a transparent Texture in its scene tree, otherwise false.

bool nvsg::Scene::waitToRead size_t  milliseconds = 0xFFFFFFFF  )  const [inline]
 

Acquire read access in a multithreaded environment.

For safety in a multithreaded environment, an object maintains a read/write locking mechanism that allows contemporaneous access for multiple readers but write access for only a single writer.

This function returns either when it gets read access or when the time-out interval elapses. By default, this function waits indefinitely.
Returns:
true, if read access could be acquired, false otherwise.

void nvsg::Scene::doneReading void   )  const [inline]
 

Signal finished reading the object.

A read access to this object, that has been acquired by a previous call to waitToRead, will be ended by a call to this function.

bool nvsg::Scene::waitToWrite size_t  milliseconds = 0xFFFFFFFF  )  const [inline]
 

Acquire write access in a multithreaded enviroment.

For safety in a multithreaded environment, an object maintains a read/write locking mechanism that allows contemporaneous access for multiple readers but write access for only a single writer.

This function returns either when it gets write access or when the time-out interval elapses. By default, this function waits indefinitely.
Returns:
true, if write access could be acquired, false otherwise.
Parameters:
milliseconds  Time-out interval, in millisceconds.

void nvsg::Scene::doneWriting void   )  const [inline]
 

Signal when finished writing the object.

A write access to this object that has been acquired by a previous call to waitToWrite will be ended by a call to this function.


The documentation for this class was generated from the following file:
Generated on Tue Mar 1 13:20:54 2005 for NVSGSDK by NVIDIA