Package com.thinkaurelius.titan.core.attribute

Examples of com.thinkaurelius.titan.core.attribute.Geoshape$Point


                               interleave);
    }

    public static long shuffle(Space space, double x, double y)
    {
        Point point = new Point(x, y);
        long[] zValues = new long[1];
        space.decompose(point, zValues);
        long z = zValues[0];
        assert z != Space.Z_NULL;
        return z;
View Full Code Here


                    }
                    pbits.write(0, bits, 0, bits.length);
                    SIZE size = new SIZE();
                    size.cx = w;
                    size.cy = h;
                    POINT srcLoc = new POINT();
                    BLENDFUNCTION blend = new BLENDFUNCTION();
                    POINT loc = new POINT();
                    loc.x = win.getX();
                    loc.y = win.getY();
                    HWND hWnd = getHWnd(win);
                    // extract current constant alpha setting, if possible
                    ByteByReference bref = new ByteByReference();
View Full Code Here

                pbits.write(0, bits, 0, bits.length);
               
                SIZE size = new SIZE();
                size.cx = w;
                size.cy = h;
                POINT loc = new POINT();
                loc.x = alphaWindow.getX();
                loc.y = alphaWindow.getY();
                POINT srcLoc = new POINT();
                BLENDFUNCTION blend = new BLENDFUNCTION();
                blend.SourceConstantAlpha = (byte)(alpha * 255);
                blend.AlphaFormat = User32.AC_SRC_ALPHA;
                user.UpdateLayeredWindow(hWnd, screenDC, loc, size, memDC, srcLoc,
                                         0, blend, User32.ULW_ALPHA);
View Full Code Here

            List sizes = new ArrayList();
            while (!pi.isDone()) {
                int type = pi.currentSegment(coords);
                if (type == PathIterator.SEG_MOVETO) {
                    size = 1;
                    points.add(new POINT((int)coords[0], (int)coords[1]));
                }
                else if (type == PathIterator.SEG_LINETO) {
                    ++size;
                    points.add(new POINT((int)coords[0], (int)coords[1]));
                }
                else if (type == PathIterator.SEG_CLOSE) {
                    sizes.add(new Integer(size));
                }
                else {
                    throw new RuntimeException("Area is not polygonal: " + area);
                }
                pi.next();
            }
            POINT[] lppt = (POINT[])new POINT().toArray(points.size());
            POINT[] pts = (POINT[])points.toArray(new POINT[points.size()]);
            for (int i=0;i < lppt.length;i++) {
                lppt[i].x = pts[i].x;
                lppt[i].y = pts[i].y;
            }
View Full Code Here

                        pbits.write((v*ww+origin.x)*4, bits, 0, bits.length);
                    }
                    SIZE winSize = new SIZE();
                    winSize.cx = win.getWidth();
                    winSize.cy = win.getHeight();
                    POINT winLoc = new POINT();
                    winLoc.x = win.getX();
                    winLoc.y = win.getY();
                    POINT srcLoc = new POINT();
                    BLENDFUNCTION blend = new BLENDFUNCTION();
                    HWND hWnd = getHWnd(win);
                    // extract current constant alpha setting, if possible
                    ByteByReference bref = new ByteByReference();
                    IntByReference iref = new IntByReference();
View Full Code Here

                pbits.write(0, bits, 0, bits.length);
               
                SIZE size = new SIZE();
                size.cx = w;
                size.cy = h;
                POINT loc = new POINT();
                loc.x = alphaWindow.getX();
                loc.y = alphaWindow.getY();
                POINT srcLoc = new POINT();
                BLENDFUNCTION blend = new BLENDFUNCTION();
                blend.SourceConstantAlpha = (byte)(alpha * 255);
                blend.AlphaFormat = User32.AC_SRC_ALPHA;
                user.UpdateLayeredWindow(hWnd, screenDC, loc, size, memDC, srcLoc,
                                         0, blend, User32.ULW_ALPHA);
View Full Code Here

    @Override
    public Geoshape convert(Object value) {
        if (value.getClass().isArray() && (value.getClass().getComponentType().isPrimitive() ||
                Number.class.isAssignableFrom(value.getClass().getComponentType())) ) {
            Geoshape shape = null;
            int len= Array.getLength(value);
            double[] arr = new double[len];
            for (int i=0;i<len;i++) arr[i]=((Number)Array.get(value,i)).doubleValue();
            if (len==2) shape=Geoshape.point(arr[0],arr[1]);
            else if (len==3) shape=Geoshape.circle(arr[0],arr[1],arr[2]);
View Full Code Here

public class GeoshapeTest {

    @Test
    public void testDistance() {
        Geoshape p1 = Geoshape.point(37.759,-122.536);
        Geoshape p2 = Geoshape.point(35.714,-105.938);

        double distance = 1496;
        assertEquals(distance,p1.getPoint().distance(p2.getPoint()),5.0);

        p1 = Geoshape.point(0.0,0.0);
        p2 = Geoshape.point(10.0,10.0);
        //System.out.println(p1.getPoint().distance(p2.getPoint()));
    }
View Full Code Here

    }

    @Test
    public void testIntersection() {
        for (int i=0;i<50;i++) {
            Geoshape point = Geoshape.point(i,i);
            Geoshape circle = Geoshape.circle(0.0,0.0,point.getPoint().distance(Geoshape.point(0,0).getPoint())+10);
            assertTrue(circle.intersect(point));
            assertTrue(point.intersect(circle));
            assertTrue(circle.intersect(circle));
        }
    }
View Full Code Here

        }
    }

    @Test
    public void testEquality() {
        Geoshape c = Geoshape.circle(10.0,12.5,100);
        Geoshape b = Geoshape.box(20.0, 22.5, 40.5, 60.5);
        assertEquals(Geoshape.circle(10.0,12.5,100),c);
        assertEquals(Geoshape.box(20.0,22.5,40.5,60.5),b);
        assertEquals(Geoshape.circle(10.0,12.5,100).hashCode(),c.hashCode());
        assertEquals(Geoshape.box(20.0,22.5,40.5,60.5).hashCode(),b.hashCode());
        assertNotSame(c.hashCode(),b.hashCode());
        assertNotSame(c,b);
        System.out.println(c);
        System.out.println(b);
    }
View Full Code Here

TOP

Related Classes of com.thinkaurelius.titan.core.attribute.Geoshape$Point

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.