Beispiel #1
0
 /// <summary>
 /// Restore the state of this drawer
 /// </summary>
 public void Load(object state)
 {
     if (state is DrawerState)
     {
         DrawerState ds = (DrawerState)state;
         currentTransform  = ds.CurrentTransform;
         matrixStack       = ds.MatrixStack;
         transformRequired = currentTransform != null;
     }
     else
     {
         IncompatibleTypeException.Publish(state, typeof(DrawerState));
     }
 }
Beispiel #2
0
        /// <summary>
        /// Create a new transformation matrix and make it active
        /// </summary>
        public void PushMatrix()
        {
            if (currentTransform == null)
            {
                currentTransform = new Matrix3x3();
            }
            else
            {
                //store current transform to stack
                if (matrixStack == null)
                {
                    matrixStack = new Matrix3x3Stack();
                }
                matrixStack.Push(currentTransform);

                //create a new matrix
                currentTransform = currentTransform.Clone();
            }

            transformRequired = true;
        }
 private Matrix3x3Stack(Matrix3x3Stack source)
     : base(source)
 {
 }