示例#1
0
        /// <summary>
        /// Called in the constructor to create the default rotate animation.
        /// </summary>
        /// <returns>Returns a new instance of RadPerspectiveAnimation.</returns>
        protected virtual RadPlaneProjectionAnimation CreateRotateAnimation()
        {
            RadPlaneProjectionAnimation result = new RadPlaneProjectionAnimation();

            result.StartAngleY = 90;
            result.EndAngleY   = 360;

            return(result);
        }
示例#2
0
        public RadScaleMoveAndRotateAnimation()
        {
            this.scale  = this.CreateScaleAnimation();
            this.move   = this.CreateMoveAnimation();
            this.rotate = this.CreateRotateAnimation();

            this.Children.Add(this.scale);
            this.Children.Add(this.move);
            this.Children.Add(this.rotate);
        }
 private static void ReverseDirection(RadPlaneProjectionAnimation animation)
 {
     if (animation.Direction == PerspectiveAnimationDirection.Clockwise)
     {
         animation.Direction = PerspectiveAnimationDirection.CounterClockwise;
     }
     else
     {
         animation.Direction = PerspectiveAnimationDirection.Clockwise;
     }
 }
        private static void ReverseAngles(RadPlaneProjectionAnimation animation)
        {
            double tmp = animation.StartAngleX;

            animation.StartAngleX = animation.EndAngleX;
            animation.EndAngleX   = tmp;

            tmp = animation.StartAngleY;
            animation.StartAngleY = animation.EndAngleY;
            animation.EndAngleY   = tmp;

            tmp = animation.StartAngleZ;
            animation.StartAngleZ = animation.EndAngleZ;
            animation.EndAngleZ   = tmp;
        }
        /// <summary>
        /// Creates a new instance of this animation that is the reverse of this instance.
        /// </summary>
        /// <param name="mode">The mode.</param>
        /// <returns>
        /// A new instance of this animation that is the reverse of this instance.
        /// </returns>
        public RadAnimation CreateOpposite(ReverseMode mode)
        {
            RadPlaneProjectionAnimation reverse = base.CreateOpposite() as RadPlaneProjectionAnimation;

            if ((mode & ReverseMode.StartEndAngles) == ReverseMode.StartEndAngles)
            {
                ReverseAngles(reverse);
            }

            if ((mode & ReverseMode.RotationDirection) == ReverseMode.RotationDirection)
            {
                ReverseDirection(reverse);
            }

            return(reverse);
        }