NVIDIA Iray API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Leaf nodes

Leaf nodes of the scene graph, for example, geometry, lights, or cameras. More...

Classes

class   mi::IAttribute_vector
  Interface representing an attribute vector for triangle meshes, polygon meshes, and subdivision surfaces. More...
 
class   mi::ICamera
  The camera defines the viewpoint from which the scene is rendered. More...
 
class   mi::IFreeform_surface
  Interface representing a freeform surface. More...
 
class   mi::ISurface
  A surface of a freeform surface. More...
 
class   mi::ICurve
  A curve used by freeform surfaces. More...
 
class   mi::ICurve_segment
  A curve segment used by freeform surfaces. More...
 
class   mi::ITexture_surface
  A texture surface associated with freeform surfaces. More...
 
class   mi::ILight
  Lights are positioned at the coordinate origin of the local light space. More...
 
class   mi::IOn_demand_mesh
  Interface representing an on-demand mesh. More...
 
class   mi::IOn_demand_mesh_callback
  Abstract interface for callbacks used by on-demand meshes. More...
 
class   mi::IOptions
  A scene element that stores scene-specific settings. More...
 
class   mi::IPolygon_connectivity
  A connectivity class for polygon mesh geometry and their attributes. More...
 
class   mi::IPolygon_mesh
  Interface representing a polygon mesh. More...
 
class   mi::ISimple_mesh
  Interface representing the geometry of on-demand meshes. More...
 
class   mi::ISubdivision_surface
  Interface representing a subdivision surface. More...
 
struct   mi::Triangle_point_indices_struct
  A triangle defined by three point indices, starting at index 0. More...
 
class   mi::Triangle_point_indices
  A triangle defined by three point indices, starting at index 0. More...
 
class   mi::ITriangle_connectivity
  A connectivity class for triangle mesh geometry and their attributes. More...
 
class   mi::ITriangle_mesh
  Interface representing a triangle mesh. More...
 

Enumerations

enum   mi::Mesh_attribute_name { ,
  mi::ATTR_NORMAL = 1,
  mi::ATTR_MOTION = 2,
  mi::ATTR_DERIVATIVES = 3,
  mi::ATTR_MATERIAL_INDEX = 4,
  mi::ATTR_TEXTURE = 6,
  mi::ATTR_TEXTURE_NUM = 256,
  mi::ATTR_MAX = ATTR_TEXTURE + ATTR_TEXTURE_NUM
}
  Symbolic constants for mesh attributes. More...
 
enum   mi::Connectivity_map_type { mi::CONNECTIVITY_MAP_GENERIC }
  Symbolic constants for different connectivity types. More...
 
enum   mi::Basis_type {
  mi::BASIS_BEZIER = 0,
  mi::BASIS_BSPLINE = 1
}
  Different basis types that are supported by freeform surfaces. More...
 
enum   mi::Parameter_space_dimension {
  mi::DIMENSION_U = 0,
  mi::DIMENSION_V = 1
}
  Distinguishes the two dimensions of the parameter space of freeform surfaces. More...
 
enum   mi::Curve_type {
  mi::TRIM_CURVE = 0,
  mi::HOLE_CURVE = 1
}
  Different curve types that are supported by freeform surfaces. More...
 
enum   mi::Light_type {
  mi::LIGHT_POINT = 0,
  mi::LIGHT_SPOT,
  mi::LIGHT_INFINITE,
  mi::LIGHT_PLANAR,
  mi::N_LIGHT_TYPES
}
  Supported light types. More...
 
enum   mi::Light_area_shape {
  mi::AREA_NONE = 0,
  mi::AREA_RECTANGLE,
  mi::AREA_DISC,
  mi::AREA_SPHERE,
  mi::AREA_CYLINDER,
  mi::N_AREA_TYPES
}
  Supported area light shapes. More...
 
enum   mi::Vertex_feature {
  mi::SMOOTH_VERTEX = 0,
  mi::CORNER_VERTEX = 1
}
  Vertex features. More...
 

