Search in sources :

Example 1 with SharedGroup

use of javax.media.j3d.SharedGroup in project ffx by mjschnie.

the class MolecularAssembly method recurseVRML.

private void recurseVRML(Node node) {
    if (node instanceof Shape3D) {
        Shape3D s3d = (Shape3D) node;
        PickTool.setCapabilities(s3d, PickTool.INTERSECT_COORD);
        return;
    } else if (node instanceof SharedGroup) {
        SharedGroup sg = (SharedGroup) node;
        for (Enumeration<Node> e = sg.getAllChildren(); e.hasMoreElements(); ) {
            recurseVRML(e.nextElement());
        }
        return;
    } else if (node instanceof BranchGroup) {
        BranchGroup bg = (BranchGroup) node;
        for (Enumeration<Node> e = bg.getAllChildren(); e.hasMoreElements(); ) {
            recurseVRML(e.nextElement());
        }
        return;
    } else if (node instanceof TransformGroup) {
        TransformGroup vrmlTG1 = (TransformGroup) node;
        for (Enumeration<Node> e = vrmlTG1.getAllChildren(); e.hasMoreElements(); ) {
            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<Node> e = group.getAllChildren(); e.hasMoreElements(); ) {
            Node n = e.nextElement();
            recurseVRML(n);
        }
    }
}
Also used : BranchGroup(javax.media.j3d.BranchGroup) Group(javax.media.j3d.Group) SharedGroup(javax.media.j3d.SharedGroup) MSGroup(ffx.potential.bonded.MSGroup) TransformGroup(javax.media.j3d.TransformGroup) Enumeration(java.util.Enumeration) BranchGroup(javax.media.j3d.BranchGroup) Node(javax.media.j3d.Node) MSNode(ffx.potential.bonded.MSNode) Shape3D(javax.media.j3d.Shape3D) SharedGroup(javax.media.j3d.SharedGroup) Link(javax.media.j3d.Link) TransformGroup(javax.media.j3d.TransformGroup)

Aggregations

MSGroup (ffx.potential.bonded.MSGroup)1 MSNode (ffx.potential.bonded.MSNode)1 Enumeration (java.util.Enumeration)1 BranchGroup (javax.media.j3d.BranchGroup)1 Group (javax.media.j3d.Group)1 Link (javax.media.j3d.Link)1 Node (javax.media.j3d.Node)1 Shape3D (javax.media.j3d.Shape3D)1 SharedGroup (javax.media.j3d.SharedGroup)1 TransformGroup (javax.media.j3d.TransformGroup)1