|
j3d.org Aviatrix3D | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.j3d.aviatrix3d.SceneGraphObject
org.j3d.aviatrix3d.Node
org.j3d.aviatrix3d.SharedNode
A node that can have multiple parents, thus allowing a graph structure to the scene graph.
Normal nodes cannot have more than one parent, so this class provides the ability to have more than one. In doing so, it overrides the normal methods provided by Node to provide the shared functionality. It provides a compliment to the SharedGroup for parts of the scene graph where you want to share a common piece, but really don't need the grouping functionality.
Using this node in preference to SharedGroup has several performance benefits. For example, when performing picking, the picking implementation can just ignore this node altogether as it knows the bounds are identical to it's child.
Field Summary |
Fields inherited from class org.j3d.aviatrix3d.Node |
bounds, implicitBounds, INVALID_BOUNDS, parent |
Fields inherited from class org.j3d.aviatrix3d.SceneGraphObject |
alive, updateHandler, WRITE_TIMING_MSG |
Fields inherited from interface org.j3d.aviatrix3d.PickableObject |
COLLIDABLE_OBJECT, GENERAL_OBJECT, PROXIMITY_OBJECT, VISIBLE_OBJECT |
Constructor Summary | |
SharedNode()
The default constructor |
Method Summary | |
protected void |
checkForCyclicParent(SceneGraphObject child)
Check to see if this node is the same reference as the passed node. |
Node |
getChild()
Get the currently set child of this node. |
Node |
getParent()
Overridden to always return null. |
void |
getParents(Node[] parents)
Get the listing of the number of parents that this node currently has. |
int |
getPickMask()
Get the current pickable state mask of this object. |
protected void |
markBoundsDirty()
Mark this node as having dirty bounds due to one of it's children having their bounds changed. |
int |
numParents()
Request the number of parents this node currently contains |
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. |
void |
postRender(net.java.games.jogl.GL gl,
net.java.games.jogl.GLU glu)
|
protected void |
recomputeBounds()
Internal method to recalculate the implicit bounds of this Node. |
protected void |
removeParent(Node p)
Remove a parent from this shared group. |
void |
render(net.java.games.jogl.GL gl,
net.java.games.jogl.GLU glu)
Set up the rendering state now. |
void |
setChild(Node child)
Set the child to be the new value. |
protected void |
setLive(boolean state)
Notification that this object is live now. |
protected void |
setParent(Node p)
Specify this nodes parent, overridden to provide behaviour that appends the node to the list rather than replacing it. |
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, getBounds, setBounds |
Methods inherited from class org.j3d.aviatrix3d.SceneGraphObject |
checkForCyclicChild, dataChanged, getUserData, isLive, setUserData |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SharedNode()
Method Detail |
protected void markBoundsDirty()
markBoundsDirty
in class Node
protected void recomputeBounds()
recomputeBounds
in class Node
protected void updateBounds()
updateBounds
in class Node
public void render(net.java.games.jogl.GL gl, net.java.games.jogl.GLU glu)
render
in class Node
gl
- The gl context to draw withglu
- The utility context to draw withpublic void postRender(net.java.games.jogl.GL gl, net.java.games.jogl.GLU glu)
postRender
in class Node
protected void setParent(Node p) throws AlreadyParentedException, InvalidNodeTypeException
setParent
in class Node
p
- The new parent instance to add to the list
AlreadyParentedException
- There is a valid parent already set
InvalidNodeTypeException
- Not a group nodeprotected void removeParent(Node p)
removeParent
in class Node
p
- The new parent instance to remove from the listpublic Node getParent()
getParent
in class Node
public int numParents()
public void getParents(Node[] parents)
parents
- An array to copy the parent listing intoprotected void setLive(boolean state)
setLive
in class Node
state
- true if this should be marked as live nowprotected void setUpdateHandler(NodeUpdateHandler handler)
setUpdateHandler
in class SceneGraphObject
handler
- The instance to use as a handlerprotected void checkForCyclicParent(SceneGraphObject child) throws CyclicSceneGraphStructureException
checkForCyclicParent
in class Node
child
- The reference to check against this class
CyclicSceneGraphStructureException
- Equal parent and childpublic 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 void setChild(Node child)
child
- The new instance to set or nullpublic Node getChild()
|
j3d.org Aviatrix3D | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |