Esempio n. 1
0
  /**
   * Notification that its safe to update the node now with any operations that could potentially
   * effect the node's bounds.
   *
   * @param src The node or Node Component that is to be updated.
   */
  public void updateNodeBoundsChanges(Object src) {

    Node kid;

    int size = (removedChildren == null) ? 0 : removedChildren.size();

    for (int i = 0; i < size; i++) {
      kid = (Node) removedChildren.get(i);
      implGroup.removeChild(kid);
    }

    size = (addedChildren == null) ? 0 : addedChildren.size();

    for (int i = 0; i < size; i++) {
      kid = (Node) addedChildren.get(i);
      implGroup.addChild(kid);
    }

    addedChildren.clear();
    removedChildren.clear();

    if (maskChanged) {
      implGroup.setMask(vfVisible);
      maskChanged = false;
    }
  }
Esempio n. 2
0
  /**
   * Notification that the construction phase of this node has finished. If the node would like to
   * do any internal processing, such as setting up geometry, then go for it now.
   */
  public void setupFinished() {
    if (!inSetup) return;

    super.setupFinished();

    if (isStatic && shareCount == 0) {
      oglImplGroup = implGroup;
    } else {
      oglImplGroup = new SharedGroup();
      oglImplGroup.addChild(implGroup);
    }

    // Check what sensors we have available and register those with the
    // user data information.
    if (!isStatic && (sensorList.size() != 0)) {
      OGLUserData data = new OGLUserData();
      implGroup.setUserData(data);

      data.sensors = new VRMLPointingDeviceSensorNodeType[sensorList.size()];

      sensorList.toArray(data.sensors);
    }

    sensorList = null;

    oglChildMap = new HashMap();
    oglChildList = new LinkedList();

    for (int i = 0; i < childCount; i++) {
      OGLVRMLNode node = (OGLVRMLNode) vfChildren.get(i);

      Node ogl_node = (Node) node.getSceneGraphObject();
      implGroup.addChild(ogl_node);

      oglChildList.add(ogl_node);
      oglChildMap.put(node, ogl_node);
    }

    if (!isStatic) {
      removedChildren = new LinkedList();
      addedChildren = new LinkedList();
    }

    // Need to fix this, not handling the list being different size to th
    // real values.
    System.out.println("OGLCADLayer not handling numVisible correctly");
    implGroup.setMask(vfVisible);
  }