Material Definition Language API nvidia_logo_transpbg.gif Up
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
mi::neuraylib::IMdle_api Class Referenceabstract

Provides access to functions related to the creation of encapsulated MDL modules (MDLE). More...

Inheritance diagram for mi::neuraylib::IMdle_api:
mi::base::Interface_declare< 0xda82106c, 0x658d, 0x449d, 0x8e, 0x1, 0xfb, 0x55, 0x1, 0x61, 0x9b, 0x97 > mi::base::IInterface

Public Member Functions

virtual Sint32 export_mdle (ITransaction *transaction, const char *file_name, const IStructure *mdle_data, IMdl_execution_context *context) const =0
 Exports a new MDLE file to disk. More...
 
virtual Sint32 validate_mdle (const char *file_name, IMdl_execution_context *context) const =0
 Checks the integrity of an MDLE file based on MD5 hashes that are stored for the contained files. More...
 
virtual IReaderget_user_file (const char *mdle_file_name, const char *user_file_name, IMdl_execution_context *context) const =0
 Get a user file that has been added to an MDLE during its creation. More...
 
virtual Sint32 compare_mdle (const char *mdle_file_name_a, const char *mdle_file_name_b, IMdl_execution_context *context) const =0
 Check if two MDLE are identical, meaning that they contain the same content independent of their file path. More...
 
virtual Sint32 get_hash (const char *mdle_file_name, base::Uuid &hash, IMdl_execution_context *context) const =0
 Extracts the hash of the MDLE archive. More...
 

Additional Inherited Members

- Public Types inherited from mi::base::Interface_declare< 0xda82106c, 0x658d, 0x449d, 0x8e, 0x1, 0xfb, 0x55, 0x1, 0x61, 0x9b, 0x97 >
typedef Interface_declare< id1,
id2, id3, id4, id5, id6, id7,
id8, id9, id10, id11,
IInterface
Self
 Own type. More...
 
typedef Uuid_t< id1, id2, id3,
id4, id5, id6, id7, id8, id9,
id10, id11 > 
IID
 Declares the interface ID (IID) of this interface. More...
 
- Static Public Member Functions inherited from mi::base::Interface_declare< 0xda82106c, 0x658d, 0x449d, 0x8e, 0x1, 0xfb, 0x55, 0x1, 0x61, 0x9b, 0x97 >
static bool compare_iid (const Uuid &iid)
 Compares the interface ID iid against the interface ID of this interface and of its ancestors. More...
 

Detailed Description

Provides access to functions related to the creation of encapsulated MDL modules (MDLE).

Member Function Documentation

virtual Sint32 mi::neuraylib::IMdle_api::compare_mdle ( const char *  mdle_file_name_a,
const char *  mdle_file_name_b,
IMdl_execution_context context 
) const
pure virtual

Check if two MDLE are identical, meaning that they contain the same content independent of their file path.

Parameters
mdle_file_name_aThe file name of the first MDLE to compare.
mdle_file_name_bThe file name of the second MDLE to compare.
contextAn execution context which can be queried for detailed error messages after the operation has finished. Can be NULL.
Returns
  • 0: Success
  • -1: The files are different or at least one is not existing. If provided, please check the context for details.
virtual Sint32 mi::neuraylib::IMdle_api::export_mdle ( ITransaction transaction,
const char *  file_name,
const IStructure mdle_data,
IMdl_execution_context context 
) const
pure virtual

Exports a new MDLE file to disk.

Parameters
transactionThe transaction to be used.
file_nameThe new filename (including the .mdle extension).
mdle_dataA structure of type Mdle_data. This structure has the following members:
  • mi::IString prototype_name
    The DB name of the prototype for the main material or function definition of the MDLE file. The prototype can be a material definition, a function definition, a material instance or a function call.
  • mi::neuraylib::IExpression_list* defaults
    The defaults of the main material or function definition of the MDLE file. The type of an argument in the expression list must match the type of the corresponding parameter of the prototype.
    If the list is empty, the resulting MDLE will have no parameters. If NULL is passed, the MDLE will inherit the defaults of the prototype.
  • mi::neuraylib::IAnnotation_block* annotations
    Annotations of the main material or function definition of the MDLE file. If the list is empty, the resulting MDLE will have no annotations. If NULL is passed, the MDLE will inherit the annotations of the prototype. Please note that parameter and return type annotations are always inherited from the prototype.
  • mi::IString thumbnail_path
    Path to a thumbnail image representing the exported material or function. Can be either an absolute MDL url or a file system path.
  • mi::base::IInterface user_files
    A static or dynamic array of structures of type Mdle_user_file pointing to additional user content (files) that should be added to the MDLE archive. Can be NULL.
    The structure has the two members
    • mi::IString source_path
      MDL url or file system path pointing to the file.
    • mi::IString target_path
      New path of the file in the archive.
contextAn execution context which can be queried for detailed error messages after the operation has finished. Can be NULL.
Returns
  • 0: Success
  • -1: An error occurred. If provided, please check the context for details.
virtual Sint32 mi::neuraylib::IMdle_api::get_hash ( const char *  mdle_file_name,
base::Uuid hash,
IMdl_execution_context context 
) const
pure virtual

Extracts the hash of the MDLE archive.

Parameters
mdle_file_nameThe file name of the MDLE.
[out]hashThe returned hash value.
contextAn execution context which can be queried for detailed error messages after the operation has finished. Can be NULL.
Returns
  • 0: Success
  • -1: An error occurred. If provided, please check the context for details.
virtual IReader* mi::neuraylib::IMdle_api::get_user_file ( const char *  mdle_file_name,
const char *  user_file_name,
IMdl_execution_context context 
) const
pure virtual

Get a user file that has been added to an MDLE during its creation.

Parameters
mdle_file_nameThe file name of the MDLE that contains the user file.
user_file_nameThe path and name of the file to read inside the MDLE. This equals the target_path during the creation.
contextAn execution context which can be queried for detailed error messages after the operation has finished. Can be NULL.
Returns
A reader with access to the user file content or NULL in case of errors. Check the context for details in that case.
virtual Sint32 mi::neuraylib::IMdle_api::validate_mdle ( const char *  file_name,
IMdl_execution_context context 
) const
pure virtual

Checks the integrity of an MDLE file based on MD5 hashes that are stored for the contained files.

Parameters
file_nameThe file name of the MDLE to check.
contextAn execution context which can be queried for detailed error messages after the operation has finished. Can be NULL.
Returns
  • 0: Success
  • -1: The MDLE file is invalid. If provided, please check the context for details.