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

nvsg::FaceAttribute Class Reference

StateAttribute that determines the render modes to use for the following geometries. More...

#include <FaceAttribute.h>

Inheritance diagram for nvsg::FaceAttribute:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual NVSG_API const FaceAttributeclone (void) const
 Get a clone of this render mode.
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 const nvmath::Vec3fgetAmbientColor (void) const
 Get the ambient color.
NVSG_API float getPolygonOffsetFactor (void) const
 Get the polygon offset scale factor.
NVSG_API float getPolygonOffsetUnits (void) const
 Get the polygon offset units.
NVSG_API bool isBackFaceCulling (void) const
 Get the back face culling state.
NVSG_API bool isPolygonOffset (void) const
 Get the polygon offset state.
NVSG_API bool isTwoSidedLighting (void) const
 Get the two sided lighting state.
NVSG_API void setAmbientColor (const nvmath::Vec3f &color)
 Set the ambient color.
NVSG_API void setBackFaceCulling (bool onOff)
 Set the back face culling state.
NVSG_API void setPolygonOffset (bool onOff)
 Set the polygon offset state.
NVSG_API void setPolygonOffset (float factor, float units)
 Set the polygon offset scale factor and units.
NVSG_API void setTwoSidedLighting (bool onOff)
 Set the two sided lighting state.

Static Public Member Functions

static NVSG_API const FaceAttributecreate (void)
 Create a FaceAttribute.
static NVSG_API const FaceAttributecreateFromBase (const StateAttribute &rhs)
 Create a FaceAttribute by copying from a StateAttribute.

Protected Member Functions

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

Detailed Description

StateAttribute that determines the render modes to use for the following geometries.


Constructor & Destructor Documentation

NVSG_API nvsg::FaceAttribute::FaceAttribute  )  [protected]
 

Default constructor.

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

Partial Constructor.

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

Copy Constructor.

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

Protected destructor to prevent explicit creation on stack.


Member Function Documentation

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

Create a FaceAttribute.

Returns:
a constant pointer to a FaceAttribute.

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

Create a FaceAttribute by copying from a StateAttribute.

Returns:
a constant pointer to a FaceAttribute.

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

Get a clone of this render mode.

Returns:
a constant pointer to a FaceAttribute.

Implements nvsg::StateAttribute.

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

Get the DataID of the data of this object.

Returns:
DataID of the object's data.

Reimplemented from nvsg::StateAttribute.

const nvmath::Vec3f & nvsg::FaceAttribute::getAmbientColor void   )  const [inline]
 

Get the ambient color.

This is the constant light for the following geometries. It lights all object vertices the same because it is not dependent on any other lighting factors such as vertex normals, light direction, light position, range, or attenuation. The default is (0.2,0.2,0.2).

Returns:
The current ambient color

float nvsg::FaceAttribute::getPolygonOffsetFactor void   )  const [inline]
 

Get the polygon offset scale factor.

The PolygonOffsetFactor is a scale factor that is used to create a variable depth offset for each polygon. The default is 0.0.

Returns:
The current polygon offset scale factor

float nvsg::FaceAttribute::getPolygonOffsetUnits void   )  const [inline]
 

Get the polygon offset units.

The PolygonOffsetUnits specifies a value that is multiplied by an implementation-specific value to create a constant depth offset. The default is 0.0.

Returns:
The current polygon offset units

bool nvsg::FaceAttribute::isBackFaceCulling void   )  const [inline]
 

Get the back face culling state.

The back face culling state specifies how back-facing facets are handled. If it is disabled, back-facing facets are drawn regulary. Otherwise, back-facing facets are not drawn. Lines and points are not affected by this state. The default is true.

Returns:
The current back face culling state

bool nvsg::FaceAttribute::isPolygonOffset void   )  const [inline]
 

Get the polygon offset state.

The polygon offset state specifies how polygon offsets are handled. If it is disabled, no polygon offsets are used. Otherwise, each fragment's depth value will be offset after it is interpolated from the depth values of the appropriate vertices. The offset is added before the depth test is performed and before the value is written into the depth buffer. The default is false.

Returns:
The current polygon offset state

bool nvsg::FaceAttribute::isTwoSidedLighting void   )  const [inline]
 

Get the two sided lighting state.

The two sided lighting state specifies whether one or two-sided lighting calculations are performed for polygons. It has no effect on the lighting calculations for points, lines, or bitmaps. If it is disabled, one-sided lighting is specified. Otherwise, two-sided lighting is specified. In this case, vertices of back-facing polygons are lighted, and have their normals reversed before the lighting equation is evaluated. Vertices of front-facing polygons are always lighted, with no change to their normals. The default is false.

Returns:
The current two sided lighting state

void nvsg::FaceAttribute::setAmbientColor const nvmath::Vec3f color  )  [inline]
 

Set the ambient color.

This is the constant light for the following geometries. It lights all object vertices the same because it is not dependent on any other lighting factors such as vertex normals, light direction, light position, range, or attenuation. The default is (0.2,0.2,0.2).

Parameters:
color  ambient color to set

void nvsg::FaceAttribute::setBackFaceCulling bool  onOff  )  [inline]
 

Set the back face culling state.

The back face culling state specifies how back-facing facets are handled. If it is disabled, back-facing facets are drawn regulary. Otherwise, back-facing facets are not drawn. Lines and points are not affected by this state. The default is true.

Parameters:
onOff  true to switch back face culling on, false to switch it off

void nvsg::FaceAttribute::setPolygonOffset bool  onOff  )  [inline]
 

Set the polygon offset state.

The polygon offset state specifies how polygon offsets are handled. If it is disabled, no polygon offsets are used. Otherwise, each fragment's depth value will be offset after it is interpolated from the depth values of the appropriate vertices. The offset is added before the depth test is performed and before the value is written into the depth buffer. The default is false.

Parameters:
onOff  true to switch polygon offset on, false to switch it off

void nvsg::FaceAttribute::setPolygonOffset float  factor,
float  units
[inline]
 

Set the polygon offset scale factor and units.

The PolygonOffset factor is a scale factor that is used to create a variable depth offset for each polygon. The default is 0.0. The PolygonOffset units specifies a value that is multiplied by an implementation-specific value to create a constant depth offset. The default is 0.0.

Parameters:
factor  polygon offset scale factor to use
units  polygon offset units to use

void nvsg::FaceAttribute::setTwoSidedLighting bool  onOff  )  [inline]
 

Set the two sided lighting state.

The two sided lighting state specifies whether one or two-sided lighting calculations are performed for polygons. It has no effect on the lighting calculations for points, lines, or bitmaps. If it is disabled, one-sided lighting is specified. Otherwise, two-sided lighting is specified. In this case, vertices of back-facing polygons are lighted, and have their normals reversed before the lighting equation is evaluated. Vertices of front-facing polygons are always lighted, with no change to their normals. The default is false.

Parameters:
onOff  true to switch two sided lighting on, false to switch it off


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