javax.media.j3d
Class NodeRetained

java.lang.Object
  extended by javax.media.j3d.IndexedObject
      extended by javax.media.j3d.SceneGraphObjectRetained
          extended by javax.media.j3d.NodeRetained
All Implemented Interfaces:
java.lang.Cloneable, NnuId
Direct Known Subclasses:
GroupRetained, LeafRetained

abstract class NodeRetained
extends SceneGraphObjectRetained
implements NnuId

The Node class provides an abstract class for all Group and Leaf Nodes. It provides a common framework for constructing a Java 3D scene graph, including bounding volumes and parent pointers.


Field Summary
(package private) static int ALTERNATEAPPEARANCE
           
(package private) static int AMBIENTLIGHT
           
(package private)  Bounds apiBounds
           
(package private) static int BACKGROUND
           
(package private) static int BACKGROUNDSOUND
           
(package private) static int BEHAVIOR
           
(package private) static int BOUNDINGLEAF
           
(package private)  boolean boundsAutoCompute
          This boolean is true when the geometric bounds for the node is automatically updated
(package private) static int BRANCHGROUP
           
(package private)  java.util.ArrayList branchGroupPaths
          Each element, p, of branchGroupPaths is a list of BranchGroup from root of the tree to this.
protected  Bounds cachedBounds
           
(package private)  int childIndex
          This is the index for the child, as seen by its parent.
(package private) static int CLIP
           
(package private)  boolean collidable
          The collidable setting; see getCollidable and setCollidable.
(package private) static int CONESOUND
           
(package private) static int CONTAINS_VIEWPLATFORM
           
(package private) static int CURRENT_LOCAL_TO_VWORLD
           
(package private) static int DECALGROUP
           
(package private) static int DIRECTIONALLIGHT
           
(package private) static int EXPONENTIALFOG
           
(package private)  BackgroundRetained geometryBackground
           
(package private) static int GROUP
           
(package private)  boolean inSharedGroup
          This boolean is true when the node is in a sharedGroup
(package private) static int LAST_LOCAL_TO_VWORLD
           
(package private) static int LINEARFOG
           
(package private) static int LINK
           
(package private)  Bounds localBounds
           
(package private)  Locale locale
          The locale that this node is attatched to.
(package private)  Transform3D[][] localToVworld
           
(package private)  int[][] localToVworldIndex
           
(package private)  HashKey[] localToVworldKeys
           
(package private) static int MODELCLIP
           
(package private) static int MORPH
           
(package private)  int nnuId
           
(package private)  java.lang.String nodeId
          The node's internal identifier.
(package private)  int nodeType
          An int that represents the nodes type.
(package private) static int NUMNODES
           
(package private) static int ORDEREDGROUP
           
(package private)  java.lang.Integer orderedId
           
(package private) static int ORIENTEDSHAPE3D
           
(package private)  NodeRetained parent
          The node's parent.
(package private)  GroupRetained parentSwitchLink
           
(package private)  GroupRetained parentTransformLink
           
(package private)  boolean pickable
          This indicates if the node is pickable.
(package private) static int POINTLIGHT
           
(package private) static int POINTSOUND
           
(package private)  int refCount
           
(package private) static int SHAPE
           
(package private) static int SHAREDGROUP
           
(package private) static int SOUNDSCAPE
           
(package private) static int SPOTLIGHT
           
(package private)  TransformGroupRetained staticTransform
           
(package private) static int SWITCH
           
(package private) static int TRANSFORMGROUP
           
(package private)  VirtualUniverse universe
          The universe that we are in
protected  boolean validCachedBounds
           
(package private) static int VIEWPLATFORM
           
(package private) static int 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
 
Constructor Summary
NodeRetained()
           
 
Method Summary
(package private)  void clearLive(SetLiveState s)
           
(package private)  void computeCombineBounds(Bounds bounds)
          ONLY needed for SHAPE, MORPH, and LINK node type.
private  void computeLocalToVworld(NodeRetained caller, NodeRetained nodeR, HashKey key, Transform3D l2Vw)
           
(package private)  void computeNonLiveLocalToVworld(Transform3D t, Node caller)
          Compute the LocalToVworld of this node even though it is not live.
(package private)  void dirtyBoundsCache()
          Make the boundsCache of this node and all its parents dirty
(package private)  void doSetLive(SetLiveState s)
          Makes the internal node live.
 int equal(NnuId obj)
           
(package private)  void findCollidableFlags(boolean[] collide)
           
(package private)  void findPickableFlags(boolean[] pick)
           
