Class SceneOrbiter

  • All Implemented Interfaces:
    SafeDisposable

    public class SceneOrbiter
    extends SceneInteractor
    (Preview Feature) Tool class for easily building an OpenInventor application whose main behavior is an orbiting displacement around the center of the scene, without using existing viewer classes.

    Preview Feature means this class is fully supported and can be used in Open Inventor applications. Being tagged as a Preview Feature just means that the implementation is still subject to API changes and adjustments based on feedback from early adopters. Please be also aware that source compatibility might be broken regardless of the Open Inventor compatibility changes policy due to our commitment to bring needed changes to be sure the specifications of this Preview Feature match the expectations of our customers.

    The SceneOrbiter is an extension of the SceneInteractor node that allows providing the camera and headlight manipulations like panning, zooming and orbiting. The 'headlight', i.e. an SoDirectionalLight node, is automatically aligned with the camera's view direction. More a viewing cube, i.e an SoViewingCube node, is added to the scene.
    But Contrary to classic Open Inventor viewer, the selection mode doesn't need to be explicitly asked, by a key press.

    See parent class SceneInteractor for more details about the structure of the internal scene graph.
    The SceneOrbiter uses an instance of SoCameraInteractor to manipulate the camera in response to OpenInventor events.

    Notes:

    • Window system integration
      The SceneOrbiter needs a component that integrates the Open Inventor 3D rendering window with the native window system. System dependent tasks include creating a window, placing the window in the application's user interface, initializing OpenGL and processing the native event/message loop. System independent support for this is provided by the SoRenderAreaCore class. Example components are provided for AWT and SWT toolkits.
    • Event handling
      The SceneOrbiter needs a component that builds OpenInventor events (SoEvent) from native system events. System independent support for this is provided by the SoEventBuilder class. Example components are provided for AWT and SWT toolkits: AWTEventToSoEvent and SWTEventToSoEvent.
    • Library
      A basic version of SceneOrbiter is a supported part of the Open Inventor API and a prebuilt jar is provided.
    • Source code
      The basic version of SceneOrbiter is also provided as source code in the sources folder to allow applications to customize and build their own interactive tool class.
      See $OIVJHOME/source/com/openinventor/inventor/viewercomponents/nodes.
    • Scene graph
      The application scene graph should be the last child of the SceneOrbiter. The initial application scene graph can be added by simply calling the inherited method addChild(). But note that if you need to replace the application scene graph, for example loading a new data set, do not call removeAllChildren(). That would also remove the SceneOrbiter's camera, headlight and event handler nodes. Add an SoSeparator to the SceneOrbiter to serve as the "scene graph holder", then add and remove the application scene graph from this node.
    • Clip planes
      SceneOrbiter automatically adjusts the 'near' and 'far' clipping planes when events modifying the camera are handled. This adjustment, based on the bounding box of the scene, ensures that shapes will not be clipped as the camera orbits and also that depth buffer precision is maximized.
      Note: Updating clipping planes after a camera move can be not sufficient. If the scene graph is modified or if a dragger or a rendered shape is moved, they can disappear or become partially clipped. A classic implementation of a render area must adjust clipping planes before each rendering by calling the provided method SceneInteractor.adjustClippingPlanes(SbViewportRegion). See render area's implementations available in $OIVJHOME/examples/inventor/viewercomponents/awt and $OIVJHOME/examples/inventor/viewercomponents/swt folders for examples of adjustClippingPlanes use.

    Compatibility
    Please note that some interaction behaviors are different than the classic Open Inventor viewer classes :

    • Left Mouse + Shift: now : Zoom in/out.
    • Mouse wheel performs a dolly relative to the cursor position, not the center of the viewport.

    • The classic Alt key behavior is not implemented. This key is reserved for application use.
    • The Right Mouse button does not display a popup menu. This button is reserved for application use.

    Usage:

    • Left Mouse: Rotate the scene
    • Left Mouse + Ctrl: Pan the scene.
    • Left Mouse + Shift: Zoom in/out the scene.
    • Mouse Wheel: Zoom in/out (zoom center is the mouse cursor location).