MDL SDK API nvidia_logo_transpbg.gif Up
imdl_module_builder.h
Go to the documentation of this file.
1/***************************************************************************************************
2 * Copyright 2025 NVIDIA Corporation. All rights reserved.
3 **************************************************************************************************/
6
7#ifndef MI_NEURAYLIB_IMDL_MODULE_BUILDER_H
8#define MI_NEURAYLIB_IMDL_MODULE_BUILDER_H
9
11#include <mi/neuraylib/itype.h>
13
14namespace mi {
15
16class IArray;
17
18namespace neuraylib {
19
20class IAnnotation_block;
21class IAnnotation_list;
22class IExpression;
23class IExpression_list;
24class IMdl_execution_context;
25
34 base::Interface_declare<0x2357f2f8,0x4428,0x47e5,0xaa,0x92,0x97,0x98,0x25,0x5d,0x26,0x57>
35{
36public:
61 const char* name,
62 const char* prototype_name,
63 const IExpression_list* defaults,
64 const IAnnotation_block* annotations,
65 const IAnnotation_block* return_annotations,
66 bool is_exported,
67 bool is_declarative,
68 IMdl_execution_context* context) = 0;
69
70#ifdef MI_NEURAYLIB_DEPRECATED_15_0
71 inline Sint32 add_variant(
72 const char* name,
73 const char* prototype_name,
74 const IExpression_list* defaults,
75 const IAnnotation_block* annotations,
76 const IAnnotation_block* return_annotations,
77 bool is_exported,
79 {
80 return add_variant(
81 name,
82 prototype_name,
83 defaults,
84 annotations,
85 return_annotations,
86 is_exported,
87 false,
88 context);
89 }
90#endif // MI_NEURAYLIB_DEPRECATED_15_0
91
122 const char* name,
123 const IExpression* body,
124 const IExpression_list* temporaries,
125 const IType_list* parameters,
126 const IExpression_list* defaults,
127 const IAnnotation_list* parameter_annotations,
128 const IAnnotation_block* annotations,
129 const IAnnotation_block* return_annotations,
130 bool is_exported,
131 bool is_declarative,
132 IType::Modifier frequency_qualifier,
133 IMdl_execution_context* context) = 0;
134
135#ifdef MI_NEURAYLIB_DEPRECATED_15_0
136 inline Sint32 add_function(
137 const char* name,
138 const IExpression* body,
139 const IType_list* parameters,
140 const IExpression_list* defaults,
141 const IAnnotation_list* parameter_annotations,
142 const IAnnotation_block* annotations,
143 const IAnnotation_block* return_annotations,
144 bool is_exported,
145 IType::Modifier frequency_qualifier,
146 IMdl_execution_context* context)
147 {
148 return add_function(
149 name, body, 0, parameters, defaults, parameter_annotations, annotations,
150 return_annotations, is_exported, false, frequency_qualifier, context);
151 }
152#endif // MI_NEURAYLIB_DEPRECATED_15_0
153
168 const char* name,
169 const IType_list* parameters,
170 const IExpression_list* defaults,
171 const IAnnotation_list* parameter_annotations,
172 const IAnnotation_block* annotations,
173 bool is_exported,
174 IMdl_execution_context* context) = 0;
175
185 const char* name,
186 const IAnnotation_block* annotations,
187 bool is_exported,
188 IMdl_execution_context* context) = 0;
189
205 const char* name,
206 const IExpression_list* enumerators,
207 const IAnnotation_list* enumerator_annotations,
208 const IAnnotation_block* annotations,
209 bool is_exported,
210 IMdl_execution_context* context) = 0;
211
233 const char* name,
234 const IType_list* fields,
235 const IExpression_list* field_defaults,
236 const IAnnotation_list* field_annotations,
237 const IAnnotation_block* annotations,
238 bool is_exported,
239 bool is_declarative,
240 const IStruct_category* struct_category,
241 IMdl_execution_context* context) = 0;
242
243#ifdef MI_NEURAYLIB_DEPRECATED_15_0
244 inline Sint32 add_struct_type(
245 const char* name,
246 const IType_list* fields,
247 const IExpression_list* field_defaults,
248 const IAnnotation_list* field_annotations,
249 const IAnnotation_block* annotations,
250 bool is_exported,
251 IMdl_execution_context* context)
252 {
253 return add_struct_type(
254 name,
255 fields,
256 field_defaults,
257 field_annotations,
258 annotations,
259 is_exported,
260 false,
261 0,
262 context);
263 }
264#endif // MI_NEURAYLIB_DEPRECATED_15_0
265
277 const char* name,
278 const IExpression* expr,
279 const IAnnotation_block* annotations,
280 bool is_exported,
281 IMdl_execution_context* context) = 0;
282
290 const IAnnotation_block* annotations, IMdl_execution_context* context) = 0;
291
302 const char* name, Size index, IMdl_execution_context* context) = 0;
303
306
342 virtual const IArray* analyze_uniform(
343 const IExpression* root_expr, bool root_expr_uniform, IMdl_execution_context* context) = 0;
344};
345 // end group mi_neuray_mdl_misc
347
348} // namespace neuraylib
349
350} // namespace mi
351
352#endif // MI_NEURAYLIB_IMDL_MODULE_BUILDER_H
This interface represents static arrays, i.e., arrays with a fixed number of elements.
Definition: iarray.h:37
Mixin class template for deriving new interface declarations.
Definition: interface_declare.h:43
An annotation block is an array of annotations.
Definition: iexpression.h:580
An ordered collection of annotation blocks identified by name or index.
Definition: iexpression.h:610
An ordered collection of expressions identified by name or index.
Definition: iexpression.h:319
The interface to MDL expressions.
Definition: iexpression.h:51
The execution context can be used to query status information like error and warning messages concern...
Definition: imdl_execution_context.h:131
The module builder allows to create new MDL modules.
Definition: imdl_module_builder.h:35
virtual Sint32 add_struct_type(const char *name, const IType_list *fields, const IExpression_list *field_defaults, const IAnnotation_list *field_annotations, const IAnnotation_block *annotations, bool is_exported, bool is_declarative, const IStruct_category *struct_category, IMdl_execution_context *context)=0
Adds a struct type to the module.
virtual Sint32 set_module_annotations(const IAnnotation_block *annotations, IMdl_execution_context *context)=0
Sets the annotations of the module itself.
virtual Sint32 add_annotation(const char *name, const IType_list *parameters, const IExpression_list *defaults, const IAnnotation_list *parameter_annotations, const IAnnotation_block *annotations, bool is_exported, IMdl_execution_context *context)=0
Adds an annotation to the module.
virtual Sint32 add_function(const char *name, const IExpression *body, const IExpression_list *temporaries, const IType_list *parameters, const IExpression_list *defaults, const IAnnotation_list *parameter_annotations, const IAnnotation_block *annotations, const IAnnotation_block *return_annotations, bool is_exported, bool is_declarative, IType::Modifier frequency_qualifier, IMdl_execution_context *context)=0
Adds a material or function to the module.
virtual Sint32 remove_entity(const char *name, Size index, IMdl_execution_context *context)=0
Removes a material, function, enum or struct type from the module.
virtual Sint32 add_struct_category(const char *name, const IAnnotation_block *annotations, bool is_exported, IMdl_execution_context *context)=0
Adds a struct category the module.
virtual Sint32 add_variant(const char *name, const char *prototype_name, const IExpression_list *defaults, const IAnnotation_block *annotations, const IAnnotation_block *return_annotations, bool is_exported, bool is_declarative, IMdl_execution_context *context)=0
Adds a variant to the module.
virtual Sint32 add_constant(const char *name, const IExpression *expr, const IAnnotation_block *annotations, bool is_exported, IMdl_execution_context *context)=0
Adds a constant to the module.
virtual const IArray * analyze_uniform(const IExpression *root_expr, bool root_expr_uniform, IMdl_execution_context *context)=0
Analyzes which parameters need to be uniform.
virtual Sint32 add_enum_type(const char *name, const IExpression_list *enumerators, const IAnnotation_list *enumerator_annotations, const IAnnotation_block *annotations, bool is_exported, IMdl_execution_context *context)=0
Adds an enum type to the module.
virtual Sint32 clear_module(IMdl_execution_context *context)=0
Clears the module, i.e., removes all entities from the module.
Represents the optional struct category for struct types.
Definition: itype.h:49
An ordered collection of types identified by name or index.
Definition: itype.h:650
Modifier
The possible kinds of type modifiers.
Definition: itype.h:201
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
Mixin class template for deriving new interface declarations.
Types of the MDL type system.
Common namespace for APIs of NVIDIA Advanced Rendering Center GmbH.
Definition: example_derivatives.dox:5
Major and minor version number and an optional qualifier.