private static CanvasGeometry CreateStarCore(ICanvasResourceCreator resourceCreator, int points, float innerRadius, Matrix3x2 oneMatrix)
        {
            float rotation = TransformerGeometry.StartingRotation;
            float angle    = FanKit.Math.Pi / points;

            Vector2[] array = new Vector2[points * 2];
            for (int i = 0; i < points; i++)
            {
                int index = i * 2;

                // Outer
                Vector2 outer          = TransformerGeometry.GetRotationVector(rotation);
                Vector2 outerTransform = Vector2.Transform(outer, oneMatrix);
                array[index] = outerTransform;
                rotation    += angle;

                // Inner
                Vector2 inner           = TransformerGeometry.GetRotationVector(rotation);
                Vector2 inner2          = inner * innerRadius;
                Vector2 inner2Transform = Vector2.Transform(inner2, oneMatrix);
                array[index + 1] = inner2Transform;
                rotation        += angle;
            }

            return(CanvasGeometry.CreatePolygon(resourceCreator, array));
        }
Beispiel #2
0
        /// <summary>
        /// Create a new cookie geometry.
        /// </summary>
        /// <param name="resourceCreator"> The resource-creator. </param>
        /// <param name="transformer"> The source transformer. </param>
        /// <param name="innerRadius"> The inner-radius. </param>
        /// <param name="sweepAngle"> The sweep-angle. </param>
        /// <returns> The product geometry. </returns>
        public static CanvasGeometry CreateCookie(ICanvasResourceCreator resourceCreator, ITransformerLTRB transformer, Matrix3x2 matrix, float innerRadius, float sweepAngle)
        {
            bool zeroInnerRadius = innerRadius == 0;
            bool zeroSweepAngle  = sweepAngle == 0;

            if (zeroSweepAngle)
            {
                CanvasGeometry ellipse = TransformerGeometry.CreateEllipse(resourceCreator, transformer, matrix);

                if (zeroInnerRadius)
                {
                    return(ellipse);
                }
                else
                {
                    Vector2 center = Vector2.Transform(transformer.Center, matrix);

                    return(TransformerGeometry.CreateDountCore(ellipse, innerRadius, center));
                }
            }
            else
            {
                Matrix3x2 oneMatrix  = Transformer.FindHomography(Transformer.One, transformer);
                Matrix3x2 oneMatrix2 = oneMatrix * matrix;

                if (zeroInnerRadius)
                {
                    return(TransformerGeometry.CreatePieCore(resourceCreator, oneMatrix2, sweepAngle));
                }
                else
                {
                    return(TransformerGeometry.CreateCookieCore(resourceCreator, oneMatrix2, innerRadius, sweepAngle));
                }
            }
        }
Beispiel #3
0
        /// <summary>
        /// Create a new capsule geometry.
        /// </summary>
        /// <param name="resourceCreator"> The resource - creator. </param>
        /// <param name="transformer"> The ITransformer - LTRB. </param>
        /// <returns> The product geometry. </returns>
        public static CanvasGeometry CreateCapsule(ICanvasResourceCreator resourceCreator, ITransformerLTRB transformer)
        {
            Vector2 centerLeft   = transformer.CenterLeft;
            Vector2 centerTop    = transformer.CenterTop;
            Vector2 centerRight  = transformer.CenterRight;
            Vector2 centerBottom = transformer.CenterBottom;

            // Horizontal
            Vector2 horizontal       = transformer.Horizontal;
            float   horizontalLength = horizontal.Length();
            Vector2 horizontalUnit   = horizontal / horizontalLength;
            // Vertical
            Vector2 vertical       = transformer.Vertical;
            float   verticalLength = vertical.Length();

            if (horizontalLength < verticalLength)
            {
                return(TransformerGeometry.CreateEllipse(resourceCreator, transformer));
            }

            return(TransformerGeometry.CreateCapsuleCore(resourceCreator,
                                                         verticalLength,
                                                         horizontalUnit,

                                                         centerTop,
                                                         centerLeft,
                                                         centerRight,
                                                         centerBottom,

                                                         transformer.LeftTop,
                                                         transformer.RightTop,
                                                         transformer.RightBottom,
                                                         transformer.LeftBottom
                                                         ));
        }
