Class RenderAreaInteractive
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Canvas
-
- com.jogamp.opengl.awt.GLCanvas
-
- com.openinventor.inventor.viewercomponents.awt.glcanvas.renderareas.RenderArea
-
- com.openinventor.inventor.viewercomponents.awt.glcanvas.renderareas.RenderAreaInteractive
-
- All Implemented Interfaces:
com.jogamp.nativewindow.awt.AWTPrintLifecycle,com.jogamp.nativewindow.NativeSurfaceHolder,com.jogamp.nativewindow.OffscreenLayerOption,com.jogamp.nativewindow.ScalableSurface,com.jogamp.nativewindow.WindowClosingProtocol,com.jogamp.opengl.awt.AWTGLAutoDrawable,com.jogamp.opengl.awt.ComponentEvents,com.jogamp.opengl.GLAutoDrawable,com.jogamp.opengl.GLDrawable,com.jogamp.opengl.GLEventListener,com.jogamp.opengl.GLSharedContextSetter,IRenderArea,IRenderAreaInteractive,java.awt.event.KeyListener,java.awt.event.MouseListener,java.awt.event.MouseMotionListener,java.awt.event.MouseWheelListener,java.awt.image.ImageObserver,java.awt.MenuContainer,java.io.Serializable,java.util.EventListener,javax.accessibility.Accessible
- Direct Known Subclasses:
RenderAreaExaminer,RenderAreaOrbiter
public class RenderAreaInteractive extends RenderArea implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.MouseWheelListener, java.awt.event.KeyListener, IRenderAreaInteractive
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.BaselineResizeBehavior
-
Nested classes/interfaces inherited from interface com.jogamp.nativewindow.awt.AWTPrintLifecycle
com.jogamp.nativewindow.awt.AWTPrintLifecycle.Context
-
Nested classes/interfaces inherited from interface com.openinventor.inventor.viewercomponents.awt.IRenderAreaInteractive
IRenderAreaInteractive.ClippingPlanesAdjustMode
-
-
Field Summary
-
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
Fields inherited from interface com.jogamp.nativewindow.awt.AWTPrintLifecycle
DEFAULT_PRINT_TILE_SIZE
-
-
Constructor Summary
Constructors Constructor Description RenderAreaInteractive()RenderAreaInteractive(com.jogamp.opengl.GLCapabilities caps)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidactivateStereo(boolean activated)Activates or deactivates raw stereo.IRenderAreaInteractive.ClippingPlanesAdjustModegetClippingPlanesAdjustMode()Get the camera clipping planes adjustment mode.SceneInteractorgetRootSceneGraph()Deprecated.SceneInteractorgetSceneInteractor()Gets the root scene graph of this render area.voidinit(com.jogamp.opengl.GLAutoDrawable drawable)booleanisStereoSupported()Gets stereo support.voidkeyPressed(java.awt.event.KeyEvent e)voidkeyReleased(java.awt.event.KeyEvent e)voidkeyTyped(java.awt.event.KeyEvent e)voidmouseClicked(java.awt.event.MouseEvent e)voidmouseDragged(java.awt.event.MouseEvent e)voidmouseEntered(java.awt.event.MouseEvent e)voidmouseExited(java.awt.event.MouseEvent e)voidmouseMoved(java.awt.event.MouseEvent e)voidmousePressed(java.awt.event.MouseEvent e)voidmouseReleased(java.awt.event.MouseEvent e)voidmouseWheelMoved(java.awt.event.MouseWheelEvent e)voidrestoreCamera()Restore saved camera.voidsaveCamera()Save current camera.voidsetCameraType(SceneInteractor.CameraMode mode)Set camera mode to perspective or orthographic.voidsetClippingPlanesAdjustMode(IRenderAreaInteractive.ClippingPlanesAdjustMode mode)Set the camera clipping planes adjustment mode.voidsetSceneGraph(SoNode sceneGraph)Sets the scene graph.voidsetStereoCameraBalance(float balance)Sets the stereo balance (the position of the zero parallax plane).voidsetStereoCameraOffset(float offset)Sets the stereo offset (the distance of each eye from the camera position).voidviewAll(SbViewportRegion viewport)Set the camera to view all the scene.voidviewAxis(SbVec3f direction, SbVec3f up)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.-
Methods inherited from class com.openinventor.inventor.viewercomponents.awt.glcanvas.renderareas.RenderArea
display, dispose, dispose, getAntialiasingMode, getAntialiasingQuality, getComponent, getGLRenderAction, getStillSuperSamplingDelay, getStillSuperSamplingQuality, getTransparencyType, isRawStereoAvailable, reshape, scheduleRedraw, setAntialiasingMode, setAntialiasingQuality, setGLRenderAction, setStillSuperSamplingDelay, setStillSuperSamplingQuality, setTransparencyType
-
Methods inherited from class com.jogamp.opengl.awt.GLCanvas
addGLEventListener, addGLEventListener, addNotify, areAllGLEventListenerInitialized, createContext, destroy, display, disposeGLEventListener, flushGLRunnables, getAnimator, getAutoSwapBufferMode, getChosenGLCapabilities, getContext, getContextCreationFlags, getCurrentSurfaceScale, getDefaultCloseOperation, getDelegatedDrawable, getExclusiveContextThread, getFactory, getGL, getGLEventListener, getGLEventListenerCount, getGLEventListenerInitState, getGLProfile, getGraphicsConfiguration, getHandle, getMaximumSurfaceScale, getMinimumSurfaceScale, getNativeSurface, getRequestedGLCapabilities, getRequestedSurfaceScale, getShallUseOffscreenLayer, getSurfaceHeight, getSurfaceWidth, getUpstreamLock, getUpstreamWidget, invoke, invoke, isGLOriented, isOffscreenLayerSurfaceEnabled, isRealized, isThreadGLCapable, main, paint, print, releasePrint, removeGLEventListener, removeNotify, reshape, setAnimator, setAutoSwapBufferMode, setContext, setContextCreationFlags, setDefaultCloseOperation, setExclusiveContextThread, setGL, setGLEventListenerInitState, setRealized, setShallUseOffscreenLayer, setSharedAutoDrawable, setSharedContext, setSurfaceScale, setupPrint, swapBuffers, toString, update
-
Methods inherited from class java.awt.Canvas
createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, dispatchEvent, doLayout, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, preferredSize, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setMixingCutoutShape, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.jogamp.opengl.awt.ComponentEvents
addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener
-
Methods inherited from interface com.openinventor.inventor.viewercomponents.awt.IRenderArea
dispose, getAntialiasingMode, getAntialiasingQuality, getComponent, getGLRenderAction, getStillSuperSamplingDelay, getStillSuperSamplingQuality, getTransparencyType, isRawStereoAvailable, scheduleRedraw, setAntialiasingMode, setAntialiasingQuality, setGLRenderAction, setStillSuperSamplingDelay, setStillSuperSamplingQuality, setTransparencyType
-
-
-
-
Method Detail
-
setSceneGraph
public void setSceneGraph(SoNode sceneGraph)
Description copied from interface:IRenderAreaSets the scene graph. This is the Open Inventor scene which will be traversed for rendering and event processing.- Specified by:
setSceneGraphin interfaceIRenderArea- Overrides:
setSceneGraphin classRenderArea- Parameters:
sceneGraph- the scene graph
-
init
public void init(com.jogamp.opengl.GLAutoDrawable drawable)
- Specified by:
initin interfacecom.jogamp.opengl.GLEventListener- Overrides:
initin classRenderArea
-
getClippingPlanesAdjustMode
public IRenderAreaInteractive.ClippingPlanesAdjustMode getClippingPlanesAdjustMode()
Get the camera clipping planes adjustment mode.- Specified by:
getClippingPlanesAdjustModein interfaceIRenderAreaInteractive
-
setClippingPlanesAdjustMode
public void setClippingPlanesAdjustMode(IRenderAreaInteractive.ClippingPlanesAdjustMode mode)
Set the camera clipping planes adjustment mode.
When adjustment mode is set toAUTO, 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 toMANUAL, 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 isAUTO.- Specified by:
setClippingPlanesAdjustModein interfaceIRenderAreaInteractive
-
getRootSceneGraph
@Deprecated public SceneInteractor getRootSceneGraph()
Deprecated.Description copied from interface:IRenderAreaInteractiveGets the root scene graph of this render area.- Specified by:
getRootSceneGraphin interfaceIRenderAreaInteractive- Returns:
- the root scene graph
-
getSceneInteractor
public SceneInteractor getSceneInteractor()
Description copied from interface:IRenderAreaInteractiveGets the root scene graph of this render area.- Specified by:
getSceneInteractorin interfaceIRenderAreaInteractive- Returns:
- the root scene graph
-
viewAll
public void viewAll(SbViewportRegion viewport)
Description copied from interface:IRenderAreaInteractiveSet the camera to view all the scene.- Specified by:
viewAllin interfaceIRenderAreaInteractive- 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:IRenderAreaInteractiveMoves 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:
viewAxisin interfaceIRenderAreaInteractive- Parameters:
direction- the new view direction vectorup- the new "up" direction
-
saveCamera
public void saveCamera()
Description copied from interface:IRenderAreaInteractiveSave current camera. The values of the camera fields are saved and can be restored by callingIRenderAreaInteractive.restoreCamera().- Specified by:
saveCamerain interfaceIRenderAreaInteractive
-
restoreCamera
public void restoreCamera()
Description copied from interface:IRenderAreaInteractiveRestore saved camera. The values of the camera fields are restored to the last saved values.- Specified by:
restoreCamerain interfaceIRenderAreaInteractive
-
setCameraType
public void setCameraType(SceneInteractor.CameraMode mode)
Description copied from interface:IRenderAreaInteractiveSet camera mode to perspective or orthographic.- Specified by:
setCameraTypein interfaceIRenderAreaInteractive- Parameters:
mode- the camera mode: perspective or orthographic
-
activateStereo
public void activateStereo(boolean activated)
Description copied from interface:IRenderAreaActivates or deactivates raw stereo.- Specified by:
activateStereoin interfaceIRenderArea- Overrides:
activateStereoin classRenderArea- Parameters:
activated- true to activate raw stereo
-
isStereoSupported
public boolean isStereoSupported()
Description copied from interface:IRenderAreaInteractiveGets stereo support.- Specified by:
isStereoSupportedin interfaceIRenderAreaInteractive- Returns:
- true if stereo is supported
-
setStereoCameraOffset
public void setStereoCameraOffset(float offset)
Description copied from interface:IRenderAreaInteractiveSets 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:
setStereoCameraOffsetin interfaceIRenderAreaInteractive- Parameters:
offset- the stereo offset
-
setStereoCameraBalance
public void setStereoCameraBalance(float balance)
Description copied from interface:IRenderAreaInteractiveSets the stereo balance (the position of the zero parallax plane).- Specified by:
setStereoCameraBalancein interfaceIRenderAreaInteractive- Parameters:
balance- the stereo balance
-
mousePressed
public void mousePressed(java.awt.event.MouseEvent e)
- Specified by:
mousePressedin interfacejava.awt.event.MouseListener
-
mouseWheelMoved
public void mouseWheelMoved(java.awt.event.MouseWheelEvent e)
- Specified by:
mouseWheelMovedin interfacejava.awt.event.MouseWheelListener
-
mouseDragged
public void mouseDragged(java.awt.event.MouseEvent e)
- Specified by:
mouseDraggedin interfacejava.awt.event.MouseMotionListener
-
mouseMoved
public void mouseMoved(java.awt.event.MouseEvent e)
- Specified by:
mouseMovedin interfacejava.awt.event.MouseMotionListener
-
mouseClicked
public void mouseClicked(java.awt.event.MouseEvent e)
- Specified by:
mouseClickedin interfacejava.awt.event.MouseListener
-
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent e)
- Specified by:
mouseReleasedin interfacejava.awt.event.MouseListener
-
mouseEntered
public void mouseEntered(java.awt.event.MouseEvent e)
- Specified by:
mouseEnteredin interfacejava.awt.event.MouseListener
-
mouseExited
public void mouseExited(java.awt.event.MouseEvent e)
- Specified by:
mouseExitedin interfacejava.awt.event.MouseListener
-
keyTyped
public void keyTyped(java.awt.event.KeyEvent e)
- Specified by:
keyTypedin interfacejava.awt.event.KeyListener
-
keyPressed
public void keyPressed(java.awt.event.KeyEvent e)
- Specified by:
keyPressedin interfacejava.awt.event.KeyListener
-
keyReleased
public void keyReleased(java.awt.event.KeyEvent e)
- Specified by:
keyReleasedin interfacejava.awt.event.KeyListener
-
-