Class BaseSwitch

java.lang.Object
All Implemented Interfaces:
VRMLNode, FrameStateListener, VRMLBoundedNodeType, VRMLChildNodeType, VRMLGroupingNodeType, VRMLNodeType, VRMLWorldRootChildNodeType
Direct Known Subclasses:
NRSwitch, OGLSwitch

public class BaseSwitch extends BaseGroupingNode
common version of a Switch node.

This code assigns a LOD node as the implGroup. As this code is a grouping node, we allow the use of the children being specified as either the childre field or the level field. The former is VRML3.0 and the latter VRML 2.0

The LOD Behavior node is kept as a child of the group node that works here. When the VRML node is removed from the scene, the behavior is too. When the behavior is asked to be disabled, we just call the setEnable method on the behavior, we do not remove it.

If someone routes a range change to us, then we see if it is the same length. If it is, we just set the range values in the existing behavior. If not, then we have to replace the old LOD with a new LOD that has the correct number of nodes in it. If the size of the range grows such that it is greater than the number of children nodes, we disable the behavior until the number of children increase to the correct amount. In the branchgroup, the behavior is always

Version:
$Revision: 1.9 $
Author:
Alan Hudson