MDL 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
72 // to be declarative.
73 virtual bool is_declarative() const = 0;
74
80 virtual bool is_material() const = 0;
81
85 inline bool is_array_constructor() const
86 { return strcmp( get_mdl_function_definition(), "T[](...)") == 0; }
87
89 virtual const IType* get_return_type() const = 0;
90
92 virtual Size get_parameter_count() const = 0;
93
98 virtual const char* get_parameter_name( Size index) const = 0;
99
104 virtual Size get_parameter_index( const char* name) const = 0;
105
107 virtual const IType_list* get_parameter_types() const = 0;
108
110 virtual const IExpression_list* get_arguments() const = 0;
111
138 virtual Sint32 set_arguments( const IExpression_list* arguments) = 0;
139
167 virtual Sint32 set_argument( Size index, const IExpression* argument) = 0;
168
196 virtual Sint32 set_argument( const char* name, const IExpression* argument) = 0;
197
212 virtual Sint32 reset_argument( Size index) = 0;
213
229 virtual Sint32 reset_argument( const char* name) = 0;
230
238 virtual bool is_default() const = 0;
239
252 virtual bool is_valid( IMdl_execution_context* context) const = 0;
253
262 virtual Sint32 repair( Uint32 flags, IMdl_execution_context* context) = 0;
263};
264 // end group mi_neuray_mdl_elements
266
267} // namespace neuraylib
268
269} // namespace mi
270
271#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:317
The interface to MDL expressions.
Definition: iexpression.h:50
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 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:85
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:646
The interface to MDL types.
Definition: itype.h:151
#define mi_static_assert(expr)
Compile time assertion that raises a compilation error if the constant expression expr evaluates to f...
Definition: assert.h:58
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: example_derivatives.dox:5