|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.j3d.utils.geometry.compression.CompressedGeometryData
public class CompressedGeometryData
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 CompressedGeometryData 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.
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
CompressedGeometryData object must not be modified after the
CompressedGeometryData 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.
Nested Class Summary | |
---|---|
static class |
CompressedGeometryData.Header
The Header class is a data container for the header information, used in conjunction with a CompressedGeometryData object. |
Constructor Summary | |
---|---|
CompressedGeometryData(CompressedGeometryData.Header hdr,
byte[] compressedGeometry)
Creates a new CompressedGeometryData object by copying the specified compressed geometry data into this object. |
|
CompressedGeometryData(CompressedGeometryData.Header hdr,
byte[] compressedGeometry,
boolean byReference)
Creates a new CompressedGeometryData object. |
|
CompressedGeometryData(CompressedGeometryData.Header hdr,
javax.media.j3d.J3DBuffer compressedGeometry)
Creates a new CompressedGeometryData object. |
Method Summary | |
---|---|
javax.media.j3d.Shape3D[] |
decompress()
Decompresses the compressed geometry. |
int |
getByteCount()
Returns the size, in bytes, of the compressed geometry buffer. |
void |
getCompressedGeometry(byte[] compressedGeometry)
Retrieves the compressed geometry associated with the CompressedGeometryData object. |
javax.media.j3d.J3DBuffer |
getCompressedGeometryBuffer()
Gets the compressed geometry data buffer reference, which is always null since NIO buffers are not supported for CompressedGeometryData objects. |
void |
getCompressedGeometryHeader(CompressedGeometryData.Header hdr)
Copies the compressed geometry header from the CompressedGeometryData object into the passed in parameter. |
byte[] |
getCompressedGeometryRef()
Gets the compressed geometry data reference. |
boolean |
isByReference()
Retrieves the data access mode for this CompressedGeometryData object. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CompressedGeometryData(CompressedGeometryData.Header hdr, byte[] compressedGeometry)
hdr
- the compressed geometry header. This is copied
into this CompressedGeometryData object.compressedGeometry
- the compressed geometry data. The
geometry must conform to the format described in Appendix B of
the Java 3D API Specification.
java.lang.IllegalArgumentException
- if a problem is detected with the
header.public CompressedGeometryData(CompressedGeometryData.Header hdr, byte[] compressedGeometry, boolean byReference)
hdr
- the compressed geometry header. This is copied
into the CompressedGeometryData object.compressedGeometry
- the compressed geometry data. The
geometry must conform to the format described in Appendix B of
the Java 3D API Specification.byReference
- a flag that indicates whether the data is copied
into this compressed geometry object or is accessed by reference.
java.lang.IllegalArgumentException
- if a problem is detected with the
header.public CompressedGeometryData(CompressedGeometryData.Header hdr, javax.media.j3d.J3DBuffer compressedGeometry)
hdr
- the compressed geometry header. This is copied
into the CompressedGeometryData object.compressedGeometry
- a buffer containing an NIO byte buffer
of compressed geometry data. The
geometry must conform to the format described in Appendix B of
the Java 3D API Specification.
java.lang.UnsupportedOperationException
- this method is not
yet implemented
java.lang.IllegalArgumentException
- if a problem is detected with the
header,
or if the java.nio.Buffer contained in the specified J3DBuffer
is not a java.nio.ByteBuffer object.CompressedGeometryData.Header
Method Detail |
---|
public int getByteCount()
public void getCompressedGeometryHeader(CompressedGeometryData.Header hdr)
hdr
- the Header object into which to copy the
CompressedGeometryData object's header; the offset field may differ
from that which was originally specified if a copy of the original
compressed geometry byte array was created.public void getCompressedGeometry(byte[] compressedGeometry)
compressedGeometry
- the array into which to copy the compressed
geometry.
java.lang.IllegalStateException
- if the data access mode for this
object is by-reference.
java.lang.ArrayIndexOutOfBoundsException
- if compressedGeometry byte
array is not large enough to receive the compressed geometrypublic javax.media.j3d.Shape3D[] decompress()
public boolean isByReference()
true
if the data access mode for this
CompressedGeometryData object is by-reference;
false
if the data access mode is by-copying.public byte[] getCompressedGeometryRef()
java.lang.IllegalStateException
- if the data access mode for this
object is not by-reference.public javax.media.j3d.J3DBuffer getCompressedGeometryBuffer()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |