com.sun.j3d.utils.compression
Class CompressionStream

java.lang.Object
  extended by com.sun.j3d.utils.compression.CompressionStream

Deprecated. As of Java 3D 1.5, replaced by com.sun.j3d.utils.geometry.compression.CompressionStream.

public class CompressionStream
extends java.lang.Object

This class is used as input to a geometry compressor. It collects elements such as vertices, normals, colors, mesh references, and quantization parameters in an ordered stream. This stream is then traversed during the compression process and used to build the compressed output buffer.

See Also:
GeometryCompressor

Nested Class Summary
private  class CompressionStream.ByCopyGeometry
          Deprecated. This class implements the GeometryAccessor interface for geometry arrays accessed with by-copy semantics.
private  class CompressionStream.ByRefGeometry
          Deprecated. This class implements the GeometryAccessor interface for non-interleaved geometry arrays accessed with by-reference semantics.
private  class CompressionStream.ByRefGeometryNIO
          Deprecated. This class implements the GeometryAccessor interface for non-interleaved geometry arrays accessed with NIO.
private  class CompressionStream.ColorQuant
          Deprecated. Stream element that sets color quantization during quantize pass.
private static interface CompressionStream.GeometryAccessor
          Deprecated. Interface to access GeometryArray vertex components and add them to the compression stream.
private static class CompressionStream.IndexArrays
          Deprecated. Class which holds index array references for a geometry array.
private  class CompressionStream.IndexedByCopyGeometry
          Deprecated. This class implements the GeometryAccessor interface for indexed geometry arrays accessed with by-copy semantics.
private  class CompressionStream.IndexedByRefGeometry
          Deprecated. This class implements the GeometryAccessor interface for indexed non-interleaved geometry arrays accessed with by-reference semantics.
private  class CompressionStream.IndexedByRefGeometryNIO
          Deprecated. This class implements the GeometryAccessor interface for non-interleaved indexed geometry arrays accessed with NIO.
private  class CompressionStream.IndexedInterleavedGeometryFloat
          Deprecated. This class implements the GeometryAccessor interface for indexed interleaved geometry arrays.
private  class CompressionStream.IndexedInterleavedGeometryNIO
          Deprecated. This class implements the GeometryAccessor interface for indexed interleaved NIO geometry arrays.
private  class CompressionStream.InterleavedGeometry
          Deprecated. This abstract class implements the GeometryAccessor interface for concrete subclasses which handle float and NIO interleaved geometry arrays.
private  class CompressionStream.InterleavedGeometryFloat
          Deprecated. This class implements the GeometryAccessor interface for float interleaved geometry arrays.
private  class CompressionStream.InterleavedGeometryNIO
          Deprecated. This class implements the GeometryAccessor interface for interleaved NIO geometry arrays.
private  class CompressionStream.MeshReference
          Deprecated. Stream element that references the mesh buffer.
private  class CompressionStream.NormalQuant
          Deprecated. Stream element that sets normal quantization during quantize pass.
private  class CompressionStream.PositionQuant
          Deprecated. Stream element that sets position quantization during quantize pass.
private static class CompressionStream.VertexCopy
          Deprecated.  
private static class CompressionStream.VertexIndices
          Deprecated. Class which holds indices for a specific vertex of an IndexedGeometryArray.
 
Field Summary
private static boolean benchmark
          Deprecated.  
(package private)  int byteCount
          Deprecated. The total number of bytes used to create the uncompressed geometric elements in this stream, useful for performance analysis.
(package private) static float ByteToFloatScale
          Deprecated. Byte to float scale factor for scaling byte color components.
private  Color3f c3f
          Deprecated.  
private  Color4f c4f
          Deprecated.  
(package private)  double[] center
          Deprecated. Center for normalizing positions to the unit cube.
(package private)  int colorQuant
          Deprecated. Current color component (R, G, B, A) quantization value.
(package private)  boolean colorQuantChanged
          Deprecated. Flag indicating color quantization change.
private static boolean debug
          Deprecated.  
(package private)  boolean firstColor
          Deprecated. Flag indicating the first color in this stream.
(package private)  boolean firstNormal
          Deprecated. Flag indicating the first normal in this stream.
(package private)  boolean firstPosition
          Deprecated. Flag indicating the first position in this stream.
(package private)  int[] lastColor
          Deprecated. Last quantized color.
private  boolean lastElementColor
          Deprecated.  
private  boolean lastElementNormal
          Deprecated.  
private  boolean lastLastElementColor
          Deprecated.  
private  boolean lastLastElementNormal
          Deprecated.  
(package private)  int lastOctant
          Deprecated. Last quantized normal's octant.
(package private)  int[] lastPosition
          Deprecated. Last quantized position.
