javax.media.j3d
Class Screen3D

java.lang.Object
  extended by javax.media.j3d.Screen3D

public class Screen3D
extends java.lang.Object

The Screen3D Object contains all information about a particular screen. All Canvas3D objects on the same physical screen (display device) refer to the same Screen3D object. Note that Screen3D has no public constructors--it is obtained from the Canvas3D via the getScreen3D method.

Default values for Screen3D parameters are as follows:

Offscreen Rendering

New for Java 3D 1.2, an off-screen rendering mode allows rendering to a memory image, which is possibly larger than the screen. The setSize and getSize methods are defined specifically for this mode. Note that the off-screen size, physical width, and physical height must be set prior to rendering to the associated off-screen canvas. Failure to do so will result in an exception.

Calibration Parameters

The Screen3D object must be calibrated with the coexistence volume. The Screen3D class provides several methods for defining the calibration parameters.

Additional Information

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

See Also:
Canvas3D, Canvas3D.getScreen3D()

Field Summary
(package private)  UnorderList activeViews
           
(package private)  int canvasCount
           
private static boolean debug
           
(package private) static java.util.Hashtable deviceRendererMap
           
(package private)  long display
           
(package private)  java.awt.GraphicsDevice graphicsDevice
           
(package private) static int HEAD_TRACKER_TO_IMAGE_PLATE_DIRTY
           
(package private)  Transform3D headTrackerToLeftImagePlate
           
(package private)  Transform3D headTrackerToRightImagePlate
           
private static double METERS_PER_PIXEL
           
(package private)  boolean offScreen
           
(package private) static int PHYSICAL_SCREEN_SIZE_DIRTY
           
(package private)  double physicalScreenHeight
           
(package private)  double physicalScreenWidth
           
(package private)  Renderer renderer
           
(package private)  int scrDirtyMask
           
(package private)  int screen
           
(package private) static int SCREEN_SIZE_DIRTY_DIRTY
           
(package private)  java.awt.Dimension screenSize
           
(package private)  ScreenViewCache screenViewCache
           
(package private) static int TRACKER_BASE_TO_IMAGE_PLATE_DIRTY
           
(package private)  Transform3D trackerBaseToImagePlate
           
(package private)  java.util.ArrayList users
           
 
Constructor Summary
Screen3D(java.awt.GraphicsConfiguration graphicsConfiguration, boolean offScreen)
          Construct a new Screen3D object with the specified size in pixels.
 
Method Summary
(package private)  boolean activeViewEmpty()
           
(package private)  void addActiveView(View v)
           
(package private)  void addUser(Canvas3D c)
           
(package private)  void decCanvasCount()
          Decrement canvas count, kill renderer if needed
 void getHeadTrackerToLeftImagePlate(Transform3D t)
          Retrieves the head-tracker coordinate system to left image-plate coordinate system transform and copies it into the specified Transform3D object.
 void getHeadTrackerToRightImagePlate(Transform3D t)
          Retrieves the head-tracker coordinate system to right image-plate coordinate system transform and copies it into the specified Transform3D object.
 double getPhysicalScreenHeight()
          Retrieves the the screen's physical height in meters.
 double getPhysicalScreenWidth()
          Retrieves the screen's physical width in meters.
 java.awt.Dimension getSize()
          Retrieves the width and height (in pixels) of this Screen3D.
 java.awt.Dimension getSize(java.awt.Dimension rv)
          Retrieves the width and height (in pixels) of this Screen3D and copies it into the specified Dimension object.
 void getTrackerBaseToImagePlate(Transform3D t)
          Retrieves the tracker-base coordinate system to image-plate coordinate system transform and copies it into the specified Transform3D object.
(package private)  void incCanvasCount()
          Increment canvas count, initialize renderer if needed
(package private)  void notifyUsers()
           
(package private)  void removeActiveView(View v)
           
