Exemplo n.º 1
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();
        }
Exemplo n.º 2
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;
        }
Exemplo n.º 3
0
 /// <summary>
 /// 退出Folding模式
 /// </summary>
 void ExitFoldingUp()
 {
     foldLineVi.End();
     foldLineVi = null;
     lineVi.End();
     lineVi = null;
     currentModeVi.End();
     currentModeVi = null;
     foldLineInfoVi1.End();
     foldLineInfoVi1 = null;
     foldLineInfoVi2.End();
     foldLineInfoVi2 = null;
 }