Beispiel #4
0
        private static CanvasGeometry CreateCookieCore(ICanvasResourceCreator resourceCreator, Matrix3x2 oneMatrix, float innerRadius, float sweepAngle)
        {
            // start tooth
            Vector2 startTooth = new Vector2(1, 0);
            // end tooth
            Vector2 endTooth = TransformerGeometry.GetRotationVector(sweepAngle);

            CanvasPathBuilder pathBuilder   = new CanvasPathBuilder(resourceCreator);
            CanvasArcSize     canvasArcSize = (sweepAngle < System.Math.PI) ? CanvasArcSize.Large : CanvasArcSize.Small;

            {
                // DonutAndCookie
                // start notch
                Vector2 startNotch = startTooth * innerRadius;
                // end notch
                Vector2 endNotch = endTooth * innerRadius;

                // start tooth point
                pathBuilder.BeginFigure(startNotch);
                // start notch point
                pathBuilder.AddArc(endNotch, innerRadius, innerRadius, sweepAngle, CanvasSweepDirection.CounterClockwise, canvasArcSize);
            }

            // end notch point
            pathBuilder.AddLine(endTooth);

            // end tooth point
            pathBuilder.AddArc(startTooth, 1, 1, sweepAngle, CanvasSweepDirection.Clockwise, canvasArcSize);

            pathBuilder.EndFigure(CanvasFigureLoop.Closed);

            return(CanvasGeometry.CreatePath(pathBuilder).Transform(oneMatrix));
        }
        /// <summary>
        /// Create a new cog geometry.
        /// </summary>
        /// <param name="resourceCreator"> The resource-creator. </param>
        /// <param name="transformer"> The source transformer. </param>
        /// <param name="count"> The point count. </param>
        /// <param name="innerRadius"> The inner-radius. </param>
        /// <param name="tooth"> The tooth. </param>
        /// <param name="notch"> The notch. </param>
        /// <returns> The product geometry. </returns>
        public static CanvasGeometry CreateCog(ICanvasResourceCreator resourceCreator, ITransformerLTRB transformer, Matrix3x2 matrix, int count, float innerRadius, float tooth, float notch)
        {
            Matrix3x2 oneMatrix  = Transformer.FindHomography(Transformer.One, transformer);
            Matrix3x2 oneMatrix2 = oneMatrix * matrix;

            return(TransformerGeometry.CreateCogCore(resourceCreator, count, innerRadius, tooth, notch, oneMatrix2));
        }
        /// <summary>
        /// Create a new star geometry.
        /// </summary>
        /// <param name="resourceCreator"> The resource-creator. </param>
        /// <param name="transformer"> The source transformer. </param>
        /// <param name="points"> The point count. </param>
        /// <param name="innerRadius"> The inner-radius. </param>
        /// <returns> The product geometry. </returns>
        public static CanvasGeometry CreateStar(ICanvasResourceCreator resourceCreator, ITransformerLTRB transformer, Matrix3x2 matrix, int points, float innerRadius)
        {
            Matrix3x2 oneMatrix  = Transformer.FindHomography(Transformer.One, transformer);
            Matrix3x2 oneMatrix2 = oneMatrix * matrix;

            return(TransformerGeometry.CreateStarCore(resourceCreator, points, innerRadius, oneMatrix2));
        }
