MDL SDK API nvidia_logo_transpbg.gif Up

Types are organized in a hierarchy based on the basic interface mi::IData. More...

Modules

 Simple Types
 This module lists all interfaces related to simple types.
 
 Collections
 This module and its submodule Compounds list all interfaces related to collections.
 

Classes

class  mi::neuraylib::IBuffer
 Abstract interface for a simple buffer with binary data. More...
 
class  mi::IData
 This interface is the base interface of all types. More...
 
class  mi::IEnum_decl
 An enum declaration is used to describe enum types. More...
 
class  mi::neuraylib::IFactory
 This API component allows the creation, assignment, and cloning of instances of types. More...
 
class  mi::IStructure_decl
 A structure declaration is used to describe structure types. More...
 
struct  mi::Type_traits<I>
 Type traits relating interfaces, corresponding primitive types, and their type names. More...
 

Functions

template<class T>
mi::Sint32 mi::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. More...
 
mi::Sint32 mi::set_value (mi::IData *data, const char *value)
 This specialization handles mi::IString and mi::IRef. More...
 
mi::Sint32 mi::set_value (mi::IData *data, const std::string &value)
 This specialization handles mi::IString and mi::IRef. More...
 
mi::Sint32 mi::set_value (mi::IData *data, const mi::base::Uuid &value)
 This specialization handles mi::IUuid. More...
 
template<class T , Size DIM>
mi::Sint32 mi::set_value (mi::IData *data, const mi::math::Vector<T, DIM> &value)
 This specialization handles the vector specializations of mi::ICompound. More...
 
template<class T , Size ROW, Size COL>
mi::Sint32 mi::set_value (mi::IData *data, const mi::math::Matrix<T, ROW, COL> &value)
 This specialization handles the matrix specializations of mi::ICompound. More...
 
mi::Sint32 mi::set_value (mi::IData *data, const mi::Color &value)
 This specialization handles mi::IColor and mi::IColor3. More...
 
mi::Sint32 mi::set_value (mi::IData *data, const mi::Spectrum &value)
 This specialization handles mi::ISpectrum. More...
 
mi::Sint32 mi::set_value (mi::IData *data, const mi::Bbox3 &value)
 This specialization handles mi::IBbox3. More...
 
template<class T>
mi::Sint32 mi::set_value (mi::IData *data, mi::Size index, const T &value)
 This variant handles elements of collections identified via an additional index. More...
 
template<class T>
mi::Sint32 mi::set_value (mi::IData *data, const char *key, const T &value)
 This variant handles elements of collections identified via an additional key. More...
 
template<class T>
mi::Sint32 mi::set_value (mi::IData *data, const T *values, mi::Size n)
 This variant handles entire arrays (as C-like array). More...
 
template<class T>
mi::Sint32 mi::set_value (mi::IData *data, const std::vector<T> &values)
 This variant handles entire arrays (as std::vector). More...
 
template<class T>
mi::Sint32 mi::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. More...
 
mi::Sint32 mi::get_value (const mi::IData *data, const char *&value)
 This specialization handles mi::IString and mi::IRef. More...
 
mi::Sint32 mi::get_value (const mi::IData *data, mi::base::Uuid &value)
 This specialization handles mi::IUuid. More...
 
template<class T , Size DIM>
mi::Sint32 mi::get_value (const mi::IData *data, mi::math::Vector<T, DIM> &value)
 This specialization handles the vector specializations of mi::ICompound. More...
 
template<class T , Size ROW, Size COL>
mi::Sint32 mi::get_value (const mi::IData *data, mi::math::Matrix<T, ROW, COL> &value)
 This specialization handles the matrix specializations of mi::ICompound. More...
 
mi::Sint32 mi::get_value (const mi::IData *data, mi::Color &value)
 This specialization handles mi::IColor and mi::IColor3. More...
 
mi::Sint32 mi::get_value (const mi::IData *data, mi::Spectrum &value)
 This specialization handles mi::ISpectrum. More...
 
mi::Sint32 mi::get_value (const mi::IData *data, mi::Bbox3 &value)
 This specialization handles mi::IBbox3. More...
 
template<class T>
mi::Sint32 mi::get_value (const mi::IData *data, mi::Size index, T &value)
 This variant handles elements of collections identified via an additional index. More...
 
template<class T>
mi::Sint32 mi::get_value (const mi::IData *data, const char *key, T &value)
 This variant handles elements of collections identified via an additional key. More...
 
template<class T>
mi::Sint32 mi::get_value (const mi::IData *data, T *values, mi::Size n)
 This variant handles entire arrays (as C-like arrays). More...
 
