Package jahuwaldt.j3d
Class BGFGCanvas3D
- java.lang.Object
- 
- java.awt.Component
- 
- java.awt.Canvas
- 
- org.jogamp.java3d.Canvas3D
- 
- jahuwaldt.j3d.ImageCaptureCanvas3D
- 
- jahuwaldt.j3d.BGFGCanvas3D
 
 
 
 
 
- 
- All Implemented Interfaces:
- java.awt.image.ImageObserver,- java.awt.MenuContainer,- java.io.Serializable,- javax.accessibility.Accessible
 - Direct Known Subclasses:
- GeomSSCanvas3D
 
 public class BGFGCanvas3D extends ImageCaptureCanvas3D BGFGCanvas3D is aCanvas3Dthat renders an list of arbitrary 2DBGFGImageobjects either behind or over top of the 3D scene. This canvas also provides a callback that allows you to capture the contents of the canvas and write out the image information.Modified by: Joseph A.Huwaldt - Version:
- June 4, 2023
- Author:
- Joseph A. Huwaldt, Date: April 9, 2009
- See Also:
- Serialized Form
 
- 
- 
Constructor SummaryConstructors Constructor Description BGFGCanvas3D(java.awt.GraphicsConfiguration gconfig)Constructs and initializes a new BGFGCanvas3D object that Java 3D can render into.BGFGCanvas3D(java.awt.GraphicsConfiguration gconfig, boolean offscreen)Constructs and initializes a new BGFGCanvas3D object that Java 3D can render into.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddBackground(BGFGImage background)Adds the specified background to this canvas.voidaddOverlay(BGFGImage overlay)Adds the specified overlay to this canvas.voidclearBackgrounds()Removes all the backgrounds from this canvas.voidclearOverlays()Removes all the overlays from this canvas.BGFGImagegetBackground(int index)Return the specified background used by this canvas.intgetNumberBackgrounds()Returns the number of background images associated with this canvas.intgetNumberOverlays()Returns the number of overlays/foregrounds associated with this canvas.BGFGImagegetOverlay(int index)Return the specified overlay used by this canvas.voidpostRender()This routine is called by the Java 3D rendering loop after completing all rendering to the canvas for this frame and before the buffer swap.voidpreRender()This routine is called by the Java 3D rendering loop after clearing the canvas and before any rendering has been done for this frame.BGFGImageremoveBackground(int index)Removes the specified background from this canvas.booleanremoveBackground(BGFGImage background)Removes the specified background from this canvas.BGFGImageremoveOverlay(int index)Removes the specified overlay from this canvas.booleanremoveOverlay(BGFGImage overlay)Removes the specified overlay from this canvas.BGFGImagesetBackground(int index, BGFGImage background)Set the specified background for use for this canvas.BGFGImagesetOverlay(int index, BGFGImage overlay)Set the specified overlay for use for this canvas.- 
Methods inherited from class jahuwaldt.j3d.ImageCaptureCanvas3DaddCaptureObserver, postSwap, removeCaptureObserver
 - 
Methods inherited from class org.jogamp.java3d.Canvas3DaddNotify, getCenterEyeInImagePlate, getDoubleBufferAvailable, getDoubleBufferEnable, getGraphics2D, getGraphicsContext3D, getImagePlateToVworld, getInverseVworldProjection, getLeftEyeInImagePlate, getLeftManualEyeInImagePlate, getLocationOnScreen, getMonoscopicViewPolicy, getOffScreenBuffer, getOffScreenLocation, getOffScreenLocation, getPhysicalHeight, getPhysicalWidth, getPixelHeight, getPixelLocationFromImagePlate, getPixelLocationInImagePlate, getPixelLocationInImagePlate, getPixelWidth, getRightEyeInImagePlate, getRightManualEyeInImagePlate, getSceneAntialiasingAvailable, getScreen3D, getStereoAvailable, getStereoEnable, getView, getVworldProjection, getVworldToImagePlate, isOffScreen, isRendererRunning, isShadingLanguageSupported, paint, queryProperties, removeNotify, renderField, renderOffScreenBuffer, setDoubleBufferEnable, setLeftManualEyeInImagePlate, setMonoscopicViewPolicy, setOffScreenBuffer, setOffScreenLocation, setOffScreenLocation, setRightManualEyeInImagePlate, setStereoEnable, startRenderer, stopRenderer, swap, waitForOffScreenRendering
 - 
Methods inherited from class java.awt.CanvascreateBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy, update
 - 
Methods inherited from class java.awt.Componentaction, 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, 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, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, 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
 
- 
 
