Java Doc for CompressedGeometryFile.java in  » 6.0-JDK-Modules » java-3d » com » sun » j3d » utils » geometry » compression » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » java 3d » com.sun.j3d.utils.geometry.compression 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.sun.j3d.utils.geometry.compression.CompressedGeometryFile

CompressedGeometryFile
public class CompressedGeometryFile (Code)
This class provides methods to read and write compressed geometry resource files. These files usually end with the .cg extension and support sequential as well as random access to multiple compressed geometry objects.
since:
   Java 3D 1.5


Field Summary
final static  intALPHA_PRESENT_MASK
     Bit in compressed geometry data descriptor encoding presence of alphas.
final static  intBLOCK_HEADER_SIZE
     Block header total size in bytes.
final static  intCOLOR_PRESENT_MASK
     Bit in compressed geometry data descriptor encoding presence of colors.
final static  intDIRECTORY_OFFSET_OFFSET
     Byte offset of the directory offset from start of file.
final static  intGEOM_DATA_OFFSET
     Byte offset of the compressed geometry data descriptor from start of individual compressed geometry block.
final static  intHEADER_SIZE
     File header total size in bytes.
final static  intMAGIC_NUMBER
     The magic number which identifies the compressed geometry file type.
final static  intMAGIC_NUMBER_OFFSET
     Byte offset of the magic number from start of file.
final static  intMAJOR_VERSION_OFFSET
     Byte offset of the major version number from start of file.
final static  intMINOR_MINOR_VERSION_OFFSET
     Byte offset of the minor minor version number from start of file.
final static  intMINOR_VERSION_OFFSET
     Byte offset of the minor version number from start of file.
final static  intNORMAL_PRESENT_MASK
     Bit in compressed geometry data descriptor encoding presence of normals.
final static  intOBJECT_COUNT_OFFSET
     Byte offset of the number of objects from start of file.
final static  intOBJECT_SIZE_OFFSET
     Byte offset of the object size from start of individual compressed geometry block.
final static  intTYPE_LINE
     Value in compressed geometry data descriptor for a line buffer type.
final static  intTYPE_MASK
     Bits in compressed geometry data descriptor which encode the buffer type.
final static  intTYPE_POINT
     Value in compressed geometry data descriptor for a point buffer type.
final static  intTYPE_TRIANGLE
     Value in compressed geometry data descriptor for a triangle buffer type.
 intbufferNextObjectCount
    
 intbufferNextObjectOffset
    
 intbufferObjectCount
    
 intbufferObjectStart
    
 bytecgBuffer
    
 RandomAccessFilecgFile
    
 CompressedGeometryData.Headercgh
    
 longdirectory
    
 longdirectoryOffset
    
 StringfileName
    
 booleanfileUpdate
    
 intgeomDataType
    
 intgeomSize
    
 intgeomStart
    
 intmagicNumber
    
 intmajorVersionNumber
    
 intminorMinorVersionNumber
    
 intminorVersionNumber
    
 intobjectCount
    
 intobjectIndex
    
 intobjectSizes
    

Constructor Summary
public  CompressedGeometryFile(String file)
     Construct a new CompressedGeometryFile instance associated with the specified file.
public  CompressedGeometryFile(String file, boolean rw)
     Construct a new CompressedGeometryFile instance associated with the specified file.
public  CompressedGeometryFile(RandomAccessFile file)
     Construct a new CompressedGeometryFile instance associated with a currently open RandomAccessFile.

Method Summary
public  voidclear()
     Delete all compressed objects from this instance.
public  voidclose()
     Release the resources associated with this instance.
protected  voidfinalize()
     Release file resources when this object is garbage collected.
public  intgetCurrentIndex()
     Return the current object index associated with this instance.
public  StringgetFileName()
     Return a string containing the file name associated with this instance or null if there is none.
public  intgetMajorVersionNumber()
     Return the major version number of the most recent compressor used to compress any of the objects in this instance.
public  intgetMinorMinorVersionNumber()
     Return the subminor version number of the most recent compressor used to compress any of the objects in this instance.
public  intgetMinorVersionNumber()
     Return the minor version number of the most recent compressor used to compress any of the objects in this instance.
public  intgetObjectCount()
     Return the number of compressed objects in this instance.
 voidinitialize()
    
 CompressedGeometryDatanewCG(int geomSize, int geomStart, int geomDataType)
    
 voidopen(String fname, boolean rw)
    
public  CompressedGeometryData[]read()
     Read all compressed geometry objects contained in the instance.
public  CompressedGeometryDataread(int index)
     Read the compressed geometry object at the specified index.
 voidreadDirectory(long offset, long[] directory)
    
 voidreadFileHeader()
    
public  CompressedGeometryDatareadNext()
     Read the next compressed geometry object in the instance.
 CompressedGeometryDatareadNext(int bufferReadLimit)
    
 voidsetFilePointer(long offset)
    
public  voidwrite(CompressedGeometryData cg)
     Add a compressed geometry node component to the end of the instance. The current object index becomes invalid; an immediately following call to readNext() will return null.
public  voidwrite(CompressedGeometryData.Header cgh, byte geometry)
     Add a buffer of compressed geometry data to the end of the resource.
 voidwriteFileDirectory()
    
 voidwriteFileHeader()
    

Field Detail
ALPHA_PRESENT_MASK
final static int ALPHA_PRESENT_MASK(Code)
Bit in compressed geometry data descriptor encoding presence of alphas.



BLOCK_HEADER_SIZE
final static int BLOCK_HEADER_SIZE(Code)
Block header total size in bytes.



COLOR_PRESENT_MASK
final static int COLOR_PRESENT_MASK(Code)
Bit in compressed geometry data descriptor encoding presence of colors.



DIRECTORY_OFFSET_OFFSET
final static int DIRECTORY_OFFSET_OFFSET(Code)
Byte offset of the directory offset from start of file. This offset is long word aligned since the directory offset is a long.



GEOM_DATA_OFFSET
final static int GEOM_DATA_OFFSET(Code)
Byte offset of the compressed geometry data descriptor from start of individual compressed geometry block.



HEADER_SIZE
final static int HEADER_SIZE(Code)
File header total size in bytes.



MAGIC_NUMBER
final static int MAGIC_NUMBER(Code)
The magic number which identifies the compressed geometry file type.



MAGIC_NUMBER_OFFSET
final static int MAGIC_NUMBER_OFFSET(Code)
Byte offset of the magic number from start of file.



MAJOR_VERSION_OFFSET
final static int MAJOR_VERSION_OFFSET(Code)
Byte offset of the major version number from start of file.



MINOR_MINOR_VERSION_OFFSET
final static int MINOR_MINOR_VERSION_OFFSET(Code)
Byte offset of the minor minor version number from start of file.



MINOR_VERSION_OFFSET
final static int MINOR_VERSION_OFFSET(Code)
Byte offset of the minor version number from start of file.



NORMAL_PRESENT_MASK
final static int NORMAL_PRESENT_MASK(Code)
Bit in compressed geometry data descriptor encoding presence of normals.



OBJECT_COUNT_OFFSET
final static int OBJECT_COUNT_OFFSET(Code)
Byte offset of the number of objects from start of file.



OBJECT_SIZE_OFFSET
final static int OBJECT_SIZE_OFFSET(Code)
Byte offset of the object size from start of individual compressed geometry block.



TYPE_LINE
final static int TYPE_LINE(Code)
Value in compressed geometry data descriptor for a line buffer type.



TYPE_MASK
final static int TYPE_MASK(Code)
Bits in compressed geometry data descriptor which encode the buffer type.



TYPE_POINT
final static int TYPE_POINT(Code)
Value in compressed geometry data descriptor for a point buffer type.



TYPE_TRIANGLE
final static int TYPE_TRIANGLE(Code)
Value in compressed geometry data descriptor for a triangle buffer type.



bufferNextObjectCount
int bufferNextObjectCount(Code)



bufferNextObjectOffset
int bufferNextObjectOffset(Code)



bufferObjectCount
int bufferObjectCount(Code)



bufferObjectStart
int bufferObjectStart(Code)



cgBuffer
byte cgBuffer(Code)



cgFile
RandomAccessFile cgFile(Code)



cgh
CompressedGeometryData.Header cgh(Code)



directory
long directory(Code)



directoryOffset
long directoryOffset(Code)



fileName
String fileName(Code)



fileUpdate
boolean fileUpdate(Code)



geomDataType
int geomDataType(Code)



geomSize
int geomSize(Code)



geomStart
int geomStart(Code)



magicNumber
int magicNumber(Code)



majorVersionNumber
int majorVersionNumber(Code)



minorMinorVersionNumber
int minorMinorVersionNumber(Code)



minorVersionNumber
int minorVersionNumber(Code)



objectCount
int objectCount(Code)



objectIndex
int objectIndex(Code)



objectSizes
int objectSizes(Code)




Constructor Detail
CompressedGeometryFile
public CompressedGeometryFile(String file) throws IOException(Code)
Construct a new CompressedGeometryFile instance associated with the specified file. An attempt is made to open the file with read-only access; if this fails then a FileNotFoundException is thrown.
Parameters:
  file - path to the compressed geometry resource file
exception:
  FileNotFoundException - if file doesn't exist orcannot be read
exception:
  IllegalArgumentException - if the file is not a compressedgeometry resource file
exception:
  IOException - if there is a header or directory read error



CompressedGeometryFile
public CompressedGeometryFile(String file, boolean rw) throws IOException(Code)
Construct a new CompressedGeometryFile instance associated with the specified file.
Parameters:
  file - path to the compressed geometry resource file
Parameters:
  rw - if true, opens the file for read and write access or attemptsto create one if it doesn't exist; if false, opens the file withread-only access
exception:
  FileNotFoundException - if file doesn't exist oraccess permissions disallow access
exception:
  IllegalArgumentException - if the file is not a compressedgeometry resource file
exception:
  IOException - if there is a header or directory read error



CompressedGeometryFile
public CompressedGeometryFile(RandomAccessFile file) throws IOException(Code)
Construct a new CompressedGeometryFile instance associated with a currently open RandomAccessFile.
Parameters:
  file - currently open RandomAccessFile
exception:
  IllegalArgumentException - if the file is not a compressedgeometry resource file
exception:
  IOException - if there is a header or directory read error




Method Detail
clear
public void clear() throws IOException(Code)
Delete all compressed objects from this instance. This method may only be called after successfully creating a CompressedGeometryFile instance with read-write access, so a corrupted or otherwise invalid resource must be removed manually before it can be rewritten. The close() method must be called sometime after invoking clear() in order to write out the new directory structure.
exception:
  IOException - if clear fails



close
public void close()(Code)
Release the resources associated with this instance. Write out final header and directory if contents were updated. This method must be called in order to create a valid compressed geometry resource file if any updates were made.



finalize
protected void finalize()(Code)
Release file resources when this object is garbage collected.



getCurrentIndex
public int getCurrentIndex()(Code)
Return the current object index associated with this instance. This is the index of the object that would be returned by an immediately following call to the readNext() method. Its initial value is 0; -1 is returned if the last object has been read. current object index, or -1 if at end



getFileName
public String getFileName()(Code)
Return a string containing the file name associated with this instance or null if there is none. file name associated with this instance or null if there isnone



getMajorVersionNumber
public int getMajorVersionNumber()(Code)
Return the major version number of the most recent compressor used to compress any of the objects in this instance. major version number



getMinorMinorVersionNumber
public int getMinorMinorVersionNumber()(Code)
Return the subminor version number of the most recent compressor used to compress any of the objects in this instance. subminor version number



getMinorVersionNumber
public int getMinorVersionNumber()(Code)
Return the minor version number of the most recent compressor used to compress any of the objects in this instance. minor version number



getObjectCount
public int getObjectCount()(Code)
Return the number of compressed objects in this instance. number of compressed objects



initialize
void initialize() throws IOException(Code)



newCG
CompressedGeometryData newCG(int geomSize, int geomStart, int geomDataType)(Code)



open
void open(String fname, boolean rw) throws FileNotFoundException, IOException(Code)



read
public CompressedGeometryData[] read() throws IOException(Code)
Read all compressed geometry objects contained in the instance. The current object index becomes invalid; an immediately following call to readNext() will return null. an array of CompressedGeometryData node components.
exception:
  IOException - if read fails



read
public CompressedGeometryData read(int index) throws IOException(Code)
Read the compressed geometry object at the specified index. The current object index is set to the subsequent object unless the last object has been read, in which case the index becomes invalid and an immediately following call to readNext() will return null.
Parameters:
  index - compressed geometry object to read a CompressedGeometryData node component
exception:
  IndexOutOfBoundsException - if object index isout of range
exception:
  IOException - if read fails



readDirectory
void readDirectory(long offset, long[] directory) throws IOException(Code)



readFileHeader
void readFileHeader() throws IOException(Code)



readNext
public CompressedGeometryData readNext() throws IOException(Code)
Read the next compressed geometry object in the instance. This is initially the first object (index 0) in the instance; otherwise, it is whatever object is next after the last one read. The current object index is incremented by 1 after the read. When the last object is read the index becomes invalid and an immediately subsequent call to readNext() returns null. a CompressedGeometryData node component, or null if the last objecthas been read
exception:
  IOException - if read fails



readNext
CompressedGeometryData readNext(int bufferReadLimit) throws IOException(Code)



setFilePointer
void setFilePointer(long offset) throws IOException(Code)



write
public void write(CompressedGeometryData cg) throws IOException(Code)
Add a compressed geometry node component to the end of the instance. The current object index becomes invalid; an immediately following call to readNext() will return null. The close() method must be called at some later time in order to create a valid compressed geometry file.
Parameters:
  cg - a compressed geometry node component
exception:
  CapabilityNotSetException - if unable to get compressedgeometry data from the node component
exception:
  IOException - if write fails



write
public void write(CompressedGeometryData.Header cgh, byte geometry) throws IOException(Code)
Add a buffer of compressed geometry data to the end of the resource. The current object index becomes invalid; an immediately following call to readNext() will return null. The close() method must be called at some later time in order to create a valid compressed geometry file.
Parameters:
  cgh - a CompressedGeometryData.Header object describing the data.
Parameters:
  geometry - the compressed geometry data
exception:
  IOException - if write fails



writeFileDirectory
void writeFileDirectory() throws IOException(Code)



writeFileHeader
void writeFileHeader() throws IOException(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.