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

nvsg::GeoSet Class Reference

Base class for Geometries. More...

#include <GeoSet.h>

Inheritance diagram for nvsg::GeoSet:

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

Collaboration graph
[legend]
List of all members.

Public Types

enum  {
  VERTEX_POSITION = 0, VERTEX_WEIGHTS, NORMAL, PRIMARY_COLOR,
  SECONDARY_COLOR, FOG_COORDINATE, UNUSED_1, UNUSED_2,
  TEXTURE_COORD_0, TEXTURE_COORD_1, TEXTURE_COORD_2, TEXTURE_COORD_3,
  TEXTURE_COORD_4, TEXTURE_COORD_5, TEXTURE_COORD_6, TEXTURE_COORD_7,
  NUMBER_OF_VERTEX_ATTRIBUTES
}
 Vertex Attribute Register Numbers. More...


Public Methods

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 isBoundingSphereValid (void) const
 Ask if the bounding sphere of this GeoSet is valid. More...

NVSG_API const nvmath::Sphere3fgetBoundingSphere (void) const
 Get the bounding sphere of this GeoSet. More...

NVSG_API size_t getNumberOfVertexAttributeBytes (size_t attrib) const
 Get amount of data bytes currently stored in the vertex attribute specified by attrib. More...

NVSG_API const float * getVertexAttributeData (size_t attrib) const
 Get float data stored in the vertex attribute specified by attrib. More...

NVSG_API unsigned int getVertexAttributeDataDim (size_t attrib) const
 Determine the dimension, in terms of float, of the data stored in the vertex attribute specified by attrib. More...

NVSG_API size_t getNumberOfVertexAttributeData (size_t attrib) const
 Determine if data is available for a vertex attribute specified by attrib. More...

NVSG_API void setVertexAttributeData (size_t attrib, unsigned int fdim, const float *fdata, size_t count)
 Set data for the vertex attribute specified by attrib. More...

NVSG_API void setVertexAttributeData (size_t attrib, unsigned int fdim, size_t pos, const float *fdata, size_t count)
 Set data for the vertex attribute specified by attrib. More...

NVSG_API size_t getNumberOfVertices (void) const
 Get number of vertices. More...

NVSG_API const nvmath::Vec3fgetVertices (void) const
 Get vertices. More...

NVSG_API void setVertices (const nvmath::Vec3f *verts, size_t count)
 Set vertices for this GeoSet. More...

NVSG_API void setVertices (size_t pos, const nvmath::Vec3f *verts, size_t count)
 Set vertices for this GeoSet. More...

NVSG_API size_t getNumberOfNormals (void) const
 Get number of normals. More...

NVSG_API const nvmath::Vec3fgetNormals (void) const
 Get normals. More...

NVSG_API void setNormals (const nvmath::Vec3f *nor, size_t count)
 Set normals for this GeoSet. More...

NVSG_API void setNormals (size_t pos, const nvmath::Vec3f *nor, size_t count)
 Set normals for this GeoSet. More...

NVSG_API bool hasTexCoords (void) const
 Determine if at least one texture coordinate array has valid texture coordinates. More...

NVSG_API size_t getNumberOfTexCoords (size_t texUnit) const
 Get number of texture coordinates in a specified texture unit. More...

NVSG_API const float * getTexCoords (size_t texUnit) const
 Get texture coordinates for a specified texture unit. More...

NVSG_API unsigned int getTexCoordsDim (size_t texUnit) const
 Get the dimension of the texture coordinates stored in the specified texture unit. More...

NVSG_API void setTexCoords (size_t texUnit, unsigned int fdim, const float *coords, size_t count)
 Set the texture coordinates for a specified texture unit. More...

NVSG_API void setTexCoords (size_t texUnit, unsigned int fdim, size_t pos, const float *coords, size_t count)
 Set the texture coordinates for a specified texture unit. More...

NVSG_API void generateTexCoords (TextureCoordType tct, const nvmath::Sphere3f &sphere, size_t tu=0)
 Generate texture coordinates into a texture unit. More...

