Katana Plug-in APIs 0.1
Public Member Functions

Foundry::Katana::Render::ScenegraphLocationDelegate Class Reference

Super-Class that enables the creation of user-defined sub-classes and plug-ins responsible for processing/rendering different location types. More...

#include <ScenegraphLocationDelegate.h>

List of all members.

Public Member Functions

virtual void * process (FnScenegraphIterator sgIterator, void *optionalInput)=0
 Process/renders a given location, must be implemented by sub-classes.

Detailed Description

Super-Class that enables the creation of user-defined sub-classes and plug-ins responsible for processing/rendering different location types.

For each location type a class associated with a plug-in can be defined that processes/renders information related to the location into something else. A common cases are to retrieve location information from the scene graph iterator, render its geometry, or output a file. A ScenegraphLocationDelegate can be used as a generic way to handle locations and perform any operation

Using the macros DEFINE_SCENEGRAPH_LOCATION_DELEGATE_PLUGIN and REGISTER_PLUGIN a location plug-in is defined and it is detected by Katana at runtime.

For example:
DEFINE_SCENEGRAPH_LOCATION_DELEGATE_PLUGIN(ArnoldSphereScenegraphLocationDelegate)
REGISTER_PLUGIN(ArnoldSphereScenegraphLocationDelegate, "ArnoldSphereScenegraphLocationDelegate", 0, 1)

associates the ScenegraphLocationDelegate sub-class ArnoldSphereScenegraphLocationDelegate to be responsible for processing/rendering a location type named "sphere" for the "arnold" renderer. The second parameter must a be a Katana-wide unique string. The registration gives priority to the plugins that are discovered first in the directory hierarchy.

Another requirement for the sub-classes is to provide 4 additional methods e.g.:
static void flush(); reset/update the state of the object
static XXX* create(); creates an instance of the sub-class XXX
std::string getSupportedRenderer() returns a string of the supported renderer name. If the string is empty then all renderers are supported. If there is a delegate that supports a specific renderer for a given location it is given priority over any delegate that supports all renderers. void fillSupportedLocationList(std::vector<std::string>& supportedLocationList) populates a vector of strings naming all the supported locations, e.g. a "polymesh"


Member Function Documentation

virtual void* Foundry::Katana::Render::ScenegraphLocationDelegate::process ( FnScenegraphIterator  sgIterator,
void *  optionalInput 
) [pure virtual]

Process/renders a given location, must be implemented by sub-classes.

Method responsible for processing/rendering a given location, passed as a scene graph iterator. Return is implementation depended.

Parameters:
sgIteratorthe iterator referring to a location. Its expected value matches the iterator type used when then subclass was registered with the REGISTER_PLUGIN macro.
optionalInputoptional input, its use and value depends on the implementation.

The documentation for this class was generated from the following file:
 All Classes Functions Variables Typedefs Enumerations Enumerator