コード例 #1
0
 public void Overlap(IDrawingTarget target, IDrawingBackend backend)
 {
     var c1 = backend.Ellipse(15, 5, 30, 30);
     var c2 = backend.Ellipse(35, 5, 30, 30);
     draw(target, c1, c2);
     expectRelation(c1, c2, GeometryRelation.Overlap);
 }
コード例 #2
0
 public void IsContained(IDrawingTarget target, IDrawingBackend backend)
 {
     var c1 = backend.Ellipse(30, 10, 20, 20);
     var c2 = backend.Ellipse(25, 5, 30, 30);
     draw(target, c1, c2);
     expectRelation(c1, c2, GeometryRelation.IsContained);
 }
コード例 #3
0
 public void Disjoint(IDrawingTarget target, IDrawingBackend backend)
 {
     var c1 = backend.Ellipse(5, 5, 30, 30);
     var c2 = backend.Ellipse(45, 5, 30, 30);
     draw(target, c1, c2);
     expectRelation(c1, c2, GeometryRelation.Disjoint);
 }
コード例 #4
0
        public void Contains(IDrawingTarget target, IDrawingBackend backend)
        {
            var c1 = backend.Ellipse(25, 5, 30, 30);
            var c2 = backend.Ellipse(30, 10, 20, 20);

            draw(target, c1, c2);
            expectRelation(c1, c2, GeometryRelation.Contains);
        }
コード例 #5
0
        public void Disjoint(IDrawingTarget target, IDrawingBackend backend)
        {
            var c1 = backend.Ellipse(5, 5, 30, 30);
            var c2 = backend.Ellipse(45, 5, 30, 30);

            draw(target, c1, c2);
            expectRelation(c1, c2, GeometryRelation.Disjoint);
        }
コード例 #6
0
        public void Overlap(IDrawingTarget target, IDrawingBackend backend)
        {
            var c1 = backend.Ellipse(15, 5, 30, 30);
            var c2 = backend.Ellipse(35, 5, 30, 30);

            draw(target, c1, c2);
            expectRelation(c1, c2, GeometryRelation.Overlap);
        }
コード例 #7
0
        static void test(CombineMode mode, IDrawingTarget target, IDrawingBackend backend)
        {
            var c1 = backend.Ellipse(15, 5, 30, 30);
            var c2 = backend.Ellipse(35, 5, 30, 30);

            var r = c1.Combine(mode, c2);

            target.Fill(color: new Color(0.7, 0.7, 1.0));
            target.Geometry(r);
        }
コード例 #8
0
        static void test(CombineMode mode, IDrawingTarget target, IDrawingBackend backend)
        {
            var c1 = backend.Ellipse(15, 5, 30, 30);
            var c2 = backend.Ellipse(35, 5, 30, 30);

            var r = c1.Combine(mode, c2);

            target.Fill(color: new Color(0.7, 0.7, 1.0));
            target.Geometry(r);
        }
コード例 #9
0
 public void StrokeFillIsContained(IDrawingTarget target, IDrawingBackend backend)
 {
     var c1 = backend.Line(35, 15, 45, 25);
     var c2 = backend.Ellipse(30, 10, 20, 20);
     draw(target, c1, c2);
     expectRelation(c1, c2, GeometryRelation.IsContained);
 }
コード例 #10
0
 public void StrokeFillDisjoint(IDrawingTarget target, IDrawingBackend backend)
 {
     var c1 = backend.Line(25, 10, 25, 30);
     var c2 = backend.Ellipse(30, 10, 20, 20);
     draw(target, c1, c2);
     expectRelation(c1, c2, GeometryRelation.Disjoint);
 }
コード例 #11
0
        static IGeometry visualize(IDrawingTarget target, IDrawingBackend backend)
        {
            var circle = backend.Ellipse(30, 10, Diameter, Diameter);

            target.Fill(color: new Color(0.7, 0.7, 1));
            target.Geometry(circle);
            return circle;
        }
コード例 #12
0
        static IGeometry visualize(IDrawingTarget target, IDrawingBackend backend)
        {
            var circle = backend.Ellipse(30, 10, Diameter, Diameter);

            target.Fill(color: new Color(0.7, 0.7, 1));
            target.Geometry(circle);
            return(circle);
        }
コード例 #13
0
        public void StrokeFillIsContained(IDrawingTarget target, IDrawingBackend backend)
        {
            var c1 = backend.Line(35, 15, 45, 25);
            var c2 = backend.Ellipse(30, 10, 20, 20);

            draw(target, c1, c2);
            expectRelation(c1, c2, GeometryRelation.IsContained);
        }
コード例 #14
0
        public void StrokeFillOverlap(IDrawingTarget target, IDrawingBackend backend)
        {
            var c1 = backend.Line(30, 10, 50, 30);
            var c2 = backend.Ellipse(30, 10, 20, 20);

            draw(target, c1, c2);
            expectRelation(c1, c2, GeometryRelation.Overlap);
        }
コード例 #15
0
        public void StrokeFillDisjoint(IDrawingTarget target, IDrawingBackend backend)
        {
            var c1 = backend.Line(25, 10, 25, 30);
            var c2 = backend.Ellipse(30, 10, 20, 20);

            draw(target, c1, c2);
            expectRelation(c1, c2, GeometryRelation.Disjoint);
        }
コード例 #16
0
        public void NotContainsPoint(IDrawingTarget target, IDrawingBackend backend)
        {
            var c1 = backend.Ellipse(30, 10, 20, 20);
            var c2 = backend.Rectangle(30, 10, 1, 1);

            target.Fill(color: new Color(0.7, 0.7, 1, 0.7));
            target.Geometry(c1);
            target.Geometry(c2);

            if (c1.Contains(30, 10))
                throw new Exception("circle is not expected to contain point at 30, 10");
        }
コード例 #17
0
        public void ContainsPoint(IDrawingTarget target, IDrawingBackend backend)
        {
            var c1 = backend.Ellipse(30, 10, 20, 20);
            var c2 = backend.Rectangle(40, 20, 1, 1);

            target.Fill(color: new Color(0.7, 0.7, 1, 0.7));
            target.Geometry(c1);
            target.Geometry(c2);

            if (!c1.Contains(40, 20))
            {
                throw new Exception("circle is expected to contain point at 40, 20");
            }
        }
コード例 #18
0
		public static IGeometry Ellipse(this IDrawingBackend backend, Rectangle rectangle)
		{
			return backend.Ellipse(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height);
		}
コード例 #19
0
 public void StrokeFillOverlap(IDrawingTarget target, IDrawingBackend backend)
 {
     var c1 = backend.Line(30, 10, 50, 30);
     var c2 = backend.Ellipse(30, 10, 20, 20);
     draw(target, c1, c2);
     expectRelation(c1, c2, GeometryRelation.Overlap);
 }