Class PostRenderingCanvas3D

java.lang.Object
java.awt.Component
java.awt.Canvas
org.jogamp.java3d.Canvas3D
mgui.interfaces.graphics.PostRenderingCanvas3D
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class PostRenderingCanvas3D
extends org.jogamp.java3d.Canvas3D
Extends Canvas3D to provide post-rendering capabilities.
Since:
1.0
Version:
1.0
Author:
Andrew Reid
See Also:
Serialized Form
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.awt.Canvas

    java.awt.Canvas.AccessibleAWTCanvas

    Nested classes/interfaces inherited from class java.awt.Component

    java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
  • Field Summary

    Fields
    Modifier and Type Field Description
    mgui.interfaces.graphics.PostRenderingCanvas3D.OffScreenCanvas3D offscreen_canvas  
    protected InterfaceCanvas3D parent  
    boolean post_render  
    protected java.util.ArrayList<Shape2DInt> post_render_shapes  

    Fields inherited from class org.jogamp.java3d.Canvas3D

    FIELD_ALL, FIELD_LEFT, FIELD_RIGHT

    Fields inherited from class java.awt.Component

    accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT

    Fields inherited from interface java.awt.image.ImageObserver

    ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
  • Constructor Summary

    Constructors
    Constructor Description
    PostRenderingCanvas3D​(InterfaceCanvas3D parent, java.awt.GraphicsConfiguration graphicsConfiguration)  
    PostRenderingCanvas3D​(InterfaceCanvas3D parent, java.awt.GraphicsConfiguration graphicsConfiguration, boolean offScreen)  
  • Method Summary

    Modifier and Type Method Description
    void addPostRenderShape​(Shape2DInt shape)  
    void clearPostRenderShapes()  
    java.awt.image.BufferedImage getScreenShot​(InterfaceGraphic3D graphic3D, float scale)
    Returns a screen shot created from an offscreen buffer for this canvas.
    void postRender()  
    void postSwap()  
    void removePostRenderShape​(Shape2DInt shape)  
    void setOffScreenCanvas​(mgui.interfaces.graphics.PostRenderingCanvas3D.OffScreenCanvas3D c)  
    void unsetOffScreenCanvas()  

    Methods inherited from class org.jogamp.java3d.Canvas3D

    addNotify, getCenterEyeInImagePlate, getDoubleBufferAvailable, getDoubleBufferEnable, getGraphics2D, getGraphicsContext3D, getImagePlateToVworld, getInverseVworldProjection, getLeftEyeInImagePlate, getLeftManualEyeInImagePlate, getLocationOnScreen, getMonoscopicViewPolicy, getOffScreenBuffer, getOffScreenLocation, getOffScreenLocation, getPhysicalHeight, getPhysicalWidth, getPixelLocationFromImagePlate, getPixelLocationInImagePlate, getPixelLocationInImagePlate, getRightEyeInImagePlate, getRightManualEyeInImagePlate, getSceneAntialiasingAvailable, getScreen3D, getStereoAvailable, getStereoEnable, getView, getVworldProjection, getVworldToImagePlate, isOffScreen, isRendererRunning, isShadingLanguageSupported, paint, preRender, queryProperties, removeNotify, renderField, renderOffScreenBuffer, setDoubleBufferEnable, setLeftManualEyeInImagePlate, setMonoscopicViewPolicy, setOffScreenBuffer, setOffScreenLocation, setOffScreenLocation, setRightManualEyeInImagePlate, setStereoEnable, startRenderer, stopRenderer, swap, waitForOffScreenRendering

    Methods inherited from class java.awt.Canvas

    createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy, update

    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, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, 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, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, 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, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, reshape, 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, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • parent

      protected InterfaceCanvas3D parent
    • post_render_shapes

      protected java.util.ArrayList<Shape2DInt> post_render_shapes
    • post_render

      public boolean post_render
    • offscreen_canvas

      public mgui.interfaces.graphics.PostRenderingCanvas3D.OffScreenCanvas3D offscreen_canvas
  • Constructor Details

    • PostRenderingCanvas3D

      public PostRenderingCanvas3D​(InterfaceCanvas3D parent, java.awt.GraphicsConfiguration graphicsConfiguration)
    • PostRenderingCanvas3D

      public PostRenderingCanvas3D​(InterfaceCanvas3D parent, java.awt.GraphicsConfiguration graphicsConfiguration, boolean offScreen)
  • Method Details

    • addPostRenderShape

      public void addPostRenderShape​(Shape2DInt shape)
    • removePostRenderShape

      public void removePostRenderShape​(Shape2DInt shape)
    • clearPostRenderShapes

      public void clearPostRenderShapes()
    • postRender

      public void postRender()
      Overrides:
      postRender in class org.jogamp.java3d.Canvas3D
    • postSwap

      public void postSwap()
      Overrides:
      postSwap in class org.jogamp.java3d.Canvas3D
    • setOffScreenCanvas

      public void setOffScreenCanvas​(mgui.interfaces.graphics.PostRenderingCanvas3D.OffScreenCanvas3D c)
    • unsetOffScreenCanvas

      public void unsetOffScreenCanvas()
    • getScreenShot

      public java.awt.image.BufferedImage getScreenShot​(InterfaceGraphic3D graphic3D, float scale)
      Returns a screen shot created from an offscreen buffer for this canvas. An offscreen canvas must have already been set via the setOffScreenCanvas(mgui.interfaces.graphics.PostRenderingCanvas3D.OffScreenCanvas3D) method (otherwise the method returns null).

      Note that post rendering is (for some reason) not captured in this screen shot. TODO: fix this

      Returns: