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

nvsg::GeoNode Class Reference

Node to hold a set of geometry. More...

#include <GeoNode.h>

Inheritance diagram for nvsg::GeoNode:

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

Collaboration graph
[legend]
List of all members.

Public Methods

virtual NVSG_API GeoNode * clone (void) const
 Create a new GeoNode by copying from this. More...

NVSG_API bool addGeometry (const Drawable *pDrawable, const StateSet *pStateSet)
 Add a Geometry to the GeoNode. More...

NVSG_API size_t getNumberOfGeometries (void) const
 Get the number of Geometries of this GeoNode. More...

NVSG_API const DrawablegetDrawable (size_t index) const
 Returns the Drawable at position index. More...

NVSG_API size_t getDrawables (std::vector< const Drawable * > &v, const StateSet *pStateSet=NULL) const
 Get the Drawables that use a given StateSet. More...

NVSG_API size_t getNumberOfDrawables (void) const
 Get the number of Drawables in this GeoNode. More...

NVSG_API void replaceDrawable (const Drawable *newDrawable, const Drawable *oldDrawable)
 Replace all occurrences of a specified Drawable. More...

NVSG_API const StateSetgetStateSet (size_t index) const
 Returns the StateSet at position index. More...

NVSG_API const StateSetgetStateSet (const Drawable *pDrawable) const
 Returns the StateSet of a specified Drawable. More...

NVSG_API size_t getStateSets (std::vector< const StateSet * > &v) const
 Get all StateSets used. More...

NVSG_API size_t getNumberOfStateSets (void) const
 Get the number of (different) StateSets in this GeoNode. More...

NVSG_API void replaceStateSet (const StateSet *newStateSet, const StateSet *oldStateSet)
 Replace all occurrences of a specified StateSet. More...

NVSG_API void replaceStateSet (const StateSet *newStateSet, const Drawable *drawable)
 Replace the StateSet for a specified Drawable. More...

NVSG_API bool removeGeometry (const Drawable *pDrawable, const StateSet *pStateSet=NULL)
 Remove one Geometry from this GeoNode. More...

NVSG_API void removeGeometry (size_t index)
 Remove the Geometry at position index. More...

NVSG_API bool removeGeometries (const StateSet *pStateSet=NULL)
 Remove the Geometries with a given StateSet. More...

NVSG_API void generateTexCoords (TextureCoordType tct, size_t tu=0)
 Generate texture coordinates on all geometries. More...

NVSG_API void calculateTangentSpace (size_t tu=0, size_t tg=1, size_t bn=2)
 Generate tangents and binormals for all geometries. More...

virtual NVSG_API bool containsCgFx (void) const
 Ask if this GeoNode contains any CgFx attributes. More...

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

virtual NVSG_API bool containsTransparentMaterial (void) const
 Ask if this GeoNode 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 GeoNode contains any transparent Texture. More...

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

virtual NVSG_API void invalidateNumberOfFrames (void) const
 Invalidate the number of animation frames 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 DataID getDataID (void) const
 Get the DataID of the data of this object. More...

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


Static Public Methods

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

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


Protected Methods

NVSG_API GeoNode (void)
 Default Constructor. More...

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

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

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

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

NVSG_API void invalidateCaches (const StateSet *pStateSet, bool insert)
 Invalidate all caches of this GeoNode, maybe depending on the added or removed StateSet. More...


Detailed Description

Node to hold a set of geometry.

A GeoNode holds a number of geometries. A Geometry consists of a Drawable - defining the topology, and a StateSet - defining the visual appearance.


Constructor & Destructor Documentation

NVSG_API nvsg::GeoNode::GeoNode void    [protected]
 

Default Constructor.

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

Partial Constructor.

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

Copy Constructor.

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

Protected destructor to prevent explicit creation on stack.


Member Function Documentation

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

Create a GeoNode.

Returns:
a constant pointer to a GeoNode.

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

Create a GeoNode by copying from a Node.

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

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

Create a new GeoNode by copying from this.

