MDL SDK API nvidia_logo_transpbg.gif Up
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
mi::neuraylib::IMdle_serialization_callback Class Referenceabstract

Callback to map references to MDLE modules during serialization. More...

Inheritance diagram for mi::neuraylib::IMdle_serialization_callback:
mi::base::Interface_declare< 0x5888652a, 0x79d6, 0x49ba, 0x87, 0x90, 0x0c, 0x1b, 0x32, 0x83, 0xf8, 0x63 > mi::base::IInterface

Public Member Functions

virtual const IStringget_serialized_filename (const char *filename) const =0
 Returns a serialized filename for the given MDLE filename. More...
 

Additional Inherited Members

- Public Types inherited from mi::base::Interface_declare< 0x5888652a, 0x79d6, 0x49ba, 0x87, 0x90, 0x0c, 0x1b, 0x32, 0x83, 0xf8, 0x63 >
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< 0x5888652a, 0x79d6, 0x49ba, 0x87, 0x90, 0x0c, 0x1b, 0x32, 0x83, 0xf8, 0x63 >
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

Callback to map references to MDLE modules during serialization.

The name of an MDLE module is the absolute filename of the module. This makes it difficult to move such modules around since that requires adjusting all references. This callback allows to rewrite such references during serialization. The reverse mapping should be implemented in an corresponding instance of mi::neuraylib::IMdle_deserialization_callback.

One possible solution is to choose a filename that is relative to a known reference point that will be moved together with the MDLE file, e.g., the main scene file.

See Also
mi::neuraylib::IMdle_deserialization_callback, mi::neuraylib::IMdl_impexp_api::serialize_function_name()

Member Function Documentation

virtual const IString* mi::neuraylib::IMdle_serialization_callback::get_serialized_filename ( const char *  filename) const
pure virtual

Returns a serialized filename for the given MDLE filename.

The implemented mapping should be reversible, otherwise you will run into problems implementing the corresponding instance of mi::neuraylib::IMdle_deserialization_callback.

The callback might get involved several times with the same argument. You might want to cache results if the computation is expensive.

Parameters
filenameThe current filename of an MDLE module.
Returns
The "serialized filename" of that MDLE module. Technically, this can be any string with ".mdle" suffix, it does not need to refer to an existing MDLE file on disk.