Class dnx.lr.NodeTraversal
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class dnx.lr.NodeTraversal

java.lang.Object
   |
   +----dnx.util.DNXObject
           |
           +----dnx.util.DNXInstancedObject
                   |
                   +----dnx.lr.Action
                           |
                           +----dnx.lr.Traversal
                                   |
                                   +----dnx.lr.NodeTraversal

public class NodeTraversal
extends Traversal
implements ChildNodeMapper
A NodeTraversal searches over the scene graph of nodes. Normally it will visit any particular node only once even if it is instanced in multiple places with different parents.

Variable Index

 o allowMultipleVisits
If true, multiply-instanced nodes will be visited once per instance.

Constructor Index

 o NodeTraversal()
Construct a traversal with a group traversal type and default context interest.
 o NodeTraversal(int)
Construct a traversal with a specified traversal type and default context interest.
 o NodeTraversal(int, int)
Construct a traversal with a specified traversal type and context interest.

Method Index

 o begin(Node)
begin() is called when a traversal is about to begin.
 o childNodeMapperCallback(Node, Node, int, int, Object)
You should definitely not call this yourself.
 o end(Node)
end() is called when a traversal has just finished.
 o enter(Node)
enter() is called when an MFNode or SFNode field is entered during traversal.
 o leave(Node)
leave() is called when an MFNode or SFNode field is left during traversal.
 o traverse(Node)
Perform a traversal of NODE and any of its children.
 o visit(Node)
visit() is called when a node is visited during traversal.

Variables

 o allowMultipleVisits
  protected boolean allowMultipleVisits
If true, multiply-instanced nodes will be visited once per instance. If false (the default), multiply-instanced nodes will be visited only once, period.

Constructors

 o NodeTraversal
  public NodeTraversal()
Construct a traversal with a group traversal type and default context interest.
 o NodeTraversal
  public NodeTraversal(int traversalType)
Construct a traversal with a specified traversal type and default context interest.
 o NodeTraversal
  public NodeTraversal(int traversalType,
                       int contextInterest)
Construct a traversal with a specified traversal type and context interest.

Methods

 o traverse
  public boolean traverse(Node node)
Perform a traversal of NODE and any of its children. The return value is true if the traversal was terminated early due to a visit() function having returned STOP. Don't confuse this with a traversal of a node instance. NOTE: If a node occurs multiple times in the scene, this will normally visit the node only once, unless the traversal object sets allowMultipleVisits to true.
 o begin
  public void begin(Node node)
begin() is called when a traversal is about to begin. NODE is the root node of the tree that is being traversed. If you override this, you *MUST* call this superclass begin method. Don't call this yourself. It's called automatically.
 o end
  public void end(Node node)
end() is called when a traversal has just finished. NODE is the root node of the tree that is being traversed. If you override this, you *MUST* call this superclass end method. Don't call this yourself. It's called automatically.
 o visit
  public abstract int visit(Node node)
visit() is called when a node is visited during traversal. The return value should be one of the three constants CONTINUE, STOP, or PRUNE. Don't call this yourself. It's called automatically. CONTINUE == continue traversing STOP == stop traversing PRUNE == don't traverse any children of this node, but otherwise continue
 o enter
  public void enter(Node node)
enter() is called when an MFNode or SFNode field is entered during traversal. This happens after the node containing the field is visited, and before visiting any of the child nodes within the field. If you override this, you *MUST* call this superclass enter method. Don't call this yourself. It's called automatically.
 o leave
  public void leave(Node node)
leave() is called when an MFNode or SFNode field is left during traversal. This happens right after visiting the last child node in the field. If you override this, you *MUST* call this superclass leave method. Don't call this yourself. It's called automatically.
 o childNodeMapperCallback
  public boolean childNodeMapperCallback(Node node,
                                         Node parent,
                                         int fieldind,
                                         int nodeind,
                                         Object mapData)
You should definitely not call this yourself. Override this if you want to change the way the traversal works.

All Packages  Class Hierarchy  This Package  Previous  Next  Index