Exemple #1
0
  /**
   * Copies all DistanceLOD information from <code>originalNode</code> into the current node. This
   * method is called from the <code>cloneNode</code> method which is, in turn, called by the <code>
   * cloneTree</code> method.
   *
   * <p>
   *
   * @param originalNode the original node to duplicate.
   * @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> variable determines whether NodeComponent data is duplicated or
   *     copied.
   * @exception RestrictedAccessException if this object is part of a live or compiled scenegraph.
   * @see Node#duplicateNode
   * @see Node#cloneTree
   * @see NodeComponent#setDuplicateOnCloneTree
   */
  @Override
  void duplicateAttributes(Node originalNode, boolean forceDuplicate) {
    super.duplicateAttributes(originalNode, forceDuplicate);

    DistanceLOD lod = (DistanceLOD) originalNode;

    int numD = lod.numDistances();

    // No API available to set the size of this array after initialize
    this.distances = new double[numD];

    for (int i = 0; i < numD; i++) setDistance(i, lod.getDistance(i));

    Point3f p = new Point3f();
    lod.getPosition(p);
    setPosition(p);
  }
Exemple #2
0
 /**
  * Used to create a new instance of the node. This routine is called by <code>cloneTree</code> to
  * duplicate the current node.
  *
  * @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> variable determines whether NodeComponent data is duplicated or
  *     copied.
  * @see Node#cloneTree
  * @see Node#cloneNode
  * @see Node#duplicateNode
  * @see NodeComponent#setDuplicateOnCloneTree
  */
 @Override
 public Node cloneNode(boolean forceDuplicate) {
   DistanceLOD d = new DistanceLOD();
   d.duplicateNode(this, forceDuplicate);
   return d;
 }