List of usage examples for javax.media.j3d Group getAllChildren
public Enumeration<Node> getAllChildren()
From source file:PickCollisionTest.java
void recursiveSetUserData(SceneGraphObject root, Object value) { root.setUserData(value);//from w w w .j a v a 2 s .c o m // recursively process group if (root instanceof Group) { Group g = (Group) root; // recurse on child nodes java.util.Enumeration enumKids = g.getAllChildren(); while (enumKids.hasMoreElements() != false) recursiveSetUserData((SceneGraphObject) enumKids.nextElement(), value); } }
From source file:VrmlPickingTest.java
void recursiveSetUserData(Object value, Object key) { if (value instanceof SceneGraphObject != false) { // set the user data for the item SceneGraphObject sg = (SceneGraphObject) value; sg.setUserData(key);/*from w w w . j a va2 s. c o m*/ // recursively process group if (sg instanceof Group) { Group g = (Group) sg; // recurse on child nodes java.util.Enumeration enumKids = g.getAllChildren(); while (enumKids.hasMoreElements() != false) recursiveSetUserData(enumKids.nextElement(), key); } else if (sg instanceof Shape3D || sg instanceof Morph) { PickTool.setCapabilities((Node) sg, PickTool.INTERSECT_FULL); } } }
From source file:ffx.potential.MolecularAssembly.java
private void recurseVRML(Node node) { if (node instanceof Shape3D) { Shape3D s3d = (Shape3D) node; PickTool.setCapabilities(s3d, PickTool.INTERSECT_COORD); return;/* www . j ava2 s. c om*/ } else if (node instanceof SharedGroup) { SharedGroup sg = (SharedGroup) node; for (Enumeration e = sg.getAllChildren(); e.hasMoreElements();) { recurseVRML((Node) e.nextElement()); } return; } else if (node instanceof BranchGroup) { BranchGroup bg = (BranchGroup) node; for (Enumeration e = bg.getAllChildren(); e.hasMoreElements();) { recurseVRML((Node) e.nextElement()); } return; } else if (node instanceof TransformGroup) { TransformGroup vrmlTG1 = (TransformGroup) node; for (Enumeration e = vrmlTG1.getAllChildren(); e.hasMoreElements();) { node = (Node) e.nextElement(); recurseVRML(node); } return; } else if (node instanceof Link) { Link link = (Link) node; recurseVRML(link.getSharedGroup()); return; } else if (node instanceof Group) { Group group = (Group) node; for (Enumeration e = group.getAllChildren(); e.hasMoreElements();) { Node n = (Node) e.nextElement(); recurseVRML(n); } } else { return; } }