Example #1
0
        private bool ReadCanonicalForm(Transform transform, bool useIfChangeable)
        {
            bool flag = false;

            if (CanonicalTransform.IsCanonical(transform))
            {
                TransformGroup     transformGroup     = (TransformGroup)transform;
                ScaleTransform     scaleTransform     = transformGroup.Children[CanonicalTransformOrder.ScaleIndex] as ScaleTransform;
                SkewTransform      skewTransform      = transformGroup.Children[CanonicalTransformOrder.SkewIndex] as SkewTransform;
                RotateTransform    rotateTransform    = transformGroup.Children[CanonicalTransformOrder.RotateIndex] as RotateTransform;
                TranslateTransform translateTransform = transformGroup.Children[CanonicalTransformOrder.TranslateIndex] as TranslateTransform;
                this.decomposition.Center        = new Point(scaleTransform.CenterX, scaleTransform.CenterY);
                this.decomposition.Scale         = new Vector(scaleTransform.ScaleX, scaleTransform.ScaleY);
                this.decomposition.Skew          = new Vector(skewTransform.AngleX, skewTransform.AngleY);
                this.decomposition.RotationAngle = rotateTransform.Angle;
                this.decomposition.Translation   = new Vector(translateTransform.X, translateTransform.Y);
                if (useIfChangeable && !transformGroup.IsFrozen)
                {
                    this.transformGroup = transformGroup;
                }
                else
                {
                    this.InitializeTransformGroup();
                }
                flag = true;
            }
            return(flag);
        }
Example #2
0
 public CanonicalTransform(CanonicalTransform canonicalTransform)
 {
     if (canonicalTransform == (CanonicalTransform)null)
     {
         this.Initialize();
     }
     else
     {
         this.decomposition = (CanonicalDecomposition)canonicalTransform.decomposition.Clone();
         this.InitializeTransformGroup();
     }
 }
Example #3
0
 public static bool Compare(CanonicalTransform ct1, CanonicalTransform ct2)
 {
     return(ct1 == ct2);
 }
Example #4
0
 public static bool IsCanonical(Transform transform)
 {
     return(CanonicalTransform.IsCanonical(transform, false));
 }