NVSG_API size_t getNumberOfColors (void) const
 Get number of colors. More...

NVSG_API const float * getColors (void) const
 Get constant pointer to colors. More...

NVSG_API unsigned int getColorsDim (void) const
 Get the dimension of the colors. More...

NVSG_API void setColors (unsigned int fdim, const float *cols, size_t count)
 Set colors for this GeoSet. More...

NVSG_API void setColors (unsigned int fdim, size_t pos, const float *cols, size_t count)
 Set colors for this GeoSet. More...

NVSG_API size_t getNumberOfSecondaryColors (void) const
 Get number of secondary colors. More...

NVSG_API const float * getSecondaryColors (void) const
 Get constant pointer to secondary colors. More...

NVSG_API unsigned int getSecondaryColorsDim (void) const
 Get the dimension of the secondary colors. More...

NVSG_API void setSecondaryColors (unsigned int fdim, const float *cols, size_t count)
 Set secondary colors for this GeoSet. More...

NVSG_API void setSecondaryColors (unsigned int fdim, size_t pos, const float *cols, size_t count)
 Set secondary colors for this GeoSet. More...

NVSG_API size_t getNumberOfFogCoords (void) const
 Get number of fog coordinates. More...

NVSG_API const float * getFogCoords (void) const
 Get fog coordinates. More...

NVSG_API void setFogCoords (const float *coords, size_t count)
 Set the fog coordinates. More...

NVSG_API void setFogCoords (size_t pos, const float *coords, size_t count)
 Set the fog coordinates. More...

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

NVSG_API void attachHighlightObject (const HighlightObject *pObj=NULL) const
 Will attach pObj as Highlight object for visualization. More...

NVSG_API const HighlightObjectgetHighlightObject (void) const
 Get the currently attached pObj Highlight object for visualization. More...


Protected Methods

NVSG_API GeoSet (void)
 Instantiate a default constructed GeoSet object. More...

NVSG_API GeoSet (const GeoSet &rhs)
 Instantiate a copy of the GeoSet refered to by rhs. More...

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

virtual NVSG_API void onSetVertexAttributeData (void)
 Vertex attribute data have been changed. More...

virtual NVSG_API void invalidateBoundingSphere (void) const
 Invalidate the BoundingSphere (of the parent geo node also). More...


Friends

class CachedGeometry

Detailed Description

Base class for Geometries.

This class only holds the vertex and attribute data. Any information about how they are connected has to be provided by the derived topology classes (such as Triangles, etc ...).


Member Enumeration Documentation

anonymous enum
 

Vertex Attribute Register Numbers.

These represent valid indices identifying a certain vertex attribute.


Constructor & Destructor Documentation

NVSG_API nvsg::GeoSet::GeoSet void    [protected]
 

Instantiate a default constructed GeoSet object.

Note:
A GeoSet naturally will not be instantiated directly, but through instantiating a derived topology object like Triangles or TriStrips for example.

NVSG_API nvsg::GeoSet::GeoSet const GeoSet &    rhs [protected]
 

Instantiate a copy of the GeoSet refered to by rhs.

Note:
A GeoSet naturally will not be instantiated directly, but through instantiating a derived topology object like Triangles or TriStrips for example.

virtual NVSG_API nvsg::GeoSet::~GeoSet void    [protected, virtual]
 

Protected destructor to prevent explicit creation on stack.


Member Function Documentation

virtual NVSG_API bool nvsg::GeoSet::isDataShared void    const [virtual]
 

Determine whether the data of this object is shared.

Returns:
true if the object's data is shared, false otherwise.

Reimplemented from nvsg::Drawable.

Reimplemented in nvsg::AnimatedQuads, nvsg::AnimatedTriangles, nvsg::Quads, nvsg::QuadStrips, nvsg::SkinnedTriangles, nvsg::Triangles, and nvsg::TriStrips.

virtual NVSG_API DataID nvsg::GeoSet::getDataID void    const [virtual]
 

