MDL SDK API nvidia_logo_transpbg.gif Up
ifunction_call.h
Go to the documentation of this file.
1/***************************************************************************************************
2 * Copyright 2025 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#include <mi/neuraylib/version.h> // for MI_NEURAYLIB_DEPRECATED_ENUM_VALUE
16
17namespace mi {
18
19namespace neuraylib {
20
24class IMdl_execution_context;
25
33 MI_NEURAYLIB_DEPRECATED_ENUM_VALUE(MDL_REPAIR_OPTIONS_FORCE_32_BIT, 0xffffffffU)
34};
35
48class IFunction_call : public
49 mi::base::Interface_declare<0x67b29f5f,0xdbc1,0x4300,0x94,0x53,0x3e,0x2d,0x28,0x29,0xc1,0xe9,
50 neuraylib::IScene_element>
51{
52public:
59 virtual const char* get_function_definition() const = 0;
60
65 virtual const char* get_mdl_function_definition() const = 0;
66
71 // to be declarative.
72 virtual bool is_declarative() const = 0;
73
79 virtual bool is_material() const = 0;
80
84 inline bool is_array_constructor() const
85 { return strcmp( get_mdl_function_definition(), "T[](...)") == 0; }
86
88 virtual const IType* get_return_type() const = 0;
89
91 virtual Size get_parameter_count() const = 0;
92
97 virtual const char* get_parameter_name( Size index) const = 0;
98
103 virtual Size get_parameter_index( const char* name) const = 0;
104
106 virtual const IType_list* get_parameter_types() const = 0;
107
109 virtual const IExpression_list* get_arguments() const = 0;
110
137 virtual Sint32 set_arguments( const IExpression_list* arguments) = 0;
138
166 virtual Sint32 set_argument( Size index, const IExpression* argument) = 0;
167
195 virtual Sint32 set_argument( const char* name, const IExpression* argument) = 0;
196
211 virtual Sint32 reset_argument( Size index) = 0;
212
228 virtual Sint32 reset_argument( const char* name) = 0;
229
237 virtual bool is_default() const = 0;
238
251 virtual bool is_valid( IMdl_execution_context* context) const = 0;
252
261 virtual Sint32 repair( Uint32 flags, IMdl_execution_context* context) = 0;
262};
263 // end group mi_neuray_mdl_elements
265
266} // namespace neuraylib
267
268} // namespace mi
269
270#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:316
The interface to MDL expressions.
Definition: iexpression.h:51
This interface represents a function call.
Definition: ifunction_call.h:51
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 bool is_declarative() const =0
Indicates whether the corresponding function definition is declarative.
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:84
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:163
An ordered collection of types identified by name or index.
Definition: itype.h:638
The interface to MDL types.
Definition: itype.h:153
int Sint32
32-bit signed integer.
Definition: types.h:46
Uint64 Size
Unsigned integral type that is large enough to hold the size of all types.
Definition: types.h:112
unsigned int Uint32
32-bit unsigned integer.
Definition: types.h:49
Mdl_repair_options
Options for repairing function calls.
Definition: ifunction_call.h:29
@ MDL_REMOVE_INVALID_ARGUMENTS
Remove an invalid call attached to an argument.
Definition: ifunction_call.h:31
@ MDL_REPAIR_DEFAULT
Default mode, do not alter any inputs.
Definition: ifunction_call.h:30
@ MDL_REPAIR_INVALID_ARGUMENTS
Attempt to repair invalid calls attached to an argument.
Definition: ifunction_call.h:32
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: example_derivatives.dox:5
Major and minor version number and an optional qualifier.