|
Xj3D 2.0 VRML/X3D Code API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.web3d.vrml.renderer.common.nodes.AbstractNode
org.web3d.vrml.renderer.common.nodes.BaseGroupingNode
public abstract class BaseGroupingNode
Common basic implementation of any node that uses grouping functionality.
The basic (X3D) definition of X3DGroupingNode is:
X3DGroupingNode : X3DChildNode, X3DBoundedObject {
MFNode [in] addChildren
MFNode [in] removeChildren
MFNode [in,out] children [] [X3DChildNode]
SFNode [in,out] metadata NULL [X3DMetadataObject]
SFVec3f [] bboxCenter 0 0 0 (-8,8)
SFVec3f [] bboxSize -1 -1 -1 [0,8) or -1 -1 -1
}
| Field Summary | |
|---|---|
protected int |
childCount
The number of children nodes we added, not the total. |
protected static int |
FIELD_ADDCHILDREN
Index of the addChildren field |
protected static int |
FIELD_BBOX_CENTER
Index of the Bounding box center bboxCenter field |
protected static int |
FIELD_BBOX_SIZE
Index of the Bounding box size bboxSize field |
protected static int |
FIELD_CHILDREN
Index of the children field |
protected static int |
FIELD_REMOVECHILDREN
Index of the removeChildren field |
protected boolean |
hasBindables
Flag indicating if this node contains bindable/activatable nodes |
protected static int |
LAST_GROUP_INDEX
The last field index used by this class |
protected int |
shareCount
Counter for the number of sharing references this has |
protected static java.lang.String |
USE_BIND_MSG
Message when the USE is a bindable |
protected float[] |
vfBboxCenter
SFVec3f bboxCenter NULL |
protected float[] |
vfBboxSize
SFVec3f bboxSize NULL |
protected java.util.ArrayList |
vfChildren
MFNode children NULL |
| Fields inherited from class org.web3d.vrml.renderer.common.nodes.AbstractNode |
|---|
BAD_NODE_MSG, errorReporter, FIELD_METADATA, fieldLocalData, hasChanged, INIT_ONLY_WRITE_MSG, inSetup, isDEF, isStatic, LAST_NODE_INDEX, layerIds, METADATA_NODE_MSG, METADATA_PROTO_MSG, nodeName, pMetadata, refCounts, removedLayerIds, stateManager, vfMetadata, vrmlMajorVersion, vrmlMinorVersion |
| Constructor Summary | |
|---|---|
protected |
BaseGroupingNode(java.lang.String name)
Construct a default instance of the grouping node type. |
| Method Summary | |
|---|---|
void |
addChild(VRMLNodeType newChild)
Append a new child node to the existing collection. |
protected void |
addChildNode(VRMLNodeType node)
Add a single child node to the list of available children. |
protected void |
clearChildren()
Clear the child node list of all children in the VRML node. |
boolean |
containsBindableNodes()
A check to see if this grouping node contains any bindable nodes. |
protected void |
copy(VRMLGroupingNodeType node)
Set the fields of the grouping node that has the fields set based on the fields of the passed in node. |
float[] |
getBboxCenter()
Accessor method to get current value of field bboxCenter default value is 0 0 0. |
float[] |
getBboxSize()
Accessor method to get current value of field bboxSize default value is -1 -1 -1. |
VRMLNodeType[] |
getChildren()
Get the children, provides a live reference not a copy |
int |
getChildrenSize()
Returns the number of children |
VRMLFieldData |
getFieldValue(int index)
Get the value of a field. |
int |
getPrimaryType()
Get the primary type of this node. |
boolean |
isShared()
Check to see if this node has been used more than once. |
protected void |
removeChildNode(VRMLNodeType node)
Remove the given node from this grouping node. |
void |
sendRoute(double time,
int srcIndex,
VRMLNodeType destNode,
int destIndex)
Send a routed value from this node to the given destination node. |
void |
setChildren(VRMLNodeType newChild)
Accessor method to set the children field Creates an array containing only newChild If passed null this method will act like removeChildren |
void |
setChildren(VRMLNodeType[] newChildren)
Accesor method to set the children field If passed null this method will act like removeChildren |
void |
setDEF()
Notify this node that is has been DEFd. |
void |
setShared(boolean used)
Adjust the sharing count up or down one increment depending on the flag. |
void |
setupFinished()
Notification that the construction phase of this node has finished. |
void |
setValue(int index,
float[] value,
int numValid)
Set the value of the field at the given index as an array of floats. |
void |
setValue(int index,
VRMLNodeType child)
Set the value of the field at the given index as an array of nodes. |
void |
setValue(int index,
VRMLNodeType[] children,
int numValid)
Set the value of the field at the given index as an array of nodes. |
void |
updateRefCount(int layer,
boolean add)
Change the reference count up or down by one for a given layer ID. |
| Methods inherited from class org.web3d.vrml.renderer.common.nodes.AbstractNode |
|---|
addNodeListener, allEventsComplete, checkNodeType, checkSecondaryType, checkSecondaryType, clearRemovedLayerIds, fireFieldChanged, getLayerIds, getMetadataObject, getRefCount, getRemovedLayerIds, getSecondaryType, getUserData, getVRMLNodeName, hasFieldChanged, isDEF, isSetupFinished, notifyExternProtoLoaded, removeNodeListener, setErrorReporter, setFrameStateManager, setMetadataObject, setUserData, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setVersion, updateRefs |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.web3d.vrml.nodes.VRMLNodeType |
|---|
addNodeListener, clearRemovedLayerIds, getLayerIds, getMetadataObject, getRefCount, getRemovedLayerIds, hasFieldChanged, isSetupFinished, notifyExternProtoLoaded, removeNodeListener, setFrameStateManager, setMetadataObject, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue |
| Methods inherited from interface org.web3d.vrml.lang.VRMLNode |
|---|
getFieldDeclaration, getFieldIndex, getNodeFieldIndices, getNumFields, getSecondaryType, getUserData, getVRMLNodeName, isDEF, setErrorReporter, setUserData, setVersion |
| Methods inherited from interface org.web3d.vrml.nodes.FrameStateListener |
|---|
allEventsComplete |
| Field Detail |
|---|
protected static final int FIELD_CHILDREN
protected static final int FIELD_ADDCHILDREN
protected static final int FIELD_REMOVECHILDREN
protected static final int FIELD_BBOX_CENTER
protected static final int FIELD_BBOX_SIZE
protected static final int LAST_GROUP_INDEX
protected static final java.lang.String USE_BIND_MSG
protected java.util.ArrayList vfChildren
protected float[] vfBboxCenter
protected float[] vfBboxSize
protected int childCount
protected boolean hasBindables
protected int shareCount
| Constructor Detail |
|---|
protected BaseGroupingNode(java.lang.String name)
name - The name of the type of node| Method Detail |
|---|
protected void copy(VRMLGroupingNodeType node)
node - The grouping node to copy info frompublic float[] getBboxCenter()
0 0 0.
getBboxCenter in interface VRMLBoundedNodeTypepublic float[] getBboxSize()
-1 -1 -1.
getBboxSize in interface VRMLBoundedNodeTypepublic VRMLNodeType[] getChildren()
getChildren in interface VRMLGroupingNodeTypepublic void setChildren(VRMLNodeType[] newChildren)
setChildren in interface VRMLGroupingNodeTypenewChildren - Array of new childrenpublic void setChildren(VRMLNodeType newChild)
setChildren in interface VRMLGroupingNodeTypenewChild - The new childpublic void addChild(VRMLNodeType newChild)
addChild in interface VRMLGroupingNodeTypenewChild - The new childpublic int getChildrenSize()
getChildrenSize in interface VRMLGroupingNodeTypepublic boolean containsBindableNodes()
containsBindableNodes in interface VRMLGroupingNodeTypepublic boolean isShared()
isShared in interface VRMLGroupingNodeTypepublic void setShared(boolean used)
setShared in interface VRMLGroupingNodeTypeused - true if this is about to have another reference added
public void updateRefCount(int layer,
boolean add)
AbstractNode.getLayerIds().
updateRefCount in interface VRMLNodeTypeupdateRefCount in class AbstractNodelayer - The id of the layer to modify the ref count onadd - true to increment the reference count, false to decrementpublic void setDEF()
setDEF in interface VRMLNodeTypesetDEF in class AbstractNodejava.lang.IllegalStateException - The setup is finished.public void setupFinished()
setupFinished in interface VRMLNodeTypesetupFinished in class AbstractNodepublic int getPrimaryType()
getPrimaryType in interface VRMLNode
public VRMLFieldData getFieldValue(int index)
throws InvalidFieldException
getFieldValue in interface VRMLNodeTypegetFieldValue in class AbstractNodeindex - The index of the field to change.
InvalidFieldException - The field index is not known
public void sendRoute(double time,
int srcIndex,
VRMLNodeType destNode,
int destIndex)
sendRoute in interface VRMLNodeTypesendRoute in class AbstractNodetime - The time that this route occurred (not necessarily epoch
time. Should be treated as a relative value only)srcIndex - The index of the field in this node that the value
should be sent fromdestNode - The node reference that we will be sending the value todestIndex - The index of the field in the destination node that
the value should be sent to.
public void setValue(int index,
float[] value,
int numValid)
throws InvalidFieldException,
InvalidFieldValueException,
InvalidFieldAccessException
setValue in interface VRMLNodeTypesetValue in class AbstractNodeindex - The index of destination field to setvalue - The new value to use for the nodenumValid - The number of valid values to copy from the array
InvalidFieldException - The field index is not known
InvalidFieldValueException - The value provided is out of range
for the field type.
InvalidFieldAccessException - The call is attempting to write to
a field that does not permit writing now
public void setValue(int index,
VRMLNodeType child)
throws InvalidFieldException,
InvalidFieldValueException,
InvalidFieldAccessException
setValue in interface VRMLNodeTypesetValue in class AbstractNodeindex - The index of destination field to setchild - The new value to use for the node
InvalidFieldException - The field index is not known
InvalidFieldValueException - The value provided is out of range
for the field type.
InvalidFieldAccessException - The call is attempting to write to
a field that does not permit writing now
public void setValue(int index,
VRMLNodeType[] children,
int numValid)
throws InvalidFieldException,
InvalidFieldValueException,
InvalidFieldAccessException
setValue in interface VRMLNodeTypesetValue in class AbstractNodeindex - The index of destination field to setchildren - The new value to use for the nodenumValid - The number of valid values to copy from the array
InvalidFieldException - The field index is not known
InvalidFieldValueException - The value provided is out of range
for the field type.
InvalidFieldAccessException - The call is attempting to write to
a field that does not permit writing nowprotected void clearChildren()
protected void addChildNode(VRMLNodeType node)
throws InvalidFieldValueException
node - The node to add
InvalidFieldValueException - This is a bindable node sharedprotected void removeChildNode(VRMLNodeType node)
node - The node to remove
|
Xj3D 2.0 VRML/X3D Code API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||