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

nvsg::Group Class Reference

Group node. More...

#include <Group.h>

Inheritance diagram for nvsg::Group:

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

Collaboration graph
[legend]
List of all members.

Public Methods

virtual NVSG_API const Group * clone (void) const
 Get a clone of this Group object. 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...

NVSG_API size_t getNumberOfChildren (void) const
 Returns the number of children in this group. More...

NVSG_API size_t addChild (const Node *pChild, size_t position=0xFFFFFFFF)
 Add a child to this group. More...

NVSG_API const NodegetChild (size_t index) const
 Returns a pointer to the const child Node at position index. More...

NVSG_API bool removeChild (const Node *pChild)
 Remove a child from this group. More...

NVSG_API bool removeChild (size_t position)
 Remove the child at given position. More...

NVSG_API bool replaceChild (const Node *newChild, const Node *oldChild)
 Replace a child of this Group by an other. More...

NVSG_API bool replaceChild (const Node *newChild, size_t position)
 Replace a child of this Group by an other. More...

NVSG_API bool hasChild (const Node *node) const
 Check if node is a child of this group. More...

NVSG_API bool getIndex (const Node *node, size_t &index) const
virtual NVSG_API bool containsCgFx (void) const
 Ask if this Group contains any CgFx attributes. More...

virtual NVSG_API void invalidateCgFxContainment (void)
 Invalidate the CgFx containment cache. More...

virtual NVSG_API bool containsLight (void) const
 Ask if this Group contains any LightSource. More...

virtual NVSG_API void invalidateLightContainment (void)
 Invalidate the LightSource containment cache. More...

virtual NVSG_API bool containsTransparentMaterial (void) const
 Ask if this Group contains any transparent Material attributes. More...

virtual NVSG_API void invalidateTransparentMaterialContainment (void)
 Invalidate the transparent Material containment cache. More...

virtual NVSG_API bool containsTransparentTexture (void) const
 Ask if this Group contains any transparent Texture. More...

virtual NVSG_API void invalidateTransparentTextureContainment (void)
 Invalidate the transparent Texture containment cache. More...

virtual NVSG_API size_t getNumberOfFrames (void) const
 Get the number of animation frames that are part of this Node. More...

virtual NVSG_API void invalidateNumberOfFrames (void) const
 Invalidate the number of animation frames cache. More...


Static Public Methods

NVSG_API const Group * create (void)
 Create a Group. More...

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


Protected Methods

NVSG_API Group (void)
 Protected constructor. More...

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

NVSG_API Group (const Group &rhs)
 Protected copy constructor. More...

virtual NVSG_API ~Group (void)
 Protected destructor to prevent explicit creation on stack. More...

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

void invalidateCaches (const Node *pChild, bool insert)
 Invalidate all caches of this Group, possibly depending on the added or removed Node. More...


Detailed Description

Group node.

A Group is a base class for grouping nodes that contain children, such as Transform or Switch - in other words, nodes that are defined relative to this node.


Constructor & Destructor Documentation

NVSG_API nvsg::Group::Group void    [protected]
 

Protected constructor.

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

Partial Constructor.

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

Protected copy constructor.

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

Protected destructor to prevent explicit creation on stack.


Member Function Documentation

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

Create a Group.

Returns:
a constant pointer to a Group.

Reimplemented in nvsg::LOD, nvsg::Switch, and nvsg::Transform.

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

Create a Group by copying from a Node.

Returns:
a constant pointer to a Group.
Parameters:
rhs  Node to copy from

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

Get a clone of this Group object.

Returns:
A constant pointer to the new created clone.

Implements nvsg::Node.

Reimplemented in nvsg::AnimatedTransform, nvsg::LOD, nvsg::Switch, and nvsg::Transform.

virtual NVSG_API bool nvsg::Group::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::Node.

Reimplemented in nvsg::AnimatedTransform, nvsg::Switch, and nvsg::Transform.

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

Get the DataID of the data of this object.

Returns:
DataID of the object's data.

Reimplemented from nvsg::Node.

Reimplemented in nvsg::AnimatedTransform, nvsg::Switch, and nvsg::Transform.

size_t nvsg::Group::getNumberOfChildren void    const [inline]
 

Returns the number of children in this group.

Returns:
The number of children in this group.

NVSG_API size_t nvsg::Group::addChild const Node   pChild,
size_t    position = 0xFFFFFFFF
 

Add a child to this group.

Adds the node pChild at position position. If position is larger than the group size, the child is added to the end. By default, the child is added to the end.

Returns:
The actual position of added child
Note:
The reference count of the new child will be incremented, while the reference count of the former child will be decremented.
Parameters:
pChild  child to add to this group
position  position to put pChild in the list

const Node * nvsg::Group::getChild size_t    index const [inline]
 

Returns a pointer to the const child Node at position index.

Returns:
A pointer to the const Node at position index.
Note:
the behaviour is undefined if called with an invalid index.
Parameters:
index  Zero-based index to get child at.

