com.sun.j3d.utils.compression
Class CompressionStreamVertex

java.lang.Object
  extended by com.sun.j3d.utils.compression.CompressionStreamElement
      extended by com.sun.j3d.utils.compression.CompressionStreamVertex

 class CompressionStreamVertex
extends CompressionStreamElement

This class represents a vertex in a compression stream. It maintains both floating-point and quantized representations of the vertex position along with meshing and vertex replacement flags for line and surface primitives. If normals or colors are bundled with geometry vertices then instances of this class will also contain references to normal or color stream elements.


Field Summary
(package private)  CompressionStreamColor color
           
private  float floatX
           
private  float floatY
           
private  float floatZ
           
private  int meshFlag
           
(package private)  CompressionStreamNormal normal
           
private  int stripFlag
           
private  int X
           
(package private)  int xAbsolute
           
private  int Y
           
(package private)  int yAbsolute
           
private  int Z
           
(package private)  int zAbsolute
           
 
Fields inherited from class com.sun.j3d.utils.compression.CompressionStreamElement
absolute, length, lengthMask, quantizationMask, shift
 
Constructor Summary
CompressionStreamVertex(CompressionStream stream, Point3f p, Vector3f n, Color3f c, int stripFlag, int meshFlag)
          Create a CompressionStreamVertex with the given parameters.
CompressionStreamVertex(CompressionStream stream, Point3f p, Vector3f n, Color4f c, int stripFlag, int meshFlag)
          Create a CompressionStreamVertex with the given parameters.
CompressionStreamVertex(CompressionStream stream, Point3f p, Vector3f n, int stripFlag, int meshFlag)
          Create a CompressionStreamVertex with the given parameters.
 
Method Summary
(package private)  void outputCommand(HuffmanTable huffmanTable, CommandStream outputBuffer)
          Output the final compressed bits to the compression command stream.
(package private)  void quantize(CompressionStream stream, HuffmanTable huffmanTable)
          Quantize the floating point position to fixed point integer components of the specified number of bits.
 java.lang.String toString()
           
 
Methods inherited from class com.sun.j3d.utils.compression.CompressionStreamElement
computeLengthShift, computeLengthShift, computeLengthShift
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

X

private int X

Y

private int Y

Z

private int Z

meshFlag

private int meshFlag

stripFlag

private int stripFlag

floatX

private float floatX

floatY

private float floatY

floatZ

private float floatZ

xAbsolute

int xAbsolute

yAbsolute

int yAbsolute

zAbsolute

int zAbsolute

color

CompressionStreamColor color

normal

CompressionStreamNormal normal
Constructor Detail

CompressionStreamVertex

CompressionStreamVertex(CompressionStream stream,
                        Point3f p,
                        Vector3f n,
                        Color3f c,
                        int stripFlag,
                        int meshFlag)
Create a CompressionStreamVertex with the given parameters.

Parameters:
stream - CompressionStream associated with this vertex
p - position
n - normal bundled with this vertex or null if not bundled
c - color bundled with this vertex or null if not bundled
stripFlag - CompressionStream.RESTART, CompressionStream.REPLACE_OLDEST, or CompressionStream.REPLACE_MIDDLE
meshFlag - CompressionStream.MESH_PUSH or CompressionStream.NO_MESH_PUSH

CompressionStreamVertex

CompressionStreamVertex(CompressionStream stream,
                        Point3f p,
                        Vector3f n,
                        Color4f c,
                        int stripFlag,
                        int meshFlag)
Create a CompressionStreamVertex with the given parameters.

Parameters:
stream - CompressionStream associated with this vertex
p - position
n - normal bundled with this vertex or null if not bundled
c - color bundled with this vertex or null if not bundled
stripFlag - CompressionStream.RESTART, CompressionStream.REPLACE_OLDEST, or CompressionStream.REPLACE_MIDDLE
meshFlag - CompressionStream.MESH_PUSH or CompressionStream.NO_MESH_PUSH

CompressionStreamVertex

CompressionStreamVertex(CompressionStream stream,
                        Point3f p,
                        Vector3f n,
                        int stripFlag,
                        int meshFlag)
Create a CompressionStreamVertex with the given parameters.

Parameters:
stream - CompressionStream associated with this vertex
p - position
n - normal bundled with this vertex or null if not bundled
stripFlag - CompressionStream.RESTART, CompressionStream.REPLACE_OLDEST, or CompressionStream.REPLACE_MIDDLE
meshFlag - CompressionStream.MESH_PUSH or CompressionStream.NO_MESH_PUSH
Method Detail

quantize

void quantize(CompressionStream stream,
              HuffmanTable huffmanTable)
Quantize the floating point position to fixed point integer components of the specified number of bits. The bit length can range from 1 to 16.

Specified by:
quantize in class CompressionStreamElement
Parameters:
stream - CompressionStream associated with this element
table - HuffmanTable for collecting data about the quantized representation of this element

outputCommand

void outputCommand(HuffmanTable huffmanTable,
                   CommandStream outputBuffer)
Output the final compressed bits to the compression command stream.

Overrides:
outputCommand in class CompressionStreamElement
Parameters:
table - HuffmanTable mapping quantized representations to compressed encodings
output - CommandStream for collecting compressed output

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


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