mi::shader::Interface Struct Reference

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

#include <mi_shader_if.h>

List of all members.

Public Member Functions

virtual OptionsgetOptions (miTag string_options)
 Access to string options.
virtual miTag createFramebuffer ()
 Framebuffer factory function.
virtual miTag copyFramebuffer (miTag old_buffer_tag)
 Creates a copy of the framebuffer collection.
virtual LightListcreateLightList (miState *state, miTag *slist=0, int n=0)
 Deprecated. Used internally by LightIterator to create a light list.
virtual void release ()
 release (delete) the instance of the interface
virtual LightListcreateLightList (miState *state, const miVector &axis, miScalar spread_cos, miTag *slist=0, int n=0)
 Used internally by LightIterator to create a light list.
virtual Map_edit_dbhandlecreateMap (const Map_declaration *map_declaration=0)
 creation of Map.
virtual Map_access_dbhandleaccessMap (const miTag map_tag)
 read-only access to a Map in the DB.
virtual Map_edit_dbhandleeditMap (const miTag map_tag)
 read-write access to a Map in the DB.
virtual Map_access_dbhandleaccessMap (const char *filename, Map_status *status)
 read-only access to a Map read from file.
virtual Map_edit_dbhandleeditMap (const char *filename, Map_status *status)
 read-write access to a Map read from file.
virtual Map_declarationcreateMapDeclaration (const miUint dimension)
 creation of a Map_declaration.
virtual Map_declarationcopyMapDeclaration (const Map_declaration *other, Map_status *status)
 copy of a Map_declaration.
virtual Map_declarationcopyMapDeclaration (const Map_element *map_element, Map_status *status)
 copy of the Map_declaration of a Map element
virtual Map_declarationcopyMapDeclaration (const Map_access &map, Map_status *status)
 copy of the Map_declaration of a Map.
virtual Map_declarationcopyMapDeclaration (const Map_edit &map, Map_status *status)
 copy of the Map_declaration of a Map.
virtual Map_elementcreateMapElement (const Map_declaration *declaration=0)
 creation of a Map_element.
virtual Map_elementcopyMapElement (const Map_element *other)
 copy of a Map_element.
virtual Map_iteratorcreateMapIterator (const Map *map, Map_status *status)
 creation of a Map_iterator.
virtual Map_iteratorcopyMapIterator (const Map_iterator *other, Map_status *status)
 copy of a Map_iterator.
virtual Map_lookupcreateMapLookup (const Map *map, Map_status *status)
 creation of a Map_lookup.
virtual Map_lookupcopyMapLookup (const Map_lookup *other, Map_status *status)
 copy of a Map_lookup.

Static Public Member Functions

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

Friends

class Access_bsdf


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 struct 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 Map_access_dbhandle* mi::shader::Interface::accessMap const char *  filename,
Map_status status
[virtual]
 

read-only access to a Map read from file.

This function is wrapped by the Map_access class and should not be used directly

Parameters:
filename the file name of the map to read
status a status code
Returns:
pointer to the Map

virtual Map_access_dbhandle* mi::shader::Interface::accessMap const miTag  map_tag  )  [virtual]
 

read-only access to a Map in the DB.

This function is wrapped by the Map_access class and should not be used directly

Parameters:
map_tag database tag of the Map
Returns:
pointer to the Map

virtual miTag mi::shader::Interface::copyFramebuffer miTag  old_buffer_tag  )  [virtual]
 

Creates a copy of the framebuffer collection.

Parameters:
old_buffer_tag A database tag for the framebuffer to copy
Returns:
a database tag for a copy of framebuffer collection.

virtual Map_declaration* mi::shader::Interface::copyMapDeclaration const Map_edit map,
Map_status status
[virtual]
 

copy of the Map_declaration of a Map.

This function is wrapped by the Map_declaration_handle class and should not be used directly

Parameters:
map is the map to get a copy of the declaration from
status is a status code
Returns:
pointer to the newly copied Map_declaration

virtual Map_declaration* mi::shader::Interface::copyMapDeclaration const Map_access map,
Map_status status
[virtual]
 

copy of the Map_declaration of a Map.

This function is wrapped by the Map_declaration_handle class and should not be used directly

Parameters:
map is the map to get a copy of the declaration from
status is a status code
Returns:
pointer to the newly copied Map_declaration

virtual Map_declaration* mi::shader::Interface::copyMapDeclaration const Map_element map_element,
Map_status status
[virtual]
 

copy of the Map_declaration of a Map element

This function is wrapped by the Map_declaration_handle class and should not be used directly

Parameters:
map_element is the map element to get a copy of the decl from
status is a status code
Returns:
pointer to the newly copied Map_declaration

virtual Map_declaration* mi::shader::Interface::copyMapDeclaration const Map_declaration other,
Map_status status
[virtual]
 

copy of a Map_declaration.

This function is wrapped by the Map_declaration_handle class and should not be used directly

Parameters:
other is the handle of the declaration to copy
status is a status code
Returns:
pointer to the newly copied Map_declaration

