javax.media.j3d
Class Canvas3D

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Canvas
          extended by javax.media.j3d.Canvas3D
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible
Direct Known Subclasses:
JCanvas3D.InternalCanvas3D

public class Canvas3D
extends java.awt.Canvas

The Canvas3D class provides a drawing canvas for 3D rendering. It is used either for on-screen rendering or off-screen rendering. Canvas3D is an extension of the AWT Canvas class that users may further subclass to implement additional functionality.

The Canvas3D object extends the Canvas object to include 3D-related information such as the size of the canvas in pixels, the Canvas3D's location, also in pixels, within a Screen3D object, and whether or not the canvas has stereo enabled.

Because all Canvas3D objects contain a reference to a Screen3D object and because Screen3D objects define the size of a pixel in physical units, Java 3D can convert a Canvas3D size in pixels to a physical world size in meters. It can also determine the Canvas3D's position and orientation in the physical world.

On-screen Rendering vs. Off-screen Rendering

The Canvas3D class is used either for on-screen rendering or off-screen rendering. On-screen Canvas3Ds are added to AWT or Swing Container objects like any other canvas. Java 3D automatically and continuously renders to all on-screen canvases that are attached to an active View object. On-screen Canvas3Ds can be either single or double buffered and they can be either stereo or monoscopic.

Off-screen Canvas3Ds must not be added to any Container. Java 3D renders to off-screen canvases in response to the renderOffScreenBuffer method. Off-screen Canvas3Ds are single buffered. However, on many systems, the actual rendering is done to an off-screen hardware buffer or to a 3D library-specific buffer and only copied to the off-screen buffer of the Canvas when the rendering is complete, at "buffer swap" time. Off-screen Canvas3Ds are monoscopic.

The setOffScreenBuffer method sets the off-screen buffer for this Canvas3D. The specified image is written into by the Java 3D renderer. The size of the specified ImageComponent determines the size, in pixels, of this Canvas3D - the size inherited from Component is ignored. Note that the size, physical width, and physical height of the associated Screen3D must be set explicitly prior to rendering. Failure to do so will result in an exception.

The getOffScreenBuffer method retrieves the off-screen buffer for this Canvas3D.

The renderOffScreenBuffer method schedules the rendering of a frame into this Canvas3D's off-screen buffer. The rendering is done from the point of view of the View object to which this Canvas3D has been added. No rendering is performed if this Canvas3D object has not been added to an active View. This method does not wait for the rendering to actually happen. An application that wishes to know when the rendering is complete must either subclass Canvas3D and override the postSwap method, or call waitForOffScreenRendering.

The setOfScreenLocation methods set the location of this off-screen Canvas3D. The location is the upper-left corner of the Canvas3D relative to the upper-left corner of the corresponding off-screen Screen3D. The function of these methods is similar to that of Component.setLocation for on-screen Canvas3D objects. The default location is (0,0).

Accessing and Modifying an Eye's Image Plate Position

A Canvas3D object provides sophisticated applications with access to the eye's position information in head-tracked, room-mounted runtime environments. It also allows applications to manipulate the position of an eye relative to an image plate in non-head-tracked runtime environments.

The setLeftManualEyeInImagePlate and setRightManualEyeInImagePlate methods set the position of the manual left and right eyes in image plate coordinates. These values determine eye placement when a head tracker is not in use and the application is directly controlling the eye position in image plate coordinates. In head-tracked mode or when the windowEyepointPolicy is RELATIVE_TO_FIELD_OF_VIEW or RELATIVE_TO_COEXISTENCE, this value is ignored. When the windowEyepointPolicy is RELATIVE_TO_WINDOW, only the Z value is used.

The getLeftEyeInImagePlate, getRightEyeInImagePlate, and getCenterEyeInImagePlate methods retrieve the actual position of the left eye, right eye, and center eye in image plate coordinates and copy that value into the object provided. The center eye is the fictional eye half-way between the left and right eye. These three values are a function of the windowEyepointPolicy, the tracking enable flag, and the manual left, right, and center eye positions.

Monoscopic View Policy

The setMonoscopicViewPolicy and getMonoscopicViewPolicy methods set and retrieve the policy regarding how Java 3D generates monoscopic view. If the policy is set to View.LEFT_EYE_VIEW, the view generated corresponds to the view as seen from the left eye. If set to View.RIGHT_EYE_VIEW, the view generated corresponds to the view as seen from the right eye. If set to View.CYCLOPEAN_EYE_VIEW, the view generated corresponds to the view as seen from the "center eye," the fictional eye half-way between the left and right eye. The default monoscopic view policy is View.CYCLOPEAN_EYE_VIEW.

Immediate Mode Rendering

Pure immediate-mode rendering provides for those applications and applets that do not want Java 3D to do any automatic rendering of the scene graph. Such applications may not even wish to build a scene graph to represent their graphical data. However, they use Java 3D's attribute objects to set graphics state and Java 3D's geometric objects to render geometry.

A pure immediate mode application must create a minimal set of Java 3D objects before rendering. In addition to a Canvas3D object, the application must create a View object, with its associated PhysicalBody and PhysicalEnvironment objects, and the following scene graph elements: a VirtualUniverse object, a high-resolution Locale object, a BranchGroup node object, a TransformGroup node object with associated transform, and a ViewPlatform leaf node object that defines the position and orientation within the virtual universe that generates the view.

In immediate mode, all rendering is done completely under user control. It is necessary for the user to clear the 3D canvas, render all geometry, and swap the buffers. Additionally, rendering the right and left eye for stereo viewing becomes the sole responsibility of the application. In pure immediate mode, the user must stop the Java 3D renderer, via the Canvas3D object stopRenderer method, prior to adding the Canvas3D object to an active View object (that is, one that is attached to a live ViewPlatform object).

Other Canvas3D methods related to immediate mode rendering are:

Mixed Mode Rendering

Mixing immediate mode and retained or compiled-retained mode requires more structure than pure immediate mode. In mixed mode, the Java 3D renderer is running continuously, rendering the scene graph into the canvas.

Canvas3D methods related to mixed mode rendering are:

The above callback methods are called by the Java 3D rendering system and should not be called by an application directly.

The basic Java 3D stereo rendering loop, executed for each Canvas3D, is as follows:

The basic Java 3D monoscopic rendering loop is as follows:

In both cases, the entire loop, beginning with clearing the canvas and ending with swapping the buffers, defines a frame. The application is given the opportunity to render immediate-mode geometry at any of the clearly identified spots in the rendering loop. A user specifies his or her own rendering methods by extending the Canvas3D class and overriding the preRender, postRender, postSwap, and/or renderField methods. Updates to live Geometry, Texture, and ImageComponent objects in the scene graph are not allowed from any of these callback methods.

Serialization

Canvas3D does not support serialization. An attempt to serialize a Canvas3D object will result in an UnsupportedOperationException being thrown.

Additional Information

For more information, see the Introduction to the Java 3D API and View Model documents.

See Also:
Screen3D, View, GraphicsContext3D, 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
(package private)  boolean active
           
(package private)  int actualStencilSize
           
(package private)  boolean added
           
private  boolean addNotifyCalled
           
(package private) static int AMBIENTLIGHT_DIRTY
           
(package private)  float anisotropicDegreeMax
           
(package private)  boolean antialiasingSet
           
(package private)  AppearanceRetained appearance
           
(package private)  java.lang.Object appHandle
           
(package private)  AttributeBin attributeBin
           
(package private) static int ATTRIBUTEBIN_BIT
           
(package private) static int ATTRIBUTEBIN_DIRTY
           
(package private) static int BACKGROUND_DIRTY
           
(package private) static int BACKGROUND_IMAGE_DIRTY
           
(package private)  int canvasBit
           
(package private)  int canvasDirty
          Dirty bit to determine if the NodeComponent needs to be re-sent down to the underlying API
(package private)  int canvasId
           
private  boolean canvasIdAlloc
           
(package private)  CanvasViewCache canvasViewCache
           
(package private)  CanvasViewCache canvasViewCacheFrustum
           
private  CanvasViewEventCatcher canvasViewEventCatcher
           
(package private)  ColoringAttributesRetained coloringAttributes
           
(package private) static int COLORINGATTRS_DIRTY
           
private  java.util.LinkedList<java.awt.Container> containerParentList
           
(package private)  Context ctx
           
(package private)  boolean ctxChanged
           
(package private)  boolean ctxEyeLightingEnable
           
(package private)  boolean ctxReset
           
(package private)  long ctxTimeStamp
           
(package private)  AppearanceRetained currentAppear
           
(package private)  LightRetained[] currentLights
          The list of lights that are currently being represented in the native graphics context.
(package private)  MaterialRetained currentMaterial
           
(package private)  java.lang.Object[] curStateToUpdate
           
(package private)  int[] cvDirtyMask
           
(package private)  java.lang.Object cvLock
           
private static java.awt.GraphicsConfiguration defaultGcfg
           
(package private)  boolean depthBufferEnableOverride
          Flag to override RenderAttributes.depthBufferEnable
(package private)  boolean depthBufferWriteEnable
           
(package private)  boolean depthBufferWriteEnableOverride
          Flag to override RenderAttributes.depthBufferWriteEnable
(package private)  boolean dirtyDisplayList
           
(package private)  java.util.ArrayList dirtyDlistPerRinfoList
           
(package private)  java.lang.Object dirtyMaskLock
           
(package private)  java.util.ArrayList dirtyRenderAtomList
           
(package private)  java.util.ArrayList dirtyRenderMoleculeList
           
(package private)  java.util.ArrayList displayListResourceFreeList
           
(package private)  boolean doubleBufferAvailable
           
(package private)  boolean doubleBufferEnable
           
(package private)  Drawable drawable
           
(package private)  DrawingSurfaceObject drawingSurfaceObject
           
(package private)  boolean enableLighting
           
(package private)  long enableMask
           
(package private) static int ENV_STATE_MASK
           
(package private)  EnvironmentSet environmentSet
           
(package private) static int ENVIRONMENTSET_BIT
           
(package private)  java.lang.Object evaluateLock
           
(package private)  EventCatcher eventCatcher
           
(package private) static int EXT_ABGR
           
(package private) static int EXT_BGR
           
(package private)  int extensionsSupported
           
(package private) static int EYE_IN_IMAGE_PLATE_DIRTY
           
private  boolean fatalError
           
(package private)  long fbConfig
           
static int FIELD_ALL
          Specifies a single-field rendering loop.
static int FIELD_LEFT
          Specifies the left field of a field-sequential stereo rendering loop.
static int FIELD_RIGHT
          Specifies the right field of a field-sequential stereo rendering loop.
(package private)  boolean firstPaintCalled
           
(package private)  FogRetained fog
           
(package private) static int FOG_DIRTY
           
(package private)  int fogOn
           
(package private)  int[] frameCount
           
(package private)  int fullscreenHeight
           
(package private)  boolean fullScreenMode
           
(package private)  int fullscreenWidth
           
(package private)  java.lang.Object gfxCreationLock
           
(package private)  J3DGraphics2DImpl graphics2D
           
(package private) static java.util.Hashtable<java.awt.GraphicsConfiguration,GraphicsConfigInfo> graphicsConfigTable
           
(package private)  java.awt.GraphicsConfiguration graphicsConfiguration
           
(package private)  GraphicsContext3D graphicsContext3D
           
(package private)  boolean imageReady
           
(package private)  boolean isRunning
           
(package private)  boolean isRunningStatus
           
(package private)  int lastActiveTexUnit
           
