Iray SDK API nvidia_logo_transpbg.gif Up
ifunction_call.h
Go to the documentation of this file.
1/***************************************************************************************************
2 * Copyright 2024 NVIDIA Corporation. All rights reserved.
3 **************************************************************************************************/
6
7#ifndef MI_NEURAYLIB_IFUNCTION_CALL_H
8#define MI_NEURAYLIB_IFUNCTION_CALL_H
9
10#include <cstring>
11
15
16namespace mi {
17
18namespace neuraylib {
19
23class IMdl_execution_context;
24
32 MDL_REPAIR_OPTIONS_FORCE_32_BIT = 0xffffffffU // Undocumented, for alignment only
33};
34
35mi_static_assert( sizeof( Mdl_repair_options) == sizeof( Uint32));
36
49class IFunction_call : public
50 mi::base::Interface_declare<0x67b29f5f,0xdbc1,0x4300,0x94,0x53,0x3e,0x2d,0x28,0x29,0xc1,0xe9,
51 neuraylib::IScene_element>
52{
53public:
60 virtual const char* get_function_definition() const = 0;
61
66 virtual const char* get_mdl_function_definition() const = 0;
67
69 virtual bool is_material() const = 0;
70
74 inline bool is_array_constructor() const
75 { return strcmp( get_mdl_function_definition(), "T[](...)") == 0; }
76
78 virtual const IType* get_return_type() const = 0;
79
81 virtual Size get_parameter_count() const = 0;
82
87 virtual const char* get_parameter_name( Size index) const = 0;
88
93 virtual Size get_parameter_index( const char* name) const = 0;
94
96 virtual const IType_list* get_parameter_types() const = 0;
97
99 virtual const IExpression_list* get_arguments() const = 0;
100
125 virtual Sint32 set_arguments( const IExpression_list* arguments) = 0;
126
152 virtual Sint32 set_argument( Size index, const IExpression* argument) = 0;
153
179 virtual Sint32 set_argument( const char* name, const IExpression* argument) = 0;
180
195 virtual Sint32 reset_argument( Size index) = 0;
196
212 virtual Sint32 reset_argument( const char* name) = 0;
213
221 virtual bool is_default() const = 0;
222
235 virtual bool is_valid( IMdl_execution_context* context) const = 0;
236
245 virtual Sint32 repair( Uint32 flags, IMdl_execution_context* context) = 0;
246};
247 // end group mi_neuray_mdl_elements
249
250} // namespace neuraylib
251
252} // namespace mi
253
254#endif // MI_NEURAYLIB_IFUNCTION_CALL
Mixin class template for deriving new interface declarations.
Definition: interface_declare.h:43
An ordered collection of expressions identified by name or index.
Definition: iexpression.h:315
The interface to MDL expressions.
Definition: iexpression.h:48
This interface represents a function call.
Definition: ifunction_call.h:52
virtual Sint32 reset_argument(const char *name)=0
Resets an argument identified by name.
virtual const char * get_mdl_function_definition() const =0
Returns the MDL name of the corresponding function definition.
virtual Sint32 set_argument(Size index, const IExpression *argument)=0
Sets the argument at index.
virtual const IType * get_return_type() const =0
Returns the return type of the corresponding function definition.
virtual bool is_default() const =0
Indicates, if this function call acts as a default argument of a material or function definition.
virtual bool is_valid(IMdl_execution_context *context) const =0
Returns true if this function call and all its arguments point to valid material and function definit...
virtual const IType_list * get_parameter_types() const =0
Returns the types of all parameters.
virtual Sint32 repair(Uint32 flags, IMdl_execution_context *context)=0
Attempts to repair an invalid function call.
virtual Size get_parameter_index(const char *name) const =0
Returns the index position of a parameter.
virtual Sint32 reset_argument(Size index)=0
Resets the argument at index.
virtual Sint32 set_arguments(const IExpression_list *arguments)=0
Sets multiple arguments.
bool is_array_constructor() const
Indicates whether this call is an instance of the array constructor.
Definition: ifunction_call.h:74
virtual Sint32 set_argument(const char *name, const IExpression *argument)=0
Sets an argument identified by name.
virtual bool is_material() const =0
Indicates whether the call represents a material instance.
virtual const char * get_function_definition() const =0
Returns the DB name of the corresponding function definition.
virtual const char * get_parameter_name(Size index) const =0
Returns the name of the parameter at index.
virtual const IExpression_list * get_arguments() const =0
Returns all arguments.
virtual Size get_parameter_count() const =0
Returns the number of parameters.
The execution context can be used to query status information like error and warning messages concern...
Definition: imdl_execution_context.h:131
An ordered collection of types identified by name or index.
Definition: itype.h:540
The interface to MDL types.
Definition: itype.h:51
#define mi_static_assert(expr)
Compile time assertion that raises a compilation error if the constant expression expr evaluates to f...
Definition: assert.h:65
unsigned int Uint32
32-bit unsigned integer.
Definition: types.h:49
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
Mdl_repair_options
Options for repairing function calls.
Definition: ifunction_call.h:28
@ MDL_REMOVE_INVALID_ARGUMENTS
Remove an invalid call attached to an argument.
Definition: ifunction_call.h:30
@ MDL_REPAIR_DEFAULT
Default mode, do not alter any inputs.
Definition: ifunction_call.h:29
@ MDL_REPAIR_INVALID_ARGUMENTS
Attempt to repair invalid calls attached to an argument.
Definition: ifunction_call.h:31
Expressions of the MDL type system.
API component that gives access to some MDL functionality.
Base class for all scene elements.
Common namespace for APIs of NVIDIA Advanced Rendering Center GmbH.
Definition: neuraylib.h:179