virtual Map_element* mi::shader::Interface::copyMapElement const Map_element other  )  [virtual]
 

copy of a Map_element.

This function is wrapped by the Map_element_handle class and should not be used directly

Parameters:
other is the element to copy
Returns:
pointer to the newly copied Map_element

virtual Map_iterator* mi::shader::Interface::copyMapIterator const Map_iterator other,
Map_status status
[virtual]
 

copy of a Map_iterator.

This function is wrapped by the Map_iterator_access/edit classes and should not be used directly

Parameters:
other is the iterator to copy
status is a status code
Returns:
pointer to the newly copied Map_iterator

virtual Map_lookup* mi::shader::Interface::copyMapLookup const Map_lookup other,
Map_status status
[virtual]
 

copy of a Map_lookup.

This function is wrapped by the Map_lookup_handle class and should not be used directly

Parameters:
other is the lookup to copy
status is a status code
Returns:
pointer to the newly created Map_lookup

virtual miTag mi::shader::Interface::createFramebuffer  )  [virtual]
 

Framebuffer factory function.

Returns:
a database tag for an empty framebuffer collection.

virtual LightList* mi::shader::Interface::createLightList miState *  state,
const miVector &  axis,
miScalar  spread_cos,
miTag *  slist = 0,
int  n = 0
[virtual]
 

Used internally by LightIterator to create a light list.

This may be used to generate light iterators. This method is needed by the LightIterator::LightIterator() constructor. Usually there is no need to invoke this method directly.

Parameters:
state provided the method with the current rendering state. From the state the current instance light list may be deduced.
axis specifies the axis for the light cone. The value should be normalized.
spread_cos specifies the cosine of the angle to the light cone axis.
slist is an optional list of light tags. If provided, this list will be used instead of the default instance light list.
n gives the number of light tags in the optional light list.
Returns:
the method returns a pointer to a LightList.

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

Deprecated. Used internally by LightIterator to create a light list.

This may be used to generate light iterators. This method is needed by the LightIterator::LightIterator() constructor. Usually there is no need to invoke this method directly.

Parameters:
state provided the method with the current rendering state. From the state the current instance light list may be deduced.
slist is an optional list of light tags. If provided, this list will be used instead of the default instance light list.
n gives the number of light tags in the optional light list.
Returns:
the method returns a pointer to a LightList.

virtual Map_edit_dbhandle* mi::shader::Interface::createMap const Map_declaration map_declaration = 0  )  [virtual]
 

creation of Map.

This function is wrapped by the Map_edit class and should not be used directly

Parameters:
map_declaration is the declaration of the new Map (possibly NULL)
Returns:
pointer to the newly created Map

virtual Map_declaration* mi::shader::Interface::createMapDeclaration const miUint  dimension  )  [virtual]
 

creation of a Map_declaration.

This function is wrapped by the Map_declaration_handle class and should not be used directly

Parameters:
dimension is the dimension of the position
Returns:
pointer to the newly created Map_declaration

virtual Map_element* mi::shader::Interface::createMapElement const Map_declaration declaration = 0  )  [virtual]
 

creation of a Map_element.

This function is wrapped by the Map_element_handle class and should not be used directly

Parameters:
declaration is the (possible) declaration to use
Returns:
pointer to the newly created Map_element

virtual Map_iterator* mi::shader::Interface::createMapIterator const Map map,
Map_status status
[virtual]
 

creation of a Map_iterator.

This function is wrapped by the Map_iterator_access/edit classes and should not be used directly

Parameters:
map is the map to attach the iterator to
status is a status code
Returns:
pointer to the newly created Map_iterator

virtual Map_lookup* mi::shader::Interface::createMapLookup const Map map,
Map_status status
[virtual]
 

creation of a Map_lookup.

This function is wrapped by the Map_lookup_handle class and should not be used directly

Parameters:
map is the map to attach the lookup to
status is a status code
Returns:
pointer to the newly created Map_lookup

virtual Map_edit_dbhandle* mi::shader::Interface::editMap const char *  filename,
Map_status status
[virtual]
 

read-write access to a Map read from file.

This function is wrapped by the Map_edit class and should not be used directly

Parameters:
filename the file name of the map to read
status a status code
Returns:
pointer to the Map

virtual Map_edit_dbhandle* mi::shader::Interface::editMap const miTag  map_tag  )  [virtual]
 

read-write access to a Map in the DB.

This function is wrapped by the Map_edit class and should not be used directly

Parameters:
map_tag database tag of the Map
Returns:
pointer to the Map

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  string_options  )  [virtual]
 

Access to string options.

This may later be extended to also access all other options from the miOptions structure. This function can be used as follows:

        Options *stringOptions = interface->getOptions(options->string_options);
Parameters:
string_options is the tag of the string options, taken from the string_options field of the miOptions structure to be read or modified. It must be valid throughout 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() or mi::shader::Interface::get() 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 struct was generated from the following file:

Copyright © 1986-2008 by mental images GmbH