- 
- 
- 
Constructor Detail- 
BGFGCanvas3Dpublic BGFGCanvas3D(java.awt.GraphicsConfiguration gconfig) Constructs and initializes a new BGFGCanvas3D object that Java 3D can render into.- Parameters:
- gconfig- A valid GraphicsConfiguration object that will be used to create the canvas. May not be null.
- Throws:
- java.lang.IllegalArgumentException- if the specified GraphicsConfiguration does not support 3D rendering
 
 - 
BGFGCanvas3Dpublic BGFGCanvas3D(java.awt.GraphicsConfiguration gconfig, boolean offscreen) Constructs and initializes a new BGFGCanvas3D object that Java 3D can render into.- Parameters:
- gconfig- A valid GraphicsConfiguration object that will be used to create the canvas. May not be null.
- offscreen- A flag that indicates whether this canvas is an off-screen 3D rendering canvas. Note that if offScreen is set to true, this Canvas3D object cannot be used for normal rendering; it should not be added to any Container object.
- Throws:
- java.lang.IllegalArgumentException- if the specified GraphicsConfiguration does not support 3D rendering
 
 
- 
 - 
Method Detail- 
getNumberBackgroundspublic int getNumberBackgrounds() Returns the number of background images associated with this canvas.- Returns:
- The number of background images.
 
 - 
getBackgroundpublic BGFGImage getBackground(int index) Return the specified background used by this canvas.- Parameters:
- index- The index of the background image to retrieve.
- Returns:
- The background image at the specified index.
 
 - 
setBackgroundpublic BGFGImage setBackground(int index, BGFGImage background) Set the specified background for use for this canvas.- Parameters:
- index- The index for the background to set.
- background- The background image to set at the specified index. May not be null.
- Returns:
- The image that was at the specified index location.
 
 - 
addBackgroundpublic void addBackground(BGFGImage background) Adds the specified background to this canvas.- Parameters:
- background- The background to add to this canvas. May not be null.
 
 - 
removeBackgroundpublic BGFGImage removeBackground(int index) Removes the specified background from this canvas.- Parameters:
- index- The index for the background to remove.
- Returns:
- The image that used to be at the specified index.
 
 - 
removeBackgroundpublic boolean removeBackground(BGFGImage background) Removes the specified background from this canvas.- Parameters:
- background- The background to remove from this canvas. May not be null.
- Returns:
- true if this canvas contained the specified background image.
 
 - 
clearBackgroundspublic void clearBackgrounds() Removes all the backgrounds from this canvas.
 - 
getNumberOverlayspublic int getNumberOverlays() Returns the number of overlays/foregrounds associated with this canvas.- Returns:
- The number of overlays.
 
 - 
getOverlaypublic BGFGImage getOverlay(int index) Return the specified overlay used by this canvas.- Parameters:
- index- The index of the overlay (foreground) to return.
- Returns:
- The overlay/foreground image at the specified index.
 
 - 
setOverlaypublic BGFGImage setOverlay(int index, BGFGImage overlay) Set the specified overlay for use for this canvas.- Parameters:
- index- The index for the overlay to set.
- overlay- The overlay to set at the specified index location. May not be null.
- Returns:
- The image that was at the specified index location.
 
 - 
addOverlaypublic void addOverlay(BGFGImage overlay) Adds the specified overlay to this canvas.- Parameters:
- overlay- The overlay to add. May not be null.
 
 - 
removeOverlaypublic BGFGImage removeOverlay(int index) Removes the specified overlay from this canvas.- Parameters:
- index- The index for the overlay to remove.
- Returns:
- The image that used to be at the specified index.
 
 - 
removeOverlaypublic boolean removeOverlay(BGFGImage overlay) Removes the specified overlay from this canvas.- Parameters:
- overlay- The overlay image to remove from this canvas. May not be null.
- Returns:
- true if this canvas contained the specified overlay/foreground image.
 
 - 
clearOverlayspublic void clearOverlays() Removes all the overlays from this canvas.
 - 
preRenderpublic void preRender() This routine is called by the Java 3D rendering loop after clearing the canvas and before any rendering has been done for this frame. This implementation renders any background images onto the canvas. Note that BGFGImage.getImage() is always called before getImageX() or getImageY().- Overrides:
- preRenderin class- org.jogamp.java3d.Canvas3D
 
 - 
postRenderpublic void postRender() This routine is called by the Java 3D rendering loop after completing all rendering to the canvas for this frame and before the buffer swap. This implementation renders any overlay images onto the canvas. Note that BGFGImage.getImage() is always called before getImageX() or getImageY().- Overrides:
- postRenderin class- org.jogamp.java3d.Canvas3D
 
 
- 
 
-