NVIDIA Iray API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
mi::IMdl_function_call Class Referenceabstract

This interface represents a function call. More...

Inheritance diagram for mi::IMdl_function_call:
Inheritance graph
[legend]

Public Member Functions

virtual const char *  get_function_definition () const =0
  Returns the DB name of the corresponding function definition. More...
 
virtual const char *  get_name () const =0
  Returns the MDL name of the corresponding function definition. More...
 
virtual const char *  get_return_type () const =0
  Returns the return type. More...
 
virtual bool  is_return_type_varying () const =0
  Indicates whether the return type is varying. More...
 
virtual Uint32  get_parameter_count () const =0
  Returns the number of parameters. More...
 
virtual const char *  get_parameter_name (Uint32 index) const =0
  Returns the name of the parameter at index. More...
 
virtual Sint32  get_parameter_index (const char *name) const =0
  Returns the index position of a parameter. More...
 
virtual const char *  get_parameter_type (Uint32 index) const =0
  Returns the type of the parameter at index. More...
 
virtual const char *  get_parameter_type (const char *name) const =0
  Returns the type of a parameter. More...
 
virtual bool  is_parameter_type_uniform (Uint32 index) const =0
  Indicates whether the type of a parameter is uniform. More...
 
virtual bool  is_parameter_type_uniform (const char *name) const =0
  Indicates whether the type of a parameter is uniform. More...
 
virtual const char *  get_argument_type (Uint32 index) const =0
  Returns the type of the argument at index. More...
 
virtual const char *  get_argument_type (const char *name) const =0
  Returns the type of an argument. More...
 
virtual const IAttachable get_argument (Uint32 index) const =0
  Returns the argument at index. More...
 
template<class T >
const T *  get_argument (Uint32 index) const
  Returns the argument at index. More...
 
virtual const IAttachable get_argument (const char *name) const =0
  Returns the argument for a parameter. More...
 
template<class T >
const T *  get_argument (const char *name) const
  Returns the argument for a parameter. More...
 
virtual Sint32  set_argument (Uint32 index, const IAttachable *value)=0
  Sets the argument at index. More...
 
virtual Sint32  set_argument (const char *name, const IAttachable *value)=0
  Sets the argument for a parameter. More...
 
virtual const
IAttribute_container
access_arguments () const =0
  Returns the arguments of all parameters. More...
 
virtual Sint32  set_arguments (const IAttribute_container *arguments)=0
  Sets the arguments of multiple parameters. More...
 

Additional Inherited Members

- Public Types inherited from mi::base::Interface_declare< 0x308bcfb7, 0x6abc, 0x44cd, 0xb2, 0xdc, 0x0c, 0x88, 0x44, 0x0f, 0x9e, 0x32, IScene_element >
typedef Interface_declare< id1,
id2, id3, id4, id5, id6, id7,
id8, id9, id10, id11,
IScene_element
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< 0x308bcfb7, 0x6abc, 0x44cd, 0xb2, 0xdc, 0x0c, 0x88, 0x44, 0x0f, 0x9e, 0x32, IScene_element >
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

This interface represents a function call.

A function call is an instance of a formal function definition, with a fixed set of arguments (possibly the defaults of the function definition). Function calls can be created from function definitions using mi::IMdl_function_definition::create_function_call().

See Also
mi::IMdl_function_definition, mi::Mdl_argument_editor

Member Function Documentation

virtual const IAttribute_container* mi::IMdl_function_call::access_arguments ( ) const
pure virtual

Returns the arguments of all parameters.

Returns
The arguments.
virtual const IAttachable* mi::IMdl_function_call::get_argument ( Uint32  index) const
pure virtual

Returns the argument at index.

Note
The method mi::neuraylib::IFactory::clone() is useful to obtain a mutable pointer to (a clone of) the argument.

If a literal 0 is passed for index, the call is ambiguous. You need to explicitly cast the value to mi::Uint32.

Parameters
index The index of the argument.
Returns
The argument, or NULL if index is out of range.
template<class T >
const T* mi::IMdl_function_call::get_argument ( Uint32  index) const
inline

Returns the argument at index.

Note
The method mi::neuraylib::IFactory::clone() is useful to obtain a mutable pointer to (a clone of) the argument.

If a literal 0 is passed for index, the call is ambiguous. You need to explicitly cast the value to mi::Uint32.

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.

Template Parameters
T The interface type of the requested element
Parameters
index The index of the argument.
Returns
The argument, or NULL if index is out of range.
virtual const IAttachable* mi::IMdl_function_call::get_argument ( const char *  name) const
pure virtual

Returns the argument for a parameter.

Note
The method mi::neuraylib::IFactory::clone() is useful to obtain a mutable pointer to (a clone of) the argument.
Parameters
name The name of the parameter.
Returns
The argument, or NULL if name is invalid.
template<class T >
const T* mi::IMdl_function_call::get_argument ( const char *  name) const
inline

Returns the argument for a parameter.

Note
The method mi::neuraylib::IFactory::clone() is useful to obtain a mutable pointer to (a clone of) the argument.

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.

Template Parameters
T The interface type of the requested element
Parameters
name The name of the parameter.
Returns
The argument, or NULL if name is invalid.
virtual const char* mi::IMdl_function_call::get_argument_type ( Uint32  index) const
pure virtual

