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

nvsg::TextureAttribute Class Reference

Texture attribute. More...

#include <TextureAttribute.h>

Inheritance diagram for nvsg::TextureAttribute:

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

Collaboration graph
[legend]
List of all members.

Public Types

enum  { INVALID_ITEM = 0xFFFFFFFF }

Public Member Functions

virtual NVSG_API const TextureAttributeclone (void) const
 Get a clone of this texture attribute.
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 void bindTextureAttributeItem (const TextureAttributeItem *item, size_t unit)
 Bind texture attribute item.
NVSG_API void unbindTextureAttributeItem (size_t unit)
 Unbind texture attribute item.
NVSG_API size_t getFirstItem (void) const
 Get first item.
NVSG_API size_t getNextItem (void) const
 Get next item.
NVSG_API size_t getNumberOfItems (void) const
 Get number of item.
NVSG_API const TextureAttributeItemgetTextureAttributeItem (size_t unit) const
 Get texture attribute item.

Static Public Member Functions

static NVSG_API const TextureAttributecreate (void)
 Create a TextureAttribute.
static NVSG_API const TextureAttributecreateFromBase (const StateAttribute &rhs)
 Create a TextureAttribute by copying from a StateAttribute.

Protected Member Functions

NVSG_API TextureAttribute (void)
 Default Constructor.
NVSG_API TextureAttribute (const StateAttribute &rhs)
 Partial Constructor.
NVSG_API TextureAttribute (const TextureAttribute &rhs)
 Copy constructor.
virtual NVSG_API ~TextureAttribute (void)
 Protected destructor to prevent explicit creation on stack.

Detailed Description

Texture attribute.

This maintains bindings between abstract texture units and TextureAttributeItem objects. For this purpose it provides an interface to bind a certain TextureAttributeItem to a specified texture unit or to unbind a TextureAttributeItem from a certain texture unit. It also provides an interface to iterate through all bounded TextureAttributeItem objects.

As a StateAttribute, a TextureAttribute can be added to a StateSet of a certain GeoNode for texturing purposes.


Constructor & Destructor Documentation

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

Default Constructor.

NVSG_API nvsg::TextureAttribute::TextureAttribute const StateAttribute rhs  )  [protected]
 

Partial Constructor.

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

Copy constructor.

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

Protected destructor to prevent explicit creation on stack.


Member Function Documentation

static NVSG_API const TextureAttribute* nvsg::TextureAttribute::create void   )  [static]
 

Create a TextureAttribute.

Returns:
a constant pointer to a TextureAttribute.

static NVSG_API const TextureAttribute* nvsg::TextureAttribute::createFromBase const StateAttribute rhs  )  [static]
 

Create a TextureAttribute by copying from a StateAttribute.

Returns:
a constant pointer to a TextureAttribute.

virtual NVSG_API const TextureAttribute* nvsg::TextureAttribute::clone void   )  const [virtual]
 

Get a clone of this texture attribute.

Returns:
a constant pointer to a TextureAttribute.

Implements nvsg::StateAttribute.

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

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

Get the DataID of the data of this object.

Returns:
DataID of the object's data.

Reimplemented from nvsg::StateAttribute.

NVSG_API void nvsg::TextureAttribute::bindTextureAttributeItem const TextureAttributeItem item,
size_t  unit
 

Bind texture attribute item.

This binds the texture attribute item pointed to by item to the texture unit specified by unit. A texture attribute that was bound to that texture unit prior to this call, will be unbound.

Parameters:
item  Texture attribute item to be bound.
unit  Zero based index of the texture unit the item should be bound to.

NVSG_API void nvsg::TextureAttribute::unbindTextureAttributeItem size_t  unit  ) 
 

Unbind texture attribute item.

Unbind the texture attribute item currently bound to the texture unit specified by unit. Immediately after this call, no texture attribute item is bound to that unit.

Parameters:
unit  Zero based index of the texture unit.

size_t nvsg::TextureAttribute::getFirstItem void   )  const [inline]
 

Get first item.

This is thought to initiate iteration of bounded texture attribute items. Use this in conjunction with getNextItem to iterate over all bounded texture attribute items.

Returns:
The zero based index of the first texture unit a texture attribute item is actually bound to or INVALID_ITEM if no texture attribute item is currently bound.

size_t nvsg::TextureAttribute::getNextItem void   )  const [inline]
 

Get next item.

This is thought to pursue iteration of bounded texture attribute items.

Note:
An iteration must be started by a call to getFirstItem to ensure that the iteration starts at the very first texture unit a texture attribute item is actually bound to.
Returns:
The zero based index of the very next texture unit a texture attribute item is actually bound to or INVALID_ITEM if no further texture attribute item is currently bound.

size_t nvsg::TextureAttribute::getNumberOfItems void   )  const [inline]
 

Get number of item.

Returns:
The number of texture attribute items currently bound.
Note:
Do not use this to iterate through the items. If you want to iterate use this construct:
 for ( size_t tu = pAttrib->getFirstItem()
     ; tu != TextureAttribute::INVALID_ITEM
     ; tu = pAttrib->getNextItem())
 {
 }

const TextureAttributeItem * nvsg::TextureAttribute::getTextureAttributeItem size_t  unit  )  const [inline]
 

Get texture attribute item.

Returns:
The texture attribute item that is currently bound to the texture unit specified by unit or a null pointer if no texture attribute item is currently bound to texture unit unit.
Parameters:
unit  Zero based index of queried texture unit.


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