| java.lang.Object javax.media.j3d.SceneGraphObject javax.media.j3d.NodeComponent javax.media.j3d.Geometry javax.media.j3d.Raster
Raster | public class Raster extends Geometry (Code) | | The Raster object extends Geometry to allow drawing a raster image
that is attached to a 3D location in the virtual world.
It contains a 3D point that is defined in the local object
coordinate system of the Shape3D node that references the Raster.
It also contains a type specifier, a clipping mode, a reference to
a ImageComponent2D object and/or a DepthComponent object, an
integer x,y source offset and a size (width, height) to allow
reading or writing a portion of the referenced image, and an
integer x,y destination offset to position the raster relative to
the transformed 3D point.
In addition to being used as a type of geometry for drawing,
a Raster may be used to readback pixel data (color and/or z-buffer)
from the frame buffer in immediate mode.
The geometric extent of a Raster object is a single 3D point, specified
by the raster position. This means that geometry-based picking or
collision with a Raster object will only intersect the object at
this single point; the 2D raster image is neither pickable
nor collidable.
|
Field Summary | |
final public static int | ALLOW_CLIP_MODE_READ Specifies that this Raster allows reading the clip mode. | final public static int | ALLOW_CLIP_MODE_WRITE Specifies that this Raster allows writing the clip mode. | final public static int | ALLOW_DEPTH_COMPONENT_READ Specifies that this Raster allows reading the depth component. | final public static int | ALLOW_DEPTH_COMPONENT_WRITE Specifies that this Raster allows writing the depth component. | final public static int | ALLOW_IMAGE_READ Specifies that this Raster allows reading the image. | final public static int | ALLOW_IMAGE_WRITE Specifies that this Raster allows writing the image. | final public static int | ALLOW_OFFSET_READ Specifies that this Raster allows reading the source or
destination offset. | final public static int | ALLOW_OFFSET_WRITE Specifies that this Raster allows writing the source or
destination offset. | final public static int | ALLOW_POSITION_READ Specifies that this Raster allows reading the position. | final public static int | ALLOW_POSITION_WRITE Specifies that this Raster allows writing the position. | final public static int | ALLOW_SIZE_READ Specifies that this Raster allows reading the size. | final public static int | ALLOW_SIZE_WRITE Specifies that this Raster allows writing the size. | final public static int | ALLOW_TYPE_READ Specifies that this Raster allows reading the type. | final public static int | CLIP_IMAGE Specifies that the raster object is clipped as an image after
the raster position has been transformed. | final public static int | CLIP_POSITION Specifies that this raster object is not drawn
if the raster position is outside the viewing volume.
In this mode, the raster is not drawn when the transformed
raster position is clipped out, even if part of the raster would
have been visible. | final public static int | RASTER_COLOR Specifies a Raster object with color data. | final public static int | RASTER_COLOR_DEPTH Specifies a Raster object with both color and depth (z-buffer) data. | final public static int | RASTER_DEPTH Specifies a Raster object with depth (z-buffer) data. |
Constructor Summary | |
public | Raster() Constructs a Raster object with default parameters. | public | Raster(Point3f pos, int type, int xSrcOffset, int ySrcOffset, int width, int height, ImageComponent2D image, DepthComponent depthComponent) Constructs a new Raster object with the specified values. | public | Raster(Point3f pos, int type, Point srcOffset, Dimension size, ImageComponent2D image, DepthComponent depthComponent) Constructs a new Raster object with the specified values. | public | Raster(Point3f pos, int type, int clipMode, Point srcOffset, Dimension size, Point dstOffset, ImageComponent2D image, DepthComponent depthComponent) Constructs a new Raster object with the specified values. |
Method Summary | |
public NodeComponent | cloneNodeComponent() | void | createRetained() Creates the retained mode Raster object that this
Raster object will point to. | void | duplicateAttributes(NodeComponent originalNodeComponent, boolean forceDuplicate) Copies all node information from originalNodeComponent into
the current node. | boolean | duplicateChild() This function is called from getNodeComponent() to see if any of
the sub-NodeComponents duplicateOnCloneTree flag is true. | public void | duplicateNodeComponent(NodeComponent originalNodeComponent) NOTE: Applications should not call this method directly. | public int | getClipMode() Retrieves the current clipping mode of this raster object. | public DepthComponent | getDepthComponent() Retrieves the current depth image object. | public void | getDstOffset(Point dstOffset) Retrieves the current destination pixel offset. | public ImageComponent2D | getImage() Retrieves the current pixel array object. | public void | getOffset(Point srcOffset) | public void | getPosition(Point3f pos) Retrieves the current position in object coordinates of this raster. | public void | getSize(Dimension size) Retrieves the current raster size. | public void | getSrcOffset(Point srcOffset) Retrieves the current source pixel offset. | public int | getType() Retrieves the current type of this raster object, one of: RASTER_COLOR,
RASTER_DEPTH, or RASTER_COLOR_DEPTH. | public 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. | public void | setDepthComponent(DepthComponent depthComponent) Sets the depth image used to copy pixels to/from a Canvas3D. | public 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. | public void | setDstOffset(Point dstOffset) Sets the destination pixel offset of the upper-left corner of
the rendered image relative to the transformed position. | public void | setImage(ImageComponent2D image) Sets the pixel array used to copy pixels to/from a Canvas3D. | public void | setOffset(int xSrcOffset, int ySrcOffset) | public void | setOffset(Point srcOffset) | public void | setPosition(Point3f pos) Sets the position in object coordinates of this raster. | public void | setSize(int width, int height) Sets the number of pixels to be copied from the pixel array. | public void | setSize(Dimension size) Sets the size of the array of pixels to be copied. | public void | setSrcOffset(int xSrcOffset, int ySrcOffset) Sets the offset within the source array of pixels
at which to start copying. | public void | setSrcOffset(Point srcOffset) Sets the offset within the source array of pixels
at which to start copying. | public void | setType(int type) Sets the type of this raster object to one of: RASTER_COLOR,
RASTER_DEPTH, or RASTER_COLOR_DEPTH. |
ALLOW_CLIP_MODE_READ | final public static int ALLOW_CLIP_MODE_READ(Code) | | Specifies that this Raster allows reading the clip mode.
since: Java 3D 1.3 |
ALLOW_CLIP_MODE_WRITE | final public static int ALLOW_CLIP_MODE_WRITE(Code) | | Specifies that this Raster allows writing the clip mode.
since: Java 3D 1.3 |
ALLOW_DEPTH_COMPONENT_READ | final public static int ALLOW_DEPTH_COMPONENT_READ(Code) | | Specifies that this Raster allows reading the depth component.
|
ALLOW_DEPTH_COMPONENT_WRITE | final public static int ALLOW_DEPTH_COMPONENT_WRITE(Code) | | Specifies that this Raster allows writing the depth component.
|
ALLOW_IMAGE_READ | final public static int ALLOW_IMAGE_READ(Code) | | Specifies that this Raster allows reading the image.
|
ALLOW_IMAGE_WRITE | final public static int ALLOW_IMAGE_WRITE(Code) | | Specifies that this Raster allows writing the image.
|
ALLOW_OFFSET_READ | final public static int ALLOW_OFFSET_READ(Code) | | Specifies that this Raster allows reading the source or
destination offset.
|
ALLOW_OFFSET_WRITE | final public static int ALLOW_OFFSET_WRITE(Code) | | Specifies that this Raster allows writing the source or
destination offset.
|
ALLOW_POSITION_READ | final public static int ALLOW_POSITION_READ(Code) | | Specifies that this Raster allows reading the position.
|
ALLOW_POSITION_WRITE | final public static int ALLOW_POSITION_WRITE(Code) | | Specifies that this Raster allows writing the position.
|
ALLOW_SIZE_READ | final public static int ALLOW_SIZE_READ(Code) | | Specifies that this Raster allows reading the size.
|
ALLOW_SIZE_WRITE | final public static int ALLOW_SIZE_WRITE(Code) | | Specifies that this Raster allows writing the size.
|
ALLOW_TYPE_READ | final public static int ALLOW_TYPE_READ(Code) | | Specifies that this Raster allows reading the type.
|
CLIP_IMAGE | final public static int CLIP_IMAGE(Code) | | Specifies that the raster object is clipped as an image after
the raster position has been transformed. In this mode, part
of the raster may be drawn even when the transformed raster
position is clipped out.
See Also: Raster.setClipMode since: Java 3D 1.3 |
CLIP_POSITION | final public static int CLIP_POSITION(Code) | | Specifies that this raster object is not drawn
if the raster position is outside the viewing volume.
In this mode, the raster is not drawn when the transformed
raster position is clipped out, even if part of the raster would
have been visible. This is the default mode.
See Also: Raster.setClipMode since: Java 3D 1.3 |
RASTER_COLOR | final public static int RASTER_COLOR(Code) | | Specifies a Raster object with color data.
In this mode, the image reference must point to
a valid ImageComponent object.
See Also: Raster.setType |
RASTER_COLOR_DEPTH | final public static int RASTER_COLOR_DEPTH(Code) | | Specifies a Raster object with both color and depth (z-buffer) data.
In this mode, the image reference must point to
a valid ImageComponent object, and the depthImage reference
must point to a valid DepthComponent object.
See Also: Raster.setType |
RASTER_DEPTH | final public static int RASTER_DEPTH(Code) | | Specifies a Raster object with depth (z-buffer) data.
In this mode, the depthImage reference must point to
a valid DepthComponent object.
See Also: Raster.setType |
Raster | public Raster()(Code) | | Constructs a Raster object with default parameters.
The default values are as follows:
type : RASTER_COLOR
clipMode : CLIP_POSITION
position : (0,0,0)
srcOffset : (0,0)
size : (0,0)
dstOffset : (0,0)
image : null
depth component : null
|
Raster | public Raster(Point3f pos, int type, int xSrcOffset, int ySrcOffset, int width, int height, ImageComponent2D image, DepthComponent depthComponent)(Code) | | Constructs a new Raster object with the specified values.
Parameters: pos - the position in object coordinates of the upper-leftcorner of the raster Parameters: type - the type of raster object, one of: RASTER_COLOR,RASTER_DEPTH, or RASTER_COLOR_DEPTH Parameters: xSrcOffset - the x offset within the source array of pixelsat which to start copying Parameters: ySrcOffset - the y offset within the source array of pixelsat which to start copying Parameters: width - the number of columns of pixels to copy Parameters: height - the number of rows of pixels to copy Parameters: image - the ImageComponent2D object containing thecolor data Parameters: depthComponent - the DepthComponent object containing the depth(z-buffer) data exception: IllegalArgumentException - if the image class of the specifiedImageComponent2D is ImageClass.NIO_IMAGE_BUFFER. |
Raster | public Raster(Point3f pos, int type, Point srcOffset, Dimension size, ImageComponent2D image, DepthComponent depthComponent)(Code) | | Constructs a new Raster object with the specified values.
Parameters: pos - the position in object coordinates of the upper-leftcorner of the raster Parameters: type - the type of raster object, one of: RASTER_COLOR,RASTER_DEPTH, or RASTER_COLOR_DEPTH Parameters: srcOffset - the offset within the source array of pixelsat which to start copying Parameters: size - the width and height of the image to be copied Parameters: image - the ImageComponent2D object containing thecolor data Parameters: depthComponent - the DepthComponent object containing the depth(z-buffer) data exception: IllegalArgumentException - if the image class of the specifiedImageComponent2D is ImageClass.NIO_IMAGE_BUFFER. |
Raster | public Raster(Point3f pos, int type, int clipMode, Point srcOffset, Dimension size, Point dstOffset, ImageComponent2D image, DepthComponent depthComponent)(Code) | | Constructs a new Raster object with the specified values.
Parameters: pos - the position in object coordinates of the upper-leftcorner of the raster Parameters: type - the type of raster object, one of: RASTER_COLOR,RASTER_DEPTH, or RASTER_COLOR_DEPTH Parameters: clipMode - the clipping mode of the raster object, one of:CLIP_POSITION or CLIP_IMAGE Parameters: srcOffset - the offset within the source array of pixelsat which to start copying Parameters: size - the width and height of the image to be copied Parameters: dstOffset - the destination pixel offset of the upper-leftcorner of the rendered image relative to the transformed position Parameters: image - the ImageComponent2D object containing thecolor data Parameters: depthComponent - the DepthComponent object containing the depth(z-buffer) data exception: IllegalArgumentException - if the image class of the specifiedImageComponent2D is ImageClass.NIO_IMAGE_BUFFER. since: Java 3D 1.3 |
createRetained | void createRetained()(Code) | | Creates the retained mode Raster object that this
Raster object will point to.
|
duplicateAttributes | void duplicateAttributes(NodeComponent originalNodeComponent, boolean forceDuplicate)(Code) | | Copies all node information from originalNodeComponent into
the current node. This method is called from the
duplicateNode method. This routine does
the actual duplication of all "local data" (any data defined in
this object).
Parameters: originalNodeComponent - the original node to duplicate. Parameters: forceDuplicate - when set to true , causes theduplicateOnCloneTree flag to be ignored. Whenfalse , the value of each node'sduplicateOnCloneTree variable determines whetherNodeComponent data is duplicated or copied. See Also: Node.cloneTree See Also: NodeComponent.setDuplicateOnCloneTree |
duplicateChild | boolean duplicateChild()(Code) | | This function is called from getNodeComponent() to see if any of
the sub-NodeComponents duplicateOnCloneTree flag is true.
If it is the case, current NodeComponent needs to
duplicate also even though current duplicateOnCloneTree flag is false.
This should be overwrite by NodeComponent which contains sub-NodeComponent.
|
duplicateNodeComponent | public void duplicateNodeComponent(NodeComponent originalNodeComponent)(Code) | | NOTE: Applications should not call this method directly.
It should only be called by the cloneNode method.
|
getClipMode | public int getClipMode()(Code) | | Retrieves the current clipping mode of this raster object.
clipMode the clipping mode of this raster,one of: CLIP_POSITION or CLIP_IMAGE. exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph since: Java 3D 1.3 |
getDepthComponent | public DepthComponent getDepthComponent()(Code) | | Retrieves the current depth image object.
depthImage DepthComponent containing thedepth (z-buffer) data exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph |
getDstOffset | public void getDstOffset(Point dstOffset)(Code) | | Retrieves the current destination pixel offset.
Parameters: dstOffset - the object that will receive the destination offset exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph since: Java 3D 1.3 |
getImage | public ImageComponent2D getImage()(Code) | | Retrieves the current pixel array object.
image the ImageComponent2D object containing thecolor data exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph |
getPosition | public void getPosition(Point3f pos)(Code) | | Retrieves the current position in object coordinates of this raster.
Parameters: pos - the vector that will receive the current position exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph |
getSize | public void getSize(Dimension size)(Code) | | Retrieves the current raster size.
Parameters: size - the object that will receive the size exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph |
getSrcOffset | public void getSrcOffset(Point srcOffset)(Code) | | Retrieves the current source pixel offset.
Parameters: srcOffset - the object that will receive the source offset exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph since: Java 3D 1.3 |
getType | public int getType()(Code) | | Retrieves the current type of this raster object, one of: RASTER_COLOR,
RASTER_DEPTH, or RASTER_COLOR_DEPTH.
type the type of this raster exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph |
setClipMode | public void setClipMode(int clipMode)(Code) | | 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 modeis CLIP_POSITION. exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph since: Java 3D 1.3 |
setDepthComponent | public void setDepthComponent(DepthComponent depthComponent)(Code) | | 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: depthComponent - the DepthComponent object containing thedepth (z-buffer) data exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph |
setDstOffset | public void setDstOffset(int xDstOffset, int yDstOffset)(Code) | | Sets the destination pixel offset of the upper-left corner of
the rendered image relative to the transformed position. This
pixel offset is added to the transformed raster position prior
to rendering the image.
Parameters: xDstOffset - the x coordinate of the new offset Parameters: yDstOffset - the y coordinate of the new offset exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph since: Java 3D 1.3 |
setDstOffset | public void setDstOffset(Point dstOffset)(Code) | | Sets the destination pixel offset of the upper-left corner of
the rendered image relative to the transformed position. This
pixel offset is added to the transformed raster position prior
to rendering the image.
Parameters: dstOffset - the new destination pixel offset exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph since: Java 3D 1.3 |
setImage | public void setImage(ImageComponent2D image)(Code) | | 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 thecolor data exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph exception: IllegalSharingException - if this Raster is live andthe specified image is being used by a Canvas3D as an off-screen buffer. exception: IllegalArgumentException - if the image class of the specifiedImageComponent2D is ImageClass.NIO_IMAGE_BUFFER. |
setOffset | public void setOffset(int xSrcOffset, int ySrcOffset)(Code) | | |
setPosition | public void setPosition(Point3f pos)(Code) | | Sets the position in object coordinates of this raster. This
position is transformed into device coordinates and is used as
the upper-left corner of the raster.
Parameters: pos - the new position of this raster exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph |
setSize | public void setSize(int width, int height)(Code) | | 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 Parameters: height - the number of rows in the array of pixels to copy exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph |
setSize | public void setSize(Dimension size)(Code) | | Sets the size of the array of pixels to be copied.
Parameters: size - the new size exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph |
setSrcOffset | public void setSrcOffset(int xSrcOffset, int ySrcOffset)(Code) | | Sets the offset within the source array of pixels
at which to start copying.
Parameters: xSrcOffset - the x offset within the source array of pixelsat which to start copying Parameters: ySrcOffset - the y offset within the source array of pixelsat which to start copying exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph since: Java 3D 1.3 |
setSrcOffset | public void setSrcOffset(Point srcOffset)(Code) | | Sets the offset within the source array of pixels
at which to start copying.
Parameters: srcOffset - the new source pixel offset exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph since: Java 3D 1.3 |
setType | public void setType(int type)(Code) | | 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 exception: RestrictedAccessException - if the method is calledwhen this object is part of live or compiled scene graph. |
Fields inherited from javax.media.j3d.Geometry | final public static int ALLOW_INTERSECT(Code)(Java Doc)
|
Fields inherited from javax.media.j3d.NodeComponent | boolean forceDuplicate(Code)(Java Doc)
|
|
|