NVIDIA Iray SDK API nvidia_logo_transpbg.gif Up
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
mi::neuraylib::IOn_demand_mesh Class Referenceabstract

Interface representing an on-demand mesh. More...

Inheritance diagram for mi::neuraylib::IOn_demand_mesh:
mi::base::Interface_declare< 0x0c1cb14f, 0x985a, 0x426e, 0xa3, 0x79, 0xa7, 0xf5, 0x62, 0x60, 0xd6, 0x8d, neuraylib::IScene_element > mi::neuraylib::IScene_element mi::base::Interface_declare< 0x8a2a4da9, 0xe323, 0x452c, 0xb8, 0xda, 0x92, 0x45, 0x67, 0x85, 0xd7, 0x78, neuraylib::IAttribute_set > mi::neuraylib::IAttribute_set mi::base::Interface_declare< 0x1bcb8d48, 0x10c1, 0x4b3e, 0x9b, 0xfa, 0x06, 0x23, 0x61, 0x81, 0xd3, 0xe1 > mi::base::IInterface

Public Member Functions

virtual void set_callback (IOn_demand_mesh_callback *callback)=0
 Sets the callback that returns the actual mesh. More...
 
virtual const
IOn_demand_mesh_callback
get_callback () const =0
 Returns the stored callback. More...
 
Methods related to the bounding box
virtual void set_bbox (const Bbox3_struct &bbox)=0
 Sets the bounding box of the on-demand mesh. More...
 
virtual Bbox3_struct get_bbox () const =0
 Returns the bounding box of the on-demand mesh. More...
 
virtual Bbox3_struct get_tight_bbox (const Float64_4_4_struct &transformation_matrix) const =0
 Returns the bounding box of the on-demand mesh after transformation. More...
 
Methods related to displacement
virtual void set_maximum_displacement (Float32 displacement)=0
 Sets the maximum displacement of the on-demand mesh. More...
 
virtual Float32 get_maximum_displacement () const =0
 Returns the maximum displacement of the on-demand mesh. More...
 

Additional Inherited Members

- Public Types inherited from mi::base::Interface_declare< 0x0c1cb14f, 0x985a, 0x426e, 0xa3, 0x79, 0xa7, 0xf5, 0x62, 0x60, 0xd6, 0x8d, neuraylib::IScene_element >
typedef Interface_declare< id1,
id2, id3, id4, id5, id6, id7,
id8, id9, id10, id11,
neuraylib::IScene_element
Self
 Own type. More...
 
typedef Uuid_t< id1, id2, id3,
id4, id5, id6, id7, id8, id9,
id10, id11 > 
IID
 Declares the interface ID (IID) of this interface. More...
 
- Static Public Member Functions inherited from mi::base::Interface_declare< 0x0c1cb14f, 0x985a, 0x426e, 0xa3, 0x79, 0xa7, 0xf5, 0x62, 0x60, 0xd6, 0x8d, neuraylib::IScene_element >
static bool compare_iid (const Uuid &iid)
 Compares the interface ID iid against the interface ID of this interface and of its ancestors. More...
 

Detailed Description

Interface representing an on-demand mesh.

On-demand meshes are scene elements representing geometry. Basically they also describe triangle meshes (see mi::neuraylib::ITriangle_mesh), just in a much simpler format. In contrast to all other scene elements representing geometry, on-demand meshes do not store the geometry.

Instead, on-demand meshes use a user-specified callback to provide the geometry when needed. The geometry data might already exist in the application in a format that can be used directly (see mi::neuraylib::ISimple_mesh). In this case a simple adaptor exposing that data in the expected format is sufficient, and another copy of the geometry can be avoided.

Even if the geometry data does not yet exist in the application in a format that can be used directly there is no need to hold permanently a copy of that data in the desired format. Often this data is only needed temporarily while it is converted into another format or for upload to the GPU. In this case the memory used by a temporary instance of mi::neuraylib::ISimple_mesh holding a copy of the geometry data can be reclaimed after the conversion process.

Note
Displacement is currently not supported for on-demand meshes.
See Also
mi::neuraylib::IOn_demand_mesh_callback, mi::neuraylib::ISimple_mesh

Member Function Documentation

virtual Bbox3_struct mi::neuraylib::IOn_demand_mesh::get_bbox ( ) const
pure virtual

Returns the bounding box of the on-demand mesh.

In contrast to get_tight_bbox(), this method does not invoke the callback to compute the bounding box, but just returns the bounding box that was stored with set_bbox().

virtual const IOn_demand_mesh_callback* mi::neuraylib::IOn_demand_mesh::get_callback ( ) const
pure virtual

Returns the stored callback.

virtual Float32 mi::neuraylib::IOn_demand_mesh::get_maximum_displacement ( ) const
pure virtual

Returns the maximum displacement of the on-demand mesh.

See Also
set_maximum_displacement()
virtual Bbox3_struct mi::neuraylib::IOn_demand_mesh::get_tight_bbox ( const Float64_4_4_struct transformation_matrix) const
pure virtual

Returns the bounding box of the on-demand mesh after transformation.

In contrast to get_bbox(), this method does invoke the callback to compute the bounding box on the fly.

Parameters
transformation_matrixThe world-to-object space transformation matrix that is applied to the object before the bounding box is computed.
virtual void mi::neuraylib::IOn_demand_mesh::set_bbox ( const Bbox3_struct bbox)
pure virtual

Sets the bounding box of the on-demand mesh.

virtual void mi::neuraylib::IOn_demand_mesh::set_callback ( IOn_demand_mesh_callback callback)
pure virtual

Sets the callback that returns the actual mesh.

Is is feasible to pass NULL as callback. An on-demand mesh without callback is treated like an empty mesh.

virtual void mi::neuraylib::IOn_demand_mesh::set_maximum_displacement ( Float32  displacement)
pure virtual

Sets the maximum displacement of the on-demand mesh.

This value is the maximum absolute value of any displacement applied to the object (defaults to 0.0). The bounding box of the object will be expanded all around by this value.