MDL SDK API nvidia_logo_transpbg.gif Up
imdl_factory.h
Go to the documentation of this file.
1/***************************************************************************************************
2 * Copyright 2025 NVIDIA Corporation. All rights reserved.
3 **************************************************************************************************/
6
7#ifndef MI_NEURAYLIB_IMDL_FACTORY_H
8#define MI_NEURAYLIB_IMDL_FACTORY_H
9
13
14#ifdef MI_NEURAYLIB_DEPRECATED_14_0
16#endif
17
18namespace mi {
19
20class IArray;
21class IString;
22
23namespace neuraylib {
24
25class IExpression_factory;
26class IMdl_execution_context;
27class IMdl_module_builder;
28class IMdl_module_transformer;
29class ITransaction;
30class IType_factory;
31class IValue_bsdf_measurement;
32class IValue_factory;
33class IValue_light_profile;
34class IValue_texture;
35
51class IMdl_factory : public
52 mi::base::Interface_declare<0xba936279,0x4b71,0x42a4,0x95,0x37,0x98,0x69,0x97,0xb3,0x47,0x72>
53{
54public:
56
57
59 virtual IType_factory* create_type_factory( ITransaction* transaction) = 0;
60
63
66
69
78
80
82
120 ITransaction* transaction,
121 const char* file_path,
123 Float32 gamma,
124 const char* selector,
125 bool shared,
126 IMdl_execution_context* context) = 0;
127
128#ifdef MI_NEURAYLIB_DEPRECATED_14_0
130 ITransaction* transaction,
131 const char* file_path,
133 Float32 gamma,
134 const char* selector,
135 bool shared,
136 Sint32* errors = 0)
137 {
140 transaction, file_path, shape, gamma, selector, shared, context.get());
141 if( errors) {
142 mi::base::Handle<const IMessage> msg( context->get_error_message( 0));
143 *errors = msg ? msg->get_code() : 0;
144 }
145 return result;
146 }
147#endif // MI_NEURAYLIB_DEPRECATED_14_0
148
178 ITransaction* transaction,
179 const char* file_path,
180 bool shared,
181 IMdl_execution_context* context) = 0;
182
183#ifdef MI_NEURAYLIB_DEPRECATED_14_0
185 ITransaction* transaction,
186 const char* file_path,
187 bool shared,
188 Sint32* errors = 0)
189 {
192 transaction, file_path, shared, context.get());
193 if( errors) {
194 mi::base::Handle<const IMessage> msg( context->get_error_message( 0));
195 *errors = msg ? msg->get_code() : 0;
196 }
197 return result;
198 }
199#endif // MI_NEURAYLIB_DEPRECATED_14_0
200
230 ITransaction* transaction,
231 const char* file_path,
232 bool shared,
233 IMdl_execution_context* context) = 0;
234
235#ifdef MI_NEURAYLIB_DEPRECATED_14_0
237 ITransaction* transaction,
238 const char* file_path,
239 bool shared,
240 Sint32* errors = 0)
241 {
244 transaction, file_path, shared, context.get());
245 if( errors) {
246 mi::base::Handle<const IMessage> msg( context->get_error_message( 0));
247 *errors = msg ? msg->get_code() : 0;
248 }
249 return result;
250 }
251#endif // MI_NEURAYLIB_DEPRECATED_14_0
252
254
256
276 ITransaction* transaction,
277 const char* module_name,
278 Mdl_version min_module_version,
279 Mdl_version max_module_version,
280 IMdl_execution_context* context) = 0;
281
292 ITransaction* transaction, const char* module_name, IMdl_execution_context* context) = 0;
293
295
297
313 virtual const IString* get_db_module_name( const char* mdl_name) = 0;
314
330 virtual const IString* get_db_definition_name( const char* mdl_name) = 0;
331
333
335
373 virtual void analyze_uniform(
374 ITransaction* transaction,
375 const char* root_name,
376 bool root_uniform,
377 const IExpression* query_expr,
378 bool& query_result,
379 IString* error_path,
380 IMdl_execution_context* context) const = 0;
381
383
385
400 virtual const IString* decode_name( const char* name) = 0;
401
412 virtual const IString* encode_module_name( const char* name) = 0;
413
432 const char* name, const IArray* parameter_types) const = 0;
433
446 virtual const IString* encode_type_name( const char* name) const = 0;
447
449
451
453 virtual bool is_valid_mdl_identifier( const char* name) const = 0;
454
456};
457 // end group mi_neuray_mdl_misc
459
460} // namespace neuraylib
461
462} // namespace mi
463
464#endif // MI_NEURAYLIB_IMDL_FACTORY_H
This interface represents static arrays, i.e., arrays with a fixed number of elements.
Definition: iarray.h:37
A simple string class.
Definition: istring.h:22
Handle class template for interfaces, automatizing the lifetime control via reference counting.
Definition: handle.h:112
Mixin class template for deriving new interface declarations.
Definition: interface_declare.h:43
The interface for creating expressions.
Definition: iexpression.h:660
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
Factory for various MDL interfaces and functions.
Definition: imdl_factory.h:53
virtual IMdl_execution_context * create_execution_context()=0
Creates an execution context.
virtual IMdl_module_builder * create_module_builder(ITransaction *transaction, const char *module_name, Mdl_version min_module_version, Mdl_version max_module_version, IMdl_execution_context *context)=0
Creates a module builder for a given module.
virtual IMdl_execution_context * clone(const IMdl_execution_context *context)=0
Clones an execution context.
virtual bool is_valid_mdl_identifier(const char *name) const =0
Indicates whether the given string is a valid MDL identifier.
virtual IType_factory * create_type_factory(ITransaction *transaction)=0
Returns an MDL type factory for the given transaction.
virtual IValue_bsdf_measurement * create_bsdf_measurement(ITransaction *transaction, const char *file_path, bool shared, IMdl_execution_context *context)=0
Creates a value referencing a BSDF measurement identified by an MDL file path.
virtual const IString * encode_type_name(const char *name) const =0
Encodes an MDL type name.
virtual const IString * encode_module_name(const char *name)=0
Encodes a DB or MDL module name.
virtual IMdl_module_transformer * create_module_transformer(ITransaction *transaction, const char *module_name, IMdl_execution_context *context)=0
Creates a module transformer for a given module.
virtual void analyze_uniform(ITransaction *transaction, const char *root_name, bool root_uniform, const IExpression *query_expr, bool &query_result, IString *error_path, IMdl_execution_context *context) const =0
Analyzes whether an expression graph violates the uniform constraints.
virtual IExpression_factory * create_expression_factory(ITransaction *transaction)=0
Returns an MDL expression factory for the given transaction.
virtual IValue_texture * create_texture(ITransaction *transaction, const char *file_path, IType_texture::Shape shape, Float32 gamma, const char *selector, bool shared, IMdl_execution_context *context)=0
Creates a value referencing a texture identified by an MDL file path.
virtual const IString * get_db_module_name(const char *mdl_name)=0
Returns the DB name for the MDL name of a module (or file path for MDLE modules).
virtual const IString * decode_name(const char *name)=0
Decodes a DB or MDL name.
virtual const IString * encode_function_definition_name(const char *name, const IArray *parameter_types) const =0
Encodes a DB or MDL function or material definition name.
virtual IValue_light_profile * create_light_profile(ITransaction *transaction, const char *file_path, bool shared, IMdl_execution_context *context)=0
Creates a value referencing a light profile identified by an MDL file path.
virtual IValue_factory * create_value_factory(ITransaction *transaction)=0
Returns an MDL value factory for the given transaction.
virtual const IString * get_db_definition_name(const char *mdl_name)=0
Returns the DB name for the MDL name of an material or function definition.
The module builder allows to create new MDL modules.
Definition: imdl_module_builder.h:35
The module transformer allows to apply certain transformations on an MDL module.
Definition: imdl_module_transformer.h:38
A transaction provides a consistent view on the database.
Definition: itransaction.h:82
The interface for creating types.
Definition: itype.h:723
Shape
The possible texture shapes.
Definition: itype.h:562
A BSDF measurement value.
Definition: ivalue.h:560
The interface for creating values.
Definition: ivalue.h:660
A light profile value.
Definition: ivalue.h:547
A texture value.
Definition: ivalue.h:525
Interface * get() const
Access to the interface. Returns 0 for an invalid interface.
Definition: handle.h:289
int Sint32
32-bit signed integer.
Definition: types.h:46
float Float32
32-bit float.
Definition: types.h:51
Mdl_version
The MDL version.
Definition: iexpression.h:28
Expressions of the MDL type system.
The MDL execution context and the IMessage class.
Mixin class template for deriving new interface declarations.
Common namespace for APIs of NVIDIA Advanced Rendering Center GmbH.
Definition: example_derivatives.dox:5
Major and minor version number and an optional qualifier.