MDL SDK API nvidia_logo_transpbg.gif Up
imdl_factory.h
Go to the documentation of this file.
1/***************************************************************************************************
2 * Copyright 2024 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 virtual IType_factory* create_type_factory( ITransaction* transaction) = 0;
57
60
63
66
75
113 ITransaction* transaction,
114 const char* file_path,
116 Float32 gamma,
117 const char* selector,
118 bool shared,
119 IMdl_execution_context* context) = 0;
120
121#ifdef MI_NEURAYLIB_DEPRECATED_14_0
123 ITransaction* transaction,
124 const char* file_path,
126 Float32 gamma,
127 const char* selector,
128 bool shared,
129 Sint32* errors = 0)
130 {
133 transaction, file_path, shape, gamma, selector, shared, context.get());
134 if( errors) {
135 mi::base::Handle<const IMessage> msg( context->get_error_message( 0));
136 *errors = msg ? msg->get_code() : 0;
137 }
138 return result;
139 }
140#endif // MI_NEURAYLIB_DEPRECATED_14_0
141
170 ITransaction* transaction,
171 const char* file_path,
172 bool shared,
173 IMdl_execution_context* context) = 0;
174
175#ifdef MI_NEURAYLIB_DEPRECATED_14_0
177 ITransaction* transaction,
178 const char* file_path,
179 bool shared,
180 Sint32* errors = 0)
181 {
184 transaction, file_path, shared, context.get());
185 if( errors) {
186 mi::base::Handle<const IMessage> msg( context->get_error_message( 0));
187 *errors = msg ? msg->get_code() : 0;
188 }
189 return result;
190 }
191#endif // MI_NEURAYLIB_DEPRECATED_14_0
192
222 ITransaction* transaction,
223 const char* file_path,
224 bool shared,
225 IMdl_execution_context* context) = 0;
226
227#ifdef MI_NEURAYLIB_DEPRECATED_14_0
229 ITransaction* transaction,
230 const char* file_path,
231 bool shared,
232 Sint32* errors = 0)
233 {
236 transaction, file_path, shared, context.get());
237 if( errors) {
238 mi::base::Handle<const IMessage> msg( context->get_error_message( 0));
239 *errors = msg ? msg->get_code() : 0;
240 }
241 return result;
242 }
243#endif // MI_NEURAYLIB_DEPRECATED_14_0
244
264 ITransaction* transaction,
265 const char* module_name,
266 Mdl_version min_module_version,
267 Mdl_version max_module_version,
268 IMdl_execution_context* context) = 0;
269
280 ITransaction* transaction, const char* module_name, IMdl_execution_context* context) = 0;
281
297 virtual const IString* get_db_module_name( const char* mdl_name) = 0;
298
314 virtual const IString* get_db_definition_name( const char* mdl_name) = 0;
315
352 virtual void analyze_uniform(
353 ITransaction* transaction,
354 const char* root_name,
355 bool root_uniform,
356 const IExpression* query_expr,
357 bool& query_result,
358 IString* error_path,
359 IMdl_execution_context* context) const = 0;
360
375 virtual const IString* decode_name( const char* name) = 0;
376
387 virtual const IString* encode_module_name( const char* name) = 0;
388
407 const char* name, const IArray* parameter_types) const = 0;
408
420 virtual const IString* encode_type_name( const char* name) const = 0;
421
423 virtual bool is_valid_mdl_identifier( const char* name) const = 0;
424};
425 // end group mi_neuray_mdl_misc
427
428} // namespace neuraylib
429
430} // namespace mi
431
432#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:113
Mixin class template for deriving new interface declarations.
Definition: interface_declare.h:43
The interface for creating expressions.
Definition: iexpression.h:650
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
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:716
Shape
The possible texture shapes.
Definition: itype.h:558
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:294
float Float32
32-bit float.
Definition: types.h:51
signed int Sint32
32-bit signed integer.
Definition: types.h:46
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.