The attribute set comprises all attributes attached to a database element. More...
#include <iattribute_set.h>
Public Member Functions | |
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... | |
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 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 | |
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< 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... | |
The attribute set comprises all attributes attached to a database element.
Attributes are pieces of information that can be attached to any database element. Basically, an attribute set is a map from attribute names (strings) to attribute values (instances of mi::IData).
Attributes can be inherited in the scene graph. For details, see mi::neuraylib::Propagation_type.
true
, the element is ignored. If the element references sub-elements in the scene graph, like instances or groups do, these references will be ignored as well. (Of course, there may be other references of non-disabled elements that can make shared sub-elements in their context visible.) This attribute is not supported for decals. true
, cannot be reset to false
by elements lower in the scene graph. This can be used to efficiently turn off objects, lights and groups by disabling their referencing instance element; it would be much more expensive to detach or attach them to the scene graph because that requires preprocessing the scene again.Approx
.c
or c_u
for parametric or distance ratio approximation, or the length bound for length or UV length approximation.c_v
for parametric approximation.c
primitives for some parameter c
(polygons are tessellated first). For freeform surfaces, assume that each surface patch has degrees deg_u
and deg_v
. Each surface patch is subdivided into deg_u
* c_u
times deg_v
* c_v
triangle pairs. c
is an upper bound for the ratio of the distance of the approximation to the original curve/surface and the length of the corresponding edge in the approximation. For example, a value of 0.01 means that the error is at most 1/100 of the edge length in the approximation. Typical values of the approximation constant for the distance ratio method are in the range [0.01,0.1]. base_method
parameter and specifies the initial subdivision. The second pass then adaptively refines the initial subdivision based on displacement values and is driven by the quality
parameter. For subdivision and freeform surfaces the base_method
defines the surface triangulation. Note that adaptive tessellation is currently not supported for meshes with more than one material region. c
are stored in the field const_u
. The The parameters c_u
and c_v
are stored in the fields const_u
and const_v
, respectively. method
.approx_geometry_from_shading_normals
. material
attribute, however, note that in contrast to the material
attribute the scene element with the decals
attribute influences the world-to-object transformation of the decal. This attribute is inherited as usual with the exception that when a parent node P and a child node C both have the decals
attribute the rules detailed in mi::neuraylib::Propagation_type do not apply. Instead, the array elements of the decals
attribute in P are appended to the array elements from C.decals
attribute.decals
and enabled_decals
minus disabled_decals
(taking attribute inheritance into account). decals
attribute is used to break ties between decals of equal priority: if decal D1 is in front of decal D2 and both have equal priorities, decal D1 will appear on top of decal D2 (assuming both are overlapping, otherwise it is not relevant anyway). material
attribute, however, note that in contrast to the material
attribute the scene element with the projectors
attribute influences the world-to-object transformation of the projector. This attribute is inherited as usual with the exception that the propagation type mi::neuraylib::PROPAGATION_OVERRIDE is not supported.projector
attribute. This attribute allows to specify a projector different from the inherited default, or to disable the inherited default. Only projectors that appear in projectors
attributes on the path from this node to the root are feasible.adjust_attribute_types
is false
and the types are incompatible).
|
inline |
Returns a const pointer to the attribute name
.
This templated member function is a wrapper of the non-template variant for the user's convenience. It eliminates the need to call mi::base::IInterface::get_interface(const Uuid &) on the returned pointer, since the return type already is a pointer to the type T
specified as template parameter.
T | The interface type of the attribute. |
name | The name of the attribute. In addition, you can also access parts of array or structure attributes directly. For an array element add the index in square brackets to the attribute name. For a structure member add a dot and the name of the structure member to the attribute name. |
NULL
if there is no attribute with the name name
or if T
does not match the attribute's type.
|
pure virtual |
Returns a const pointer to the attribute name
.
name | The name of the attribute. In addition, you can also access parts of array or structure attributes directly. For an array element add the index in square brackets to the attribute name. For a structure member add a dot and the name of the structure member to the attribute name. |
NULL
if there is no attribute with the name name
.
|
inline |
Creates a new attribute name
of the type T
.
See Types for a list of supported attribute types.
Note that there are two versions of this templated member function, one that takes only one argument (the attribute name), and another one that takes two arguments (the attribute name and the type name). The version with one argument can only be used to create a subset of supported attribute types: it supports only those types where the type name can be deduced from the template parameter, i.e., it does not support arrays and structures. The version with two arguments can be used to create attributes of any supported type (but requires the type name as parameter, which is redundant for many types). Attempts to use the version with one argument with a template parameter where the type name can not be deduced results in compiler errors.
This templated member function is a wrapper of the non-template variant for the user's convenience. It eliminates the need to call mi::base::IInterface::get_interface(const Uuid &) on the returned pointer, since the return type already is a pointer to the type T
specified as template parameter.
T | The interface type of the attribute. |
name | The name of the attribute. The name must not contain "[" , "]" , or "." |
NULL
in case of failure. Reasons for failure are:name
or type
is invalid,name
, orname
is the name of a reserved attribute and T
does not match the required type(s) of such an attribute.
|
inline |
Creates a new attribute name
of the type type
.
See Types for a list of supported attribute types.
Note that there are two versions of this templated member function, one that takes only one argument (the attribute name), and another one that takes two arguments (the attribute name and the type name). The version with one argument can only be used to create a subset of supported attribute types: it supports only those types where the type name can be deduced from the template parameter, i.e., it does not support arrays and structures. The version with two arguments can be used to create attributes of any supported type (but requires the type name as parameter, which for redundant for many types). Attempts to use the version with one argument with a template parameter where the type name can not be deduced results in compiler errors.
This templated member function is a wrapper of the non-template variant for the user's convenience. It eliminates the need to call mi::base::IInterface::get_interface(const Uuid &) on the returned pointer, since the return type already is a pointer to the type T
specified as template parameter.
T | The interface type of the attribute. |
name | The name of the attribute. The name must not contain "[" , "]" , or "." |
type | The type of the attribute. See Types for a list of supported attribute types. |
NULL
in case of failure. Reasons for failure are:name
or type
is invalid,name
,name
is the name of a reserved attribute and type
does not match the required type(s) of such an attribute, orT
does not match type
.
|
pure virtual |
Creates a new attribute name
of the type type
.
name | The name of the attribute. The name must not contain "[" , "]" , or "." |
type | The type of the attribute. See Types for a list of supported attribute types. |
NULL
in case of failure. Reasons for failure are:name
or type
is invalid,name
, orname
is the name of a reserved attribute and type
does not match the required type(s) of such an attribute.
|
pure virtual |
Destroys the attribute name
.
name | The name of the attribute to destroy. |
true
if the attribute has been successfully destroyed, and false
otherwise (there is no attribute with the name name
).
|
inline |
Returns a mutable pointer to the attribute name
.
This templated member function is a wrapper of the non-template variant for the user's convenience. It eliminates the need to call mi::base::IInterface::get_interface(const Uuid &) on the returned pointer, since the return type already is a pointer to the type T
specified as template parameter.
T | The interface type of the attribute. |
name | The name of the attribute. In addition, you can also access parts of array or structure attributes directly. For an array element add the index in square brackets to the attribute name. For a structure member add a dot and the name of the structure member to the attribute name. |
NULL
if there is no attribute with the name name
or if T
does not match the attribute's type.
|
pure virtual |
Returns a mutable pointer to the attribute name
.
name | The name of the attribute. In addition, you can also access parts of array or structure attributes directly. For an array element add the index in square brackets to the attribute name. For a structure member add a dot and the name of the structure member to the attribute name. |
NULL
if there is no attribute with the name name
.
|
pure virtual |
Returns the name of the attribute indicated by index
.
index | The index of the attribute. |
index
, or NULL
if index
is out of bounds.
|
pure virtual |
Returns the propagation type of the attribute name
.
|
pure virtual |
Returns the type of an attribute.
See Types for a list of supported attribute types.
name | The name of the attribute. In addition, you can also query parts of array or structure attributes directly. For an array element add the index in square brackets to the attribute name. For a structure member add a dot and the name of the structure member to the attribute name. |
NULL
if there is no attribute with the name name
.
|
pure virtual |
Indicates existence of an attribute.
name | The name of the attribute. In addition, you can also checks for parts of array or structure attributes directly. For an array element add the index in square brackets to the attribute name. For a structure member add a dot and the name of the structure member to the attribute name. |
true
if the attribute set contains this attribute (and the attribute contains the requested array element or struct member), false
otherwise
|
pure virtual |
Sets the propagation type of the attribute name
.
NULL
pointer or invalid enum value).name
.