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

Interface representing a collection of particles. More...

#include <iparticles.h>

Inheritance diagram for mi::neuraylib::IParticles:

Public Member Functions

General methods
virtual void set_type (Particle_type particle_type)=0
 Sets the particle type. More...
 
virtual Particle_type get_type () const =0
 Returns the particle type. More...
 
virtual Size get_particles_size () const =0
 Returns the number of particles. More...
 
virtual Uint32 get_particles_element_size () const =0
 Returns the number of floats that define a particle of the current particle type. More...
 
virtual void reserve (Size n)=0
 Reserves space for n particles. More...
 
Methods related to particles
virtual Sint32 set_data (const Float32 *data, Size n)=0
 Sets the data for the whole particle object. More...
 
virtual const Float32get_data () const =0
 Returns the data of this particle object or NULL if the object is empty. More...
 
virtual Sint32 add_particle (const Float32 *data)=0
 Adds a particle. More...
 
virtual Sint32 set_particle (Size index, const Float32 *data)=0
 Sets a particle. More...
 
virtual const Float32get_particle (Size index) const =0
 Returns the data of the particle at index or NULL if the object is empty or index is out of bounds. More...
 
Methods related to per-particle attributes
virtual bool has_attribute (Mesh_attribute_name name) const =0
 Indicates whether the particle object has a particular attribute. More...
 
virtual IAttribute_vectorcreate_attribute_vector (Mesh_attribute_name name, Uint32 dim=1)=0
 Creates a particle object attribute. More...
 
virtual const IAttribute_vectoraccess_attribute_vector (Mesh_attribute_name name) const =0
 Returns a particle object attribute. More...
 
virtual IAttribute_vectoredit_attribute_vector (Mesh_attribute_name name)=0
 Detaches and returns a particle object attribute. More...
 
virtual Sint32 attach_attribute_vector (IAttribute_vector *attribute_vector)=0
 Attaches an attribute to the particle object. More...
 
virtual Sint32 remove_attribute_vector (Mesh_attribute_name name)=0
 Removes a particle object attribute. More...
 
Methods related to the bounding box
virtual Bbox3_struct get_bbox () const =0
 Returns the bounding box of the particle object. More...
 
virtual Bbox3_struct get_tight_bbox (const Float64_4_4_struct &transformation_matrix) const =0
 Returns the bounding box of the particle object after transformation. 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< 0xd48750cf, ... >
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< 0xd48750cf, ... >
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 a collection of particles.

Member Function Documentation

 access_attribute_vector()

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

Returns a particle object attribute.

Parameters
nameThe name of the attribute, see above.
Returns
The requested attribute vector, or NULL in case of failure.

 add_particle()

virtual Sint32 mi::neuraylib::IParticles::add_particle ( const Float32 data)
pure virtual

Adds a particle.

Parameters
dataThe particle data. The size of the array depends on the particle type. In case of mi::neuraylib::PARTICLE_TYPE_SPHERE four floats need to be provided: the first three define its position and the fourth one its radius.
See also
get_particles_element_size()
Returns
  • 0: Success.
  • -1: Invalid input data (NULL or zero-length array).

 attach_attribute_vector()

virtual Sint32 mi::neuraylib::IParticles::attach_attribute_vector ( IAttribute_vector attribute_vector)
pure virtual

Attaches an attribute to the particle object.

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

See also
create_attribute_vector(), edit_attribute_vector()
Parameters
attribute_vectorThe attribute vector to attach.
Returns
  • 0: Success.
  • -1: Invalid parameters (NULL pointer).
  • -3: The attribute vector is not one of the supported types.
  • -4: The number of elements does not match the number of particle of the object
  • -5: An attribute of the same name is already attached to the particle object.

 create_attribute_vector()

virtual IAttribute_vector * mi::neuraylib::IParticles::create_attribute_vector ( Mesh_attribute_name  name,
Uint32  dim = 1 
)
pure virtual