(package private)  Point3d leftManualEyeInImagePlate
           
(package private)  LightBin lightBin
          The RenderBin bundle references used to decide what the underlying context contains.
(package private) static int LIGHTBIN_BIT
           
(package private) static int LIGHTBIN_DIRTY
           
(package private)  boolean lightChanged
           
(package private) static int LIGHTENABLES_DIRTY
           
(package private)  LightRetained[] lights
          cached RenderBin states for lazy native states update
(package private)  LineAttributesRetained lineAttributes
           
(package private) static int LINEATTRS_DIRTY
           
(package private)  boolean manualRendering
           
(package private)  MaterialRetained material
           
(package private) static int MATERIAL_DIRTY
           
(package private)  int maxAvailableTextureUnits
           
(package private)  int maxCombinedTextureImageUnits
           
(package private)  int maxTexCoordSets
           
(package private)  int maxTextureImageUnits
           
(package private)  int maxTextureUnits
           
(package private)  int maxVertexAttrs
           
(package private)  int maxVertexTextureImageUnits
           
(package private)  ModelClipRetained modelClip
           
(package private) static int MODELCLIP_DIRTY
           
(package private)  Transform3D modelMatrix
           
(package private) static int MONOSCOPIC_VIEW_POLICY_DIRTY
           
(package private)  int monoscopicViewPolicy
           
(package private) static int MOVED_OR_RESIZED_DIRTY
           
(package private) static int MULTISAMPLE
           
(package private)  boolean multiTexAccelerated
           
(package private)  java.lang.String nativeGraphicsRenderer
           
(package private)  java.lang.String nativeGraphicsVendor
           
(package private)  java.lang.String nativeGraphicsVersion
           
(package private)  boolean needToRebuildDisplayList
           
(package private)  java.awt.Point newPosition
           
(package private)  java.awt.Dimension newSize
           
(package private) static int NOCHANGE
           
(package private)  int numActiveTexUnit
           
(package private)  boolean offScreen
           
(package private)  ImageComponent2D offScreenBuffer
           
(package private)  long offScreenBufferInfo
           
(package private)  boolean offScreenBufferPending
           
(package private)  java.awt.Point offScreenCanvasLoc
           
(package private)  java.awt.Dimension offScreenCanvasSize
           
(package private)  boolean offScreenRendering
           
(package private)  View pendingView
           
(package private)  PointAttributesRetained pointAttributes
           
(package private) static int POINTATTRS_DIRTY
           
(package private)  PolygonAttributesRetained polygonAttributes
           
(package private) static int POLYGONATTRS_DIRTY
           
(package private)  Transform3D projTrans
           
(package private)  J3dQueryProps queryProps
           
(package private)  RenderAtom ra
           
(package private)  boolean raIsVisible
           
(package private) static int RECREATEDDRAW
           
(package private)  int reEvaluateCanvasCmd
           
(package private) static int RENDER_BIN_DIRTY_IDX
           
(package private) static int RENDERER_DIRTY_IDX
           
(package private)  RenderingAttributesRetained renderingAttrs
           
(package private)  RenderMolecule renderMolecule
           
(package private) static int RENDERMOLECULE_BIT
           
(package private) static int RENDERMOLECULE_DIRTY
           
(package private)  int requestedStencilSize
           
(package private) static int RESETSURFACE
           
(package private) static int RESIZE
           
(package private)  boolean resizeGraphics2D
           
(package private)  Point3d rightManualEyeInImagePlate
           
(package private)  boolean rightStereoPass
           
(package private)  Color3f sceneAmbient
           
(package private)  boolean sceneAntialiasingAvailable
           
(package private)  boolean sceneAntialiasingMultiSamplesAvailable
           
(package private)  Screen3D screen
           
(package private)  ShaderBin shaderBin
           
(package private) static int SHADERBIN_BIT
           
(package private)  ShaderProgramRetained shaderProgram
           
(package private)  boolean shadingLanguageCg
           
(package private)  boolean shadingLanguageGLSL
           
(package private)  int stateUpdateMask
           
(package private) static int STEREO_DIRTY
           
(package private)  boolean stereoAvailable
           
(package private)  boolean stereoEnable
           
(package private) static int SUN_GLOBAL_ALPHA
           
(package private)  boolean swapDone
           
(package private)  boolean systemStencilAvailable
           
(package private)  TextureAttributesRetained texAttrs
           
(package private)  TexCoordGenerationRetained texCoordGeneration
           
(package private)  boolean texLinearMode
          Set to true when any one of texture state use Texture Generation linear mode.
(package private)  TextureRetained texture
          These cached values are only used in Pure Immediate and Mixed Mode rendering
(package private) static int TEXTURE_3D
           
(package private) static int TEXTURE_ANISOTROPIC_FILTER
           
(package private) static int TEXTURE_AUTO_MIPMAP_GENERATION
           
(package private) static int TEXTURE_COLOR_TABLE
           
(package private) static int TEXTURE_COMBINE
           
(package private) static int TEXTURE_COMBINE_DOT3
           
(package private) static int TEXTURE_COMBINE_SUBTRACT
           
(package private) static int TEXTURE_CUBE_MAP
           
(package private) static int TEXTURE_DETAIL
           
(package private) static int TEXTURE_FILTER4
           
(package private) static int TEXTURE_LERP
           
(package private) static int TEXTURE_LOD_OFFSET
           
(package private) static int TEXTURE_LOD_RANGE
           
(package private) static int TEXTURE_MULTI_TEXTURE
           
(package private) static int TEXTURE_NON_POWER_OF_TWO
           
(package private) static int TEXTURE_REGISTER_COMBINERS
           
(package private) static int TEXTURE_SHARPEN
           
(package private)  int texture3DDepthMax
           
(package private)  int texture3DHeightMax
           
(package private)  int texture3DWidthMax
           
(package private) static int TEXTUREATTRIBUTES_DIRTY
           
(package private)  TextureBin textureBin
           
(package private) static int TEXTUREBIN_BIT
           
(package private) static int TEXTUREBIN_DIRTY
           
(package private)  int textureBoundaryWidthMax
           
(package private)  int textureColorTableSize
           
(package private)  int textureExtendedFeatures
           
(package private)  int textureHeightMax
           
(package private)  java.util.ArrayList textureIdResourceFreeList
           
(package private)  java.util.ArrayList textureIDResourceTable
           
(package private)  int textureWidthMax
           
(package private)  TextureUnitStateRetained[] texUnitState
           
(package private) static int TOGGLEFULLSCREEN
           
(package private)  TransparencyAttributesRetained transparency
           
(package private) static int TRANSPARENCY_BIT
           
(package private) static int TRANSPARENCYATTRS_DIRTY
           
(package private)  boolean useDoubleBuffer
           
(package private)  boolean userStencilAvailable
           
(package private)  boolean useSharedCtx
           
(package private)  boolean useStereo
           
(package private)  boolean validCanvas
           
(package private)  boolean validCtx
           
(package private)  boolean vfPlanesValid
           
(package private)  View view
           
(package private) static int VIEW_INFO_DIRTY
           
(package private) static int VIEW_MATRIX_DIRTY
           
(package private)  CachedFrustum viewFrustum
          The object used for View Frustum Culling
(package private)  boolean visible
           
(package private)  Transform3D vpcToEc
           
(package private)  Transform3D vworldToEc
           
(package private)  boolean waiting
           
private  java.awt.Window windowParent
           
 
Fields inherited from class java.awt.Component
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
  Canvas3D(java.awt.GraphicsConfiguration graphicsConfiguration)
          Constructs and initializes a new Canvas3D object that Java 3D can render into.
  Canvas3D(java.awt.GraphicsConfiguration graphicsConfiguration, boolean offScreen)
          Constructs and initializes a new Canvas3D object that Java 3D can render into.
private Canvas3D(java.lang.Object dummyObj1, java.awt.GraphicsConfiguration graphicsConfiguration, boolean offScreen)
           
private Canvas3D(java.lang.Object dummyObj1, java.awt.GraphicsConfiguration graphicsConfiguration, java.awt.GraphicsConfiguration graphicsConfiguration2, boolean offScreen)
           
 
Method Summary
(package private)  void accum(Context ctx, float value)
           
(package private)  void accumReturn(Context ctx)
           
(package private)  void activeTextureUnit(Context ctx, int texUnitIndex)
           
 void addNotify()
          Canvas3D uses the addNotify callback to track when it is added to a container.
(package private)  void addTextureResource(int id, java.lang.Object obj)
          obj is either TextureRetained or DetailTextureImage if obj is DetailTextureImage then we just clear the resourceCreationMask of all the formats no matter it is create or not since we don't remember the format information for simplicity.
(package private)  void allocateCanvasId()
           
(package private)  void beginScene()
           
private  void beginScene(Context ctx)
           
(package private)  void callDisplayList(Context ctx, int id, boolean isNonUniformScale)
           
private static java.awt.GraphicsConfiguration checkForValidGraphicsConfig(java.awt.GraphicsConfiguration gconfig, boolean offScreen)
           
(package private)  void clear(BackgroundRetained bg, int winWidth, int winHeight)
           
(package private)  void clear(Context ctx, float r, float g, float b, boolean clearStencil)
           
(package private)  void clearAccum(Context ctx)
           
(package private)  void computeViewCache()
           
(package private)  Context createNewContext(Context shareCtx, boolean isSharedCtx)
          Wrapper for native createNewContext method.
private  Context createNewContext(long display, Drawable drawable, long fbConfig, Context shareCtx, boolean isSharedCtx, boolean offScreen, boolean glslLibraryAvailable, boolean cgLibraryAvailable)
           
(package private)  Drawable createOffScreenBuffer(Context ctx, long display, long fbConfig, int width, int height)
           
(package private)  void createQueryContext()
           
private  void createQueryContext(long display, Drawable drawable, long fbConfig, boolean offScreen, int width, int height, boolean glslLibraryAvailable, boolean cgLibraryAvailable)
           
private  void createQueryProps()
          Creates the query properties for this Canvas.
(package private)  void createTexUnitState()
           
(package private)  void ctxUpdateEyeLightingEnable(Context ctx, boolean localEyeLightingEnable)
           
(package private)  void d3dResize()
           
(package private)  void d3dToggle()
           
(package private)  boolean decal1stChildSetup(Context ctx)
           
(package private)  void decalNthChildSetup(Context ctx)
           
(package private)  void decalReset(Context ctx, boolean depthBufferEnable)
           
private static java.awt.GraphicsConfiguration defaultGraphicsConfiguration()
           
(package private) static void destroyContext(long display, Drawable drawable, Context ctx)
           
(package private)  void destroyOffScreenBuffer(Context ctx, long display, long fbConfig, Drawable drawable)
           
(package private)  void disableFog(Context ctx)
           
(package private)  void disableModelClip(Context ctx)
           
(package private)  void doSwap()
           
(package private)  void enableSeparateSpecularColor()
          Enable separate specular color if it is not overriden by the property j3d.disableSeparateSpecular.
(package private)  void endDisplayList(Context ctx)
           
(package private)  void endOffScreenRendering()
           
(package private)  void endScene()
           
private  void endScene(Context ctx)
           
(package private)  void evaluateActive()
           
(package private)  void evaluateVisiblilty()
           
(package private)  void executeRasterDepth(Context ctx, float posX, float posY, float posZ, int srcOffsetX, int srcOffsetY, int rasterWidth, int rasterHeight, int depthWidth, int depthHeight, int depthType, java.lang.Object depthData)
           
(package private)  void freeAllDisplayListResources(Context ctx)
           
