|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.j3d.utils.geometry.compression.GeometryDecompressor
abstract class GeometryDecompressor
This abstract class provides the base methods needed to create a geometry decompressor. Subclasses must implement a backend to handle the output, consisting of a generalized triangle strip, line strip, or point array, along with possible global color and normal changes.
Nested Class Summary | |
---|---|
(package private) static class |
GeometryDecompressor.HuffmanTableEntry
Decompression table entry. |
(package private) static class |
GeometryDecompressor.MeshBufferEntry
Mesh buffer entry containing position, normal, and color. |
Field Summary | |
---|---|
private static boolean |
benchmark
|
private int |
bitBuffer
|
private int |
bitBufferCount
|
private static int[] |
BMASK
|
private boolean |
bundlingColor
|
private boolean |
bundlingNorm
|
private short |
curA
|
private short |
curB
|
private Color4f |
curColor
|
private short |
curG
|
private Vector3f |
curNorm
|
private int |
curOct
|
private Point3f |
curPos
|
private short |
curR
|
private int |
currentHeader
|
private int |
curSex
|
private int |
curU
|
private int |
curV
|
private short |
curX
|
private short |
curY
|
private short |
curZ
|
private static boolean |
debug
|
private boolean |
doingAlpha
|
private static int |
GC_EOS
|
private static int |
GC_MESH_B_R
|
private static int |
GC_PASS_THROUGH
|
private static int |
GC_SET_COLOR
|
private static int |
GC_SET_NORM
|
private static int |
GC_SET_STATE
|
private static int |
GC_SET_TABLE
|
private static int |
GC_SKIP_8
|
private static int |
GC_V_NO_OP
|
private static int |
GC_VERTEX
|
private byte[] |
gcData
|
private int |
gcIndex
|
private static double[][][] |
gcNormals
|
private GeometryDecompressor.HuffmanTableEntry[][] |
gctables
|
(package private) static int |
majorVersionNumber
Compressed geometry format version supported. |
private GeometryDecompressor.MeshBufferEntry[] |
meshBuffer
|
private int |
meshIndex
|
private int |
meshState
|
(package private) static int |
minorMinorVersionNumber
|
(package private) static int |
minorVersionNumber
|
private int |
nextHeader
|
private static double |
NORMAL_MAX_Y_ANG
|
private static boolean |
printNormalTable
|
private int |
repCode
|
private long |
startTime
|
private static int |
USE_MESH_COLOR
|
private static int |
USE_MESH_NORMAL
|
private int |
vertexCount
|
Constructor Summary | |
---|---|
GeometryDecompressor()
|
Method Summary | |
---|---|
private void |
benchmarkPrint(int length)
|
private void |
benchmarkStart(int length)
|
(package private) boolean |
checkVersion(int majorVersionNumber,
int minorVersionNumber)
Check version numbers and return true if compatible. |
(package private) void |
decompress(int start,
int length,
byte[] data)
Decompress data and invoke abstract output methods. |
private int |
getBits(int bitCount,
java.lang.String d)
|
private void |
indexNormal(int sex,
int oct,
int u,
int v,
Vector3f n)
|
(package private) abstract void |
outputColor(Color4f color)
This method captures the global color output of the decompressor. |
(package private) abstract void |
outputNormal(Vector3f normal)
This method captures the global normal output of the decompressor. |
(package private) abstract void |
outputVertex(Point3f position,
Vector3f normal,
Color4f color,
int vertexReplaceCode)
This method captures the vertex output of the decompressor. |
(package private) abstract void |
outputVertexFormat(boolean bundlingNorm,
boolean bundlingColor,
boolean doingAlpha)
This method is called when a SetState command is encountered in the decompression stream. |
private void |
processDecompression()
|
private int |
processDecompressionOpcode(int mbp)
|
private void |
processEos()
|
private void |
processMeshBR()
|
private void |
processPassThrough()
|
private void |
processSetColor(int mbp)
|
private void |
processSetNormal(int mbp)
|
private void |
processSetState()
|
private void |
processSetTable()
|
private void |
processSkip8()
|
private int |
processVertex()
|
private void |
processVNoop()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final boolean debug
private static final boolean benchmark
static final int majorVersionNumber
static final int minorVersionNumber
static final int minorMinorVersionNumber
private static final int GC_VERTEX
private static final int GC_SET_NORM
private static final int GC_SET_COLOR
private static final int GC_MESH_B_R
private static final int GC_SET_STATE
private static final int GC_SET_TABLE
private static final int GC_PASS_THROUGH
private static final int GC_EOS
private static final int GC_V_NO_OP
private static final int GC_SKIP_8
private GeometryDecompressor.HuffmanTableEntry[][] gctables
private GeometryDecompressor.MeshBufferEntry[] meshBuffer
private int meshIndex
private int meshState
private static final int USE_MESH_NORMAL
private static final int USE_MESH_COLOR
private short curX
private short curY
private short curZ
private short curR
private short curG
private short curB
private short curA
private int curSex
private int curOct
private int curU
private int curV
private Point3f curPos
private Vector3f curNorm
private Color4f curColor
private int repCode
private boolean bundlingNorm
private boolean bundlingColor
private boolean doingAlpha
private int currentHeader
private int nextHeader
private int bitBuffer
private int bitBufferCount
private long startTime
private int vertexCount
private static final int[] BMASK
private byte[] gcData
private int gcIndex
private static final double[][][] gcNormals
private static final double NORMAL_MAX_Y_ANG
private static final boolean printNormalTable
Constructor Detail |
---|
GeometryDecompressor()
Method Detail |
---|
abstract void outputVertexFormat(boolean bundlingNorm, boolean bundlingColor, boolean doingAlpha)
bundlingNorm
- true indicates normals are bundled with verticesbundlingColor
- true indicates colors are bundled with verticesdoingAlpha
- true indicates alpha values are bundled with verticesabstract void outputVertex(Point3f position, Vector3f normal, Color4f color, int vertexReplaceCode)
position
- The coordinates of the vertex.normal
- The normal bundled with the vertex. May be null.color
- The color bundled with the vertex. May be null.
Alpha may be present.vertexReplaceCode
- Specifies the generalized strip flag
that is bundled with each vertex.GeneralizedStripFlags
,
CompressedGeometryHeader
abstract void outputColor(Color4f color)
color
- The current global color.abstract void outputNormal(Vector3f normal)
normal
- The current global normal.boolean checkVersion(int majorVersionNumber, int minorVersionNumber)
void decompress(int start, int length, byte[] data)
start
- byte offset to start of compressed geometry in data arraylength
- size of compressed geometry in bytesdata
- array containing compressed geometry buffer of the
specified length at the given offset from the start of the array
java.lang.ArrayIndexOutOfBoundsException
- if start+length > data sizeprivate int getBits(int bitCount, java.lang.String d)
private void processDecompression()
private int processDecompressionOpcode(int mbp)
private void processSetState()
private void processSetTable()
private int processVertex()
private void processSetNormal(int mbp)
private void indexNormal(int sex, int oct, int u, int v, Vector3f n)
private void processSetColor(int mbp)
private void processMeshBR()
private void processEos()
private void processVNoop()
private void processPassThrough()
private void processSkip8()
private void benchmarkStart(int length)
private void benchmarkPrint(int length)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |