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

nvsg::TriStrips Class Reference

GeoSet defining triangle strips. More...

#include <TriStrips.h>

Inheritance diagram for nvsg::TriStrips:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual NVSG_API const TriStripsclone () const
 Get a clone of this Triangles object.
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 bool hasStrips (void) const
 Ask if this TriStrips has strips.
NVSG_API size_t getNumberOfStrips (void) const
 Get number of strips.
NVSG_API const IndexSetgetStrips () const
 Get constant pointer to strips.
NVSG_API void setStrips (const IndexSet *pStrips, size_t numStrips)
 Set the strips for this TriStrip.
NVSG_API void setStrips (size_t pos, const IndexSet *pStrips, size_t numStrips)
 Set the strips for this TriStrip.
virtual NVSG_API void calculateTangentSpace (size_t tu=0, size_t tg=1, size_t bn=2)
 Calculate tangents and binormals.

Static Public Member Functions

static NVSG_API const TriStripscreate (void)
 Create a TriStrips.
static NVSG_API const TriStripscreateFromBase (const GeoSet &rhs)
 Create a TriStrips by copying from a GeoSet.

Protected Member Functions

NVSG_API TriStrips (void)
 Constructor.
NVSG_API TriStrips (const GeoSet &rhs)
 Partial Constructor from a GeoSet.
NVSG_API TriStrips (const TriStrips &rhs)
 Copy Constructor.
virtual NVSG_API ~TriStrips (void)
 Protected destructor to prevent explicit creation on stack.

Detailed Description

GeoSet defining triangle strips.

A TriStrips is a GeoSet that represents the vertex attributes of the GeoSet as triangle strips. The strips are defined by a number of IndexSet elements. Each IndexSet is a std::vector<unsigned int> and represents one triangle strip. If you have, for example, an array of eight vertices in the GeoSet, one possibility to make them a cube is, to define three IndexSet elements like that:

   set[0] = { 0, 1, 2, 3, 4, 5, 6, 7, 0, 1 };
   set[1] = { 1, 7, 3, 5 };
   set[2] = { 6, 0, 4, 2 };
The ordering ensures that the triangles are all drawn with the same orientation so that the triangle strip correctly form part of a surface. Preserving the orientation is important for some operations, such as culling. The number of vertices per IndexSet must be at least 3 for anything to be drawn.


Constructor & Destructor Documentation

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

Constructor.

NVSG_API nvsg::TriStrips::TriStrips const GeoSet rhs  )  [protected]
 

Partial Constructor from a GeoSet.

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

Copy Constructor.

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

Protected destructor to prevent explicit creation on stack.


Member Function Documentation

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

Create a TriStrips.

Returns:
a constant pointer to a TriStrips.

static NVSG_API const TriStrips* nvsg::TriStrips::createFromBase const GeoSet rhs  )  [static]
 

Create a TriStrips by copying from a GeoSet.

Returns:
a constant pointer to a TriStrips.

virtual NVSG_API const TriStrips* nvsg::TriStrips::clone  )  const [virtual]
 

Get a clone of this Triangles object.

Returns:
A constant pointer to a TriStrips.

Implements nvsg::Drawable.

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

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

Get the DataID of the data of this object.

Returns:
DataID of the object's data.

Reimplemented from nvsg::GeoSet.

bool nvsg::TriStrips::hasStrips void   )  const [inline]
 

Ask if this TriStrips has strips.

Returns:
true, if this TriStrips has strips, otherwise false

size_t nvsg::TriStrips::getNumberOfStrips void   )  const [inline]
 

Get number of strips.

Returns:
The number of strips

const IndexSet * nvsg::TriStrips::getStrips  )  const [inline]
 

Get constant pointer to strips.

Returns:
A constant pointer to strips

NVSG_API void nvsg::TriStrips::setStrips const IndexSet pStrips,
size_t  numStrips
 

Set the strips for this TriStrip.

Copies numStrips strips from pStrips into this TriStrips.

Parameters:
pStrips  strips to set
numStrips  number of strips

NVSG_API void nvsg::TriStrips::setStrips size_t  pos,
const IndexSet pStrips,
size_t  numStrips
 

Set the strips for this TriStrip.

Copies numStrips strips from pStrips into this TriStrips, starting at position pos inside the range of pre-existing strips.

Pre-existing strips in the range [pos, pos + numStrips) will be replaced. Pre-existing strips outside this range remain untouched.

If you specify -1 for pos or if pos specifies the number of strips currently stored, the strips pointed to by pStrips will be appended to the pre-existing faces.

If you not specify -1 for pos or pos neither specifies the number of faces currently stored nor does it specify a valid position inside the range of pre-existing strips, the behaviour is undefined!

Parameters:
pos  Start position inside the range of pre-existing strips
pStrips  strips to set
numStrips  number of strips

virtual NVSG_API void nvsg::TriStrips::calculateTangentSpace size_t  tu = 0,
size_t  tg = 1,
size_t  bn = 2
[virtual]
 

Calculate tangents and binormals.

The two dimensional texture coordinates out of texture unit tu are used as the parameterization for the calculation. The tangents are written to texture unit tg and the binormals to texture unit bn.

Parameters:
tu  texture unit to get parameterizing coords
tg  texture unit to write tangents to
bn  texture unit to write binormals to

Implements nvsg::GeoSet.


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