Get the DataID of the data of this object.

Returns:
The DataID of the object's data.

Reimplemented from nvsg::Drawable.

Reimplemented in nvsg::AnimatedQuads, nvsg::AnimatedTriangles, nvsg::Quads, nvsg::QuadStrips, nvsg::SkinnedTriangles, nvsg::Triangles, and nvsg::TriStrips.

NVSG_API bool nvsg::GeoSet::isBoundingSphereValid void    const [virtual]
 

Ask if the bounding sphere of this GeoSet is valid.

If the bounding sphere isn't valid, it is tried to validate it.

Returns:
The valid state of the bounding sphere.

Implements nvsg::Drawable.

NVSG_API const nvmath::Sphere3f& nvsg::GeoSet::getBoundingSphere void    const [virtual]
 

Get the bounding sphere of this GeoSet.

The bounding sphere of a Node is a sphere that completely contains the Node and all its children.

Note:
It is assumed that the bounding sphere of this Node is valid.
Returns:
A constant reference to the bounding sphere.

Implements nvsg::Drawable.

NVSG_API size_t nvsg::GeoSet::getNumberOfVertexAttributeBytes size_t    attrib const
 

Get amount of data bytes currently stored in the vertex attribute specified by attrib.

Returns:
The number of bytes used.
Note:
The behavior is undefined when passing an invalid index for attrib. Valid indices are:
GeoSet::VERTEX_POSITION
GeoSet::VERTEX_WEIGHTS
GeoSet::NORMAL
GeoSet::PRIMARY_COLOR
GeoSet::SECONDARY_COLOR
GeoSet::FOG_COORDINATE
GeoSet::UNUSED_1
GeoSet::UNUSED_2
GeoSet::TEXTURE_COORD_0
GeoSet::TEXTURE_COORD_1
GeoSet::TEXTURE_COORD_2
GeoSet::TEXTURE_COORD_3
GeoSet::TEXTURE_COORD_4
GeoSet::TEXTURE_COORD_5
GeoSet::TEXTURE_COORD_6
GeoSet::TEXTURE_COORD_7
The indices listed here are a contiguous set of indices and range from 0 to 15.
Parameters:
attrib  Zero based index identifying the target vertex attribute.

const float * nvsg::GeoSet::getVertexAttributeData size_t    attrib const [inline]
 

Get float data stored in the vertex attribute specified by attrib.

Returns:
A valid pointer to the vertex attribute's data if data was stored in the vertex attribute, a NULL pointer otherwise.
Note:
The behavior is undefined when passing an invalid index for attrib. Valid indices are:
GeoSet::VERTEX_POSITION
GeoSet::VERTEX_WEIGHTS
GeoSet::NORMAL
GeoSet::PRIMARY_COLOR
GeoSet::SECONDARY_COLOR
GeoSet::FOG_COORDINATE
GeoSet::UNUSED_1
GeoSet::UNUSED_2
GeoSet::TEXTURE_COORD_0
GeoSet::TEXTURE_COORD_1
GeoSet::TEXTURE_COORD_2
GeoSet::TEXTURE_COORD_3
GeoSet::TEXTURE_COORD_4
GeoSet::TEXTURE_COORD_5
GeoSet::TEXTURE_COORD_6
GeoSet::TEXTURE_COORD_7
The indices listed here are a contiguous set of indices and range from 0 to 15.
Parameters:
attrib  Zero based index identifying the target vertex attribute.

unsigned int nvsg::GeoSet::getVertexAttributeDataDim size_t    attrib const [inline]
 

Determine the dimension, in terms of float, of the data stored in the vertex attribute specified by attrib.

The native data format for data stored in a vertex attribute is float, thus the reason for expressing a data element's dimension in terms of float. A single vertex position, for example, is of dimension 3, which is one single-precision float value for representing a direction in a 3-dimensional space.

