コード例 #1
0
        internal static void ShowToolbars(SceneGLControl sceneControl)
        {
            var controlsToRemove = new List <Control>();

            foreach (Control control in sceneControl.Controls)
            {
                if (control is SceneControlToolbarBase || control is ExportUserControl)
                {
                    controlsToRemove.Add(control);
                }
            }

            foreach (var control in controlsToRemove)
            {
                sceneControl.Controls.Remove(control);
            }

            //add new controls
            foreach (var panel in Toolbars)
            {
                sceneControl.Controls.Add(panel);
            }

            sceneControl.Render();
        }
コード例 #2
0
        public static void ChangeViewMode(ViewMode viewMode, SceneGLControl sceneControl, PictureBox buttonPressed)
        {
            ResetObjectsCache();

            CurrentViewMode = viewMode;


            switch (viewMode)
            {
            case ViewMode.ModelRotation:
                SceneActionControlManager.ShowPanel(Enums.MainFormToolStripActionType.btnRotatePressed, buttonPressed, sceneControl);
                break;

            case ViewMode.SelectObject:
                SceneActionControlManager.ShowPanel(Enums.MainFormToolStripActionType.btnSelectPressed, buttonPressed, sceneControl);
                SceneView.Reset3DGizmos();
                sceneControl.RightMouseDown = false;
                break;

            case ViewMode.MoveTranslation:
                SceneActionControlManager.ShowPanel(Enums.MainFormToolStripActionType.btnMovePressed, buttonPressed, sceneControl);
                break;

            case ViewMode.Pan:
                sceneControl.RightMouseDown = false;
                break;

            case ViewMode.Duplicate:
                SceneActionControlManager.ShowPanel(Enums.MainFormToolStripActionType.btnModelActionDuplicate, buttonPressed, sceneControl);
                break;

            case ViewMode.ModelScale:
                SceneActionControlManager.ShowPanel(Enums.MainFormToolStripActionType.btnScalePressed, buttonPressed, sceneControl);
                break;

            case ViewMode.MagsAI:
                SceneActionControlManager.ShowPanel(Enums.MainFormToolStripActionType.btnModelActionMagsAI, buttonPressed, sceneControl);
                sceneControl.RightMouseDown = false;
                break;

            case ViewMode.MagsAIManualSupport:
                SceneActionControlManager.ShowPanel(Enums.MainFormToolStripActionType.btnModelActionMagsAIManualSupport, buttonPressed, sceneControl);
                sceneControl.RightMouseDown = false;
                break;

            case ViewMode.MagsAIGridSupport:
                SceneActionControlManager.ShowPanel(Enums.MainFormToolStripActionType.btnModelActionMagsAIGridSupport, buttonPressed, sceneControl);
                sceneControl.RightMouseDown = false;
                break;

            case ViewMode.LayFlat:
                sceneControl.RightMouseDown = false;
                break;
            }

            sceneControl.DrawSelectedTriangleRayTrace = true;
            sceneControl.Render(true);
        }
コード例 #3
0
        internal static void HideToolbars(SceneGLControl sceneControl)
        {
            var controlsToRemove = new List <Control>();

            foreach (Control control in sceneControl.Controls)
            {
                controlsToRemove.Add(control);
            }
            foreach (var control in controlsToRemove)
            {
                sceneControl.Controls.Remove(control);
            }

            sceneControl.Render();
        }