|
Xj3D VRML/X3D Code API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.web3d.vrml.export.compressors.J3DIndexedFaceSetCompressor
A node compressor for IndexedFaceSet nodes. This will use Java3D's geometry compression. Please note these methods are covered by Patents held by Sun Microsystems and are only allowed in X3D implementations.
| Field Summary | |
protected int[] |
childIndexStack
The stack of child indexes used during processing |
protected int |
currentFieldIndex
Copy of the top child index for efficiency purposes |
protected VRMLNodeType |
currentNode
Copy of the top node for efficiency purposes |
protected J3DNodeFactory |
nodeFactory
The node factory used to create real node instances |
protected J3DVRMLNode[] |
nodeStack
The stack of nodes used during processing the document |
protected static int |
STACK_INCREMENT
The increment size of the stack if it get overflowed |
protected int |
topOfStack
Counter to the top item in the stack array |
| Constructor Summary | |
J3DIndexedFaceSetCompressor()
|
|
| Method Summary | |
boolean |
canSupport(int nodeNumber,
int method)
Can this NodeCompressor support this compression method |
void |
componentDecl(java.lang.String componentName)
A component declaration has been found in the code. |
void |
endDocument()
Declaration of the end of the document. |
void |
endField()
Notification of the end of a field declaration. |
void |
endNode()
Notification of the end of a node declaration. |
void |
exportDecl(java.lang.String defName,
java.lang.String exported)
An EXPORT declaration has been found in the document. |
void |
fieldValue(boolean value)
Set the value of the field at the given index as an boolean. |
void |
fieldValue(boolean[] value,
int len)
Set the value of the field at the given index as an array of boolean. |
void |
fieldValue(double value)
Set the value of the field at the given index as an double. |
void |
fieldValue(double[] value,
int len)
Set the value of the field at the given index as an array of doubles. |
void |
fieldValue(float value)
Set the value of the field at the given index as a float. |
void |
fieldValue(float[] value,
int len)
Set the value of the field at the given index as an array of floats. |
void |
fieldValue(int value)
Set the value of the field at the given index as an integer. |
void |
fieldValue(int[] value,
int len)
Set the value of the field at the given index as an array of integers. |
void |
fieldValue(long value)
Set the value of the field at the given index as an long. |
void |
fieldValue(long[] value,
int len)
Set the value of the field at the given index as an array of longs. |
void |
fieldValue(java.lang.String value)
The value of a normal field. |
void |
fieldValue(java.lang.String[] values)
The value of an MFField where the underlying parser knows about how the values are broken up. |
void |
fieldValue(java.lang.String[] value,
int len)
Set the value of the field at the given index as an array of strings. |
void |
importDecl(java.lang.String inline,
java.lang.String exported,
java.lang.String imported)
An IMPORT declaration has been found in the document. |
void |
metaDecl(java.lang.String key,
java.lang.String value)
A META declaration has been found in the code. |
void |
profileDecl(java.lang.String profileName)
A profile declaration has been found in the code. |
void |
reinit(java.io.DataOutputStream dos,
VRMLFieldReader vfr)
Reinitialize this class for a new instance. |
protected void |
resizeStack()
Resize the stack if needed. |
void |
setDocumentLocator(Locator loc)
Set the document locator that can be used by the implementing code to find out information about the current line information. |
void |
startDocument(java.lang.String url,
java.lang.String encoding,
java.lang.String type,
java.lang.String version,
java.lang.String comment)
Declaration of the start of the document. |
void |
startField(java.lang.String name)
Notification of a field declaration. |
void |
startNode(java.lang.String name,
java.lang.String defName)
Notification of the start of a node. |
void |
useDecl(java.lang.String defName)
The field value is a USE for the given node name. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.web3d.vrml.export.compressors.NodeCompressor |
compress, decompress, fillData, getEncoderMetadata, handleData |
| Field Detail |
protected static final int STACK_INCREMENT
protected J3DNodeFactory nodeFactory
protected J3DVRMLNode[] nodeStack
protected int[] childIndexStack
protected int topOfStack
protected int currentFieldIndex
protected VRMLNodeType currentNode
| Constructor Detail |
public J3DIndexedFaceSetCompressor()
| Method Detail |
public void reinit(java.io.DataOutputStream dos,
VRMLFieldReader vfr)
dos - The output stream to use.vfr - The field parser to use.
public boolean canSupport(int nodeNumber,
int method)
nodeNumber - What node, constant defined by Web3D Consortiummethod - What method of compression. 0-127 defined by Web3D Consortium.public void setDocumentLocator(Locator loc)
startDocument() has
been called, you can assume that you will not have one available.
loc - The locator instance to use
public void startDocument(java.lang.String url,
java.lang.String encoding,
java.lang.String type,
java.lang.String version,
java.lang.String comment)
throws SAVException,
VRMLException
# start. The type string contains the representation of
the first few characters of the file after the #. This allows us to
work out if it is VRML97 or the later X3D spec.
Version numbers change from VRML97 to X3D and aren't logical. In the
first, it is #VRML V2.0 and the second is
#X3D V1.0 even though this second header represents a
later spec.
url - The base URL of the file for resolving relative URIs
contained in the fileencoding - The encoding of this document - utf8 or binarytype - The bytes of the first part of the file headerversion - The full VRML version string of this documentcomment - Any trailing text on this line. If there is none, this
is null.
SAVException - This call is taken at the wrong time in the
structure of the document.
VRMLException - This call is taken at the wrong time in the
structure of the document.
public void profileDecl(java.lang.String profileName)
throws SAVException,
VRMLException
profileName - The name of the profile to use
SAVException - This call is taken at the wrong time in the
structure of the document.
VRMLException - This call is taken at the wrong time in the
structure of the document.
public void componentDecl(java.lang.String componentName)
throws SAVException,
VRMLException
componentName - The name of the component to use
SAVException - This call is taken at the wrong time in the
structure of the document.
VRMLException - This call is taken at the wrong time in the
structure of the document.
public void metaDecl(java.lang.String key,
java.lang.String value)
throws SAVException,
VRMLException
key - The value of the key stringvalue - The value of the value string
SAVException - This call is taken at the wrong time in the
structure of the document.
VRMLException - This call is taken at the wrong time in the
structure of the document.
public void importDecl(java.lang.String inline,
java.lang.String exported,
java.lang.String imported)
throws SAVException,
VRMLException
inline - The name of the inline DEF nodesexported - The exported name from the inlined fileimported - The local name to use for the exported name
SAVException - This call is taken at the wrong time in the
structure of the document.
VRMLException - This call is taken at the wrong time in the
structure of the document.
public void exportDecl(java.lang.String defName,
java.lang.String exported)
throws SAVException,
VRMLException
defName - The DEF name of the nodes to be exportedexported - The name to be exported as
SAVException - This call is taken at the wrong time in the
structure of the document.
VRMLException - This call is taken at the wrong time in the
structure of the document.
public void endDocument()
throws SAVException,
VRMLException
SAVException - This call is taken at the wrong time in the
structure of the document.
VRMLException - This call is taken at the wrong time in the
structure of the document.
public void startNode(java.lang.String name,
java.lang.String defName)
throws SAVException,
VRMLException
name - The name of the node that we are about to parsedefName - The string associated with the DEF name. Null if not
given for this node.
SAVException - This call is taken at the wrong time in the
structure of the document.
VRMLException - This call is taken at the wrong time in the
structure of the document.
public void endNode()
throws SAVException,
VRMLException
SAVException - This call is taken at the wrong time in the
structure of the document.
VRMLException - This call is taken at the wrong time in the
structure of the document.
public void startField(java.lang.String name)
throws SAVException,
VRMLException
ScriptHandler or ProtoHandler methods are
used.
name - The name of the field declared
SAVException - This call is taken at the wrong time in the
structure of the document.
VRMLException - This call is taken at the wrong time in the
structure of the document.
public void fieldValue(java.lang.String value)
throws SAVException,
VRMLException
startField() or endNode().
If this field is an SFNode with a USE declaration you will have the
useDecl(String) method called rather than this method. If the
SFNode is empty the value returned here will be "NULL".
There are times where we have an MFField that is declared in the file to be empty. To signify this case, this method will be called with a parameter value of null. A lot of the time this is because we can't really determine if the incoming node is an MFNode or not.
value - The value of this field
SAVException - This call is taken at the wrong time in the
structure of the document.
VRMLException - This call is taken at the wrong time in the
structure of the document.
public void fieldValue(java.lang.String[] values)
throws SAVException,
VRMLException
values - The list of string representing the values
SAVException - This call is taken at the wrong time in the
structure of the document.
VRMLException - This call is taken at the wrong time in the
structure of the document.
public void useDecl(java.lang.String defName)
throws SAVException,
VRMLException
startField() or endNode().
defName - The name of the DEF string to use
SAVException - This call is taken at the wrong time in the
structure of the document.
VRMLException - This call is taken at the wrong time in the
structure of the document.
public void endField()
throws SAVException,
VRMLException
useDecl(String) or fieldValue(String). This
will only ever be called if there have been nodes declared. If no nodes
have been declared (ie "[]") then you will get a
fieldValue(). call with the parameter value of null.
SAVException - This call is taken at the wrong time in the
structure of the document.
VRMLException - This call is taken at the wrong time in the
structure of the document.
public void fieldValue(int value)
throws SAVException,
VRMLException
value - The new value to use for the node
SAVException - This call is taken at the wrong time in the
structure of the document.
VRMLException - This call is taken at the wrong time in the
structure of the document.
public void fieldValue(int[] value,
int len)
throws SAVException,
VRMLException
value - The new value to use for the nodelen - The number of valid entries in the value array
SAVException - This call is taken at the wrong time in the
structure of the document.
VRMLException - This call is taken at the wrong time in the
structure of the document.
public void fieldValue(boolean value)
throws SAVException,
VRMLException
value - The new value to use for the node
SAVException - This call is taken at the wrong time in the
structure of the document.
VRMLException - This call is taken at the wrong time in the
structure of the document.
public void fieldValue(boolean[] value,
int len)
throws SAVException,
VRMLException
value - The new value to use for the nodelen - The number of valid entries in the value array
SAVException - This call is taken at the wrong time in the
structure of the document.
VRMLException - This call is taken at the wrong time in the
structure of the document.
public void fieldValue(float value)
throws SAVException,
VRMLException
value - The new value to use for the node
SAVException - This call is taken at the wrong time in the
structure of the document.
VRMLException - This call is taken at the wrong time in the
structure of the document.
public void fieldValue(float[] value,
int len)
throws SAVException,
VRMLException
value - The new value to use for the nodelen - The number of valid entries in the value array
SAVException - This call is taken at the wrong time in the
structure of the document.
VRMLException - This call is taken at the wrong time in the
structure of the document.
public void fieldValue(long value)
throws SAVException,
VRMLException
value - The new value to use for the node
SAVException - This call is taken at the wrong time in the
structure of the document.
VRMLException - This call is taken at the wrong time in the
structure of the document.
public void fieldValue(long[] value,
int len)
throws SAVException,
VRMLException
value - The new value to use for the nodelen - The number of valid entries in the value array
SAVException - This call is taken at the wrong time in the
structure of the document.
VRMLException - This call is taken at the wrong time in the
structure of the document.
public void fieldValue(double value)
throws SAVException,
VRMLException
value - The new value to use for the node
SAVException - This call is taken at the wrong time in the
structure of the document.
VRMLException - This call is taken at the wrong time in the
structure of the document.
public void fieldValue(double[] value,
int len)
throws SAVException,
VRMLException
value - The new value to use for the nodelen - The number of valid entries in the value array
SAVException - This call is taken at the wrong time in the
structure of the document.
VRMLException - This call is taken at the wrong time in the
structure of the document.
public void fieldValue(java.lang.String[] value,
int len)
throws SAVException,
VRMLException
value - The new value to use for the nodelen - The number of valid entries in the value array
SAVException - This call is taken at the wrong time in the
structure of the document.
VRMLException - This call is taken at the wrong time in the
structure of the document.protected final void resizeStack()
|
Xj3D VRML/X3D Code API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||