Package javax.media.j3d
Class SharedGroup
java.lang.Object
javax.media.j3d.SceneGraphObject
javax.media.j3d.Node
javax.media.j3d.Group
javax.media.j3d.SharedGroup
The SharedGroup provides the ability to manipulate an
instanced scene graph.
A SharedGroup node allows multiple Link leaf nodes to share its
subgraph according to the following semantics:
- A SharedGroup may be referenced by one or more Link leaf nodes. Any runtime changes to a node or component object in this shared subgraph affect all graphs that refer to this subgraph.
- A SharedGroup may be compiled by calling its compile method prior to being referenced by any Link leaf nodes.
- Only Link leaf nodes may refer to SharedGroup nodes. A SharedGroup node cannot have parents or be attached to a Locale.
- Light
- Link
- Morph
- Shape
- Sound
An IllegalSharingException is thrown if any of the following leaf nodes appear in a shared subgraph:
- AlternateAppearance
- Background
- Behavior
- BoundingLeaf
- Clip
- Fog
- ModelClip
- Soundscape
- ViewPlatform
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Specifies that this SharedGroup node allows reading the list of links that refer to this node.Fields inherited from class javax.media.j3d.Group
ALLOW_CHILDREN_EXTEND, ALLOW_CHILDREN_READ, ALLOW_CHILDREN_WRITE, ALLOW_COLLISION_BOUNDS_READ, ALLOW_COLLISION_BOUNDS_WRITE
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_LOCALE_READ, ALLOW_PARENT_READ, ALLOW_PICKABLE_READ, ALLOW_PICKABLE_WRITE, ENABLE_COLLISION_REPORTING, ENABLE_PICK_REPORTING
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncloneNode
(boolean forceDuplicate) Used to create a new instance of the node.void
compile()
Compiles the source SharedGroup associated with this object and creates and caches a compiled scene graph.Link[]
getLinks()
Returns the list of Link nodes that refer to this SharedGroup node.Methods inherited from class javax.media.j3d.Group
addChild, getAllChildren, getAlternateCollisionTarget, getChild, getCollisionBounds, indexOfChild, insertChild, moveTo, numChildren, removeAllChildren, removeChild, removeChild, setAlternateCollisionTarget, setChild, setCollisionBounds
Methods inherited from class javax.media.j3d.Node
cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, duplicateNode, getBounds, getBoundsAutoCompute, getCollidable, getLocale, getLocalToVworld, getLocalToVworld, getParent, getPickable, setBounds, setBoundsAutoCompute, setCollidable, setPickable
Methods inherited from class javax.media.j3d.SceneGraphObject
clearCapability, clearCapabilityIsFrequent, duplicateSceneGraphObject, getCapability, getCapabilityIsFrequent, getName, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setName, setUserData, toString, updateNodeReferences
-
Field Details
-
ALLOW_LINK_READ
public static final int ALLOW_LINK_READSpecifies that this SharedGroup node allows reading the list of links that refer to this node.- Since:
- Java 3D 1.3
- See Also:
-
-
Constructor Details
-
SharedGroup
public SharedGroup()Constructs and initializes a new SharedGroup node object.
-
-
Method Details
-
getLinks
Returns the list of Link nodes that refer to this SharedGroup node.- Returns:
- An array of Link nodes that refer to this SharedGroup node.
- Since:
- Java 3D 1.3
-
compile
public void compile()Compiles the source SharedGroup associated with this object and creates and caches a compiled scene graph.- Throws:
SceneGraphCycleException
- if there is a cycle in the scene graphRestrictedAccessException
- if the method is called when this object is part of a live scene graph.
-
cloneNode
Used to create a new instance of the node. This routine is called bycloneTree
to duplicate the current node.
-