Returns:
The dimension, in terms of float, of the data elements stored in the specified vertex attribute. If there is no data currently stored in that vertex attribute, the function returns 0.
Note:
The behavior is undefined when passing an invalid index for attrib. Valid indices are:
GeoSet::VERTEX_POSITION
GeoSet::VERTEX_WEIGHTS
GeoSet::NORMAL
GeoSet::PRIMARY_COLOR
GeoSet::SECONDARY_COLOR
GeoSet::FOG_COORDINATE
GeoSet::UNUSED_1
GeoSet::UNUSED_2
GeoSet::TEXTURE_COORD_0
GeoSet::TEXTURE_COORD_1
GeoSet::TEXTURE_COORD_2
GeoSet::TEXTURE_COORD_3
GeoSet::TEXTURE_COORD_4
GeoSet::TEXTURE_COORD_5
GeoSet::TEXTURE_COORD_6
GeoSet::TEXTURE_COORD_7
The indices listed here are a contiguous set of indices and range from 0 to 15.
Parameters:
attrib  Identifies the target vertex attribute.

size_t nvsg::GeoSet::getNumberOfVertexAttributeData size_t    attrib const [inline]
 

Determine if data is available for a vertex attribute specified by attrib.

Returns:
The number of stored data elements.
Note:
The behavior is undefined when passing an invalid index for attrib. Valid indices are:
GeoSet::VERTEX_POSITION
GeoSet::VERTEX_WEIGHTS
GeoSet::NORMAL
GeoSet::PRIMARY_COLOR
GeoSet::SECONDARY_COLOR
GeoSet::FOG_COORDINATE
GeoSet::UNUSED_1
GeoSet::UNUSED_2
GeoSet::TEXTURE_COORD_0
GeoSet::TEXTURE_COORD_1
GeoSet::TEXTURE_COORD_2
GeoSet::TEXTURE_COORD_3
GeoSet::TEXTURE_COORD_4
GeoSet::TEXTURE_COORD_5
GeoSet::TEXTURE_COORD_6
GeoSet::TEXTURE_COORD_7
The indices listed here are a contiguous set of indices and range from 0 to 15.
Parameters:
attrib  Identifies the target vertex attribute.

NVSG_API void nvsg::GeoSet::setVertexAttributeData size_t    attrib,
unsigned int    fdim,
const float *    fdata,
size_t    count
 

Set data for the vertex attribute specified by attrib.

The function copies fdim * count float values from the location pointed to by fdata to the vertex attribute specified by attrib. Pre-existing data of the specified vertex attribute will be entirely erased.

Note:
The behavior is undefined when passing an invalid index for attrib. Valid indices are:
GeoSet::VERTEX_POSITION
GeoSet::VERTEX_WEIGHTS
GeoSet::NORMAL
GeoSet::PRIMARY_COLOR
GeoSet::SECONDARY_COLOR
GeoSet::FOG_COORDINATE
GeoSet::UNUSED_1
GeoSet::UNUSED_2
GeoSet::TEXTURE_COORD_0
GeoSet::TEXTURE_COORD_1
GeoSet::TEXTURE_COORD_2
GeoSet::TEXTURE_COORD_3
GeoSet::TEXTURE_COORD_4
GeoSet::TEXTURE_COORD_5
GeoSet::TEXTURE_COORD_6
GeoSet::TEXTURE_COORD_7
The indices listed here are a contiguous set of indices and range from 0 to 15.
The behavior is also undefined if either fdim doesn't match the correct dimension, in terms of float, of the data pointed to by fdata, or if fdata is an invalid pointer, or if count exceeds the actual number of source data elements.
Parameters:
attrib  Identifies the target vertex attribute.
fdim  Dimension, in terms of float, of the source data elements.
fdata  Address of source data.
count  Number of source data elements.

NVSG_API void nvsg::GeoSet::setVertexAttributeData size_t    attrib,
unsigned int    fdim,
size_t    pos,
const float *    fdata,
size_t    count
 

Set data for the vertex attribute specified by attrib.