NVSG_API bool nvsg::Group::removeChild const Node   pChild
 

Remove a child from this group.

Returns:
true if the child pChild was removed, otherwise false
Note:
The reference count of the removed child will be decremented.
Parameters:
pChild  child node to remove from this group

NVSG_API bool nvsg::Group::removeChild size_t    position
 

Remove the child at given position.

If the position is not valid in this group, nothing is removed.

Returns:
true on successful removal, otherwise false
Note:
The reference count of the removed child will be decremented.
Parameters:
position  position of child to remove from this group

NVSG_API bool nvsg::Group::replaceChild const Node   newChild,
const Node   oldChild
 

Replace a child of this Group by an other.

Replaces the oldChild by the newChild, keeping the position in the Group constant. If oldChild is not a child of this Group, nothing is changed and false is returned.

Returns:
true on successful replacement, otherwise false
Parameters:
newChild  new child
oldChild  child to be replaced

NVSG_API bool nvsg::Group::replaceChild const Node   newChild,
size_t    position
 

Replace a child of this Group by an other.

Replaces the child at index by newChild. If the index is not valid, nothing is changed and false is returned.

Returns:
true on successful replacement, otherwise false
Parameters:
newChild  new child
position  position of child to be replaced

NVSG_API bool nvsg::Group::hasChild const Node   node const
 

Check if node is a child of this group.

Returns:
true - The node is in this group; false - The node is not in this group.
Parameters:
node  Node pointer.

NVSG_API bool nvsg::Group::getIndex const Node   node,
size_t &    index
const
 

Returns:
true - The node is a child of this group; false - The node is not a child of this group.
The result of index is not defined when the return value is false.
Note:
This method only retrieves the first appearance of the node in this group!
Parameters:
node  Node pointer.
index  Resulting index.

virtual NVSG_API bool nvsg::Group::containsCgFx void    const [virtual]
 

Ask if this Group contains any CgFx attributes.

Returns:
true if the Group contains a child with a CgFx attribute, otherwise false.

Reimplemented from nvsg::Node.

virtual NVSG_API void nvsg::Group::invalidateCgFxContainment void    [virtual]
 

Invalidate the CgFx containment cache.

The cache is invalidated and the invalidation of a Node is called.

Reimplemented from nvsg::Node.

virtual NVSG_API bool nvsg::Group::containsLight void    const [virtual]
 

Ask if this Group contains any LightSource.

Returns:
true if the Group contains a LightSource as a child, otherwise false.

Reimplemented from nvsg::Node.

virtual NVSG_API void nvsg::Group::invalidateLightContainment void    [virtual]
 

Invalidate the LightSource containment cache.

The cache is invalidated and the invalidation of a Node is called.

Reimplemented from nvsg::Node.

virtual NVSG_API bool nvsg::Group::containsTransparentMaterial void    const [virtual]
 

Ask if this Group contains any transparent Material attributes.

Returns:
true if the Group contains a child with a transparent Material attribute, otherwise false.

Reimplemented from nvsg::Node.

virtual NVSG_API void nvsg::Group::invalidateTransparentMaterialContainment void    [virtual]
 

Invalidate the transparent Material containment cache.

The cache is invalidated and the invalidation of a Node is called.

Reimplemented from nvsg::Node.

virtual NVSG_API bool nvsg::Group::containsTransparentTexture void    const [virtual]
 

Ask if this Group contains any transparent Texture.

Returns:
true if the Group contains a child with a transparent Texture, otherwise false.

Reimplemented from nvsg::Node.

virtual NVSG_API void nvsg::Group::invalidateTransparentTextureContainment void    [virtual]
 

Invalidate the transparent Texture containment cache.

The cache is invalidated and the invalidation of a Node is called.

Reimplemented from nvsg::Node.

virtual NVSG_API size_t nvsg::Group::getNumberOfFrames void    const [virtual]
 

Get the number of animation frames that are part of this Node.

Returns:
The number of animation frames of at least one child.

Reimplemented from nvsg::Node.

Reimplemented in nvsg::AnimatedTransform.

virtual NVSG_API void nvsg::Group::invalidateNumberOfFrames void    const [virtual]
 

Invalidate the number of animation frames cache.

The cache is invalidated and the invalidation of a Node is called.

Reimplemented from nvsg::Node.

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

Calculate the bounding sphere of this group.

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.

Implements nvsg::Node.

Reimplemented in nvsg::Switch, and nvsg::Transform.

void nvsg::Group::invalidateCaches const Node   pChild,
bool    insert
[inline, protected]
 

Invalidate all caches of this Group, possibly depending on the added or removed Node.

Invalidates the bounding sphere of this Group. If the CgFx containment or the LightSource containment changes by adding/removing pChild, the corresponding caches are invalidated.

Parameters:
pChild  Node that has been added or removed
insert  true, if the Node has been added, otherwise false


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