Xj3D VRML/X3D Code API

org.web3d.vrml.export.compressors
Class TestCompressor

java.lang.Object
  extended byorg.web3d.vrml.export.compressors.TestCompressor
All Implemented Interfaces:
NodeCompressor, SceneGraphTraversalSimpleObserver

public class TestCompressor
extends java.lang.Object
implements NodeCompressor, SceneGraphTraversalSimpleObserver


Field Summary
protected  J3DNodeFactory factory
          The J3D node factory to get default values from
protected  NRNodeFactory nrfactory
          The NR node factory
 
Constructor Summary
TestCompressor()
           
 
Method Summary
 int[] compress(VRMLNodeType ifs)
          Compress the given geometry.
 void decompress(int[] data)
          Decompress the data into a geometry.
 void fillData(java.lang.String nodeName, BinaryContentHandler ch)
          Fill in the data handled by the compressor.
 java.lang.String getEncoderMetadata()
          Get any metadata the encoder would like to write to the file.
 boolean handleData(java.lang.String nodeName, java.lang.String fieldName)
          Checks whether this compressors handles this data.
 void observedNode(VRMLNodeType parent, VRMLNodeType child, int field, boolean used)
          Notification of a child node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

factory

protected J3DNodeFactory factory
The J3D node factory to get default values from


nrfactory

protected NRNodeFactory nrfactory
The NR node factory

Constructor Detail

TestCompressor

public TestCompressor()
Method Detail

compress

public int[] compress(VRMLNodeType ifs)
Compress the given geometry.

Specified by:
compress in interface NodeCompressor
Parameters:
ifs - The geometry to compress
Returns:
An int array for the geometry

decompress

public void decompress(int[] data)
Decompress the data into a geometry.

Specified by:
decompress in interface NodeCompressor
Parameters:
data - The compressed data
Returns:
The X3D node

handleData

public boolean handleData(java.lang.String nodeName,
                          java.lang.String fieldName)
Checks whether this compressors handles this data. If not then the data should be written to the stream.

Specified by:
handleData in interface NodeCompressor
Parameters:
nodeName - the node
fieldName - the field

fillData

public void fillData(java.lang.String nodeName,
                     BinaryContentHandler ch)
Fill in the data handled by the compressor.

Specified by:
fillData in interface NodeCompressor
Parameters:
nodeName - The nodeName

getEncoderMetadata

public java.lang.String getEncoderMetadata()
Get any metadata the encoder would like to write to the file.

Specified by:
getEncoderMetadata in interface NodeCompressor
Returns:
The metadata in X3D XML encoding

observedNode

public void observedNode(VRMLNodeType parent,
                         VRMLNodeType child,
                         int field,
                         boolean used)
Notification of a child node.

Specified by:
observedNode in interface SceneGraphTraversalSimpleObserver
Parameters:
parent - The parent node of this node
child - The child node that is being observed
field - The index of the child field in its parent node
used - true if the node reference is actually a USE

Xj3D VRML/X3D Code API

Copyright © 2001 - 2005 Web3D Consortium