MDL SDK API nvidia_logo_transpbg.gif Up
mi::neuraylib::IMdle_api Class Referenceabstract

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

#include <imdle_api.h>

Inheritance diagram for mi::neuraylib::IMdle_api:

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...
 
- Public Member Functions inherited from mi::base::IInterface
virtual Uint32 retain () const =0
 Increments the reference count. More...
 
virtual Uint32 release () const =0
 Decrements the reference count. More...
 
virtual const IInterfaceget_interface (const Uuid &interface_id) const =0
 Acquires a const interface from another. More...
 
template<class T>
const T * get_interface () const
 Acquires a const interface from another. More...
 
virtual IInterfaceget_interface (const Uuid &interface_id)=0
 Acquires a mutable interface from another. More...
 
template<class T>
T * get_interface ()
 Acquires a mutable interface from another. More...
 
virtual Uuid get_iid () const =0
 Returns the interface ID of the most derived interface. More...
 

Additional Inherited Members

- Public Types inherited from mi::base::Interface_declare< 0xda82106c, ... >
typedef Interface_declare< id1, ... > Self
 Own type. More...
 
typedef Uuid_t< id1, ... > IID
 Declares the interface ID (IID) of this interface. More...
 
- Public Types inherited from mi::base::IInterface
typedef Uuid_t<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0> IID
 Declares the interface ID (IID) of this interface. More...
 
- Static Public Member Functions inherited from mi::base::Interface_declare< 0xda82106c, ... >
static bool compare_iid (const Uuid &iid)
 Compares the interface ID iid against the interface ID of this interface and of its ancestors. More...
 
- Static Public Member Functions inherited from mi::base::IInterface
static bool compare_iid (const Uuid &iid)
 Compares the interface ID iid against the interface ID of this interface. More...
 

Detailed Description

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

Member Function Documentation

 compare_mdle()

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.

 export_mdle()

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 file path 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 file path 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.

 get_hash()

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.

 get_user_file()

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.

 validate_mdle()

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.