javax.media.j3d
Class RasterRetained

java.lang.Object
  extended by javax.media.j3d.IndexedObject
      extended by javax.media.j3d.SceneGraphObjectRetained
          extended by javax.media.j3d.NodeComponentRetained
              extended by javax.media.j3d.GeometryRetained
                  extended by javax.media.j3d.RasterRetained
All Implemented Interfaces:
java.lang.Cloneable

 class RasterRetained
extends GeometryRetained

A Retained Raster.


Field Summary
private  int clipMode
           
(package private)  DepthComponentRetained depthComponent
           
private  int height
           
(package private)  ImageComponent2DRetained image
           
private  Point3f position
           
(package private)  Texture2DRetained texture
           
(package private)  int type
          Raster type
private  int width
           
private  int xDstOffset
           
private  int xSrcOffset
           
private  int yDstOffset
           
private  int ySrcOffset
           
 
Fields inherited from class javax.media.j3d.GeometryRetained
boundsDirty, cachedChangedFrequent, centroid, COMPRESS_TYPE, computeGeoBounds, EPSILON, GEO_TYPE_COMPRESSED, GEO_TYPE_GEOMETRYARRAY, GEO_TYPE_INDEXED_LINE_SET, GEO_TYPE_INDEXED_LINE_STRIP_SET, GEO_TYPE_INDEXED_POINT_SET, GEO_TYPE_INDEXED_QUAD_SET, GEO_TYPE_INDEXED_TRI_FAN_SET, GEO_TYPE_INDEXED_TRI_SET, GEO_TYPE_INDEXED_TRI_STRIP_SET, GEO_TYPE_LINE_SET, GEO_TYPE_LINE_STRIP_SET, GEO_TYPE_NONE, GEO_TYPE_POINT_SET, GEO_TYPE_QUAD_SET, GEO_TYPE_RASTER, GEO_TYPE_TEXT3D, GEO_TYPE_TOTAL, GEO_TYPE_TRI_FAN_SET, GEO_TYPE_TRI_SET, GEO_TYPE_TRI_STRIP_SET, geoBounds, geomLock, geoType, isDirty, isEditable, LINE_TYPE, liveStateLock, mirrorGeometry, nativeId, noAlpha, POINT_TYPE, QUAD_TYPE, RASTER_TYPE, recompCentroid, TEXT3D_TYPE, TRIANGLE_TYPE, universeList, userLists
 
Fields inherited from class javax.media.j3d.NodeComponentRetained
changedFrequent, compChanged, duplicateOnCloneTree, mirror, refCnt, refCount, users
 
Fields inherited from class javax.media.j3d.SceneGraphObjectRetained
DONT_MERGE, inBackgroundGroup, inSetLive, MERGE, MERGE_DONE, mergeFlag, onUpdateList, source
 
Fields inherited from class javax.media.j3d.IndexedObject
listIdx
 
Constructor Summary
RasterRetained()
           
 
Method Summary
(package private)  void clearLive(int refCount)
           
private  void clipImage(Canvas3D canvas, RenderAtom ra, Point2d winCoord, Point2i srcOffset)
          Clips the image against the window.
(package private)  void computeBoundingBox()
           
private  void computeObjCoord(Canvas3D canvas, Point2d winCoord, Point3d objCoord, Transform3D localToImagePlate)
           
private  Point3d computeWinCoord(Canvas3D canvas, RenderAtom ra, Point2d winCoord, Point3d objCoord, Transform3D localToImagePlate)
           
(package private)  void execute(Canvas3D cv, RenderAtom ra, boolean isNonUniformScale, boolean updateAlpha, float alpha, int screen, boolean ignoreVertexColors)
           
(package private)  int getClassType()
           
(package private)  int getClipMode()
          Retrieves the current clipping mode of this raster object.
(package private)  DepthComponent getDepthComponent()
          Retrieves the current depth image object.
(package private)  void getDstOffset(java.awt.Point dstOffset)
          Retrieves the current destination pixel offset.
(package private)  ImageComponent2D getImage()
          Retrieves the current pixel array object.
(package private)  void getPosition(Point3f pos)
          Retrieves the Raster's position
(package private)  void getSize(java.awt.Dimension size)
          Gets the size of the array of pixels to be copied.
(package private)  void getSrcOffset(java.awt.Point srcOffset)
          Retrieves the current source pixel offset.
(package private)  int getType()
          Retrieves the current type of this raster object, one of: RASTER_COLOR, RASTER_DEPTH, or RASTER_COLOR_DEPTH.
(package private)  void handleFrequencyChange(int bit)
           
(package private)  void initImage(ImageComponent2D img)
          Initializes the raster image to the specified image.
(package private)  boolean intersect(Bounds targetBound)
           
(package private)  boolean intersect(PickShape pickShape, PickInfo pickInfo, int flags, Point3d iPnt, GeometryRetained geom, int geomIndex)
           
