MDL SDK API nvidia_logo_transpbg.gif Up
imdl_module_builder.h
Go to the documentation of this file.
1/***************************************************************************************************
2 * Copyright 2024 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:
58 const char* name,
59 const char* prototype_name,
60 const IExpression_list* defaults,
61 const IAnnotation_block* annotations,
62 const IAnnotation_block* return_annotations,
63 bool is_exported,
64 bool is_declarative,
65 IMdl_execution_context* context) = 0;
66
67#ifdef MI_NEURAYLIB_DEPRECATED_15_0
68 inline Sint32 add_variant(
69 const char* name,
70 const char* prototype_name,
71 const IExpression_list* defaults,
72 const IAnnotation_block* annotations,
73 const IAnnotation_block* return_annotations,
74 bool is_exported,
76 {
77 return add_variant(
78 name,
79 prototype_name,
80 defaults,
81 annotations,
82 return_annotations,
83 is_exported,
84 false,
85 context);
86 }
87#endif // MI_NEURAYLIB_DEPRECATED_15_0
88
119 const char* name,
120 const IExpression* body,
121 const IExpression_list* temporaries,
122 const IType_list* parameters,
123 const IExpression_list* defaults,
124 const IAnnotation_list* parameter_annotations,
125 const IAnnotation_block* annotations,
126 const IAnnotation_block* return_annotations,
127 bool is_exported,
128 bool is_declarative,
129 IType::Modifier frequency_qualifier,
130 IMdl_execution_context* context) = 0;
131
132#ifdef MI_NEURAYLIB_DEPRECATED_15_0
133 inline Sint32 add_function(
134 const char* name,
135 const IExpression* body,
136 const IType_list* parameters,
137 const IExpression_list* defaults,
138 const IAnnotation_list* parameter_annotations,
139 const IAnnotation_block* annotations,
140 const IAnnotation_block* return_annotations,
141 bool is_exported,
142 IType::Modifier frequency_qualifier,
143 IMdl_execution_context* context)
144 {
145 return add_function(
146 name, body, 0, parameters, defaults, parameter_annotations, annotations,
147 return_annotations, is_exported, false, frequency_qualifier, context);
148 }
149#endif // MI_NEURAYLIB_DEPRECATED_15_0
150
165 const char* name,
166 const IType_list* parameters,
167 const IExpression_list* defaults,
168 const IAnnotation_list* parameter_annotations,
169 const IAnnotation_block* annotations,
170 bool is_exported,
171 IMdl_execution_context* context) = 0;
172
182 const char* name,
183 const IAnnotation_block* annotations,
184 bool is_exported,
185 IMdl_execution_context* context) = 0;
186
202 const char* name,
203 const IExpression_list* enumerators,
204 const IAnnotation_list* enumerator_annotations,
205 const IAnnotation_block* annotations,
206 bool is_exported,
207 IMdl_execution_context* context) = 0;
208
229 const char* name,
230 const IType_list* fields,
231 const IExpression_list* field_defaults,
232 const IAnnotation_list* field_annotations,
233 const IAnnotation_block* annotations,
234 bool is_exported,
235 bool is_declarative,
236 const IStruct_category* struct_category,
237 IMdl_execution_context* context) = 0;
238
239#ifdef MI_NEURAYLIB_DEPRECATED_15_0
240 inline Sint32 add_struct_type(
241 const char* name,
242 const IType_list* fields,
243 const IExpression_list* field_defaults,
244 const IAnnotation_list* field_annotations,
245 const IAnnotation_block* annotations,
246 bool is_exported,
247 IMdl_execution_context* context)
248 {
249 return add_struct_type(
250 name,
251 fields,
252 field_defaults,
253 field_annotations,
254 annotations,
255 is_exported,
256 false,
257 0,
258 context);
259 }
260#endif // MI_NEURAYLIB_DEPRECATED_15_0
261
273 const char* name,
274 const IExpression* expr,
275 const IAnnotation_block* annotations,
276 bool is_exported,
277 IMdl_execution_context* context) = 0;
278
286 const IAnnotation_block* annotations, IMdl_execution_context* context) = 0;
287
298 const char* name, Size index, IMdl_execution_context* context) = 0;
299
302
338 virtual const IArray* analyze_uniform(
339 const IExpression* root_expr, bool root_expr_uniform, IMdl_execution_context* context) = 0;
340};
341 // end group mi_neuray_mdl_misc
343
344} // namespace neuraylib
345
346} // namespace mi
347
348#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:575
An ordered collection of annotation blocks identified by name or index.
Definition: iexpression.h:603
An ordered collection of expressions identified by name or index.
Definition: iexpression.h:317
The interface to MDL expressions.
Definition: iexpression.h:50
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:646
Modifier
The possible kinds of type modifiers.
Definition: itype.h:198
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
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.