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

nvsg::StateSet Class Reference

Class to hold a list of StateAttributes. More...

#include <StateSet.h>

Inheritance diagram for nvsg::StateSet:

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

Collaboration graph
[legend]
List of all members.

Public Methods

virtual NVSG_API const StateSet * clone (void) const
 Create a StateSet by cloning this. 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 void addAttribute (const StateAttribute *attrib)
 Add a StateAttribute to the attribute list. More...

NVSG_API size_t getNumberOfAttributes (void) const
 Get the number of StateAttributes in this StateSet. More...

NVSG_API const StateAttributegetAttribute (size_t index) const
 Returns a pointer to the constant StateAttribute at position index. More...

NVSG_API const StateAttributegetAttributeByObjectCode (unsigned int oc) const
 Get a constant pointer to the StateAttribute with the object code oc. More...

NVSG_API bool removeAttribute (const StateAttribute *attrib)
 Remove a specified StateAttribute. More...

NVSG_API bool removeAttribute (size_t index)
 Remove the StateAttribute at position index. More...

NVSG_API bool removeAttributeByObjectCode (unsigned int oc)
 Remove the StateAttribute with the object code oc. More...

NVSG_API size_t getNumberOfOwners (void) const
 Get the number of owners of this StateSet. More...

NVSG_API const GeoNodegetOwner (size_t index) const
 Get a constant pointer to the owner node at position index. More...

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

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


Static Public Methods

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

NVSG_API const StateSet * createFromBase (const Object &rhs)
 Create a StateSet by copying from an Object. More...


Protected Methods

NVSG_API StateSet (void)
 Constructor. More...

NVSG_API StateSet (const Object &rhs)
 Partial Constructor. More...

NVSG_API StateSet (const StateSet &rhs)
 Copy constructor. More...

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

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


Friends

class GeoNode

Related Functions

(Note that these are not member functions.)

NVSG_API bool operator== (const StateSet &lhs, const StateSet &rhs)

Detailed Description

Class to hold a list of StateAttributes.

A StateSet is a complete description of the visual appearance of some geometry. This is achieved by a list of StateAttributes, each describing parts of the appearance (e.g. FaceAttribute, Material, TextureAttribute).


Constructor & Destructor Documentation

NVSG_API nvsg::StateSet::StateSet void    [protected]
 

Constructor.

NVSG_API nvsg::StateSet::StateSet const Object   rhs [protected]
 

Partial Constructor.

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

Copy constructor.

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

Protected destructor to prevent explicit creation on stack.


Member Function Documentation

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

Create a StateSet.

Returns:
a constant pointer to a StateSet.

NVSG_API const StateSet* nvsg::StateSet::createFromBase const Object   rhs [static]
 

Create a StateSet by copying from an Object.

Returns:
a constant pointer to a StateSet.

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

Create a StateSet by cloning this.

Returns:
a constant pointer to a StateSet.

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

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

Get the DataID of the data of this object.

Returns:
DataID of the object's data.

Reimplemented from nvsg::Object.

NVSG_API void nvsg::StateSet::addAttribute const StateAttribute   attrib
 

Add a StateAttribute to the attribute list.

There is always only one attribute of the same type in the list. So for example if you add a second StateAttribute of the type CgFX the other CgFX attribute will be replaced.

Note:
In RenderTraverser::RT_EFFECTED mode the CgFX attribute is used with higher priority than every other attribute. E.g an additional material attribute will be neglected until you use RenderTraverser::RT_SHADED.
Parameters:
attrib  attribute to add

size_t nvsg::StateSet::getNumberOfAttributes void    const [inline]
 

Get the number of StateAttributes in this StateSet.

Returns:
number of StateAttributes in this StateSet

const StateAttribute * nvsg::StateSet::getAttribute size_t    index const [inline]
 

Returns a pointer to the constant StateAttribute at position index.

Returns:
A pointer to the constant StateAttribute at position index.
Note:
The behavior is undefined if called with an invalid index.
Parameters:
index  position to get StateAttribute at

NVSG_API const StateAttribute* nvsg::StateSet::getAttributeByObjectCode unsigned int    oc const
 

Get a constant pointer to the StateAttribute with the object code oc.

Returns:
constant pointer to the StateAttribute with object code oc or NULL, if there is none.
Note:
You will find the non custom object codes here: OC_OBJECT
Parameters:
oc  object code of StateAttribute to get

NVSG_API bool nvsg::StateSet::removeAttribute const StateAttribute   attrib
 

Remove a specified StateAttribute.

Returns:
true, if the attribute was successfully removed, false otherwise.
Parameters:
attrib  StateAttribute to remove

NVSG_API bool nvsg::StateSet::removeAttribute size_t    index
 

Remove the StateAttribute at position index.

Returns:
true, if the attribute was successfully removed, false otherwise.
Parameters:
index  index of StateAttribute to remove

NVSG_API bool nvsg::StateSet::removeAttributeByObjectCode unsigned int    oc
 

Remove the StateAttribute with the object code oc.

Returns:
true, if the attribute was successfully removed, false otherwise.
Note:
You will find the non custom object codes here: OC_OBJECT
Parameters:
oc  StateAttribute class to remove

size_t nvsg::StateSet::getNumberOfOwners void    const [inline]
 

Get the number of owners of this StateSet.

Returns:
The number of owners if this StateSet

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

Get a constant pointer to the owner node at position index.

Returns:
The constant pointer to the owner node at position index
Parameters:
index  The position to get the owner at

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

Ask if this StateSet contains any CgFx attributes.

Returns:
true if the StateSet contains a CgFx attribute, otherwise false.

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

Invalidate the CgFx containment cache.

The cache is invalidated and all owners of this StateSet are invalidated on CgFx containment.

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

Ask if this StateSet contains any transparent Material attributes.

Returns:
true if the StateSet contains a transparent Material attribute, otherwise false.

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

Invalidate the transparent Material containment cache.

The cache is invalidated and all owners of this StateSet are invalidated on CgFx containment.

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

Ask if this StateSet contains any transparent Texture.

Returns:
true if the StateSet contains a transparent Texture, otherwise false.

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

Invalidate the transparent Texture containment cache.

The cache is invalidated and all owners of this StateSet are invalidated on CgFx containment.

NVSG_API void nvsg::StateSet::invalidateCaches const StateAttribute   attrib,
bool    insert
[protected]
 

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

If the CgFx containment changes by adding/removing attrib, the CgFx cache is invalidated.


Friends And Related Function Documentation

NVSG_API bool operator== const StateSet &    lhs,
const StateSet &    rhs
[related]
 

Compare two StateSets. Two StateSets are considered to be equal, if they have the same number of StateAttributes and each of these StateAttributes are pairwise equal.

Returns:
true, if the StateSets are equal, false otherwise.
Parameters:
lhs  first StateSet to compare
rhs  second StateSet to compare


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