The function copies fdim * count float values from the location pointed to by fdata to the vertex attribute specified by attrib, starting at position pos of the pre-existing vertex data. Pre-existing vertex data in the range [pos, pos + count) will be replaced. Pre-existing data outside this range remains untouched.

If you specify -1 for pos or if pos specifies the number of elements currently stored for the vertex attribute specified by attrib, the data pointed to by fdata will be appended to the pre-existing vertex data.

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

Note:
The behavior is undefined when passing an invalid index for attrib. Valid indices are:
GeoSet::VERTEX_POSITION
GeoSet::VERTEX_WEIGHTS
GeoSet::NORMAL
GeoSet::PRIMARY_COLOR
GeoSet::SECONDARY_COLOR
GeoSet::FOG_COORDINATE
GeoSet::UNUSED_1
GeoSet::UNUSED_2
GeoSet::TEXTURE_COORD_0
GeoSet::TEXTURE_COORD_1
GeoSet::TEXTURE_COORD_2
GeoSet::TEXTURE_COORD_3
GeoSet::TEXTURE_COORD_4
GeoSet::TEXTURE_COORD_5
GeoSet::TEXTURE_COORD_6
GeoSet::TEXTURE_COORD_7
The indices listed here are a contiguous set of indices and range from 0 to 15.
The behavior is also undefined if either fdim doesn't match the correct dimension, in terms of float, of the data element currently stored for the specified vertex attribute, or if fdata is an invalid pointer.
Parameters:
attrib  Identifies the target vertex attribute.
fdim  Dimension, in terms of float, of the source data element.
pos  Position in contigious memory of the vertex attribute's data set.
fdata  Address of source data.
count  Number of source data elements.

size_t nvsg::GeoSet::getNumberOfVertices void    const [inline]
 

Get number of vertices.

Returns:
The number of vertices.
Note:
Calling this function has the same effect as calling getNumberOfVertexAttributeData(VERTEX_POSITION).

const nvmath::Vec3f * nvsg::GeoSet::getVertices void    const [inline]
 

Get vertices.

Returns:
A pointer to the vertices.
Note:
Calling this function has the same effect as calling getVertexAttributeData(VERTEX_POSITION). The only difference is, that this function returns a const Vec3f* rather than a const float* to reflect a vertex position's dimension. One must keep this in mind when it comes to pointer arithmetics!

void nvsg::GeoSet::setVertices const nvmath::Vec3f   verts,
size_t    count
[inline]
 

Set vertices for this GeoSet.

Copies count vertices from the location pointed to by verts into this GeoSet. Pre-existing vertices will be entirely erased.

Note:
The behaviour is undefined if either verts is invalid, or if count exceeds the actual number of vertices stored at verts.
Parameters:
verts  vertices to set
count  number of vertices

void nvsg::GeoSet::setVertices size_t    pos,
const nvmath::Vec3f   verts,
size_t    count
[inline]
 

Set vertices for this GeoSet.

Copies count vertices from the location pointed to by verts into this GeoSet, starting at position pos inside the range of pre-existing vertices. Pre-existing vertices in the range [pos, pos + count) will be replaced. Pre-existing vertices outside this range remain untouched.

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

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

Note:
The behaviour is undefined if either verts is invalid, or if count exceeds the actual number of vertices stored at verts.
Parameters:
pos  Start position inside the range of pre-existing vertices.
verts  Start address of vertices to set.
count  Number of vertices to copy.

size_t nvsg::GeoSet::getNumberOfNormals void    const [inline]
 

Get number of normals.

Returns:
The number of normals.
Note:
Calling this function has the same effect as calling getNumberOfVertexAttributeData(NORMAL).

const nvmath::Vec3f * nvsg::GeoSet::getNormals void    const [inline]
 

Get normals.

Returns:
A pointer to the normals.
Note:
Calling this function has the same effect as calling getVertexAttributeData(NORMAL). The only difference is, that this function returns a const Vec3f* rather than a const float* to reflect a normal's dimension. One must keep this in mind when it comes to pointer arithmetics!

void nvsg::GeoSet::setNormals const nvmath::Vec3f   nor,
size_t    count
[inline]
 

Set normals for this GeoSet.

Copies count normals from the location pointed to by nor into this GeoSet. Pre-existing normals will be entirely erased.

Note:
The behaviour is undefined if either nor is invalid, or if count exceeds the actual number of normals stored at nor.
Parameters:
nor  Address of source normals.
count  Number of normals to set.

Reimplemented in nvsg::SkinnedTriangles.

void nvsg::GeoSet::setNormals size_t    pos,
const nvmath::Vec3f   nor,
size_t    count
[inline]
 

Set normals for this GeoSet.

Copies count normals from the location pointed to by nor into this GeoSet, starting at position pos inside the range of pre-existing normals. Pre-existing normals in the range [pos, pos + count) will be replaced. Pre-existing normals outside this range remain untouched.

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

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

Note:
The behaviour is undefined if either nor is invalid, or if count exceeds the actual number of normals stored at nor.
Parameters:
pos  Start position inside the range of pre-existing normals.
nor  Start address of normals to set.
count  Number of normals to copy.

Reimplemented in nvsg::SkinnedTriangles.

bool nvsg::GeoSet::hasTexCoords void    const [inline]
 

Determine if at least one texture coordinate array has valid texture coordinates.

Returns:
true, if this GeoSet has texture coordinates, false otherwise.

size_t nvsg::GeoSet::getNumberOfTexCoords size_t    texUnit const [inline]
 

Get number of texture coordinates in a specified texture unit.

Returns:
The number of texture coordinates in texture unit texUnit.
Note:
Calling the function has the same effect as calling getNumberOfVertexAttributeData(TEXTURE_COORD_0 + texUnit).
The behavior is undefined if texUnit specifies an invalid index. A valid index ranges from 0 to 7.
Parameters:
texUnit  The zero based index of the texture unit.

const float * nvsg::GeoSet::getTexCoords size_t    texUnit const [inline]
 

Get texture coordinates for a specified texture unit.

Returns:
A pointer to the texture coords.
Note:
Texture coordinates can be either 1, 2, 3, or 4-dimensional in terms of float. Call either getTexCoordDim(texUnit) or getVertexAttributeDataDim(TEXTURE_COORD_0 + texUnit) to determine the dimension of the texture coordinates stored in texture unit texUnit.
The behavior is undefined if texUnit specifies an invalid index. A valid index ranges from 0 to 7.
Parameters:
texUnit  The zero based index of the texture unit.

unsigned int nvsg::GeoSet::getTexCoordsDim size_t    texUnit const [inline]
 

Get the dimension of the texture coordinates stored in the specified texture unit.

The dimension of texture coordinates is meant in terms of floats. Texture coordinates can be either 1, 2, 3, or 4-dimensional.

Returns:
The dimension of the texture coordinates stored in texture unit texUnit. If there are no texture coordinates stored in that texture unit, the function returns 0.
Note:
The behavior is undefined if texUnit specifies an invalid index. A valid index ranges from 0 to 7.
Parameters:
texUnit  The zero based index of the texture unit.

void nvsg::GeoSet::setTexCoords size_t    texUnit,
unsigned int    fdim,
const float *    coords,
size_t    count
[inline]
 

Set the texture coordinates for a specified texture unit.

Copies count texture coordinates of dimension dim from the location pointed to by coords into the texture unit texUnit of this GeoSet.
Valid values for fdim are either 1, 2, 3, or 4. A valid index for texUnit ranges from 0 to 7.

Note:
The behavior is undefined if either texUnit specifies an invalid index, or fdim doesn't match the correct dimension, in terms of float, of the data pointed to by coords, or coords is an invalid pointer, or count exceeds the actual number of source coordinates.
Parameters:
texUnit  The zero based index of the texture unit.
fdim  Dimension of coordinates, in terms of float
coords  Address of source coordinates
count  Number of coordinates to copy

