Xj3D VRML/X3D Code API

org.web3d.vrml.nodes
Interface SceneGraphTraversalDetailObserver


public interface SceneGraphTraversalDetailObserver

An observer interface to look at the structure of the VRML runtime scene graph presented by the SceneGraphTraverser.

As this interface is an observer of the traversal process, it may perform many tasks, such as building an equivalent API. However, it should not attempt to make calls back to this class. For speed reasons, only one observer can be registered at a time. We feel this is the most common way that the class will be used (usually to generate alternate scene graphs) and the overheads of dealing with loops for multiple observers is not worth it.

The observer will report the top of a use hierarchy. If the traverser, in it's internal references, detects a reference re-use that is indicative of a DEF/USE situation then the flag passed with each method call will be set true. After reporting the USE, the traverser will not descend that part of the scene graph any further.

When reporting the parent node, if the root is the root node of the VRML file or the body of a Proto, the parent reference will be null - regardless of the type of node.

Version:
$Revision: 1.2 $
Author:
Justin Couch

Method Summary
 void appearanceNode(VRMLShapeNodeType parent, VRMLAppearanceNodeType appearance, boolean used)
          Notification of an appearance node.
 void audioClipNode(VRMLSoundNodeType parent, VRMLAudioClipNodeType clip, boolean used)
          Notification of an AudioClip based node.
 void bindableNode(VRMLGroupingNodeType parent, VRMLBindableNodeType bindable, boolean used)
          Notification of a bindable node.
 void customNode(VRMLNodeType parent, int fieldIndex, VRMLNodeType child, boolean used)
          Notification of a custom node that defines its own children types.
 void geometricPropertyNode(VRMLComponentGeometryNodeType parent, VRMLGeometricPropertyNodeType geoprop, boolean used)
          Notification of a geometric property node.
 void geometryNode(VRMLShapeNodeType parent, VRMLGeometryNodeType geometry, boolean used)
          Notification of a geometry node.
 void groupingNode(VRMLGroupingNodeType parent, VRMLGroupingNodeType group, boolean used)
          Notification of a grouping node.
 void inlineNode(VRMLGroupingNodeType parent, VRMLInlineNodeType inline, boolean used)
          Notification of an inline node.
 void interpolatorNode(VRMLGroupingNodeType parent, VRMLInterpolatorNodeType interp, boolean used)
          Notification of any form of interpolator node
 void lightNode(VRMLGroupingNodeType parent, VRMLLightNodeType light, boolean used)
          Notification of a light node.
 void materialNode(VRMLAppearanceNodeType parent, VRMLMaterialNodeType material, boolean used)
          Notification of a Material node.
 void miscellaneousNode(VRMLNodeType parent, int fieldIndex, VRMLNodeType node, boolean used)
          Notification of an unknown or miscellaneous node type that does not fit into any of the other categories.
 void protoNode(VRMLNodeType parent, VRMLProtoInstance proto, boolean used)
          Notification of a proto instance.
 void scriptNode(VRMLGroupingNodeType parent, VRMLScriptNodeType script, boolean used)
          Notification of a script node.
 void sensorNode(VRMLGroupingNodeType parent, VRMLSensorNodeType sensor, boolean used)
          Notification of any form of sensor node.
 void shapeNode(VRMLGroupingNodeType parent, VRMLShapeNodeType shape, boolean used)
          Notification of a shape node.
 void soundNode(VRMLGroupingNodeType parent, VRMLSoundNodeType sound, boolean used)
          Notification of a sound node.
 void textureNode(VRMLAppearanceNodeType parent, VRMLTextureNodeType texture, boolean used)
          Notification of a texture node.
 void textureTransformNode(VRMLAppearanceNodeType parent, VRMLTextureTransformNodeType transform, boolean used)
          Notification of a TextureTransform node.
 

Method Detail

groupingNode

public void groupingNode(VRMLGroupingNodeType parent,
                         VRMLGroupingNodeType group,
                         boolean used)
Notification of a grouping node.

Parameters:
parent - The parent group of this node
group - The grouping node that has been found
used - true if the node reference is actually a USE

inlineNode

public void inlineNode(VRMLGroupingNodeType parent,
                       VRMLInlineNodeType inline,
                       boolean used)
Notification of an inline node.

Parameters:
parent - The parent group of this node
inline - The inline node that has been found
used - true if the node reference is actually a USE

lightNode

public void lightNode(VRMLGroupingNodeType parent,
                      VRMLLightNodeType light,
                      boolean used)
Notification of a light node.

Parameters:
parent - The parent group of this node
light - The light node that has been found
used - true if the node reference is actually a USE

bindableNode

public void bindableNode(VRMLGroupingNodeType parent,
                         VRMLBindableNodeType bindable,
                         boolean used)
Notification of a bindable node.

Parameters:
parent - The parent group of this node
bindable - The bindable node that has been found
used - true if the node reference is actually a USE

