Class dnx.lr.InstanceTraversal
All Packages Class Hierarchy This Package Previous Next Index
Class dnx.lr.InstanceTraversal
java.lang.Object
|
+----dnx.util.DNXObject
|
+----dnx.util.DNXInstancedObject
|
+----dnx.lr.Action
|
+----dnx.lr.Traversal
|
+----dnx.lr.InstanceTraversal
- public class InstanceTraversal
- extends Traversal
- implements ChildInstanceMapper
An InstanceTraversal searches over the scene graph of node
instances. If a node is instanced multiple times, this will
visit each instance. Note that the NodeInstance object passed
to the various callbacks below may not be unique to this
particular instance; however, if an instance is ever returned,
unique NodeInstance objects for that instance, and for all parent
instances back to the root, need to be created so that there
is a unique path to the NodeInstance object. This is done
with the InstanceReturningTraversal type.
If you want to traverse over only the currently existing
NodeInstance objects, do a node traversal and iterate
over each instance object attached to the node.
-
mapDataValue
- Value passed as mapData; normally the traversal object itself.
-
InstanceTraversal()
- Construct a traversal with a group traversal type and default
nodes interest.
-
InstanceTraversal(int)
- Construct a traversal with a specified traversal type and
default context interest.
-
InstanceTraversal(int, int)
- Construct a traversal with a specified traversal type and
context interest.
-
begin(NodeInstance)
- begin() is called when a traversal is about to begin.
-
childInstanceMapperCallback(NodeInstance, NodeInstance, int, int, Object)
- You should definitely not call this yourself.
-
end(NodeInstance)
- end() is called when a traversal has just finished.
-
enter(NodeInstance)
- enter() is called when an MFNode or SFNode field is entered
during traversal.
-
leave(NodeInstance)
- leave() is called when an MFNode or SFNode field is left during
traversal.
-
traverse(NodeInstance)
-
-
visit(NodeInstance)
- visit() is called when a node instance is visited during traversal.
mapDataValue
protected Object mapDataValue
- Value passed as mapData; normally the traversal object itself.
Uninterpreted by childInstanceMapperCallback() so it can be anything
you want.
InstanceTraversal
public InstanceTraversal()
- Construct a traversal with a group traversal type and default
nodes interest.
InstanceTraversal
public InstanceTraversal(int traversalType)
- Construct a traversal with a specified traversal type and
default context interest.
InstanceTraversal
public InstanceTraversal(int traversalType,
int contextInterest)
- Construct a traversal with a specified traversal type and
context interest.
traverse
public boolean traverse(NodeInstance inst)
begin
public void begin(NodeInstance inst)
- begin() is called when a traversal is about to begin.
INST is the root node instance of the tree that is being traversed.
You should reset anything that tracks state over the duration of
the traversal -- remember that the same traversal object can be
used multiple times.
If you override this, you *MUST* call this superclass begin method.
Don't call this yourself. It's called automatically.
end
public void end(NodeInstance inst)
- end() is called when a traversal has just finished.
INST is the root node instance 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(NodeInstance inst)
- visit() is called when a node instance 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
@param inst the node instance being visited
enter
public void enter(NodeInstance inst)
- 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.
@param inst the node instance whose field is being entered
@param nodeInd the index of the instance within its containing field
@param fieldInd the index of the field being entered
leave
public void leave(NodeInstance inst)
- 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.
childInstanceMapperCallback
public NodeInstance childInstanceMapperCallback(NodeInstance child,
NodeInstance 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