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

nvsg::TextureAttributeItem Class Reference

Texture attribute item. More...

#include <TextureAttribute.h>

Inheritance diagram for nvsg::TextureAttributeItem:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual NVSG_API const TextureAttributeItemclone (void) const
 Create a TextureAttributeItem by cloning an other.
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 setFileName (const std::string &fname)
 Set texture file name.
NVSG_API const std::string & getFileName (void) const
 Get texture file name.
NVSG_API const TexturegetTexture (void) const
 Get texture.
NVSG_API void setTexture (const Texture *p) const
 Set texture.
NVSG_API void setBorderColor (const nvmath::Vec4f &color)
 Sets the texture border color.
NVSG_API const nvmath::Vec4fgetBorderColor (void) const
 Gets the texture border color.
NVSG_API TextureEnvMode getEnvMode (void) const
 Get texture environment mode.
NVSG_API void setEnvMode (TextureEnvMode mode)
 Set texture environment mode.
NVSG_API void setMagFilterMode (TextureMagFilterMode mode)
 Set the texture magnification filter mode.
NVSG_API TextureMagFilterMode getMagFilterMode (void) const
 Get the texture magnification filter mode.
NVSG_API void setMinFilterMode (TextureMinFilterMode mode)
 Set the texture minification filter mode.
NVSG_API TextureMinFilterMode getMinFilterMode (void) const
 Get the texture minification filter mode.
NVSG_API TextureWrapMode getWrapMode (TexCoordAxis target) const
 Get the texture wrap mode.
NVSG_API void setWrapMode (TexCoordAxis target, TextureWrapMode mode)
 Set the texture wrap mode.
NVSG_API TextureType getType (void) const
 Get texture type.
NVSG_API void setType (TextureType tt)
 Set texture type.
NVSG_API nvmath::Mat44f getMatrix (void) const
 Get texture matrix.
NVSG_API const nvmath::QuatfgetOrientation (void) const
 Get orientation.
NVSG_API void setOrientation (const nvmath::Quatf &orientation)
 Set orientation.
NVSG_API const nvmath::Vec3fgetScaling (void) const
 Get scaling.
NVSG_API void setScaling (const nvmath::Vec3f &scale)
 Set scaling.
NVSG_API const nvmath::Vec3fgetTranslation (void) const
 Get translation.
NVSG_API void setTranslation (const nvmath::Vec3f &trans)
 Set translation.
NVSG_API bool isLookupRequired (void) const
 Determine if a texture lookup is required with the very next rendering step.
NVSG_API void setTexGenEnvironmentMapping (bool sAxis=true, bool tAxis=true)
 Set the texture coordinate generation of the s- and t-axis to TGM_SPHERE_MAP.
NVSG_API void setTexGenLinearMapping (TexCoordAxis axis, TexGenLinearMode mode, const nvmath::Plane3f &plane)
 Set the texture coordinate generation of axis to object or eye linear.
NVSG_API void disableTexGen (TexCoordAxis axis)
 Disable the texture coordinate generation of axis.
NVSG_API TexGenMode getTexGenMode (TexCoordAxis axis) const
 Get the texture coordinate generation mode.
NVSG_API const nvmath::Plane3fgetTexGenPlane (TexCoordAxis axis) const
 Get the base plane for linear texture coordinate generation.

Static Public Member Functions

static NVSG_API const TextureAttributeItemcreate (void)
 Create a TextureAttributeItem.
static NVSG_API const TextureAttributeItemcreateFromBase (const Object &rhs)
 Create a TextureAttributeItem by copying from an Object.

Protected Member Functions

NVSG_API TextureAttributeItem (void)
 Default constructor.
NVSG_API TextureAttributeItem (const Object &rhs)
 Partial Constructor.
NVSG_API TextureAttributeItem (const TextureAttributeItem &rhs)
 Copy constructor.

Friends

class TextureAttribute

Detailed Description

Texture attribute item.

This class serves as an abstract layer for a single texture object. The use of a TextureAttributeItem is meaningful only in conjunction with a TextureAttribute, which provides an interface to bind a TextureAttributeItem to a specified texture unit.


Constructor & Destructor Documentation

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

Default constructor.