Functions

  mi::Triangle_point_indices::Triangle_point_indices ()
  The default triangle has all three indices set to zero. More...
 
  mi::Triangle_point_indices::Triangle_point_indices (Uint32 e1, Uint32 e2, Uint32 e3)
  Constructs triangle from three point indices. More...
 
  mi::Triangle_point_indices::Triangle_point_indices (const Triangle_point_indices_struct &other)
  Constructs triangle from underlying storage class. More...
 
Uint32 &  mi::Triangle_point_indices::operator[] (Uint32 i)
  Returns the i -th point index, where 0 <= i <= 2. More...
 
const Uint32 &  mi::Triangle_point_indices::operator[] (Uint32 i) const
  Returns the i -th point index, where 0 <= i <= 2. More...
 
int  mi::Triangle_point_indices::compare (const Triangle_point_indices &other) const
  Compares two triangles lexicographically. More...
 
bool  mi::Triangle_point_indices::operator== (const Triangle_point_indices &other) const
  Equality comparison. More...
 
bool  mi::Triangle_point_indices::operator!= (const Triangle_point_indices &other) const
  Inequality comparison. More...
 
bool  mi::Triangle_point_indices::operator< (const Triangle_point_indices &other) const
  Returns true if *this is less than other. More...
 
bool  mi::Triangle_point_indices::operator<= (const Triangle_point_indices &other) const
  Returns true if *this is less than or equal to other. More...
 
bool  mi::Triangle_point_indices::operator> (const Triangle_point_indices &other) const
  Returns true if *this is greater than other. More...
 
bool  mi::Triangle_point_indices::operator>= (const Triangle_point_indices &other) const
  Returns true if *this is greater than or equal to other. More...
 

Methods related to the mapping represented by the connectivity

virtual Uint32  mi::ITriangle_connectivity::triangles_size () const =0
  Returns the number of triangles. More...
 
virtual Sint32  mi::ITriangle_connectivity::set_triangle_indices (Triangle_handle_struct t, const Uint32 *indices)=0
  Sets the vertex indices of a triangle. More...
 
virtual Sint32  mi::ITriangle_connectivity::set_triangle_indices (Triangle_handle_struct t, Uint32 v0, Uint32 v1, Uint32 v2)=0
  Sets the vertex indices of a triangle. More...
 
virtual Sint32  mi::ITriangle_connectivity::set_triangle_indices (Triangle_handle_struct t, const Triangle_point_indices_struct &triangle)=0
  Sets the vertex indices of a triangle. More...
 
virtual Uint32  mi::ITriangle_connectivity::get_triangle_index (Triangle_handle_struct t, Uint32 vertex) const =0
  Returns the index at the vertex vertex of triangle t. More...
 
virtual
Triangle_point_indices_struct 
mi::ITriangle_connectivity::triangle_point_indices (Triangle_handle_struct t) const =0
  Returns the indices for all three vertices of triangle t. More...
 
virtual bool  mi::ITriangle_connectivity::is_valid_connectivity () const =0
  Indicates whether this connectivity is valid. More...
 

Methods related to the attached mesh attributes

virtual bool  mi::ITriangle_connectivity::has_attribute (Mesh_attribute_name name) const =0
  Indicates whether the connectivity has a particular mesh attribute. More...
 
virtual IAttribute_vector *  mi::ITriangle_connectivity::create_attribute_vector (Mesh_attribute_name name, Uint32 dim=1) const =0
  Creates a non-per-primitive mesh attribute. More...
 
virtual const IAttribute_vector *  mi::ITriangle_connectivity::access_attribute_vector (Mesh_attribute_name name) const =0
  Returns a per-primitive mesh attribute. More...
 
virtual IAttribute_vector *  mi::ITriangle_connectivity::edit_attribute_vector (Mesh_attribute_name name)=0
  Detaches and returns a per-primitive mesh attribute. More...
 
virtual Sint32  mi::ITriangle_connectivity::attach_attribute_vector (IAttribute_vector *attr)=0
  Attaches a given per-primitive mesh attribute to the mesh. More...
 