(package private)  boolean intersect(Point3d[] pnts)
           
(package private)  boolean intersect(Transform3D thisLocalToVworld, Bounds targetBound)
           
(package private)  boolean intersect(Transform3D thisToOtherVworld, GeometryRetained geom)
           
(package private)  boolean intersect(Transform3D thisLocalToVworld, Transform3D otherLocalToVworld, GeometryRetained geom)
           
private  boolean isRasterClipPositionInside(Point3d clipCoord)
           
(package private)  void notifyImageComponentImageChanged(ImageComponentRetained image, ImageComponentUpdateInfo value)
           
private  void sendChangedMessage(int threads, java.lang.Object arg1, java.lang.Object arg2)
           
(package private)  void setClipMode(int clipMode)
          Sets the clipping mode of this raster object.
(package private)  void setDepthComponent(DepthComponent depthComponent)
          Sets the depth image used to copy pixels to/from a Canvas3D.
(package private)  void setDstOffset(int xDstOffset, int yDstOffset)
          Sets the destination pixel offset of the upper-left corner of the rendered image relative to the transformed position.
(package private)  void setImage(ImageComponent2D img)
          Sets the pixel array used to copy pixels to/from a Canvas3D.
(package private)  void setLive(boolean inBackgroundGroup, int refCount)
           
(package private)  void setPosition(Point3f pos)
          Set the Raster position
(package private)  void setSize(int width, int height)
          Sets the number of pixels to be copied from the pixel array.
(package private)  void setSrcOffset(int xSrcOffset, int ySrcOffset)
          Sets the offset within the source array of pixels at which to start copying.
(package private)  void setType(int type)
          Sets the type of this raster object to one of: RASTER_COLOR, RASTER_DEPTH, or RASTER_COLOR_DEPTH.
(package private)  void update()
           
 
Methods inherited from class javax.media.j3d.GeometryRetained
addUser, canBeInDisplayList, computeCentroid, decrComputeGeoBounds, doSetLive, getVertexFormat, incrComputeGeoBounds, isEquivalenceClass, removeUser, storeInterestData, updateObject
 
Methods inherited from class javax.media.j3d.NodeComponentRetained
addAMirrorUser, addUser, clone, copyMirrorUsers, createMirrorObject, decRefCnt, getDuplicateOnCloneTree, getInImmCtx, incRefCnt, initMirrorObject, notifyUsers, removeAMirrorUser, removeMirrorUsers, removeUser, set, setDuplicateOnCloneTree, setFrequencyChangeMask, setInImmCtx, updateMirrorObject
 
Methods inherited from class javax.media.j3d.SceneGraphObjectRetained
clearLive, clearLive, compile, doSetLive, doSetLive, getSource, getVirtualUniverse, isInSetLive, isStatic, markAsLive, merge, mergeTransform, setCompiled, setLive, setLive, setSource, traverse
 
Methods inherited from class javax.media.j3d.IndexedObject
getIdxUsed, incIdxUsed
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

type

int type
Raster type


clipMode

private int clipMode

position

private Point3f position

xSrcOffset

private int xSrcOffset

ySrcOffset

private int ySrcOffset

width

private int width

height

private int height

xDstOffset

private int xDstOffset

yDstOffset

private int yDstOffset

image

ImageComponent2DRetained image

texture

Texture2DRetained texture

depthComponent

DepthComponentRetained depthComponent
Constructor Detail

RasterRetained

RasterRetained()
Method Detail

setPosition

final void setPosition(Point3f pos)
Set the Raster position

Parameters:
position - new raster position

getPosition

final void getPosition(Point3f pos)
Retrieves the Raster's position

Parameters:
position - the variable to receive the position vector

setType

final void setType(int type)
Sets the type of this raster object to one of: RASTER_COLOR, RASTER_DEPTH, or RASTER_COLOR_DEPTH.

Parameters:
type - the new type of this raster

getType

final int getType()
Retrieves the current type of this raster object, one of: RASTER_COLOR, RASTER_DEPTH, or RASTER_COLOR_DEPTH.

Returns:
type the type of this raster

setClipMode

final void setClipMode(int clipMode)
Sets the clipping mode of this raster object.

Parameters:
clipMode - the new clipping mode of this raster, one of: CLIP_POSITION or CLIP_IMAGE. The default mode is CLIP_POSITION.

getClipMode

final int getClipMode()
Retrieves the current clipping mode of this raster object.

Returns:
clipMode the clipping mode of this raster, one of: CLIP_POSITION or CLIP_IMAGE.

setSrcOffset

final void setSrcOffset(int xSrcOffset,
                        int ySrcOffset)
Sets the offset within the source array of pixels at which to start copying.

Parameters:
xSrcOffset - the x offset within the source array of pixels at which to start copying
ySrcOffset - the y offset within the source array of pixels at which to start copying

getSrcOffset

final void getSrcOffset(java.awt.Point srcOffset)
Retrieves the current source pixel offset.

