Package javax.media.j3d

Examples of javax.media.j3d.Group


        Vector3d translationVector = new Vector3d();
        transform3D.get(translationVector);
        Vector3d expectedTranslationVector = new Vector3d(previousPartEndPoints.get(nbPartsFound).toPointValue());
        VectorTestHelper.assertVectorEquals(expectedTranslationVector, translationVector);

        Group groupPart = (Group) transformGroupPart.getChild(0);
        assertNotNull(groupPart);

        return checkCurrentTransformGroup(nbPartsFound + 1, transformGroupPart);
    }
View Full Code Here


    public void testTreeBranchPart3D() {
        BasicTreeBranchPart3D part3D = new BasicTreeBranchPart3D(mockUniverse3D, part3DState, mockBranchPart);
        CompilerHelper.compile(part3D.getGroup());
        assertEquals(nbLeaves, part3D.getLeaves().size());
        assertEquals(part3DState.getEndPoint().toPointValue(), part3D.getEndPoint());
        Group partGroup = part3D.getGroup();
        assertTrue(partGroup.getCapability(Group.ALLOW_CHILDREN_WRITE));
        assertTrue(partGroup.getCapability(Group.ALLOW_CHILDREN_EXTEND));
        int nbTimesNoLeafShapeIsFound = 0;
        int nbLeavesFound = 0;
        for (Enumeration enumeration = partGroup.getAllChildren(); enumeration.hasMoreElements();) {
            Object child = enumeration.nextElement();
            if (child instanceof BranchGroup) {
                BranchGroup leafBranchGroup = (BranchGroup) child;

                Structure3DHelper.assertExactlyOneTransformGroup(leafBranchGroup);
View Full Code Here

                Vector3d expectedTranslationVector = treeBranch.getBranch3D().getTranslationVector();
                VectorTestHelper.assertVectorEquals(expectedTranslationVector, translationVector);

                // test one branch found
                Structure3DHelper.assertExactlyOneGroup(transformGroup);
                Group specificGroupForTheBranch = (Group) transformGroup.getChild(0);
                assertNotNull(specificGroupForTheBranch);
                nbBranchesFound++;
            } else {
                if (child instanceof Group) {
                    nbTimesTrunkGroupIsFound++;
View Full Code Here

        Vector3d translationVector = new Vector3d();
        transform3D.get(translationVector);
        Vector3d expectedTranslationVector = new Vector3d(previousPartEndPoints.get(nbPartsFound).toPointValue());
        VectorTestHelper.assertVectorEquals(expectedTranslationVector, translationVector);

        Group groupPart = (Group) transformGroupPart.getChild(0);
        assertNotNull(groupPart);

        return checkCurrentTransformGroup(nbPartsFound + 1, transformGroupPart);
    }
View Full Code Here

    public void testTreeBranchPart3D() {
        BasicTreeBranchPart3D part3D = new BasicTreeBranchPart3D(mockUniverse3D, part3DState, mockBranchPart);
        CompilerHelper.compile(part3D.getGroup());
        assertEquals(nbLeaves, part3D.getLeaves().size());
        assertEquals(part3DState.getEndPoint().toPointValue(), part3D.getEndPoint());
        Group partGroup = part3D.getGroup();
        assertTrue(partGroup.getCapability(Group.ALLOW_CHILDREN_WRITE));
        assertTrue(partGroup.getCapability(Group.ALLOW_CHILDREN_EXTEND));
        int nbTimesNoLeafShapeIsFound = 0;
        int nbLeavesFound = 0;
        for (Enumeration enumeration = partGroup.getAllChildren(); enumeration.hasMoreElements();) {
            Object child = enumeration.nextElement();
            if (child instanceof BranchGroup) {
                BranchGroup leafBranchGroup = (BranchGroup) child;

                Structure3DHelper.assertExactlyOneTransformGroup(leafBranchGroup);
View Full Code Here

        }
        this.state = state;
        this.translationVector = state.getTranslationVector().toVectorValue();
        this.treeBranch = treeBranch;
        BranchGroup parts = createParts();
        this.group = new Group();
        group.addChild(parts);
    }
View Full Code Here

        Point3d currentPartStartPoint = new Point3d(0, 0, 0);
        TransformGroup previousTransformGroup = new TransformGroup();
        branchGroup.addChild(previousTransformGroup);
        for (TreeBranchPart branchPart : treeBranch.getParts()) {
            TreeBranchPart3D branchPart3D = branchPart.getBranchPart3D();
            Group branchPartGroup = branchPart3D.getGroup();
            BranchGroup currentBranchGroup = new BranchGroup();
            Vector3d translationVector = new Vector3d(currentPartStartPoint);
            TransformGroup currentTransformGroup = TransformerHelper.getTranslationTransformGroup(translationVector);
            currentBranchGroup.addChild(currentTransformGroup);
            currentTransformGroup.addChild(branchPartGroup);
View Full Code Here

            throw new IllegalArgumentException("Null tree branch part");
        }
        this.state = state;
        this.endPoint = state.getEndPoint().toPointValue();
        this.branchPart = branchPart;
        this.group = new Group();
        group.setCapability(Group.ALLOW_CHILDREN_WRITE);
        group.setCapability(Group.ALLOW_CHILDREN_EXTEND);
        createFullTreeBranch(branchPart);
    }
View Full Code Here

        trunkCylinder = new Cylinder(trunk.getRadius(), trunk.getHeight(), trunkAppearance);
        Vector3d translationVector = new Vector3d();
        translationVector.setY(trunk.getHeight() / 2);
        TransformGroup transformGroup = TransformerHelper.getTranslationTransformGroup(translationVector);
        transformGroup.addChild(trunkCylinder);
        this.group = new Group();
        group.addChild(transformGroup);
    }
View Full Code Here

TOP

Related Classes of javax.media.j3d.Group

Copyright © 2018 www.massapicom. 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.