Miscellaneous methods

virtual Connectivity_map_type  mi::ITriangle_connectivity::get_map_type () const =0
  Returns the type of the connectivity. More...
 

Detailed Description

Leaf nodes of the scene graph, for example, geometry, lights, or cameras.

Enumeration Type Documentation

Different basis types that are supported by freeform surfaces.

Enumerator
BASIS_BEZIER 

Represents a Bezier basis.

BASIS_BSPLINE 

Represents a B-spline basis.

Symbolic constants for different connectivity types.

Connectivities may come in different types. Currently, there is only one type.

See Also
mi::ITriangle_mesh::create_connectivity()
mi::IPolygon_mesh::create_connectivity()
Enumerator
CONNECTIVITY_MAP_GENERIC 

A generic connectivity allows to map the vertices of every polygon to arbitrary indices.

These indices either represents points (for the mesh connectivity) or elements of the attribute vector (for custom connectivities).

Different curve types that are supported by freeform surfaces.

Enumerator
TRIM_CURVE 

A trim curve cuts away all parts of the surface outside the curve.

HOLE_CURVE 

A hole curve cuts away all parts of the surface inside the curve.

Supported area light shapes.

See Also
mi::ILight::get_area_shape()
mi::ILight::set_area_shape()
Enumerator
AREA_NONE 

not an area light

AREA_RECTANGLE 

rectangular shape

AREA_DISC 

disc shape

AREA_SPHERE 

sphere shape

AREA_CYLINDER 

cylinder shape

N_AREA_TYPES 

number of defined area types

Supported light types.

See Also
mi::ILight::get_type()
mi::ILight::set_type()
Enumerator
LIGHT_POINT 

emits in all directions from origin

LIGHT_SPOT 

like point but with direction/spread

LIGHT_INFINITE 

no origin, all light rays parallel

LIGHT_PLANAR 

rays are parallel from plane at origin

N_LIGHT_TYPES 

number of defined light types

Symbolic constants for mesh attributes.

Mesh attributes are an extension of the regular attributes (see mi::IAttribute_set). They are only supported for scene elements that represent geometry, namely triangle meshes, polygon meshes, subdivision surfaces, and freeform surfaces. In contrast to regular attributes which exist only once per object, mesh attributes are always a vector of values with one vector element per primitive, per point, or per vertex. Note that a vector element in itself can be an array.

Mesh attributes are identified by the symbolic names of this enum. Note that there are mi::ATTR_TEXTURE_NUM mesh attributes for texture spaces, but not all values exist as explicit enum values. In order to use these textures spaces, you need to cast the corresponding integer in the range mi::ATTR_TEXTURE to mi::ATTR_TEXTURE + mi::ATTR_TEXTURE_NUM - 1 to mi::Mesh_attribute_name.

One mesh attribute, mi::ATTR_MATERIAL_INDEX, stores one vector element per primitive. That is, there is one material index for each triangle, quad, or polygon of the mesh. This attribute can be created, accessed, and edited directly from the corresponding mesh interfaces.

The remaining attributes store one vector element either per point or per vertex of the mesh. These attributes cannot be created, accessed, and edited directly from the corresponding mesh interfaces, only from a connectivity (either from the mesh connectivity, or from a custom connectivity). The connectivity maps each vertex of the mesh to an index which is used to look up the corresponding vector element. If the mesh connectivity is used, the attribute vector stores one element per point (since the mesh connectivity already defines the mapping of vertices to points). For a custom connectivity, the attribute vector allows to store one element per vertex (possibly sharing values between vertices as defined by the connectivity).

See Also
mi::ITriangle_mesh::create_attribute_vector()
mi::IPolygon_mesh::create_attribute_vector()
mi::ITriangle_connectivity::create_attribute_vector()
mi::IPolygon_connectivity::create_attribute_vector()
mi::IAttribute_vector
Enumerator
ATTR_NORMAL 

Surface normals of type mi::Float32_3 per point or per vertex.

ATTR_MOTION 

Motion vectors of type mi::Float32_3[] per point or per vertex.

The array size is chosen when the attribute vector is created.

ATTR_DERIVATIVES 

Surface derivatives of type mi::Float32_3[2] per point or per vertex.

ATTR_MATERIAL_INDEX 

Material index of type mi::Uint32 per primitive.

ATTR_TEXTURE 

Texture coordinates of type mi::Float32[] per point or per vertex (also called texture space).

The array size is chosen when the attribute vector is created.

Note
Texture spaces need to use consecutive mesh attribute IDs starting with mi::ATTR_TEXTURE.
ATTR_TEXTURE_NUM 

Total number of supported texture spaces.

ATTR_MAX 

Maximum legal attribute number + 1.

Distinguishes the two dimensions of the parameter space of freeform surfaces.

Enumerator
DIMENSION_U 

Represents the U-dimension of the parameter space.

DIMENSION_V 

Represents the V-dimension of the parameter space.

Vertex features.

Currently, two vertex features are supported, smooth vertices (the default) and corners.

See Also
mi::ISubdivision_surface::set_vertex_feature()
mi::ISubdivision_surface::get_vertex_feature()
Enumerator
SMOOTH_VERTEX 

the vertex is smooth (the default)

CORNER_VERTEX 

the vertex is a corner

Function Documentation

virtual const IAttribute_vector* mi::ITriangle_connectivity::access_attribute_vector ( Mesh_attribute_name  name) const
pure virtual

Returns a per-primitive mesh attribute.

Parameters
name The name of the attribute, see Mesh_attribute_name. The attribute must not be a per-primitive attribute.
Returns
The requested attribute vector, or NULL in case of failure.
virtual Sint32 mi::ITriangle_connectivity::attach_attribute_vector ( IAttribute_vector attr)
pure virtual

Attaches a given per-primitive mesh attribute to the mesh.

The attribute vector must not be used any longer after it has been attached.

See Also
create_attribute_vector(), edit_attribute_vector()
Returns
  • 0: Success.
  • -1: Invalid parameters (NULL pointer).
  • -2: The attribute vector has not been acquired from this connectivity.
  • -3: An attribute of the same name is already attached to the mesh (or to one of its connectivities).
  • -4: The connectivity is invalid.
  • -5: The attribute vector is too small for this connectivity.
int mi::Triangle_point_indices::compare ( const Triangle_point_indices other) const
inline

Compares two triangles lexicographically.

Returns
-1 if *this is less than other, 0 if *this is equal to other, or +1 if *this is greater than other.
virtual IAttribute_vector* mi::ITriangle_connectivity::create_attribute_vector ( Mesh_attribute_name  name,
Uint32  dim = 1 
) const
pure virtual

Creates a non-per-primitive mesh attribute.

The attribute is not yet attached to the connectivity. It needs to be attached before it is released.

See Also
attach_attribute_vector()
Parameters
name The name of the attribute, see Mesh_attribute_name. The attribute must not be a per-primitive attribute.
dim Dimension of an attribute value. Only used for those attributes that have user specifiable dimensions.
Returns
The requested attribute vector, or NULL in case of failure.
virtual IAttribute_vector* mi::ITriangle_connectivity::edit_attribute_vector ( Mesh_attribute_name  name)
pure virtual

Detaches and returns a per-primitive mesh attribute.

The attribute needs to be reattached before it is released. Otherwise, the attribute is effectively removed from the connectivity.

See Also
attach_attribute_vector()
Parameters
name The name of the attribute, see Mesh_attribute_name. The attribute must not be a per-primitive attribute.
Returns
The requested attribute vector, or NULL in case of failure.
virtual Connectivity_map_type mi::ITriangle_connectivity::get_map_type ( ) const
pure virtual

Returns the type of the connectivity.

Currently, only one type is supported.

virtual Uint32 mi::ITriangle_connectivity::get_triangle_index ( Triangle_handle_struct  t,
Uint32  vertex 
) const
pure virtual

