Пример #1
0
 /// <overloads>
 /// Multiplies this <see cref="SvgTransformF"/> by the specified
 /// <see cref="SvgTransformF"/> by appending or prepending the specified
 /// <see cref="SvgTransformF"/>.
 /// </overloads>
 /// <summary>
 /// Multiplies this <see cref="SvgTransformF"/> by the specified
 /// <see cref="SvgTransformF"/> by prepending the specified
 /// <see cref="SvgTransformF"/>.
 /// </summary>
 /// <param name="matrix">
 /// The <see cref="SvgTransformF"/> by which this <see cref="SvgTransformF"/>
 /// is to be multiplied.
 /// </param>
 public void Multiply(SvgTransformF matrix)
 {
     if (matrix == null)
     {
         throw new ArgumentNullException("matrix");
     }
     Multiply((SvgTransformF)matrix, this);
 }
Пример #2
0
        /// <summary>
        /// Determine whether the specified object is a <see cref="SvgTransformF"/>
        /// and is identical to this <see cref="SvgTransformF"/>.
        /// </summary>
        /// <param name="obj">The object to test.</param>
        /// <returns>
        /// This method returns <see langword="true"/> if obj is the specified
        /// <see cref="SvgTransformF"/> identical to this
        /// <see cref="SvgTransformF"/>; otherwise, <see langword="false"/>.
        /// </returns>
        public override bool Equals(Object obj)
        {
            SvgTransformF other = (obj as SvgTransformF);

            if (other != null)
            {
                return(other.m11 == m11 && other.m12 == m12 &&
                       other.m21 == m21 && other.m22 == m22 &&
                       other.dx == dx && other.dy == dy);
            }

            return(false);
        }
Пример #3
0
        /// <summary>
        /// Determine whether the specified object is a <see cref="SvgTransformF"/>
        /// and is identical to this <see cref="SvgTransformF"/>.
        /// </summary>
        /// <param name="obj">The object to test.</param>
        /// <returns>
        /// This method returns <see langword="true"/> if obj is the specified
        /// <see cref="SvgTransformF"/> identical to this
        /// <see cref="SvgTransformF"/>; otherwise, <see langword="false"/>.
        /// </returns>
        public override bool Equals(object obj)
        {
            SvgTransformF other = (obj as SvgTransformF);

            if (other != null)
            {
                return(other.m11.Equals(m11) && other.m12.Equals(m12) &&
                       other.m21.Equals(m21) && other.m22.Equals(m22) &&
                       other.dx.Equals(dx) && other.dy.Equals(dy));
            }

            return(false);
        }
Пример #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SvgTransformF"/> class
        /// with parameters copied from the specified parameter, a copy
        /// constructor.
        /// </summary>
        /// <param name="source">
        /// The <see cref="SvgTransformF"/> instance from which the parameters
        /// are to be copied.
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// If the <paramref name="source"/> is <see langword="null"/>.
        /// </exception>
        public SvgTransformF(SvgTransformF source)
        {
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }

            this.m11 = source.m11;
            this.m12 = source.m12;
            this.m21 = source.m21;
            this.m22 = source.m22;
            this.dx  = source.dx;
            this.dy  = source.dy;
        }
Пример #5
0
 /// <summary>
 /// Multiplies this <see cref="SvgTransformF"/> by the matrix specified in
 /// the matrix parameter, and in the order specified in the order parameter.
 /// </summary>
 /// <param name="matrix">
 /// The <see cref="SvgTransformF"/> by which this <see cref="SvgTransformF"/>
 /// is to be multiplied.
 /// </param>
 /// <param name="order">
 /// The <see cref="TransformOrder"/> that represents the order of the
 /// multiplication.
 /// </param>
 public void Multiply(SvgTransformF matrix, SvgTransformOrder order)
 {
     if (matrix == null)
     {
         throw new ArgumentNullException("matrix");
     }
     if (order == SvgTransformOrder.Prepend)
     {
         Multiply((SvgTransformF)matrix, this);
     }
     else
     {
         Multiply(this, (SvgTransformF)matrix);
     }
 }