void nvsg::GeoSet::setTexCoords size_t    texUnit,
unsigned int    fdim,
size_t    pos,
const float *    coords,
size_t    count
[inline]
 

Set the texture coordinates for a specified texture unit.

Copies count texture coordinates of dimension dim from the location pointed to by coords into the texture unit texUnit of this GeoSet, starting at position pos inside the range of pre-existing texture coordinates. Valid values for fdim are either 1, 2, 3, or 4. A valid index for texUnit ranges from 0 to 7.

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

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

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

Note:
The behavior is undefined if either texUnit specifies an invalid index, or fdim doesn't match the correct dimension, in terms of float, of the data pointed to by coords, or coords is an invalid pointer, or count exceeds the actual number of source coordinates.
Parameters:
texUnit  The zero based index of the texture unit.
fdim  Dimension of coordinates, in terms of float
pos  Start position inside the range of pre-existing texture coordinates.
coords  Address of source coordinates
count  Number of coordinates to copy

NVSG_API void nvsg::GeoSet::generateTexCoords TextureCoordType    tct,
const nvmath::Sphere3f   sphere,
size_t    tu = 0
 

Generate texture coordinates into a texture unit.

Calculates either spherical, cylindrical, or planar two-dimensional texture coordinates into texture unit tu. The sphere can be either the bounding sphere of this GeoSet to calculate local texture coordinates or some other for non-local texture coordinates.

Parameters:
tct  type of texture coordinates to generate
sphere  bounding sphere to map coordinates to
tu  texture unit to generate the coordinates in

size_t nvsg::GeoSet::getNumberOfColors void    const [inline]
 

Get number of colors.

Returns:
The number of colors.

const float * nvsg::GeoSet::getColors void    const [inline]
 

Get constant pointer to colors.

Note:
It is a mistake to call getColors on a GeoSet that has no colors available. For this reason, the client code should either call hasColors or getNumberOfColors on that GeoSet to ensure that colors are available for that GeoSet.
Returns:
A constant pointer to The colors.

unsigned int nvsg::GeoSet::getColorsDim void    const [inline]
 

Get the dimension of the colors.

The dimension of colors is conveyed in terms of floats. With this in mind, colors can be either 3-dimensional - occupying 3 floating point values per color, or 4-dimensional - occupying 4 floating point values per color.

Returns:
The dimension of the colors stored. If there are no colors stored, the function return 0.

void nvsg::GeoSet::setColors unsigned int    fdim,
const float *    cols,
size_t    count
[inline]
 

Set colors for this GeoSet.

Copies count colors of dimension fdim from the location pointed to by cols to this GeoSet.
Valid values for fdim are 3 and 4.

Note:
The behavior is undefined if either fdim doesn't match the correct dimension, in terms of float, of the colors pointed to by cols, or cols is an invalid pointer, or count exceeds the actual number of source colors.
Parameters:
fdim  Dimension of colors, in terms of float
cols  Address of source colors
count  Number of colors to copy

void nvsg::GeoSet::setColors unsigned int    fdim,
size_t    pos,
const float *    cols,
size_t    count
[inline]
 

Set colors for this GeoSet.

Copies count colors of dimension fdim from the location pointed to by cols to this GeoSet, starting at position pos inside the range of pre-existing colors. Valid values for fdim are 3 and 4.

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

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

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

Note:
The behavior is undefined if either fdim doesn't match the correct dimension, in terms of float, of the colors pointed to by cols, or cols is an invalid pointer, or count exceeds the actual number of source colors.
Parameters:
fdim  Dimension of colors, in terms of float
pos  Start position inside the range of pre-existing colors.
cols  Address of source colors
count  Number of colors to copy

size_t nvsg::GeoSet::getNumberOfSecondaryColors void    const [inline]
 

Get number of secondary colors.

Returns:
The number of secondary colors.

const float * nvsg::GeoSet::getSecondaryColors void    const [inline]
 

Get constant pointer to secondary colors.

Returns:
A pointer to the secondary colors.

