Class dnx.lr.Traversal
All Packages Class Hierarchy This Package Previous Next Index
Class dnx.lr.Traversal
java.lang.Object
|
+----dnx.util.DNXObject
|
+----dnx.util.DNXInstancedObject
|
+----dnx.lr.Action
|
+----dnx.lr.Traversal
- public class Traversal
- extends Action
A traversal object is used to effect a traversal of all (or maybe
some) of the nodes or instances in a scene graph. The traversal is
normally done using a pre-order depth-first search (but can be
changed to post-order depth-first). The different traversal types
control which types of nodes or instances are visited. The
traversal object itself is subclassed to specify the actual behavior
that happens at each visited node or instance, and also contains any
state information maintained during the traversal.
The traversal actually "happens" when the traverse() method of a
traversal is called. Creating a Traversal object doesn't make a
traversal happen.
Note that a return value of PRUNE from visit() only makes sense when
doing a pre-order traversal; it's equivalent to CONTINUE when doing
a post-order traversal.
-
ALL_NODES
- All context interests.
-
AUX_NODES
- Visit those nodes within auxiliary nodes (whose context is an
AuxNodeTreeContext object).
-
COMPLETE_GROUP_TRAVERSAL
- Similar to GROUP_TRAVERSAL; but for SwitchNodes and LODNodes,
all children will be traversed.
-
COMPLETE_LEAF_TRAVERSAL
- Similar to LEAF_TRAVERSAL; but for SwitchNodes and LODNodes,
all children will be traversed.
-
contextInterest
-
-
DEFAULT_NODES
- The default context interest: (NORMAL_NODES | EMBEDDED_NODES).
-
EMBEDDED_NODES
- Visit those nodes embedded within InlineNodes and prototypes
(whose context is an EmbeddedNodeTreeContext object).
-
GROUP_TRAVERSAL
- Traverse just the main scene graph hierarchy; visit() will
be called only with grouping and leaf nodes (or instances
of same).
-
LEAF_TRAVERSAL
- Traverse all (i.e.
-
mappingType
-
-
NORMAL_NODES
- Visit those nodes within the main scene (whose context is the
SceneContext object).
-
POST_ORDER_MAPPING
- Visit a node or instance after visiting its children.
-
PRE_ORDER_MAPPING
- Visit a node or instance before visiting its children.
-
traversalType
-
-
Traversal()
- Construct a traversal with a traversal type of GROUP_TRAVERSAL
and a context interest of DEFAULT_NODES.
-
Traversal(int)
- Construct a traversal with the specified traversal type
and a context interest of DEFAULT_NODES.
-
Traversal(int, int)
- Construct a traversal with the specified traversal type
and context interest.
-
contextToContextInterest(NodeTreeContext)
-
-
getContextInterest()
- Get the context interest of this traversal.
-
getMappingType()
- Get the type of mapping that will happen.
-
getTraversalType()
- Get the type of this traversal.
-
setContextInterest(int)
- Specify which ndoe you want traversed.
GROUP_TRAVERSAL
public final static int GROUP_TRAVERSAL
- Traverse just the main scene graph hierarchy; visit() will
be called only with grouping and leaf nodes (or instances
of same). For SwitchNodes and LODNodes, only the active child
will be traversed.
LEAF_TRAVERSAL
public final static int LEAF_TRAVERSAL
- Traverse all (i.e. grouping, leaf, and subsidiary) nodes.
For SwitchNodes and LODNodes, only the active child
will be traversed.
COMPLETE_GROUP_TRAVERSAL
public final static int COMPLETE_GROUP_TRAVERSAL
- Similar to GROUP_TRAVERSAL; but for SwitchNodes and LODNodes,
all children will be traversed.
COMPLETE_LEAF_TRAVERSAL
public final static int COMPLETE_LEAF_TRAVERSAL
- Similar to LEAF_TRAVERSAL; but for SwitchNodes and LODNodes,
all children will be traversed.
PRE_ORDER_MAPPING
public final static int PRE_ORDER_MAPPING
- Visit a node or instance before visiting its children. This is
the default for almost all traversals.
POST_ORDER_MAPPING
public final static int POST_ORDER_MAPPING
- Visit a node or instance after visiting its children.
traversalType
protected int traversalType
contextInterest
protected int contextInterest
mappingType
protected int mappingType
NORMAL_NODES
public final static int NORMAL_NODES
- Visit those nodes within the main scene (whose context is the
SceneContext object).
AUX_NODES
public final static int AUX_NODES
- Visit those nodes within auxiliary nodes (whose context is an
AuxNodeTreeContext object).
EMBEDDED_NODES
public final static int EMBEDDED_NODES
- Visit those nodes embedded within InlineNodes and prototypes
(whose context is an EmbeddedNodeTreeContext object).
DEFAULT_NODES
public final static int DEFAULT_NODES
- The default context interest: (NORMAL_NODES | EMBEDDED_NODES).
ALL_NODES
public final static int ALL_NODES
- All context interests.
Traversal
public Traversal()
- Construct a traversal with a traversal type of GROUP_TRAVERSAL
and a context interest of DEFAULT_NODES.
Traversal
public Traversal(int traversalType)
- Construct a traversal with the specified traversal type
and a context interest of DEFAULT_NODES.
Traversal
public Traversal(int traversalType,
int contextInterest)
- Construct a traversal with the specified traversal type
and context interest.
getTraversalType
public final int getTraversalType()
- Get the type of this traversal.
getMappingType
public final int getMappingType()
- Get the type of mapping that will happen.
getContextInterest
public final int getContextInterest()
- Get the context interest of this traversal.
See setContextInterest().
setContextInterest
public void setContextInterest(int contextInterest)
- Specify which ndoe you want traversed. INTEREST can be either
NORMAL_NODES (only the nodes that are actually part of the scene
itself), AUX_NODES (only the auxiliary nodes attached to the
scene, such as selection boxes), EMBEDDED_NODES (only the nodes
within inlines and prototypes) or some combination of the above, using
the | operator to combine flags. You can also use ALL_NODES
to refer to the combination of all possible flags.
contextToContextInterest
protected static int contextToContextInterest(NodeTreeContext context)
All Packages Class Hierarchy This Package Previous Next Index