NVSG_API nvsg::TextureAttributeItem::TextureAttributeItem const Object rhs  )  [protected]
 

Partial Constructor.

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

Copy constructor.


Member Function Documentation

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

Create a TextureAttributeItem.

Returns:
a constant pointer to a TextureAttributeItem.

static NVSG_API const TextureAttributeItem* nvsg::TextureAttributeItem::createFromBase const Object rhs  )  [static]
 

Create a TextureAttributeItem by copying from an Object.

Returns:
a constant pointer to a TextureAttributeItem.
Parameters:
rhs  Object to copy from

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

Create a TextureAttributeItem by cloning an other.

Returns:
a constant pointer to a TextureAttributeItem.

virtual NVSG_API bool nvsg::TextureAttributeItem::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::TextureAttributeItem::getDataID void   )  const [virtual]
 

Get the DataID of the data of this object.

Returns:
DataID of the object's data.

Reimplemented from nvsg::Object.

void nvsg::TextureAttributeItem::setFileName const std::string &  fname  )  [inline]
 

Set texture file name.

Use this to specify the name of the image file from which to load the texture

Parameters:
fname  Name of the image file

const std::string & nvsg::TextureAttributeItem::getFileName void   )  const [inline]
 

Get texture file name.

Returns:
The name of the image file from which to load the texture.

const Texture * nvsg::TextureAttributeItem::getTexture void   )  const [inline]
 

Get texture.

Returns:
A constant pointer to the device dependent texture object.

void nvsg::TextureAttributeItem::setTexture const Texture p  )  const [inline]
 

Set texture.

This is used to attach the device dependent texture object to this texture attribute item.

Note:
The device dependent texture will be generated while rendering the scenegraph. As rendering is a const traverser step working on a const texture attribute item, this function needs to be a const member function.
Parameters:
p  Pointer to the Texture object to be set.

void nvsg::TextureAttributeItem::setBorderColor const nvmath::Vec4f color  )  [inline]
 

Sets the texture border color.

const nvmath::Vec4f & nvsg::TextureAttributeItem::getBorderColor void   )  const [inline]
 

Gets the texture border color.

TextureEnvMode nvsg::TextureAttributeItem::getEnvMode void   )  const [inline]
 

Get texture environment mode.

Returns:
The texture environment mode used with rasterizing

void nvsg::TextureAttributeItem::setEnvMode TextureEnvMode  mode  )  [inline]
 

Set texture environment mode.

Use this to specify the texture environment mode to be used with rasterizing.

Parameters:
mode  Environment mode.

void nvsg::TextureAttributeItem::setMagFilterMode TextureMagFilterMode  mode  )  [inline]
 

Set the texture magnification filter mode.

The texture magnification function is used when the pixel being textured maps to an area less than or equal to one texture element. It sets the texture magnification function to either TFM_MAG_NEAREST or TFM_MAG_BILINEAR.

Parameters:
mode  magnification filter mode to set

TextureMagFilterMode nvsg::TextureAttributeItem::getMagFilterMode void   )  const [inline]
 

Get the texture magnification filter mode.

Returns:
The magnification filter mode.

void nvsg::TextureAttributeItem::setMinFilterMode TextureMinFilterMode  mode  )  [inline]
 

Set the texture minification filter mode.

The texture minifying function is used whenever the pixel being textured maps to an area greater than one texture element. There are three defined minifying functions. TFM_MIN_NEAREST uses the nearest texture element to compute the texture value. TFM_MIN_BILINEAR uses the nearest four texture elements. TFM_MIN_TRILINEAR uses mipmaps.

Parameters:
mode  minification filter mode to set

TextureMinFilterMode nvsg::TextureAttributeItem::getMinFilterMode void   )  const [inline]
 

Get the texture minification filter mode.

Returns:
The minification filter mode.

TextureWrapMode nvsg::TextureAttributeItem::getWrapMode TexCoordAxis  target  )  const [inline]
 

Get the texture wrap mode.

The texture wrap mode can be either TWM_REPEAT (default), TWM_CLAMP, or TWM_MIRROR. Each of the up to three texture dimensions may have it's own wrap mode.

