Inherits From:
NSObject
Conforms To:
NSCoding
Declared In:
Sc21/SCController.h
The most basic setup of using an SCController is to have an
SCSceneGraph, an SCView, and an SCController instance, connecting
the SCView's controller outlet to the SCController and the
SCController's sceneGraph outlet to the SCSceneGraph.
Since Coin is a data driven API, redraws are usually requested by
the scene graph itself. To handle these redraws, the controller must
be given a "drawable" (an object conforming to the SCDrawable
protocol) that should called upon such a redraw request. See the
SCDrawable and SCView documentation for more information.
setSceneGraph:
initCoin
Initializes Coin.
SCController automatically calls this method if needed.
You need to call this method explicitly only if you want to use Coin functionality before actually instantiating an SCController in your application (e.g. if you want to read a 3D model from disk and load the nib file containing your SCView and SCController only if the file was read successfully).
This method calls SoDB::init(), SoInteraction::init() and
SoNodeKit::init().
backgroundColor
Returns the scene's background color.
clearsColorBuffer
Returns YES if the receiver clears the color buffer before rendering. The default value is YES.
clearsDepthBuffer
Returns YES if the receiver clears the depth buffer before rendering. The default value is YES.
drawable
Returns the receiver's drawable.
eventHandler
Returns the first eventhandler in the receiver's eventhandler chain.
handleEvent:(NSEvent *)event
Handle event by sending it down the eventhandler chain, starting at
the receiver's eventHandler. If eventHandler returns NO,
event is sent to the eventHandler's nextEventHandler, and so
on.
Note that the Sc21 way of handling events is different from the one taken in Cocoa (where events are normally handled by NSView subclasses) - SCView just passes on all events to this method. (See the SCEventHandler documentation for more information on eventhandling in Sc21.)
For overriding the default behavior of ctrl-clicks (context menu),
see the documentation for SCView's -mouseDown: method.
Returns YES if the event has been handled, NO otherwise.
init
Designated initializer.
Initializes a newly allocated SCController and calls initCoin.
render
Renders the scene by calling the receiver's SoSceneManager's
render() funtion. After rendering, an update: message is sent
to each eventhandler in the event handler chain, starting at the
receiver's eventHandler.
sceneGraph
Returns the receiver's scenegraph
sceneManager
Returns the receiver's Coin scene manager instance.
setBackgroundColor:(NSColor *)color
Sets the background color of the scene to color. Raises an exception if color cannot be converted to an RGB color.
setClearsColorBuffer:(BOOL)yesno
Controls whether the receiver should clear the color buffer before rendering. The default value is YES.
setClearsDepthBuffer:(BOOL)yesno
Controls whether the receiver should clear the depth buffer before rendering. The default value is YES.
setDrawable:(id<SCDrawable>)newdrawable
Set the receiver's drawable. Note that you do not have to call this method if you are using an SCView.
setEventHandler:(SCEventHandler *)handler
Set the receiver's eventhandler, which will be the start of the eventhandler chain.(See handleEvent: for more information.)
setSceneGraph:(SCSceneGraph *)scenegraph
Sets the scene graph that shall be rendered.
setSceneManager:(SoSceneManager *)scenemanager
Sets the receiver's scene manager to scenemanager. The scene manager's render callback will be set to SCController's internal redraw callback implementation; and scenemanager will be activated. Also, if a scenegraph has been set earlier, scenemanager's scenegraph will be set to it.
Note that you should not normally need to call that method, since a scene manager is created for you while initializing.