(package private)  void findTransformLevels(int[] transformLevels)
           
(package private)  Bounds getBounds()
           
(package private)  boolean getBoundsAutoCompute()
          Gets the auto Compute flag for the geometric bounds.
(package private)  boolean getCollidable()
           
(package private)  Transform3D getCurrentLocalToVworld()
          Get the current localToVworld transform for a node
(package private)  Transform3D getCurrentLocalToVworld(HashKey key)
           
(package private)  Transform3D getCurrentLocalToVworld(int index)
           
(package private)  Bounds getEffectiveBounds()
          Gets the bounding object of a node.
 int getId()
           
(package private)  Transform3D getLastLocalToVworld()
          Get the last localToVworld transform for a node
(package private)  Transform3D getLastLocalToVworld(HashKey key)
           
(package private)  Transform3D getLastLocalToVworld(int index)
           
(package private)  Bounds getLocalBounds(Bounds bounds)
           
(package private)  Locale getLocale()
          Get the Locale to which the node is attached
(package private)  void getLocalToVworld(SceneGraphPath path, Transform3D t)
          Get the localToVworld transform for a node.
(package private)  void getLocalToVworld(Transform3D t)
          Get the localToVworld transform for a node.
(package private)  void getLocalToVworld(Transform3D t, HashKey key)
          Get the localToVworld transform for a node
(package private)  NodeRetained getParent()
          Returns the parent of the node.
(package private)  boolean getPickable()
           
(package private)  VirtualUniverse getVirtualUniverse()
           
(package private)  boolean isStatic()
          true if component can't be read or written after compile or setlive()
(package private)  void merge(CompileState compState)
           
(package private)  void mergeTransform(TransformGroupRetained xform)
           
(package private)  void notifySceneGraphChanged(boolean globalTraverse)
          For the default, just pass up to parent
(package private)  int[] processViewSpecificInfo(int mode, HashKey k, View v, java.util.ArrayList vsgList, int[] keyList, java.util.ArrayList leafList)
           
(package private)  void recombineAbove()
           
(package private)  void removeNodeData(SetLiveState s)
          remove the localToVworld transform for this node.
(package private)  void searchGeometryAtoms(UnorderList list)
           
(package private)  void setAuxData(SetLiveState s, int index, int hkIndex)
           
(package private)  void setBounds(Bounds bounds)
          Sets the geometric bounds of a node.
(package private)  void setBoundsAutoCompute(boolean autoCompute)
          Sets the automatic calcuation of geometric bounds of a node.
(package private)  void setCollidable(boolean collidable)
           
(package private)  void setLive(SetLiveState s)
           
(package private)  void setNodeData(SetLiveState s)
           
(package private)  void setParent(NodeRetained parent)
          Replaces the specified parent by a new parent.
(package private)  void setPickable(boolean pickable)
           
(package private)  void transformBounds(SceneGraphPath path, Bounds bound)
           
(package private)  void updateCollidable(HashKey[] keys, boolean[] collide)
           
(package private)  void updateLocalToVworld()
           
(package private)  void updatePickable(HashKey[] pickKeys, boolean[] pick)
           
 
Methods inherited from class javax.media.j3d.SceneGraphObjectRetained
clearLive, clearLive, clone, compile, doSetLive, getSource, handleFrequencyChange, isInSetLive, markAsLive, setCompiled, setLive, setSource, traverse
 
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

BACKGROUND

static final int BACKGROUND
See Also:
Constant Field Values

CLIP

static final int CLIP
See Also:
Constant Field Values

LINEARFOG

static final int LINEARFOG
See Also:
Constant Field Values

EXPONENTIALFOG

static final int EXPONENTIALFOG
See Also:
Constant Field Values

AMBIENTLIGHT

static final int AMBIENTLIGHT
See Also:
Constant Field Values

DIRECTIONALLIGHT

static final int DIRECTIONALLIGHT
See Also:
Constant Field Values

POINTLIGHT

static final int POINTLIGHT
See Also:
Constant Field Values

SPOTLIGHT

static final int SPOTLIGHT
See Also:
Constant Field Values

LINK

static final int LINK
See Also:
Constant Field Values

MORPH

static final int MORPH
See Also:
Constant Field Values

SHAPE

static final int SHAPE
See Also:
Constant Field Values

BACKGROUNDSOUND

static final int BACKGROUNDSOUND
See Also:
Constant Field Values

POINTSOUND

static final int POINTSOUND
See Also:
Constant Field Values

CONESOUND