Returns:
TextureWrapMode of the texture target (TCA_S, TCA_T, or TCA_R)
Parameters:
target  Target dimension to get wrap mode for

void nvsg::TextureAttributeItem::setWrapMode TexCoordAxis  target,
TextureWrapMode  mode
[inline]
 

Set the texture wrap mode.

The texture wrap mode can be set independently for each of up to three texture dimensions to either TWM_REPEAT (default), TWM_CLAMP or TWM_MIRROR.

Note:
If the underlying hardware doesn't support mirroring textures, it falls back to the repeat mode.
Parameters:
target  Target dimension to set wrap mode for
mode  Wrap mode to set

TextureType nvsg::TextureAttributeItem::getType void   )  const [inline]
 

Get texture type.

Note:
Currently only diffuse textures are supported.
Returns:
The type of the embedded texture object.

void nvsg::TextureAttributeItem::setType TextureType  tt  )  [inline]
 

Set texture type.

Use this to specify the texture type.

Note:
Only diffuse textures are currently supported.
Parameters:
tt  Texture type.

nvmath::Mat44f nvsg::TextureAttributeItem::getMatrix void   )  const [inline]
 

Get texture matrix.

The texture matrix is composed of the cropping and the rotation matrix.

Returns:
The matrix used to transform the embedded texture object.

const nvmath::Quatf & nvsg::TextureAttributeItem::getOrientation void   )  const [inline]
 

Get orientation.

Get the rotation part of the texture transformation.

Returns:
A quaternion that describes the rotational part.

void nvsg::TextureAttributeItem::setOrientation const nvmath::Quatf orientation  )  [inline]
 

Set orientation.

Sets the orientation of the texture transformation.

Parameters:
orientation  Rotational part of the texture transformation.

const nvmath::Vec3f & nvsg::TextureAttributeItem::getScaling void   )  const [inline]
 

Get scaling.

Get the scaling part of the texture transformation.

Returns:
A three component vector that describes the scaling in u, v, and w.

void nvsg::TextureAttributeItem::setScaling const nvmath::Vec3f scale  )  [inline]
 

Set scaling.

Sets the scaling of the texture transformation.

Parameters:
scale  Scaling factors in u, v, w.

const nvmath::Vec3f & nvsg::TextureAttributeItem::getTranslation void   )  const [inline]
 

Get translation.

Get the translation part of the texture transformation.

Returns:
The translation in u, v, and w

void nvsg::TextureAttributeItem::setTranslation const nvmath::Vec3f trans  )  [inline]
 

Set translation.

Sets the translation of the texture transformation.

Parameters:
trans  Translation in u, v, w.

bool nvsg::TextureAttributeItem::isLookupRequired void   )  const [inline]
 

Determine if a texture lookup is required with the very next rendering step.

Returns:
true if a texture lookup is required with the very next rendering step, false otherwise.

void nvsg::TextureAttributeItem::setTexGenEnvironmentMapping bool  sAxis = true,
bool  tAxis = true
[inline]
 

Set the texture coordinate generation of the s- and t-axis to TGM_SPHERE_MAP.

Parameters:
sAxis  enable TGM_SPHERE_MAP on the s-axis
tAxis  enable TGM_SPHERE_MAP on the t-axis

void nvsg::TextureAttributeItem::setTexGenLinearMapping TexCoordAxis  axis,
TexGenLinearMode  mode,
const nvmath::Plane3f plane
[inline]
 

Set the texture coordinate generation of axis to object or eye linear.

Parameters:
axis  select the axis to enable
mode  select the linear mode to set
plane  set the plane equation

void nvsg::TextureAttributeItem::disableTexGen TexCoordAxis  axis  )  [inline]
 

Disable the texture coordinate generation of axis.

Parameters:
axis  select the axis to disable

TexGenMode nvsg::TextureAttributeItem::getTexGenMode TexCoordAxis  axis  )  const [inline]
 

Get the texture coordinate generation mode.

Parameters:
axis  select the axis to query

const nvmath::Plane3f & nvsg::TextureAttributeItem::getTexGenPlane TexCoordAxis  axis  )  const [inline]
 

Get the base plane for linear texture coordinate generation.

Parameters:
axis  select the axis to query


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