(package private)  void removeUser(Canvas3D c)
           
 void setHeadTrackerToLeftImagePlate(Transform3D t)
          Sets the head-tracker coordinate system to left image-plate coordinate system transform.
 void setHeadTrackerToRightImagePlate(Transform3D t)
          Sets the head-tracker coordinate system to right image-plate coordinate system transform.
 void setPhysicalScreenHeight(double height)
          Sets the screen physical height in meters.
 void setPhysicalScreenWidth(double width)
          Sets the screen physical width in meters.
 void setSize(java.awt.Dimension d)
          Sets the width and height (in pixels) of this off-screen Screen3D.
 void setSize(int width, int height)
          Sets the width and height (in pixels) of this off-screen Screen3D.
 void setTrackerBaseToImagePlate(Transform3D t)
          Sets the tracker-base coordinate system to image-plate coordinate system transform.
 java.lang.String toString()
           
(package private)  void updateViewCache()
          Update the view cache associated with this screen.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

debug

private static final boolean debug
See Also:
Constant Field Values

METERS_PER_PIXEL

private static final double METERS_PER_PIXEL
See Also:
Constant Field Values

graphicsDevice

java.awt.GraphicsDevice graphicsDevice

offScreen

boolean offScreen

display

long display

screen

int screen

physicalScreenWidth

double physicalScreenWidth

physicalScreenHeight

double physicalScreenHeight

screenSize

java.awt.Dimension screenSize

trackerBaseToImagePlate

Transform3D trackerBaseToImagePlate

headTrackerToLeftImagePlate

Transform3D headTrackerToLeftImagePlate

headTrackerToRightImagePlate

Transform3D headTrackerToRightImagePlate

PHYSICAL_SCREEN_SIZE_DIRTY

static final int PHYSICAL_SCREEN_SIZE_DIRTY
See Also:
Constant Field Values

SCREEN_SIZE_DIRTY_DIRTY

static final int SCREEN_SIZE_DIRTY_DIRTY
See Also:
Constant Field Values

TRACKER_BASE_TO_IMAGE_PLATE_DIRTY

static final int TRACKER_BASE_TO_IMAGE_PLATE_DIRTY
See Also:
Constant Field Values

HEAD_TRACKER_TO_IMAGE_PLATE_DIRTY

static final int HEAD_TRACKER_TO_IMAGE_PLATE_DIRTY
See Also:
Constant Field Values

scrDirtyMask

int scrDirtyMask

screenViewCache

ScreenViewCache screenViewCache

renderer

Renderer renderer

deviceRendererMap

static java.util.Hashtable deviceRendererMap

canvasCount

int canvasCount

activeViews

UnorderList activeViews

users

java.util.ArrayList users
Constructor Detail

Screen3D

Screen3D(java.awt.GraphicsConfiguration graphicsConfiguration,
         boolean offScreen)
Construct a new Screen3D object with the specified size in pixels. Note that currently, there is no AWT equivalent of screen so Java 3D users need to get this through the Canvas3D object (via getScreen()) if they need it.

Parameters:
graphicsConfiguration - the AWT graphics configuration associated with this Screen3D
offScreen - a flag that indicates whether this Screen3D is associated with an off-screen Canvas3D
Method Detail

addActiveView

void addActiveView(View v)

removeActiveView

void removeActiveView(View v)

activeViewEmpty

boolean activeViewEmpty()

removeUser

void removeUser(Canvas3D c)

addUser

void addUser(Canvas3D c)

notifyUsers

void notifyUsers()

getSize

public java.awt.Dimension getSize()
Retrieves the width and height (in pixels) of this Screen3D.

Returns:
a new Dimension object containing the width and height of this Screen3D.

getSize

public java.awt.Dimension getSize(java.awt.Dimension rv)
Retrieves the width and height (in pixels) of this Screen3D and copies it into the specified Dimension object.

Parameters:
rv - Dimension object into which the size of this Screen3D is copied. If rv is null, a new Dimension object is allocated.
Returns:
rv
Since:
Java 3D 1.2

