| java.lang.Object javax.media.j3d.SceneGraphObject javax.media.j3d.NodeComponent javax.media.j3d.Geometry javax.media.j3d.CompressedGeometry
All known Subclasses: org.jdesktop.j3d.examples.picking.BoltCG, org.jdesktop.j3d.examples.picking.GullCG,
CompressedGeometry | public class CompressedGeometry extends Geometry (Code) | | The compressed geometry object is used to store geometry in a
compressed format. Using compressed geometry may increase the speed
objects can be sent over the network. Note that the geometry will
be decompressed in memory, so the application will not see any
memory savings.
Compressed geometry may be passed to this CompressedGeometry object
in one of two ways: by copying the data into this object using the
existing constructor, or by passing a reference to the data.
-
By Copying:
The existing CompressedGeometry constructor copies the buffer of
compressed geometry data into this CompressedGeometry object. This
is appropriate for many applications, and allows Java 3D to verify
the data once and then not worry about it again.
- By Reference:
A new constructor and set of methods in Java 3D version 1.2 allows
compressed geometry data to be accessed by reference, directly from
the user's array. To use this feature, you need to construct a
CompressedGeometry object with the
byReference flag
set to true . In this mode, a reference to the input
data is saved, but the data itself is not necessarily copied. Note
that the compressed geometry header is still copied into this
compressed geometry object. Data referenced by a
CompressedGeometry object must not be modified after the
CompressedGeometry object is constructed.
Applications
must exercise care not to violate this rule. If any referenced
compressed geometry data is modified after construction,
the results are undefined.
|
Field Summary | |
final public static int | ALLOW_COUNT_READ Specifies that this CompressedGeometry object allows reading its
byte count information. | final public static int | ALLOW_GEOMETRY_READ Specifies that this CompressedGeometry object allows reading its
geometry data component information. | final public static int | ALLOW_HEADER_READ Specifies that this CompressedGeometry object allows reading its
header information. | final public static int | ALLOW_REF_DATA_READ Specifies that this CompressedGeometry allows reading the geometry
data reference information for this object. | CompressedGeometryHeader | cgHeader |
Constructor Summary | |
| CompressedGeometry() Package scoped default constructor for use by cloneNodeComponent. | public | CompressedGeometry(CompressedGeometryHeader hdr, byte[] compressedGeometry) Creates a new CompressedGeometry NodeComponent by copying
the specified compressed geometry data into this object.
If the version number of compressed geometry, as specified by
the CompressedGeometryHeader, is incompatible with the
supported version of compressed geometry in the current version
of Java 3D, then the compressed geometry object will not be
rendered.
Parameters: hdr - the compressed geometry header. | public | CompressedGeometry(CompressedGeometryHeader hdr, byte[] compressedGeometry, boolean byReference) Creates a new CompressedGeometry NodeComponent. | public | CompressedGeometry(CompressedGeometryHeader hdr, J3DBuffer compressedGeometry) This constructor is not implemented. |
ALLOW_COUNT_READ | final public static int ALLOW_COUNT_READ(Code) | | Specifies that this CompressedGeometry object allows reading its
byte count information.
|
ALLOW_GEOMETRY_READ | final public static int ALLOW_GEOMETRY_READ(Code) | | Specifies that this CompressedGeometry object allows reading its
geometry data component information.
|
ALLOW_HEADER_READ | final public static int ALLOW_HEADER_READ(Code) | | Specifies that this CompressedGeometry object allows reading its
header information.
|
ALLOW_REF_DATA_READ | final public static int ALLOW_REF_DATA_READ(Code) | | Specifies that this CompressedGeometry allows reading the geometry
data reference information for this object. This is only used in
by-reference geometry mode.
since: Java 3D 1.2 |
CompressedGeometry | CompressedGeometry()(Code) | | Package scoped default constructor for use by cloneNodeComponent.
|
CompressedGeometry | public CompressedGeometry(CompressedGeometryHeader hdr, byte[] compressedGeometry)(Code) | | Creates a new CompressedGeometry NodeComponent by copying
the specified compressed geometry data into this object.
If the version number of compressed geometry, as specified by
the CompressedGeometryHeader, is incompatible with the
supported version of compressed geometry in the current version
of Java 3D, then the compressed geometry object will not be
rendered.
Parameters: hdr - the compressed geometry header. This is copiedinto the CompressedGeometry NodeComponent. Parameters: compressedGeometry - the compressed geometry data. Thegeometry must conform to the format described in Appendix B ofthe Java 3D API Specification. exception: IllegalArgumentException - if a problem is detected with theheader See Also: CompressedGeometryHeader See Also: Canvas3D.queryProperties |
CompressedGeometry | public CompressedGeometry(CompressedGeometryHeader hdr, byte[] compressedGeometry, boolean byReference)(Code) | | Creates a new CompressedGeometry NodeComponent. The
specified compressed geometry data is either copied into this
object or is accessed by reference.
If the version number of compressed geometry, as specified by
the CompressedGeometryHeader, is incompatible with the
supported version of compressed geometry in the current version
of Java 3D, the compressed geometry object will not be
rendered.
Parameters: hdr - the compressed geometry header. This is copiedinto the CompressedGeometry NodeComponent. Parameters: compressedGeometry - the compressed geometry data. Thegeometry must conform to the format described in Appendix B ofthe Java 3D API Specification. Parameters: byReference - a flag that indicates whether the data is copiedinto this compressed geometry object or is accessed by reference. exception: IllegalArgumentException - if a problem is detected with theheader See Also: CompressedGeometryHeader See Also: Canvas3D.queryProperties since: Java 3D 1.2 |
createRetained | void createRetained()(Code) | | Creates the retained mode CompressedGeometryRetained object that this
CompressedGeometry object will point to.
|
decompress | public Shape3D[] decompress()(Code) | | Decompresses the compressed geometry. Returns an array of Shape nodes
containing the decompressed geometry objects, or null if the version
number of the compressed geometry is incompatible with the decompressor
in the current version of Java 3D.
an array of Shape nodes containing thegeometry decompressed from this CompressedGeometry NodeComponentobject, or null if its version is incompatible exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph |
getByteCount | public int getByteCount()(Code) | | Returns the size, in bytes, of the compressed geometry buffer.
The size of the compressed geometry header is not included.
the size, in bytes, of the compressed geometry buffer. exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph |
getCompressedGeometry | public void getCompressedGeometry(byte[] compressedGeometry)(Code) | | Retrieves the compressed geometry associated with the
CompressedGeometry NodeComponent object. Copies the compressed
geometry from the CompressedGeometry node into the given array.
The array must be large enough to hold all of the bytes.
The individual array elements must be allocated by the caller.
Parameters: compressedGeometry - the array into which to copy the compressedgeometry. exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph exception: IllegalStateException - if the data access mode for thisobject is by-reference. exception: ArrayIndexOutOfBoundsException - if compressedGeometry bytearray is not large enough to receive the compressed geometry |
getCompressedGeometryBuffer | public J3DBuffer getCompressedGeometryBuffer()(Code) | | Gets the compressed geometry data buffer reference, which is
always null since NIO buffers are not supported for
CompressedGeometry objects.
null exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph since: Java 3D 1.3 |
getCompressedGeometryHeader | public void getCompressedGeometryHeader(CompressedGeometryHeader hdr)(Code) | | Copies the compressed geometry header from the CompressedGeometry
NodeComponent into the passed in parameter.
Parameters: hdr - the CompressedGeometryHeader object into which to copy theCompressedGeometry NodeComponent's header; the offset field may differfrom that which was originally specified if a copy of the originalcompressed geometry byte array was created. exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph See Also: CompressedGeometryHeader |
getCompressedGeometryRef | public byte[] getCompressedGeometryRef()(Code) | | Gets the compressed geometry data reference.
the current compressed geometry data reference. exception: IllegalStateException - if the data access mode for thisobject is not by-reference. exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph since: Java 3D 1.2 |
isByReference | public boolean isByReference()(Code) | | Retrieves the data access mode for this CompressedGeometry object.
true if the data access mode for thisCompressedGeometry object is by-reference;false if the data access mode is by-copying. since: Java 3D 1.2 |
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)
|
|
|