(package private)  int lastSextant
          Deprecated. Last quantized normal's sextant.
(package private)  boolean lastSpecialNormal
          Deprecated. Flag indicating last normal used a special encoding.
(package private)  int lastU
          Deprecated. Last quantized normal's U encoding parameter.
(package private)  int lastV
          Deprecated. Last quantized normal's V encoding parameter.
(package private)  Point3d[] mcBounds
          Deprecated. Axes-aligned box enclosing all vertices in model coordinates.
(package private) static int MESH_PUSH
          Deprecated. This flag indicates that a vertex is to be pushed into the mesh buffer.
(package private)  MeshBuffer meshBuffer
          Deprecated. Mesh buffer mirror used for computing deltas during quantization pass and a limited meshing algorithm for unstripped data.
(package private)  int meshReferenceCount
          Deprecated. The number of mesh buffer references created for this stream.
private  Vector3f n3f
          Deprecated.  
(package private)  Point3d[] ncBounds
          Deprecated. Axes-aligned box enclosing all vertices in normalized coordinates.
(package private) static int NO_MESH_PUSH
          Deprecated. This flag indicates that a vertex does not use the mesh buffer.
private static boolean noMeshNormalSubstitution
          Deprecated.  
(package private)  int normalQuant
          Deprecated. Current normal component (U and V) quantization value.
(package private)  boolean normalQuantChanged
          Deprecated. Flag indicating normal quantization change.
private  Point3f p3f
          Deprecated.  
(package private)  int positionQuant
          Deprecated. Current position component (X, Y, and Z) quantization value.
(package private)  boolean positionQuantChanged
          Deprecated. Flag indicating position quantization change.
(package private)  double positionRangeMaximum
          Deprecated. Maximum position range along the 3 axes.
(package private)  Point3i[] qcBounds
          Deprecated. Axes-aligned box enclosing all vertices in quantized coordinates.
(package private) static int REPLACE_MIDDLE
          Deprecated. This flag indicates that the next triangle in the strip is defined by replacing the middle vertex of the previous triangle in the strip.
(package private) static int REPLACE_OLDEST
          Deprecated. This flag indicates that the next triangle in the strip is defined by replacing the oldest vertex of the previous triangle in the strip.
(package private) static int RESTART
          Deprecated. This flag indicates that a vertex starts a new triangle or line strip.
(package private)  double scale
          Deprecated. Scale for normalizing positions to the unit cube.
private  java.util.Collection stream
          Deprecated.  
(package private)  int streamType
          Deprecated. Type of this stream, either CompressedGeometryHeader.POINT_BUFFER, CompressedGeometryHeader.LINE_BUFFER, or CompressedGeometryHeader.TRIANGLE_BUFFER
(package private)  boolean vertexColor3
          Deprecated. Boolean indicating RGB colors are bundled with the vertices.
(package private)  boolean vertexColor4
          Deprecated. Boolean indicating RGBA colors are bundled with the vertices.
(package private)  boolean vertexColors
          Deprecated. Boolean indicating colors are bundled with the vertices.
(package private)  int vertexComponents
          Deprecated. A mask indicating which components are present in each vertex, as defined by GeometryArray.
(package private)  int vertexCount
          Deprecated. The number of vertices created for this stream, excluding mesh buffer references.
(package private)  boolean vertexNormals
          Deprecated. Boolean indicating normals are bundled with the vertices.
(package private)  boolean vertexTexture2
          Deprecated. Boolean indicating that 2D texture coordinates are used.
(package private)  boolean vertexTexture3
          Deprecated. Boolean indicating that 3D texture coordinates are used.
(package private)  boolean vertexTexture4
          Deprecated. Boolean indicating that 4D texture coordinates are used.
(package private)  boolean vertexTextures
          Deprecated. Boolean indicating texture coordinates are present.
 
Constructor Summary
private CompressionStream()
          Deprecated.  
  CompressionStream(GeometryInfo[] geometry)
          Deprecated. Creates a CompressionStream from an array of GeometryInfo objects.
(package private) CompressionStream(int streamType, int vertexComponents)
          Deprecated. Creates a new CompressionStream for the specified geometry type and vertex format.
  CompressionStream(int positionQuant, int colorQuant, int normalQuant, GeometryInfo[] geometry)
          Deprecated. Creates a CompressionStream from an array of GeometryInfo objects.
  CompressionStream(int positionQuant, int colorQuant, int normalQuant, Shape3D[] shapes)
          Deprecated. Creates a CompressionStream from an array of Shape3D scene graph objects.
  CompressionStream(Shape3D[] shapes)
          Deprecated. Creates a CompressionStream from an array of Shape3D scene graph objects.
 
Method Summary
(package private)  void addColor(Color3f c3f)
          Deprecated. Copy the given color to the end of this stream and use it as a global state change that applies to all subsequent vertices.
