User guide

55
responsible for generating the root location is. In order to write a custom SGG plug-in, both of these classes have to
be derived and their abstract functions implemented.
Constructor
The constructor is the place to initialize custom variables for new instances of the class derived from
ScenegraphGenerator, like in this example:
CubeMaker::CubeMaker() :
_numberOfCubes(0),
_rotateCubes(false)
{
// empty
}
NOTE: The code examples in this document come from a custom SGG plug-in named CubeMaker that
creates locations for a number of polygonal cubes in a Katana project. Its source code can be found in the
Katana directory:
$KATANA_ROOT/plugins/Src/ScenegraphGenerators/GeoMakers/
Destructor
Usually no special destructor is needed when creating a class derived from ScenegraphGenerator, unless memory or
other resources are allocated for the plug-in that should be released again when an instance is destroyed.
Static Methods
The following static methods must be implemented in a class derived from the ScenegraphGenerator of a custom
scene graph generator plug-in:
static FnKat::ScenegraphGenerator* create()
Returns an instance of the custom scene graph generator's main class, similar to a factory method, as in the
following code example:
FnKat::ScenegraphGenerator*
CubeMaker::create()
{
return new CubeMaker();
}
8 SCENE GRAPH GENERATOR PLUG-INS | SGG PLUG-IN API CLASSES