7#ifndef MI_NEURAYLIB_SET_GET_H
8#define MI_NEURAYLIB_SET_GET_H
62 return result == 0 ? 0 : -2;
80 return result == 0 ? 0 : -2;
84 mi::Sint32 result = e->set_value_by_name( value);
85 return result == 0 ? 0 : -2;
121template <
class T, Size DIM>
124 typedef typename mi::Vector_type_traits<T,DIM>::Interface_type Vector_interface_type;
127 v->set_value( value);
143template <
class T, Size ROW, Size COL>
146 typedef typename mi::Matrix_type_traits<T,ROW,COL>::Interface_type Matrix_interface_type;
149 m->set_value( value);
162 c->set_value( value);
167 c3->set_value( value);
180 s->set_value( value);
193 b->set_value( value);
271 v->get_value( value);
276#ifdef MI_COMPILER_MSC
277#pragma warning( push )
278#pragma warning( disable : 4800 )
282 value =
static_cast<T
>( e->get_value());
285#ifdef MI_COMPILER_MSC
286#pragma warning( pop )
298 value = i->get_c_str();
303 value = r->get_reference_name();
308 value = e->get_value_by_name();
321 value = u->get_uuid();
337template <
class T, Size DIM>
340 typedef typename mi::Vector_type_traits<T,DIM>::Interface_type Vector_interface_type;
343 value = v->get_value();
359template <
class T, Size ROW, Size COL>
362 typedef typename mi::Matrix_type_traits<T,ROW,COL>::Interface_type Matrix_interface_type;
365 value = m->get_value();
378 value = c->get_value();
383 value = c3->get_value();
396 value = s->get_value();
409 value = b->get_value();
This interface represents bounding boxes.
Definition: ibbox.h:28
This interface represents RGB colors.
Definition: icolor.h:52
This interface represents RGBA colors.
Definition: icolor.h:28
This interface represents collections.
Definition: idata.h:350
This interface is the base interface of all types.
Definition: idata.h:297
This interface represents enums.
Definition: ienum.h:39
This interface represents simple numeric types.
Definition: inumber.h:25
A reference is an object that acts as a pointer to other database elements.
Definition: iref.h:25
This interface represents spectrums.
Definition: ispectrum.h:28
A simple string class.
Definition: istring.h:22
This interface represents UUIDs.
Definition: iuuid.h:24
Handle class template for interfaces, automatizing the lifetime control via reference counting.
Definition: handle.h:113
Axis-aligned N-dimensional bounding box class template of fixed dimension.
Definition: bbox.h:74
Standard RGBA color class with floating point elements and operations.
Definition: color.h:81
NxM-dimensional matrix class template of fixed dimensions.
Definition: matrix.h:367
Spectrum with floating point elements and operations.
Definition: spectrum.h:53
Fixed-size math vector class template with generic operations.
Definition: vector.h:286
The attribute set comprises all attributes attached to a database element.
Definition: iattribute_set.h:332
virtual IData * edit_attribute(const char *name)=0
Returns a mutable pointer to the attribute name.
virtual const IData * access_attribute(const char *name) const =0
Returns a const pointer to the attribute name.
Configuration of the Base API.
virtual const IInterface * get_interface(const Uuid &interface_id) const =0
Acquires a const interface from another.
Interface * get() const
Access to the interface. Returns 0 for an invalid interface.
Definition: handle.h:294
bool is_valid_interface() const
Returns true if the interface is valid.
Definition: handle.h:291
Uint64 Size
Unsigned integral type that is large enough to hold the size of all types.
Definition: types.h:112
signed int Sint32
32-bit signed integer.
Definition: types.h:46
mi::Sint32 set_value(mi::IData *data, const T &value)
Simplifies setting the value of mi::IData from the corresponding classes from the base and math API.
Definition: set_get.h:52
mi::Sint32 get_value(const mi::IData *data, T &value)
Simplifies reading the value of mi::IData into the corresponding classes from the base and math API.
Definition: set_get.h:267
Smart-pointer handle class for interfaces, const and non-const version.
Base class for database elements with attributes.
Type that holds a reference to a database element.
Common namespace for APIs of NVIDIA Advanced Rendering Center GmbH.
Definition: neuraylib.h:179
A 128 bit representation of a universally unique identifier (UUID or GUID).
Definition: uuid.h:26