unsigned int nvsg::GeoSet::getSecondaryColorsDim void    const [inline]
 

Get the dimension of the secondary colors.

Returns:
The dimension of the secondary colors stored. If there are no secondary colors stored, the function returns 0.

void nvsg::GeoSet::setSecondaryColors unsigned int    fdim,
const float *    cols,
size_t    count
[inline]
 

Set secondary colors for this GeoSet.

Copies count colors of dimension fdim from the location pointed to by cols to this GeoSet.
Valid values for fdim are 3 and 4.

Note:
The behavior is undefined if either fdim doesn't match the correct dimension, in terms of float, of the colors pointed to by cols, or if cols is an invalid pointer, or if count exceeds the actual number of source colors.
Parameters:
fdim  Dimension of colors, in terms of float.
cols  Address of source colors.
count  Number of colors to copy.

void nvsg::GeoSet::setSecondaryColors unsigned int    fdim,
size_t    pos,
const float *    cols,
size_t    count
[inline]
 

Set secondary colors for this GeoSet.

Copies count colors of dimension fdim from the location pointed to by cols to this GeoSet, starting at position pos inside the range of pre-existing colors. Valid values for fdim are 3 and 4.

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

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

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

Note:
The behavior is undefined if either fdim doesn't match the correct dimension, in terms of float, of the colors pointed to by cols, or cols is an invalid pointer, or count exceeds the actual number of source colors.
Parameters:
fdim  Dimension of colors, in terms of float
pos  Start position inside the range of pre-existing colors.
cols  Address of source colors
count  Number of colors to copy

size_t nvsg::GeoSet::getNumberOfFogCoords void    const [inline]
 

Get number of fog coordinates.

Returns:
The number of fog coordinates.

const float * nvsg::GeoSet::getFogCoords void    const [inline]
 

Get fog coordinates.

Returns:
A pointer to the fog coordiantes.

void nvsg::GeoSet::setFogCoords const float *    coords,
size_t    count
[inline]
 

Set the fog coordinates.

Copies count fog coordinates from the location pointed to by coords to this GeoSet.

Note:
The behaviour is undefined if either coords is an invalid pointer, or count exceeds the actual number of source coordinates.
Parameters:
coords  Address of source coordinates.
count  Number of coordinates to copy.

void nvsg::GeoSet::setFogCoords size_t    pos,
const float *    coords,
size_t    count
[inline]
 

Set the fog coordinates.

Copies count fog coordinates from the location pointed to by coords to this GeoSet, starting at position pos inside the range of pre-existing coordinates.

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

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

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

Note:
The behaviour is undefined if either coords is an invalid pointer, or count exceeds the actual number of source coordinates.
Parameters:
pos  Start position inside the range of pre-existing coordinates
coords  Address of source coordinates.
count  Number of coordinates to copy.

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

Interface for calculating tangents and binormals.

The 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

Implemented in nvsg::Quads, nvsg::QuadStrips, nvsg::Triangles, and nvsg::TriStrips.

NVSG_API void nvsg::GeoSet::attachHighlightObject const HighlightObject   pObj = NULL const
 

Will attach pObj as Highlight object for visualization.

Pass NULL to remove any attached object.

const HighlightObject * nvsg::GeoSet::getHighlightObject void    const [inline]
 

Get the currently attached pObj Highlight object for visualization.

Returns:
A pointer to the highlight object.

virtual NVSG_API void nvsg::GeoSet::onSetVertexAttributeData void    [protected, virtual]
 

Vertex attribute data have been changed.

This function gets called from the framework, whenever certain vertex attribute data has been changed. Classes that derive from GeoSet may overload this function to add some necessary work after the vertex attribute data has been changed.

Reimplemented in nvsg::AnimatedQuads, and nvsg::AnimatedTriangles.

virtual NVSG_API void nvsg::GeoSet::invalidateBoundingSphere void    const [protected, virtual]
 

Invalidate the BoundingSphere (of the parent geo node also).

Reimplemented from nvsg::Drawable.


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