Creates a particle object attribute.

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

See also
attach_attribute_vector()
Parameters
nameThe name of the attribute, see above.
dimDimension 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.

 edit_attribute_vector()

virtual IAttribute_vector * mi::neuraylib::IParticles::edit_attribute_vector ( Mesh_attribute_name  name)
pure virtual

Detaches and returns a particle object attribute.

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

See also
attach_attribute_vector()
Parameters
nameThe name of the attribute, see above.
Returns
The requested attribute vector, or NULL in case of failure.

 get_bbox()

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

Returns the bounding box of the particle object.

 get_data()

virtual const Float32 * mi::neuraylib::IParticles::get_data ( ) const
pure virtual

Returns the data of this particle object or NULL if the object is empty.

 get_particle()

virtual const Float32 * mi::neuraylib::IParticles::get_particle ( Size  index) const
pure virtual

Returns the data of the particle at index or NULL if the object is empty or index is out of bounds.

 get_particles_element_size()

virtual Uint32 mi::neuraylib::IParticles::get_particles_element_size ( ) const
pure virtual

Returns the number of floats that define a particle of the current particle type.

(mi::neuraylib::Particle_type).

 get_particles_size()

virtual Size mi::neuraylib::IParticles::get_particles_size ( ) const
pure virtual

Returns the number of particles.

 get_tight_bbox()

virtual Bbox3_struct mi::neuraylib::IParticles::get_tight_bbox ( const Float64_4_4_struct transformation_matrix) const
pure virtual

Returns the bounding box of the particle object after transformation.

Parameters
transformation_matrixThe world-to-object space transformation matrix that is applied to the object before the bounding box is computed.

 get_type()

virtual Particle_type mi::neuraylib::IParticles::get_type ( ) const
pure virtual

Returns the particle type.

 has_attribute()

virtual bool mi::neuraylib::IParticles::has_attribute ( Mesh_attribute_name  name) const
pure virtual

Indicates whether the particle object has a particular attribute.

Parameters
nameThe name of the attribute to query, see above.
Returns
true if the particle object has this attribute, false otherwise.

 remove_attribute_vector()

virtual Sint32 mi::neuraylib::IParticles::remove_attribute_vector ( Mesh_attribute_name  name)
pure virtual

Removes a particle object attribute.

Parameters
nameThe name of the attribute, see above.
Returns
  • 0: Success.
  • -1: There is no attribute of the given type and name.

 reserve()

virtual void mi::neuraylib::IParticles::reserve ( Size  n)
pure virtual

Reserves space for n particles.

 set_data()

virtual Sint32 mi::neuraylib::IParticles::set_data ( const Float32 data,
Size  n 
)
pure virtual

Sets the data for the whole particle object.

Parameters
dataAn array containing the data needed to describe all particles of this particle object. In case of mi::neuraylib::PARTICLE_TYPE_SPHERE a single particle is given by four floats: the first three define its position and the fourth one its radius, therefore the size of data is 4 * n.
See also
get_particles_element_size()
Parameters
nThe number of particles.
Returns
  • 0: Success.
  • -1: Invalid input data (NULL or zero-length array).

 set_particle()

virtual Sint32 mi::neuraylib::IParticles::set_particle ( Size  index,
const Float32 data 
)
pure virtual

Sets a particle.

Parameters
indexParticle index.
dataThe particle data. The size of the array depends on the particle type. In case of mi::neuraylib::PARTICLE_TYPE_SPHERE four floats need to be provided: the first three define its position and the fourth one its radius.
See also
get_particles_element_size()
Returns
  • 0: Success.
  • -1: Invalid input data (NULL or zero-length array).
  • -2: index is out of bounds.

 set_type()

virtual void mi::neuraylib::IParticles::set_type ( Particle_type  particle_type)
pure virtual

Sets the particle type.

The default type is mi::neuraylib::PARTICLE_TYPE_SPHERE. Currently, no other type is supported.