7#ifndef MI_NEURAYLIB_SET_GET_H
8#define MI_NEURAYLIB_SET_GET_H
67 return result == 0 ? 0 : -2;
85 return result == 0 ? 0 : -2;
89 mi::Sint32 result = e->set_value_by_name( value);
90 return result == 0 ? 0 : -2;
126template <
class T, Size DIM>
129 typedef typename mi::Vector_type_traits<T,DIM>::Interface_type Vector_interface_type;
132 v->set_value( value);
148template <
class T, Size ROW, Size COL>
151 typedef typename mi::Matrix_type_traits<T,ROW,COL>::Interface_type Matrix_interface_type;
154 m->set_value( value);
167 c->set_value( value);
172 c3->set_value( value);
185 s->set_value( value);
198 b->set_value( value);
283 else if( a->get_length() != n)
345 v->get_value( value);
350#ifdef MI_COMPILER_MSC
351#pragma warning( push )
352#pragma warning( disable : 4800 )
356 value =
static_cast<T
>( e->get_value());
359#ifdef MI_COMPILER_MSC
360#pragma warning( pop )
372 value = i->get_c_str();
377 value = r->get_reference_name();
382 value = e->get_value_by_name();
395 value = u->get_uuid();
411template <
class T, Size DIM>
414 typedef typename mi::Vector_type_traits<T,DIM>::Interface_type Vector_interface_type;
417 value = v->get_value();
433template <
class T, Size ROW, Size COL>
436 typedef typename mi::Matrix_type_traits<T,ROW,COL>::Interface_type Matrix_interface_type;
439 value = m->get_value();
452 value = c->get_value();
457 value = c3->get_value();
470 value = s->get_value();
483 value = b->get_value();
559 if( a->get_length() != n)
592 values.resize( a->get_length());
608 const char* c_str = 0;
611 value.assign( c_str);
This interface represents static arrays, i.e., arrays with a fixed number of elements.
Definition: iarray.h:37
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 dynamic arrays, i.e., arrays with a variable number of elements.
Definition: idynamic_array.h:36
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:373
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
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:57
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:341
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: example_derivatives.dox:5
A 128 bit representation of a universally unique identifier (UUID or GUID).
Definition: uuid.h:26