Class ObjectFileCompressor

java.lang.Object
  |
  +--com.sun.j3d.loaders.objectfile.ObjectFile
        |
        +--ObjectFileCompressor

public class ObjectFileCompressor
extends com.sun.j3d.loaders.objectfile.ObjectFile

This extension of ObjectFile provides the methods setQuantization() and compress() to compress Wavefront .obj files into the format described by appendix B of the Java 3D specification.


Fields inherited from class com.sun.j3d.loaders.objectfile.ObjectFile
RESIZE, REVERSE, STRIPIFY, TRIANGULATE
 
Constructor Summary
ObjectFileCompressor()
           
ObjectFileCompressor(int flags)
           
ObjectFileCompressor(int flags, float radians)
           
 
Method Summary
 javax.media.j3d.CompressedGeometry compress(java.io.Reader reader)
          Compress the specified .obj file into a CompressedGeometry node component.
 void compress(java.io.Reader reader, com.sun.j3d.utils.compression.CompressedGeometryFile file)
          Compress the specified .obj file and add it to the end of an open compressed geometry file.
 javax.media.j3d.CompressedGeometry compress(java.lang.String objFileName)
          Compress the specified .obj file into a CompressedGeometry node component.
 void compress(java.lang.String objFileName, com.sun.j3d.utils.compression.CompressedGeometryFile file)
          Compress the specified .obj file and add it to the end of an open compressed geometry file.
 javax.media.j3d.CompressedGeometry compress(java.net.URL url)
          Compress the specified .obj file into a CompressedGeometry node component.
 void compress(java.net.URL url, com.sun.j3d.utils.compression.CompressedGeometryFile file)
          Compress the specified .obj file and add it to the end of an open compressed geometry file.
 void setFlags(int flags)
           
 void setQuantization(int positionQuant, int colorQuant, int normalQuant)
          Set the position, normal, and color quantization values for compression.
 
Methods inherited from class com.sun.j3d.loaders.objectfile.ObjectFile
getBasePath, getBaseUrl, getFlags, load, load, load, setBasePath, setBaseUrl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectFileCompressor

public ObjectFileCompressor()

ObjectFileCompressor

public ObjectFileCompressor(int flags)

ObjectFileCompressor

public ObjectFileCompressor(int flags,
                            float radians)
Method Detail

setFlags

public void setFlags(int flags)
Overrides:
setFlags in class com.sun.j3d.loaders.objectfile.ObjectFile

setQuantization

public void setQuantization(int positionQuant,
                            int colorQuant,
                            int normalQuant)
Set the position, normal, and color quantization values for compression.
Parameters:
positionQuant - number of bits to quantize each position's X, Y, and Z components, ranging from 1 to 16 with a default of 10
colorQuant - number of bits to quantize each color's R, G, B, and alpha components, ranging from 2 to 16 with a default of 8
normalQuant - number of bits for quantizing each normal's U and V components, ranging from 0 to 6 with a default of 3

compress

public javax.media.j3d.CompressedGeometry compress(java.lang.String objFileName)
Compress the specified .obj file into a CompressedGeometry node component.
Parameters:
objFileName - String object representing the path to a .obj file
Returns:
a CompressedGeometry node component

compress

public void compress(java.lang.String objFileName,
                     com.sun.j3d.utils.compression.CompressedGeometryFile file)
              throws java.io.IOException
Compress the specified .obj file and add it to the end of an open compressed geometry file.
Parameters:
objFileName - String object representing the path to a .obj file
file - a currently open CompressedGeometryFile object
Throws:
java.io.IOException - - if write fails

compress

public javax.media.j3d.CompressedGeometry compress(java.io.Reader reader)
Compress the specified .obj file into a CompressedGeometry node component.
Parameters:
reader - an open .obj file
Returns:
a CompressedGeometry node component

compress

public void compress(java.io.Reader reader,
                     com.sun.j3d.utils.compression.CompressedGeometryFile file)
              throws java.io.IOException
Compress the specified .obj file and add it to the end of an open compressed geometry file.
Parameters:
reader - an open .obj file
file - an open CompressedGeometryFile object
Throws:
java.io.IOException - - if write fails

compress

public javax.media.j3d.CompressedGeometry compress(java.net.URL url)
Compress the specified .obj file into a CompressedGeometry node component.
Parameters:
url - Uniform Resource Locator for the .obj file
Returns:
a CompressedGeometry node component

compress

public void compress(java.net.URL url,
                     com.sun.j3d.utils.compression.CompressedGeometryFile file)
              throws java.io.IOException
Compress the specified .obj file and add it to the end of an open compressed geometry file.
Parameters:
url - Uniform Resource Locator for the .obj file
file - a currently open CompressedGeometryFile object
Throws:
java.io.IOException - - if write fails