Iray SDK API nvidia_logo_transpbg.gif Up
mi::neuraylib::IOn_demand_mesh Class Referenceabstract

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

#include <ion_demand_mesh.h>

Inheritance diagram for mi::neuraylib::IOn_demand_mesh:

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_callbackget_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...
 
- Public Member Functions inherited from mi::neuraylib::IScene_element
virtual Element_type get_element_type () const =0
 Indicates the actual scene element represented by interfaces derived from this interface. More...
 
- Public Member Functions inherited from mi::neuraylib::IAttribute_set
virtual IDatacreate_attribute (const char *name, const char *type)=0
 Creates a new attribute name of the type type. More...
 
template<class T>
T * create_attribute (const char *name, const char *type)
 Creates a new attribute name of the type type. More...
 
template<class T>
T * create_attribute (const char *name)
 Creates a new attribute name of the type T. More...
 
virtual bool destroy_attribute (const char *name)=0
 Destroys the attribute name. More...
 
virtual const IDataaccess_attribute (const char *name) const =0
 Returns a const pointer to the attribute name. More...
 
template<class T>
const T * access_attribute (const char *name) const
 Returns a const pointer to the attribute name. More...
 
virtual IDataedit_attribute (const char *name)=0
 Returns a mutable pointer to the attribute name. More...
 
template<class T>
T * edit_attribute (const char *name)
 Returns a mutable pointer to the attribute name. More...
 
virtual bool is_attribute (const char *name) const =0
 Indicates existence of an attribute. More...
 
virtual const char * get_attribute_type_name (const char *name) const =0
 Returns the type of an attribute. More...
 
virtual Sint32 set_attribute_propagation (const char *name, Propagation_type value)=0
 Sets the propagation type of the attribute name. More...
 
virtual Propagation_type get_attribute_propagation (const char *name) const =0
 Returns the propagation type of the attribute name. More...
 
virtual const char * enumerate_attributes (Sint32 index) const =0
 Returns the name of the attribute indicated by index. More...
 
- Public Member Functions inherited from mi::base::IInterface
virtual Uint32 retain () const =0
 Increments the reference count. More...
 
virtual Uint32 release () const =0
 Decrements the reference count. More...
 
virtual const IInterfaceget_interface (const Uuid &interface_id) const =0
 Acquires a const interface from another. More...
 
template<class T>
const T * get_interface () const
 Acquires a const interface from another. More...
 
virtual IInterfaceget_interface (const Uuid &interface_id)=0
 Acquires a mutable interface from another. More...
 
template<class T>
T * get_interface ()
 Acquires a mutable interface from another. More...
 
virtual Uuid get_iid () const =0
 Returns the interface ID of the most derived interface. More...
 

Additional Inherited Members

- Public Types inherited from mi::base::Interface_declare< 0x0c1cb14f, ... >
typedef Interface_declare< id1, ... > Self
 Own type. More...
 
typedef Uuid_t< id1, ... > IID
 Declares the interface ID (IID) of this interface. More...
 
- Public Types inherited from mi::base::Interface_declare< 0x8a2a4da9, ... >
typedef Interface_declare< id1, ... > Self
 Own type. More...
 
typedef Uuid_t< id1, ... > IID
 Declares the interface ID (IID) of this interface. More...
 
- Public Types inherited from mi::base::Interface_declare< 0x1bcb8d48, ... >
typedef Interface_declare< id1, ... > Self
 Own type. More...
 
typedef Uuid_t< id1, ... > IID
 Declares the interface ID (IID) of this interface. More...
 
- Public Types inherited from mi::base::IInterface
typedef Uuid_t<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0> IID
 Declares the interface ID (IID) of this interface. More...
 
- Static Public Member Functions inherited from mi::base::Interface_declare< 0x0c1cb14f, ... >
static bool compare_iid (const Uuid &iid)
 Compares the interface ID iid against the interface ID of this interface and of its ancestors. More...
 
- Static Public Member Functions inherited from mi::base::Interface_declare< 0x8a2a4da9, ... >
static bool compare_iid (const Uuid &iid)
 Compares the interface ID iid against the interface ID of this interface and of its ancestors. More...
 
- Static Public Member Functions inherited from mi::base::Interface_declare< 0x1bcb8d48, ... >
static bool compare_iid (const Uuid &iid)
 Compares the interface ID iid against the interface ID of this interface and of its ancestors. More...
 
- Static Public Member Functions inherited from mi::base::IInterface
static bool compare_iid (const Uuid &iid)
 Compares the interface ID iid against the interface ID of this interface. 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

 get_bbox()

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().

 get_callback()

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

Returns the stored callback.

 get_maximum_displacement()

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()

 get_tight_bbox()

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.

 set_bbox()

virtual void mi::neuraylib::IOn_demand_mesh::set_bbox ( const Bbox3_struct bbox)
pure virtual

Sets the bounding box of the on-demand mesh.

 set_callback()

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.

 set_maximum_displacement()

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.