setSize

public void setSize(int width,
                    int height)
Sets the width and height (in pixels) of this off-screen Screen3D. The default size for off-screen Screen3D objects is (0,0).
NOTE: the size must be set prior to rendering to the associated off-screen canvas. Failure to do so will result in an exception.

Parameters:
width - the new width of this Screen3D object
height - the new height of this Screen3D object
Throws:
java.lang.IllegalStateException - if this Screen3D is not in off-screen mode.
Since:
Java 3D 1.2

setSize

public void setSize(java.awt.Dimension d)
Sets the width and height (in pixels) of this off-screen Screen3D. The default size for off-screen Screen3D objects is (0,0).
NOTE: the size must be set prior to rendering to the associated off-screen canvas. Failure to do so will result in an exception.

Parameters:
d - the new dimension of this Screen3D object
Throws:
java.lang.IllegalStateException - if this Screen3D is not in off-screen mode.
Since:
Java 3D 1.2

setPhysicalScreenWidth

public void setPhysicalScreenWidth(double width)
Sets the screen physical width in meters. In the case of a head-mounted display, this should be the apparent width at the focal plane.

Parameters:
width - the screen's physical width in meters

getPhysicalScreenWidth

public double getPhysicalScreenWidth()
Retrieves the screen's physical width in meters.

Returns:
the screen's physical width in meters

setPhysicalScreenHeight

public void setPhysicalScreenHeight(double height)
Sets the screen physical height in meters. In the case of a head-mounted display, this should be the apparent height at the focal plane.

Parameters:
height - the screen's physical height in meters

getPhysicalScreenHeight

public double getPhysicalScreenHeight()
Retrieves the the screen's physical height in meters.

Returns:
the screen's physical height in meters

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

setTrackerBaseToImagePlate

public void setTrackerBaseToImagePlate(Transform3D t)
Sets the tracker-base coordinate system to image-plate coordinate system transform. This transform is typically a calibration constant. This is used only in SCREEN_VIEW mode.

Parameters:
t - the new transform
Throws:
BadTransformException - if the transform is not rigid

getTrackerBaseToImagePlate

public void getTrackerBaseToImagePlate(Transform3D t)
Retrieves the tracker-base coordinate system to image-plate coordinate system transform and copies it into the specified Transform3D object.

Parameters:
t - the object that will receive the transform

setHeadTrackerToLeftImagePlate

public void setHeadTrackerToLeftImagePlate(Transform3D t)
Sets the head-tracker coordinate system to left image-plate coordinate system transform. This transform is typically a calibration constant. This is used only in HMD_VIEW mode.

Parameters:
t - the new transform
Throws:
BadTransformException - if the transform is not rigid

getHeadTrackerToLeftImagePlate

public void getHeadTrackerToLeftImagePlate(Transform3D t)
Retrieves the head-tracker coordinate system to left image-plate coordinate system transform and copies it into the specified Transform3D object.

Parameters:
t - the object that will receive the transform

setHeadTrackerToRightImagePlate

public void setHeadTrackerToRightImagePlate(Transform3D t)
Sets the head-tracker coordinate system to right image-plate coordinate system transform. This transform is typically a calibration constant. This is used only in HMD_VIEW mode.

Parameters:
t - the new transform
Throws:
BadTransformException - if the transform is not rigid

getHeadTrackerToRightImagePlate

public void getHeadTrackerToRightImagePlate(Transform3D t)
Retrieves the head-tracker coordinate system to right image-plate coordinate system transform and copies it into the specified Transform3D object.

Parameters:
t - the object that will receive the transform

updateViewCache

void updateViewCache()
Update the view cache associated with this screen.


incCanvasCount

void incCanvasCount()
Increment canvas count, initialize renderer if needed


decCanvasCount

void decCanvasCount()
Decrement canvas count, kill renderer if needed



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