示例#1
0
        ////////////////////////////////////////////////////////////////////////////
        //--------------------------------- REVISIONS ------------------------------
        // Date       Name                 Tracking #         Description
        // ---------  -------------------  -------------      ----------------------
        // 13JUN2009  James Shen                              Initial Creation
        ////////////////////////////////////////////////////////////////////////////

        /**
         * Set the graphics matrix.
         * @param Value the graphics matrix.
         */
        internal void SetGraphicsMatrix(MatrixFP value)
        {
            _graphicsMatrix = new MatrixFP(value);
            _graphicsMatrix.Invert();
            _finalMatrix = new MatrixFP(_graphicsMatrix);
            if (_matrix != null)
            {
                _finalMatrix.Multiply(_matrix);
            }
        }
示例#2
0
文件: MatrixX.cs 项目: nakijun/adasg
 public void Multiply(MatrixX m, MatrixOrderX order)
 {
     if (order == MatrixOrderX.Prepend)
     {
         MatrixFP m1 = new MatrixFP(m.matrix);
         m1.Multiply(matrix);
         matrix = m1;
     }
     else
     {
         matrix.Multiply(m.matrix);
     }
 }
示例#3
0
文件: MatrixX.cs 项目: nakijun/adasg
 public void Translate(float offsetX, float offsetY, MatrixOrderX order)
 {
     if (order == MatrixOrderX.Prepend)
     {
         MatrixFP m = MatrixFP.Identity();
         m.Translate(SingleFP.FromFloat(offsetX), SingleFP.FromFloat(offsetY));
         m.Multiply(matrix);
         matrix = m;
     }
     else
     {
         matrix.Translate(SingleFP.FromFloat(offsetX), SingleFP.FromFloat(offsetY));
     }
 }
示例#4
0
文件: MatrixX.cs 项目: nakijun/adasg
 public void Shear(float shearX, float shearY, MatrixOrderX order)
 {
     if (order == MatrixOrderX.Prepend)
     {
         MatrixFP m = MatrixFP.Identity();
         m.RotateSkew(SingleFP.FromFloat(shearX), SingleFP.FromFloat(shearY));
         m.Multiply(matrix);
         matrix = m;
     }
     else
     {
         matrix.RotateSkew(SingleFP.FromFloat(shearX), SingleFP.FromFloat(shearY));
     }
 }
示例#5
0
文件: MatrixX.cs 项目: nakijun/adasg
 public void Scale(float scaleX, float scaleY, MatrixOrderX order)
 {
     if (order == MatrixOrderX.Prepend)
     {
         MatrixFP m = MatrixFP.Identity();
         m.Scale(SingleFP.FromFloat(scaleX), SingleFP.FromFloat(scaleY));
         m.Multiply(matrix);
         matrix = m;
     }
     else
     {
         matrix.Scale(SingleFP.FromFloat(scaleX), SingleFP.FromFloat(scaleY));
     }
 }
示例#6
0
文件: MatrixX.cs 项目: nakijun/adasg
 public void Rotate(float angle, MatrixOrderX order)
 {
     if (order == MatrixOrderX.Prepend)
     {
         MatrixFP m = MatrixFP.Identity();
         m.Rotate(MathFP.ToRadians(SingleFP.FromFloat(angle)));
         m.Multiply(matrix);
         matrix = m;
     }
     else
     {
         matrix.Rotate(MathFP.ToRadians(SingleFP.FromFloat(angle)));
     }
 }
示例#7
0
        public void Transform(MatrixFP m1)
        {
            MatrixFP m = new MatrixFP(m1);

            m.Invert();
            if (matrix == null)
            {
                matrix = m;
            }
            else
            {
                matrix.Multiply(m);
            }
        }
示例#8
0
文件: MatrixX.cs 项目: nakijun/adasg
 public void RotateAt(float angle, PointF point, MatrixOrderX order)
 {
     if (order == MatrixOrderX.Prepend)
     {
         MatrixFP m = MatrixFP.Identity();
         m.Translate(SingleFP.FromFloat(-point.X), SingleFP.FromFloat(-point.Y));
         m.Rotate(MathFP.ToRadians(SingleFP.FromFloat(angle)));
         m.Multiply(matrix);
         m.Translate(SingleFP.FromFloat(point.X), SingleFP.FromFloat(point.Y));
         matrix = m;
     }
     else
     {
         matrix.Translate(SingleFP.FromFloat(-point.X), SingleFP.FromFloat(-point.Y));
         matrix.Rotate(MathFP.ToRadians(SingleFP.FromFloat(angle)));
         matrix.Translate(SingleFP.FromFloat(point.X), SingleFP.FromFloat(point.Y));
     }
 }
示例#9
0
 ////////////////////////////////////////////////////////////////////////////
 //--------------------------------- REVISIONS ------------------------------
 // Date       Name                 Tracking #         Description
 // ---------  -------------------  -------------      ----------------------
 // 13JUN2009  James Shen                 	          Initial Creation
 ////////////////////////////////////////////////////////////////////////////
 /**
  * Set the graphics matrix.
  * @param Value the graphics matrix.
  */
 internal void SetGraphicsMatrix(MatrixFP value)
 {
     _graphicsMatrix = new MatrixFP(value);
     _graphicsMatrix.Invert();
     _finalMatrix = new MatrixFP(_graphicsMatrix);
     if (_matrix != null)
     {
         _finalMatrix.Multiply(_matrix);
     }
 }