neuray API Programmer's Manual

mi::neuraylib::IOn_demand_mesh Class Reference

[Leaf nodes]

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

Public Member Functions

virtual const IOn_demand_mesh_callbackget_callback() const =0
Returns the stored callback.
virtual void set_callback( IOn_demand_mesh_callback* callback) =0
Sets the callback that returns the actual mesh. More...

Methods related to the bounding box

virtual const Float32_3_structget_bbox_max() const =0
Returns the maximal corner of the bounding box.
virtual const Float32_3_structget_bbox_min() const =0
Returns the minimal corner of the bounding box.
virtual void set_bbox_max( const Float32_3_struct& bbox_max) =0
Sets the maximal corner of the bounding box.
virtual void set_bbox_min( const Float32_3_struct& bbox_min) =0
Sets the minimal corner of the bounding box.

Methods related to displacement

virtual Float32 get_maximum_displacement() const =0
Returns the maximum displacement of the on-demand mesh. More...
virtual void set_maximum_displacement( Float32 displacement) =0
Sets the maximum displacement of the on-demand mesh. More...

Member Functions

virtual const Float32_3_struct& mi::​neuraylib::​IOn_demand_mesh::get_bbox_max() const [pure virtual]

Returns the maximal corner of the bounding box.

virtual const Float32_3_struct& mi::​neuraylib::​IOn_demand_mesh::get_bbox_min() const [pure virtual]

Returns the minimal corner of the bounding box.

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 void mi::​neuraylib::​IOn_demand_mesh::set_bbox_max( const Float32_3_struct& bbox_max) [pure virtual]

Sets the maximal corner of the bounding box.

virtual void mi::​neuraylib::​IOn_demand_mesh::set_bbox_min( const Float32_3_struct& bbox_min) [pure virtual]

Sets the minimal corner of the bounding box.

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.