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:
56 const char* name,
57 const char* prototype_name,
58 const IExpression_list* defaults,
59 const IAnnotation_block* annotations,
60 const IAnnotation_block* return_annotations,
61 bool is_exported,
62 IMdl_execution_context* context) = 0;
63
92 const char* name,
93 const IExpression* body,
94 const IExpression_list* temporaries,
95 const IType_list* parameters,
96 const IExpression_list* defaults,
97 const IAnnotation_list* parameter_annotations,
98 const IAnnotation_block* annotations,
99 const IAnnotation_block* return_annotations,
100 bool is_exported,
101 IType::Modifier frequency_qualifier,
102 IMdl_execution_context* context) = 0;
103
104#ifdef MI_NEURAYLIB_DEPRECATED_15_0
105 inline Sint32 add_function(
106 const char* name,
107 const IExpression* body,
108 const IType_list* parameters,
109 const IExpression_list* defaults,
110 const IAnnotation_list* parameter_annotations,
111 const IAnnotation_block* annotations,
112 const IAnnotation_block* return_annotations,
113 bool is_exported,
114 IType::Modifier frequency_qualifier,
115 IMdl_execution_context* context)
116 {
117 return add_function(
118 name, body, 0, parameters, defaults, parameter_annotations, annotations,
119 return_annotations, is_exported, frequency_qualifier, context);
120 }
121#endif // MI_NEURAYLIB_DEPRECATED_15_0
122
137 const char* name,
138 const IType_list* parameters,
139 const IExpression_list* defaults,
140 const IAnnotation_list* parameter_annotations,
141 const IAnnotation_block* annotations,
142 bool is_exported,
143 IMdl_execution_context* context) = 0;
144
160 const char* name,
161 const IExpression_list* enumerators,
162 const IAnnotation_list* enumerator_annotations,
163 const IAnnotation_block* annotations,
164 bool is_exported,
165 IMdl_execution_context* context) = 0;
166
184 const char* name,
185 const IType_list* fields,
186 const IExpression_list* field_defaults,
187 const IAnnotation_list* field_annotations,
188 const IAnnotation_block* annotations,
189 bool is_exported,
190 IMdl_execution_context* context) = 0;
191
203 const char* name,
204 const IExpression* expr,
205 const IAnnotation_block* annotations,
206 bool is_exported,
207 IMdl_execution_context* context) = 0;
208
216 const IAnnotation_block* annotations,
217 IMdl_execution_context* context) = 0;
218
229 const char* name,
230 Size index,
231 IMdl_execution_context* context) = 0;
232
235
271 virtual const IArray* analyze_uniform(
272 const IExpression* root_expr,
273 bool root_expr_uniform,
274 IMdl_execution_context* context) = 0;
275};
276 // end group mi_neuray_mdl_misc
278
279} // namespace neuraylib
280
281} // namespace mi
282
283#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:573
An ordered collection of annotation blocks identified by name or index.
Definition: iexpression.h:601
An ordered collection of expressions identified by name or index.
Definition: iexpression.h:315
The interface to MDL expressions.
Definition: iexpression.h:48
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_variant(const char *name, const char *prototype_name, const IExpression_list *defaults, const IAnnotation_block *annotations, const IAnnotation_block *return_annotations, bool is_exported, IMdl_execution_context *context)=0
Adds a variant 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, IType::Modifier frequency_qualifier, IMdl_execution_context *context)=0
Adds a material or function 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 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_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, IMdl_execution_context *context)=0
Adds a struct type 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 declarations from the module.
An ordered collection of types identified by name or index.
Definition: itype.h:540
Modifier
The possible kinds of type modifiers.
Definition: itype.h:98
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.