#include <GeoSet.h>
Inheritance diagram for nvsg::GeoSet:
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::Sphere3f & | getBoundingSphere (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::Vec3f * | getVertices (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::Vec3f * | getNormals (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 HighlightObject * | getHighlightObject (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 |
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 ...).
|
Vertex Attribute Register Numbers. These represent valid indices identifying a certain vertex attribute. |
|
Instantiate a default constructed GeoSet object.
|
|
Instantiate a copy of the GeoSet refered to by rhs.
|
|
Protected destructor to prevent explicit creation on stack.
|
|
Determine whether the data of this object is shared.
Reimplemented from nvsg::Drawable. Reimplemented in nvsg::AnimatedQuads, nvsg::AnimatedTriangles, nvsg::Quads, nvsg::QuadStrips, nvsg::SkinnedTriangles, nvsg::Triangles, and nvsg::TriStrips. |
|
Get the DataID of the data of this object.
Reimplemented from nvsg::Drawable. Reimplemented in nvsg::AnimatedQuads, nvsg::AnimatedTriangles, nvsg::Quads, nvsg::QuadStrips, nvsg::SkinnedTriangles, nvsg::Triangles, and nvsg::TriStrips. |
|
Ask if the bounding sphere of this GeoSet is valid. If the bounding sphere isn't valid, it is tried to validate it.
Implements nvsg::Drawable. |
|
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.
Implements nvsg::Drawable. |
|
Get amount of data bytes currently stored in the vertex attribute specified by attrib.
|
|
Get float data stored in the vertex attribute specified by attrib.
|
|
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.
|
|
Determine if data is available for a vertex attribute specified by attrib.
|
|
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.
|
|
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!
|
|
Get number of vertices.
|
|
Get vertices.
|
|
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.
|
|
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!
|
|
Get number of normals.
|
|
Get normals.
|
|
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.
Reimplemented in nvsg::SkinnedTriangles. |
|
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!
Reimplemented in nvsg::SkinnedTriangles. |
|
Determine if at least one texture coordinate array has valid texture coordinates.
|
|
Get number of texture coordinates in a specified texture unit.
|
|
Get texture coordinates for a specified texture unit.
|
|
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.
|
|
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.
|
|
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!
|
|
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.
|
|
Get number of colors.
|
|
Get constant pointer to colors.
|
|
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.
|
|
Set colors for this GeoSet.
Copies count colors of dimension fdim from the location pointed to by cols to this GeoSet.
|
|
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!
|
|
Get number of secondary colors.
|
|
Get constant pointer to secondary colors.
|
|
Get the dimension of the secondary colors.
|
|
Set secondary colors for this GeoSet.
Copies count colors of dimension fdim from the location pointed to by cols to this GeoSet.
|
|
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!
|
|
Get number of fog coordinates.
|
|
Get fog coordinates.
|
|
Set the fog coordinates. Copies count fog coordinates from the location pointed to by coords to this GeoSet.
|
|
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!
|
|
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.
Implemented in nvsg::Quads, nvsg::QuadStrips, nvsg::Triangles, and nvsg::TriStrips. |
|
Will attach pObj as Highlight object for visualization. Pass NULL to remove any attached object. |
|
Get the currently attached pObj Highlight object for visualization.
|
|
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. |
|
Invalidate the BoundingSphere (of the parent geo node also).
Reimplemented from nvsg::Drawable. |