Package javax.media.j3d

Examples of javax.media.j3d.BranchGroup.numChildren()


   * Updates the rotation of the model displayed by this component.
   * The model is shown at its default size.
   */
  protected void setModelRotation(float [][] modelRotation) {
    BranchGroup model = getModel();
    if (model != null && model.numChildren() > 0) {
      BoundingBox bounds = ModelManager.getInstance().getBounds(model);
      Point3d lower = new Point3d();
      bounds.getLower(lower);
      Point3d upper = new Point3d();
      bounds.getUpper(upper);
View Full Code Here


   * Updates the rotation and the size of the model displayed by this component.
   */
  protected void setModelRotationAndSize(float [][] modelRotation,
                                         float width, float depth, float height) {
    BranchGroup model = getModel();
    if (model != null && model.numChildren() > 0) {
      BoundingBox bounds = ModelManager.getInstance().getBounds(model);
      Point3d lower = new Point3d();
      bounds.getLower(lower);
      Point3d upper = new Point3d();
      bounds.getUpper(upper);
View Full Code Here

        // Return the first scene that can be loaded from model URL content
        Scene scene = loader.load(urlContent.getURL());

        BranchGroup modelNode = scene.getSceneGroup();
        // If model doesn't have any child, consider the file as wrong
        if (modelNode.numChildren() == 0) {
          throw new IllegalArgumentException("Empty model");
        }
       
        // Update transparency of scene window panes shapes
        updateShapeNamesAndWindowPanesTransparency(scene);
View Full Code Here

   * Returns the node of the outline model.
   */
  private Node getOutlineModelNode() {
    TransformGroup transformGroup = (TransformGroup)getChild(0);
    BranchGroup branchGroup = (BranchGroup)transformGroup.getChild(0);
    if (branchGroup.numChildren() > 1) {
      return branchGroup.getChild(1);
    } else {
      return null;
    }
  }
View Full Code Here

        BasicUniverse3D universe3D = new BasicUniverse3D(new Universe3DState(), new MockUniverse());
        assertNotNull(universe3D.getElements3D());
        assertNotNull(universe3D.getPhysics3D());
        BranchGroup root = universe3D.getUniverseRoot();
        assertNotNull(root);
        assertEquals(0, root.numChildren());
        assertTrue(root.getCapability(Group.ALLOW_CHILDREN_EXTEND));
    }

    public void testInitFromUniverse() {
        BasicUniverse3D universe3D = new BasicUniverse3D(new Universe3DState(), new MockUniverse());
View Full Code Here

        assertNotNull(elements3d);
        assertEquals(1, elements3d.size());
        assertTrue(elements3d.contains(treeLeaf3D.getBranchGroup()));
        BranchGroup root = universe3D.getUniverseRoot();
        assertNotNull(root);
        assertEquals(1, root.numChildren());
        assertEquals(treeLeaf3D.getBranchGroup(), root.getChild(0));
    }
}
View Full Code Here

        BasicUniverse3D universe3D = new BasicUniverse3D();
        assertNotNull(universe3D.getElements3D());
        assertNotNull(universe3D.getPhysics());
        BranchGroup root = universe3D.getUniverseRoot();
        assertNotNull(root);
        assertEquals(0, root.numChildren());
        assertTrue(root.getCapability(Group.ALLOW_CHILDREN_EXTEND));
    }

    public void testInitFromUniverse() {
        BasicUniverse3D universe3D = new BasicUniverse3D();
View Full Code Here

        assertNotNull(elements3d);
        assertEquals(1, elements3d.size());
        assertTrue(elements3d.contains(treeLeaf3D.getBranchGroup()));
        BranchGroup root = universe3D.getUniverseRoot();
        assertNotNull(root);
        assertEquals(1, root.numChildren());
        assertEquals(treeLeaf3D.getBranchGroup(), root.getChild(0));
    }
}
View Full Code Here

        BasicUniverse3D universe3D = new BasicUniverse3D();
        assertNotNull(universe3D.getElements3D());
        assertNotNull(universe3D.getPhysics());
        BranchGroup root = universe3D.getUniverseRoot();
        assertNotNull(root);
        assertEquals(0, root.numChildren());
        assertTrue(root.getCapability(Group.ALLOW_CHILDREN_EXTEND));
    }

    public void testInitFromUniverse() {
        BasicUniverse3D universe3D = new BasicUniverse3D();
View Full Code Here

        assertNotNull(elements3d);
        assertEquals(1, elements3d.size());
        assertTrue(elements3d.contains(treeLeaf3D.getNode()));
        BranchGroup root = universe3D.getUniverseRoot();
        assertNotNull(root);
        assertEquals(1, root.numChildren());
        assertEquals(treeLeaf3D.getNode(), root.getChild(0));
    }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.