(package private)  void freeCanvasId()
           
(package private)  void freeContextResources(Renderer rdr, boolean freeBackground, Context ctx)
           
(package private) static void freeDisplayList(Context ctx, int id)
           
(package private)  void freeResourcesInFreeList(Context ctx)
           
(package private) static void freeTexture(Context ctx, int id)
           
 java.awt.Rectangle getBounds()
           
 java.awt.Rectangle getBounds(java.awt.Rectangle rv)
           
 void getCenterEyeInImagePlate(Point3d position)
          Retrieves the actual position of the center eye in image-plate coordinates and copies that value into the object provided.
 boolean getDoubleBufferAvailable()
          Returns a status flag indicating whether or not double buffering is available.
 boolean getDoubleBufferEnable()
          Returns a status flag indicating whether or not double buffering is enabled.
 J3DGraphics2D getGraphics2D()
          Get the 2D graphics object associated with this Canvas3D.
private static java.awt.GraphicsConfiguration getGraphicsConfig(java.awt.GraphicsConfiguration gconfig)
           
 GraphicsContext3D getGraphicsContext3D()
          Get the immediate mode 3D graphics context associated with this Canvas3D.
 int getHeight()
           
 void getImagePlateToVworld(Transform3D t)
          Retrieves the current ImagePlate coordinates to Virtual World coordinates transform and places it into the specified object.
 void getInverseVworldProjection(Transform3D leftInverseProjection, Transform3D rightInverseProjection)
          Copies the inverse of the current Vworld projection transform for each eye into the specified Transform3D objects.
(package private)  int getLastActiveTexUnit()
           
(package private)  void getLastVworldToImagePlate(Transform3D t)
           
 void getLeftEyeInImagePlate(Point3d position)
          Retrieves the actual position of the left eye in image-plate coordinates and copies that value into the object provided.
 void getLeftManualEyeInImagePlate(Point3d position)
          Retrieves the position of the user-specified, manual left eye in image-plate coordinates and copies that value into the object provided.
 java.awt.Point getLocation()
           
 java.awt.Point getLocation(java.awt.Point rv)
           
 java.awt.Point getLocationOnScreen()
           
 int getMonoscopicViewPolicy()
          Returns policy on how Java 3D generates monoscopic view.
(package private)  int getNumActiveTexUnit()
           
(package private)  int getNumCtxLights(Context ctx)
           
 ImageComponent2D getOffScreenBuffer()
          Retrieves the off-screen buffer for this Canvas3D.
 java.awt.Point getOffScreenLocation()
          Retrieves the location of this off-screen Canvas3D.
 java.awt.Point getOffScreenLocation(java.awt.Point rv)
          Retrieves the location of this off-screen Canvas3D and stores it in the specified Point object.
 double getPhysicalHeight()
          Retrieves the physical height of this canvas window in meters.
 double getPhysicalWidth()
          Retrieves the physical width of this canvas window in meters.
 void getPixelLocationFromImagePlate(Point3d imagePlatePoint, Point2d pixelLocation)
          Projects the specified point from image plate coordinates into AWT pixel coordinates.
(package private)  void getPixelLocationInImagePlate(double x, double y, double z, Point3d imagePlatePoint)
           
 void getPixelLocationInImagePlate(int x, int y, Point3d imagePlatePoint)
          Computes the position of the specified AWT pixel value in image-plate coordinates and copies that value into the object provided.
 void getPixelLocationInImagePlate(Point2d pixelLocation, Point3d imagePlatePoint)
          Computes the position of the specified AWT pixel value in image-plate coordinates and copies that value into the object provided.
 void getRightEyeInImagePlate(Point3d position)
          Retrieves the actual position of the right eye in image-plate coordinates and copies that value into the object provided.
 void getRightManualEyeInImagePlate(Point3d position)
          Retrieves the position of the user-specified, manual right eye in image-plate coordinates and copies that value into the object provided.
 boolean getSceneAntialiasingAvailable()
          Returns a status flag indicating whether or not scene antialiasing is available.
 Screen3D getScreen3D()
          Retrieve the Screen3D object that this Canvas3D is attached to.
 java.awt.Dimension getSize()
           
 java.awt.Dimension getSize(java.awt.Dimension rv)
           
(package private)  int getStencilSize()
           
 boolean getStereoAvailable()
          Returns a status flag indicating whether or not stereo is available.
 boolean getStereoEnable()
          Returns a status flag indicating whether or not stereo is enabled.
 View getView()
          Gets view that points to this Canvas3D.
 void getVworldProjection(Transform3D leftProjection, Transform3D rightProjection)
          Copies the current Vworld projection transform for each eye into the specified Transform3D objects.
 void getVworldToImagePlate(Transform3D t)
          Retrieves the current Virtual World coordinates to ImagePlate coordinates transform and places it into the specified object.
 int getWidth()
           
 int getX()
           
 int getY()
           
(package private)  boolean hasDoubleBuffer()
           
(package private)  boolean hasSceneAntialiasingAccum()
           
(package private)  boolean hasSceneAntialiasingMultisample()
           
(package private)  boolean hasStereo()
           
(package private)  boolean initTexturemapping(Context ctx, int texWidth, int texHeight, int objectId)
           
(package private)  boolean isFatalError()
           
private  boolean isIconified()
          Method to return whether the top-level Window parent is iconified
 boolean isOffScreen()
          Retrieves a flag indicating whether this Canvas3D is an off-screen canvas.
private  boolean isRecursivelyVisible()
          Method to return whether or not the Canvas3D is recursively visible; that is, whether the Canas3D is currently visible on the screen.
 boolean isRendererRunning()
          Retrieves the state of the renderer for this Canvas3D object.
 boolean isShadingLanguageSupported(int shadingLanguage)
          Returns a flag indicating whether or not the specified shading language is supported.
private static boolean isValidConfig(java.awt.GraphicsConfiguration gconfig)
           
(package private)  void makeCtxCurrent()
          Make the context associated with the specified canvas current.
(package private)  void makeCtxCurrent(Context ctx)
          Make the specified context current.
(package private)  void makeCtxCurrent(Context ctx, long dpy, Drawable drawable)
           
(package private)  void newDisplayList(Context ctx, int displayListId)
           
(package private)  void notifyD3DPeer(int cmd)
           
 void paint(java.awt.Graphics g)
          Canvas3D uses the paint callback to track when it is possible to render into the canvas.
 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.
 void postSwap()
          This routine is called by the Java 3D rendering loop after completing all rendering to the canvas, and all other canvases associated with this view, for this frame following the buffer swap.
 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.
 java.util.Map queryProperties()
          Returns a read-only Map object containing key-value pairs that define various properties for this Canvas3D.
private  void readObject(java.io.ObjectInputStream in)
          Serialization of Canvas3D objects is not supported.
private  void readOffScreenBuffer(Context ctx, int format, int type, java.lang.Object data, int width, int height)
           
(package private)  void redraw()
          This version looks for the view and notifies it.
(package private)  void releaseCtx()
           
private  boolean releaseCtx(Context ctx, long dpy)
           
private  void removeCtx()
           
 void removeNotify()
          Canvas3D uses the removeNotify callback to track when it is removed from a container.
 void renderField(int fieldDesc)
          This routine is called by the Java 3D rendering loop during the execution of the rendering loop.
 void renderOffScreenBuffer()
          Schedules the rendering of a frame into this Canvas3D's off-screen buffer.
(package private)  void reset()
           
(package private)  void resetColoringAttributes(Context ctx, float r, float g, float b, float a, boolean enableLight)
           
(package private)  void resetImmediateRendering(int status)
           
(package private)  void resetLineAttributes(Context ctx)
           
(package private)  void resetPointAttributes(Context ctx)
           
(package private)  void resetPolygonAttributes(Context ctx)
           
(package private)  void resetRendering(int status)
           
(package private)  void resetRenderingAttributes(Context ctx, boolean depthBufferWriteEnableOverride, boolean depthBufferEnableOverride)
           
(package private)  void resetTexCoordGeneration(Context ctx)
           
(package private)  void resetTexture(Context ctx, int texUnitIndex)
           
(package private)  void resetTextureAttributes(Context ctx)
           
(package private)  void resetTextureBin()
           
(package private)  void resetTextureNative(Context ctx, int texUnitIndex)
           
(package private)  void resetTransparency(Context ctx, int geometryType, int polygonMode, boolean lineAA, boolean pointAA)
           
private  int resizeD3DCanvas(Context ctx)
           
(package private)  void restoreTextureBin()
           
private  void sendAllocateCanvasId()
           
private  void sendCreateOffScreenBuffer()
           
private  void sendDestroyCtxAndOffScreenBuffer()
           
(package private)  void sendEventToBehaviorScheduler(java.awt.AWTEvent evt)
          This method overrides AWT's handleEvent class...
private  void sendFreeCanvasId()
           
(package private)  void setBlendColor(Context ctx, float red, float green, float blue, float alpha)
           
(package private)  void setBlendFunc(Context ctx, int src, int dst)
           
(package private)  void setDepthBufferEnableOverride(boolean flag)
          Set depthBufferEnableOverride flag
(package private)  void setDepthBufferWriteEnable(boolean mode)
           
(package private)  void setDepthBufferWriteEnable(Context ctx, boolean mode)
           
(package private)  void setDepthBufferWriteEnableOverride(boolean flag)
          Set depthBufferWriteEnableOverride flag
 void setDoubleBufferEnable(boolean flag)
          Turns double buffering on or off.
(package private)  void setFatalError()
           
(package private)  void setFogEnableFlag(Context ctx, boolean enableFlag)
           
(package private)  void setFrustumPlanes(Vector4d[] planes)
           
(package private)  void setFullSceneAntialiasing(Context ctx, boolean enable)
           
(package private)  void setGlobalAlpha(Context ctx, float alpha)
           
(package private)  void setLastActiveTexUnit(int n)
           
 void setLeftManualEyeInImagePlate(Point3d position)
          Sets the position of the manual left eye in image-plate coordinates.
(package private)  void setLightEnables(Context ctx, long enableMask, int maxLights)
           
(package private)  void setModelViewMatrix(Context ctx, double[] viewMatrix, double[] modelMatrix)
           
(package private)  void setModelViewMatrix(Context ctx, double[] viewMatrix, Transform3D mTrans)
           
 void setMonoscopicViewPolicy(int policy)
          Specifies how Java 3D generates monoscopic view.
(package private)  void setNumActiveTexUnit(int n)
           
 void setOffScreenBuffer(ImageComponent2D buffer)
          Sets the off-screen buffer for this Canvas3D.
 void setOffScreenLocation(int x, int y)
          Sets the location of this off-screen Canvas3D.
 void setOffScreenLocation(java.awt.Point p)
          Sets the location of this off-screen Canvas3D.
(package private)  void setProjectionMatrix(Context ctx, double[] projMatrix)
           
(package private)  void setProjectionMatrix(Context ctx, Transform3D projTrans)
           
(package private)  void setRenderMode(Context ctx, int mode, boolean doubleBuffer)
           
 void setRightManualEyeInImagePlate(Point3d position)
          Sets the position of the manual right eye in image-plate coordinates.
(package private)  void setSceneAmbient(Context ctx, float red, float green, float blue)
           
(package private)  void setStateIsUpdated(int bit)
           
(package private)  void setStateToUpdate(int bit, java.lang.Object bin)
           
 void setStereoEnable(boolean flag)
          Turns stereo on or off.
(package private)  void setView(View view)
          Sets view that points to this Canvas3D.