template<class T>
mi::Sint32 mi::get_value (const mi::IData *data, std::vector<T> &values)
 This variant handles entire arrays (as std::vector). More...
 
mi::Sint32 mi::get_value (const mi::IData *data, std::string &value)
 This variant handles strings as std::string. More...
 

Detailed Description

Types are organized in a hierarchy based on the basic interface mi::IData.

The hierarchy of types based on mi::IData is split into two branches, simple types (derived from mi::IData_simple) and collections (derived from mi::IData_collection). Simple types are e.g. numbers and strings. Collections are e.g. arrays, structures, maps, vectors, and matrices.

Types are identified by type names. The method mi::IData::get_type_name() returns the type name of an instance of mi::IData. Most notably type names are used to create instances of types via mi::neuraylib::IFactory::create() and mi::neuraylib::ITransaction::create() , and to create attributes or to query their type.

Since there is a very high number of interfaces related to types they are not listed in this module. Rather they have been split into three submodules Simple Types, Collections, and Compounds (compounds are a subset of the collections).

The free functions mi::set_value() and mi::get_value() including the various specializations may help to write/read values to/from instances of mi::IData.

Simple types

Simple types are booleans, integral and floating-point numbers, strings, UUIDs, void, pointers, and references. All interfaces of the simple types are derived from mi::IData_simple. For most simple types there is an equivalent C++ class. With the exception of pointers, references, and enums the type name of simple types equals the interface name without the leading "I". See also the module Simple Types.

Type name Attribute type Interface C++ class Description
"Boolean" yesmi::IBooleanbool Boolean
"Sint8" yesmi::ISint8mi::Sint8 Signed 8-bit integer
"Sint16" yesmi::ISint16mi::Sint16 Signed 16-bit integer
"Sint32" yesmi::ISint32mi::Sint32 Signed 32-bit integer
"Sint64" yesmi::ISint64mi::Sint64 Signed 64-bit integer
"Uint8" nomi::IUint8mi::Uint8 Unsigned 8-bit integer
"Uint16" nomi::IUint16mi::Uint16 Unsigned 16-bit integer
"Uint32" nomi::IUint32mi::Uint32 Unsigned 32-bit integer
"Uint64" nomi::IUint64mi::Uint64 Unsigned 64-bit integer
"Float32" yesmi::IFloat32 mi::Float32 32-bit IEEE-754 single-precision floating-point number
"Float64" yesmi::IFloat64 mi::Float64 64-bit IEEE-754 double-precision floating-point number
"Difference" nomi::IDifferencemi::Difference Signed 32-bit or 64-bit integer, depending on the architecture
"Size" nomi::ISizemi::Size Unsigned 32-bit or 64-bit integer, depending on the architecture
"String" yesmi::IStringconst char* String representation in ISO-8859-1 encoding
"Uuid" nomi::IUuidmi::base::Uuid Universally unique identifier (UUID)
"Void" nomi::IVoidvoid Void type
"Pointer<T>" nomi::IPointer- Mutable pointer to an instance of type T
"Const_pointer<T>" nomi::IConst_pointer- Const pointer to an instance of type T
as registered (1) yesmi::IEnum - Subsets of mi::Sint32 values, identified by strings
"Ref" yesmi::IRef- Reference to another database element

(1) The type name of an enum is specific to the actual enum type. There is no naming pattern as for the other simple types.

Collections

Collections are static and dynamic arrays, maps, structures, and compounds (for compounds see separate section below). All interfaces of collections are derived from mi::IData_collection. For all collection types there are similar constructs in C++, but there are no directly equivalent C++ classes as for the simple types. The type names of collections are typically constructed according to certain rules, typically involving the type name of the contained elements or values. See the table below for examples or the corresponding interfaces for an exact description. See also the module Collections.

Type name Attribute type Interface C++ class Description
"T[N]" yes (2)(3)mi::IArray - Static array of N elements of type T, N > 0
"T[]" yes (2)mi::IDynamic_array - Dynamic array of elements of type T
"Map<T>" nomi::IMap - Set of key-value pairs, values are of type T
as registered (4)yesmi::IStructure - Ordered set of key-value pairs, values are of arbitrary types

(2) For attributes, the type of array elements must not be an array (but it can be a structure with arrays as members).
(3) For attributes, the array length N must not be zero.
(4) The type name of a structure is specific to the actual structure type. There is no naming pattern as for arrays or maps.

Compounds

Compound types are vectors, matrices, colors, spectrums, and bounding boxes. Actually, compounds belong to the set of collections, they are not a third kind of type besides simple types and collections.In the documentation they are split into their own module due to the very high number of interfaces and typedefs for compounds. See also the module Compounds.

For all compound types there is a C++ class from the math API as counterpart. Type names for vectors and matrices are based on the type name of the element followed by the dimension in angle brackets ("<N>" or "<M,N>", N = 2, 3, or 4).

Type name Attribute type Interface C++ class Description
"Boolean<N>" yesmi::IBoolean_2, ... mi::Boolean_2, ... N x bool vector, N = 2, 3, or 4
"Sint32<N>" yesmi::ISint32_2, ... mi::Sint32_2, ... N x Sint32 vector, N = 2, 3, or 4
"Uint32<N>" nomi::IUint32_2, ... mi::Uint32_2, ... N x Uint32 vector, N = 2, 3, or 4
"Float32<N>" yesmi::IFloat32_2, ... mi::Float32_2, ... N x Float32 vector, N = 2, 3, or 4
"Float64<N>" yesmi::IFloat64_2, ... mi::Float64_2, ... N x Float64 vector, N = 2, 3, or 4
"Boolean<M,N>" nomi::IBoolean_2_2, ... mi::Boolean_2_2, ... M x N matrix of bool, M, N = 2, 3, or 4
"Sint32<M,N>" nomi::ISint32_2_2, ... mi::Sint32_2_2, ... M x N matrix of Sint32, M, N = 2, 3, or 4
"Uint32<M,N>" nomi::IUint32_2_2, ... mi::Uint32_2_2, ... M x N matrix of Uint32, M, N = 2, 3, or 4
"Float32<M,N>" yesmi::IFloat32_2_2, ... mi::Float32_2_2, ... M x N matrix of Float32, M, N = 2, 3, or 4
"Float64<M,N>" yesmi::IFloat64_2_2, ... mi::Float64_2_2, ... M x N matrix of Float64, M, N = 2, 3, or 4
"Color" yesmi::IColor mi::Color 4 x Float32 representing RGBA color
"Color3" yesmi::IColor3 mi::Color 3 x Float32 representing RGB color
"Spectrum" yesmi::ISpectrum mi::Spectrum 3 x Float32 representing three color bands
"Bbox3" nomi::IBbox3 mi::Bbox3 Bounding box, represented by two mi::Float32_3
Pixel types

Pixel types denote the type of the pixel of a canvas or image. The table below lists the valid pixel types. See also mi::neuraylib::ICanvas and mi::neuraylib::ITile.

Type name Interface C++ class Description
"Sint8" mi::ISint8mi::Sint8 Signed 8-bit integer (6)
"Sint32" mi::ISint32mi::Sint32 Signed 32-bit integer
"Float32" mi::IFloat32mi::Float32 32-bit IEEE-754 single-precision floating-point number
"Float32<2>" mi::IFloat32_2mi::Float32_2 2 x Float32
"Float32<3>" mi::IFloat32_3mi::Float32_3 3 x Float32
"Float32<4>" mi::IFloat32_4mi::Float32_4 4 x Float32
"Rgb" -- 3 x Uint8 representing RGB color
"Rgba" -- 4 x Uint8 representing RGBA color
"Rgbe" -- 4 x Uint8 representing RGBE color
"Rgbea" -- 5 x Uint8 representing RGBEA color
"Rgb_16" -- 3 x Uint16 representing RGB color
"Rgba_16" -- 4 x Uint16 representing RGBA color
"Rgb_fp" -- 3 x Float32 representing RGB color
"Color" mi::IColormi::Color 4 x Float32 representing RGBA color

(6) For most purposes, in particular for pixel type conversion, the data is actually treated as unsigned 8-bit integer.

Function Documentation

 get_value() [1/13]

mi::Sint32 mi::get_value ( const mi::IData data,
const char *&  value 
)
inline

This specialization handles mi::IString and mi::IRef.

It expects a const char* argument. See mi::get_value() for details.

 get_value() [2/13]

template<class T>
mi::Sint32 mi::get_value ( const mi::IData data,
const char *  key,
T &  value 
)

This variant handles elements of collections identified via an additional key.

See also mi::get_value(const mi::IData*,T*,mi::Size n) and mi::get_value(const mi::IData*,std::vector<T>&) to read entire arrays.

Parameters
dataThe instance of mi::IData to read.
keyThe key of the affected collection element.
valueThe new value will be stored here.
Returns
  • 0: Success.
  • -1: The dynamic type of data does not match the static type of value.
  • -3: The key is not valid.

 get_value() [3/13]

mi::Sint32 mi::get_value ( const mi::IData data,
mi::base::Uuid value 
)
inline

This specialization handles mi::IUuid.