Пример #6
0
        private void Multiply(SvgTransformF a, SvgTransformF b)
        {
            float nm11 = a.m11 * b.m11 + a.m12 * b.m21;
            float nm12 = a.m11 * b.m12 + a.m12 * b.m22;
            float nm21 = a.m21 * b.m11 + a.m22 * b.m21;
            float nm22 = a.m21 * b.m12 + a.m22 * b.m22;
            float ndx  = a.dx * b.m11 + a.dy * b.m21 + b.dx;
            float ndy  = a.dx * b.m12 + a.dy * b.m22 + b.dy;

            this.m11 = nm11;
            this.m12 = nm12;
            this.m21 = nm21;
            this.m22 = nm22;
            this.dx  = ndx;
            this.dy  = ndy;
        }
Пример #7
0
        private void Multiply(SvgTransformF a, SvgTransformF b)
        {
            float nm11 = a.m11 * b.m11 + a.m12 * b.m21;
            float nm12 = a.m11 * b.m12 + a.m12 * b.m22;
            float nm21 = a.m21 * b.m11 + a.m22 * b.m21;
            float nm22 = a.m21 * b.m12 + a.m22 * b.m22;
            float ndx  = a.dx  * b.m11 + a.dy  * b.m21 + b.dx;
            float ndy  = a.dx  * b.m12 + a.dy  * b.m22 + b.dy;

            this.m11 = nm11;
            this.m12 = nm12;
            this.m21 = nm21;
            this.m22 = nm22;
            this.dx  = ndx;
            this.dy  = ndy;
        }
Пример #8
0
 /// <summary>
 /// Multiplies this <see cref="SvgTransformF"/> by the matrix specified in 
 /// the matrix parameter, and in the order specified in the order parameter.
 /// </summary>
 /// <param name="matrix">
 /// The <see cref="SvgTransformF"/> by which this <see cref="SvgTransformF"/> 
 /// is to be multiplied.
 /// </param>
 /// <param name="order">
 /// The <see cref="TransformOrder"/> that represents the order of the 
 /// multiplication.
 /// </param>
 public void Multiply(SvgTransformF matrix, SvgTransformOrder order)
 {
     if (matrix == null)
     {
         throw new ArgumentNullException("matrix");
     }
     if (order == SvgTransformOrder.Prepend)
     {
         Multiply((SvgTransformF)matrix, this);
     }
     else
     {
         Multiply(this, (SvgTransformF)matrix);
     }
 }
Пример #9
0
 /// <overloads>
 /// Multiplies this <see cref="SvgTransformF"/> by the specified 
 /// <see cref="SvgTransformF"/> by appending or prepending the specified 
 /// <see cref="SvgTransformF"/>.
 /// </overloads>
 /// <summary>
 /// Multiplies this <see cref="SvgTransformF"/> by the specified 
 /// <see cref="SvgTransformF"/> by prepending the specified 
 /// <see cref="SvgTransformF"/>.
 /// </summary>
 /// <param name="matrix">
 /// The <see cref="SvgTransformF"/> by which this <see cref="SvgTransformF"/> 
 /// is to be multiplied.
 /// </param>
 public void Multiply(SvgTransformF matrix)
 {
     if (matrix == null)
     {
         throw new ArgumentNullException("matrix");
     }
     Multiply((SvgTransformF)matrix, this);
 }
Пример #10
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SvgTransformF"/> class
        /// with parameters copied from the specified parameter, a copy 
        /// constructor.
        /// </summary>
        /// <param name="source">
        /// The <see cref="SvgTransformF"/> instance from which the parameters
        /// are to be copied.
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// If the <paramref name="source"/> is <see langword="null"/>.
        /// </exception>
        public SvgTransformF(SvgTransformF source)
        {
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }

            this.m11 = source.m11;
            this.m12 = source.m12;
            this.m21 = source.m21;
            this.m22 = source.m22;
            this.dx  = source.dx;
            this.dy  = source.dy;
        }