|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.j3d.aviatrix3d.SceneGraphObject org.j3d.aviatrix3d.NodeComponent org.j3d.aviatrix3d.Raster org.j3d.aviatrix3d.BitmapRaster
public class BitmapRaster
Raster object that represents a single drawn object using individual bits.
Bitmaps describe what should be seen on screen, but not the colour. Colour information is derived from the Pixmap's appearance information. A bitmap also has a local offset field. A user may set explicit bounds for this object, but in doing so may or may not truncate the bits themselves.
When providing byte data, each bit represents the state of a single pixel as either on or off. The bitmap width does not need to be a power of 2 or eight to handle this. An image that is 2 pixels high and 10 pixels wide would be represented by 4 bytes. The first byte is the first 8 bits of the input for the first row. The second byte uses the first 2 bits for the remaining part of the first row. The other 6 bits are ignored. The third byte starts the next row, and finally the first 2 bits of the the fourth byte provide the last two pixels of the second row.
Internationalisation Resource Names
Field Summary |
---|
Fields inherited from class org.j3d.aviatrix3d.Raster |
---|
bounds, implicitBounds, internalUpdater, INVALID_BOUNDS, lastParentList, parentList, pickFlags, validAlpha |
Fields inherited from class org.j3d.aviatrix3d.NodeComponent |
---|
lastParent, liveCount |
Fields inherited from class org.j3d.aviatrix3d.SceneGraphObject |
---|
alive, LISTENER_SET_TIMING_ERR_PROP, updateHandler |
Fields inherited from interface org.j3d.aviatrix3d.picking.PickableObject |
---|
COLLIDABLE_OBJECT, GENERAL_OBJECT, PROXIMITY_OBJECT, VISIBLE_OBJECT |
Fields inherited from interface org.j3d.aviatrix3d.picking.PickTarget |
---|
CUSTOM_PICK_TYPE, GROUP_PICK_TYPE, LEAF_PICK_TYPE, SINGLE_PICK_TYPE |
Constructor Summary | |
---|---|
BitmapRaster(int width,
int height)
Create a new empty raster with the given width and height. |
Method Summary | |
---|---|
int |
compareTo(BitmapRaster br)
Compares this object with the specified object for order. |
int |
compareTo(java.lang.Object o)
Compares this object with the specified object for order. |
boolean |
equals(BitmapRaster br)
Compares this object with the specified object to check for equivalence. |
boolean |
equals(java.lang.Object o)
Compare this object for equality to the given object. |
void |
getBits(byte[] bitmask)
Retrieve the vertices that are currently set. |
int |
getHeight()
Get the height of this bitmap. |
void |
getOrigin(float[] origin)
Get the current origin of the bitmap. |
int |
getWidth()
Get the width of this bitmap. |
boolean |
pickLineRay(float[] origin,
float[] direction,
boolean findAny,
float[] dataOut,
int dataOutFlags)
Check for all intersections against this geometry using a line ray and return the exact distance away of the closest picking point. |
boolean |
pickLineSegment(float[] start,
float[] end,
boolean findAny,
float[] dataOut,
int dataOutFlags)
Check for all intersections against this geometry using a line segment and return the exact distance away of the closest picking point. |
protected void |
recomputeBounds()
Internal method to recalculate the implicit bounds of this Node. |
void |
render(javax.media.opengl.GL gl)
Render the geometry now. |
void |
setBits(byte[] bitmask)
Set the pixel data for the bitmap contents. |
void |
setBits(byte[] bitmask,
int width,
int height)
Set the pixel data for the bitmap contents and change the size of the raster at the same time. |
protected void |
setLive(boolean state)
Notification that this object is live now. |
void |
setOrigin(float x,
float y)
Set the origin offset of the bitmap to be used when rendering. |
protected void |
updateBounds()
Update this node's bounds and then call the parent to update it's bounds. |
Methods inherited from class org.j3d.aviatrix3d.Raster |
---|
addParent, boundsChanged, checkPickMask, getBounds, getPickableBounds, getPickMask, getPickTargetType, hasTransparency, isVisible, markBoundsDirty, pickBatch, pickSingle, removeParent, setBounds, setPickMask |
Methods inherited from class org.j3d.aviatrix3d.NodeComponent |
---|
addParent, getParents, numParents, removeParent |
Methods inherited from class org.j3d.aviatrix3d.SceneGraphObject |
---|
checkForCyclicChild, checkForCyclicParent, dataChanged, getAppUpdateWriteTimingMessage, getBoundsWriteTimingMessage, getDataWriteTimingMessage, getUserData, isLive, setUpdateHandler, setUserData |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BitmapRaster(int width, int height)
width
- The width of the raster in pixelsheight
- The height of the raster in pixels
java.lang.IllegalArgumentException
- The width or height are not positiveMethod Detail |
---|
public void render(javax.media.opengl.GL gl)
gl
- The GL context to render withpublic boolean pickLineSegment(float[] start, float[] end, boolean findAny, float[] dataOut, int dataOutFlags) throws NotPickableException
pickLineSegment
in interface LeafPickTarget
pickLineSegment
in class Raster
start
- The start point of the segmentend
- The end point of the segmentfindAny
- True if it only has to find a single intersection and can
exit as soon as it finds the first intersection. False if it must find
the closest polygondataOut
- An array to put the data in for the intersection. Exact
format is described by the flagsdataOutFlags
- A set of derived-class specific flags describing what
data should be included in the output array
NotPickableException
- This object has been marked as non pickable,
but you decided to try to call the method anywaypublic boolean pickLineRay(float[] origin, float[] direction, boolean findAny, float[] dataOut, int dataOutFlags) throws NotPickableException
pickLineRay
in interface LeafPickTarget
pickLineRay
in class Raster
origin
- The start point of the raydirection
- The direction vector of the rayfindAny
- True if it only has to find a single intersection and can
exit as soon as it finds the first intersection. False if it must find
the closest polygondataOut
- An array to put the data in for the intersection. Exact
format is described by the flagsdataOutFlags
- A set of derived-class specific flags describing what
data should be included in the output array
NotPickableException
- This object has been marked as non pickable,
but you decided to try to call the method anywayprotected void updateBounds()
updateBounds
in class Raster
protected void recomputeBounds()
recomputeBounds
in class Raster
protected void setLive(boolean state)
setLive
in class SceneGraphObject
state
- true if this should be marked as live nowpublic int compareTo(java.lang.Object o) throws java.lang.ClassCastException
o
- The objec to be compared
java.lang.ClassCastException
- The specified object's type prevents it from
being compared to this Objectpublic boolean equals(java.lang.Object o)
equals
in interface Renderable
equals
in class java.lang.Object
o
- The object to be compared
public int getHeight()
public int getWidth()
public void setBits(byte[] bitmask) throws InvalidWriteTimingException, java.lang.IllegalArgumentException
bitmask
- The bits to use for the raster or null to clear
java.lang.IllegalArgumentException
- The number of bytes is not sufficient to
fulfill the previously set width and height of the bitmap
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data callback methodpublic void setBits(byte[] bitmask, int width, int height) throws InvalidWriteTimingException, java.lang.IllegalArgumentException
bitmask
- The bits to use for the raster or null to clearwidth
- The width of the raster in pixelsheight
- The height of the raster in pixels
java.lang.IllegalArgumentException
- The width or height are not positive
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener bounds callback methodpublic void getBits(byte[] bitmask)
bitmask
- The array to copy the bit mask values into
java.lang.ArrayIndexOutOfBoundsException
- The provided array is too shortpublic void setOrigin(float x, float y) throws InvalidWriteTimingException
x
- The X coordinate of the originy
- The Y coordinate of the origin
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener bounds callback methodpublic void getOrigin(float[] origin)
origin
- An array of length 2 to copy the values intopublic int compareTo(BitmapRaster br)
br
- The argument instance to be compared
public boolean equals(BitmapRaster br)
br
- The shape instance to be compared
|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |