MDL SDK API nvidia_logo_transpbg.gif Up
mi::mdl::Mdl_distiller_plugin Class Referenceabstract

Abstract interface for MDL distiller plugins. More...

#include <mdl_distiller_plugin.h>

Inheritance diagram for mi::mdl::Mdl_distiller_plugin:

Public Member Functions

virtual const char * get_name () const =0
 Returns the name of the plugin. More...
 
virtual mi::Size get_api_version () const =0
 Return the distiller plugin API version. More...
 
virtual bool init (mi::base::ILogger *logger)=0
 Initializes the plugin. More...
 
virtual bool exit ()=0
 De-initializes the plugin. More...
 
virtual mi::Size get_target_count () const =0
 Returns the number of available distilling targets. More...
 
virtual const char * get_target_name (mi::Size index) const =0
 Returns the name of the distilling target at index position. More...
 
virtual const mi::mdl::IMaterial_instancedistill (mi::mdl::IDistiller_plugin_api &api, mi::mdl::IRule_matcher_event *event_handler, const mi::mdl::IMaterial_instance *material_instance, mi::Size target_index, Distiller_options *options, mi::Sint32 *p_error) const =0
 Main function to distill an MDL material. More...
 
virtual mi::Size get_required_module_count (mi::Size target_index) const =0
 Returns the number of modules that are required by result materials of this Distiller plugin. More...
 
virtual const char * get_required_module_code (mi::Size target_index, mi::Size module_index) const =0
 Returns the MDL source code of the required module at the given index. More...
 
virtual const char * get_required_module_name (mi::Size target_index, mi::Size module_index) const =0
 Returns the fully qualified name of the required module at the given index. More...
 
- Public Member Functions inherited from mi::base::Plugin
virtual Sint32 get_plugin_system_version () const
 Returns the version of the plugin system used to compile this. More...
 
virtual const char * get_name () const =0
 Returns the name of the plugin. More...
 
virtual const char * get_type () const =0
 Returns the type of the plugin. More...
 
virtual Sint32 get_version () const
 Returns the version number of the plugin. More...
 
virtual const char * get_compiler () const
 Returns the compiler used to compile the plugin. More...
 
virtual void release ()=0
 Destroys the plugin instance. More...
 
virtual const char * get_string_property (Sint32 index, const char **value)
 Returns a plugin property. More...
 

Detailed Description

Abstract interface for MDL distiller plugins.

Member Function Documentation

 distill()

virtual const mi::mdl::IMaterial_instance * mi::mdl::Mdl_distiller_plugin::distill ( mi::mdl::IDistiller_plugin_api api,
mi::mdl::IRule_matcher_event event_handler,
const mi::mdl::IMaterial_instance material_instance,
mi::Size  target_index,
Distiller_options options,
mi::Sint32 p_error 
) const
pure virtual

Main function to distill an MDL material.

Uses a DAG material instance as input, applies selected rule sets and returns the result as a new DAG material instance. The mdl module ::nvidia::distilling_support is loaded before calling this function.

Parameters
apiThe MDL distiller plugin API to manipulate the DAG, and also the API against which the mdltlc generates code
event_handlerIf non-NULL, an event handler interface used to report events during processing.
material_instanceThe material instance to "distill".
target_indexThe index of the distilling target model
optionsThe Distiller options
p_errorAn optional pointer to an mi::Sint32 to which an error code will be written. The error codes have the following meaning:
  • 0: Success.
  • -1: Reserved for API layer.
  • -2: Reserved for API layer.
  • -3: Unspecified failure.
Returns
The distilled material instance, or NULL in case of failure.

 exit()

virtual bool mi::mdl::Mdl_distiller_plugin::exit ( )
pure virtual

De-initializes the plugin.

Returns
true in case of success, and false otherwise.

 get_api_version()

virtual mi::Size mi::mdl::Mdl_distiller_plugin::get_api_version ( ) const
pure virtual

Return the distiller plugin API version.

A plugin is only accepted if it is compiled against the same API version than the SDK.

 get_name()

virtual const char * mi::mdl::Mdl_distiller_plugin::get_name ( ) const
pure virtual

Returns the name of the plugin.

Note
This method from mi::base::Plugin is repeated here only for documentation purposes.

Implements mi::base::Plugin.

 get_required_module_code()

virtual const char * mi::mdl::Mdl_distiller_plugin::get_required_module_code ( mi::Size  target_index,
mi::Size  module_index 
) const
pure virtual

Returns the MDL source code of the required module at the given index.

This can be used to load the module, also using the corresponding module name (see get_required_module_name()).

Parameters
target_indexThe index of the distilling target model.
module_indexThe index of the module for the target model.
Returns
The code of the required module.

 get_required_module_count()

virtual mi::Size mi::mdl::Mdl_distiller_plugin::get_required_module_count ( mi::Size  target_index) const
pure virtual

Returns the number of modules that are required by result materials of this Distiller plugin.

Parameters
target_indexThe index of the distilling target model.
Returns
The number of required MDL modules for the target model.

 get_required_module_name()

virtual const char * mi::mdl::Mdl_distiller_plugin::get_required_module_name ( mi::Size  target_index,
mi::Size  module_index 
) const
pure virtual

Returns the fully qualified name of the required module at the given index.

This can be used to load the module, using the corresponding module code (see get_required_module_code()).

Parameters
target_indexThe index of the distilling target model.
module_indexThe index of the module for the target model.
Returns
The fully qualified name of the required module.

 get_target_count()

virtual mi::Size mi::mdl::Mdl_distiller_plugin::get_target_count ( ) const
pure virtual

Returns the number of available distilling targets.

 get_target_name()

virtual const char * mi::mdl::Mdl_distiller_plugin::get_target_name ( mi::Size  index) const
pure virtual

Returns the name of the distilling target at index position.

 init()

virtual bool mi::mdl::Mdl_distiller_plugin::init ( mi::base::ILogger logger)
pure virtual

Initializes the plugin.

Returns
true in case of success, and false otherwise.