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

nvsg::Node Class Reference

Base class for all nodes of the scene graph. More...

#include <Node.h>

Inheritance diagram for nvsg::Node:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual NVSG_API const Nodeclone (void) const =0
 Get a clone of this Node object.
virtual NVSG_API bool isDataShared (void) const
 Determine whether the data of this object is shared.
virtual NVSG_API DataID getDataID (void) const
 Get the DataID of the data of this object.
NVSG_API size_t getNumberOfParents () const
 Returns the number of Group nodes that currently reference this node.
NVSG_API const GroupgetParent (size_t i) const
 Get the i-th parent of this Node.
NVSG_API bool isBoundingSphereValid (void) const
 Ask if the bounding sphere of this Node is valid.
NVSG_API const nvmath::Sphere3fgetBoundingSphere (void) const
 Get the bounding sphere of this Node.
NVSG_API void invalidateBoundingSphere (void) const
 Invalidate the BoundingSphere.
virtual NVSG_API bool containsCgFx (void) const
 Ask if this Node contains any CgFx attributes.
virtual NVSG_API void invalidateCgFxContainment (void)
 Invalidate the CgFx containment cache.
virtual NVSG_API bool containsLight (void) const
 Ask if this Node contains any LightSource.
virtual NVSG_API void invalidateLightContainment (void)
 Invalidate the LightSource containment cache.
virtual NVSG_API bool containsTransparentMaterial (void) const
 Ask if this Node contains any transparent Material attributes.
virtual NVSG_API void invalidateTransparentMaterialContainment (void)
 Invalidate the transparent Material containment cache.
virtual NVSG_API bool containsTransparentTexture (void) const
 Ask if this Node contains any transparent Texture.
virtual NVSG_API void invalidateTransparentTextureContainment (void)
 Invalidate the transparent Texture containment cache.
virtual NVSG_API size_t getNumberOfFrames (void) const
 Get the number of animation frames that are part of this Node.
virtual NVSG_API void invalidateNumberOfFrames (void) const
 Invalidate the number of animation frames cache.
NVSG_API void setAnnotation (const char *anno)
 Set the annotation of this Node.
NVSG_API const char * getAnnotation (void) const
 Get the annotation of this Node.

Protected Member Functions

NVSG_API Node (void)
 Constructor.
NVSG_API Node (const Node &rhs)
 Copy constructor.
virtual NVSG_API ~Node (void)
 Protected destructor to prevent explicit creation on stack.
virtual NVSG_API bool calcBoundingSphere (void) const =0
 Interface for calculating the BoundingSphere of this Node.
NVSG_API bool extendBoundingSphere (const nvmath::Sphere3f &sphere) const
 Extend the bounding sphere of this Node by another sphere.
NVSG_API void transformBoundingSphere (const nvmath::Mat44f &m, float factor=1.0f) const
 Transform the BoundingSphere by a matrix and a factor for the radius.

Friends

class Group

Detailed Description

Base class for all nodes of the scene graph.

The Node is the base of all nodes of the scene graph, like GeoNode, Group, or LightSource.


Constructor & Destructor Documentation

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

Constructor.

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

Copy constructor.

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

Protected destructor to prevent explicit creation on stack.


Member Function Documentation

virtual NVSG_API const Node* nvsg::Node::clone void   )  const [pure virtual]
 

Get a clone of this Node object.

Returns:
A pointer to the new created clone.

Implemented in nvsg::AnimatedTransform, nvsg::DirectedLight, nvsg::GeoNode, nvsg::Group, nvsg::LOD, nvsg::PointLight, nvsg::SpotLight, nvsg::Switch, and nvsg::Transform.

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

Reimplemented in nvsg::AnimatedTransform, nvsg::DirectedLight, nvsg::GeoNode, nvsg::Group, nvsg::LightSource, nvsg::PointLight, nvsg::SpotLight, nvsg::Switch, and nvsg::Transform.

virtual NVSG_API DataID nvsg::Node::getDataID void   )  const [virtual]
 

Get the DataID of the data of this object.

Returns:
DataID of the object's data.

Reimplemented from nvsg::Object.

Reimplemented in nvsg::AnimatedTransform, nvsg::DirectedLight, nvsg::GeoNode, nvsg::Group, nvsg::LightSource, nvsg::PointLight, nvsg::SpotLight, nvsg::Switch, and nvsg::Transform.

size_t nvsg::Node::getNumberOfParents  )  const [inline]
 

Returns the number of Group nodes that currently reference this node.

Returns:
The actual number of Group nodes that have this node as child node.

const Group * nvsg::Node::getParent size_t  i  )  const [inline]
 

Get the i-th parent of this Node.

Note:
The behavior is undefined if called with an invalid index. Use getNumberOfParents to determine the actual number of parents that have this node as child node.
Parameters:
i  zero-based index of parent to get

bool nvsg::Node::isBoundingSphereValid void   )  const [inline]
 

Ask if the bounding sphere of this Node is valid.

If the bounding sphere isn't valid, it is tried to validate it.

Returns:
The valid state of the bounding sphere.

const nvmath::Sphere3f & nvsg::Node::getBoundingSphere void   )  const [inline]
 

Get the bounding sphere of this Node.

The bounding sphere of a Node is a sphere that completely contains the Node and all its children.

Note:
It is assumed that the bounding sphere of this Node is valid.
Returns:
A constant reference to the bounding sphere.

NVSG_API void nvsg::Node::invalidateBoundingSphere void   )  const
 

Invalidate the BoundingSphere.

virtual NVSG_API bool nvsg::Node::containsCgFx void   )  const [virtual]
 

Ask if this Node contains any CgFx attributes.

Returns:
false

Reimplemented in nvsg::GeoNode, and nvsg::Group.

virtual NVSG_API void nvsg::Node::invalidateCgFxContainment void   )  [virtual]
 

Invalidate the CgFx containment cache.

Invalidating the cache is carried to all parents of this Node.

Reimplemented in nvsg::GeoNode, and nvsg::Group.

virtual NVSG_API bool nvsg::Node::containsLight void   )  const [virtual]
 

Ask if this Node contains any LightSource.

Returns:
false

Reimplemented in nvsg::Group, and nvsg::LightSource.

virtual NVSG_API void nvsg::Node::invalidateLightContainment void   )  [virtual]
 

Invalidate the LightSource containment cache.

Invalidating the cache is carried to all parents of this Node.

Reimplemented in nvsg::Group.

virtual NVSG_API bool nvsg::Node::containsTransparentMaterial void   )  const [virtual]
 

Ask if this Node contains any transparent Material attributes.

Returns:
false

Reimplemented in nvsg::GeoNode, and nvsg::Group.

virtual NVSG_API void nvsg::Node::invalidateTransparentMaterialContainment void   )  [virtual]
 

Invalidate the transparent Material containment cache.

Invalidating the cache is carried to all parents of this Node.

Reimplemented in nvsg::GeoNode, and nvsg::Group.

virtual NVSG_API bool nvsg::Node::containsTransparentTexture void   )  const [virtual]
 

Ask if this Node contains any transparent Texture.

Returns:
false

Reimplemented in nvsg::GeoNode, and nvsg::Group.

virtual NVSG_API void nvsg::Node::invalidateTransparentTextureContainment void   )  [virtual]
 

Invalidate the transparent Texture containment cache.

Invalidating the cache is carried to all parents of this Node.

Reimplemented in nvsg::GeoNode, and nvsg::Group.

virtual NVSG_API size_t nvsg::Node::getNumberOfFrames void   )  const [virtual]
 

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

Returns:
0

Reimplemented in nvsg::AnimatedTransform, nvsg::GeoNode, nvsg::Group, and nvsg::LightSource.

virtual NVSG_API void nvsg::Node::invalidateNumberOfFrames void   )  const [virtual]
 

Invalidate the number of animation frames cache.

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

Reimplemented in nvsg::GeoNode, and nvsg::Group.

NVSG_API void nvsg::Node::setAnnotation const char *  anno  ) 
 

Set the annotation of this Node.

const char * nvsg::Node::getAnnotation void   )  const [inline]
 

Get the annotation of this Node.

virtual NVSG_API bool nvsg::Node::calcBoundingSphere void   )  const [protected, pure virtual]
 

Interface for calculating the BoundingSphere of this Node.

Implemented in nvsg::GeoNode, nvsg::Group, nvsg::LightSource, nvsg::Switch, and nvsg::Transform.

bool nvsg::Node::extendBoundingSphere const nvmath::Sphere3f sphere  )  const [inline, protected]
 

Extend the bounding sphere of this Node by another sphere.

When a Node contains a number of children or geometries, it can calculate the bounding sphere of all its constituents and extend its bounding sphere by them.

Parameters:
sphere  bounding sphere to extend with

void nvsg::Node::transformBoundingSphere const nvmath::Mat44f m,
float  factor = 1.0f
const [inline, protected]
 

Transform the BoundingSphere by a matrix and a factor for the radius.

Parameters:
m  matrix to transform with
factor  factor for radius


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