(package private)  void setViewport(Context ctx, int x, int y, int width, int height)
           
 void startRenderer()
          Start the Java 3D renderer on this Canvas3D object.
 void stopRenderer()
          Stop the Java 3D renderer on this Canvas3D object.
(package private)  boolean supportGlobalAlpha()
           
 void swap()
          Synchronize and swap buffers on a double buffered canvas for this Canvas3D object.
(package private)  int swapBuffers(Context ctx, long dpy, Drawable drawable)
           
(package private)  void syncRender(Context ctx, boolean wait)
          This native method makes sure that the rendering for this canvas gets done now.
(package private)  void textureFill(BackgroundRetained bg, int winWidth, int winHeight)
           
(package private)  void textureFill(RasterRetained raster, Point2d winCoord, float mapZ, float alpha)
           
(package private)  void textureFillBackground(Context ctx, float texMinU, float texMaxU, float texMinV, float texMaxV, float mapMinX, float mapMaxX, float mapMinY, float mapMaxY, boolean useBiliearFilter)
           
(package private)  void textureFillRaster(Context ctx, float texMinU, float texMaxU, float texMinV, float texMaxV, float mapMinX, float mapMaxX, float mapMinY, float mapMaxY, float mapZ, float alpha, boolean useBiliearFilter)
           
(package private)  void texturemapping(Context ctx, int px, int py, int xmin, int ymin, int xmax, int ymax, int texWidth, int texHeight, int rasWidth, int format, int objectId, byte[] image, int winWidth, int winHeight)
           
private  int toggleFullScreenMode(Context ctx)
           
(package private)  void updateEnvState()
           
(package private)  void updateMaterial(Context ctx, float r, float g, float b, float a)
           
(package private)  void updateSeparateSpecularColorEnable(Context ctx, boolean control)
           
(package private)  void updateState(int dirtyBits)
          update state if neccessary according to the stateUpdatedMask
(package private)  void updateTextureForRaster(Texture2DRetained texture)
           
(package private)  void updateViewCache(boolean flag, CanvasViewCache cvc, BoundingBox frustumBBox, boolean doInfinite)
          Update the view cache associated with this canvas.
(package private) static boolean useCtx(Context ctx, long display, Drawable drawable)
           
private  boolean validGraphicsMode()
           
 void waitForOffScreenRendering()
          Waits for this Canvas3D's off-screen rendering to be done.
private  void writeObject(java.io.ObjectOutputStream out)
          Serialization of Canvas3D objects is not supported.
 
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, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getToolkit, getTreeLock, 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, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, 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 Detail

FIELD_LEFT

public static final int FIELD_LEFT
Specifies the left field of a field-sequential stereo rendering loop. A left field always precedes a right field.

See Also:
Constant Field Values

FIELD_RIGHT

public static final int FIELD_RIGHT
Specifies the right field of a field-sequential stereo rendering loop. A right field always follows a left field.

See Also:
Constant Field Values

FIELD_ALL

public static final int FIELD_ALL
Specifies a single-field rendering loop.

See Also:
Constant Field Values

POLYGONATTRS_DIRTY

static final int POLYGONATTRS_DIRTY
See Also:
Constant Field Values

LINEATTRS_DIRTY

static final int LINEATTRS_DIRTY
See Also:
Constant Field Values

POINTATTRS_DIRTY

static final int POINTATTRS_DIRTY
See Also:
Constant Field Values

MATERIAL_DIRTY

static final int MATERIAL_DIRTY
See Also:
Constant Field Values

TRANSPARENCYATTRS_DIRTY

static final int TRANSPARENCYATTRS_DIRTY
See Also:
Constant Field Values

COLORINGATTRS_DIRTY

static final int COLORINGATTRS_DIRTY
See Also:
Constant Field Values

LIGHTBIN_DIRTY

static final int LIGHTBIN_DIRTY
See Also:
Constant Field Values

LIGHTENABLES_DIRTY

static final int LIGHTENABLES_DIRTY
See Also:
Constant Field Values

AMBIENTLIGHT_DIRTY

static final int AMBIENTLIGHT_DIRTY
See Also:
Constant Field Values

ATTRIBUTEBIN_DIRTY

static final int ATTRIBUTEBIN_DIRTY
See Also:
Constant Field Values

TEXTUREBIN_DIRTY

static final int TEXTUREBIN_DIRTY
See Also:
Constant Field Values

TEXTUREATTRIBUTES_DIRTY

static final int TEXTUREATTRIBUTES_DIRTY
See Also:
Constant Field Values

RENDERMOLECULE_DIRTY

static final int RENDERMOLECULE_DIRTY
See Also:
Constant Field Values

FOG_DIRTY

static final int FOG_DIRTY
See Also:
Constant Field Values

MODELCLIP_DIRTY

static final int MODELCLIP_DIRTY
See Also:
Constant Field Values

VIEW_MATRIX_DIRTY

static final int VIEW_MATRIX_DIRTY
See Also:
Constant Field Values

RESIZE

static final int RESIZE
See Also:
Constant Field Values

TOGGLEFULLSCREEN

static final int TOGGLEFULLSCREEN
See Also:
Constant Field Values

NOCHANGE

static final int NOCHANGE
See Also:
Constant Field Values

RESETSURFACE

static final int RESETSURFACE
See Also:
Constant Field Values

RECREATEDDRAW

static final int RECREATEDDRAW
See Also:
Constant Field Values

offScreen

boolean offScreen

manualRendering

boolean manualRendering

offScreenCanvasLoc

java.awt.Point offScreenCanvasLoc

offScreenCanvasSize

java.awt.Dimension offScreenCanvasSize

offScreenRendering

volatile boolean offScreenRendering

offScreenBufferPending

volatile boolean offScreenBufferPending

offScreenBuffer

ImageComponent2D offScreenBuffer

useSharedCtx

boolean useSharedCtx

stereoAvailable

boolean stereoAvailable

stereoEnable

boolean stereoEnable

useStereo

boolean useStereo

rightStereoPass

boolean rightStereoPass

monoscopicViewPolicy

int monoscopicViewPolicy

requestedStencilSize

int requestedStencilSize

actualStencilSize

int actualStencilSize

userStencilAvailable

boolean userStencilAvailable

systemStencilAvailable

boolean systemStencilAvailable

doubleBufferAvailable

boolean doubleBufferAvailable

doubleBufferEnable

boolean doubleBufferEnable

useDoubleBuffer

boolean useDoubleBuffer

sceneAntialiasingAvailable

boolean sceneAntialiasingAvailable

sceneAntialiasingMultiSamplesAvailable

boolean sceneAntialiasingMultiSamplesAvailable

antialiasingSet

boolean antialiasingSet

textureColorTableSize

int textureColorTableSize

numActiveTexUnit

int numActiveTexUnit

lastActiveTexUnit

int lastActiveTexUnit

shadingLanguageGLSL

boolean shadingLanguageGLSL

shadingLanguageCg

boolean shadingLanguageCg

queryProps

J3dQueryProps queryProps

fatalError

private boolean fatalError

leftManualEyeInImagePlate

Point3d leftManualEyeInImagePlate

rightManualEyeInImagePlate

Point3d rightManualEyeInImagePlate

view

View view

pendingView

View pendingView

canvasViewCache

CanvasViewCache canvasViewCache

canvasViewCacheFrustum

CanvasViewCache canvasViewCacheFrustum

raIsVisible

boolean raIsVisible

ra

RenderAtom ra

STEREO_DIRTY

static final int STEREO_DIRTY
See Also:
Constant Field Values

MONOSCOPIC_VIEW_POLICY_DIRTY

static final int MONOSCOPIC_VIEW_POLICY_DIRTY
See Also:
Constant Field Values

EYE_IN_IMAGE_PLATE_DIRTY

static final int EYE_IN_IMAGE_PLATE_DIRTY
See Also:
Constant Field Values

MOVED_OR_RESIZED_DIRTY

static final int MOVED_OR_RESIZED_DIRTY
See Also:
Constant Field Values

BACKGROUND_DIRTY

static final int BACKGROUND_DIRTY
See Also:
Constant Field Values

BACKGROUND_IMAGE_DIRTY

static final int BACKGROUND_IMAGE_DIRTY
See Also:
Constant Field Values

VIEW_INFO_DIRTY

static final int VIEW_INFO_DIRTY
See Also:
Constant Field Values

RENDERER_DIRTY_IDX

static final int RENDERER_DIRTY_IDX
See Also:
Constant Field Values

RENDER_BIN_DIRTY_IDX

static final int RENDER_BIN_DIRTY_IDX
See Also:
Constant Field Values

cvDirtyMask

int[] cvDirtyMask

resizeGraphics2D

boolean resizeGraphics2D

isRunning

volatile boolean isRunning

isRunningStatus

volatile boolean isRunningStatus

active

boolean active

visible

boolean visible

ctxReset

boolean ctxReset

screen

Screen3D screen

imageReady

boolean imageReady

fogOn

int fogOn

graphicsContext3D

GraphicsContext3D graphicsContext3D

waiting

boolean waiting

swapDone

boolean swapDone

graphicsConfiguration

java.awt.GraphicsConfiguration graphicsConfiguration

graphics2D

J3DGraphics2DImpl graphics2D

gfxCreationLock

java.lang.Object gfxCreationLock

vworldToEc

Transform3D vworldToEc

vpcToEc

Transform3D vpcToEc

drawable

Drawable drawable

fbConfig

long fbConfig

offScreenBufferInfo

long offScreenBufferInfo

graphicsConfigTable

static java.util.Hashtable<java.awt.GraphicsConfiguration,GraphicsConfigInfo> graphicsConfigTable

nativeGraphicsVersion

java.lang.String nativeGraphicsVersion

nativeGraphicsVendor

java.lang.String nativeGraphicsVendor

nativeGraphicsRenderer

java.lang.String nativeGraphicsRenderer

firstPaintCalled

boolean firstPaintCalled

added

boolean added

addNotifyCalled

private boolean addNotifyCalled

ctx

Context ctx

ctxTimeStamp

volatile long ctxTimeStamp

ctxEyeLightingEnable

boolean ctxEyeLightingEnable

currentAppear

AppearanceRetained currentAppear

currentMaterial

MaterialRetained currentMaterial

viewFrustum

CachedFrustum viewFrustum
The object used for View Frustum Culling


lightBin

LightBin lightBin
The RenderBin bundle references used to decide what the underlying context contains.


environmentSet

EnvironmentSet environmentSet

attributeBin

AttributeBin attributeBin

shaderBin

ShaderBin shaderBin

renderMolecule

RenderMolecule renderMolecule

polygonAttributes

PolygonAttributesRetained polygonAttributes

lineAttributes

LineAttributesRetained lineAttributes

pointAttributes

PointAttributesRetained pointAttributes

material

MaterialRetained material

enableLighting

boolean enableLighting

transparency

TransparencyAttributesRetained transparency

coloringAttributes

ColoringAttributesRetained coloringAttributes

modelMatrix

Transform3D modelMatrix

projTrans

Transform3D projTrans

textureBin

TextureBin textureBin

lights

LightRetained[] lights
cached RenderBin states for lazy native states update


frameCount

int[] frameCount

enableMask

long enableMask

fog

FogRetained fog

modelClip

ModelClipRetained modelClip

sceneAmbient

Color3f sceneAmbient

texUnitState

TextureUnitStateRetained[] texUnitState

texture

TextureRetained texture
These cached values are only used in Pure Immediate and Mixed Mode rendering


