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

nvsg::Switch Class Reference

Switch node. More...

#include <Switch.h>

Inheritance diagram for nvsg::Switch:

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

Collaboration graph
[legend]
List of all members.

Public Methods

virtual NVSG_API const Switch * clone (void) const
 Get a clone of this Switch object. More...

NVSG_API void setActive (void)
 Set all children to active. More...

NVSG_API void setActive (size_t index)
 Set one child to active. More...

NVSG_API void setInactive (void)
 Set all children to inactive. More...

NVSG_API void setInactive (size_t index)
 Set one child to inactive. More...

NVSG_API size_t getNumberOfActive (void) const
 Get the number of active children. More...

NVSG_API size_t getActive (std::vector< size_t > &indices) const
 Get indices to active child nodes. More...

NVSG_API bool isActive (void) const
 Determine if any of the children is active. More...

NVSG_API bool isActive (size_t index) const
 Determine if the child is active. More...

virtual NVSG_API bool isDataShared (void) const
 Determine whether the data of this object is shared. More...

virtual NVSG_API DataID getDataID (void) const
 Get the DataID of the data of this object. More...


Static Public Methods

NVSG_API const Switch * create (void)
 Create Switch. More...

NVSG_API const Switch * createFromBase (const Group &rhs)
 Create Switch by copying from a Group. More...


Protected Methods

NVSG_API Switch (void)
 Default constructor. More...

NVSG_API Switch (const Group &rhs)
 Partial Constructor. More...

NVSG_API Switch (const Switch &rhs)
 Copy Constructor. More...

virtual NVSG_API ~Switch (void)
 Prohibit explicit creation on stack by making the destructor protected. More...

virtual NVSG_API bool calcBoundingSphere (void) const
 Calculate the bounding sphere of this switch. More...


Detailed Description

Switch node.

A switch node is a special kind of grouping node where one can define which children will be traversed or not (active/inactive children).
See LightSource documentation on how to use a switch for light sources.


Constructor & Destructor Documentation

NVSG_API nvsg::Switch::Switch void    [protected]
 

Default constructor.

NVSG_API nvsg::Switch::Switch const Group   rhs [protected]
 

Partial Constructor.

NVSG_API nvsg::Switch::Switch const Switch &    rhs [protected]
 

Copy Constructor.

virtual NVSG_API nvsg::Switch::~Switch void    [protected, virtual]
 

Prohibit explicit creation on stack by making the destructor protected.


Member Function Documentation

NVSG_API const Switch* nvsg::Switch::create void    [static]
 

Create Switch.

Returns:
a constant pointer to a Switch.

Reimplemented from nvsg::Group.

NVSG_API const Switch* nvsg::Switch::createFromBase const Group   rhs [static]
 

Create Switch by copying from a Group.

Returns:
a constant pointer to a Switch.

virtual NVSG_API const Switch* nvsg::Switch::clone void    const [virtual]
 

Get a clone of this Switch object.

Returns:
a constant pointer to a Switch.

Reimplemented from nvsg::Group.

NVSG_API void nvsg::Switch::setActive void   
 

Set all children to active.

NVSG_API void nvsg::Switch::setActive size_t    index
 

Set one child to active.

Note:
Currently active children will stay active!
Parameters:
index  Index of the child.

NVSG_API void nvsg::Switch::setInactive void   
 

Set all children to inactive.

NVSG_API void nvsg::Switch::setInactive size_t    index
 

Set one child to inactive.

Note:
Currently inactive children will stay inactive!
Parameters:
index  Index of the child.

NVSG_API size_t nvsg::Switch::getNumberOfActive void    const
 

Get the number of active children.

Returns:
The number of active children

NVSG_API size_t nvsg::Switch::getActive std::vector< size_t > &    indices const
 

Get indices to active child nodes.

Copies the indices of all active child nodes to the vector /a indices.

Returns:
The number of indices copied to /a indices.
Note:
The internal format a Switch uses for storing indices is size_t, which expands to 32-bit for 32-bit environments and 64-bit for 64-bit environments.

NVSG_API bool nvsg::Switch::isActive void    const
 

Determine if any of the children is active.

Returns:
true - at least one child is active.
false - no child is active.

NVSG_API bool nvsg::Switch::isActive size_t    index const
 

Determine if the child is active.

Returns:
true - the child is active.
false - the child is active.
Parameters:
index  Index of the child.

virtual NVSG_API bool nvsg::Switch::isDataShared void    const [virtual]
 

Determine whether the data of this object is shared.

Returns:
true if the object's data is shared, otherwise false.

Reimplemented from nvsg::Group.

virtual NVSG_API DataID nvsg::Switch::getDataID void    const [virtual]
 

Get the DataID of the data of this object.

Returns:
DataID of the object's data.

Reimplemented from nvsg::Group.

virtual NVSG_API bool nvsg::Switch::calcBoundingSphere void    const [protected, virtual]
 

Calculate the bounding sphere of this switch.

Calculate the bounding sphere for the active children only. If this group doesn't contain any real geometry ( for example only light sources without a bounding sphere), it doesn't have a valid bounding sphere.

Returns:
true if the calculated bounding sphere is valid, otherwise false.

Reimplemented from nvsg::Group.


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