de.grogra.imp3d.objects
Class SceneTreeWithShader

java.lang.Object
  extended by de.grogra.imp3d.objects.SceneTree
      extended by de.grogra.imp3d.objects.SceneTreeWithShader
All Implemented Interfaces:
Visitor, javax.swing.tree.TreeModel
Direct Known Subclasses:
Tree

public abstract class SceneTreeWithShader
extends SceneTree

This class extends SceneTree and keeps track of the current shader and interior. These additional parameters are stored in the corresponding fields of the Leaf class.

Author:
Ole Kniemeyer

Nested Class Summary
static class SceneTreeWithShader.Leaf
          This subclass of SceneTree.Leaf stores the shader and interior which are associated with the object of the leaf.
 
Nested classes/interfaces inherited from class de.grogra.imp3d.objects.SceneTree
SceneTree.InnerNode, SceneTree.Node, SceneTree.Visitor
 
Field Summary
 
Fields inherited from class de.grogra.imp3d.objects.SceneTree
state
 
Fields inherited from interface de.grogra.graph.Visitor
STOP
 
Constructor Summary
SceneTreeWithShader(GraphState gs, EdgePattern pattern)
           
SceneTreeWithShader(View3D scene)
           
 
Method Summary
protected  Interior getCurrentInterior()
           
protected  Shader getCurrentShader()
           
protected  void init(SceneTree.Leaf leaf)
          This method has to be invoked whenever a new SceneTree.Leaf is created as a leaf of this tree.
protected  Shader resolveShader(Shader shader)
           
 boolean visitLeave(java.lang.Object o, Path path, boolean node)
          Informs this visitor that a node or an edge has been processed completely.
 
Methods inherited from class de.grogra.imp3d.objects.SceneTree
accept, acceptLeaf, addTreeModelListener, createInnerNode, createLeaf, createTree, createTree, getChild, getChildCount, getGraphState, getIndexOfChild, getRoot, isLeaf, removeTreeModelListener, valueForPathChanged, visitEnter, visitInstanceEnter, visitInstanceLeave
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SceneTreeWithShader

public SceneTreeWithShader(GraphState gs,
                           EdgePattern pattern)

SceneTreeWithShader

public SceneTreeWithShader(View3D scene)
Method Detail

getCurrentInterior

protected Interior getCurrentInterior()

getCurrentShader

protected Shader getCurrentShader()

init

protected void init(SceneTree.Leaf leaf)
Description copied from class: SceneTree
This method has to be invoked whenever a new SceneTree.Leaf is created as a leaf of this tree. The tree may perform some initialization tasks on the leaf.

Overrides:
init in class SceneTree
Parameters:
leaf - a newly created Leaf to be initialized

resolveShader

protected Shader resolveShader(Shader shader)

visitLeave

public boolean visitLeave(java.lang.Object o,
                          Path path,
                          boolean node)
Description copied from interface: Visitor
Informs this visitor that a node or an edge has been processed completely. The value o is the return value of the corresponding invocation of Visitor.visitEnter(de.grogra.graph.Path, boolean). In case of a node and if this invocation returns false, no further edges of the current level of hierarchy will be passed to this visitor, i.e., the visitLeave methods for the enclosing edge and node will be invoked immediately. Likewise, in case of an edge and a return value false, no further instantiations or edges of the current level of hierarchy will be passed to this visitor, i.e., the visitLeave method for the enclosing node will be invoked immediately.

Specified by:
visitLeave in interface Visitor
Overrides:
visitLeave in class SceneTree
Parameters:
o - returned value of visitEnter
path - current path to node
node - do we leave a node or an edge?
Returns:
true iff processing of current level shall be continued