NSObject (SCSceneGraphDelegate)

Declared In:
Sc21/SCSceneGraph.h

Category Description

The following delegate methods allow you to control superscenegraph creation.


Method Types

Turning off default superscenegraph creation
- shouldCreateDefaultSuperSceneGraph
Supplying your own code for superscenegraph creation
- createSuperSceneGraph:

Instance Methods

createSuperSceneGraph:

- (SoGroup *)createSuperSceneGraph:(SoGroup *)scenegraph

If present, this method will be called from setRoot to allow the delegate to do custom superscenegraph creation.

Note that this does not influence the creation of the default superscenegraph (i.e. the internal behaviour of adding a light and camera if necessary). Use the shouldCreateDefaultSuperSceneGraph: method to control whether the internal superscenegraph creation should be performed.

Depending on whether an internal superscenegraph has been added, createSuperSceneGraph: will be called either with the original root or (if the default scenegraph was created) with the root of the internal superscenegraph.

The scenegraph argument is the root node of the Coin scene graph. The method is expected to return a new node that contains scenegraph as one of its children, or scenegraph itself. If the return value is NULL, SCSceneGraph's setRoot: will be aborted and the scenegraph and superscenegraph set to NULL. Note that normally you should never return NULL from this method - use this only to indicate unexpected error conditions.


shouldCreateDefaultSuperSceneGraph

- (BOOL)shouldCreateDefaultSuperSceneGraph

Implement this method to return NO to skip creation of the internal default superscenegraph.

Note that this does not turn on or off custom superscenegraph creation (done by the createSuperSceneGraph: delegate method, if present).


Sc21 version 1.0 © 2003-2004 Systems in Motion AS.