Returns the index at the vertex vertex of triangle t.

Returns
The requested vertex index, or 0 if t is out of bounds, or vertex is not in the range [0,3).
virtual bool mi::ITriangle_connectivity::has_attribute ( Mesh_attribute_name  name) const
pure virtual

Indicates whether the connectivity has a particular mesh attribute.

Parameters
name The attribute to query.
Returns
true if the connectivity has this attribute, false otherwise.
virtual bool mi::ITriangle_connectivity::is_valid_connectivity ( ) const
pure virtual

Indicates whether this connectivity is valid.

A connectivity becomes invalid after it has been (re)attached to the corresponding mesh and may no longer been used.

bool mi::Triangle_point_indices::operator!= ( const Triangle_point_indices other) const
inline

Inequality comparison.

bool mi::Triangle_point_indices::operator< ( const Triangle_point_indices other) const
inline

Returns true if *this is less than other.

bool mi::Triangle_point_indices::operator<= ( const Triangle_point_indices other) const
inline

Returns true if *this is less than or equal to other.

bool mi::Triangle_point_indices::operator== ( const Triangle_point_indices other) const
inline

Equality comparison.

bool mi::Triangle_point_indices::operator> ( const Triangle_point_indices other) const
inline

Returns true if *this is greater than other.

bool mi::Triangle_point_indices::operator>= ( const Triangle_point_indices other) const
inline

Returns true if *this is greater than or equal to other.

Uint32& mi::Triangle_point_indices::operator[] ( Uint32  i)
inline

Returns the i -th point index, where 0 <= i <= 2.

const Uint32& mi::Triangle_point_indices::operator[] ( Uint32  i) const
inline

Returns the i -th point index, where 0 <= i <= 2.

virtual Sint32 mi::ITriangle_connectivity::set_triangle_indices ( Triangle_handle_struct  t,
const Uint32 indices 
)
pure virtual

Sets the vertex indices of a triangle.

Parameters
t The triangle to modify.
indices The new indices for triangle t.
Returns
  • 0: Success.
  • -1: Invalid parameters (NULL pointer).
  • -3: t is out of bounds.
  • -4: The connectivity is no longer valid.
virtual Sint32 mi::ITriangle_connectivity::set_triangle_indices ( Triangle_handle_struct  t,
Uint32  v0,
Uint32  v1,
Uint32  v2 
)
pure virtual

Sets the vertex indices of a triangle.

Parameters
t The triangle to modify.
v0 The first new index of triangle t.
v1 The second new index of triangle t.
v2 The third new index of triangle t.
Returns
  • 0: Success.
  • -3: t is out of bounds.
  • -4: The connectivity is no longer valid.
virtual Sint32 mi::ITriangle_connectivity::set_triangle_indices ( Triangle_handle_struct  t,
const Triangle_point_indices_struct triangle 
)
pure virtual

Sets the vertex indices of a triangle.

Parameters
t The triangle to modify.
triangle The new indices for triangle t.
Returns
  • 0: Success.
  • -3: t is out of bounds.
  • -4: The connectivity is no longer valid.
mi::Triangle_point_indices::Triangle_point_indices ( )
inline

The default triangle has all three indices set to zero.

mi::Triangle_point_indices::Triangle_point_indices ( Uint32  e1,
Uint32  e2,
Uint32  e3 
)
inline

Constructs triangle from three point indices.

mi::Triangle_point_indices::Triangle_point_indices ( const Triangle_point_indices_struct other)
inline

Constructs triangle from underlying storage class.

virtual Triangle_point_indices_struct mi::ITriangle_connectivity::triangle_point_indices ( Triangle_handle_struct  t) const
pure virtual

Returns the indices for all three vertices of triangle t.

Returns
The requested indices, or a defaulted constructed return value if t is out of bounds.
virtual Uint32 mi::ITriangle_connectivity::triangles_size ( ) const
pure virtual

Returns the number of triangles.