|
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.ObjectSet
public abstract class ObjectSet
A general purpose container class to allow end users to extend the basic geometry capabilities, while still providing a way to manage scene graph state such as liveness calls and update handlers.
A lot of the state calls of children can only be called by extending the class and calling protected methods. When a child scenegraph object is defined for a collection of children outside of the base aviatrix3d package there is no way for passing in liveness state due to the protected nature of the required methods. This class provides methods that allow a derived class to call back into the package and set those states.
Implementation Note
Since this is a base set of nodes, no interface with the rendering pipeline
has been implemented. It is up to the person extending this class to
implement an appropriate interface that extends from
Cullable
so that the rendering
infrastructure may process any or all children of this set.
Internationalisation Resource Names
Field Summary | |
---|---|
protected SceneGraphObject[] |
childList
The list of children nodes |
protected int |
lastChild
Index to the next place to add items in the nodeList |
Fields inherited from class org.j3d.aviatrix3d.SceneGraphObject |
---|
alive, LISTENER_SET_TIMING_ERR_PROP, updateHandler |
Constructor Summary | |
---|---|
protected |
ObjectSet()
The default constructor |
Method Summary | |
---|---|
void |
addChild(SceneGraphObject 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. |
SceneGraphObject[] |
getAllChildren()
Return an array containing all of this groups children. |
SceneGraphObject |
getChild(int idx)
Retrieves the child node at the specified index in this group node's list of children. |
int |
indexOfChild(SceneGraphObject child)
Retrieves the index of the specified child node in this group node's list of children. |
int |
numChildren()
Returns the number of children this group contains. |
void |
removeAllChildren()
Removes all children from the group. |
void |
removeChild(int idx)
Remove the child at the specified index from the group. |
void |
removeChild(SceneGraphObject child)
Removes the specified child from the group. |
void |
setChild(SceneGraphObject 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. |
Methods inherited from class org.j3d.aviatrix3d.SceneGraphObject |
---|
checkForCyclicParent, 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 SceneGraphObject[] childList
protected int lastChild
Constructor Detail |
---|
protected ObjectSet()
Method Detail |
---|
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(SceneGraphObject 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 changed callback methodpublic void setChild(SceneGraphObject 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 changed 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 changed callback methodpublic SceneGraphObject getChild(int idx)
java.lang.IndexOutOfBoundsException
- If the idx is invalidpublic SceneGraphObject[] getAllChildren()
public int numChildren()
public int indexOfChild(SceneGraphObject child)
child
- The child to find
public void removeChild(SceneGraphObject child) throws InvalidWriteTimingException
child
- The child to remove
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener bounds changed callback methodpublic void removeAllChildren() throws InvalidWriteTimingException
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener bounds changed callback method
|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |