Class ViewSpecificGroup
All nodes except ViewPlatform may appear as a descendant of ViewSpecificGroup, including another ViewSpecificGroup. If a ViewSpecificGroup is a descendant of a ViewSpecificGroup, the effect is to intersect the view sets of the ViewSpecificGroup nodes in the hierarchy; each ViewSpecificGroup encountered when traversing the scene graph further restricts the set of views on which its descendants are rendered. More formally, descendant nodes of ViewSpecificGroups are rendered in (or apply to) only those views that are contained in the set of views of every ViewSpecificGroup in the scene graph path from the Locale to the Node.
Behavior nodes may appear under a ViewSpecificGroup, but are not affected by it--the Behavior scheduler is per-universe rather than per-View. BoundingLeaf nodes are similarly unaffected by being under a ViewSpecificGroup. A BoundingLeaf under a ViewSpecificGroup provides a valid bounds for any node that refers to it, irrespective of the view.
The rest of the leaf nodes either: A) are only rendered within the specified view(s), for example, Shape3D, Morph, and Sound; or B) only affect other objects when they are rendered in the specified view(s), for example, AlternateAppearance, Clip, ModelClip, Fog, Light, Soundscape, Background.
- Since:
- Java 3D 1.3
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Specifies that this ViewSpecificGroup node allows reading its view information at runtime.static final int
Specifies that this ViewSpecificGroup node allows writing its view information at runtime.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
ConstructorsConstructorDescriptionConstructs and initializes a new ViewSpecificGroup node object. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Appends the specified View object to this node's list of views.cloneNode
(boolean forceDuplicate) Used to create a new instance of the node.Returns an enumeration of this ViewSpecificGroup node's list of views.getView
(int index) Retrieves the View object at the specified index from this node's list of views.int
indexOfView
(View view) Retrieves the index of the specified View object in this node's list of views.void
insertView
(View view, int index) Inserts the specified View object into this node's list of views at the specified index.int
numViews()
Returns the number of View objects in this node's list of views.void
Removes all View objects from this node's list of views.void
removeView
(int index) Removes the View object at the specified index from this node's list of views.void
removeView
(View view) Removes the specified View object from this node's list of views.void
Replaces the view at the specified index in this node's list of views with the specified View object.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_VIEW_READ
public static final int ALLOW_VIEW_READSpecifies that this ViewSpecificGroup node allows reading its view information at runtime.- See Also:
-
ALLOW_VIEW_WRITE
public static final int ALLOW_VIEW_WRITESpecifies that this ViewSpecificGroup node allows writing its view information at runtime.- See Also:
-
-
Constructor Details
-
ViewSpecificGroup
public ViewSpecificGroup()Constructs and initializes a new ViewSpecificGroup node object.
-
-
Method Details
-
setView
Replaces the view at the specified index in this node's list of views with the specified View object.- Parameters:
view
- the View object to be stored at the specified index.index
- the index of the View object to be replaced.- Throws:
CapabilityNotSetException
- if appropriate capability is not set and this object is part of live or compiled scene graph
-
getView
Retrieves the View object at the specified index from this node's list of views.- Parameters:
index
- the index of the View object to be returned.- Returns:
- the View object at the specified index.
- Throws:
CapabilityNotSetException
- if appropriate capability is not set and this object is part of live or compiled scene graph
-
insertView
Inserts the specified View object into this node's list of views at the specified index.- Parameters:
view
- the View object to be inserted at the specified index.index
- the index at which the View object is inserted.- Throws:
CapabilityNotSetException
- if appropriate capability is not set and this object is part of live or compiled scene graph
-
removeView
public void removeView(int index) Removes the View object at the specified index from this node's list of views. If this operation causes the list of views to become empty, then the descendants of this ViewSpecificGroup node will not be rendered.- Parameters:
index
- the index of the View object to be removed.- Throws:
CapabilityNotSetException
- if appropriate capability is not set and this object is part of live or compiled scene graph
-
getAllViews
Returns an enumeration of this ViewSpecificGroup node's list of views.- Returns:
- an Enumeration object containing all the views.
- Throws:
CapabilityNotSetException
- if appropriate capability is not set and this object is part of live or compiled scene graph
-
addView
Appends the specified View object to this node's list of views.- Parameters:
view
- the View object to be appended.- Throws:
CapabilityNotSetException
- if appropriate capability is not set and this object is part of live or compiled scene graph
-
numViews
public int numViews()Returns the number of View objects in this node's list of views. If this number is 0, then the list of views is empty and the descendants of this ViewSpecificGroup node will not be rendered.- Returns:
- the number of views in this node's list of views.
- Throws:
CapabilityNotSetException
- if appropriate capability is not set and this object is part of live or compiled scene graph
-
indexOfView
Retrieves the index of the specified View object in this node's list of views.- Parameters:
view
- the View object to be looked up.- Returns:
- the index of the specified View object; returns -1 if the object is not in the list.
- Throws:
CapabilityNotSetException
- if appropriate capability is not set and this object is part of live or compiled scene graph- Since:
- Java 3D 1.3
-
removeView
Removes the specified View object from this node's list of views. If the specified object is not in the list, the list is not modified. If this operation causes the list of views to become empty, then the descendants of this ViewSpecificGroup node will not be rendered.- Parameters:
view
- the View object to be removed.- Throws:
CapabilityNotSetException
- if appropriate capability is not set and this object is part of live or compiled scene graph- Since:
- Java 3D 1.3
-
removeAllViews
public void removeAllViews()Removes all View objects from this node's list of views. Since this method clears the list of views, the descendants of this ViewSpecificGroup node will not be rendered.- Throws:
CapabilityNotSetException
- if appropriate capability is not set and this object is part of live or compiled scene graph- Since:
- Java 3D 1.3
-
cloneNode
Used to create a new instance of the node. This routine is called bycloneTree
to duplicate the current node.
-