javax.media.j3d
Class LOD

java.lang.Object
  |
  +--javax.media.j3d.SceneGraphObject
        |
        +--javax.media.j3d.Node
              |
              +--javax.media.j3d.Leaf
                    |
                    +--javax.media.j3d.Behavior
                          |
                          +--javax.media.j3d.LOD
Direct Known Subclasses:
DistanceLOD

public abstract class LOD
extends Behavior

An LOD leaf node is an abstract behavior class that operates on a list of Switch group nodes to selects one of the children of the Switch nodes. The LOD class is extended to implement various selection criteria.


Fields inherited from class javax.media.j3d.Node
ALLOW_AUTO_COMPUTE_BOUNDS_READ, ALLOW_AUTO_COMPUTE_BOUNDS_WRITE, ALLOW_BOUNDS_READ, ALLOW_BOUNDS_WRITE, ALLOW_COLLIDABLE_READ, ALLOW_COLLIDABLE_WRITE, ALLOW_LOCAL_TO_VWORLD_READ, ALLOW_PICK, ALLOW_PICKABLE_READ, ALLOW_PICKABLE_WRITE, ENABLE_COLLISION_REPORTING, ENABLE_PICK_REPORTING
 
Constructor Summary
LOD()
          Constructs and initializes an LOD node.
 
Method Summary
 void addSwitch(Switch switchNode)
          Appends the specified switch node to this LOD's list of switches.
 java.util.Enumeration getAllSwitches()
          Returns the enumeration object of all switches.
 Switch getSwitch(int index)
          Returns the switch node specified by the index.
 void insertSwitch(Switch switchNode, int index)
          Inserts the specified switch node at specified index.
 int numSwitches()
          Returns a count of this LOD's switches.
 void removeSwitch(int index)
          Removes the switch node at specified index.
 void setSwitch(Switch switchNode, int index)
          Replaces the specified switch node with the switch node provided.
 void updateNodeReferences(NodeReferenceTable referenceTable)
          Callback used to allow a node to check if any nodes referenced by that node have been duplicated via a call to cloneTree.
 
Methods inherited from class javax.media.j3d.Behavior
duplicateNode, getEnable, getSchedulingBoundingLeaf, getSchedulingBounds, getView, initialize, postId, processStimulus, setEnable, setSchedulingBoundingLeaf, setSchedulingBounds, wakeupOn
 
Methods inherited from class javax.media.j3d.Node
cloneNode, cloneTree, cloneTree, cloneTree, getBounds, getBoundsAutoCompute, getCollidable, getLocalToVworld, getLocalToVworld, getParent, getPickable, setBounds, setBoundsAutoCompute, setCollidable, setPickable
 
Methods inherited from class javax.media.j3d.SceneGraphObject
clearCapability, duplicateSceneGraphObject, getCapability, getUserData, isCompiled, isLive, setCapability, setUserData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LOD

public LOD()
Constructs and initializes an LOD node.
Method Detail

addSwitch

public final void addSwitch(Switch switchNode)
Appends the specified switch node to this LOD's list of switches.
Parameters:
switchNode - the switch node to add to this LOD's list of switches

setSwitch

public final void setSwitch(Switch switchNode,
                            int index)
Replaces the specified switch node with the switch node provided.
Parameters:
switchNode - the new switch node
index - which switch node to replace

insertSwitch

public final void insertSwitch(Switch switchNode,
                               int index)
Inserts the specified switch node at specified index.
Parameters:
switchNode - the new switch node
index - position to insert new switch node at

removeSwitch

public final void removeSwitch(int index)
Removes the switch node at specified index.
Parameters:
index - which switch node to remove

getSwitch

public final Switch getSwitch(int index)
Returns the switch node specified by the index.
Parameters:
index - which switch node to return
Returns:
the switch node at location index

getAllSwitches

public final java.util.Enumeration getAllSwitches()
Returns the enumeration object of all switches.
Returns:
the enumeration object of all switches

numSwitches

public final int numSwitches()
Returns a count of this LOD's switches.
Returns:
the number of switches controlled by this LOD

updateNodeReferences

public void updateNodeReferences(NodeReferenceTable referenceTable)
Callback used to allow a node to check if any nodes referenced by that node have been duplicated via a call to cloneTree. This method is called by cloneTree after all nodes in the sub-graph have been duplicated. The cloned Leaf node's method will be called and the Leaf node can then look up any node references by using the getNewNodeReference method found in the NodeReferenceTable object. If a match is found, a reference to the corresponding Node in the newly cloned sub-graph is returned. If no corresponding reference is found, either a DanglingReferenceException is thrown or a reference to the original node is returned depending on the value of the allowDanglingReferences parameter passed in the cloneTree call.
Overrides:
updateNodeReferences in class Behavior
Parameters:
referenceTable - a NodeReferenceTableObject that contains the getNewNodeReference method needed to search for new object instances.
See Also:
NodeReferenceTable, Node.cloneTree(), DanglingReferenceException