Interface representing an on-demand mesh. More...
#include <ion_demand_mesh.h>
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... | |
![]() | |
virtual Element_type | get_element_type () const =0 |
Indicates the actual scene element represented by interfaces derived from this interface. More... | |
![]() | |
virtual IData * | create_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 IData * | access_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 IData * | edit_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... | |
![]() | |
virtual Uint32 | retain () const =0 |
Increments the reference count. More... | |
virtual Uint32 | release () const =0 |
Decrements the reference count. More... | |
virtual const IInterface * | get_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 IInterface * | get_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 | |
![]() | |
using | Self = Interface_declare< id1, ... > |
Own type. More... | |
using | IID = Uuid_t< id1, ... > |
Declares the interface ID (IID) of this interface. More... | |
![]() | |
using | Self = Interface_declare< id1, ... > |
Own type. More... | |
using | IID = Uuid_t< id1, ... > |
Declares the interface ID (IID) of this interface. More... | |
![]() | |
using | Self = Interface_declare< id1, ... > |
Own type. More... | |
using | IID = Uuid_t< id1, ... > |
Declares the interface ID (IID) of this interface. More... | |
![]() | |
using | IID = Uuid_t<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0> |
Declares the interface ID (IID) of this interface. More... | |
![]() | |
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 bool | compare_iid (const Uuid &iid) |
Compares the interface ID iid against the interface ID of this interface and of its ancestors. More... | |
![]() | |
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 bool | compare_iid (const Uuid &iid) |
Compares the interface ID iid against the interface ID of this interface. More... | |
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.
|
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().
|
pure virtual |
Returns the stored callback.
|
pure virtual |
Returns the maximum displacement of the on-demand mesh.
|
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.
transformation_matrix | The world-to-object space transformation matrix that is applied to the object before the bounding box is computed. |
|
pure virtual |
Sets the bounding box of the on-demand mesh.
|
pure virtual |
Sets the callback that returns the actual mesh.
Is is feasible to pass nullptr
as callback
. An on-demand mesh without callback is treated like an empty mesh.
|
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.