mi::shader::Interface Class Reference

top level C++ mental ray interface extensions More...

#include <mi_shader_if.h>

List of all members.


Public Member Functions

virtual Options getOptions (miTag options_tag)
  access string options
virtual LightList createLightList (miState *state, miTag *slist=0, int n=0)
  get light list, used internally by light iterators
virtual void  release ()
  release (delete) the instance of the interface

Static Public Member Functions

Interface get (int version=mi_ray_interface_version)
  acquire an instance of the interface

Detailed Description

top level C++ mental ray interface extensions

This class is the top level access to the C++ shader interface extensions. All other C++ extensions like mi::shader::Options and mi::shader::LightIterator are accessible through this class.

An instance of the Interface must be acquired by calling mi_get_shader_interface() or the static method Interface::get(). When the interface is no more needed, it must be released by calling Interface::release():

    mi::shader::Interface *iface = mi::shader::Interface::get();
    // do something with it...
    iface->release();

The C++ interface extensions are implemented as virtual functions in this interface class in order to avoid linking and symbol lookup problems. The interface is defined in the header file mi_shader_if.h.


Member Function Documentation

virtual LightList* mi::shader::Interface::createLightList miState *  state,
miTag *  slist = 0,
int  n = 0
[virtual]
 

get light list, used internally by light iterators

This may be used to generate light iterators.

Interface* mi::shader::Interface::get int  version = mi_ray_interface_version  )  [inline, static]
 

acquire an instance of the interface

This static method is equivalent to the function mi_get_shader_interface(), see there fore more information. This static function can be used as follows:

Parameters:
version  is the version number of the requested interface class, usually no version argument needs to be passed.
Returns:
The returned pointer points to an object in mental ray which contains the interface functions as virtual methods (hence it is possible to call the interface routines from a dynamically loaded library without resolving the routine in a symbol table). The caller may not attempt to modify or delete the returned object but should call the mi::shader::Interface::release() method when done.
virtual Options* mi::shader::Interface::getOptions miTag  options_tag  )  [virtual]
 

access string options

This may later be extended to also access all other options from the miOptions structure.

Parameters:
options_tag  is the tag of the miOptions structure to be read or modified. It must be valid through the use of the Options instance.
Returns:
A pointer to an interface class. The Options::release() method should be called when done.
virtual void mi::shader::Interface::release  )  [virtual]
 

release (delete) the instance of the interface

An interface acquired with mi_get_shader_interface() must be released with this call when done. The call may delete the object, and the interface may no longer be used afterwards.


The documentation for this class was generated from the following file:



Copyright © 1986-2006 by mental images GmbH