Beispiel #7
0
        /// <summary>
        /// Create a new heart geometry.
        /// </summary>
        /// <param name="resourceCreator"> The resource - creator. </param>
        /// <param name="transformer"> The source transformer. </param>
        /// <param name="spread"> The spread. </param>
        /// <returns> The product geometry. </returns>
        public static CanvasGeometry CreateHeart(ICanvasResourceCreator resourceCreator, ITransformerLTRB transformer, Matrix3x2 matrix, float spread)
        {
            Matrix3x2 oneMatrix  = Transformer.FindHomography(Transformer.One, transformer);
            Matrix3x2 oneMatrix2 = oneMatrix * matrix;

            return(TransformerGeometry.CreateHeartCore(resourceCreator, spread, oneMatrix2));
        }
        /// <summary>
        /// Create a new diamond geometry.
        /// </summary>
        /// <param name="resourceCreator"> The resource-creator. </param>
        /// <param name="transformer"> The source transformer. </param>
        /// <param name="mid"> The mid value. </param>
        /// <returns> The product geometry. </returns>
        public static CanvasGeometry CreateDiamond(ICanvasResourceCreator resourceCreator, ITransformerLTRB transformer, Matrix3x2 matrix, float mid)
        {
            return(TransformerGeometry.CreateDiamondCore(resourceCreator,
                                                         Vector2.Transform(transformer.LeftTop, matrix),
                                                         Vector2.Transform(transformer.RightTop, matrix),
                                                         Vector2.Transform(transformer.RightBottom, matrix),
                                                         Vector2.Transform(transformer.LeftBottom, matrix),

                                                         Vector2.Transform(transformer.CenterLeft, matrix),
                                                         Vector2.Transform(transformer.CenterRight, matrix),

                                                         mid
                                                         ));
        }
        /// <summary>
        /// Create a new diamond geometry.
        /// </summary>
        /// <param name="resourceCreator"> The resource-creator. </param>
        /// <param name="mid"> The mid value. </param>
        /// <returns> The product geometry. </returns>
        public static CanvasGeometry CreateDiamond(ICanvasResourceCreator resourceCreator, ITransformerLTRB transformer, float mid)
        {
            return(TransformerGeometry.CreateDiamondCore(resourceCreator,
                                                         transformer.LeftTop,
                                                         transformer.RightTop,
                                                         transformer.RightBottom,
                                                         transformer.LeftBottom,

                                                         transformer.CenterLeft,
                                                         transformer.CenterRight,

                                                         mid
                                                         ));
        }
Beispiel #10
0
        /// <summary>
        /// Create a new pie geometry.
        /// </summary>
        /// <param name="resourceCreator"> The resource-creator. </param>
        /// <param name="sweepAngle"> The sweep-angle. </param>
        /// <returns> The product geometry. </returns>
        public static CanvasGeometry CreatePie(ICanvasResourceCreator resourceCreator, ITransformerLTRB transformer, float sweepAngle)
        {
            bool zeroSweepAngle = sweepAngle == 0;

            if (zeroSweepAngle)
            {
                return(TransformerGeometry.CreateEllipse(resourceCreator, transformer));
            }
            else
            {
                Matrix3x2 oneMatrix = Transformer.FindHomography(Transformer.One, transformer);

                return(TransformerGeometry.CreatePieCore(resourceCreator, oneMatrix, sweepAngle));
            }
        }
Beispiel #11
0
        /// <summary>
        /// Create a new dount geometry.
        /// </summary>
        /// <param name="resourceCreator"> The resource-creator. </param>
        /// <param name="transformer"> The source transformer. </param>
        /// <param name="matrix"> The matrix. </param>
        /// <param name="holeRadius"> The hole-radius. </param>
        /// <returns> The product geometry. </returns>
        public static CanvasGeometry CreateDount(ICanvasResourceCreator resourceCreator, ITransformerLTRB transformer, Matrix3x2 matrix, float holeRadius)
        {
            bool           zeroHoleRadius = holeRadius == 0;
            CanvasGeometry outter         = TransformerGeometry.CreateEllipse(resourceCreator, transformer, matrix);

            if (zeroHoleRadius)
            {
                return(outter);
            }
            else
            {
                Vector2 center = Vector2.Transform(transformer.Center, matrix);

                return(TransformerGeometry.CreateDountCore(outter, holeRadius, center));
            }
        }
        /// <summary>
        /// Create a new round rect geometry.
        /// </summary>
        /// <param name="resourceCreator"> The resource-creator. </param>
        /// <param name="transformer"> The source transformer. </param>
        /// <param name="matrix"> The matrix. </param>
        /// <param name="corner"> The corner. </param>
        /// <returns> The product geometry. </returns>
        public static CanvasGeometry CreateRoundRect(ICanvasResourceCreator resourceCreator, ITransformerLTRB transformer, Matrix3x2 matrix, float corner)
        {
            return(TransformerGeometry.CreateRoundRectCore
                   (
                       resourceCreator,

                       Vector2.Transform(transformer.LeftTop, matrix),
                       Vector2.Transform(transformer.RightTop, matrix),
                       Vector2.Transform(transformer.RightBottom, matrix),
                       Vector2.Transform(transformer.LeftBottom, matrix),

                       Vector2.Transform(transformer.CenterLeft, matrix),
                       Vector2.Transform(transformer.CenterTop, matrix),
                       Vector2.Transform(transformer.CenterRight, matrix),
                       Vector2.Transform(transformer.CenterBottom, matrix),

                       corner
                   ));
        }
        /// <summary>
        /// Create a new round rect geometry.
        /// </summary>
        /// <param name="resourceCreator"> The resource-creator. </param>
        /// <param name="transformer"> The source transformer. </param>
        /// <param name="corner"> The corner. </param>
        /// <returns> The product geometry. </returns>
        public static CanvasGeometry CreateRoundRect(ICanvasResourceCreator resourceCreator, ITransformerLTRB transformer, float corner)
        {
            return(TransformerGeometry.CreateRoundRectCore
                   (
                       resourceCreator,

                       transformer.LeftTop,
                       transformer.RightTop,
                       transformer.RightBottom,
                       transformer.LeftBottom,

                       transformer.CenterLeft,
                       transformer.CenterTop,
                       transformer.CenterRight,
                       transformer.CenterBottom,

                       corner
                   ));
        }