shapeNode

public void shapeNode(VRMLGroupingNodeType parent,
                      VRMLShapeNodeType shape,
                      boolean used)
Notification of a shape node.

Parameters:
parent - The parent group of this node
shape - The shape node that has been found
used - true if the node reference is actually a USE

appearanceNode

public void appearanceNode(VRMLShapeNodeType parent,
                           VRMLAppearanceNodeType appearance,
                           boolean used)
Notification of an appearance node.

Parameters:
parent - The parent shape node of this node
appearance - The appearance node that has been found
used - true if the node reference is actually a USE

materialNode

public void materialNode(VRMLAppearanceNodeType parent,
                         VRMLMaterialNodeType material,
                         boolean used)
Notification of a Material node.

Parameters:
parent - The parent appearance of this node
material - The material node that has been found
used - true if the node reference is actually a USE

textureNode

public void textureNode(VRMLAppearanceNodeType parent,
                        VRMLTextureNodeType texture,
                        boolean used)
Notification of a texture node. If the node is a movie texture node it will be reported here as well as the audioclip notification when the child of a sound node.

Parameters:
parent - The parent appearance of this node
texture - The texture node that has been found
used - true if the node reference is actually a USE

textureTransformNode

public void textureTransformNode(VRMLAppearanceNodeType parent,
                                 VRMLTextureTransformNodeType transform,
                                 boolean used)
Notification of a TextureTransform node.

Parameters:
parent - The parent appearance of this node
transform - The texture transform node that has been found
used - true if the node reference is actually a USE

geometryNode

public void geometryNode(VRMLShapeNodeType parent,
                         VRMLGeometryNodeType geometry,
                         boolean used)
Notification of a geometry node.

Parameters:
parent - The parent shape node of this node
geometry - The geometry node that has been found
used - true if the node reference is actually a USE

geometricPropertyNode

public void geometricPropertyNode(VRMLComponentGeometryNodeType parent,
                                  VRMLGeometricPropertyNodeType geoprop,
                                  boolean used)
Notification of a geometric property node.

Parameters:
parent - The parent component geometry of this node
geoprop - The geometric property node that has been found
used - true if the node reference is actually a USE

soundNode

public void soundNode(VRMLGroupingNodeType parent,
                      VRMLSoundNodeType sound,
                      boolean used)
Notification of a sound node.

Parameters:
parent - The parent group of this node
sound - The sound node that has been found
used - true if the node reference is actually a USE

audioClipNode

public void audioClipNode(VRMLSoundNodeType parent,
                          VRMLAudioClipNodeType clip,
                          boolean used)
Notification of an AudioClip based node. This may be a movie texture or ordinary audio clip node.

Parameters:
parent - The parent sound node of this node
clip - The audioclip node that has been found
used - true if the node reference is actually a USE

sensorNode

public void sensorNode(VRMLGroupingNodeType parent,
                       VRMLSensorNodeType sensor,
                       boolean used)
Notification of any form of sensor node. Anchors are not considered to be an anchor node.

Parameters:
parent - The parent group of this node
sensor - The sensor node that has been found
used - true if the node reference is actually a USE

interpolatorNode

public void interpolatorNode(VRMLGroupingNodeType parent,
                             VRMLInterpolatorNodeType interp,
                             boolean used)
Notification of any form of interpolator node

Parameters:
parent - The parent group of this node
interp - The interpolator node that has been found
used - true if the node reference is actually a USE

scriptNode

public void scriptNode(VRMLGroupingNodeType parent,
                       VRMLScriptNodeType script,
                       boolean used)
Notification of a script node.

Parameters:
parent - The parent group of this node
script - The script node that has been found
used - true if the node reference is actually a USE

protoNode

public void protoNode(VRMLNodeType parent,
                      VRMLProtoInstance proto,
                      boolean used)
Notification of a proto instance.

Parameters:
parent - The parent node of this node
proto - The proto node that has been found
used - true if the node reference is actually a USE

customNode

public void customNode(VRMLNodeType parent,
                       int fieldIndex,
                       VRMLNodeType child,
                       boolean used)
Notification of a custom node that defines its own children types. A typical custom node is a proto or script.

Parameters:
parent - The parent node of this node
fieldIndex - The index of the field that the child belongs to
child - The child node that has been found
used - true if the node reference is actually a USE

miscellaneousNode

public void miscellaneousNode(VRMLNodeType parent,
                              int fieldIndex,
                              VRMLNodeType node,
                              boolean used)
Notification of an unknown or miscellaneous node type that does not fit into any of the other categories. For example WorldInfo.

Parameters:
parent - The parent node of this node
fieldIndex - The index of the field that the child belongs to
node - The node that has been found
used - true if the node reference is actually a USE

Xj3D VRML/X3D Code API

Copyright © 2001 - 2005 Web3D Consortium