texAttrs

TextureAttributesRetained texAttrs

texCoordGeneration

TexCoordGenerationRetained texCoordGeneration

renderingAttrs

RenderingAttributesRetained renderingAttrs

appearance

AppearanceRetained appearance

shaderProgram

ShaderProgramRetained shaderProgram

appHandle

java.lang.Object appHandle

texLinearMode

boolean texLinearMode
Set to true when any one of texture state use Texture Generation linear mode. This is used for D3D temporary turn displayList off and do its own coordinate generation since D3D don't support it. TODO aces : is this still true in DX9?


canvasDirty

int canvasDirty
Dirty bit to determine if the NodeComponent needs to be re-sent down to the underlying API


dirtyDisplayList

boolean dirtyDisplayList

dirtyRenderMoleculeList

java.util.ArrayList dirtyRenderMoleculeList

dirtyRenderAtomList

java.util.ArrayList dirtyRenderAtomList

dirtyDlistPerRinfoList

java.util.ArrayList dirtyDlistPerRinfoList

displayListResourceFreeList

java.util.ArrayList displayListResourceFreeList

textureIdResourceFreeList

java.util.ArrayList textureIdResourceFreeList

canvasBit

int canvasBit

canvasId

int canvasId

canvasIdAlloc

private boolean canvasIdAlloc

cvLock

java.lang.Object cvLock

evaluateLock

java.lang.Object evaluateLock

dirtyMaskLock

java.lang.Object dirtyMaskLock

fullScreenMode

boolean fullScreenMode

fullscreenWidth

int fullscreenWidth

fullscreenHeight

int fullscreenHeight

needToRebuildDisplayList

boolean needToRebuildDisplayList

reEvaluateCanvasCmd

int reEvaluateCanvasCmd

TEXTURE_3D

static final int TEXTURE_3D
See Also:
Constant Field Values

TEXTURE_COLOR_TABLE

static final int TEXTURE_COLOR_TABLE
See Also:
Constant Field Values

TEXTURE_MULTI_TEXTURE

static final int TEXTURE_MULTI_TEXTURE
See Also:
Constant Field Values

TEXTURE_COMBINE

static final int TEXTURE_COMBINE
See Also:
Constant Field Values

TEXTURE_COMBINE_DOT3

static final int TEXTURE_COMBINE_DOT3
See Also:
Constant Field Values

TEXTURE_COMBINE_SUBTRACT

static final int TEXTURE_COMBINE_SUBTRACT
See Also:
Constant Field Values

TEXTURE_REGISTER_COMBINERS

static final int TEXTURE_REGISTER_COMBINERS
See Also:
Constant Field Values

TEXTURE_CUBE_MAP

static final int TEXTURE_CUBE_MAP
See Also:
Constant Field Values

TEXTURE_SHARPEN

static final int TEXTURE_SHARPEN
See Also:
Constant Field Values

TEXTURE_DETAIL

static final int TEXTURE_DETAIL
See Also:
Constant Field Values

TEXTURE_FILTER4

static final int TEXTURE_FILTER4
See Also:
Constant Field Values

TEXTURE_ANISOTROPIC_FILTER

static final int TEXTURE_ANISOTROPIC_FILTER
See Also:
Constant Field Values

TEXTURE_LOD_RANGE

static final int TEXTURE_LOD_RANGE
See Also:
Constant Field Values

TEXTURE_LOD_OFFSET

static final int TEXTURE_LOD_OFFSET
See Also:
Constant Field Values

TEXTURE_LERP

static final int TEXTURE_LERP
See Also:
Constant Field Values

TEXTURE_NON_POWER_OF_TWO

static final int TEXTURE_NON_POWER_OF_TWO
See Also:
Constant Field Values

TEXTURE_AUTO_MIPMAP_GENERATION

static final int TEXTURE_AUTO_MIPMAP_GENERATION
See Also:
Constant Field Values

textureExtendedFeatures

int textureExtendedFeatures

SUN_GLOBAL_ALPHA

static final int SUN_GLOBAL_ALPHA
See Also:
Constant Field Values

EXT_ABGR

static final int EXT_ABGR
See Also:
Constant Field Values

EXT_BGR

static final int EXT_BGR
See Also:
Constant Field Values

MULTISAMPLE

static final int MULTISAMPLE
See Also:
Constant Field Values

extensionsSupported

int extensionsSupported

anisotropicDegreeMax

float anisotropicDegreeMax

textureBoundaryWidthMax

int textureBoundaryWidthMax

multiTexAccelerated

boolean multiTexAccelerated

maxTexCoordSets

int maxTexCoordSets

maxTextureUnits

int maxTextureUnits

maxTextureImageUnits

int maxTextureImageUnits

maxVertexTextureImageUnits

int maxVertexTextureImageUnits

maxCombinedTextureImageUnits

int maxCombinedTextureImageUnits

maxVertexAttrs

int maxVertexAttrs

maxAvailableTextureUnits

int maxAvailableTextureUnits

textureWidthMax

int textureWidthMax

textureHeightMax

int textureHeightMax

texture3DWidthMax

int texture3DWidthMax

texture3DHeightMax

int texture3DHeightMax

texture3DDepthMax

int texture3DDepthMax

newPosition

java.awt.Point newPosition

newSize

java.awt.Dimension newSize

textureIDResourceTable

java.util.ArrayList textureIDResourceTable

LIGHTBIN_BIT

static final int LIGHTBIN_BIT
See Also:
Constant Field Values

ENVIRONMENTSET_BIT

static final int ENVIRONMENTSET_BIT
See Also:
Constant Field Values

ATTRIBUTEBIN_BIT

static final int ATTRIBUTEBIN_BIT
See Also:
Constant Field Values

TEXTUREBIN_BIT

static final int TEXTUREBIN_BIT
See Also:
Constant Field Values

RENDERMOLECULE_BIT

static final int RENDERMOLECULE_BIT
See Also:
Constant Field Values

TRANSPARENCY_BIT

static final int TRANSPARENCY_BIT
See Also:
Constant Field Values

SHADERBIN_BIT

static final int SHADERBIN_BIT
See Also:
Constant Field Values

stateUpdateMask

int stateUpdateMask

curStateToUpdate

java.lang.Object[] curStateToUpdate

currentLights

LightRetained[] currentLights
The list of lights that are currently being represented in the native graphics context.


depthBufferWriteEnableOverride

boolean depthBufferWriteEnableOverride
Flag to override RenderAttributes.depthBufferWriteEnable


depthBufferEnableOverride

boolean depthBufferEnableOverride
Flag to override RenderAttributes.depthBufferEnable


depthBufferWriteEnable

boolean depthBufferWriteEnable

vfPlanesValid

boolean vfPlanesValid

eventCatcher

EventCatcher eventCatcher

canvasViewEventCatcher

private CanvasViewEventCatcher canvasViewEventCatcher

windowParent

private java.awt.Window windowParent

containerParentList

private java.util.LinkedList<java.awt.Container> containerParentList

lightChanged

boolean lightChanged

drawingSurfaceObject

DrawingSurfaceObject drawingSurfaceObject

validCtx

boolean validCtx

validCanvas

boolean validCanvas

ctxChanged

boolean ctxChanged

defaultGcfg

private static java.awt.GraphicsConfiguration defaultGcfg

ENV_STATE_MASK

static int ENV_STATE_MASK
Constructor Detail

Canvas3D

public Canvas3D(java.awt.GraphicsConfiguration graphicsConfiguration)
Constructs and initializes a new Canvas3D object that Java 3D can render into. The following Canvas3D attributes are initialized to default values as shown:

Parameters:
graphicsConfiguration - a valid GraphicsConfiguration object that will be used to create the canvas. This object should not be null and should be created using a GraphicsConfigTemplate3D or the getPreferredConfiguration() method of the SimpleUniverse utility. For backward compatibility with earlier versions of Java 3D, a null or default GraphicsConfiguration will still work when used to create a Canvas3D on the default screen, but an error message will be printed. A NullPointerException or IllegalArgumentException will be thrown in a subsequent release.
Throws:
java.lang.IllegalArgumentException - if the specified GraphicsConfiguration does not support 3D rendering

Canvas3D

public Canvas3D(java.awt.GraphicsConfiguration graphicsConfiguration,
                boolean offScreen)
Constructs and initializes a new Canvas3D object that Java 3D can render into.

Parameters:
graphicsConfiguration - a valid GraphicsConfiguration object that will be used to create the canvas. This must be created either with a GraphicsConfigTemplate3D or by using the getPreferredConfiguration() method of the SimpleUniverse utility.
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.NullPointerException - if the GraphicsConfiguration is null.
java.lang.IllegalArgumentException - if the specified GraphicsConfiguration does not support 3D rendering
Since:
Java 3D 1.2

Canvas3D

private Canvas3D(java.lang.Object dummyObj1,
                 java.awt.GraphicsConfiguration graphicsConfiguration,
                 boolean offScreen)

Canvas3D

private Canvas3D(java.lang.Object dummyObj1,
                 java.awt.GraphicsConfiguration graphicsConfiguration,
                 java.awt.GraphicsConfiguration graphicsConfiguration2,
                 boolean offScreen)
Method Detail

defaultGraphicsConfiguration

private static java.awt.GraphicsConfiguration defaultGraphicsConfiguration()

isValidConfig

private static boolean isValidConfig(java.awt.GraphicsConfiguration gconfig)

checkForValidGraphicsConfig

private static java.awt.GraphicsConfiguration checkForValidGraphicsConfig(java.awt.GraphicsConfiguration gconfig,
                                                                          boolean offScreen)

getGraphicsConfig

private static java.awt.GraphicsConfiguration getGraphicsConfig(java.awt.GraphicsConfiguration gconfig)

sendEventToBehaviorScheduler

void sendEventToBehaviorScheduler(java.awt.AWTEvent evt)
This method overrides AWT's handleEvent class...


isRecursivelyVisible

private boolean isRecursivelyVisible()
Method to return whether or not the Canvas3D is recursively visible; that is, whether the Canas3D is currently visible on the screen. Note that we don't directly use isShowing() because that won't work for an auto-offScreen Canvas3D.


isIconified

private boolean isIconified()
Method to return whether the top-level Window parent is iconified


evaluateVisiblilty

void evaluateVisiblilty()

redraw

void redraw()
This version looks for the view and notifies it.


paint

public void paint(java.awt.Graphics g)
Canvas3D uses the paint callback to track when it is possible to render into the canvas. Subclasses of Canvas3D that override this method need to call super.paint() in their paint method for Java 3D to function properly.

Overrides:
paint in class java.awt.Canvas
Parameters:
g - the graphics context

addNotify

public void addNotify()
Canvas3D uses the addNotify callback to track when it is added to a container. Subclasses of Canvas3D that override this method need to call super.addNotify() in their addNotify() method for Java 3D to function properly.

Overrides:
addNotify in class java.awt.Canvas

removeNotify

public void removeNotify()
Canvas3D uses the removeNotify callback to track when it is removed from a container. Subclasses of Canvas3D that override this method need to call super.removeNotify() in their removeNotify() method for Java 3D to function properly.

Overrides:
removeNotify in class java.awt.Component

allocateCanvasId

void allocateCanvasId()

freeCanvasId

void freeCanvasId()

evaluateActive

void evaluateActive()

setFrustumPlanes

void setFrustumPlanes(Vector4d[] planes)

getScreen3D

public Screen3D getScreen3D()
Retrieve the Screen3D object that this Canvas3D is attached to. If this Canvas3D is an off-screen buffer, a new Screen3D object is created corresponding to the off-screen buffer.