Beispiel #14
0
        /// <summary>
        /// Create a new arrow geometry.
        /// </summary>
        /// <param name="resourceCreator"> The resource - creator. </param>
        /// <param name="transformer"> The source transformer. </param>
        /// <param name="matrix"> The matrix. </param>
        /// <param name="isAbsolute"> Is absolute? </param>
        /// <param name="width"> The absolute width. </param>
        /// <param name="value"> The relative value. </param>
        /// <param name="leftTail"> The left - tail. </param>
        /// <param name="rightTail"> The right - tail. </param>
        /// <returns> The product geometry. </returns>
        public static CanvasGeometry CreateArrow(ICanvasResourceCreator resourceCreator, ITransformerLTRB transformer, Matrix3x2 matrix, bool isAbsolute = false, float width = 10, float value = 0.5f, GeometryArrowTailType leftTail = GeometryArrowTailType.None, GeometryArrowTailType rightTail = GeometryArrowTailType.Arrow)
        {
            Vector2 center      = Vector2.Transform(transformer.Center, matrix);
            Vector2 centerLeft  = Vector2.Transform(transformer.CenterLeft, matrix);
            Vector2 centerRight = Vector2.Transform(transformer.CenterRight, matrix);

            // horizontal
            Vector2 horizontal       = transformer.Horizontal;
            float   horizontalLength = horizontal.Length();
            // vertical
            Vector2 vertical       = transformer.Vertical;
            float   verticalLength = vertical.Length();

            Vector2 widthVector = TransformerGeometry.GetArrowWidthVector(isAbsolute, width, value, vertical, verticalLength);

            Vector2 focusVector         = TransformerGeometry.GetArrowFocusVector(verticalLength, horizontalLength, horizontal);
            Vector2 leftFocusTransform  = Vector2.Transform(transformer.CenterLeft + focusVector, matrix);
            Vector2 rightFocusTransform = Vector2.Transform(transformer.CenterRight - focusVector, matrix);

            return(TransformerGeometry.CreateArrowCore
                   (
                       resourceCreator,
                       Vector2.Transform(widthVector + transformer.Center, matrix) - center,

                       // Left
                       centerLeft,
                       Vector2.Transform(transformer.LeftBottom, matrix),

                       Vector2.Transform(transformer.LeftTop, matrix),
                       (leftFocusTransform - centerLeft),
                       leftFocusTransform,

                       // Right
                       centerRight,
                       Vector2.Transform(transformer.RightBottom, matrix),

                       Vector2.Transform(transformer.RightTop, matrix),
                       (rightFocusTransform - centerRight),
                       rightFocusTransform,

                       leftTail, rightTail
                   ));
        }
