edu.washington.NVisF.animator
Class CompressedMovieIO

java.lang.Object
  |
  +--edu.washington.NVisF.animator.MovieIO
        |
        +--edu.washington.NVisF.animator.CompressedMovieIO

public class CompressedMovieIO
extends MovieIO

The CompressedMovieIO object reads and writes NVisF movies (that is, an array of ObjectGroup objects) using the Compressed Geometry utilities provided in the com.sun.j3d.utils.compression package. The Geometry components of the frames are compressed and written to a file with a .cg extension, while the Appearance component is written to a file with a .apr extension. Currently, only the Appearance of the first frame is written under the assumption that all frames share the same Appearance. There is currently a bug in this process. A scale factor is somehow applied to the frames so that when they are read back in, each frame is a distinct different size than the original. I'm 98% sure this is a bug in the com.sun routines themselves, which is a problem. I plan to sort this out later.


Constructor Summary
CompressedMovieIO()
           
 
Method Summary
 ObjectGroup[] readMovie(java.lang.String inputFileName)
          Reconstructs the movie frames written to file by a previous call to writeMovie(edu.washington.NVisF.plotter.ObjectGroup[], java.lang.String).
 boolean writeMovie(ObjectGroup[] frames, java.lang.String outputFileName)
          Writes the input ObjectGroups using outputFileName as a filename pattern.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompressedMovieIO

public CompressedMovieIO()
Method Detail

writeMovie

public boolean writeMovie(ObjectGroup[] frames,
                          java.lang.String outputFileName)
                   throws java.io.IOException
Writes the input ObjectGroups using outputFileName as a filename pattern. The extension ".cg" (for "Compressed Geometry") is added for the geometry portion and the extension ".apr" is used for the file that stores the Appearance component. If either output file already exists, it is overwritten.
Overrides:
writeMovie in class MovieIO
Parameters:
frames - the movie frames to write to file
outputFileName - the name of the file to write
Throws:
java.io.IOException - if a write error occurs
java.lang.IllegalArgumentException - if a .cg file already exists but is somehow corrupted or unparseable, or if the frames do not contain valid references to their Shape3Ds

readMovie

public ObjectGroup[] readMovie(java.lang.String inputFileName)
                        throws java.io.IOException
Reconstructs the movie frames written to file by a previous call to writeMovie(edu.washington.NVisF.plotter.ObjectGroup[], java.lang.String). The parameter identifies the files to be read. This usually is the header component of the filename, but this method will also parse the header from a .cg or .apr filename.
Overrides:
readMovie in class MovieIO
Throws:
java.io.IOException - if a read error occurs
java.lang.IllegalArgumentException - if the Geometry file has an unrecognizable format