NVIDIA IndeX API nvidia_logo_transpbg.gif Up
nv::index::ITriangle_mesh_subset Class Referenceabstract

Defines the vertices and per-vertex attributes of a subset of a triangle mesh. More...

#include <itriangle_mesh_subset.h>

Inherits mi::base::Interface_declare< 0x19fa1bbf, ... >.

Public Types

enum  Triflags
 Triangle flags. More...
 

Public Member Functions

virtual bool initialize (const mi::math::Bbox_struct< mi::Float32, 3 > &bounding_box, const mi::math::Vector_struct< mi::Float32, 3 > *vertices, mi::Uint32 nb_vertices, const mi::Uint32 *vertex_indices, mi::Uint32 nb_indices, const mi::Uint64 *global_triangle_ids, mi::Uint64 nb_global_triangle_ids, const mi::math::Vector_struct< mi::Float32, 3 > *normals=0, mi::Uint32 nb_normals=0, const mi::math::Vector_struct< mi::Float32, 2 > *texture_coordinates=0, mi::Uint32 nb_texture_coordinates=0, const mi::math::Color_struct *colors=0, mi::Uint32 nb_colors=0, const mi::Uint32 *normal_indices=0, const mi::Uint32 *tex_coord_indices=0, const mi::Uint32 *color_indices=0, const mi::Uint32 *colormap_indices=0, const mi::Uint16 *materials=0, mi::Uint32 nb_materials=0, const ITriangle_mesh_subset::Triflags *triangle_flags=0, mi::Uint32 nb_triangle_flags=0)=0
 Initializes the triangle mesh subset by assigning vertices and per-vertex attributes. More...
 
virtual mi::Uint32 get_nb_triangles () const =0
 Returns the number of triangles in the sub-mesh. More...
 
virtual mi::Uint32 get_nb_vertices () const =0
 Returns the number of vertices. More...
 
virtual const mi::math::Vector_struct< mi::Float32, 3 > * get_vertices () const =0
 Returns the vertex position array. More...
 
virtual const mi::Uint32 * get_vertex_indices () const =0
 Returns the tri-vertex to vertex position index array. More...
 
virtual mi::Uint32 get_nb_normals () const =0
 Returns the number of vertex normals. More...
 
virtual const mi::math::Vector_struct< mi::Float32, 3 > * get_normals () const =0
 Returns the vertex normals array. More...
 
virtual const mi::Uint32 * get_normal_indices () const =0
 Returns the tri-vertex to normal index array. More...
 
virtual mi::Uint32 get_nb_texture_coordinates () const =0
 Returns the number of texture coordinates. More...
 
virtual const mi::math::Vector_struct< mi::Float32, 2 > * get_texture_coordinates () const =0
 Returns the vertex texture coordinate array. More...
 
virtual const mi::Uint32 * get_texture_coordinate_indices () const =0
 Returns the tri-vertex to texture coordinate index array. More...
 
virtual mi::Uint32 get_nb_colors () const =0
 Returns the number of colors. More...
 
virtual const mi::math::Color_struct * get_colors () const =0
 Returns the vertex color array. More...
 
virtual const mi::Uint32 * get_color_indices () const =0
 Returns the tri-vertex to color index. More...
 
virtual const mi::Uint32 * get_colormap_indices () const =0
 Returns the tri-vertex to colormap index array. More...
 
virtual mi::Uint32 get_nb_materials () const =0
 Returns the number of materials. More...
 
virtual const mi::Uint16 * get_materials () const =0
 Returns the triangle materials. More...
 
virtual mi::Uint32 get_nb_triangle_flags () const =0
 Returns the number of triangle flags. More...
 
virtual const ITriangle_mesh_subset::Triflagsget_triangle_flags () const =0
 Returns the triangle flags. More...
 
virtual const mi::Uint64 * get_global_triangle_ids () const =0
 Returns the IDs of the triangles in the sub-mesh. More...
 
virtual const mi::math::Bbox_struct< mi::Float32, 3 > & get_bounding_box () const =0
 Returns the bounding box of the sub-mesh. More...
 

Detailed Description