Returns:
the 3D screen object that this Canvas3D is attached to

getGraphicsContext3D

public GraphicsContext3D getGraphicsContext3D()
Get the immediate mode 3D graphics context associated with this Canvas3D. A new graphics context object is created if one does not already exist.

Returns:
a GraphicsContext3D object that can be used for immediate mode rendering to this Canvas3D.

getGraphics2D

public J3DGraphics2D getGraphics2D()
Get the 2D graphics object associated with this Canvas3D. A new 2D graphics object is created if one does not already exist.

Returns:
a Graphics2D object that can be used for Java 2D rendering into this Canvas3D.
Since:
Java 3D 1.2

preRender

public 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. Applications that wish to perform operations in the rendering loop, prior to any actual rendering may override this function.

Updates to live Geometry, Texture, and ImageComponent objects in the scene graph are not allowed from this method.

NOTE: Applications should not call this method.


postRender

public 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. Applications that wish to perform operations in the rendering loop, following any actual rendering may override this function.

Updates to live Geometry, Texture, and ImageComponent objects in the scene graph are not allowed from this method.

NOTE: Applications should not call this method.


postSwap

public void postSwap()
This routine is called by the Java 3D rendering loop after completing all rendering to the canvas, and all other canvases associated with this view, for this frame following the buffer swap. Applications that wish to perform operations at the very end of the rendering loop may override this function. In off-screen mode, all rendering is copied to the off-screen buffer before this method is called.

Updates to live Geometry, Texture, and ImageComponent objects in the scene graph are not allowed from this method.

NOTE: Applications should not call this method.


renderField

