Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound 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 Methods

virtual NVSG_API const TriStrips * clone () const
 Get a clone of this Triangles object. 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 bool hasStrips (void) const
 Ask if this TriStrips has strips. More...

NVSG_API size_t getNumberOfStrips (void) const
 Get number of strips. More...

NVSG_API const IndexSetgetStrips () const
 Get constant pointer to strips. More...

NVSG_API void setStrips (const IndexSet *pStrips, size_t numStrips)
 Set the strips for this TriStrip. More...

NVSG_API void setStrips (size_t pos, const IndexSet *pStrips, size_t numStrips)
 Set the strips for this TriStrip. More...

virtual NVSG_API void calculateTangentSpace (size_t tu=0, size_t tg=1, size_t bn=2)
 Calculate tangents and binormals. More...


Static Public Methods

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

NVSG_API const TriStrips * createFromBase (const GeoSet &rhs)
 Create a TriStrips by copying from a GeoSet. More...


Protected Methods

NVSG_API TriStrips (void)
 Constructor. More...

NVSG_API TriStrips (const GeoSet &rhs)
 Partial Constructor from a GeoSet. More...

NVSG_API TriStrips (const TriStrips &rhs)
 Copy Constructor. More...

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


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

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

Create a TriStrips.

Returns:
a constant pointer to a TriStrips.

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:20:35 2005 for NVSGSDK by NVIDIA