|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.mines.jtk.sgl.TraversalContext
public class TraversalContext
A context for scene graph traversal. A traversal context maintains a current node and a list of its parent nodes. Because nodes in the scene graph may have multiple parents, a node may become current at more than time during a traversal, each time with a different list of parent nodes.
| Constructor Summary | |
|---|---|
TraversalContext()
|
|
| Method Summary | |
|---|---|
int |
countNodes()
Returns the number of current and parent nodes in this traversal. |
Node |
getNode()
Gets the current node in this traversal. |
Node |
getNode(int index)
Gets the node in this traversal with specified index. |
Node[] |
getNodes()
Gets an array of nodes representing the state of this traversal. |
void |
popNode()
Restores the most recently saved (pushed) node. |
void |
pushNode(Node node)
Saves the current node, and then makes the specified node current. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TraversalContext()
| Method Detail |
|---|
public int countNodes()
public Node getNode()
public Node getNode(int index)
countNodes(), then the
current node has index count-1, and the root node has index zero.
If the specified index is negative, then count is added to the index. Therefore, the index -1 will get the current node, the index -2 will get its parent node, and so on.
index - the index.
public Node[] getNodes()
public void pushNode(Node node)
node - the new current node.public void popNode()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||