Parameters:
srcOffset - the object that will receive the source offset

setSize

final void setSize(int width,
                   int height)
Sets the number of pixels to be copied from the pixel array.

Parameters:
width - the number of columns in the array of pixels to copy
height - the number of rows in the array of pixels to copy

getSize

final void getSize(java.awt.Dimension size)
Gets the size of the array of pixels to be copied.

Parameters:
size - the new size

setDstOffset

final void setDstOffset(int xDstOffset,
                        int yDstOffset)
Sets the destination pixel offset of the upper-left corner of the rendered image relative to the transformed position.

Parameters:
xDstOffset - the x coordinate of the new offset
yDstOffset - the y coordinate of the new offset

getDstOffset

final void getDstOffset(java.awt.Point dstOffset)
Retrieves the current destination pixel offset.

Parameters:
dstOffset - the object that will receive the destination offset

initImage

final void initImage(ImageComponent2D img)
Initializes the raster image to the specified image.

Parameters:
image - new ImageCompoent2D object used as the raster image

setImage

final void setImage(ImageComponent2D img)
Sets the pixel array used to copy pixels to/from a Canvas3D. This is used when the type is RASTER_COLOR or RASTER_COLOR_DEPTH.

Parameters:
image - the ImageComponent2D object containing the color data

getImage

final ImageComponent2D getImage()
Retrieves the current pixel array object.

Returns:
image the ImageComponent2D object containing the color data

setDepthComponent

final void setDepthComponent(DepthComponent depthComponent)
Sets the depth image used to copy pixels to/from a Canvas3D. This is used when the type is RASTER_DEPTH or RASTER_COLOR_DEPTH.

Parameters:
depthImage - the DepthComponent object containing the depth (z-buffer) data

getDepthComponent

final DepthComponent getDepthComponent()
Retrieves the current depth image object.

Returns:
depthImage DepthComponent containing the depth (z-buffer) data

setLive

void setLive(boolean inBackgroundGroup,
             int refCount)
Overrides:
setLive in class GeometryRetained

clearLive

void clearLive(int refCount)
Overrides:
clearLive in class NodeComponentRetained

computeBoundingBox

void computeBoundingBox()
Specified by:
computeBoundingBox in class GeometryRetained

update

void update()
Specified by:
update in class GeometryRetained

sendChangedMessage

private void sendChangedMessage(int threads,
                                java.lang.Object arg1,
                                java.lang.Object arg2)

execute

void execute(Canvas3D cv,
             RenderAtom ra,
             boolean isNonUniformScale,
             boolean updateAlpha,
             float alpha,
             int screen,
             boolean ignoreVertexColors)
Specified by:
execute in class GeometryRetained

clipImage

private void clipImage(Canvas3D canvas,
                       RenderAtom ra,
                       Point2d winCoord,
                       Point2i srcOffset)
Clips the image against the window. This method simulates clipping the image by determining the subimage that will be drawn and adjusting the xOffset and yOffset accordingly. Only clipping against the left and top edges needs to be handled, clipping against the right and bottom edges will be handled by the underlying graphics library automatically.


isRasterClipPositionInside

private boolean isRasterClipPositionInside(Point3d clipCoord)

computeObjCoord

private void computeObjCoord(Canvas3D canvas,
                             Point2d winCoord,
                             Point3d objCoord,
                             Transform3D localToImagePlate)

computeWinCoord

private Point3d computeWinCoord(Canvas3D canvas,
                                RenderAtom ra,
                                Point2d winCoord,
                                Point3d objCoord,
                                Transform3D localToImagePlate)

getClassType

int getClassType()
Specified by:
getClassType in class GeometryRetained

notifyImageComponentImageChanged

void notifyImageComponentImageChanged(ImageComponentRetained image,
                                      ImageComponentUpdateInfo value)

intersect

boolean intersect(PickShape pickShape,
                  PickInfo pickInfo,
                  int flags,
                  Point3d iPnt,
                  GeometryRetained geom,
                  int geomIndex)
Specified by:
intersect in class GeometryRetained

intersect

boolean intersect(Bounds targetBound)
Specified by:
intersect in class GeometryRetained

intersect

boolean intersect(Point3d[] pnts)
Specified by:
intersect in class GeometryRetained

intersect

boolean intersect(Transform3D thisToOtherVworld,
                  GeometryRetained geom)
Specified by:
intersect in class GeometryRetained

intersect

boolean intersect(Transform3D thisLocalToVworld,
                  Transform3D otherLocalToVworld,
                  GeometryRetained geom)
Overrides:
intersect in class GeometryRetained

intersect

boolean intersect(Transform3D thisLocalToVworld,
                  Bounds targetBound)
Overrides:
intersect in class GeometryRetained

handleFrequencyChange

void handleFrequencyChange(int bit)
Overrides:
handleFrequencyChange in class SceneGraphObjectRetained


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