Examples of x()


Examples of org.gephi.layout.plugin.force.ForceVector.x()

        tree.addNode(new TestNode(1, 1));
        BarnesHut barnesHut = new BarnesHut(new TestForce());

        ForceVector f = barnesHut.calculateForce(tree, tree);
        assertNotNull(f);
        assertEquals(f.x(), 1, eps);
        assertEquals(f.y(), 1, eps);
    }
}
View Full Code Here

Examples of org.gephi.layout.plugin.force.quadtree.QuadTree.x()

        QuadTree tree = new QuadTree(0, 0, 10, 0);
        assertEquals(tree.mass(), 0);

        assertTrue(tree.addNode(new TestNode(1, 1)));
        assertEquals(1, tree.mass());
        assertEquals(1, tree.x(), eps);
        assertEquals(1, tree.y(), eps);

        assertTrue(tree.addNode(new TestNode(9, 9)));
        assertEquals(tree.mass(), 2);
        assertEquals(5, tree.x(), eps);
View Full Code Here

Examples of org.gephi.layout.plugin.force.quadtree.QuadTree.x()

        assertEquals(1, tree.x(), eps);
        assertEquals(1, tree.y(), eps);

        assertTrue(tree.addNode(new TestNode(9, 9)));
        assertEquals(tree.mass(), 2);
        assertEquals(5, tree.x(), eps);
        assertEquals(5, tree.y(), eps);
    }

    @org.junit.Test
    public void testMaxLevel1() {
View Full Code Here

Examples of org.gephi.layout.plugin.force.quadtree.QuadTree.x()

        QuadTree tree = new QuadTree(0, 0, 10, 1);
        assertEquals(0, tree.mass());

        assertTrue(tree.addNode(new TestNode(1, 1)));
        assertEquals(1, tree.mass());
        assertEquals(1, tree.x(), eps);
        assertEquals(1, tree.y(), eps);

        assertTrue(tree.addNode(new TestNode(9, 9)));
        assertEquals(2, tree.mass());
        assertEquals(5, tree.y(), eps);
View Full Code Here

Examples of org.gephi.lib.gleem.linalg.Vec2f.x()

            return;
        }
        float collisionDistance = ((ModelImpl) nodeTo.getModel()).getCollisionDistance(angle);

        //Point of the arrow
        float targetX = x2 - edgeVector.x() * collisionDistance;
        float targetY = y2 - edgeVector.y() * collisionDistance;

        //Base of the arrow
        float baseX = targetX - edgeVector.x() * arrowHeight * 2f;
        float baseY = targetY - edgeVector.y() * arrowHeight * 2f;
 
View Full Code Here

Examples of org.gephi.lib.gleem.linalg.Vec2f.x()

        //Point of the arrow
        float targetX = x2 - edgeVector.x() * collisionDistance;
        float targetY = y2 - edgeVector.y() * collisionDistance;

        //Base of the arrow
        float baseX = targetX - edgeVector.x() * arrowHeight * 2f;
        float baseY = targetY - edgeVector.y() * arrowHeight * 2f;

        //Side vector
        float sideVectorX = y1 - y2;
        float sideVectorY = x2 - x1;
View Full Code Here

Examples of org.gephi.lib.gleem.linalg.Vec3f.x()

        //Set stepVector for zooming, direction of camera and norm of step
        cameraVector.normalize();
        Vec3f stepVec = cameraVector.times(step);

        cameraLocation[0] += stepVec.x();
        cameraLocation[1] += stepVec.y();
        cameraLocation[2] += stepVec.z();
        cameraLocation[2] = MathUtil.clamp(cameraLocation[2], 1f, Float.POSITIVE_INFINITY);
        //System.out.println("camera: "+graphDrawable.cameraLocation[2]);
View Full Code Here

Examples of org.gephi.lib.gleem.linalg.Vec3f.x()

        //Displacement of camera according to mouse position. Clamped to graph limits
        Vec3f disVec = new Vec3f(mouseX, mouseY, 0);
        disVec.scale(stepRatio);
        //System.out.println(disVec.x()+"    "+disVec.y()+"     "+disVec.z());

        cameraLocation[0] += disVec.x();
        cameraLocation[1] += disVec.y();
        cameraLocation[2] += disVec.z();

        cameraTarget[0] += disVec.x();
        cameraTarget[1] += disVec.y();
View Full Code Here

Examples of org.gephi.lib.gleem.linalg.Vec3f.x()

        cameraLocation[0] += disVec.x();
        cameraLocation[1] += disVec.y();
        cameraLocation[2] += disVec.z();

        cameraTarget[0] += disVec.x();
        cameraTarget[1] += disVec.y();
        cameraTarget[2] += disVec.z();

        //Refresh
        engine.getScheduler().requireUpdateVisible();
View Full Code Here

Examples of org.gephi.lib.gleem.linalg.Vec3f.x()

        Vec3f camVect = new Vec3f(cameraTarget[0] - cameraLocation[0], cameraTarget[1] - cameraLocation[1], cameraTarget[2] - cameraLocation[2]);

        float diff = camVect.length() - distance;
        if (Math.abs(diff) > 1f) {
            camVect.normalize();
            cameraLocation[0] += camVect.x() * diff;
            cameraLocation[1] += camVect.y() * diff;
            cameraLocation[2] += camVect.z() * diff;
            cameraLocation[2] = Math.max(0.5f, cameraLocation[2]);

            engine.getScheduler().requireUpdateVisible();
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.