(package private)  void addColor(Color4f c4f)
          Deprecated. Copy the given color to the end of this stream and use it as a global state change that applies to all subsequent vertices.
(package private)  void addColorQuantization(int value)
          Deprecated. Add a new color quantization value to the end of this stream that will apply to all subsequent colors.
(package private)  void addGeometryArray(GeometryArray ga)
          Deprecated. Convert a GeometryArray to compression stream elements and add them to this stream.
(package private)  void addMeshReference(int stripFlag, int meshIndex)
          Deprecated. Add a mesh buffer reference to this stream.
(package private)  void addNormal(Vector3f n)
          Deprecated. Copy the given normal to the end of this stream and use it as a global state change that applies to all subsequent vertices.
(package private)  void addNormalQuantization(int value)
          Deprecated. Add a new normal quantization value to the end of this stream that will apply to all subsequent normals.
(package private)  void addPositionQuantization(int value)
          Deprecated. Add a new position quantization value to the end of this stream that will apply to all subsequent vertex positions.
(package private)  void addVertex(Point3f pos, Color3f color, int stripFlag)
          Deprecated. Copy vertex data and add it to the end of this stream.
(package private)  void addVertex(Point3f pos, Color3f color, int stripFlag, int meshFlag)
          Deprecated. Copy vertex data and add it to the end of this stream.
(package private)  void addVertex(Point3f pos, Color4f color, int stripFlag)
          Deprecated. Copy vertex data and add it to the end of this stream.
(package private)  void addVertex(Point3f pos, Color4f color, int stripFlag, int meshFlag)
          Deprecated. Copy vertex data and add it to the end of this stream.
(package private)  void addVertex(Point3f pos, int stripFlag)
          Deprecated. Copy vertex data and add it to the end of this stream.
(package private)  void addVertex(Point3f pos, int stripFlag, int meshFlag)
          Deprecated. Copy vertex data and add it to the end of this stream.
(package private)  void addVertex(Point3f pos, Vector3f norm, Color3f color, int stripFlag)
          Deprecated. Copy vertex data and add it to the end of this stream.
(package private)  void addVertex(Point3f pos, Vector3f norm, Color3f color, int stripFlag, int meshFlag)
          Deprecated. Copy vertex data and add it to the end of this stream.
(package private)  void addVertex(Point3f pos, Vector3f norm, Color4f color, int stripFlag)
          Deprecated. Copy vertex data and add it to the end of this stream.
(package private)  void addVertex(Point3f pos, Vector3f norm, Color4f color, int stripFlag, int meshFlag)
          Deprecated. Copy vertex data and add it to the end of this stream.
(package private)  void addVertex(Point3f pos, Vector3f norm, int stripFlag)
          Deprecated. Copy vertex data and add it to the end of this stream.
(package private)  void addVertex(Point3f pos, Vector3f norm, int stripFlag, int meshFlag)
          Deprecated. Copy vertex data and add it to the end of this stream.
(package private)  void addVertex(Point3f pos, Vector3f norm, java.lang.Object color, int stripFlag, int meshFlag)
          Deprecated. Copy vertex data and add it to the end of this stream.
(package private)  int getByteCount()
          Deprecated. Retrieve the total size of the uncompressed geometric data in bytes, excluding mesh buffer references.
private  void getIndexArrays(GeometryArray ga, CompressionStream.IndexArrays ia)
          Deprecated. Retrieves index array references for the specified IndexedGeometryArray.
(package private)  int getMeshReferenceCount()
          Deprecated. Retrieve the number of mesh buffer references created for this stream.
 Point3d[] getModelBounds()
          Deprecated. Get the original bounds of the coordinate data, in modeling coordinates.
 Point3d[] getNormalizedBounds()
          Deprecated. Get the bounds of the compressed object in normalized coordinates.
private  int getStreamType(GeometryArray ga)
          Deprecated.  
private  int getVertexComponents(int vertexFormat)
          Deprecated.  
(package private)  int getVertexCount()
          Deprecated. Retrieve the the number of vertices created for this stream, excluding mesh buffer references.
private  void getVertexIndices(int v, CompressionStream.IndexArrays ia, CompressionStream.VertexIndices vi)
          Deprecated. Retrieves vertex indices for a specific vertex in an IndexedGeometryArray.
(package private)  void outputCommands(HuffmanTable huffmanTable, CommandStream outputBuffer)
          Deprecated. Iterates across all compression stream elements and builds the compressed geometry command stream output.
(package private)  void print()
          Deprecated. Print the stream to standard output.
private  void processIndexedVertexCopy(CompressionStream.VertexCopy vc, CompressionStream.VertexIndices vi, int stripFlag)
          Deprecated.  
private  void processVertexCopy(CompressionStream.VertexCopy vc, int stripFlag)
          Deprecated.  
(package private)  void quantize(HuffmanTable huffmanTable)
          Deprecated. Iterates across all compression stream elements and applies quantization parameters, encoding consecutive vertices as delta values whenever possible.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debug

private static final boolean debug
Deprecated. 
See Also:
Constant Field Values

benchmark

private static final boolean benchmark
Deprecated. 
See Also:
Constant Field Values

noMeshNormalSubstitution

private static final boolean noMeshNormalSubstitution
Deprecated. 
See Also:
Constant Field Values

RESTART

static final int RESTART
Deprecated. 
This flag indicates that a vertex starts a new triangle or line strip.

See Also:
Constant Field Values

REPLACE_MIDDLE

static final int REPLACE_MIDDLE
Deprecated. 
This flag indicates that the next triangle in the strip is defined by replacing the middle vertex of the previous triangle in the strip. Equivalent to REPLACE_OLDEST for line strips.

See Also:
Constant Field Values

REPLACE_OLDEST

static final int REPLACE_OLDEST
Deprecated. 
This flag indicates that the next triangle in the strip is defined by replacing the oldest vertex of the previous triangle in the strip. Equivalent to REPLACE_MIDDLE for line strips.

See Also:
Constant Field Values

MESH_PUSH

static final int MESH_PUSH
Deprecated. 
This flag indicates that a vertex is to be pushed into the mesh buffer.

See Also:
Constant Field Values

NO_MESH_PUSH

static final int NO_MESH_PUSH
Deprecated. 
This flag indicates that a vertex does not use the mesh buffer.

See Also:
Constant Field Values

ByteToFloatScale

static final float ByteToFloatScale
Deprecated. 
Byte to float scale factor for scaling byte color components.

See Also:
Constant Field Values

streamType

int streamType
Deprecated. 
Type of this stream, either CompressedGeometryHeader.POINT_BUFFER, CompressedGeometryHeader.LINE_BUFFER, or CompressedGeometryHeader.TRIANGLE_BUFFER


vertexComponents

int vertexComponents
Deprecated. 
A mask indicating which components are present in each vertex, as defined by GeometryArray.


vertexColors

boolean vertexColors
Deprecated. 
Boolean indicating colors are bundled with the vertices.


vertexColor3

boolean vertexColor3
Deprecated. 
Boolean indicating RGB colors are bundled with the vertices.


vertexColor4

boolean vertexColor4
Deprecated. 
Boolean indicating RGBA colors are bundled with the vertices.


vertexNormals

boolean vertexNormals
Deprecated. 
Boolean indicating normals are bundled with the vertices.


vertexTextures

boolean vertexTextures
Deprecated. 
Boolean indicating texture coordinates are present.


vertexTexture2

boolean vertexTexture2
Deprecated. 
Boolean indicating that 2D texture coordinates are used. Currently only used to skip over textures in interleaved data.


vertexTexture3

boolean vertexTexture3
Deprecated. 
Boolean indicating that 3D texture coordinates are used. Currently only used to skip over textures in interleaved data.


vertexTexture4

boolean vertexTexture4
Deprecated. 
Boolean indicating that 4D texture coordinates are used. Currently only used to skip over textures in interleaved data.


mcBounds

Point3d[] mcBounds
Deprecated. 
Axes-aligned box enclosing all vertices in model coordinates.


ncBounds

Point3d[] ncBounds
Deprecated. 
Axes-aligned box enclosing all vertices in normalized coordinates.


qcBounds

Point3i[] qcBounds
Deprecated. 
Axes-aligned box enclosing all vertices in quantized coordinates.


center

double[] center
Deprecated. 
Center for normalizing positions to the unit cube.


positionRangeMaximum

double positionRangeMaximum
Deprecated. 
Maximum position range along the 3 axes.


scale

double scale
Deprecated. 
Scale for normalizing positions to the unit cube.


positionQuant

int positionQuant
Deprecated. 
Current position component (X, Y, and Z) quantization value. This can range from 1 to 16 bits and has a default of 16.

At 1 bit of quantization it is not possible to express positive absolute or delta positions.


colorQuant

int colorQuant
Deprecated. 
Current color component (R, G, B, A) quantization value. This can range from 2 to 16 bits and has a default of 9.

A color component is represented with a signed fixed-point value in order to be able express negative deltas; the default of 9 bits corresponds to the 8-bit color component range of the graphics hardware commonly available. Colors must be non-negative, so the lower limit of quantization is 2 bits.


normalQuant

int normalQuant
Deprecated. 
Current normal component (U and V) quantization value. This can range from 0 to 6 bits and has a default of 6.

