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.

Variable Index

 o ALL_NODES
All context interests.
 o AUX_NODES
Visit those nodes within auxiliary nodes (whose context is an AuxNodeTreeContext object).
 o COMPLETE_GROUP_TRAVERSAL
Similar to GROUP_TRAVERSAL; but for SwitchNodes and LODNodes, all children will be traversed.
 o COMPLETE_LEAF_TRAVERSAL
Similar to LEAF_TRAVERSAL; but for SwitchNodes and LODNodes, all children will be traversed.
 o contextInterest
 o DEFAULT_NODES
The default context interest: (NORMAL_NODES | EMBEDDED_NODES).
 o EMBEDDED_NODES
Visit those nodes embedded within InlineNodes and prototypes (whose context is an EmbeddedNodeTreeContext object).
 o GROUP_TRAVERSAL
Traverse just the main scene graph hierarchy; visit() will be called only with grouping and leaf nodes (or instances of same).
 o LEAF_TRAVERSAL
Traverse all (i.e.
 o mappingType
 o NORMAL_NODES
Visit those nodes within the main scene (whose context is the SceneContext object).
 o POST_ORDER_MAPPING
Visit a node or instance after visiting its children.
 o PRE_ORDER_MAPPING
Visit a node or instance before visiting its children.
 o traversalType

Constructor Index

 o Traversal()
Construct a traversal with a traversal type of GROUP_TRAVERSAL and a context interest of DEFAULT_NODES.
 o Traversal(int)
Construct a traversal with the specified traversal type and a context interest of DEFAULT_NODES.
 o Traversal(int, int)
Construct a traversal with the specified traversal type and context interest.

Method Index

 o contextToContextInterest(NodeTreeContext)
 o getContextInterest()
Get the context interest of this traversal.
 o getMappingType()
Get the type of mapping that will happen.
 o getTraversalType()
Get the type of this traversal.
 o setContextInterest(int)
Specify which ndoe you want traversed.

Variables

 o 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.
 o 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.
 o COMPLETE_GROUP_TRAVERSAL
  public final static int COMPLETE_GROUP_TRAVERSAL
Similar to GROUP_TRAVERSAL; but for SwitchNodes and LODNodes, all children will be traversed.
 o COMPLETE_LEAF_TRAVERSAL
  public final static int COMPLETE_LEAF_TRAVERSAL
Similar to LEAF_TRAVERSAL; but for SwitchNodes and LODNodes, all children will be traversed.
 o 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.
 o POST_ORDER_MAPPING
  public final static int POST_ORDER_MAPPING
Visit a node or instance after visiting its children.
 o traversalType
  protected int traversalType
 o contextInterest
  protected int contextInterest
 o mappingType
  protected int mappingType
 o NORMAL_NODES
  public final static int NORMAL_NODES
Visit those nodes within the main scene (whose context is the SceneContext object).
 o AUX_NODES
  public final static int AUX_NODES
Visit those nodes within auxiliary nodes (whose context is an AuxNodeTreeContext object).
 o EMBEDDED_NODES
  public final static int EMBEDDED_NODES
Visit those nodes embedded within InlineNodes and prototypes (whose context is an EmbeddedNodeTreeContext object).
 o DEFAULT_NODES
  public final static int DEFAULT_NODES
The default context interest: (NORMAL_NODES | EMBEDDED_NODES).
 o ALL_NODES
  public final static int ALL_NODES
All context interests.

Constructors

 o Traversal
  public Traversal()
Construct a traversal with a traversal type of GROUP_TRAVERSAL and a context interest of DEFAULT_NODES.
 o Traversal
  public Traversal(int traversalType)
Construct a traversal with the specified traversal type and a context interest of DEFAULT_NODES.
 o Traversal
  public Traversal(int traversalType,
                   int contextInterest)
Construct a traversal with the specified traversal type and context interest.

Methods

 o getTraversalType
  public final int getTraversalType()
Get the type of this traversal.
 o getMappingType
  public final int getMappingType()
Get the type of mapping that will happen.
 o getContextInterest
  public final int getContextInterest()
Get the context interest of this traversal. See setContextInterest().
 o 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.
 o contextToContextInterest
  protected static int contextToContextInterest(NodeTreeContext context)

All Packages  Class Hierarchy  This Package  Previous  Next  Index