示例#1
0
        public void bboxFromLinkedGeoLoopNoVertices()
        {
            LinkedGeo.LinkedGeoLoop loop = new LinkedGeo.LinkedGeoLoop();

            BBox expected = new BBox {
                north = 0.0, south = 0.0, east = 0.0, west = 0.0
            };

            BBox result = new BBox();

            LinkedGeo.bboxFromLinkedGeoLoop(ref loop, ref result);

            Assert.True(BBox.bboxEquals(result, expected), "Got expected bbox");
        }
示例#2
0
        public void pointInsideLinkedGeoLoop()
        {
            GeoCoord somewhere = new GeoCoord(1, 2);
            GeoCoord inside    = new GeoCoord(0.659, -2.136);

            LinkedGeo.LinkedGeoLoop loop = new LinkedGeo.LinkedGeoLoop();
            createLinkedLoop(ref loop, sfVerts, 6);

            BBox bbox = new BBox();

            LinkedGeo.bboxFromLinkedGeoLoop(ref loop, ref bbox);

            Assert.True(LinkedGeo.pointInsideLinkedGeoLoop(ref loop, ref bbox, ref inside),
                        "contains exact4");
            Assert.True(!LinkedGeo.pointInsideLinkedGeoLoop(ref loop, ref bbox, ref somewhere),
                        "contains somewhere else");

            LinkedGeo.destroyLinkedGeoLoop(ref loop);
        }
示例#3
0
        public void bboxFromLinkedGeoLoop()
        {
            List <GeoCoord> verts =
                new List <GeoCoord>
            {
                new GeoCoord(0.8, 0.3),
                new GeoCoord(0.7, 0.6),
                new GeoCoord(1.1, 0.7),
                new GeoCoord(1.0, 0.2)
            };

            LinkedGeo.LinkedGeoLoop loop = new LinkedGeo.LinkedGeoLoop();
            createLinkedLoop(ref loop, verts, 4);

            BBox expected = new BBox {
                north = 1.1, south = 0.7, east = 0.7, west = 0.2
            };

            BBox result = new BBox();

            LinkedGeo.bboxFromLinkedGeoLoop(ref loop, ref result);
            Assert.True(BBox.bboxEquals(result, expected), "Got expected bbox");
        }