Returns:
a constant pointer to an identical GeoNode.

Implements nvsg::Node.

NVSG_API bool nvsg::GeoNode::addGeometry const Drawable   pDrawable,
const StateSet   pStateSet
 

Add a Geometry to the GeoNode.

If the GeoNode already holds a geometry with the same Drawable, no geometry is added. Otherwise the pair of pDrawable and pStateSet is added to the set of geometries.

Returns:
true, if the pair is added, otherwise false
Parameters:
pDrawable  Drawable to add
pStateSet  StateSet to add

size_t nvsg::GeoNode::getNumberOfGeometries void    const [inline]
 

Get the number of Geometries of this GeoNode.

Note:
The number of Drawables is equal to the number of Geometries. /**
Returns:
number of Geometries

const Drawable * nvsg::GeoNode::getDrawable size_t    index const [inline]
 

Returns the Drawable at position index.

Returns:
A pointer to a constant Drawable at position index.
Note:
The behaviour is undefined if called with an invalid index. You should call getNumberOfDrawables prior to this call to determine a valid range of indices that can be passed to this function.
Parameters:
index  Zero-based index of Drawable to get

NVSG_API size_t nvsg::GeoNode::getDrawables std::vector< const Drawable * > &    v,
const StateSet   pStateSet = NULL
const
 

Get the Drawables that use a given StateSet.

Fills the vector v with the pointers to all const Drawables. If pStateSet is not NULL, only the Drawables that use that StateSet are returned.

Returns:
number of Drawables that are collected into v.
Parameters:
v  Receive requested Drawables here.
pStateSet  If not NULL, only drawables with the specified StateSet will be copied to v.

size_t nvsg::GeoNode::getNumberOfDrawables void    const [inline]
 

Get the number of Drawables in this GeoNode.

Note:
The number of Drawables is equal to the number of Geometries.
Returns:
number of Drawables.

NVSG_API void nvsg::GeoNode::replaceDrawable const Drawable   newDrawable,
const Drawable   oldDrawable
 

Replace all occurrences of a specified Drawable.

The function replaces all occurrences of oldDrawable by newDrawable.

Note:
The behavior is undefined when passing an invalid pointer for newDrawable.
Parameters:
newDrawable  Specifies the new Drawable.
oldDrawable  Specifies the Drawable to be replaced by newDrawable.

const StateSet * nvsg::GeoNode::getStateSet size_t    index const [inline]
 

Returns the StateSet at position index.

Returns:
pointer to const StateSet at position index.
Parameters:
index  Zero-based index of StateSet to get

NVSG_API const StateSet* nvsg::GeoNode::getStateSet const Drawable   pDrawable const
 

Returns the StateSet of a specified Drawable.

Returns:
A pointer to the const StateSet corresponding to the Drawable pDrawable, or NULL, if pDrawable is not part of this GeoNode.
Parameters:
pDrawable  Drawable to get associated StateSet from.

NVSG_API size_t nvsg::GeoNode::getStateSets std::vector< const StateSet * > &    v const
 

Get all StateSets used.

Fills the vector v with the constant pointers to all (different) StateSets.

Returns:
number of (different) StateSets that are collected into v.
Parameters:
v  Receive requested StateSets here

size_t nvsg::GeoNode::getNumberOfStateSets void    const [inline]
 

Get the number of (different) StateSets in this GeoNode.

Returns:
number of (different) StateSets.

NVSG_API void nvsg::GeoNode::replaceStateSet const StateSet   newStateSet,
const StateSet   oldStateSet
 

Replace all occurrences of a specified StateSet.

The function replaces all occurrences of oldStateSet by newStateSet.

Parameters:
newStateSet  Specifies the new StateSet.
oldStateSet  Specifies the StateSet to be replaced by newStateSet.

NVSG_API void nvsg::GeoNode::replaceStateSet const StateSet   newStateSet,
const Drawable   drawable
 

Replace the StateSet for a specified Drawable.

The function replaces the StateSet currently assigned to \s drawable by newStateSet.

Parameters:
newStateSet  Specifies the new StateSet.
drawable  Specifies the Drawable whose current StateSet is to be replaced by newStateSet.

NVSG_API bool nvsg::GeoNode::removeGeometry const Drawable   pDrawable,
const StateSet   pStateSet = NULL
 

Remove one Geometry from this GeoNode.

Removes the Geometry with Drawable pDrawable from the GeoNode. If pStateSet is not NULL, the Geometry is only removed if it corresponds to pDrawable.

Returns:
true, if a Geometry is removed, otherwise false.
Parameters:
pDrawable  Specifies the Drawable of the geometry to be removed.
pStateSet  Conditional StateSet. Remove the geometry only if pDrawable and pStateSet are associated.

NVSG_API void nvsg::GeoNode::removeGeometry size_t    index
 

Remove the Geometry at position index.

Note:
The behaviour is undefined if called with an invalid index.
Parameters:
index  Zero-based index of the geometry to be removed.

NVSG_API bool nvsg::GeoNode::removeGeometries const StateSet   pStateSet = NULL
 

Remove the Geometries with a given StateSet.

If pStateSet is given, all Geometries that use that StateSet are removed. Otherwise all Geometries are removed (i.e. the GeoNode is cleared).

Returns:
true if at least one Geometry was removed, otherwise false.
Parameters:
pStateSet  Conditional StateSet. If not NULL, only geometries associated with pStateSet will be removed from the GeoNode.

NVSG_API void nvsg::GeoNode::generateTexCoords TextureCoordType    tct,
size_t    tu = 0
 

Generate texture coordinates on all geometries.

There are three different methods for texture generation: TCT_CYLINDRICAL, TCT_PLANAR, and TCT_SPHERICAL.

Parameters:
tct  texture coordinate type to create
tu  texture unit to create coords for

NVSG_API void nvsg::GeoNode::calculateTangentSpace size_t    tu = 0,
size_t    tg = 1,
size_t    bn = 2
 

Generate tangents and binormals for all geometries.

To generate tangents and binormals there have to be texture coordinates.

Parameters:
tu  texture unit that holds the texture coordinates to use for generation
tg  texture unit to create tangents in
bn  texture unit to create binormals in

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

Ask if this GeoNode contains any CgFx attributes.

Returns:
true if the GeoNode contains Geometry with a CgFx attribute, otherwise false.

Reimplemented from nvsg::Node.

virtual NVSG_API void nvsg::GeoNode::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::GeoNode::containsTransparentMaterial void    const [virtual]
 

Ask if this GeoNode contains any transparent Material attributes.

Returns:
true if the GeoNode contains Geometry with a transparent Material attribute, otherwise false.

Reimplemented from nvsg::Node.

virtual NVSG_API void nvsg::GeoNode::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::GeoNode::containsTransparentTexture void    const [virtual]
 

Ask if this GeoNode contains any transparent Texture.

Returns:
true if the GeoNode contains Geometry with a transparent Texture, otherwise false.

Reimplemented from nvsg::Node.

virtual NVSG_API void nvsg::GeoNode::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 void nvsg::GeoNode::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 size_t nvsg::GeoNode::getNumberOfFrames void    const [virtual]
 

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

Returns:
0

Reimplemented from nvsg::Node.

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

Get the DataID of the data of this object.

Returns:
DataID of the object's data.

Reimplemented from nvsg::Node.

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

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

Calculate the bounding sphere of this GeoNode.

The bounding sphere of a GeoNode is calculated by combining the bounding spheres of all its geometries.

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

Implements nvsg::Node.

NVSG_API void nvsg::GeoNode::invalidateCaches const StateSet   pStateSet,
bool    insert
[protected]
 

Invalidate all caches of this GeoNode, maybe depending on the added or removed StateSet.

Invalidates the bounding sphere of this GeoNode. If the CgFx containment changes by adding/removing pStateSet, the CgFx cache is invalidated.

Parameters:
pStateSet  StateSet that has been added or removed
insert  Assigns whether pSateSet has been added or removed


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