At 0 bits of quantization normals are represented only as 6 bit sextant/octant pairs and 14 specially encoded normals (the 6 axis normals and the 8 octant midpoint normals); since U and V can only be 0 at the minimum quantization, the totally number of unique normals is 12 + 14 = 26.


positionQuantChanged

boolean positionQuantChanged
Deprecated. 
Flag indicating position quantization change.


colorQuantChanged

boolean colorQuantChanged
Deprecated. 
Flag indicating color quantization change.


normalQuantChanged

boolean normalQuantChanged
Deprecated. 
Flag indicating normal quantization change.


lastPosition

int[] lastPosition
Deprecated. 
Last quantized position.


lastColor

int[] lastColor
Deprecated. 
Last quantized color.


lastSextant

int lastSextant
Deprecated. 
Last quantized normal's sextant.


lastOctant

int lastOctant
Deprecated. 
Last quantized normal's octant.


lastU

int lastU
Deprecated. 
Last quantized normal's U encoding parameter.


lastV

int lastV
Deprecated. 
Last quantized normal's V encoding parameter.


lastSpecialNormal

boolean lastSpecialNormal
Deprecated. 
Flag indicating last normal used a special encoding.


firstPosition

boolean firstPosition
Deprecated. 
Flag indicating the first position in this stream.


firstColor

boolean firstColor
Deprecated. 
Flag indicating the first color in this stream.


firstNormal

boolean firstNormal
Deprecated. 
Flag indicating the first normal in this stream.


byteCount

int byteCount
Deprecated. 
The total number of bytes used to create the uncompressed geometric elements in this stream, useful for performance analysis. This excludes mesh buffer references.


vertexCount

int vertexCount
Deprecated. 
The number of vertices created for this stream, excluding mesh buffer references.


meshReferenceCount

int meshReferenceCount
Deprecated. 
The number of mesh buffer references created for this stream.


meshBuffer

MeshBuffer meshBuffer
Deprecated. 
Mesh buffer mirror used for computing deltas during quantization pass and a limited meshing algorithm for unstripped data.


stream

private java.util.Collection stream
Deprecated. 

lastElementColor

private boolean lastElementColor
Deprecated. 

lastLastElementColor

private boolean lastLastElementColor
Deprecated. 

lastElementNormal

private boolean lastElementNormal
Deprecated. 

lastLastElementNormal

private boolean lastLastElementNormal
Deprecated. 

p3f

private Point3f p3f
Deprecated. 

c3f

private Color3f c3f
Deprecated. 

c4f

private Color4f c4f
Deprecated. 

n3f

private Vector3f n3f
Deprecated. 
Constructor Detail

CompressionStream

private CompressionStream()
Deprecated. 

CompressionStream

CompressionStream(int streamType,
                  int vertexComponents)
Deprecated. 
Creates a new CompressionStream for the specified geometry type and vertex format.

Parameters:
streamType - type of data in this stream, either CompressedGeometryHeader.POINT_BUFFER, CompressedGeometryHeader.LINE_BUFFER, or CompressedGeometryHeader.TRIANGLE_BUFFER
vertexComponents - a mask indicating which components are present in each vertex, as defined by GeometryArray: COORDINATES, NORMALS, and COLOR_3 or COLOR_4.
See Also:
GeometryCompressor, GeometryArray

CompressionStream

public CompressionStream(int positionQuant,
                         int colorQuant,
                         int normalQuant,
                         Shape3D[] shapes)
Deprecated. 
Creates a CompressionStream from an array of Shape3D scene graph objects. These Shape3D objects may only consist of a GeometryArray component and an optional Appearance component. The resulting stream may be used as input to the GeometryCompressor methods.

Each Shape3D in the array must be of the same dimensionality (point, line, or surface) and have the same vertex format as the others. Texture coordinates are ignored.

If a color is specified in the material attributes for a Shape3D then that color is added to the CompressionStream as the current global color. Subsequent colors as well as any colors bundled with vertices will override it. Only the material diffuse colors are used; all other appearance attributes are ignored.

Parameters:
positionQuant - number of bits to quantize each position's X, Y, and Z components, ranging from 1 to 16
colorQuant - number of bits to quantize each color's R, G, B, and alpha components, ranging from 2 to 16
normalQuant - number of bits for quantizing each normal's U and V components, ranging from 0 to 6
shapes - an array of Shape3D scene graph objects containing GeometryArray objects, all with the same vertex format and dimensionality
Throws:
java.lang.IllegalArgumentException - if any Shape3D has an inconsistent dimensionality or vertex format, or if any Shape3D contains a geometry component that is not a GeometryArray
See Also:
Shape3D, GeometryArray, GeometryCompressor

CompressionStream