Beispiel #15
0
        private static CanvasGeometry CreateHeartCore(ICanvasResourceCreator resourceCreator, float spread, Matrix3x2 oneMatrix)
        {
            Vector2 bottom = new Vector2(0, 1);

            Vector2 leftBottom  = new Vector2(-0.84f, 0.178f);
            Vector2 leftBottom2 = leftBottom + new Vector2(-0.2f, -0.2f);

            Vector2 leftTop  = new Vector2(-0.84f, -0.6f);
            Vector2 leftTop1 = leftTop + new Vector2(-0.2f, 0.2f);
            Vector2 leftTop2 = leftTop + new Vector2(0.2f, -0.2f);

            Vector2 top1      = new Vector2(-0.2f, -0.8f);
            Vector2 topSpread = TransformerGeometry.HeartTopSpread(spread);
            Vector2 top2      = new Vector2(0.2f, -0.8f);

            Vector2 rightTop  = new Vector2(0.84f, -0.6f);
            Vector2 rightTop1 = rightTop + new Vector2(-0.2f, -0.2f);
            Vector2 rightTop2 = rightTop + new Vector2(0.2f, 0.2f);

            Vector2 rightBottom  = new Vector2(0.84f, 0.178f);
            Vector2 rightBottom1 = rightBottom + new Vector2(0.2f, -0.2f);


            // Path
            CanvasPathBuilder pathBuilder = new CanvasPathBuilder(resourceCreator);

            {
                pathBuilder.BeginFigure(bottom);
                pathBuilder.AddLine(leftBottom);

                pathBuilder.AddCubicBezier(leftBottom2, leftTop1, leftTop);

                pathBuilder.AddCubicBezier(leftTop2, top1, topSpread);
                pathBuilder.AddCubicBezier(top2, rightTop1, rightTop);

                pathBuilder.AddCubicBezier(rightTop2, rightBottom1, rightBottom);
                pathBuilder.EndFigure(CanvasFigureLoop.Closed);
            }

            // Geometry
            return(CanvasGeometry.CreatePath(pathBuilder).Transform(oneMatrix));
        }
Beispiel #16
0
        /// <summary>
        /// Create a new capsule geometry.
        /// </summary>
        /// <param name="resourceCreator"> The resource - creator. </param>
        /// <param name="transformerLTRB"> The ITransformer - LTRB. </param>
        /// <param name="matrix"> The matrix. </param>
        /// <returns> The product geometry. </returns>
        public static CanvasGeometry CreateCapsule(ICanvasResourceCreator resourceCreator, ITransformerLTRB transformer, Matrix3x2 matrix)
        {
            Vector2 leftTop     = Vector2.Transform(transformer.LeftTop, matrix);
            Vector2 rightTop    = Vector2.Transform(transformer.RightTop, matrix);
            Vector2 rightBottom = Vector2.Transform(transformer.RightBottom, matrix);
            Vector2 leftBottom  = Vector2.Transform(transformer.LeftBottom, matrix);

            Vector2 centerLeft   = Vector2.Transform(transformer.CenterLeft, matrix);
            Vector2 centerTop    = Vector2.Transform(transformer.CenterTop, matrix);
            Vector2 centerRight  = Vector2.Transform(transformer.CenterRight, matrix);
            Vector2 centerBottom = Vector2.Transform(transformer.CenterBottom, matrix);

            // Horizontal
            Vector2 horizontal       = (centerRight - centerLeft);
            float   horizontalLength = horizontal.Length();
            Vector2 horizontalUnit   = horizontal / horizontalLength;
            // Vertical
            Vector2 vertical       = (centerBottom - centerTop);
            float   verticalLength = vertical.Length();

            if (horizontalLength < verticalLength)
            {
                return(TransformerGeometry.CreateEllipse(resourceCreator, transformer, matrix));
            }

            return(TransformerGeometry.CreateCapsuleCore(resourceCreator,
                                                         verticalLength,
                                                         horizontalUnit,

                                                         centerTop,
                                                         centerLeft,
                                                         centerRight,
                                                         centerBottom,

                                                         leftTop,
                                                         rightTop,
                                                         rightBottom,
                                                         leftBottom));
        }
Beispiel #17
0
 /// <summary>
 /// Turn to geometry.
 /// </summary>
 /// <param name="resourceCreator"> The resource-creator. </param>
 /// <returns> The product geometry. </returns>
 public CanvasGeometry ToRectangle(ICanvasResourceCreator resourceCreator) => TransformerGeometry.CreateRectangle(resourceCreator, this);
 /// <summary>
 /// Create a new triangle geometry.
 /// </summary>
 /// <param name="resourceCreator"> The resource-creator. </param>
 /// <param name="transformerLTRB"> The ITransformer-LTRB. </param>
 /// <returns> The product geometry. </returns>
 public static CanvasGeometry CreateTriangle(ICanvasResourceCreator resourceCreator, ITransformerLTRB transformerLTRB, float center) => TransformerGeometry.CreateTriangleCore(resourceCreator, transformerLTRB.LeftTop, transformerLTRB.RightTop, transformerLTRB.RightBottom, transformerLTRB.LeftBottom, center);
        /// <summary>
        /// Create a new pentagon geometry.
        /// </summary>
        /// <param name="resourceCreator"> The resource-creator. </param>
        /// <param name="transformer"> The source transformer. </param>
        /// <param name="points"> The points count. </param>
        /// <returns> The product geometry. </returns>
        public static CanvasGeometry CreatePentagon(ICanvasResourceCreator resourceCreator, ITransformerLTRB transformer, int points)
        {
            Matrix3x2 oneMatrix = Transformer.FindHomography(Transformer.One, transformer);

            return(TransformerGeometry.CreatePentagonCore(resourceCreator, points, oneMatrix));
        }
 /// <summary>
 /// Create a new triangle geometry.
 /// </summary>
 /// <param name="resourceCreator"> The resource-creator. </param>
 /// <param name="transformerLTRB"> The ITransformer-LTRB. </param>
 /// <param name="matrix"> The matrix. </param>
 /// <returns> The product geometry. </returns>
 public static CanvasGeometry CreateTriangle(ICanvasResourceCreator resourceCreator, ITransformerLTRB transformerLTRB, Matrix3x2 matrix, float center) => TransformerGeometry.CreateTriangleCore(resourceCreator, Vector2.Transform(transformerLTRB.LeftTop, matrix), Vector2.Transform(transformerLTRB.RightTop, matrix), Vector2.Transform(transformerLTRB.RightBottom, matrix), Vector2.Transform(transformerLTRB.LeftBottom, matrix), center);
 /// <summary>
 /// Create a new ellipse geometry.
 /// </summary>
 /// <param name="resourceCreator"> The resource-creator. </param>
 /// <param name="transformerLTRB"> The ITransformer-LTRB. </param>
 /// <returns> The product geometry. </returns>
 public static CanvasGeometry CreateEllipse(ICanvasResourceCreator resourceCreator, ITransformerLTRB transformerLTRB) => TransformerGeometry.CreateEllipseCore(resourceCreator, transformerLTRB.CenterLeft, transformerLTRB.CenterTop, transformerLTRB.CenterRight, transformerLTRB.CenterBottom);
 /// <summary>
 /// Create a new rectangle geometry.
 /// </summary>
 /// <param name="resourceCreator"> The resource-creator. </param>
 /// <param name="leftTop"> The left-top point. </param>
 /// <param name="rightTop"> The right-top point. </param>
 /// <param name="rightBottom"> The right-bottom point. </param>
 /// <param name="leftBottom"> The left-bottom point. </param>
 /// <param name="matrix"> The matrix. </param>
 /// <returns> The product geometry. </returns>
 public static CanvasGeometry CreateRectangle(ICanvasResourceCreator resourceCreator, Vector2 leftTop, Vector2 rightTop, Vector2 rightBottom, Vector2 leftBottom, Matrix3x2 matrix) => TransformerGeometry.CreateRectangleCore(resourceCreator, Vector2.Transform(leftTop, matrix), Vector2.Transform(rightTop, matrix), Vector2.Transform(rightBottom, matrix), Vector2.Transform(leftBottom, matrix));
 /// <summary>
 /// Create a new rectangle geometry.
 /// </summary>
 /// <param name="resourceCreator"> The resource-creator. </param>
 /// <param name="leftTop"> The left-top point. </param>
 /// <param name="rightTop"> The right-top point. </param>
 /// <param name="rightBottom"> The right-bottom point. </param>
 /// <param name="leftBottom"> The left-bottom point. </param>
 /// <returns> The product geometry. </returns>
 public static CanvasGeometry CreateRectangle(ICanvasResourceCreator resourceCreator, Vector2 leftTop, Vector2 rightTop, Vector2 rightBottom, Vector2 leftBottom) => TransformerGeometry.CreateRectangleCore(resourceCreator, leftTop, rightTop, rightBottom, leftBottom);
 /// <summary>
 /// Create a new rectangle geometry.
 /// </summary>
 /// <param name="resourceCreator"> The resource-creator. </param>
 /// <param name="transformerLTRB"> The ITransformer-LTRB. </param>
 /// <param name="matrix"> The matrix. </param>
 /// <returns> The product geometry. </returns>
 public static CanvasGeometry CreateRectangle(ICanvasResourceCreator resourceCreator, ITransformerLTRB transformerLTRB, Matrix3x2 matrix) => TransformerGeometry.CreateRectangle(resourceCreator, transformerLTRB.LeftTop, transformerLTRB.RightTop, transformerLTRB.RightBottom, transformerLTRB.LeftBottom, matrix);
 /// <summary>
 /// Create a new ellipse geometry.
 /// </summary>
 /// <param name="resourceCreator"> The resource-creator. </param>
 /// <param name="centerLeft"> The left point. </param>
 /// <param name="centerTop"> The top point. </param>
 /// <param name="centerRight"> The right point. </param>
 /// <param name="centerBottom"> The bottom point. </param>
 /// <param name="matrix"> The matrix. </param>
 /// <returns> The product geometry. </returns>
 public static CanvasGeometry CreateEllipse(ICanvasResourceCreator resourceCreator, Vector2 centerLeft, Vector2 centerTop, Vector2 centerRight, Vector2 centerBottom, Matrix3x2 matrix) => TransformerGeometry.CreateEllipseCore(resourceCreator, Vector2.Transform(centerLeft, matrix), Vector2.Transform(centerTop, matrix), Vector2.Transform(centerRight, matrix), Vector2.Transform(centerBottom, matrix));
 /// <summary>
 /// Create a new ellipse geometry.
 /// </summary>
 /// <param name="resourceCreator"> The resource-creator. </param>
 /// <param name="centerLeft"> The left point. </param>
 /// <param name="centerTop"> The top point. </param>
 /// <param name="centerRight"> The right point. </param>
 /// <param name="centerBottom"> The bottom point. </param>
 /// <returns> The product geometry. </returns>
 public static CanvasGeometry CreateEllipse(ICanvasResourceCreator resourceCreator, Vector2 centerLeft, Vector2 centerTop, Vector2 centerRight, Vector2 centerBottom) => TransformerGeometry.CreateEllipseCore(resourceCreator, centerLeft, centerTop, centerRight, centerBottom);
