Пример #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);
 }