|
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.Group
public class Group
The Group node object is a generic container of other nodes in the scene.
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 unless the global flag is set to true on them.
Picking is enabled by default.
Internationalisation Resource Names
Field Summary | |
---|---|
protected Node[] |
childList
The list of children nodes |
protected Cullable[] |
cullList
The list of children nodes represented as cullable |
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 PickTarget[] |
pickableList
The list of children nodes that are pickable targets |
protected int |
pickFlags
Flag indicating if this object is pickable currently |
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 |
Fields inherited from interface org.j3d.aviatrix3d.picking.PickableObject |
---|
COLLIDABLE_OBJECT, GENERAL_OBJECT, PROXIMITY_OBJECT, VISIBLE_OBJECT |
Fields inherited from interface org.j3d.aviatrix3d.picking.PickTarget |
---|
CUSTOM_PICK_TYPE, GROUP_PICK_TYPE, LEAF_PICK_TYPE, SINGLE_PICK_TYPE |
Constructor Summary | |
---|---|
Group()
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. |
boolean |
checkPickMask(int mask)
Check the given pick mask against the node's internal pick mask representation. |
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. |
Cullable[] |
getCullableChildren()
Get the list of children that are valid to be rendered according to the rules of the grouping node. |
Cullable |
getCullableParent()
Get the parent cullable of this instance. |
BoundingVolume |
getPickableBounds()
Get the bounds of this picking target so that testing can be performed on the object. |
PickTarget |
getPickableChild(int idx)
Return the pickable target instance at the given index. |
PickTarget[] |
getPickableChildren()
Return an array containing all of this group's pickable children. |
int |
getPickMask()
Get the current pickable state mask of this object. |
int |
getPickTargetType()
Return the type constant that represents the type of pick target this is. |
boolean |
hasMultipleParents()
Check to see if this cullable is mulitparented. |
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. |
int |
numCullableChildren()
Returns the number of valid renderable children to process. |
int |
numPickableChildren()
Returns the number of valid pickable child targets to process. |
void |
pickBatch(PickRequest[] reqs,
int numRequests)
Check for all intersections against this geometry and it's children to see if there is an intersection with the given set of requests. |
void |
pickSingle(PickRequest req)
Check for all intersections against this geometry and it's children to see if there is an intersection with the given set of requests. |
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. |
void |
setPickMask(int state)
Set the node as being pickable currently using the given bit mask. |
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.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 |
Methods inherited from interface org.j3d.aviatrix3d.rendering.GroupCullable |
---|
getBounds |
Field Detail |
---|
protected Node[] childList
protected int lastChild
protected int dirtyBoundsCount
protected float[] wkVec1
protected float[] wkVec2
protected int pickFlags
protected PickTarget[] pickableList
protected Cullable[] cullList
Constructor Detail |
---|
public Group()
Method Detail |
---|
public Cullable[] getCullableChildren()
getCullableChildren
in interface GroupCullable
public int numCullableChildren()
numCullableChildren
in interface GroupCullable
public boolean hasMultipleParents()
hasMultipleParents
in interface GroupCullable
public Cullable getCullableParent()
getCullableParent
in interface GroupCullable
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 setPickMask(int state)
setPickMask
in interface PickableObject
state
- A bit mask of available options to pick forpublic int getPickMask()
getPickMask
in interface PickableObject
public void pickBatch(PickRequest[] reqs, int numRequests) throws NotPickableException, InvalidPickTimingException
pickBatch
in interface PickableObject
reqs
- The list of picks to be made, starting at this objectnumRequests
- The number of valid pick requests to process
NotPickableException
- This object has been marked as non pickable,
but you decided to try to call the method anyway
InvalidPickTimingException
- An attempt was made to pick outside
of the ApplicationUpdateObserver callback methodpublic void pickSingle(PickRequest req) throws NotPickableException, InvalidPickTimingException
pickSingle
in interface PickableObject
req
- The details of the pick to be made
NotPickableException
- This object has been marked as non pickable,
but you decided to try to call the method anyway
InvalidPickTimingException
- An attempt was made to pick outside
of the ApplicationUpdateObserver callback methodpublic int numPickableChildren()
numPickableChildren
in interface GroupPickTarget
public PickTarget[] getPickableChildren()
numPickableChildren()
call for how many valid objects are part
of this array. If there are none, this may return either a null or a
valid array, depending on the implementation.
The list may contain null values.
getPickableChildren
in interface GroupPickTarget
public PickTarget getPickableChild(int idx)
getPickableChild
in interface GroupPickTarget
idx
- The index of the child to get
public final int getPickTargetType()
getPickTargetType
in interface PickTarget
public boolean checkPickMask(int mask)
checkPickMask
in interface PickTarget
mask
- The bit mask to check against
public BoundingVolume getPickableBounds()
getPickableBounds
in interface PickTarget
public 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 |