示例#1
0
        /// <summary>
        /// 退出xx模式
        /// </summary>
        public override void exit(Boolean isCancled)
        {
            if (mode == FoldingMode.DoingNothing)
                return;

            mode = FoldingMode.DoingNothing;

            ExitFoldingUp();

            currSelectedElementVi.End();
            currSelectedElementVi = null;
            currOveredElementVi.End();
            currOveredElementVi = null;
            currSelectedElement = currOveredElement = null;
            canSelectedVertices.Clear();
            canSelectedFaces.Clear();
            IsOnMoveLocked = false;
            IsOnPressLocked = false;
            LockViewport(false);

            // 传给下层。。
            if (!isCancled)
                CloverController.GetInstance().FoldingUp.ExitFoldingMode();
            // 显示实像
            //RenderController.GetInstance().Entity.Content = RenderController.GetInstance().ModelGroup;
            // 销毁虚像……
            paperVoid.DestoryShadow(mainWindow.foldingPaperViewport,
                mainWindow.VoidPaperTopImgFront, mainWindow.VoidPaperBgImg, mainWindow.VoidPaperTopImgBack);
        }
示例#2
0
        /// <summary>
        /// 退出Blending
        /// </summary>
        void ExitBlending()
        {
            mode = FoldingMode.DoingNothing;
            currentModeVi.End();
            currentModeVi = null;
            blendAngleVi.End();
            blendAngleVi = null;

            // 向下层传递退出Blending模式
            CloverController.GetInstance().Blending.ExitBlendingMode();
        }
示例#3
0
 /// <summary>
 /// 进入Blending
 /// </summary>
 void EnterBlending()
 {
     mode = FoldingMode.Blending;
     // 计算旋转
     Quaternion quat = CalculateBlendingRotation();
     // 应用旋转
     RenderController.GetInstance().BeginRotationSlerp(quat);
     // 显示模式
     currentModeVi = new CurrentModeVisual("Blending Mode");
     VisualController.GetSingleton().AddVisual(currentModeVi);
     currentModeVi.Start();
     // 显示纸张夹角vi
     blendAngleVi = new BlendAngleVisual(0, new Point(100, 100), new Point(200, 200));
     VisualController.GetSingleton().AddVisual(blendAngleVi);
     blendAngleVi.Start();
 }
示例#4
0
        public override void exit(Boolean isCancled)
        {
            if (mode == FoldingMode.TuckingIn)
                ExitTuckingIn();

            currSelectedElementVi.End();
            currSelectedElementVi = null;
            currOveredElementVi.End();
            currOveredElementVi = null;
            currSelectedElement = currOveredElement = null;
            IsOnMoveLocked = false;
            IsOnPressLocked = false;
            LockViewport(false);

            // 向下层传递
            if (!isCancled)
                CloverController.GetInstance().Tucking.ExitTuckingMode();

            // 销毁虚像……
            paperVoid.DestoryShadow(mainWindow.foldingPaperViewport,
                mainWindow.VoidPaperTopImgFront, mainWindow.VoidPaperBgImg, mainWindow.VoidPaperTopImgBack);

            mode = FoldingMode.DoingNothing;
        }
示例#5
0
        void ExitTuckingIn()
        {
            mode = FoldingMode.DoingNothing;

            tuckLine = null;
            currentModeVi.End();
            currentModeVi = null;
            tuckLineVi.End();
            tuckLineVi = null;
            lineVi.End();
            lineVi = null;
            foldLineInfoVi1.End();
            foldLineInfoVi1 = null;
            foldLineInfoVi2.End();
            foldLineInfoVi2 = null;
            tuckTriangleVi.End();
            tuckTriangleVi = null;
        }
示例#6
0
        void EnterTuckingIn()
        {
            mode = FoldingMode.TuckingIn;
            VisualController visualController = VisualController.GetSingleton();

            // 计算旋转
            Quaternion quat = CalculateFoldingUpRotation();
            // 应用旋转
            RenderController.GetInstance().BeginRotationSlerp(quat);
            // 显示模式
            currentModeVi = new CurrentModeVisual("Tucking In Mode");
            visualController.AddVisual(currentModeVi);
            currentModeVi.Start();
            // 显示连线提示
            lineVi = new DashLineVisual(Origin2Dpos, currMousePos, (SolidColorBrush)App.Current.FindResource("VisualElementBlueBrush"));
            visualController.AddVisual(lineVi);
            lineVi.Start();
            tuckLineVi = new DashLineVisual(new Point(0, 0), new Point(0, 0), (SolidColorBrush)App.Current.FindResource("VisualElementBlueBrush"));
            visualController.AddVisual(tuckLineVi);
            tuckLineVi.Start();
            // 显示折线提示
            foldLineInfoVi1 = new FoldLinePercentageVisual(new Point(-100, -100), new Point(-100, -100), 0);
            foldLineInfoVi2 = new FoldLinePercentageVisual(new Point(-100, -100), new Point(-100, -100), 0);
            visualController.AddVisual(foldLineInfoVi1);
            visualController.AddVisual(foldLineInfoVi2);
            foldLineInfoVi1.Start();
            foldLineInfoVi2.Start();
            // 显示虚影三角形
            tuckTriangleVi = new TuckTriangleVisual(new Point(), new Point(), new Point(), (SolidColorBrush)App.Current.FindResource("VisualElementBlueBrushTran"));
            visualController.AddVisual(tuckTriangleVi);
            tuckTriangleVi.Start();
        }