MDL SDK API nvidia_logo_transpbg.gif Up
imdl_factory.h
Go to the documentation of this file.
1/***************************************************************************************************
2 * Copyright 2023 NVIDIA Corporation. All rights reserved.
3 **************************************************************************************************/
6
7#ifndef MI_NEURAYLIB_IMDL_FACTORY_H
8#define MI_NEURAYLIB_IMDL_FACTORY_H
9
13
14#if defined (MI_NEURAYLIB_DEPRECATED_12_1) || defined(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_12_1
123 ITransaction* transaction,
124 const char* file_path,
126 Float32 gamma,
127 bool shared,
128 Sint32* errors = 0)
129 {
132 transaction, file_path, shape, gamma, 0, shared, context.get());
133 if( errors) {
134 mi::base::Handle<const IMessage> msg( context->get_error_message( 0));
135 *errors = msg ? msg->get_code() : 0;
136 }
137 return result;
138 }
139#endif // MI_NEURAYLIB_DEPRECATED_12_1
140
141#ifdef MI_NEURAYLIB_DEPRECATED_14_0
143 ITransaction* transaction,
144 const char* file_path,
146 Float32 gamma,
147 const char* selector,
148 bool shared,
149 Sint32* errors = 0)
150 {
153 transaction, file_path, shape, gamma, selector, shared, context.get());
154 if( errors) {
155 mi::base::Handle<const IMessage> msg( context->get_error_message( 0));
156 *errors = msg ? msg->get_code() : 0;
157 }
158 return result;
159 }
160#endif // MI_NEURAYLIB_DEPRECATED_14_0
161
190 ITransaction* transaction,
191 const char* file_path,
192 bool shared,
193 IMdl_execution_context* context) = 0;
194
195#ifdef MI_NEURAYLIB_DEPRECATED_14_0
197 ITransaction* transaction,
198 const char* file_path,
199 bool shared,
200 Sint32* errors = 0)
201 {
204 transaction, file_path, shared, context.get());
205 if( errors) {
206 mi::base::Handle<const IMessage> msg( context->get_error_message( 0));
207 *errors = msg ? msg->get_code() : 0;
208 }
209 return result;
210 }
211#endif // MI_NEURAYLIB_DEPRECATED_14_0
212
242 ITransaction* transaction,
243 const char* file_path,
244 bool shared,
245 IMdl_execution_context* context) = 0;
246
247#ifdef MI_NEURAYLIB_DEPRECATED_14_0
249 ITransaction* transaction,
250 const char* file_path,
251 bool shared,
252 Sint32* errors = 0)
253 {
256 transaction, file_path, shared, context.get());
257 if( errors) {
258 mi::base::Handle<const IMessage> msg( context->get_error_message( 0));
259 *errors = msg ? msg->get_code() : 0;
260 }
261 return result;
262 }
263#endif // MI_NEURAYLIB_DEPRECATED_14_0
264
284 ITransaction* transaction,
285 const char* module_name,
286 Mdl_version min_module_version,
287 Mdl_version max_module_version,
288 IMdl_execution_context* context) = 0;
289
300 ITransaction* transaction, const char* module_name, IMdl_execution_context* context) = 0;
301
316 virtual const IString* get_db_module_name( const char* mdl_name) = 0;
317
332 virtual const IString* get_db_definition_name( const char* mdl_name) = 0;
333
370 virtual void analyze_uniform(
371 ITransaction* transaction,
372 const char* root_name,
373 bool root_uniform,
374 const IExpression* query_expr,
375 bool& query_result,
376 IString* error_path,
377 IMdl_execution_context* context) const = 0;
378
393 virtual const IString* decode_name( const char* name) = 0;
394
405 virtual const IString* encode_module_name( const char* name) = 0;
406
425 const char* name, const IArray* parameter_types) const = 0;
426
438 virtual const IString* encode_type_name( const char* name) const = 0;
439
441 virtual bool is_valid_mdl_identifier( const char* name) const = 0;
442};
443 // end group mi_neuray_mdl_misc
445
446} // namespace neuraylib
447
448} // namespace mi
449
450#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:621
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:126
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:34
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:84
The interface for creating types.
Definition: itype.h:612
Shape
The possible texture shapes.
Definition: itype.h:454
A BSDF measurement value.
Definition: ivalue.h:562
The interface for creating values.
Definition: ivalue.h:664
A light profile value.
Definition: ivalue.h:547
A texture value.
Definition: ivalue.h:523
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:27
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.