Material Definition Language API nvidia_logo_transpbg.gif Up
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
mi::neuraylib::ITarget_value_layout Class Referenceabstract

Represents the layout of an mi::neuraylib::ITarget_argument_block with support for nested elements. More...

Inheritance diagram for mi::neuraylib::ITarget_value_layout:
mi::base::Interface_declare< 0x1003351f, 0x0c31, 0x4a9d, 0xb9, 0x99, 0x90, 0xb5, 0xe4, 0xb4, 0x71, 0xe3 > mi::base::IInterface

Public Member Functions

virtual Size get_size () const =0
 Returns the size of the target argument block. More...
 
virtual Size get_num_elements (Target_value_layout_state state=Target_value_layout_state()) const =0
 Get the number of arguments / elements at the given layout state. More...
 
virtual Size get_layout (IValue::Kind &kind, Size &arg_size, Target_value_layout_state state=Target_value_layout_state()) const =0
 Get the offset, the size and the kind of the argument / element inside the argument block at the given layout state. More...
 
virtual Target_value_layout_state get_nested_state (Size i, Target_value_layout_state state=Target_value_layout_state()) const =0
 Get the layout state for the i'th argument / element inside the argument value block at the given layout state. More...
 
virtual Sint32 set_value (char *block, IValue const *value, ITarget_resource_callback *resource_callback, Target_value_layout_state state=Target_value_layout_state()) const =0
 Set the value inside the given block at the given layout state. More...
 

Additional Inherited Members

- Public Types inherited from mi::base::Interface_declare< 0x1003351f, 0x0c31, 0x4a9d, 0xb9, 0x99, 0x90, 0xb5, 0xe4, 0xb4, 0x71, 0xe3 >
typedef Interface_declare< id1,
id2, id3, id4, id5, id6, id7,
id8, id9, id10, id11,
IInterface
Self
 Own type. More...
 
typedef Uuid_t< id1, id2, id3,
id4, id5, id6, id7, id8, id9,
id10, id11 > 
IID
 Declares the interface ID (IID) of this interface. More...
 
- Static Public Member Functions inherited from mi::base::Interface_declare< 0x1003351f, 0x0c31, 0x4a9d, 0xb9, 0x99, 0x90, 0xb5, 0xe4, 0xb4, 0x71, 0xe3 >
static bool compare_iid (const Uuid &iid)
 Compares the interface ID iid against the interface ID of this interface and of its ancestors. More...
 

Detailed Description

Represents the layout of an mi::neuraylib::ITarget_argument_block with support for nested elements.

The structure of the layout corresponds to the structure of the arguments of the compiled material not of the original material. Especially note, that the i'th argument of a compiled material does not in general correspond to the i'th argument of the original material.

See Instance-compilation and class-compilation for more details.

Member Function Documentation

virtual Size mi::neuraylib::ITarget_value_layout::get_layout ( IValue::Kind kind,
Size arg_size,
Target_value_layout_state  state = Target_value_layout_state() 
) const
pure virtual

Get the offset, the size and the kind of the argument / element inside the argument block at the given layout state.

Parameters
[out]kindReceives the kind of the argument.
[out]arg_sizeReceives the size of the argument.
stateThe layout state representing the current nesting within the argument value block. The default value is used for the top-level.
Returns
the offset of the requested argument / element or "~mi::Size(0)" if the state is invalid.
virtual Target_value_layout_state mi::neuraylib::ITarget_value_layout::get_nested_state ( Size  i,
Target_value_layout_state  state = Target_value_layout_state() 
) const
pure virtual

Get the layout state for the i'th argument / element inside the argument value block at the given layout state.

Parameters
iThe index of the argument / element.
stateThe layout state representing the current nesting within the argument value block. The default value is used for the top-level.
Returns
the layout state for the nested element or a state with "~mi::Uint32(0)" as m_state_offs if the element is atomic.
virtual Size mi::neuraylib::ITarget_value_layout::get_num_elements ( Target_value_layout_state  state = Target_value_layout_state()) const
pure virtual

Get the number of arguments / elements at the given layout state.

Parameters
stateThe layout state representing the current nesting within the argument value block. The default value is used for the top-level.
virtual Size mi::neuraylib::ITarget_value_layout::get_size ( ) const
pure virtual

Returns the size of the target argument block.

virtual Sint32 mi::neuraylib::ITarget_value_layout::set_value ( char *  block,
IValue const *  value,
ITarget_resource_callback resource_callback,
Target_value_layout_state  state = Target_value_layout_state() 
) const
pure virtual

Set the value inside the given block at the given layout state.

Parameters
[in,out]blockThe argument value block buffer to be modified.
[in]valueThe value to be set. It has to match the expected kind.
[in]resource_callbackCallback for retrieving resource indices for resource values.
[in]stateThe layout state representing the current nesting within the argument value block. The default value is used for the top-level.
Returns
  • 0: Success.
  • -1: Invalid parameters, block or value is a NULL pointer.
  • -2: Invalid state provided.
  • -3: Value kind does not match expected kind.
  • -4: Size of compound value does not match expected size.
  • -5: Unsupported value type.