示例#1
0
 /// <summary>
 /// Applies the inverse of the geometric transform represented by this
 /// <see cref="PMatrix"/> object to the given point.
 /// </summary>
 /// <param name="point">The point to transform.</param>
 /// <returns>The transformed point.</returns>
 public virtual PointF InverseTransform(PointF point)
 {
     if (IsInvertible)
     {
         TEMP_MATRIX.Reset();
         TEMP_MATRIX.Multiply(this);
         TEMP_MATRIX.Invert();
         point = TEMP_MATRIX.Transform(point);
     }
     return(point);
 }
示例#2
0
        /// <summary>
        /// Creates an exact copy of this <see cref="PMatrix"/> object.
        /// </summary>
        /// <returns>The <see cref="PMatrix"/> object that his method creates.</returns>
        public virtual Object Clone()
        {
            PMatrix r = new PMatrix();

            r.Multiply(this);
            return(r);
        }
示例#3
0
        /// <summary>
        /// Returns the product of the matrices from the top-most ancestor node (the last node
        /// in the list) to the given node.
        /// </summary>
        /// <param name="nodeOnPath">
        /// The bottom-most node in the path for which the matrix product will be computed.
        /// </param>
        /// <returns>
        /// The product of the matrices from the top-most node to the given node.
        /// </returns>
        public virtual PMatrix GetPathTransformTo(PNode nodeOnPath)
        {
            PMatrix aMatrix = new PMatrix();

            object[] matrices = matrixStack.ToArray();
            int      count    = matrices.Length;

            for (int i = count - 1; i >= 0; i--)
            {
                PTuple each = (PTuple)matrices[i];
                if (each.matrix != null)
                {
                    aMatrix.Multiply(each.matrix);
                }
                if (nodeOnPath == each.node)
                {
                    return(aMatrix);
                }
            }

            return(aMatrix);
        }
示例#4
0
		/// <summary>
		/// Returns the product of the matrices from the top-most ancestor node (the last node
		/// in the list) to the given node.
		/// </summary>
		/// <param name="nodeOnPath">
		/// The bottom-most node in the path for which the matrix product will be computed.
		/// </param>
		/// <returns>
		/// The product of the matrices from the top-most node to the given node.
		/// </returns>
		public virtual PMatrix GetPathTransformTo(PNode nodeOnPath) {
			PMatrix aMatrix = new PMatrix();

			object[] matrices = matrixStack.ToArray();
			int count = matrices.Length;
			for (int i = count - 1; i >= 0; i--) {
				PTuple each = (PTuple) matrices[i];
				if (each.matrix != null) aMatrix.Multiply(each.matrix);
				if (nodeOnPath == each.node) {
					return aMatrix;
				}
			}
		
			return aMatrix;
		}
示例#5
0
		/// <summary>
		/// Creates an exact copy of this <see cref="PMatrix"/> object.
		/// </summary>
		/// <returns>The <see cref="PMatrix"/> object that his method creates.</returns>
		public virtual Object Clone() {
			PMatrix r = new PMatrix();
			r.Multiply(this);
			return r;
		}