/** * Duplicates all the nodes of the specified sub-graph. For Group Nodes * the group node is duplicated via a call to <code>cloneNode</code> * and then <code>cloneTree</code> * is called for each child node. For Leaf Nodes, component * data can either be duplicated or be made a reference to the original * data. Leaf Node cloneTree behavior is determined by the * <code>duplicateOnCloneTree</code> flag found in every Leaf Node's * component data class and by the <code>forceDuplicate</code> paramter. * @param referenceTable table that stores the mapping between * original and cloned nodes. All previous values in the * referenceTable will be cleared before the clone is made. * @return a reference to the cloned sub-graph. * @exception DanglingReferenceException When a dangling reference is * discovered during the cloneTree operation. * @exception RestrictedAccessException if this object is part of live * or compiled scene graph * @exception SceneGraphCycleException if there is a cycle in the * scene graph * @see NodeComponent#setDuplicateOnCloneTree * @since Java 3D 1.2 */ public Node cloneTree(NodeReferenceTable referenceTable) { return cloneTree(referenceTable, false, false); }
return cloneTree(referenceTable, forceDuplicate, false);
/** * Duplicates all the nodes of the specified sub-graph. For Group Nodes * the group node is duplicated via a call to <code>cloneNode</code> * and then <code>cloneTree</code> * is called for each child node. For Leaf Nodes, component * data can either be duplicated or be made a reference to the original * data. Leaf Node cloneTree behavior is determined by the * <code>duplicateOnCloneTree</code> flag found in every Leaf Node's * component data class and by the <code>forceDuplicate</code> paramter. * @return a reference to the cloned sub-graph. * @exception DanglingReferenceException When a dangling reference is * discovered during the cloneTree operation. * @exception RestrictedAccessException if this object is part of live * or compiled scene graph * @exception SceneGraphCycleException if there is a cycle in the * scene graph * @see NodeComponent#setDuplicateOnCloneTree */ public Node cloneTree() { return cloneTree(new NodeReferenceTable(), false, false); }
/** * Duplicates all the nodes of the specified sub-graph. For Group Nodes * the group node is duplicated via a call to <code>cloneNode</code> * and then <code>cloneTree</code> is called for each child node. * For Leaf Nodes, component * data can either be duplicated or be made a reference to the original * data. Leaf Node cloneTree behavior is determined by the * <code>duplicateOnCloneTree</code> flag found in every Leaf Node's * component data class and by the <code>forceDuplicate</code> paramter. * @param forceDuplicate when set to <code>true</code>, causes the * <code>duplicateOnCloneTree</code> flag to be ignored. When * <code>false</code>, the value of each node's * <code>duplicateOnCloneTree</code> determines whether data is * duplicated or copied. * @return a reference to the cloned scene graph. * @exception DanglingReferenceException When a dangling reference is * discovered during the cloneTree operation. * @exception RestrictedAccessException if this object is part of live * or compiled scene graph * @exception SceneGraphCycleException if there is a cycle in the * scene graph * @see NodeComponent#setDuplicateOnCloneTree */ public Node cloneTree(boolean forceDuplicate) { return cloneTree(new NodeReferenceTable(), forceDuplicate, false); }
return cloneTree(new NodeReferenceTable(), forceDuplicate, allowDanglingReferences);
Node n = cloneTree(forceDuplicate, referenceTable.objectHashtable);