static final int CONESOUND
See Also:
Constant Field Values

SOUNDSCAPE

static final int SOUNDSCAPE
See Also:
Constant Field Values

VIEWPLATFORM

static final int VIEWPLATFORM
See Also:
Constant Field Values

BEHAVIOR

static final int BEHAVIOR
See Also:
Constant Field Values

SWITCH

static final int SWITCH
See Also:
Constant Field Values

BRANCHGROUP

static final int BRANCHGROUP
See Also:
Constant Field Values

ORDEREDGROUP

static final int ORDEREDGROUP
See Also:
Constant Field Values

DECALGROUP

static final int DECALGROUP
See Also:
Constant Field Values

SHAREDGROUP

static final int SHAREDGROUP
See Also:
Constant Field Values

GROUP

static final int GROUP
See Also:
Constant Field Values

TRANSFORMGROUP

static final int TRANSFORMGROUP
See Also:
Constant Field Values

BOUNDINGLEAF

static final int BOUNDINGLEAF
See Also:
Constant Field Values

MODELCLIP

static final int MODELCLIP
See Also:
Constant Field Values

ALTERNATEAPPEARANCE

static final int ALTERNATEAPPEARANCE
See Also:
Constant Field Values

ORIENTEDSHAPE3D

static final int ORIENTEDSHAPE3D
See Also:
Constant Field Values

VIEWSPECIFICGROUP

static final int VIEWSPECIFICGROUP
See Also:
Constant Field Values

NUMNODES

static final int NUMNODES
See Also:
Constant Field Values

CONTAINS_VIEWPLATFORM

static final int CONTAINS_VIEWPLATFORM
See Also:
Constant Field Values

universe

VirtualUniverse universe
The universe that we are in


locale

Locale locale
The locale that this node is attatched to. This is only non-null if this instance is directly linked into a locale.


parent

NodeRetained parent
The node's parent.


nodeId

java.lang.String nodeId
The node's internal identifier.


nodeType

int nodeType
An int that represents the nodes type. Used for quick if tests in the traverser.


refCount

int refCount

childIndex

int childIndex
This is the index for the child, as seen by its parent.


inSharedGroup

boolean inSharedGroup
This boolean is true when the node is in a sharedGroup


pickable

boolean pickable
This indicates if the node is pickable. If this node is not pickable then neither are any children


collidable

boolean collidable
The collidable setting; see getCollidable and setCollidable.


localToVworld

Transform3D[][] localToVworld

localToVworldIndex

int[][] localToVworldIndex

LAST_LOCAL_TO_VWORLD

static final int LAST_LOCAL_TO_VWORLD
See Also:
Constant Field Values

CURRENT_LOCAL_TO_VWORLD

static final int CURRENT_LOCAL_TO_VWORLD
See Also:
Constant Field Values

localToVworldKeys

HashKey[] localToVworldKeys

boundsAutoCompute

boolean boundsAutoCompute
This boolean is true when the geometric bounds for the node is automatically updated


localBounds

Bounds localBounds

apiBounds

Bounds apiBounds

cachedBounds

protected Bounds cachedBounds

validCachedBounds

protected boolean validCachedBounds

branchGroupPaths

java.util.ArrayList branchGroupPaths
Each element, p, of branchGroupPaths is a list of BranchGroup from root of the tree to this. For BranchGroup under a non-shared group this size of branchGroupPaths is always 1. Otherwise, the size is equal to the number of possible paths to reach this node. This variable is used to cached BranchGroup for fast picking. For non BranchGroupRetained class this is a reference to the previous BranchGroupRetained branchGroupPaths.


geometryBackground

BackgroundRetained geometryBackground

parentTransformLink

GroupRetained parentTransformLink

parentSwitchLink

GroupRetained parentSwitchLink

staticTransform

TransformGroupRetained staticTransform

orderedId

java.lang.Integer orderedId

nnuId

int nnuId
Constructor Detail

NodeRetained

NodeRetained()
Method Detail

getId

public int getId()
Specified by:
getId in interface NnuId

equal

public int equal(NnuId obj)
Specified by:
equal in interface NnuId

getLocalBounds

Bounds getLocalBounds(Bounds bounds)

setBounds

void setBounds(Bounds bounds)
Sets the geometric bounds of a node.

Parameters:
bounds - the bounding object for the node

getEffectiveBounds

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

Returns:
the node's bounding object

getBounds

Bounds getBounds()

computeCombineBounds

