|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.j3d.aviatrix3d.SceneGraphObject org.j3d.aviatrix3d.Node org.j3d.aviatrix3d.BaseNode org.j3d.aviatrix3d.BaseGroup
public abstract class BaseGroup
Abstracted verson of the Group node designed for extension by 3rd-party node implementors.
Group nodes have exactly one parent and an arbitrary number of children. The children are rendered in an unspecified order. Null children are allowed but no operation is performed on a null child.
Lights are automatically scoped and culled to the parent group. Picking is enabled by default.
Internationalisation Resource Names
Field Summary | |
---|---|
protected Node[] |
childList
The list of children nodes |
protected int |
dirtyBoundsCount
Number of currently known dirty child bounds |
protected int |
lastChild
Index to the next place to add items in the nodeList |
protected float[] |
wkVec1
Temp array for fetching bounds from the children. |
protected float[] |
wkVec2
Temp array for fetching bounds from the children. |
Fields inherited from class org.j3d.aviatrix3d.Node |
---|
bounds, implicitBounds, INVALID_BOUNDS, parent |
Fields inherited from class org.j3d.aviatrix3d.SceneGraphObject |
---|
alive, LISTENER_SET_TIMING_ERR_PROP, updateHandler |
Constructor Summary | |
---|---|
protected |
BaseGroup()
The default constructor |
Method Summary | |
---|---|
void |
addChild(Node newChild)
Appends the specified child node to this group node's list of children |
protected void |
checkForCyclicChild(SceneGraphObject parent)
Check to see if this node is the same reference as the passed node that is a parent of this node. |
Node[] |
getAllChildren()
Return an array containing all of this group's children. |
Node |
getChild(int idx)
Retrieves the child node at the specified index in this group node's list of children. |
int |
indexOfChild(Node child)
Retrieves the index of the specified child node in this group node's list of children. |
protected void |
markBoundsDirty()
Mark this node as having dirty bounds due to one of it's children having their bounds changed. |
int |
numChildren()
Returns the number of children this group contains. |
protected void |
recomputeBounds()
Internal method to recalculate the implicit bounds of this Node. |
void |
removeAllChildren()
Removes all children from the group. |
void |
removeChild(int idx)
Remove the child at the specified index from the group. |
void |
removeChild(Node child)
Removes the specified child from the group. |
void |
requestBoundsUpdate()
Request a recomputation of the bounds of this object. |
void |
setBounds(BoundingVolume b)
Set the bounds to the given explicit value. |
void |
setChild(Node newChild,
int idx)
Replaces the child node at the specified index in this group node's list of children with the specified child. |
protected void |
setLive(boolean state)
Notification that this object is live now. |
protected void |
setUpdateHandler(NodeUpdateHandler handler)
Set the scenegraph update handler for this node. |
protected void |
updateBounds()
Update this node's bounds and then call the parent to update it's bounds. |
Methods inherited from class org.j3d.aviatrix3d.BaseNode |
---|
checkForCyclicChild, checkForCyclicParent, clearUpdateHandler, removeParent, setLive, setParent, setUpdateHandler |
Methods inherited from class org.j3d.aviatrix3d.Node |
---|
boundsChanged, checkForCyclicParent, getBounds, getParent, removeParent, setParent, updateParentBounds |
Methods inherited from class org.j3d.aviatrix3d.SceneGraphObject |
---|
dataChanged, getAppUpdateWriteTimingMessage, getBoundsWriteTimingMessage, getDataWriteTimingMessage, getUserData, isLive, setUserData |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Node[] childList
protected int lastChild
protected int dirtyBoundsCount
protected float[] wkVec1
protected float[] wkVec2
Constructor Detail |
---|
protected BaseGroup()
Method Detail |
---|
public void setBounds(BoundingVolume b)
setBounds
in class Node
b
- The new bounds to use or null to clearprotected void markBoundsDirty()
markBoundsDirty
in class Node
protected void updateBounds()
updateBounds
in class Node
protected void recomputeBounds()
recomputeBounds
in class Node
public void requestBoundsUpdate()
This will recurse down the children asking all of them to recompute the bounds. If a child is found to be during this process, that branch will not update, and thus the value used will be the last updated (ie from the previous frame it was processed).
requestBoundsUpdate
in class Node
protected void checkForCyclicChild(SceneGraphObject parent) throws CyclicSceneGraphStructureException
checkForCyclicChild
in class SceneGraphObject
parent
- The reference to check against this class
CyclicSceneGraphStructureException
- Equal parent and childprotected void setUpdateHandler(NodeUpdateHandler handler)
setUpdateHandler
in class SceneGraphObject
handler
- The instance to use as a handlerprotected void setLive(boolean state)
setLive
in class SceneGraphObject
state
- true if this should be marked as live nowpublic void addChild(Node newChild) throws AlreadyParentedException, InvalidWriteTimingException
newChild
- The child to add
AlreadyParentedException
- There is a valid parent already set
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener bounds callback methodpublic void setChild(Node newChild, int idx) throws AlreadyParentedException, InvalidWriteTimingException
newChild
- The child node to useidx
- The index to replace. Must be greater than 0 and less then numChildren
java.lang.IndexOutOfBoundsException
- When the idx is invalid
AlreadyParentedException
- There is a valid parent already set
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener bounds callback methodpublic void removeChild(int idx) throws InvalidWriteTimingException
idx
- The index of the child to remove
IndexOfBoundsException
- When the idx is invalid
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener bounds callback methodpublic Node getChild(int idx)
java.lang.IndexOutOfBoundsException
- If the idx is invalidpublic Node[] getAllChildren()
public int numChildren()
public int indexOfChild(Node child)
child
- The child to find
public void removeChild(Node child) throws InvalidWriteTimingException
child
- The child to remove
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener bounds callback methodpublic void removeAllChildren() throws InvalidWriteTimingException
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener bounds callback method
|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |