Class NodeReferenceTable
- java.lang.Object
-
- javax.media.j3d.NodeReferenceTable
-
public class NodeReferenceTable extends java.lang.ObjectThe NodeReferenceTable object is used by a leaf node'supdateNodeReferencesmethod called by thecloneTreemethod. The NodeReferenceTable maps nodes from the original subgraph to the new nodes in the cloned subgraph. This information can then be used to update any cloned leaf node references to reference nodes in the cloned subgraph.During a
cloneTreecall, after all nodes have been duplicated, each SceneGraphObject'supdateNodeReferencesmethod is called. This method takes a NodeReferenceTable object as a parameter. The SceneGraphObject'supdateNodeReferencesmethod can then use thegetNewObjectReferencemethod from this object to get updated references to objects that have been duplicated in the new cloneTree sub-graph. If a match is found, a reference to the corresponding SceneGraphObject in the newly cloned sub-graph is returned. If no corresponding reference is found, either a DanglingReferenceException is thrown by thecloneTreemethod or a reference to the original SceneGraphObject is returned depending on the value of theallowDanglingReferencesparameter passed in thecloneTreecall.
-
-
Constructor Summary
Constructors Constructor Description NodeReferenceTable()Constructs an empty NodeReferenceTable.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SceneGraphObjectgetNewObjectReference(SceneGraphObject oldReference)This method is used in conjunction with thecloneTreemethod.
-
-
-
Method Detail
-
getNewObjectReference
public final SceneGraphObject getNewObjectReference(SceneGraphObject oldReference)
This method is used in conjunction with thecloneTreemethod. It can be used by theupdateNodeReferencesmethod to see if a SceneGraphObject that is being referenced has been duplicated in the new cloneTree sub-graph.A SceneGraphObject's
updateNodeReferencesmethod would use this method by calling it with the reference to the old (existed before the cloneTree operation) object. If the object has been duplicated in the cloneTree sub-graph, the corresponding object in the cloned sub-graph is returned. If no corresponding reference is found, either a DanglingReferenceException is thrown or a reference to the original SceneGraphObject is returned depending on the value of theallowDanglingReferencesparameter passed in thecloneTreecall.- Parameters:
oldReference- the reference to the object in the original sub-graph.- Returns:
- A reference to the corresponding object in the cloned
sub-graph. If no corresponding object exists, either a
DanglingReferenceException will be generated by the
cloneTreemethod or a reference to the original object is returned depending on the value of theallowDanglingReferencesparameter passed in thecloneTreecall. - See Also:
SceneGraphObject.updateNodeReferences(javax.media.j3d.NodeReferenceTable),Node.cloneTree(),DanglingReferenceException
-
-