void computeCombineBounds(Bounds bounds)
ONLY needed for SHAPE, MORPH, and LINK node type. Compute the combine bounds of bounds and its localBounds.


setBoundsAutoCompute

void setBoundsAutoCompute(boolean autoCompute)
Sets the automatic calcuation of geometric bounds of a node.

Parameters:
autoCompute - is a boolean value indicating if automatic calcuation of bounds

getBoundsAutoCompute

boolean getBoundsAutoCompute()
Gets the auto Compute flag for the geometric bounds.

Returns:
the node's auto Compute flag for the geometric bounding object

setParent

void setParent(NodeRetained parent)
Replaces the specified parent by a new parent.

Parameters:
parent - the new parent

getParent

NodeRetained getParent()
Returns the parent of the node.

Returns:
the parent.

transformBounds

void transformBounds(SceneGraphPath path,
                     Bounds bound)

computeLocalToVworld

private void computeLocalToVworld(NodeRetained caller,
                                  NodeRetained nodeR,
                                  HashKey key,
                                  Transform3D l2Vw)

computeNonLiveLocalToVworld

void computeNonLiveLocalToVworld(Transform3D t,
                                 Node caller)
Compute the LocalToVworld of this node even though it is not live. We assume the graph is attached at the origin of a locale


getLocalToVworld

void getLocalToVworld(Transform3D t)
Get the localToVworld transform for a node.


getLocalToVworld

void getLocalToVworld(SceneGraphPath path,
                      Transform3D t)
Get the localToVworld transform for a node.


getLocalToVworld

void getLocalToVworld(Transform3D t,
                      HashKey key)
Get the localToVworld transform for a node


getLocale

Locale getLocale()
Get the Locale to which the node is attached


getCurrentLocalToVworld

Transform3D getCurrentLocalToVworld()
Get the current localToVworld transform for a node


getCurrentLocalToVworld

Transform3D getCurrentLocalToVworld(int index)

getCurrentLocalToVworld

Transform3D getCurrentLocalToVworld(HashKey key)

getLastLocalToVworld

Transform3D getLastLocalToVworld()
Get the last localToVworld transform for a node


getLastLocalToVworld

Transform3D getLastLocalToVworld(int index)

getLastLocalToVworld

Transform3D getLastLocalToVworld(HashKey key)

setAuxData

void setAuxData(SetLiveState s,
                int index,
                int hkIndex)

setNodeData

void setNodeData(SetLiveState s)

setPickable

void setPickable(boolean pickable)

updatePickable

void updatePickable(HashKey[] pickKeys,
                    boolean[] pick)

getPickable

boolean getPickable()

setCollidable

void setCollidable(boolean collidable)

getCollidable

boolean getCollidable()

updateCollidable

void updateCollidable(HashKey[] keys,
                      boolean[] collide)

notifySceneGraphChanged

void notifySceneGraphChanged(boolean globalTraverse)
For the default, just pass up to parent


recombineAbove

void recombineAbove()

updateLocalToVworld

void updateLocalToVworld()

setLive

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

doSetLive

void doSetLive(SetLiveState s)
Description copied from class: SceneGraphObjectRetained
Makes the internal node live.

Overrides:
doSetLive in class SceneGraphObjectRetained

removeNodeData

void removeNodeData(SetLiveState s)
remove the localToVworld transform for this node.


clearLive

void clearLive(SetLiveState s)

findPickableFlags

void findPickableFlags(boolean[] pick)

findCollidableFlags

void findCollidableFlags(boolean[] collide)

findTransformLevels

void findTransformLevels(int[] transformLevels)

isStatic

boolean isStatic()
Description copied from class: SceneGraphObjectRetained
true if component can't be read or written after compile or setlive()

Overrides:
isStatic in class SceneGraphObjectRetained

merge

void merge(CompileState compState)
Overrides:
merge in class SceneGraphObjectRetained

mergeTransform

void mergeTransform(TransformGroupRetained xform)
Overrides:
mergeTransform in class SceneGraphObjectRetained

processViewSpecificInfo

int[] processViewSpecificInfo(int mode,
                              HashKey k,
                              View v,
                              java.util.ArrayList vsgList,
                              int[] keyList,
                              java.util.ArrayList leafList)

getVirtualUniverse

VirtualUniverse getVirtualUniverse()
Overrides:
getVirtualUniverse in class SceneGraphObjectRetained

searchGeometryAtoms

void searchGeometryAtoms(UnorderList list)

dirtyBoundsCache

void dirtyBoundsCache()
Make the boundsCache of this node and all its parents dirty



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