Example usage for javax.media.j3d BranchGroup getAllChildren

List of usage examples for javax.media.j3d BranchGroup getAllChildren

Introduction

In this page you can find the example usage for javax.media.j3d BranchGroup getAllChildren.

Prototype

public Enumeration<Node> getAllChildren() 

Source Link

Document

Returns an Enumeration object of this group node's list of children.

Usage

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;//from  w ww .ja v a2  s .  co  m

    } 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;
    }

}