public CompressionStream(Shape3D[] shapes)
Deprecated. 
Creates a CompressionStream from an array of Shape3D scene graph objects. These Shape3D objects may only consist of a GeometryArray component and an optional Appearance component. The resulting stream may be used as input to the GeometryCompressor methods.

Each Shape3D in the array must be of the same dimensionality (point, line, or surface) and have the same vertex format as the others. Texture coordinates are ignored.

If a color is specified in the material attributes for a Shape3D then that color is added to the CompressionStream as the current global color. Subsequent colors as well as any colors bundled with vertices will override it. Only the material diffuse colors are used; all other appearance attributes are ignored.

Defaults of 16, 9, and 6 bits are used as the quantization values for positions, colors, and normals respectively. These are the maximum resolution values defined for positions and normals; the default of 9 for color is the equivalent of the 8 bits of RGBA component resolution commonly available in graphics frame buffers.

Parameters:
shapes - an array of Shape3D scene graph objects containing GeometryArray objects, all with the same vertex format and dimensionality.
Throws:
java.lang.IllegalArgumentException - if any Shape3D has an inconsistent dimensionality or vertex format, or if any Shape3D contains a geometry component that is not a GeometryArray
See Also:
Shape3D, GeometryArray, GeometryCompressor

CompressionStream

public CompressionStream(int positionQuant,
                         int colorQuant,
                         int normalQuant,
                         GeometryInfo[] geometry)
Deprecated. 
Creates a CompressionStream from an array of GeometryInfo objects. The resulting stream may be used as input to the GeometryCompressor methods.

Each GeometryInfo in the array must be of the same dimensionality (point, line, or surface) and have the same vertex format as the others. Texture coordinates are ignored.

Parameters:
positionQuant - number of bits to quantize each position's X, Y, and Z components, ranging from 1 to 16
colorQuant - number of bits to quantize each color's R, G, B, and alpha components, ranging from 2 to 16
normalQuant - number of bits for quantizing each normal's U and V components, ranging from 0 to 6
geometry - an array of GeometryInfo objects, all with the same vertex format and dimensionality
Throws:
java.lang.IllegalArgumentException - if any GeometryInfo object has an inconsistent dimensionality or vertex format
See Also:
GeometryInfo, GeometryCompressor

CompressionStream

public CompressionStream(GeometryInfo[] geometry)
Deprecated. 
Creates a CompressionStream from an array of GeometryInfo objects. The resulting stream may be used as input to the GeometryCompressor methods.

Each GeometryInfo in the array must be of the same dimensionality (point, line, or surface) and have the same vertex format as the others. Texture coordinates are ignored.

Defaults of 16, 9, and 6 bits are used as the quantization values for positions, colors, and normals respectively. These are the maximum resolution values defined for positions and normals; the default of 9 for color is the equivalent of the 8 bits of RGBA component resolution commonly available in graphics frame buffers.

Parameters:
geometry - an array of GeometryInfo objects, all with the same vertex format and dimensionality
Throws:
java.lang.IllegalArgumentException - if any GeometryInfo object has an inconsistent dimensionality or vertex format
See Also:
GeometryInfo, GeometryCompressor
Method Detail

getVertexComponents

private int getVertexComponents(int vertexFormat)
Deprecated. 

getStreamType

private int getStreamType(GeometryArray ga)
Deprecated. 

quantize

void quantize(HuffmanTable huffmanTable)
Deprecated. 
Iterates across all compression stream elements and applies quantization parameters, encoding consecutive vertices as delta values whenever possible. Each geometric element is mapped to a HuffmanNode object containing its resulting bit length, right shift (trailing 0 count), and absolute or relative status.

Positions are normalized to span a unit cube via an offset and a uniform scale factor that maps the midpoint of the object extents along each dimension to the origin, and the longest dimension of the object to the open interval (-1.0 .. +1.0). The geometric endpoints along that dimension are both one quantum away from unity; for example, at a position quantization of 6 bits, an object would be normalized so that its most negative dimension is at (-1 + 1/64) and the most positive is at (1 - 1/64).

Normals are assumed to be of unit length. Color components are clamped to the [0..1) range, where the right endpoint is one quantum less than 1.0.

Parameters:
huffmanTable - Table which will map geometric compression stream elements to HuffmanNode objects describing each element's data representation. This table can then be processed with Huffman's algorithm to optimize the bit length of descriptor tags according to the number of geometric elements mapped to each tag.

outputCommands

void outputCommands(HuffmanTable huffmanTable,
                    CommandStream outputBuffer)
Deprecated. 
Iterates across all compression stream elements and builds the compressed geometry command stream output.

Parameters:
huffmanTable - Table which maps geometric elements in this stream to tags describing the encoding parameters (length, shift, and absolute/relative status) to be used for their representations in the compressed output. All tags must be 6 bits or less in length, and the sum of the number of bits in the tag plus the number of bits in the data it describes must be at least 6 bits in length.
outputBuffer - CommandStream to use for collecting the compressed bits.

getByteCount

int getByteCount()
Deprecated. 
Retrieve the total size of the uncompressed geometric data in bytes, excluding mesh buffer references.

Returns:
uncompressed byte count

getVertexCount

int getVertexCount()
Deprecated. 
Retrieve the the number of vertices created for this stream, excluding mesh buffer references.

Returns:
vertex count

getMeshReferenceCount

int getMeshReferenceCount()
Deprecated. 
Retrieve the number of mesh buffer references created for this stream.

Returns:
mesh buffer reference count

addVertex

void addVertex(Point3f pos,
               int stripFlag)
Deprecated. 
Copy vertex data and add it to the end of this stream.

Parameters:
pos - position data
stripFlag - vertex replacement flag, either RESTART, REPLACE_OLDEST, or REPLACE_MIDDLE

addVertex

void addVertex(Point3f pos,
               Vector3f norm,
               int stripFlag)
Deprecated. 
Copy vertex data and add it to the end of this stream.

Parameters:
pos - position data
norm - normal data
stripFlag - vertex replacement flag, either RESTART, REPLACE_OLDEST, or REPLACE_MIDDLE

addVertex

void addVertex(Point3f pos,
               Color3f color,
               int stripFlag)
Deprecated. 
Copy vertex data and add it to the end of this stream.

Parameters:
pos - position data
color - color data
stripFlag - vertex replacement flag, either RESTART, REPLACE_OLDEST, or REPLACE_MIDDLE

addVertex

void addVertex(Point3f pos,
               Color4f color,
               int stripFlag)
Deprecated. 
Copy vertex data and add it to the end of this stream.

Parameters:
pos - position data
color - color data
stripFlag - vertex replacement flag, either RESTART, REPLACE_OLDEST, or REPLACE_MIDDLE

addVertex

void addVertex(Point3f pos,
               Vector3f norm,
               Color3f color,
               int stripFlag)
Deprecated. 
Copy vertex data and add it to the end of this stream.

Parameters:
pos - position data
norm - normal data
color - color data
stripFlag - vertex replacement flag, either RESTART, REPLACE_OLDEST, or REPLACE_MIDDLE

addVertex

void addVertex(Point3f pos,
               Vector3f norm,
               Color4f color,
               int stripFlag)
Deprecated. 
Copy vertex data and add it to the end of this stream.

Parameters:
pos - position data
norm - normal data
color - color data
stripFlag - vertex replacement flag, either RESTART, REPLACE_OLDEST, or REPLACE_MIDDLE

addVertex

void addVertex(Point3f pos,
               int stripFlag,
               int meshFlag)
Deprecated. 
Copy vertex data and add it to the end of this stream.

Parameters:
pos - position data
stripFlag - vertex replacement flag, either RESTART, REPLACE_OLDEST, or REPLACE_MIDDLE
meshFlag - if MESH_PUSH the vertex is pushed into the mesh buffer

addVertex

void addVertex(Point3f pos,
               Vector3f norm,
               int stripFlag,
               int meshFlag)
Deprecated. 
Copy vertex data and add it to the end of this stream.

Parameters:
pos - position data
norm - normal data
stripFlag - vertex replacement flag, either RESTART, REPLACE_OLDEST, or REPLACE_MIDDLE
meshFlag - if MESH_PUSH the vertex is pushed into the mesh buffer

addVertex

void addVertex(Point3f pos,
               Color3f color,
               int stripFlag,
               int meshFlag)
Deprecated. 
Copy vertex data and add it to the end of this stream.

Parameters:
pos - position data
color - color data
stripFlag - vertex replacement flag, either RESTART, REPLACE_OLDEST, or REPLACE_MIDDLE
meshFlag - if MESH_PUSH the vertex is pushed into the mesh buffer

addVertex

void addVertex(Point3f pos,
               Color4f color,
               int stripFlag,
               int meshFlag)
Deprecated. 
Copy vertex data and add it to the end of this stream.

Parameters:
pos - position data
color - color data
stripFlag - vertex replacement flag, either RESTART, REPLACE_OLDEST, or REPLACE_MIDDLE
meshFlag - if MESH_PUSH the vertex is pushed into the mesh buffer

addVertex

void addVertex(Point3f pos,
               Vector3f norm,
               Color3f color,
               int stripFlag,
               int meshFlag)
Deprecated. 
Copy vertex data and add it to the end of this stream.

Parameters:
pos - position data
norm - normal data
color - color data
stripFlag - vertex replacement flag, either RESTART, REPLACE_OLDEST, or REPLACE_MIDDLE
meshFlag - if MESH_PUSH the vertex is pushed into the mesh buffer