Returns the type of the argument at index.

The type of a given argument is an attachable of the corresponding parameter type. For example, if get_parameter_type() returns "Sint32", this method returns "Attachable<Sint32>".

If a literal 0 is passed for index, the call is ambiguous. You need to explicitly cast the value to mi::Uint32.

Parameters
index The index of the argument.
Returns
The argument type, or NULL if index is out of range.
virtual const char* mi::IMdl_function_call::get_argument_type ( const char *  name) const
pure virtual

Returns the type of an argument.

The type of a given argument is an attachable of the corresponding parameter type. For example, if get_parameter_type() returns "Sint32", this method returns "Attachable<Sint32>".

Parameters
name The name of the argument.
Returns
The argument type, or NULL if name is invalid.
virtual const char* mi::IMdl_function_call::get_function_definition ( ) const
pure virtual

Returns the DB name of the corresponding function definition.

The type of the function definition is mi::IMdl_function_definition.

Returns
The DB name of the function definition.
virtual const char* mi::IMdl_function_call::get_name ( ) const
pure virtual

Returns the MDL name of the corresponding function definition.

Note
The MDL name of the function definition is different from the name of the DB element. Use mi::neuraylib::ITransaction::name_of()to obtain the name of the DB element.
Returns
The MDL name of the function definition.
virtual Uint32 mi::IMdl_function_call::get_parameter_count ( ) const
pure virtual

Returns the number of parameters.

Returns
The number of function parameters.
virtual Sint32 mi::IMdl_function_call::get_parameter_index ( const char *  name) const
pure virtual

Returns the index position of a parameter.

Parameters
name The name of the parameter.
Returns
The index of the parameter, or -1 if name is invalid.
virtual const char* mi::IMdl_function_call::get_parameter_name ( Uint32  index) const
pure virtual

Returns the name of the parameter at index.

Parameters
index The index of the parameter.
Returns
The name of the parameter, or NULL if index is out of range.
virtual const char* mi::IMdl_function_call::get_parameter_type ( Uint32  index) const
pure virtual

Returns the type of the parameter at index.

If a literal 0 is passed for index, the call is ambiguous. You need to explicitly cast the value to mi::Uint32.

Parameters
index The index of the parameter.
Returns
The parameter type, or NULL if index is out of range.
virtual const char* mi::IMdl_function_call::get_parameter_type ( const char *  name) const
pure virtual

Returns the type of a parameter.

Parameters
name The name of the parameter.
Returns
The parameter type, or NULL if name is invalid.
virtual const char* mi::IMdl_function_call::get_return_type ( ) const
pure virtual

Returns the return type.

Returns
The return type of the function.
virtual bool mi::IMdl_function_call::is_parameter_type_uniform ( Uint32  index) const
pure virtual

Indicates whether the type of a parameter is uniform.

Parameters
index The index of the parameter.
Returns
true if the parameter is uniform, otherwise false (including invalid index).
virtual bool mi::IMdl_function_call::is_parameter_type_uniform ( const char *  name) const
pure virtual

Indicates whether the type of a parameter is uniform.

Parameters
name The name of the parameter.
Returns
true if the parameter is uniform, otherwise false (including invalid name).
virtual bool mi::IMdl_function_call::is_return_type_varying ( ) const
pure virtual

Indicates whether the return type is varying.

Returns
true if the return type is varying, otherwise false.
virtual Sint32 mi::IMdl_function_call::set_argument ( Uint32  index,
const IAttachable value 
)
pure virtual

Sets the argument at index.

Parameters
index The index of the argument.
value The argument. Note that the value is copied; passing a value obtained from another MDL interface does not create a link between both instances.
Returns
  • 0: Success.
  • -1: Invalid parameters (NULL pointer).
  • -2: Parameter index does not exist.
  • -3: Type of parameter does not match.
  • -4: The function call is immutable (because it appears in a default of a function or material definition).
  • -5: The parameter type is uniform, but the attachment has a varying return type.
virtual Sint32 mi::IMdl_function_call::set_argument ( const char *  name,
const IAttachable value 
)
pure virtual

Sets the argument for a parameter.

Parameters
name The name of the parameter.
value The argument. Note that the value is copied; passing a value obtained from another MDL interface does not create a link between both instances.
Returns
  • 0: Success.
  • -1: Invalid parameters (NULL pointer).
  • -2: Parameter name does not exist.
  • -3: Type of parameter does not match.
  • -4: The function call is immutable (because it appears in a default of a function or material definition).
  • -5: The parameter type is uniform, but the attachment has a varying return type.
virtual Sint32 mi::IMdl_function_call::set_arguments ( const IAttribute_container arguments)
pure virtual

Sets the arguments of multiple parameters.

Parameters
arguments The arguments. Note that the values are copied; passing an attribute container obtained from another MDL interface does not create a link between both instances.
Returns
  • 0: Success.
  • -1: Invalid parameters (NULL pointer).
  • -2: One of the parameters in arguments does not exist.
  • -3: The type of one of the parameters does not match.
  • -4: The function call is immutable (because it appears in a default of a function or material definition).
  • -5: The parameter type is uniform, but the attachment has a varying return type.