It expects an mi::base::Uuid argument. See mi::get_value() for details.

 get_value() [4/13]

mi::Sint32 mi::get_value ( const mi::IData data,
mi::Bbox3 value 
)
inline

This specialization handles mi::IBbox3.

It expects an mi::Bbox3 argument. See mi::get_value() for details.

 get_value() [5/13]

mi::Sint32 mi::get_value ( const mi::IData data,
mi::Color value 
)
inline

This specialization handles mi::IColor and mi::IColor3.

It expects an mi::Color argument. See mi::get_value() for details.

 get_value() [6/13]

template<class T , Size ROW, Size COL>
mi::Sint32 mi::get_value ( const mi::IData data,
mi::math::Matrix<T, ROW, COL> &  value 
)

This specialization handles the matrix specializations of mi::ICompound.

It expects one of the following specializations of mi::math::Matrix as its second argument:

See mi::get_value() for details.

 get_value() [7/13]

template<class T , Size DIM>
mi::Sint32 mi::get_value ( const mi::IData data,
mi::math::Vector<T, DIM> &  value 
)
inline

This specialization handles the vector specializations of mi::ICompound.

It expects one of the following specializations of mi::math::Vector as its second argument:

See mi::get_value() for details.

 get_value() [8/13]

template<class T>
mi::Sint32 mi::get_value ( const mi::IData data,
mi::Size  index,
T &  value 
)

This variant handles elements of collections identified via an additional index.

See also mi::get_value(const mi::IData*,T*,mi::Size n) and mi::get_value(const mi::IData*,std::vector<T>&) to read entire arrays.

Parameters
dataThe instance of mi::IData to read.
indexThe index of the affected collection element.
valueThe new value will be stored here.
Returns
  • 0: Success.
  • -1: The dynamic type of data does not match the static type of value.
  • -3: The index is not valid.

 get_value() [9/13]

mi::Sint32 mi::get_value ( const mi::IData data,
mi::Spectrum value 
)
inline

This specialization handles mi::ISpectrum.

It expects an mi::Spectrum argument. See mi::get_value() for details.

 get_value() [10/13]

mi::Sint32 mi::get_value ( const mi::IData data,
std::string &  value 
)
inline

This variant handles strings as std::string.

See also mi::get_value(const IData*,const char*&) for C-strings.

Parameters
dataThe instance of mi::IData to read.
valueThe new values will be stored here.
Returns
  • 0: Success.
  • -1: The dynamic type of data does not match.

 get_value() [11/13]

template<class T>
mi::Sint32 mi::get_value ( const mi::IData data,
std::vector<T> &  values 
)

This variant handles entire arrays (as std::vector).

See also mi::get_value(const IData*,T*,mi::Size) for C-like arrays.

Parameters
dataThe instance of mi::IData to read.
valuesThe new values will be stored here. The vector will be resized accordingly.
Returns
  • 0: Success.
  • -1: The dynamic type of data is not an array, or the dynamic type of the array elements does not match the static type of values.

 get_value() [12/13]

template<class T>
mi::Sint32 mi::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.

Parameters
dataThe instance of mi::IData to read.
[out]valueThe new value will be stored here.
Returns
  • 0: Success.
  • -1: The dynamic type of data does not match the static type of value.

This general template handles mi::INumber, and expects one of the following types as second argument:

It also handles mi::IEnum and expects an mi::Sint32 argument in that case.

 get_value() [13/13]

template<class T>
mi::Sint32 mi::get_value ( const mi::IData data,
T *  values,
mi::Size  n 
)

This variant handles entire arrays (as C-like arrays).

See also mi::get_value(const IData*,std::vector<T>&) for std::vector support.

Parameters
dataThe instance of mi::IData to read.
valuesThe new values will be stored here (as pointer to a C-like array).
nThe size of the C-like array (needs to match the size of data).
Returns
  • 0: Success.
  • -1: The dynamic type of data is not an array, or the dynamic type of the array elements does not match the static type of values.
  • -5: The array sizes do not match.

 set_value() [1/13]

template<class T>
mi::Sint32 mi::set_value ( mi::IData data,
const char *  key,
const T &  value 
)

This variant handles elements of collections identified via an additional key.

See also mi::set_value(mi::IData*,const T*,mi::Size n) and mi::set_value(mi::IData*,const std::vector<T>&) to set entire arrays.

Parameters
dataThe instance of mi::IData to modify.
keyThe key of the affected collection element.
valueThe new value to be set.
Returns
  • 0: Success.
  • -1: The dynamic type of data does not match the static type of value.
  • -2: The value of value is not valid.
  • -3: The key is not valid.

 set_value() [2/13]