Beispiel #27
0
 /// <summary>
 /// Turn to geometry.
 /// </summary>
 /// <param name="resourceCreator"> The resource-creator. </param>
 /// <param name="matrix"> The matrix. </param>
 /// <returns></returns>
 public CanvasGeometry ToEllipse(ICanvasResourceCreator resourceCreator, Matrix3x2 matrix) => TransformerGeometry.CreateEllipse(resourceCreator, this, matrix);
Beispiel #28
0
 /// <summary>
 /// Turn to geometry.
 /// </summary>
 /// <param name="resourceCreator"> The resource-creator. </param>
 /// <returns></returns>
 public CanvasGeometry ToEllipse(ICanvasResourceCreator resourceCreator) => TransformerGeometry.CreateEllipse(resourceCreator, this);
Beispiel #29
0
 /// <summary>
 /// Turn to geometry.
 /// </summary>
 /// <param name="resourceCreator"> The resource-creator. </param>
 /// <param name="matrix"> The matrix. </param>
 /// <returns> The product geometry. </returns>
 public CanvasGeometry ToRectangle(ICanvasResourceCreator resourceCreator, Matrix3x2 matrix) => TransformerGeometry.CreateRectangle(resourceCreator, this, matrix);
 /// <summary>
 /// Create a new triangle geometry.
 /// </summary>
 /// <param name="resourceCreator"> The resource-creator. </param>
 /// <param name="leftTop"> The left-top point. </param>
 /// <param name="rightTop"> The right-top point. </param>
 /// <param name="rightBottom"> The right-bottom point. </param>
 /// <param name="leftBottom"> The left-bottom point. </param>
 /// <returns> The product geometry. </returns>
 public static CanvasGeometry CreateTriangle(ICanvasResourceCreator resourceCreator, Vector2 leftTop, Vector2 rightTop, Vector2 rightBottom, Vector2 leftBottom, float center) => TransformerGeometry.CreateTriangleCore(resourceCreator, leftTop, rightTop, rightBottom, leftBottom, center);