public class CompressedGeometryData extends Object
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.
Modifier and Type | Class and Description |
---|---|
static class |
CompressedGeometryData.Header
The Header class is a data container for the header information,
used in conjunction with a CompressedGeometryData object.
|
Constructor and Description |
---|
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,
J3DBuffer compressedGeometry)
Creates a new CompressedGeometryData object.
|
Modifier and Type | Method and Description |
---|---|
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.
|
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.
|
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.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.IllegalArgumentException
- if a problem is detected with the
header.public CompressedGeometryData(CompressedGeometryData.Header hdr, 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.UnsupportedOperationException
- this method is not
yet implementedIllegalArgumentException
- 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
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.IllegalStateException
- if the data access mode for this
object is by-reference.ArrayIndexOutOfBoundsException
- if compressedGeometry byte
array is not large enough to receive the compressed geometrypublic 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()
IllegalStateException
- if the data access mode for this
object is not by-reference.public J3DBuffer getCompressedGeometryBuffer()
Copyright © 2016–2022 SciJava. All rights reserved.