Defines the vertices and per-vertex attributes of a subset of a triangle mesh.

Member Enumeration Documentation

 Triflags

Triangle flags.

Specifies edge visibility for a given triangle with vertices (p0, p1, p2) and edges (e01, e12, e20). This is used by get_edge_flags() when an IWireframe_rendering_style attribute is used with the mesh.

Member Function Documentation

 get_bounding_box()

virtual const mi::math::Bbox_struct< mi::Float32, 3 > & nv::index::ITriangle_mesh_subset::get_bounding_box ( ) const
pure virtual

Returns the bounding box of the sub-mesh.

Returns
Bounding box in the local coordinate system.

 get_color_indices()

virtual const mi::Uint32 * nv::index::ITriangle_mesh_subset::get_color_indices ( ) const
pure virtual

Returns the tri-vertex to color index.

The array length is number of triangles * 3.

Returns
Tri-vertex to color index array

 get_colormap_indices()

virtual const mi::Uint32 * nv::index::ITriangle_mesh_subset::get_colormap_indices ( ) const
pure virtual

Returns the tri-vertex to colormap index array.

The array length is number of triangles * 3.

Returns
Tri-vertex to colormap index array, or 0

 get_colors()

virtual const mi::math::Color_struct * nv::index::ITriangle_mesh_subset::get_colors ( ) const
pure virtual

Returns the vertex color array.

Returns
Vertex color array

 get_global_triangle_ids()

virtual const mi::Uint64 * nv::index::ITriangle_mesh_subset::get_global_triangle_ids ( ) const
pure virtual

Returns the IDs of the triangles in the sub-mesh.

The array length is number of triangles.

Returns
Triangle ID array

 get_materials()

virtual const mi::Uint16 * nv::index::ITriangle_mesh_subset::get_materials ( ) const
pure virtual

Returns the triangle materials.

Returns
Material array

 get_nb_colors()

virtual mi::Uint32 nv::index::ITriangle_mesh_subset::get_nb_colors ( ) const
pure virtual

Returns the number of colors.

Returns
Length of the vertex color array

 get_nb_materials()

virtual mi::Uint32 nv::index::ITriangle_mesh_subset::get_nb_materials ( ) const
pure virtual

Returns the number of materials.

Returns
Length of the material array

 get_nb_normals()

virtual mi::Uint32 nv::index::ITriangle_mesh_subset::get_nb_normals ( ) const
pure virtual

Returns the number of vertex normals.

Returns
Length of the vertex normal array

 get_nb_texture_coordinates()

virtual mi::Uint32 nv::index::ITriangle_mesh_subset::get_nb_texture_coordinates ( ) const
pure virtual

Returns the number of texture coordinates.

Returns
Length of the texture coordinate array

 get_nb_triangle_flags()

virtual mi::Uint32 nv::index::ITriangle_mesh_subset::get_nb_triangle_flags ( ) const
pure virtual

Returns the number of triangle flags.

Returns
Length of the triangle flag array

 get_nb_triangles()

virtual mi::Uint32 nv::index::ITriangle_mesh_subset::get_nb_triangles ( ) const
pure virtual

Returns the number of triangles in the sub-mesh.

Returns
Number of triangles

 get_nb_vertices()

virtual mi::Uint32 nv::index::ITriangle_mesh_subset::get_nb_vertices ( ) const
pure virtual

Returns the number of vertices.

Returns
Length of the vertex position array

 get_normal_indices()

virtual const mi::Uint32 * nv::index::ITriangle_mesh_subset::get_normal_indices ( ) const
pure virtual

Returns the tri-vertex to normal index array.

The array length is number of triangles * 3.

Returns
Tri-vertex to normal index array

 get_normals()

virtual const mi::math::Vector_struct< mi::Float32, 3 > * nv::index::ITriangle_mesh_subset::get_normals ( ) const
pure virtual

Returns the vertex normals array.

Returns
Vertex normal array

 get_texture_coordinate_indices()

virtual const mi::Uint32 * nv::index::ITriangle_mesh_subset::get_texture_coordinate_indices ( ) const
pure virtual

Returns the tri-vertex to texture coordinate index array.

The array length is number of triangles * 3.

Returns
Tri-vertex to texture coordinate index array

 get_texture_coordinates()

virtual const mi::math::Vector_struct< mi::Float32, 2 > * nv::index::ITriangle_mesh_subset::get_texture_coordinates ( ) const
pure virtual

Returns the vertex texture coordinate array.

Returns
Vertex texture coordinate array

 get_triangle_flags()

virtual const ITriangle_mesh_subset::Triflags * nv::index::ITriangle_mesh_subset::get_triangle_flags ( ) const
pure virtual

Returns the triangle flags.

Returns
Triangle flag array

 get_vertex_indices()

virtual const mi::Uint32 * nv::index::ITriangle_mesh_subset::get_vertex_indices ( ) const
pure virtual

Returns the tri-vertex to vertex position index array.

The array length is number of triangles * 3.

Returns
Tri-vertex to vertex position index array

 get_vertices()

virtual const mi::math::Vector_struct< mi::Float32, 3 > * nv::index::ITriangle_mesh_subset::get_vertices ( ) const
pure virtual

Returns the vertex position array.

Returns
Vertex position array

 initialize()

virtual bool nv::index::ITriangle_mesh_subset::initialize ( const mi::math::Bbox_struct< mi::Float32, 3 > &  bounding_box,
const mi::math::Vector_struct< mi::Float32, 3 > *  vertices,
mi::Uint32  nb_vertices,
const mi::Uint32 *  vertex_indices,
mi::Uint32  nb_indices,
const mi::Uint64 *  global_triangle_ids,
mi::Uint64  nb_global_triangle_ids,
const mi::math::Vector_struct< mi::Float32, 3 > *  normals = 0,
mi::Uint32  nb_normals = 0,
const mi::math::Vector_struct< mi::Float32, 2 > *  texture_coordinates = 0,
mi::Uint32  nb_texture_coordinates = 0,
const mi::math::Color_struct *  colors = 0,
mi::Uint32  nb_colors = 0,
const mi::Uint32 *  normal_indices = 0,
const mi::Uint32 *  tex_coord_indices = 0,
const mi::Uint32 *  color_indices = 0,
const mi::Uint32 *  colormap_indices = 0,
const mi::Uint16 *  materials = 0,
mi::Uint32  nb_materials = 0,
const ITriangle_mesh_subset::Triflags triangle_flags = 0,
mi::Uint32  nb_triangle_flags = 0 
)
pure virtual

Initializes the triangle mesh subset by assigning vertices and per-vertex attributes.

When an array is provided (e.g. normals or texture_coordinates), but its index array (normal_indices, tex_coord_indices) is 0, then the vertex index array (vertex_indices) will be used instead. This way, you can share the attribute index map.

The arrays that map a triangle index to an attribute index are all separate.

Parameters
[in]bounding_boxbounding box of the sub-mesh (required)
[in]verticesvertex position array (required)
[in]nb_verticesvertex position array size (required)
[in]vertex_indicestri-vertex to vertex index array (required)
[in]nb_indicesindex array size (required)
[in]global_triangle_idsglobal triangle ID array (required)
[in]nb_global_triangle_idsglobal triangle ID array size (required)
[in]normalsvertex normal array (optional)
[in]nb_normalsvertex normal array size (optional)
[in]texture_coordinatesvertex texture coordinate array (optional)
[in]nb_texture_coordinatesvertex texture coordinate array size (optional)
[in]colorsvertex color value array (optional)
[in]nb_colorsvertex color value array size (optional)
[in]normal_indicestri-vertex to normal index array (optional)
[in]tex_coord_indicestri-vertex to texture coordinate index array (optional)
[in]color_indicestri-vertex to color value index array (optional)
[in]colormap_indicestri-vertex to colormap index array (optional)
[in]materialstriangle material array (optional)
[in]nb_materialstriangle material array size (optional)
[in]triangle_flagstriangle flag array (optional)
[in]nb_triangle_flagstriangle flag array size (optional)
Returns
True when initialization succeeded.

The documentation for this class was generated from the following file: