| java.lang.Object com.sun.j3d.utils.geometry.compression.CompressionStream
CompressionStream | public class CompressionStream (Code) | | 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 since: Java 3D 1.5 |
Field Summary | |
final static float | ByteToFloatScale Byte to float scale factor for scaling byte color components. | final static int | MESH_PUSH This flag indicates that a vertex is to be pushed into the mesh buffer. | final static int | NO_MESH_PUSH This flag indicates that a vertex does not use the mesh buffer. | final static int | REPLACE_MIDDLE This flag indicates that the next triangle in the strip is defined by
replacing the middle vertex of the previous triangle in the strip. | final static int | REPLACE_OLDEST This flag indicates that the next triangle in the strip is defined by
replacing the oldest vertex of the previous triangle in the strip. | final static int | RESTART This flag indicates that a vertex starts a new triangle or line strip. | int | byteCount The total number of bytes used to create the uncompressed geometric
elements in this stream, useful for performance analysis. | double | center Center for normalizing positions to the unit cube. | int | colorQuant Current color component (R, G, B, A) quantization value. | boolean | colorQuantChanged Flag indicating color quantization change. | boolean | firstColor Flag indicating the first color in this stream. | boolean | firstNormal Flag indicating the first normal in this stream. | boolean | firstPosition Flag indicating the first position in this stream. | int | lastColor Last quantized color. | int | lastOctant Last quantized normal's octant. | int | lastPosition Last quantized position. | int | lastSextant Last quantized normal's sextant. | boolean | lastSpecialNormal Flag indicating last normal used a special encoding. | int | lastU Last quantized normal's U encoding parameter. | int | lastV Last quantized normal's V encoding parameter. | Point3d | mcBounds Axes-aligned box enclosing all vertices in model coordinates. | MeshBuffer | meshBuffer Mesh buffer mirror used for computing deltas during quantization pass
and a limited meshing algorithm for unstripped data. | int | meshReferenceCount The number of mesh buffer references created for this stream. | Point3d | ncBounds Axes-aligned box enclosing all vertices in normalized coordinates. | int | normalQuant Current normal component (U and V) quantization value. | boolean | normalQuantChanged Flag indicating normal quantization change. | int | positionQuant Current position component (X, Y, and Z) quantization value. | boolean | positionQuantChanged Flag indicating position quantization change. | double | positionRangeMaximum Maximum position range along the 3 axes. | Point3i | qcBounds Axes-aligned box enclosing all vertices in quantized coordinates. | double | scale Scale for normalizing positions to the unit cube. | int | streamType | boolean | vertexColor3 Boolean indicating RGB colors are bundled with the vertices. | boolean | vertexColor4 Boolean indicating RGBA colors are bundled with the vertices. | boolean | vertexColors Boolean indicating colors are bundled with the vertices. | int | vertexComponents A mask indicating which components are present in each vertex, as
defined by GeometryArray. | int | vertexCount The number of vertices created for this stream, excluding mesh buffer
references. | boolean | vertexNormals Boolean indicating normals are bundled with the vertices. | boolean | vertexTexture2 Boolean indicating that 2D texture coordinates are used. | boolean | vertexTexture3 Boolean indicating that 3D texture coordinates are used. | boolean | vertexTexture4 Boolean indicating that 4D texture coordinates are used. | boolean | vertexTextures Boolean indicating texture coordinates are present. |
Constructor Summary | |
| CompressionStream(int streamType, int vertexComponents) | public | CompressionStream(int positionQuant, int colorQuant, int normalQuant, Shape3D shapes) Creates a CompressionStream from an array of Shape3D scene graph
objects. | public | CompressionStream(Shape3D shapes) Creates a CompressionStream from an array of Shape3D scene graph
objects. | public | CompressionStream(int positionQuant, int colorQuant, int normalQuant, GeometryInfo geometry) Creates a CompressionStream from an array of GeometryInfo objects. | public | CompressionStream(GeometryInfo geometry) Creates a CompressionStream from an array of GeometryInfo objects. |
Method Summary | |
void | addColor(Color3f c3f) Copy the given color to the end of this stream and use it as a global
state change that applies to all subsequent vertices. | void | addColor(Color4f c4f) Copy the given color to the end of this stream and use it as a global
state change that applies to all subsequent vertices. | void | addColorQuantization(int value) Add a new color quantization value to the end of this stream that will
apply to all subsequent colors. | void | addGeometryArray(GeometryArray ga) Convert a GeometryArray to compression stream elements and add them to
this stream. | void | addMeshReference(int stripFlag, int meshIndex) Add a mesh buffer reference to this stream. | void | addNormal(Vector3f n) Copy the given normal to the end of this stream and use it as a global
state change that applies to all subsequent vertices. | void | addNormalQuantization(int value) Add a new normal quantization value to the end of this stream that will
apply to all subsequent normals. | void | addPositionQuantization(int value) Add a new position quantization value to the end of this stream that
will apply to all subsequent vertex positions. | void | addVertex(Point3f pos, int stripFlag) Copy vertex data and add it to the end of this stream. | void | addVertex(Point3f pos, Vector3f norm, int stripFlag) Copy vertex data and add it to the end of this stream. | void | addVertex(Point3f pos, Color3f color, int stripFlag) Copy vertex data and add it to the end of this stream. | void | addVertex(Point3f pos, Color4f color, int stripFlag) Copy vertex data and add it to the end of this stream. | void | addVertex(Point3f pos, Vector3f norm, Color3f color, int stripFlag) Copy vertex data and add it to the end of this stream. | void | addVertex(Point3f pos, Vector3f norm, Color4f color, int stripFlag) Copy vertex data and add it to the end of this stream. | void | addVertex(Point3f pos, int stripFlag, int meshFlag) Copy vertex data and add it to the end of this stream. | void | addVertex(Point3f pos, Vector3f norm, int stripFlag, int meshFlag) Copy vertex data and add it to the end of this stream. | void | addVertex(Point3f pos, Color3f color, int stripFlag, int meshFlag) Copy vertex data and add it to the end of this stream. | void | addVertex(Point3f pos, Color4f color, int stripFlag, int meshFlag) Copy vertex data and add it to the end of this stream. | void | addVertex(Point3f pos, Vector3f norm, Color3f color, int stripFlag, int meshFlag) Copy vertex data and add it to the end of this stream. | void | addVertex(Point3f pos, Vector3f norm, Color4f color, int stripFlag, int meshFlag) Copy vertex data and add it to the end of this stream. | void | addVertex(Point3f pos, Vector3f norm, Object color, int stripFlag, int meshFlag) Copy vertex data and add it to the end of this stream. | int | getByteCount() Retrieve the total size of the uncompressed geometric data in bytes,
excluding mesh buffer references. | int | getMeshReferenceCount() Retrieve the number of mesh buffer references created for this stream. | public Point3d[] | getModelBounds() Get the original bounds of the coordinate data, in modeling coordinates.
Coordinate data is positioned and scaled to a normalized cube after
compression. | public Point3d[] | getNormalizedBounds() Get the bounds of the compressed object in normalized coordinates.
These have an maximum bounds by [-1.0 .. | int | getVertexCount() Retrieve the the number of vertices created for this stream, excluding
mesh buffer references. | void | outputCommands(HuffmanTable huffmanTable, CommandStream outputBuffer) Iterates across all compression stream elements and builds the
compressed geometry command stream output.
Parameters: huffmanTable - Table which maps geometric elements in this streamto tags describing the encoding parameters (length, shift, andabsolute/relative status) to be used for their representations in thecompressed output. | void | print() Print the stream to standard output. | void | quantize(HuffmanTable huffmanTable) Iterates across all compression stream elements and applies
quantization parameters, encoding consecutive vertices as delta values
whenever possible. |
ByteToFloatScale | final static float ByteToFloatScale(Code) | | Byte to float scale factor for scaling byte color components.
|
MESH_PUSH | final static int MESH_PUSH(Code) | | This flag indicates that a vertex is to be pushed into the mesh buffer.
|
NO_MESH_PUSH | final static int NO_MESH_PUSH(Code) | | This flag indicates that a vertex does not use the mesh buffer.
|
REPLACE_MIDDLE | final static int REPLACE_MIDDLE(Code) | | 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.
|
REPLACE_OLDEST | final static int REPLACE_OLDEST(Code) | | 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.
|
RESTART | final static int RESTART(Code) | | This flag indicates that a vertex starts a new triangle or line strip.
|
byteCount | int byteCount(Code) | | The total number of bytes used to create the uncompressed geometric
elements in this stream, useful for performance analysis. This
excludes mesh buffer references.
|
center | double center(Code) | | Center for normalizing positions to the unit cube.
|
colorQuant | int colorQuant(Code) | | 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.
|
colorQuantChanged | boolean colorQuantChanged(Code) | | Flag indicating color quantization change.
|
firstColor | boolean firstColor(Code) | | Flag indicating the first color in this stream.
|
firstNormal | boolean firstNormal(Code) | | Flag indicating the first normal in this stream.
|
firstPosition | boolean firstPosition(Code) | | Flag indicating the first position in this stream.
|
lastColor | int lastColor(Code) | | Last quantized color.
|
lastOctant | int lastOctant(Code) | | Last quantized normal's octant.
|
lastPosition | int lastPosition(Code) | | Last quantized position.
|
lastSextant | int lastSextant(Code) | | Last quantized normal's sextant.
|
lastSpecialNormal | boolean lastSpecialNormal(Code) | | Flag indicating last normal used a special encoding.
|
lastU | int lastU(Code) | | Last quantized normal's U encoding parameter.
|
lastV | int lastV(Code) | | Last quantized normal's V encoding parameter.
|
mcBounds | Point3d mcBounds(Code) | | Axes-aligned box enclosing all vertices in model coordinates.
|
meshBuffer | MeshBuffer meshBuffer(Code) | | Mesh buffer mirror used for computing deltas during quantization pass
and a limited meshing algorithm for unstripped data.
|
meshReferenceCount | int meshReferenceCount(Code) | | The number of mesh buffer references created for this stream.
|
ncBounds | Point3d ncBounds(Code) | | Axes-aligned box enclosing all vertices in normalized coordinates.
|
normalQuant | int normalQuant(Code) | | 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.
|
normalQuantChanged | boolean normalQuantChanged(Code) | | Flag indicating normal quantization change.
|
positionQuant | int positionQuant(Code) | | 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.
|
positionQuantChanged | boolean positionQuantChanged(Code) | | Flag indicating position quantization change.
|
positionRangeMaximum | double positionRangeMaximum(Code) | | Maximum position range along the 3 axes.
|
qcBounds | Point3i qcBounds(Code) | | Axes-aligned box enclosing all vertices in quantized coordinates.
|
scale | double scale(Code) | | Scale for normalizing positions to the unit cube.
|
streamType | int streamType(Code) | | Type of this stream, either CompressedGeometryData.Header.POINT_BUFFER,
CompressedGeometryData.Header.LINE_BUFFER, or
CompressedGeometryData.Header.TRIANGLE_BUFFER
|
vertexColor3 | boolean vertexColor3(Code) | | Boolean indicating RGB colors are bundled with the vertices.
|
vertexColor4 | boolean vertexColor4(Code) | | Boolean indicating RGBA colors are bundled with the vertices.
|
vertexColors | boolean vertexColors(Code) | | Boolean indicating colors are bundled with the vertices.
|
vertexComponents | int vertexComponents(Code) | | A mask indicating which components are present in each vertex, as
defined by GeometryArray.
|
vertexCount | int vertexCount(Code) | | The number of vertices created for this stream, excluding mesh buffer
references.
|
vertexNormals | boolean vertexNormals(Code) | | Boolean indicating normals are bundled with the vertices.
|
vertexTexture2 | boolean vertexTexture2(Code) | | Boolean indicating that 2D texture coordinates are used.
Currently only used to skip over textures in interleaved data.
|
vertexTexture3 | boolean vertexTexture3(Code) | | Boolean indicating that 3D texture coordinates are used.
Currently only used to skip over textures in interleaved data.
|
vertexTexture4 | boolean vertexTexture4(Code) | | Boolean indicating that 4D texture coordinates are used.
Currently only used to skip over textures in interleaved data.
|
vertexTextures | boolean vertexTextures(Code) | | Boolean indicating texture coordinates are present.
|
CompressionStream | CompressionStream(int streamType, int vertexComponents)(Code) | | Creates a new CompressionStream for the specified geometry type and
vertex format.
Parameters: streamType - type of data in this stream, eitherCompressedGeometryData.Header.POINT_BUFFER,CompressedGeometryData.Header.LINE_BUFFER, orCompressedGeometryData.Header.TRIANGLE_BUFFER Parameters: vertexComponents - a mask indicating which components are presentin each vertex, as defined by GeometryArray: COORDINATES, NORMALS, andCOLOR_3 or COLOR_4. See Also: GeometryCompressor See Also: GeometryArray |
CompressionStream | public CompressionStream(int positionQuant, int colorQuant, int normalQuant, Shape3D shapes)(Code) | | 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 Parameters: colorQuant - number of bits to quantize each color's R, G, B, andalpha components, ranging from 2 to 16 Parameters: normalQuant - number of bits for quantizing each normal's U and V components, rangingfrom 0 to 6 Parameters: shapes - an array of Shape3D scene graph objects containingGeometryArray objects, all with the same vertex format anddimensionality exception: IllegalArgumentException - if any Shape3D has an inconsistentdimensionality or vertex format, or if any Shape3D contains a geometrycomponent that is not a GeometryArray See Also: Shape3D See Also: GeometryArray See Also: GeometryCompressor |
CompressionStream | public CompressionStream(Shape3D shapes)(Code) | | 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 containingGeometryArray objects, all with the same vertex format anddimensionality. exception: IllegalArgumentException - if any Shape3D has an inconsistentdimensionality or vertex format, or if any Shape3D contains a geometrycomponent that is not a GeometryArray See Also: Shape3D See Also: GeometryArray See Also: GeometryCompressor |
CompressionStream | public CompressionStream(int positionQuant, int colorQuant, int normalQuant, GeometryInfo geometry)(Code) | | 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 Parameters: colorQuant - number of bits to quantize each color's R, G, B, andalpha components, ranging from 2 to 16 Parameters: normalQuant - number of bits for quantizing each normal's U and V components, rangingfrom 0 to 6 Parameters: geometry - an array of GeometryInfo objects, all with the samevertex format and dimensionality exception: IllegalArgumentException - if any GeometryInfo object has aninconsistent dimensionality or vertex format See Also: GeometryInfo See Also: GeometryCompressor |
CompressionStream | public CompressionStream(GeometryInfo geometry)(Code) | | 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 samevertex format and dimensionality exception: IllegalArgumentException - if any GeometryInfo object has aninconsistent dimensionality or vertex format See Also: GeometryInfo See Also: GeometryCompressor |
addColor | void addColor(Color3f c3f)(Code) | | 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)(Code) | | Copy the given color to the end of this stream and use it as a global
state change that applies to all subsequent vertices.
|
addColorQuantization | void addColorQuantization(int value)(Code) | | 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, andalpha components, ranging from 2 to 16 with a default of 9 |
addGeometryArray | void addGeometryArray(GeometryArray ga)(Code) | | Convert a GeometryArray to compression stream elements and add them to
this stream.
Parameters: ga - GeometryArray to convert exception: IllegalArgumentException - if GeometryArray has adimensionality or vertex format inconsistent with the CompressionStream |
addMeshReference | void addMeshReference(int stripFlag, int meshIndex)(Code) | | Add a mesh buffer reference to this stream.
Parameters: stripFlag - vertex replacement flag, either RESTART, REPLACE_OLDEST,or REPLACE_MIDDLE Parameters: meshIndex - index of vertex to retrieve from the mesh buffer |
addNormal | void addNormal(Vector3f n)(Code) | | Copy the given normal to the end of this stream and use it as a global
state change that applies to all subsequent vertices.
|
addNormalQuantization | void addNormalQuantization(int value)(Code) | | 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 to6 with a default of 6 |
addPositionQuantization | void addPositionQuantization(int value)(Code) | | 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 |
addVertex | void addVertex(Point3f pos, int stripFlag)(Code) | | Copy vertex data and add it to the end of this stream.
Parameters: pos - position data Parameters: stripFlag - vertex replacement flag, either RESTART,REPLACE_OLDEST, or REPLACE_MIDDLE |
addVertex | void addVertex(Point3f pos, Vector3f norm, int stripFlag)(Code) | | Copy vertex data and add it to the end of this stream.
Parameters: pos - position data Parameters: norm - normal data Parameters: stripFlag - vertex replacement flag, either RESTART,REPLACE_OLDEST, or REPLACE_MIDDLE |
addVertex | void addVertex(Point3f pos, Color3f color, int stripFlag)(Code) | | Copy vertex data and add it to the end of this stream.
Parameters: pos - position data Parameters: color - color data Parameters: stripFlag - vertex replacement flag, either RESTART,REPLACE_OLDEST, or REPLACE_MIDDLE |
addVertex | void addVertex(Point3f pos, Color4f color, int stripFlag)(Code) | | Copy vertex data and add it to the end of this stream.
Parameters: pos - position data Parameters: color - color data Parameters: stripFlag - vertex replacement flag, either RESTART,REPLACE_OLDEST, or REPLACE_MIDDLE |
addVertex | void addVertex(Point3f pos, Vector3f norm, Color3f color, int stripFlag)(Code) | | Copy vertex data and add it to the end of this stream.
Parameters: pos - position data Parameters: norm - normal data Parameters: color - color data Parameters: stripFlag - vertex replacement flag, either RESTART,REPLACE_OLDEST, or REPLACE_MIDDLE |
addVertex | void addVertex(Point3f pos, Vector3f norm, Color4f color, int stripFlag)(Code) | | Copy vertex data and add it to the end of this stream.
Parameters: pos - position data Parameters: norm - normal data Parameters: color - color data Parameters: stripFlag - vertex replacement flag, either RESTART,REPLACE_OLDEST, or REPLACE_MIDDLE |
addVertex | void addVertex(Point3f pos, int stripFlag, int meshFlag)(Code) | | Copy vertex data and add it to the end of this stream.
Parameters: pos - position data Parameters: stripFlag - vertex replacement flag, either RESTART, REPLACE_OLDEST,or REPLACE_MIDDLE Parameters: meshFlag - if MESH_PUSH the vertex is pushed into the mesh buffer |
addVertex | void addVertex(Point3f pos, Vector3f norm, int stripFlag, int meshFlag)(Code) | | Copy vertex data and add it to the end of this stream.
Parameters: pos - position data Parameters: norm - normal data Parameters: stripFlag - vertex replacement flag, either RESTART, REPLACE_OLDEST,or REPLACE_MIDDLE Parameters: meshFlag - if MESH_PUSH the vertex is pushed into the mesh buffer |
addVertex | void addVertex(Point3f pos, Color3f color, int stripFlag, int meshFlag)(Code) | | Copy vertex data and add it to the end of this stream.
Parameters: pos - position data Parameters: color - color data Parameters: stripFlag - vertex replacement flag, either RESTART, REPLACE_OLDEST,or REPLACE_MIDDLE Parameters: meshFlag - if MESH_PUSH the vertex is pushed into the mesh buffer |
addVertex | void addVertex(Point3f pos, Color4f color, int stripFlag, int meshFlag)(Code) | | Copy vertex data and add it to the end of this stream.
Parameters: pos - position data Parameters: color - color data Parameters: stripFlag - vertex replacement flag, either RESTART, REPLACE_OLDEST,or REPLACE_MIDDLE Parameters: 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)(Code) | | Copy vertex data and add it to the end of this stream.
Parameters: pos - position data Parameters: norm - normal data Parameters: color - color data Parameters: stripFlag - vertex replacement flag, either RESTART, REPLACE_OLDEST,or REPLACE_MIDDLE Parameters: 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)(Code) | | Copy vertex data and add it to the end of this stream.
Parameters: pos - position data Parameters: norm - normal data Parameters: color - color data Parameters: stripFlag - vertex replacement flag, either RESTART, REPLACE_OLDEST,or REPLACE_MIDDLE Parameters: meshFlag - if MESH_PUSH the vertex is pushed into the mesh buffer |
addVertex | void addVertex(Point3f pos, Vector3f norm, Object color, int stripFlag, int meshFlag)(Code) | | Copy vertex data and add it to the end of this stream.
Parameters: pos - position data Parameters: norm - normal data Parameters: color - color data, either Color3f or Color4f, determined bycurrent vertex format Parameters: stripFlag - vertex replacement flag, either RESTART, REPLACE_OLDEST,or REPLACE_MIDDLE Parameters: meshFlag - if MESH_PUSH the vertex is pushed into the mesh buffer |
getByteCount | int getByteCount()(Code) | | Retrieve the total size of the uncompressed geometric data in bytes,
excluding mesh buffer references.
uncompressed byte count |
getMeshReferenceCount | int getMeshReferenceCount()(Code) | | Retrieve the number of mesh buffer references created for this stream.
mesh buffer reference count |
getModelBounds | public Point3d[] getModelBounds()(Code) | | Get the original bounds of the coordinate data, in modeling coordinates.
Coordinate data is positioned and scaled to a normalized cube after
compression.
Point3d array of length 2, where the 1st Point3d is the lowerbounds and the 2nd Point3d is the upper bounds. since: Java 3D 1.3 |
getNormalizedBounds | public Point3d[] getNormalizedBounds()(Code) | | Get the bounds of the compressed object in normalized coordinates.
These have an maximum bounds by [-1.0 .. +1.0] across each axis.
Point3d array of length 2, where the 1st Point3d is the lowerbounds and the 2nd Point3d is the upper bounds. since: Java 3D 1.3 |
getVertexCount | int getVertexCount()(Code) | | Retrieve the the number of vertices created for this stream, excluding
mesh buffer references.
vertex count |
outputCommands | void outputCommands(HuffmanTable huffmanTable, CommandStream outputBuffer)(Code) | | Iterates across all compression stream elements and builds the
compressed geometry command stream output.
Parameters: huffmanTable - Table which maps geometric elements in this streamto tags describing the encoding parameters (length, shift, andabsolute/relative status) to be used for their representations in thecompressed output. All tags must be 6 bits or less in length, and thesum of the number of bits in the tag plus the number of bits in thedata it describes must be at least 6 bits in length. Parameters: outputBuffer - CommandStream to use for collecting the compressedbits. |
print | void print()(Code) | | Print the stream to standard output.
|
quantize | void quantize(HuffmanTable huffmanTable)(Code) | | 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 streamelements to HuffmanNode objects describing each element's datarepresentation. This table can then be processed with Huffman'salgorithm to optimize the bit length of descriptor tags according tothe number of geometric elements mapped to each tag. |
|
|