Esempio n. 1
0
 /// <summary>
 /// Combines this affine transfor with the other.
 /// <remarks>
 /// The result of the combined transformation is equivalent to the result
 /// of successive application of transformations. Preferable to use this
 /// form of combination, not ConcatenatedTransform, because
 /// ConcatenatedTransform applies each transformation consistently, and
 /// CombineWith method calculates the resulting transformation matrix.
 /// </remarks>
 /// </summary>
 /// <param name="other">An affine transform to combine</param>
 public void CombineWith(Affine other)
 {
     _matrix = _matrix.Multiply(other._matrix);
     if (_inverseMatrix != null)
     {
         _inverseMatrix = _matrix.GetInverseMatrix();
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Creates the inverse transform of this object.
        /// </summary>
        /// <remarks>
        /// This method may fail if the transformation matrix
        /// is not invertible.
        /// </remarks>
        public override IMathTransform Inverse()
        {
            if (_inverseMatrix == null)
            {
                _inverseMatrix = _matrix.GetInverseMatrix();

                //values ​​may differ slightly from the exact,
                //in which case check the affinity will not be passed,
                //so set the value of the third column manually
                _inverseMatrix[0, 2] = 0;
                _inverseMatrix[1, 2] = 0;
                _inverseMatrix[2, 2] = 1;
            }

            _inverse = new Affine(_matrix, _inverseMatrix, !_isInverse);

            return(_inverse);
        }
Esempio n. 3
0
 /// <summary>
 /// Combines this affine transfor with the other.
 /// <remarks>
 /// The result of the combined transformation is equivalent to the result 
 /// of successive application of transformations. Preferable to use this 
 /// form of combination, not ConcatenatedTransform, because 
 /// ConcatenatedTransform applies each transformation consistently, and 
 /// CombineWith method calculates the resulting transformation matrix.
 /// </remarks>
 /// </summary>
 /// <param name="other">An affine transform to combine</param>
 public void CombineWith(Affine other)
 {
     _matrix = _matrix.Multiply(other._matrix);
     if (_inverseMatrix != null)
         _inverseMatrix = _matrix.GetInverseMatrix();
 }