mi::Sint32 mi::set_value ( mi::IData data,
const char *  value 
)
inline

This specialization handles mi::IString and mi::IRef.

It expects a const char* argument. See mi::set_value() for details.

 set_value() [3/13]

mi::Sint32 mi::set_value ( mi::IData data,
const mi::base::Uuid value 
)
inline

This specialization handles mi::IUuid.

It expects an mi::base::Uuid argument. See mi::set_value() for details.

 set_value() [4/13]

mi::Sint32 mi::set_value ( mi::IData data,
const mi::Bbox3 value 
)
inline

This specialization handles mi::IBbox3.

It expects an mi::Bbox3 argument. See mi::set_value() for details.

 set_value() [5/13]

mi::Sint32 mi::set_value ( mi::IData data,
const mi::Color value 
)
inline

This specialization handles mi::IColor and mi::IColor3.

It expects an mi::Color argument. See mi::set_value() for details.

 set_value() [6/13]

template<class T , Size ROW, Size COL>
mi::Sint32 mi::set_value ( mi::IData data,
const mi::math::Matrix<T, ROW, COL> &  value 
)

This specialization handles the matrix specializations of mi::ICompound.

It expects one of the following specializations of mi::math::Matrix as its second argument:

See mi::set_value() for details.

 set_value() [7/13]

template<class T , Size DIM>
mi::Sint32 mi::set_value ( mi::IData data,
const mi::math::Vector<T, DIM> &  value 
)
inline

This specialization handles the vector specializations of mi::ICompound.

It expects one of the following specializations of mi::math::Vector as its second argument:

See mi::set_value() for details.

 set_value() [8/13]

mi::Sint32 mi::set_value ( mi::IData data,
const mi::Spectrum value 
)
inline

This specialization handles mi::ISpectrum.

It expects an mi::Spectrum argument. See mi::set_value() for details.

 set_value() [9/13]

mi::Sint32 mi::set_value ( mi::IData data,
const std::string &  value 
)
inline

This specialization handles mi::IString and mi::IRef.

It expects a const std::string& argument. See mi::set_value() for details.

 set_value() [10/13]

template<class T>
mi::Sint32 mi::set_value ( mi::IData data,
const std::vector<T> &  values 
)

This variant handles entire arrays (as std::vector).

See also mi::set_value(mi::IData*,const T*,mi::Size) for C-like arrays.

Parameters
dataThe instance of mi::IData to modify.
valuesThe new values to be set. If data is a dynamic array, then it is resized accordingly. If data is a static array, then its size needs to match the size of values.
Returns
  • 0: Success.
  • -1: The dynamic type of data is not an array, or the dynamic type of the array elements does not match the static type of values.
  • -2: At least one value of values is not valid (possibly incomplete operation)
  • -5: The array sizes do not match (if data is a static array).

 set_value() [11/13]

template<class T>
mi::Sint32 mi::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.

Parameters
dataThe instance of mi::IData to modify.
valueThe new value to be set.
Returns
  • 0: Success.
  • -1: The dynamic type of data does not match the static type of value.
  • -2: The value of value is not valid.

This general template handles mi::INumber and expects one of the following types as second argument:

It also handles mi::IEnum and expects an mi::Sint32 argument in that case.

 set_value() [12/13]

template<class T>
mi::Sint32 mi::set_value ( mi::IData data,
const T *  values,
mi::Size  n 
)

This variant handles entire arrays (as C-like array).

See also mi::set_value(mi::IData*,const std::vector<T>&) for std::vector support.

Parameters
dataThe instance of mi::IData to modify.
valuesThe new values to be set (as pointer to a C-like array).
nThe size of the C-like array. If data is a dynamic array, then it is resized accordingly. If data is a static array, then n needs to match the size of data.
Returns
  • 0: Success.
  • -1: The dynamic type of data is not an array, or the dynamic type of the array elements does not match the static type of values.
  • -2: At least one value of values is not valid (possibly incomplete operation).
  • -5: The array sizes do not match (if data is a static array).

 set_value() [13/13]

template<class T>
mi::Sint32 mi::set_value ( mi::IData data,
mi::Size  index,
const T &  value 
)

This variant handles elements of collections identified via an additional index.

See also mi::set_value(mi::IData*,const T*,mi::Size n) and mi::set_value(mi::IData*,const std::vector<T>&) to set entire arrays.

Parameters
dataThe instance of mi::IData to modify.
indexThe index of the affected collection element.
valueThe new value to be set.
Returns
  • 0: Success.
  • -1: The dynamic type of data does not match the static type of value.
  • -2: The value of value is not valid.
  • -3: The index or key is not valid for the collection.