Esempio n. 1
0
        //UPGRADE_NOTE: ref keyword was added to struct-type parameters. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1303_3"'
        public override void getBounds(System.Drawing.Drawing2D.Matrix transform, ref System.Drawing.Rectangle r, ref System.Drawing.PointF position)
        {
            System.Drawing.Rectangle a = new System.Drawing.Rectangle();
            double x, y;

            x = (double)position.X - System.Math.Cos(SupportClass.DegreesToRadians(startAngle)) * xRadius;
            y = (double)position.Y - System.Math.Sin(SupportClass.DegreesToRadians(startAngle)) * yRadius;

            //UPGRADE_WARNING: Data types in Visual C# might be different.  Verify the accuracy of narrowing conversions. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1042_3"'
            a.X = (int)(x - xRadius);
            //UPGRADE_WARNING: Data types in Visual C# might be different.  Verify the accuracy of narrowing conversions. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1042_3"'
            a.Y = (int)(y - yRadius);
            //UPGRADE_WARNING: Data types in Visual C# might be different.  Verify the accuracy of narrowing conversions. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1042_3"'
            a.Width = (int)System.Math.Ceiling(x + xRadius) - a.X;
            //UPGRADE_WARNING: Data types in Visual C# might be different.  Verify the accuracy of narrowing conversions. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1042_3"'
            a.Height = (int)System.Math.Ceiling(y + yRadius) - a.Y;

            System.Drawing.Drawing2D.Matrix temp_Matrix;
            temp_Matrix = new System.Drawing.Drawing2D.Matrix();
            temp_Matrix.Rotate((float)(rotation * (180 / System.Math.PI)));
            //UPGRADE_NOTE: ref keyword was added to struct-type parameters. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1303_3"'
            a = Util.transform(Util.multiply(transform, temp_Matrix), ref a);

            //UPGRADE_NOTE: ref keyword was added to struct-type parameters. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1303_3"'
            Util.combine(ref r, ref a);

            //UPGRADE_NOTE: ref keyword was added to struct-type parameters. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1303_3"'
            System.Drawing.PointF endPoint = calcPoint(1.0, ref position);

            position.X = (float)endPoint.X;
            position.Y = (float)endPoint.Y;
        }
Esempio n. 2
0
 /// <summary> Rotates the current transformation around the given
 /// pivot point by the given angle.
 ///
 /// </summary>
 /// <param name="angle">rotation in degrees.
 /// </param>
 /// <param name="pivotX">x coordinate of the pivot point.
 /// </param>
 /// <param name="pivotY">y coordinate of the pivot point.
 /// </param>
 public virtual void Rotate(double angle, double pivotX, double pivotY)
 {
     System.Drawing.Drawing2D.Matrix temp_Matrix;
     temp_Matrix = new System.Drawing.Drawing2D.Matrix();
     temp_Matrix.RotateAt((float)(SupportClass.DegreesToRadians(angle) * (180 / System.Math.PI)), new System.Drawing.PointF((float)pivotX, (float)pivotY));
     transform(temp_Matrix);
 }
Esempio n. 3
0
        //UPGRADE_NOTE: ref keyword was added to struct-type parameters. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1303_3"'
        public override System.Drawing.PointF calcPoint(double t, ref System.Drawing.PointF position)
        {
            System.Drawing.PointF p = new System.Drawing.PointF();
            double angle = SupportClass.DegreesToRadians(startAngle + (stopAngle - startAngle) * t);
            double x, y;
            double sinr = System.Math.Sin(SupportClass.DegreesToRadians(rotation));
            double cosr = System.Math.Cos(SupportClass.DegreesToRadians(rotation));

            x = (System.Math.Cos(angle) - System.Math.Cos(SupportClass.DegreesToRadians(startAngle))) * xRadius;
            y = (System.Math.Sin(angle) - System.Math.Sin(SupportClass.DegreesToRadians(startAngle))) * yRadius;

            p.X = (float)((double)position.X + cosr * x - sinr * y);
            p.Y = (float)((double)position.Y + sinr * x + cosr * y);

            return(p);
        }
Esempio n. 4
0
        /// <summary> Calculates the point along the Arc, when the center of the ellipse
        /// is thought to be at (0, 0).
        ///
        /// </summary>
        /// <param name="t">the place along the Arc (must be inside the rangle [0, 1]).
        /// </param>
        /// <returns> the point.
        /// </returns>
        public virtual System.Drawing.PointF calcRelativePoint(double t)
        {
            System.Drawing.PointF p = new System.Drawing.PointF();
            double angle = SupportClass.DegreesToRadians(startAngle + (stopAngle - startAngle) * t);
            double x, y;
            double sinr = System.Math.Sin(SupportClass.DegreesToRadians(rotation));
            double cosr = System.Math.Cos(SupportClass.DegreesToRadians(rotation));

            x = System.Math.Cos(angle) * xRadius;
            y = System.Math.Sin(angle) * yRadius;

            p.X = (float)(cosr * x - sinr * y);
            p.Y = (float)(sinr * x + cosr * y);

            return(p);
        }