Example #1
0
        public void InQuadrant()
        {
            var polygons = new List <Polygon>
            {
                new Polygon
                (
                    new []
                {
                    Vector3.Origin,
                    new Vector3(8.0, 0.0),
                    new Vector3(8.0, 3.0),
                    new Vector3(0.0, 3.0)
                }
                ),
                new Polygon
                (
                    new []
                {
                    new Vector3(-5.0, 0.0),
                    new Vector3(-8.0, 0.0),
                    new Vector3(-8.0, 20.0),
                    new Vector3(-5.0, 20.0)
                }
                ),
                new Polygon
                (
                    new []
                {
                    new Vector3(-10.0, -1.0),
                    new Vector3(-20.0, -1.0),
                    new Vector3(-20.0, -3.0),
                    new Vector3(-10.0, -3.0)
                }
                ),
                new Polygon
                (
                    new []
                {
                    new Vector3(10.0, 0.0),
                    new Vector3(20.0, 0.0),
                    new Vector3(20.0, -3.0),
                    new Vector3(10.0, -3.0)
                }
                )
            };

            Assert.Single(Shaper.InQuadrant(polygons, Quadrant.I));
            Assert.Single(Shaper.InQuadrant(polygons, Quadrant.II));
            Assert.Single(Shaper.InQuadrant(polygons, Quadrant.III));
            Assert.Single(Shaper.InQuadrant(polygons, Quadrant.IV));
        }