javax.media.j3d
Class SwitchRetained

java.lang.Object
  extended by javax.media.j3d.IndexedObject
      extended by javax.media.j3d.SceneGraphObjectRetained
          extended by javax.media.j3d.NodeRetained
              extended by javax.media.j3d.GroupRetained
                  extended by javax.media.j3d.SwitchRetained
All Implemented Interfaces:
java.lang.Cloneable, BHLeafInterface, NnuId, TargetsInterface

 class SwitchRetained
extends GroupRetained
implements TargetsInterface

The switch node controls which one of its children will be rendered.


Field Summary
(package private) static int BEHAVIOR_NODES
           
(package private) static int BOUNDINGLEAF_NODES
           
(package private)  java.util.BitSet childMask
          The BitSet specifying which children are to be selected for rendering.
(package private)  java.util.ArrayList childrenSwitchStates
           
(package private) static int ENV_NODES
           
(package private) static int GEO_NODES
           
(package private)  boolean isDirty
           
(package private)  java.util.BitSet renderChildMask
          The childmask bitset used for rendering
(package private) static int SOUND_NODES
           
(package private)  int switchIndexCount
           
(package private)  HashKey switchKey
           
(package private)  java.util.ArrayList switchLevels
           
(package private)  UpdateTargets updateTargets
           
(package private)  int whichChild
          The value specifing which child to render.
 
Fields inherited from class javax.media.j3d.GroupRetained
allocatedAltApps, allocatedFogs, allocatedLights, allocatedMclips, altAppearances, bhLeafNode, children, childrenSwitchLinks, collisionBound, collisionTarget, collisionVwcBounds, compiledChildrenList, fogs, inViewSpecificGroup, isInClearLive, isRoot, key, lights, locale, mirrorGroup, modelClips, orderedPaths, parentSwitchLinkChildIndex, scopingRefCount, sourceNode, viewLists
 
Fields inherited from class javax.media.j3d.NodeRetained
ALTERNATEAPPEARANCE, AMBIENTLIGHT, apiBounds, BACKGROUND, BACKGROUNDSOUND, BEHAVIOR, BOUNDINGLEAF, boundsAutoCompute, BRANCHGROUP, branchGroupPaths, cachedBounds, childIndex, CLIP, collidable, CONESOUND, CONTAINS_VIEWPLATFORM, CURRENT_LOCAL_TO_VWORLD, DECALGROUP, DIRECTIONALLIGHT, EXPONENTIALFOG, geometryBackground, GROUP, inSharedGroup, LAST_LOCAL_TO_VWORLD, LINEARFOG, LINK, localBounds, localToVworld, localToVworldIndex, localToVworldKeys, MODELCLIP, MORPH, nnuId, nodeId, nodeType, NUMNODES, ORDEREDGROUP, orderedId, ORIENTEDSHAPE3D, parent, parentSwitchLink, parentTransformLink, pickable, POINTLIGHT, POINTSOUND, refCount, SHAPE, SHAREDGROUP, SOUNDSCAPE, SPOTLIGHT, staticTransform, SWITCH, TRANSFORMGROUP, universe, validCachedBounds, VIEWPLATFORM, VIEWSPECIFICGROUP
 
Fields inherited from class javax.media.j3d.SceneGraphObjectRetained
DONT_MERGE, inBackgroundGroup, inSetLive, MERGE, MERGE_DONE, mergeFlag, onUpdateList, source
 
Fields inherited from class javax.media.j3d.IndexedObject
listIdx
 
Fields inherited from interface javax.media.j3d.TargetsInterface
SWITCH_TARGETS, TRANSFORM_TARGETS
 
Constructor Summary
SwitchRetained()
           
 
Method Summary
(package private)  void appendChildrenData()
           
(package private)  void childDoSetLive(NodeRetained child, int childIndex, SetLiveState s)
           
(package private)  void clearLive(SetLiveState s)
          This version of clearLive calls clearLive on all of its chidren.
(package private)  void compile(CompileState compState)
          Compiles the children of the switch, preventing shape merging at this level or above
(package private)  void computeCombineBounds(Bounds bounds)
          ONLY needed for SHAPE, MORPH, and LINK node type.
 void computeTargetThreads(int type, CachedTargets[] newCt)
           
 void copyCachedTargets(int type, CachedTargets[] newCt)
           
(package private)  Node currentChild()
          Returns the current child.
(package private)  Bounds getBounds()
          Gets the bounding object of a node.
 CachedTargets getCachedTargets(int type, int index, int child)
           
(package private)  java.util.BitSet getChildMask()
          Returns the current childMask.
(package private)  TargetsInterface getClosestTargetsInterface(int type)
           
 java.util.ArrayList getTargetsData(int type, int child)
           
 int getTargetThreads(int type)
           
(package private)  int getWhichChild()
          Returns the index of the current child.
(package private)  void initRenderChildMask()
           
(package private)  void insertChildrenData(int index)
           
 void propagateTargetThreads(int type, int newTargetThreads)
           
(package private)  void removeChildrenData(int index)
           
(package private)  void removeNodeData(SetLiveState s)
          remove the localToVworld transform for this node.
 void resetCachedTargets(int type, CachedTargets[] newCtArr, int child)
           
(package private)  void sendMessage(java.util.ArrayList updateList)
           
(package private)  void setAuxData(SetLiveState s, int index, int hkIndex)
           
(package private)  void setChildMask(java.util.BitSet childMask)
          Sets current childMask.
(package private)  void setLive(SetLiveState s)
           
(package private)  void setNodeData(SetLiveState s)
           
(package private)  void setWhichChild(int whichChild, boolean updateAlways)
          Sets which child should be drawn.
(package private)  void traverseSwitchChild(int child, HashKey key, int index, SwitchRetained switchRoot, boolean init, boolean swChanged, boolean switchOn, int switchLevel, java.util.ArrayList updateList)
           
(package private)  void traverseSwitchParent()
           
 void updateCachedTargets(int type, CachedTargets[] newCt)
           
(package private)  void updateSwitchChild(int child, boolean switchOn, java.util.ArrayList updateList)
           
 void updateTargetThreads(int type, CachedTargets[] newCt)
           
 
Methods inherited from class javax.media.j3d.GroupRetained
addAllNodesForScopedAltApp, addAllNodesForScopedFog, addAllNodesForScopedLight, addAllNodesForScopedModelClip, addAltApp, addChild, addFog, addLight, addModelClip, checkClearLive, checkClearLive, checkSetLive, checkSetLive, checkValidChild, childCheckSetLive, computeBoundingHull, createMirrorGroup, doAddChild, doInsertChild, doMoveTo, doRemoveChild, doSetChild, doSetLive, findSwitchInfo, gatherBlUsers, getAllChildren, getAlternateCollisionTarget, getChild, getCollisionBounds, getEffectiveBounds, getLocale2, indexOfChild, initSwitchStates, initTransformStates, insertChild, isEnable, isEnable, isNodeSwitchOn, isStatic, isStaticChildren, merge, moveTo, numChildren, processAddNodesForScopedAltApp, processAddNodesForScopedFog, processAddNodesForScopedModelClip, processAllNodesForScopedLight, processCollisionTarget, processRemoveAllNodesForScopedFog, processRemoveAllNodesForScopedLight, processRemoveAllNodesForScopedModelClip, processRemoveNodesForScopedAltApp, processViewSpecificInfo, removeAllChildren, removeAllNodesForScopedAltApp, removeAllNodesForScopedFog, removeAllNodesForScopedLight, removeAllNodesForScopedModelClip, removeAltApp, removeAltAppScope, removeChild, removeChild, removeFog, removeFogScope, removeLight, removeLightScope, removeMclipScope, removeModelClip, searchGeometryAtoms, setAltAppScope, setAlternateCollisionTarget, setBounds, setBoundsAutoCompute, setChild, setCollisionBounds, setCompiled, setFogScope, setLightScope, setMclipScope, setScopingInfo, traverse, updateCollidable, updateLocalToVworld, updatePickable, updateSwitchStates, updateTransformStates, usedInScoping, validSwitchChild
 
Methods inherited from class javax.media.j3d.NodeRetained
computeNonLiveLocalToVworld, dirtyBoundsCache, equal, findCollidableFlags, findPickableFlags, findTransformLevels, getBoundsAutoCompute, getCollidable, getCurrentLocalToVworld, getCurrentLocalToVworld, getCurrentLocalToVworld, getId, getLastLocalToVworld, getLastLocalToVworld, getLastLocalToVworld, getLocalBounds, getLocale, getLocalToVworld, getLocalToVworld, getLocalToVworld, getParent, getPickable, getVirtualUniverse, mergeTransform, notifySceneGraphChanged, recombineAbove, setCollidable, setParent, setPickable, transformBounds
 
Methods inherited from class javax.media.j3d.SceneGraphObjectRetained
clearLive, clearLive, clone, doSetLive, getSource, handleFrequencyChange, isInSetLive, markAsLive, setLive, setSource
 
Methods inherited from class javax.media.j3d.IndexedObject
getIdxUsed, incIdxUsed
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GEO_NODES

static final int GEO_NODES
See Also:
Constant Field Values

ENV_NODES

static final int ENV_NODES
See Also:
Constant Field Values

BEHAVIOR_NODES

static final int BEHAVIOR_NODES
See Also:
Constant Field Values

SOUND_NODES

static final int SOUND_NODES
See Also:
Constant Field Values

BOUNDINGLEAF_NODES

static final int BOUNDINGLEAF_NODES
See Also:
Constant Field Values

whichChild

int whichChild
The value specifing which child to render.


childMask

java.util.BitSet childMask
The BitSet specifying which children are to be selected for rendering. This is used ONLY if whichChild is set to CHILD_MASK.


renderChildMask

java.util.BitSet renderChildMask
The childmask bitset used for rendering


isDirty

boolean isDirty

switchLevels

java.util.ArrayList switchLevels

switchKey

HashKey switchKey

switchIndexCount

int switchIndexCount

updateTargets

UpdateTargets updateTargets

childrenSwitchStates

java.util.ArrayList childrenSwitchStates
Constructor Detail

SwitchRetained

SwitchRetained()
Method Detail

setWhichChild

void setWhichChild(int whichChild,
                   boolean updateAlways)
Sets which child should be drawn.

Parameters:
whichChild - the child to choose during a render operation

getWhichChild

int getWhichChild()
Returns the index of the current child.

Returns:
the default child's index

setChildMask

final void setChildMask(java.util.BitSet childMask)
Sets current childMask.

Parameters:
childMask - a BitSet to select the children for rendering

sendMessage

void sendMessage(java.util.ArrayList updateList)

getChildMask

final java.util.BitSet getChildMask()
Returns the current childMask.

Returns:
the current childMask

currentChild

Node currentChild()
Returns the current child.

Returns:
the current child

updateSwitchChild

void updateSwitchChild(int child,
                       boolean switchOn,
                       java.util.ArrayList updateList)

setAuxData

void setAuxData(SetLiveState s,
                int index,
                int hkIndex)
Overrides:
setAuxData in class NodeRetained

setNodeData

void setNodeData(SetLiveState s)
Overrides:
setNodeData in class GroupRetained

setLive

void setLive(SetLiveState s)
Overrides:
setLive in class GroupRetained

removeNodeData

void removeNodeData(SetLiveState s)
Description copied from class: NodeRetained
remove the localToVworld transform for this node.

Overrides:
removeNodeData in class GroupRetained

clearLive

void clearLive(SetLiveState s)
Description copied from class: GroupRetained
This version of clearLive calls clearLive on all of its chidren.

Overrides:
clearLive in class GroupRetained

initRenderChildMask

void initRenderChildMask()

traverseSwitchChild

void traverseSwitchChild(int child,
                         HashKey key,
                         int index,
                         SwitchRetained switchRoot,
                         boolean init,
                         boolean swChanged,
                         boolean switchOn,
                         int switchLevel,
                         java.util.ArrayList updateList)

traverseSwitchParent

void traverseSwitchParent()

computeCombineBounds

void computeCombineBounds(Bounds bounds)
Description copied from class: NodeRetained
ONLY needed for SHAPE, MORPH, and LINK node type. Compute the combine bounds of bounds and its localBounds.

Overrides:
computeCombineBounds in class GroupRetained

getBounds

Bounds getBounds()
Gets the bounding object of a node.

Overrides:
getBounds in class GroupRetained
Returns:
the node's bounding object

compile

void compile(CompileState compState)
Compiles the children of the switch, preventing shape merging at this level or above

Overrides:
compile in class GroupRetained

insertChildrenData

void insertChildrenData(int index)
Overrides:
insertChildrenData in class GroupRetained

appendChildrenData

void appendChildrenData()
Overrides:
appendChildrenData in class GroupRetained

removeChildrenData

void removeChildrenData(int index)
Overrides:
removeChildrenData in class GroupRetained

childDoSetLive

void childDoSetLive(NodeRetained child,
                    int childIndex,
                    SetLiveState s)
Overrides:
childDoSetLive in class GroupRetained

getClosestTargetsInterface

TargetsInterface getClosestTargetsInterface(int type)
Overrides:
getClosestTargetsInterface in class GroupRetained

getCachedTargets

public CachedTargets getCachedTargets(int type,
                                      int index,
                                      int child)
Specified by:
getCachedTargets in interface TargetsInterface

resetCachedTargets

public void resetCachedTargets(int type,
                               CachedTargets[] newCtArr,
                               int child)
Specified by:
resetCachedTargets in interface TargetsInterface

getTargetsData

public java.util.ArrayList getTargetsData(int type,
                                          int child)
Specified by:
getTargetsData in interface TargetsInterface

getTargetThreads

public int getTargetThreads(int type)
Specified by:
getTargetThreads in interface TargetsInterface

updateCachedTargets

public void updateCachedTargets(int type,
                                CachedTargets[] newCt)
Specified by:
updateCachedTargets in interface TargetsInterface

computeTargetThreads

public void computeTargetThreads(int type,
                                 CachedTargets[] newCt)
Specified by:
computeTargetThreads in interface TargetsInterface

updateTargetThreads

public void updateTargetThreads(int type,
                                CachedTargets[] newCt)
Specified by:
updateTargetThreads in interface TargetsInterface

propagateTargetThreads

public void propagateTargetThreads(int type,
                                   int newTargetThreads)
Specified by:
propagateTargetThreads in interface TargetsInterface

copyCachedTargets

public void copyCachedTargets(int type,
                              CachedTargets[] newCt)
Specified by:
copyCachedTargets in interface TargetsInterface


Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.