In Inventor, events are distributed to the 3D objects contained in the scene database. Manipulator and dragger objects, described in detail in Chapter 17, Draggers and Manipulators, are the 3D objects in the Inventor scene graph that handle events. Shape objects (such as sphere, cylinder, quad mesh), property objects (such as material and draw style), transformation objects, light objects, and camera objects ignore events. Finding the node that handles an event is discussed in Section 10.4, “How Nodes Handle Events: SoHandleEventAction”.
With Inventor, you can choose from one of four event-handling mechanisms:
You can use Inventor's automatic event-handling mechanism, provided by the scene manager, in which certain kinds of nodes handle events (see Section 10.4, “How Nodes Handle Events: SoHandleEventAction”). This is probably the easiest mechanism to use. (Note that you can also create your own nodes to handle events. You might create your own node if you want to use it in several different applications or
give it to other programmers. You could also create a new manipulator to handle events. See The Inventor Toolmaker for more information on creating new nodes and manipulators.)
You can use Inventor's event callback mechanism, in which user-written callback nodes handle events (see Section 10.5, “Using Event Callback Nodes (Advanced)” ). This method handles events on a per-object basis and is fairly easy to implement. Its drawback is that, although the callback node does write to a file, it has no fields describing which path it is monitoring or which events it is interested in.
You can override Inventor's event-handling mechanisms entirely and pass all events directly to the application (see Section 10.6, “Sending Events Directly to the Application (Advanced)”). Use this method if you prefer to work directly with X events and you do not need to handle events on a per-object basis. This method bypasses scene traversal and handles only window events.
You can use Inventor's generic callback mechanism in which user-written callback nodes handle all actions (see Chapter 28, Using Open Inventor with OpenGL for an example of an SoCallback( C++ | Java | .NET ) node). Use this mechanism if you need to handle events and you want to implement another action, such as rendering. If you are only handling events, use Method 2 (the event callback node), because it does more work for you.
Methods 1, 2, and 4 are recommended because they are window-system– independent and therefore more flexible. Methods 1 and 2 are probably the easiest.