- All Implemented Interfaces:
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
SceneInteractornode 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
SceneInteractorfor more details about the structure of the internal scene graph.
The SceneOrbiter uses an instance of
SoCameraInteractorto manipulate the camera in response to OpenInventor events.
- 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
SoRenderAreaCoreclass. 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
SoEventBuilderclass. Example components are provided for AWT and SWT toolkits: AWTEventToSoEvent and SWTEventToSoEvent.
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.
- 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
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.
- 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).
Nested Class Summary
Nested classes/interfaces inherited from class com.openinventor.inventor.viewercomponents.nodes.SceneInteractor
Nested classes/interfaces inherited from class com.openinventor.inventor.nodes.SoSeparator
SoSeparator.Cachings, SoSeparator.FastEditings, SoSeparator.RenderUnitIds
Nested classes/interfaces inherited from class com.openinventor.inventor.nodes.SoNode
Fields inherited from class com.openinventor.inventor.nodes.SoSeparator
boundingBoxCaching, fastEditing, pickCulling, renderCaching, renderCulling, renderUnitId
Constructors Constructor Description
All Methods Instance Methods Concrete Methods Modifier and Type Method Description
enableViewingCube(boolean enabled)Enable or disable the viewing cube.
getViewingCube()Returns a pointer to the viewing cube.
isViewingCubeEnabled()Return if viewing cube is enabled.
setCameraMode(SceneInteractor.CameraMode mode)Set camera mode to perspective or orthographic.
Methods inherited from class com.openinventor.inventor.viewercomponents.nodes.SceneInteractor
adjustClippingPlanes, enableHeadlight, getCamera, getCameraInteractor, getCameraMode, getRenderEngineMode, isHeadlightEnabled, viewAll, viewAxis
Methods inherited from class com.openinventor.inventor.nodes.SoGroup
addChild, findChild, getChild, getNumChildren, insertChild, removeAllChildren, removeChild, removeChild, replaceChild, replaceChild
Methods inherited from class com.openinventor.inventor.nodes.SoNode
affectsState, callback, copy, copy, distribute, doAction, getAlternateRep, getBoundingBox, getByName, getMatrix, getPrimitiveCount, getRenderUnitID, GLRender, GLRenderBelowPath, GLRenderInPath, GLRenderOffPath, grabEventsCleanup, grabEventsSetup, handleEvent, isBoundingBoxIgnoring, isOverride, pick, rayPick, search, setOverride, touch, write
Methods inherited from class com.openinventor.inventor.fields.SoFieldContainer
copyFieldValues, copyFieldValues, enableNotify, fieldsAreEqual, get, getAllFields, getEventIn, getEventOut, getField, getFieldName, hasDefaultValues, isNotifyEnabled, set, setToDefaults
Methods inherited from class com.openinventor.inventor.misc.SoBase
dispose, getName, isDisposable, isSynchronizable, setName, setSynchronizable
public void enableViewingCube(boolean enabled)Enable or disable the viewing cube.
public boolean isViewingCubeEnabled()Return if viewing cube is enabled.
public SoViewingCube getViewingCube()Returns a pointer to the viewing cube.