neuray API Programmer's Manual

mi::neuraylib::IMdle_serialization_callback Class Reference

[Miscellaneous MDL-related Interfaces]

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()

Public Member Functions

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

Member Functions

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

filename
The 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.