java.lang.Object
java.awt.Component
java.awt.Canvas
com.jogamp.newt.awt.NewtCanvasAWT
com.openinventor.inventor.viewercomponents.awt.newt.renderareas.RenderArea
com.openinventor.inventor.viewercomponents.awt.newt.renderareas.RenderAreaInteractive
All Implemented Interfaces:
com.jogamp.nativewindow.awt.AWTPrintLifecycle, com.jogamp.nativewindow.NativeSurfaceHolder, com.jogamp.nativewindow.NativeWindowHolder, com.jogamp.nativewindow.OffscreenLayerOption, com.jogamp.nativewindow.WindowClosingProtocol, com.jogamp.newt.event.KeyListener, com.jogamp.newt.event.MouseListener, com.jogamp.newt.event.NEWTEventListener, com.jogamp.opengl.GLEventListener, IRenderArea, IRenderAreaInteractive, ImageObserver, MenuContainer, Serializable, EventListener, Accessible
Direct Known Subclasses:
RenderAreaExaminer, RenderAreaOrbiter

public class RenderAreaInteractive extends RenderArea implements com.jogamp.newt.event.MouseListener, com.jogamp.newt.event.KeyListener, IRenderAreaInteractive
See Also:
  • Constructor Details

    • RenderAreaInteractive

      public RenderAreaInteractive()
    • RenderAreaInteractive

      public RenderAreaInteractive(boolean enableStereo)
  • Method Details

    • setSceneGraph

      public void setSceneGraph(SoNode sceneGraph)
      Description copied from interface: IRenderArea
      Sets the scene graph. This is the Open Inventor scene which will be traversed for rendering and event processing.
      Specified by:
      setSceneGraph in interface IRenderArea
      Overrides:
      setSceneGraph in class RenderArea
      Parameters:
      sceneGraph - the scene graph
    • init

      public void init(com.jogamp.opengl.GLAutoDrawable drawable)
      Specified by:
      init in interface com.jogamp.opengl.GLEventListener
      Overrides:
      init in class RenderArea
    • getClippingPlanesAdjustMode

      public IRenderAreaInteractive.ClippingPlanesAdjustMode getClippingPlanesAdjustMode()
      Get the camera clipping planes adjustment mode.
      Specified by:
      getClippingPlanesAdjustMode in interface IRenderAreaInteractive
    • setClippingPlanesAdjustMode

      public void setClippingPlanesAdjustMode(IRenderAreaInteractive.ClippingPlanesAdjustMode mode)
      Set the camera clipping planes adjustment mode.
      When adjustment mode is set to AUTO, the camera near and far planes are dynamically adjusted to be as tight as possible (least amount of stuff is clipped) before each render traversal.
      When adjustment mode is set to MANUAL, the user is expected to manually set those planes. Updating clipping planes after a camera move is not enough, if a dragger or a rendered shape is moved, they can disappear or become partially clipped.
      Default is AUTO.
      Specified by:
      setClippingPlanesAdjustMode in interface IRenderAreaInteractive
    • getRootSceneGraph

      @Deprecated public SceneInteractor getRootSceneGraph()
      Deprecated.
      Description copied from interface: IRenderAreaInteractive
      Gets the root scene graph of this render area.
      Specified by:
      getRootSceneGraph in interface IRenderAreaInteractive
      Returns:
      the root scene graph
    • getSceneInteractor

      public SceneInteractor getSceneInteractor()
      Description copied from interface: IRenderAreaInteractive
      Gets the root scene graph of this render area.
      Specified by:
      getSceneInteractor in interface IRenderAreaInteractive
      Returns:
      the root scene graph
    • viewAll

      public void viewAll(SbViewportRegion viewport)
      Description copied from interface: IRenderAreaInteractive
      Set the camera to view all the scene.
      Specified by:
      viewAll in interface IRenderAreaInteractive
      Parameters:
      viewport - the viewport region used to compute the bounding box of the scene.
    • viewAxis

      public void viewAxis(SbVec3f direction, SbVec3f up)
      Description copied from interface: IRenderAreaInteractive
      Moves the camera to be aligned with the given direction vector while keeping the "up" direction of the camera parallel to the specified up vector.
      Specified by:
      viewAxis in interface IRenderAreaInteractive
      Parameters:
      direction - the new view direction vector
      up - the new "up" direction
    • saveCamera

      public void saveCamera()
      Description copied from interface: IRenderAreaInteractive
      Save current camera. The values of the camera fields are saved and can be restored by calling IRenderAreaInteractive.restoreCamera().
      Specified by:
      saveCamera in interface IRenderAreaInteractive
    • restoreCamera

      public void restoreCamera()
      Description copied from interface: IRenderAreaInteractive
      Restore saved camera. The values of the camera fields are restored to the last saved values.
      Specified by:
      restoreCamera in interface IRenderAreaInteractive
    • setCameraType

      public void setCameraType(SceneInteractor.CameraMode mode)
      Description copied from interface: IRenderAreaInteractive
      Set camera mode to perspective or orthographic.
      Specified by:
      setCameraType in interface IRenderAreaInteractive
      Parameters:
      mode - the camera mode: perspective or orthographic
    • activateStereo

      public void activateStereo(boolean activated)
      Description copied from interface: IRenderArea
      Activates or deactivates raw stereo.
      Specified by:
      activateStereo in interface IRenderArea
      Overrides:
      activateStereo in class RenderArea
      Parameters:
      activated - true to activate raw stereo
    • isStereoSupported

      public boolean isStereoSupported()
      Description copied from interface: IRenderAreaInteractive
      Gets stereo support.
      Specified by:
      isStereoSupported in interface IRenderAreaInteractive
      Returns:
      true if stereo is supported
    • setStereoCameraOffset

      public void setStereoCameraOffset(float offset)
      Description copied from interface: IRenderAreaInteractive
      Sets the stereo offset (the distance of each eye from the camera position). The right eye is moved plus offset and the left eye is moved minus offset.
      Specified by:
      setStereoCameraOffset in interface IRenderAreaInteractive
      Parameters:
      offset - the stereo offset
    • setStereoCameraBalance

      public void setStereoCameraBalance(float balance)
      Description copied from interface: IRenderAreaInteractive
      Sets the stereo balance (the position of the zero parallax plane).
      Specified by:
      setStereoCameraBalance in interface IRenderAreaInteractive
      Parameters:
      balance - the stereo balance
    • mousePressed

      public void mousePressed(com.jogamp.newt.event.MouseEvent e)
      Specified by:
      mousePressed in interface com.jogamp.newt.event.MouseListener
    • mouseWheelMoved

      public void mouseWheelMoved(com.jogamp.newt.event.MouseEvent e)
      Specified by:
      mouseWheelMoved in interface com.jogamp.newt.event.MouseListener
    • mouseDragged

      public void mouseDragged(com.jogamp.newt.event.MouseEvent e)
      Specified by:
      mouseDragged in interface com.jogamp.newt.event.MouseListener
    • mouseMoved

      public void mouseMoved(com.jogamp.newt.event.MouseEvent e)
      Specified by:
      mouseMoved in interface com.jogamp.newt.event.MouseListener
    • mouseClicked

      public void mouseClicked(com.jogamp.newt.event.MouseEvent e)
      Specified by:
      mouseClicked in interface com.jogamp.newt.event.MouseListener
    • mouseReleased

      public void mouseReleased(com.jogamp.newt.event.MouseEvent e)
      Specified by:
      mouseReleased in interface com.jogamp.newt.event.MouseListener
    • mouseEntered

      public void mouseEntered(com.jogamp.newt.event.MouseEvent e)
      Specified by:
      mouseEntered in interface com.jogamp.newt.event.MouseListener
    • mouseExited

      public void mouseExited(com.jogamp.newt.event.MouseEvent e)
      Specified by:
      mouseExited in interface com.jogamp.newt.event.MouseListener
    • keyPressed

      public void keyPressed(com.jogamp.newt.event.KeyEvent e)
      Specified by:
      keyPressed in interface com.jogamp.newt.event.KeyListener
    • keyReleased

      public void keyReleased(com.jogamp.newt.event.KeyEvent e)
      Specified by:
      keyReleased in interface com.jogamp.newt.event.KeyListener