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.
-
allowMultipleVisits
- If true, multiply-instanced nodes will be visited once per
instance.
-
NodeTraversal()
- Construct a traversal with a group traversal type and default
context interest.
-
NodeTraversal(int)
- Construct a traversal with a specified traversal type and default
context interest.
-
NodeTraversal(int, int)
- Construct a traversal with a specified traversal type and
context interest.
-
begin(Node)
- begin() is called when a traversal is about to begin.
-
childNodeMapperCallback(Node, Node, int, int, Object)
- You should definitely not call this yourself.
-
end(Node)
- end() is called when a traversal has just finished.
-
enter(Node)
- enter() is called when an MFNode or SFNode field is entered
during traversal.
-
leave(Node)
- leave() is called when an MFNode or SFNode field is left during
traversal.
-
traverse(Node)
- Perform a traversal of NODE and any of its children.
-
visit(Node)
- visit() is called when a node is visited during traversal.
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.
NodeTraversal
public NodeTraversal()
- Construct a traversal with a group traversal type and default
context interest.
NodeTraversal
public NodeTraversal(int traversalType)
- Construct a traversal with a specified traversal type and default
context interest.
NodeTraversal
public NodeTraversal(int traversalType,
int contextInterest)
- Construct a traversal with a specified traversal type and
context interest.
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.
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.
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.
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
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.
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.
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