addVertex

void addVertex(Point3f pos,
               Vector3f norm,
               Color4f color,
               int stripFlag,
               int meshFlag)
Deprecated. 
Copy vertex data and add it to the end of this stream.

Parameters:
pos - position data
norm - normal data
color - color data
stripFlag - vertex replacement flag, either RESTART, REPLACE_OLDEST, or REPLACE_MIDDLE
meshFlag - if MESH_PUSH the vertex is pushed into the mesh buffer

addVertex

void addVertex(Point3f pos,
               Vector3f norm,
               java.lang.Object color,
               int stripFlag,
               int meshFlag)
Deprecated. 
Copy vertex data and add it to the end of this stream.

Parameters:
pos - position data
norm - normal data
color - color data, either Color3f or Color4f, determined by current vertex format
stripFlag - vertex replacement flag, either RESTART, REPLACE_OLDEST, or REPLACE_MIDDLE
meshFlag - if MESH_PUSH the vertex is pushed into the mesh buffer

addMeshReference

void addMeshReference(int stripFlag,
                      int meshIndex)
Deprecated. 
Add a mesh buffer reference to this stream.

Parameters:
stripFlag - vertex replacement flag, either RESTART, REPLACE_OLDEST, or REPLACE_MIDDLE
meshIndex - index of vertex to retrieve from the mesh buffer

addColor

void addColor(Color3f c3f)
Deprecated. 
Copy the given color to the end of this stream and use it as a global state change that applies to all subsequent vertices.


addColor

void addColor(Color4f c4f)
Deprecated. 
Copy the given color to the end of this stream and use it as a global state change that applies to all subsequent vertices.


addNormal

void addNormal(Vector3f n)
Deprecated. 
Copy the given normal to the end of this stream and use it as a global state change that applies to all subsequent vertices.


addPositionQuantization

void addPositionQuantization(int value)
Deprecated. 
Add a new position quantization value to the end of this stream that will apply to all subsequent vertex positions.

Parameters:
value - number of bits to quantize each position's X, Y, and Z components, ranging from 1 to 16 with a default of 16

addColorQuantization

void addColorQuantization(int value)
Deprecated. 
Add a new color quantization value to the end of this stream that will apply to all subsequent colors.

Parameters:
value - number of bits to quantize each color's R, G, B, and alpha components, ranging from 2 to 16 with a default of 9

addNormalQuantization

void addNormalQuantization(int value)
Deprecated. 
Add a new normal quantization value to the end of this stream that will apply to all subsequent normals. This value specifies the number of bits for each normal's U and V components.

Parameters:
value - number of bits for quantizing U and V, ranging from 0 to 6 with a default of 6

getIndexArrays

private void getIndexArrays(GeometryArray ga,
                            CompressionStream.IndexArrays ia)
Deprecated. 
Retrieves index array references for the specified IndexedGeometryArray. Index arrays are copied starting from initialIndexIndex.


getVertexIndices

private void getVertexIndices(int v,
                              CompressionStream.IndexArrays ia,
                              CompressionStream.VertexIndices vi)
Deprecated. 
Retrieves vertex indices for a specific vertex in an IndexedGeometryArray.


processVertexCopy

private void processVertexCopy(CompressionStream.VertexCopy vc,
                               int stripFlag)
Deprecated. 

processIndexedVertexCopy

private void processIndexedVertexCopy(CompressionStream.VertexCopy vc,
                                      CompressionStream.VertexIndices vi,
                                      int stripFlag)
Deprecated. 

addGeometryArray

void addGeometryArray(GeometryArray ga)
Deprecated. 
Convert a GeometryArray to compression stream elements and add them to this stream.

Parameters:
ga - GeometryArray to convert
Throws:
java.lang.IllegalArgumentException - if GeometryArray has a dimensionality or vertex format inconsistent with the CompressionStream

print

void print()
Deprecated. 
Print the stream to standard output.


getModelBounds

public Point3d[] getModelBounds()
Deprecated. 
Get the original bounds of the coordinate data, in modeling coordinates. Coordinate data is positioned and scaled to a normalized cube after compression.

Returns:
Point3d array of length 2, where the 1st Point3d is the lower bounds and the 2nd Point3d is the upper bounds.
Since:
Java 3D 1.3

getNormalizedBounds

public Point3d[] getNormalizedBounds()
Deprecated. 
Get the bounds of the compressed object in normalized coordinates. These have an maximum bounds by [-1.0 .. +1.0] across each axis.

Returns:
Point3d array of length 2, where the 1st Point3d is the lower bounds and the 2nd Point3d is the upper bounds.
Since:
Java 3D 1.3


Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.