public void renderField(int fieldDesc)
This routine is called by the Java 3D rendering loop during the execution of the rendering loop. It is called once for each field (i.e., once per frame on a mono system or once each for the right eye and left eye on a two-pass stereo system. This is intended for use by applications that want to mix retained/compiled-retained mode rendering with some immediate mode rendering. Applications that wish to perform operations during the rendering loop, may override this function.

Updates to live Geometry, Texture, and ImageComponent objects in the scene graph are not allowed from this method.

NOTE: Applications should not call this method.

Parameters:
fieldDesc - field description, one of: FIELD_LEFT, FIELD_RIGHT or FIELD_ALL. Applications that wish to work correctly in stereo mode should render the same image for both FIELD_LEFT and FIELD_RIGHT calls. If Java 3D calls the renderer with FIELD_ALL then the immediate mode rendering only needs to be done once.

stopRenderer

public final void stopRenderer()
Stop the Java 3D renderer on this Canvas3D object. If the Java 3D renderer is currently running, the rendering will be synchronized before being stopped. No further rendering will be done to this canvas by Java 3D until the renderer is started again. In pure immediate mode this method should be called prior to adding this canvas to an active View object.

Throws:
java.lang.IllegalStateException - if this Canvas3D is in off-screen mode.

startRenderer

public final void startRenderer()
Start the Java 3D renderer on this Canvas3D object. If the Java 3D renderer is not currently running, any rendering to other Canvas3D objects sharing the same View will be synchronized before this Canvas3D's renderer is (re)started. When a Canvas3D is created, it is initially marked as being started. This means that as soon as the Canvas3D is added to an active View object, the rendering loop will render the scene graph to the canvas.


isRendererRunning

public final boolean isRendererRunning()
Retrieves the state of the renderer for this Canvas3D object.

Returns:
the state of the renderer
Since:
Java 3D 1.2

isFatalError

boolean isFatalError()

setFatalError

void setFatalError()

isOffScreen

public boolean isOffScreen()
Retrieves a flag indicating whether this Canvas3D is an off-screen canvas.

Returns:
true if this Canvas3D is an off-screen canvas; false if this is an on-screen canvas.
Since:
Java 3D 1.2

setOffScreenBuffer

public void setOffScreenBuffer(ImageComponent2D buffer)
Sets the off-screen buffer for this Canvas3D. The specified image is written into by the Java 3D renderer. The size of the specified ImageComponent determines the size, in pixels, of this Canvas3D--the size inherited from Component is ignored.

NOTE: the size, physical width, and physical height of the associated Screen3D must be set explicitly prior to rendering. Failure to do so will result in an exception.

Parameters:
buffer - the image component that will be rendered into by subsequent calls to renderOffScreenBuffer. The image component must not be part of a live scene graph, nor may it subsequently be made part of a live scene graph while being used as an off-screen buffer; an IllegalSharingException is thrown in such cases. The buffer may be null, indicating that the previous off-screen buffer is released without a new buffer being set.
Throws:
java.lang.IllegalStateException - if this Canvas3D is not in off-screen mode.
RestrictedAccessException - if an off-screen rendering is in process for this Canvas3D.
IllegalSharingException - if the specified ImageComponent2D is part of a live scene graph
IllegalSharingException - if the specified ImageComponent2D is being used by an immediate mode context, or by another Canvas3D as an off-screen buffer.
java.lang.IllegalArgumentException - if the image class of the specified ImageComponent2D is not ImageClass.BUFFERED_IMAGE.
java.lang.IllegalArgumentException - if the specified ImageComponent2D is in by-reference mode and its RenderedImage is null.
java.lang.IllegalArgumentException - if the ImageComponent2D format is not a 3-component format (e.g., FORMAT_RGB) or a 4-component format (e.g., FORMAT_RGBA).
Since:
Java 3D 1.2
See Also:
renderOffScreenBuffer(), Screen3D.setSize(int, int), Screen3D.setSize(Dimension), Screen3D.setPhysicalScreenWidth(double), Screen3D.setPhysicalScreenHeight(double)

getOffScreenBuffer

public ImageComponent2D getOffScreenBuffer()
Retrieves the off-screen buffer for this Canvas3D.

Returns:
the current off-screen buffer for this Canvas3D.
Throws:
java.lang.IllegalStateException - if this Canvas3D is not in off-screen mode.
Since:
Java 3D 1.2

renderOffScreenBuffer

public void renderOffScreenBuffer()
Schedules the rendering of a frame into this Canvas3D's off-screen buffer. The rendering is done from the point of view of the View object to which this Canvas3D has been added. No rendering is performed if this Canvas3D object has not been added to an active View. This method does not wait for the rendering to actually happen. An application that wishes to know when the rendering is complete must either subclass Canvas3D and override the postSwap method, or call waitForOffScreenRendering.

Throws:
java.lang.NullPointerException - if the off-screen buffer is null.
java.lang.IllegalStateException - if this Canvas3D is not in off-screen mode, or if either the width or the height of the associated Screen3D's size is <= 0, or if the associated Screen3D's physical width or height is <= 0.
RestrictedAccessException - if an off-screen rendering is already in process for this Canvas3D or if the Java 3D renderer is stopped.
Since:
Java 3D 1.2
See Also:
setOffScreenBuffer(javax.media.j3d.ImageComponent2D), Screen3D.setSize(int, int), Screen3D.setSize(Dimension), Screen3D.setPhysicalScreenWidth(double), Screen3D.setPhysicalScreenHeight(double), waitForOffScreenRendering(), postSwap()

waitForOffScreenRendering

public void waitForOffScreenRendering()
Waits for this Canvas3D's off-screen rendering to be done. This method will wait until the postSwap method of this off-screen Canvas3D has completed. If this Canvas3D has not been added to an active view or if the renderer is stopped for this Canvas3D, then this method will return immediately. This method must not be called from a render callback method of an off-screen Canvas3D.

Throws:
java.lang.IllegalStateException - if this Canvas3D is not in off-screen mode, or if this method is called from a render callback method of an off-screen Canvas3D.
Since:
Java 3D 1.2
See Also:
renderOffScreenBuffer(), postSwap()

setOffScreenLocation

public void setOffScreenLocation(int x,
                                 int y)
Sets the location of this off-screen Canvas3D. The location is the upper-left corner of the Canvas3D relative to the upper-left corner of the corresponding off-screen Screen3D. The function of this method is similar to that of Component.setLocation for on-screen Canvas3D objects. The default location is (0,0).

Parameters:
x - the x coordinate of the upper-left corner of the new location.
y - the y coordinate of the upper-left corner of the new location.
Throws:
java.lang.IllegalStateException - if this Canvas3D is not in off-screen mode.
Since:
Java 3D 1.2

setOffScreenLocation

public void setOffScreenLocation(java.awt.Point p)
Sets the location of this off-screen Canvas3D. The location is the upper-left corner of the Canvas3D relative to the upper-left corner of the corresponding off-screen Screen3D. The function of this method is similar to that of Component.setLocation for on-screen Canvas3D objects. The default location is (0,0).

Parameters:
p - the point defining the upper-left corner of the new location.
Throws:
java.lang.IllegalStateException - if this Canvas3D is not in off-screen mode.
Since:
Java 3D 1.2

getOffScreenLocation

public java.awt.Point getOffScreenLocation()
Retrieves the location of this off-screen Canvas3D. The location is the upper-left corner of the Canvas3D relative to the upper-left corner of the corresponding off-screen Screen3D. The function of this method is similar to that of Component.getLocation for on-screen Canvas3D objects.

Returns:
a new point representing the upper-left corner of the location of this off-screen Canvas3D.
Throws:
java.lang.IllegalStateException - if this Canvas3D is not in off-screen mode.
Since:
Java 3D 1.2

getOffScreenLocation

public java.awt.Point getOffScreenLocation(java.awt.Point rv)
Retrieves the location of this off-screen Canvas3D and stores it in the specified Point object. The location is the upper-left corner of the Canvas3D relative to the upper-left corner of the corresponding off-screen Screen3D. The function of this method is similar to that of Component.getLocation for on-screen Canvas3D objects. This version of getOffScreenLocation is useful if the caller wants to avoid allocating a new Point object on the heap.

Parameters:
rv - Point object into which the upper-left corner of the location of this off-screen Canvas3D is copied. If rv is null, a new Point is allocated.
Returns:
rv
Throws:
java.lang.IllegalStateException - if this Canvas3D is not in off-screen mode.
Since:
Java 3D 1.2

endOffScreenRendering

void endOffScreenRendering()

swap

public void swap()
Synchronize and swap buffers on a double buffered canvas for this Canvas3D object. This method should only be called if the Java 3D renderer has been stopped. In the normal case, the renderer automatically swaps the buffer. This method calls the flush(true) methods of the associated 2D and 3D graphics contexts, if they have been allocated.

Throws:
RestrictedAccessException - if the Java 3D renderer is running.
java.lang.IllegalStateException - if this Canvas3D is in off-screen mode.
See Also:
stopRenderer(), GraphicsContext3D.flush(boolean), J3DGraphics2D.flush(boolean)

doSwap

void doSwap()

createNewContext

Context createNewContext(Context shareCtx,
                         boolean isSharedCtx)
Wrapper for native createNewContext method.


makeCtxCurrent

final void makeCtxCurrent()
Make the context associated with the specified canvas current.


makeCtxCurrent

final void makeCtxCurrent(Context ctx)
Make the specified context current.


makeCtxCurrent

final void makeCtxCurrent(Context ctx,
                          long dpy,
                          Drawable drawable)

releaseCtx

void releaseCtx()

setLeftManualEyeInImagePlate

public void setLeftManualEyeInImagePlate(Point3d position)
Sets the position of the manual left eye in image-plate coordinates. This value determines eye placement when a head tracker is not in use and the application is directly controlling the eye position in image-plate coordinates. In head-tracked mode or when the windowEyePointPolicy is RELATIVE_TO_FIELD_OF_VIEW or RELATIVE_TO_COEXISTENCE, this value is ignored. When the windowEyepointPolicy is RELATIVE_TO_WINDOW only the Z value is used.

Parameters:
position - the new manual left eye position

setRightManualEyeInImagePlate

public void setRightManualEyeInImagePlate(Point3d position)
Sets the position of the manual right eye in image-plate coordinates. This value determines eye placement when a head tracker is not in use and the application is directly controlling the eye position in image-plate coordinates. In head-tracked mode or when the windowEyePointPolicy is RELATIVE_TO_FIELD_OF_VIEW or RELATIVE_TO_COEXISTENCE, this value is ignored. When the windowEyepointPolicy is RELATIVE_TO_WINDOW only the Z value is used.

Parameters:
position - the new manual right eye position

getLeftManualEyeInImagePlate

public void getLeftManualEyeInImagePlate(Point3d position)
Retrieves the position of the user-specified, manual left eye in image-plate coordinates and copies that value into the object provided.

Parameters:
position - the object that will receive the position

getRightManualEyeInImagePlate

public void getRightManualEyeInImagePlate(Point3d position)
Retrieves the position of the user-specified, manual right eye in image-plate coordinates and copies that value into the object provided.

Parameters:
position - the object that will receive the position

getLeftEyeInImagePlate

public void getLeftEyeInImagePlate(Point3d position)
Retrieves the actual position of the left eye in image-plate coordinates and copies that value into the object provided. This value is a function of the windowEyepointPolicy, the tracking enable flag, and the manual left eye position.

Parameters:
position - the object that will receive the position

getRightEyeInImagePlate

public void getRightEyeInImagePlate(Point3d position)
Retrieves the actual position of the right eye in image-plate coordinates and copies that value into the object provided. This value is a function of the windowEyepointPolicy, the tracking enable flag, and the manual right eye position.

Parameters:
position - the object that will receive the position

getCenterEyeInImagePlate

public void getCenterEyeInImagePlate(Point3d position)
Retrieves the actual position of the center eye in image-plate coordinates and copies that value into the object provided. The center eye is the fictional eye half-way between the left and right eye. This value is a function of the windowEyepointPolicy, the tracking enable flag, and the manual right and left eye positions.

Parameters:
position - the object that will receive the position
See Also:
setMonoscopicViewPolicy(int)

getImagePlateToVworld

public void getImagePlateToVworld(Transform3D t)
Retrieves the current ImagePlate coordinates to Virtual World coordinates transform and places it into the specified object.

Parameters:
t - the Transform3D object that will receive the transform

getPixelLocationInImagePlate

public void getPixelLocationInImagePlate(int x,
                                         int y,
                                         Point3d imagePlatePoint)
Computes the position of the specified AWT pixel value in image-plate coordinates and copies that value into the object provided.

Parameters:
x - the X coordinate of the pixel relative to the upper-left hand corner of the window.
y - the Y coordinate of the pixel relative to the upper-left hand corner of the window.
imagePlatePoint - the object that will receive the position in physical image plate coordinates (relative to the lower-left corner of the screen).

getPixelLocationInImagePlate

void getPixelLocationInImagePlate(double x,
                                  double y,
                                  double z,
                                  Point3d imagePlatePoint)

getPixelLocationInImagePlate

public void getPixelLocationInImagePlate(Point2d pixelLocation,
                                         Point3d imagePlatePoint)
Computes the position of the specified AWT pixel value in image-plate coordinates and copies that value into the object provided.

Parameters:
pixelLocation - the coordinates of the pixel relative to the upper-left hand corner of the window.
imagePlatePoint - the object that will receive the position in physical image plate coordinates (relative to the lower-left corner of the screen).
Since:
Java 3D 1.2

getPixelLocationFromImagePlate

public void getPixelLocationFromImagePlate(Point3d imagePlatePoint,
                                           Point2d pixelLocation)
Projects the specified point from image plate coordinates into AWT pixel coordinates. The AWT pixel coordinates are copied into the object provided.

Parameters:
imagePlatePoint - the position in physical image plate coordinates (relative to the lower-left corner of the screen).
pixelLocation - the object that will receive the coordinates of the pixel relative to the upper-left hand corner of the window.
Since:
Java 3D 1.2

getVworldProjection

public void getVworldProjection(Transform3D leftProjection,
                                Transform3D rightProjection)
Copies the current Vworld projection transform for each eye into the specified Transform3D objects. This transform takes points in virtual world coordinates and projects them into clipping coordinates, which are in the range [-1,1] in X, Y, and Z after clipping and perspective division. In monoscopic mode, the same projection transform will be copied into both the right and left eye Transform3D objects.

Parameters:
leftProjection - the Transform3D object that will receive a copy of the current projection transform for the left eye.
rightProjection - the Transform3D object that will receive a copy of the current projection transform for the right eye.
Since:
Java 3D 1.3

getInverseVworldProjection

public void getInverseVworldProjection(Transform3D leftInverseProjection,
                                       Transform3D rightInverseProjection)
Copies the inverse of the current Vworld projection transform for each eye into the specified Transform3D objects. This transform takes points in clipping coordinates, which are in the range [-1,1] in X, Y, and Z after clipping and perspective division, and transforms them into virtual world coordinates. In monoscopic mode, the same inverse projection transform will be copied into both the right and left eye Transform3D objects.

Parameters:
leftInverseProjection - the Transform3D object that will receive a copy of the current inverse projection transform for the left eye.
rightInverseProjection - the Transform3D object that will receive a copy of the current inverse projection transform for the right eye.
Since:
Java 3D 1.3

getPhysicalWidth

public double getPhysicalWidth()
Retrieves the physical width of this canvas window in meters.

Returns:
the physical window width in meters.

getPhysicalHeight

public double getPhysicalHeight()
Retrieves the physical height of this canvas window in meters.

Returns:
the physical window height in meters.

getVworldToImagePlate

public void getVworldToImagePlate(Transform3D t)
Retrieves the current Virtual World coordinates to ImagePlate coordinates transform and places it into the specified object.

Parameters:
t - the Transform3D object that will receive the transform

getLastVworldToImagePlate

void getLastVworldToImagePlate(Transform3D t)

setView

void setView(View view)
Sets view that points to this Canvas3D.

Parameters:
view - view object that points to this Canvas3D

computeViewCache

void computeViewCache()

getView

public View getView()
Gets view that points to this Canvas3D.

Returns:
view object that points to this Canvas3D

getStereoAvailable

public boolean getStereoAvailable()
Returns a status flag indicating whether or not stereo is available. This is equivalent to:

Returns:
a flag indicating whether stereo is available

setStereoEnable

public void setStereoEnable(boolean flag)
Turns stereo on or off. Note that this attribute is used only when stereo is available. Enabling stereo on a Canvas3D that does not support stereo has no effect.

Parameters:
flag - enables or disables the display of stereo
See Also:
queryProperties()

getStereoEnable

public boolean getStereoEnable()
Returns a status flag indicating whether or not stereo is enabled.

Returns:
a flag indicating whether stereo is enabled

setMonoscopicViewPolicy

public void setMonoscopicViewPolicy(int policy)
Specifies how Java 3D generates monoscopic view. If set to View.LEFT_EYE_VIEW, the view generated corresponds to the view as seen from the left eye. If set to View.RIGHT_EYE_VIEW, the view generated corresponds to the view as seen from the right eye. If set to View.CYCLOPEAN_EYE_VIEW, the view generated corresponds to the view as seen from the 'center eye', the fictional eye half-way between the left and right eye. The default monoscopic view policy is View.CYCLOPEAN_EYE_VIEW.

NOTE: for backward compatibility with Java 3D 1.1, if this attribute is set to its default value of View.CYCLOPEAN_EYE_VIEW, the monoscopic view policy in the View object will be used. An application should not use both the deprecated View method and this Canvas3D method at the same time.

Parameters:
policy - one of View.LEFT_EYE_VIEW, View.RIGHT_EYE_VIEW, or View.CYCLOPEAN_EYE_VIEW.
Throws:
java.lang.IllegalStateException - if the specified policy is CYCLOPEAN_EYE_VIEW, the canvas is a stereo canvas, and the viewPolicy for the associated view is HMD_VIEW
Since:
Java 3D 1.2

getMonoscopicViewPolicy

public int getMonoscopicViewPolicy()
Returns policy on how Java 3D generates monoscopic view.

Returns:
policy one of View.LEFT_EYE_VIEW, View.RIGHT_EYE_VIEW or View.CYCLOPEAN_EYE_VIEW.
Since:
Java 3D 1.2

getDoubleBufferAvailable

public boolean getDoubleBufferAvailable()
Returns a status flag indicating whether or not double buffering is available. This is equivalent to:

Returns:
a flag indicating whether double buffering is available.

setDoubleBufferEnable

public void setDoubleBufferEnable(boolean flag)
Turns double buffering on or off. If double buffering is off, all drawing is to the front buffer and no buffer swap is done between frames. It should be stressed that running Java 3D with double buffering disabled is not recommended. Enabling double buffering on a Canvas3D that does not support double buffering has no effect.

Parameters:
flag - enables or disables double buffering.
See Also:
queryProperties()

getDoubleBufferEnable

public boolean getDoubleBufferEnable()
Returns a status flag indicating whether or not double buffering is enabled.

Returns:
a flag indicating if double buffering is enabled.

getSceneAntialiasingAvailable

public boolean getSceneAntialiasingAvailable()
Returns a status flag indicating whether or not scene antialiasing is available. This is equivalent to:

Returns:
a flag indicating whether scene antialiasing is available.

isShadingLanguageSupported

public boolean isShadingLanguageSupported(int shadingLanguage)
Returns a flag indicating whether or not the specified shading language is supported. A ShaderError will be generated if an unsupported shading language is used.

Parameters:
shadingLanguage - the shading language being queried, one of: Shader.SHADING_LANGUAGE_GLSL or Shader.SHADING_LANGUAGE_CG.
Returns:
true if the specified shading language is supported, false otherwise.
Since:
Java 3D 1.4

queryProperties

public final java.util.Map queryProperties()
Returns a read-only Map object containing key-value pairs that define various properties for this Canvas3D. All of the keys are String objects. The values are key-specific, but most will be Boolean, Integer, Float, Double, or String objects.

The currently defined keys are:

The descriptions of the values returned for each key are as follows:

Returns:
the properties of this Canavs3D
Since:
Java 3D 1.2

createQueryContext

void createQueryContext()

createQueryProps

private void createQueryProps()
Creates the query properties for this Canvas.


updateViewCache

void updateViewCache(boolean flag,
                     CanvasViewCache cvc,
                     BoundingBox frustumBBox,
                     boolean doInfinite)
Update the view cache associated with this canvas.


setDepthBufferWriteEnableOverride

void setDepthBufferWriteEnableOverride(boolean flag)
Set depthBufferWriteEnableOverride flag


setDepthBufferEnableOverride

void setDepthBufferEnableOverride(boolean flag)
Set depthBufferEnableOverride flag


resetTexture

void resetTexture(Context ctx,
                  int texUnitIndex)

resetTextureBin

void resetTextureBin()

d3dResize

void d3dResize()

d3dToggle

void d3dToggle()

notifyD3DPeer

void notifyD3DPeer(int cmd)

resetRendering

void resetRendering(int status)

reset

void reset()

resetImmediateRendering

void resetImmediateRendering(int status)

getSize

public java.awt.Dimension getSize()
Overrides:
getSize in class java.awt.Component

getSize

public java.awt.Dimension getSize(java.awt.Dimension rv)
Overrides:
getSize in class java.awt.Component

getLocationOnScreen

public java.awt.Point getLocationOnScreen()
Overrides:
getLocationOnScreen in class java.awt.Component

getX

public int getX()
Overrides:
getX in class java.awt.Component

getY

public int getY()
Overrides:
getY in class java.awt.Component

getWidth

public int getWidth()
Overrides:
getWidth in class java.awt.Component

getHeight

public int getHeight()
Overrides:
getHeight in class java.awt.Component

getLocation

public java.awt.Point getLocation(java.awt.Point rv)
Overrides:
getLocation in class java.awt.Component

getLocation

public java.awt.Point getLocation()
Overrides:
getLocation in class java.awt.Component

getBounds

public java.awt.Rectangle getBounds()
Overrides:
getBounds in class java.awt.Component

getBounds

public java.awt.Rectangle getBounds(java.awt.Rectangle rv)
Overrides:
getBounds in class java.awt.Component

setProjectionMatrix

void setProjectionMatrix(Context ctx,
                         Transform3D projTrans)

setModelViewMatrix

void setModelViewMatrix(Context ctx,
                        double[] viewMatrix,
                        Transform3D mTrans)

setDepthBufferWriteEnable

void setDepthBufferWriteEnable(boolean mode)

setNumActiveTexUnit

void setNumActiveTexUnit(int n)

getNumActiveTexUnit

int getNumActiveTexUnit()

setLastActiveTexUnit

void setLastActiveTexUnit(int n)

getLastActiveTexUnit

int getLastActiveTexUnit()

createTexUnitState

void createTexUnitState()

supportGlobalAlpha

boolean supportGlobalAlpha()

enableSeparateSpecularColor

void enableSeparateSpecularColor()
Enable separate specular color if it is not overriden by the property j3d.disableSeparateSpecular.


beginScene

final void beginScene()

endScene

final void endScene()

sendCreateOffScreenBuffer

private void sendCreateOffScreenBuffer()

sendDestroyCtxAndOffScreenBuffer

private void sendDestroyCtxAndOffScreenBuffer()

sendAllocateCanvasId

private void sendAllocateCanvasId()

sendFreeCanvasId

private void sendFreeCanvasId()

removeCtx

private void removeCtx()

writeObject

private void writeObject(java.io.ObjectOutputStream out)
                  throws java.io.IOException
Serialization of Canvas3D objects is not supported.

Throws:
java.lang.UnsupportedOperationException - this method is not supported
java.io.IOException
Since:
Java 3D 1.3

readObject

private void readObject(java.io.ObjectInputStream in)
                 throws java.io.IOException,
                        java.lang.ClassNotFoundException
Serialization of Canvas3D objects is not supported.

Throws:
java.lang.UnsupportedOperationException - this method is not supported
java.io.IOException
java.lang.ClassNotFoundException
Since:
Java 3D 1.3

setStateIsUpdated

void setStateIsUpdated(int bit)

setStateToUpdate

void setStateToUpdate(int bit,
                      java.lang.Object bin)

updateEnvState

void updateEnvState()

updateState

void updateState(int dirtyBits)
update state if neccessary according to the stateUpdatedMask


updateTextureForRaster

void updateTextureForRaster(Texture2DRetained texture)

restoreTextureBin

void restoreTextureBin()

textureFill

void textureFill(RasterRetained raster,
                 Point2d winCoord,
                 float mapZ,
                 float alpha)

textureFill

void textureFill(BackgroundRetained bg,
                 int winWidth,
                 int winHeight)

clear

void clear(BackgroundRetained bg,
           int winWidth,
           int winHeight)

addTextureResource

void addTextureResource(int id,
                        java.lang.Object obj)
obj is either TextureRetained or DetailTextureImage if obj is DetailTextureImage then we just clear the resourceCreationMask of all the formats no matter it is create or not since we don't remember the format information for simplicity. We don't need to check duplicate value of id in the table since this procedure is invoke only when id of texture is -1 one time only. This is always call from Renderer thread.


freeResourcesInFreeList

void freeResourcesInFreeList(Context ctx)

freeContextResources

void freeContextResources(Renderer rdr,
                          boolean freeBackground,
                          Context ctx)

freeAllDisplayListResources

void freeAllDisplayListResources(Context ctx)

createNewContext

private Context createNewContext(long display,
                                 Drawable drawable,
                                 long fbConfig,
                                 Context shareCtx,
                                 boolean isSharedCtx,
                                 boolean offScreen,
                                 boolean glslLibraryAvailable,
                                 boolean cgLibraryAvailable)

createQueryContext

private void createQueryContext(long display,
                                Drawable drawable,
                                long fbConfig,
                                boolean offScreen,
                                int width,
                                int height,
                                boolean glslLibraryAvailable,
                                boolean cgLibraryAvailable)

createOffScreenBuffer

Drawable createOffScreenBuffer(Context ctx,
                               long display,
                               long fbConfig,
                               int width,
                               int height)

destroyOffScreenBuffer

void destroyOffScreenBuffer(Context ctx,
                            long display,
                            long fbConfig,
                            Drawable drawable)

readOffScreenBuffer

private void readOffScreenBuffer(Context ctx,
                                 int format,
                                 int type,
                                 java.lang.Object data,
                                 int width,
                                 int height)

swapBuffers

int swapBuffers(Context ctx,
                long dpy,
                Drawable drawable)

resizeD3DCanvas

private int resizeD3DCanvas(Context ctx)

toggleFullScreenMode

private int toggleFullScreenMode(Context ctx)

updateMaterial

void updateMaterial(Context ctx,
                    float r,
                    float g,
                    float b,
                    float a)

destroyContext

static void destroyContext(long display,
                           Drawable drawable,
                           Context ctx)

accum

void accum(Context ctx,
           float value)

accumReturn

void accumReturn(Context ctx)

clearAccum

void clearAccum(Context ctx)

getNumCtxLights

int getNumCtxLights(Context ctx)

decal1stChildSetup

boolean decal1stChildSetup(Context ctx)

decalNthChildSetup

void decalNthChildSetup(Context ctx)

decalReset

void decalReset(Context ctx,
                boolean depthBufferEnable)

ctxUpdateEyeLightingEnable

void ctxUpdateEyeLightingEnable(Context ctx,
                                boolean localEyeLightingEnable)

setBlendColor

void setBlendColor(Context ctx,
                   float red,
                   float green,
                   float blue,
                   float alpha)

setBlendFunc

void setBlendFunc(Context ctx,
                  int src,
                  int dst)

setFogEnableFlag

void setFogEnableFlag(Context ctx,
                      boolean enableFlag)

setFullSceneAntialiasing

void setFullSceneAntialiasing(Context ctx,
                              boolean enable)

setGlobalAlpha

void setGlobalAlpha(Context ctx,
                    float alpha)

updateSeparateSpecularColorEnable

void updateSeparateSpecularColorEnable(Context ctx,
                                       boolean control)

beginScene

private void beginScene(Context ctx)

endScene

private void endScene(Context ctx)

validGraphicsMode

private boolean validGraphicsMode()

setLightEnables

void setLightEnables(Context ctx,
                     long enableMask,
                     int maxLights)

setSceneAmbient

void setSceneAmbient(Context ctx,
                     float red,
                     float green,
                     float blue)

disableFog

void disableFog(Context ctx)

disableModelClip

void disableModelClip(Context ctx)

resetRenderingAttributes

void resetRenderingAttributes(Context ctx,
                              boolean depthBufferWriteEnableOverride,
                              boolean depthBufferEnableOverride)

resetTextureNative

void resetTextureNative(Context ctx,
                        int texUnitIndex)

activeTextureUnit

void activeTextureUnit(Context ctx,
                       int texUnitIndex)

resetTexCoordGeneration

void resetTexCoordGeneration(Context ctx)

resetTextureAttributes

void resetTextureAttributes(Context ctx)

resetPolygonAttributes

void resetPolygonAttributes(Context ctx)

resetLineAttributes

void resetLineAttributes(Context ctx)

resetPointAttributes

void resetPointAttributes(Context ctx)

resetTransparency

void resetTransparency(Context ctx,
                       int geometryType,
                       int polygonMode,
                       boolean lineAA,
                       boolean pointAA)

resetColoringAttributes

void resetColoringAttributes(Context ctx,
                             float r,
                             float g,
                             float b,
                             float a,
                             boolean enableLight)

syncRender

void syncRender(Context ctx,
                boolean wait)
This native method makes sure that the rendering for this canvas gets done now.


useCtx

static boolean useCtx(Context ctx,
                      long display,
                      Drawable drawable)

releaseCtx

private boolean releaseCtx(Context ctx,
                           long dpy)

clear

void clear(Context ctx,
           float r,
           float g,
           float b,
           boolean clearStencil)

textureFillBackground

void textureFillBackground(Context ctx,
                           float texMinU,
                           float texMaxU,
                           float texMinV,
                           float texMaxV,
                           float mapMinX,
                           float mapMaxX,
                           float mapMinY,
                           float mapMaxY,
                           boolean useBiliearFilter)

textureFillRaster

void textureFillRaster(Context ctx,
                       float texMinU,
                       float texMaxU,
                       float texMinV,
                       float texMaxV,
                       float mapMinX,
                       float mapMaxX,
                       float mapMinY,
                       float mapMaxY,
                       float mapZ,
                       float alpha,
                       boolean useBiliearFilter)

executeRasterDepth

void executeRasterDepth(Context ctx,
                        float posX,
                        float posY,
                        float posZ,
                        int srcOffsetX,
                        int srcOffsetY,
                        int rasterWidth,
                        int rasterHeight,
                        int depthWidth,
                        int depthHeight,
                        int depthType,
                        java.lang.Object depthData)

setModelViewMatrix

void setModelViewMatrix(Context ctx,
                        double[] viewMatrix,
                        double[] modelMatrix)

setProjectionMatrix

void setProjectionMatrix(Context ctx,
                         double[] projMatrix)

setViewport

void setViewport(Context ctx,
                 int x,
                 int y,
                 int width,
                 int height)

newDisplayList

void newDisplayList(Context ctx,
                    int displayListId)

endDisplayList

void endDisplayList(Context ctx)

callDisplayList

void callDisplayList(Context ctx,
                     int id,
                     boolean isNonUniformScale)

freeDisplayList

static void freeDisplayList(Context ctx,
                            int id)

freeTexture

static void freeTexture(Context ctx,
                        int id)

texturemapping

void texturemapping(Context ctx,
                    int px,
                    int py,
                    int xmin,
                    int ymin,
                    int xmax,
                    int ymax,
                    int texWidth,
                    int texHeight,
                    int rasWidth,
                    int format,
                    int objectId,
                    byte[] image,
                    int winWidth,
                    int winHeight)

initTexturemapping

boolean initTexturemapping(Context ctx,
                           int texWidth,
                           int texHeight,
                           int objectId)

setRenderMode

void setRenderMode(Context ctx,
                   int mode,
                   boolean doubleBuffer)

setDepthBufferWriteEnable

void setDepthBufferWriteEnable(Context ctx,
                               boolean mode)

hasDoubleBuffer

boolean hasDoubleBuffer()

hasStereo

boolean hasStereo()

getStencilSize

int getStencilSize()

hasSceneAntialiasingMultisample

boolean hasSceneAntialiasingMultisample()

hasSceneAntialiasingAccum

boolean hasSceneAntialiasingAccum()


Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.