Examples of MockTreeLeaf


Examples of barsuift.simLife.tree.MockTreeLeaf

    private MockUniverse3D mockUniverse3D;

    @Override
    protected void setUp() throws Exception {
        super.setUp();
        mockLeaf = new MockTreeLeaf();
        leaf3DState = DisplayDataCreatorForTests.createRandomTreeLeaf3DState();
        mockUniverse3D = new MockUniverse3D();
    }
View Full Code Here

Examples of barsuift.simLife.tree.MockTreeLeaf

    protected void setUp() throws Exception {
        super.setUp();
        mockBranchPart = new MockTreeBranchPart();
        nbLeaves = 5;
        for (int index = 0; index < nbLeaves; index++) {
            MockTreeLeaf mockLeaf = new MockTreeLeaf();
            mockLeaf.getTreeLeaf3D().getState().setRotation(Randomizer.randomRotation());
            mockLeaf.getTreeLeaf3D().getState().setLeafAttachPoint(DisplayDataCreatorForTests.createRandomPointState());
            mockBranchPart.addLeaf(mockLeaf);
        }
        mockUniverse3D = new MockUniverse3D();
        part3DState = DisplayDataCreatorForTests.createRandomTreeBranchPart3DState();
    }
View Full Code Here

Examples of barsuift.simLife.tree.MockTreeLeaf

    }

    public void testInitFromUniverse() {
        BasicUniverse3D universe3D = new BasicUniverse3D();
        Universe universe = new MockUniverse();
        MockTreeLeaf treeLeaf = new MockTreeLeaf();
        treeLeaf.setState(CoreDataCreatorForTests.createSpecificTreeLeafState());
        universe.addFallenLeaf(treeLeaf);
        MockTree tree = new MockTree();
        tree.setState(CoreDataCreatorForTests.createSpecificTreeState());
        universe.addTree(tree);
        universe3D.initFromUniverse(universe);

        assertNotNull(universe3D.getLights());

        Set<Node> elements3d = universe3D.getElements3D();
        assertNotNull(elements3d);
        assertEquals(3, elements3d.size());
        // the 3D node is added to a transform group, itself added to a branch group
        // that's why i test the parent of the parent
        assertTrue(elements3d.contains(tree.getTree3D().getBranchGroup().getParent().getParent()));
        assertTrue(elements3d.contains(treeLeaf.getTreeLeaf3D().getNode().getParent().getParent()));

    }
View Full Code Here

Examples of barsuift.simLife.tree.MockTreeLeaf

    public void testAddElement3D() {
        BasicUniverse3D universe3D = new BasicUniverse3D();
        TreeLeaf3DStateFactory stateFactory = new TreeLeaf3DStateFactory();
        Point3d leafAttachPoint = new Point3d(Math.random(), Math.random(), Math.random());
        TreeLeaf3DState leaf3dState = stateFactory.createRandomTreeLeaf3DState(leafAttachPoint);
        BasicTreeLeaf3D treeLeaf3D = new BasicTreeLeaf3D(universe3D, leaf3dState, new MockTreeLeaf());
        universe3D.addElement3D(treeLeaf3D.getNode());
        Set<Node> elements3d = universe3D.getElements3D();
        assertNotNull(elements3d);
        assertEquals(1, elements3d.size());
        assertTrue(elements3d.contains(treeLeaf3D.getNode()));
View Full Code Here

Examples of barsuift.simLife.tree.MockTreeLeaf

    private MockUniverse3D mockUniverse3D;

    @Override
    protected void setUp() throws Exception {
        super.setUp();
        mockLeaf = new MockTreeLeaf();
        leaf3DState = DisplayDataCreatorForTests.createRandomTreeLeaf3DState();
        mockUniverse3D = new MockUniverse3D();
    }
View Full Code Here

Examples of barsuift.simLife.tree.MockTreeLeaf

    protected void setUp() throws Exception {
        super.setUp();
        mockBranchPart = new MockTreeBranchPart();
        nbLeaves = 5;
        for (int index = 0; index < nbLeaves; index++) {
            MockTreeLeaf mockLeaf = new MockTreeLeaf();
            mockLeaf.getTreeLeaf3D().getState().setRotation(Randomizer.randomRotation());
            mockLeaf.getTreeLeaf3D().getState().setLeafAttachPoint(DisplayDataCreatorForTests.createRandomTupleState());
            mockBranchPart.addLeaf(mockLeaf);
        }
        mockUniverse3D = new MockUniverse3D();
        part3DState = DisplayDataCreatorForTests.createRandomTreeBranchPart3DState();
    }
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.