コード例 #1
0
        //Update function with the Menu
        private void Update()
        {
            if (CurrentMenu.Menu.Selection == cMenu.GetCurrentMenu() && currentVolume != null)
            {
                if (CurrentMenu.Selection.SetOperation == cMenu.GetCurrentMenuSelection())
                {
                    switch (cMenu.GetCurrentMenuSetOperation())
                    {
                    case CurrentMenu.SetOperation.SetUnion:
                        if (test != 0)
                        {
                            BoolUpdate(OrBoolOperation);
                            test = 0;
                        }
                        break;

                    case CurrentMenu.SetOperation.SetIntersection:
                        if (test != 1)
                        {
                            BoolUpdate(AndBoolOperation);
                            test = 1;
                        }
                        break;

                    case CurrentMenu.SetOperation.SetRelativeComplement:
                        if (test != 2)
                        {
                            BoolUpdate(NotInBoolOperation);
                            test = 2;
                        }
                        break;

                    default:
                        if (cMenu.SetOperationIsConfirmed() && test != 3)
                        {
                            currentSelectedDataPoints = ScatterPlot.GetSelectedPoints(currentVolume);
                            currentSelectedDataPoints = BoolOperationMain(currentSelectedDataPoints);
                            OperationData.Add(new List <DataPoint>(currentSelectedDataPoints));
                            Coloration(currentSelectedDataPoints);
                            cMenu.ResetSetOperation();
                            test = 3;
                        }
                        break;
                    }
                }
            }
        }
コード例 #2
0
        private void MenuPreview() // MenuPreview gives a preview of the button's action
        {
            // Checks whether a button is hovered

            switch (cMenu.GetCurrentMenu())
            {
            case CurrentMenu.Menu.Selection:
            {
                switch (cMenu.GetCurrentMenuSelection())
                {
                case CurrentMenu.Selection.SetOperation:             // Set Operation Menu behavior
                {
                    if (ButtonCreation.isPrimaryHovered)
                    {
                        cMenu.DisplaySetOperation(CurrentMenu.SetOperation.SetIntersection);
                        break;
                    }

                    if (ButtonSelection.isPrimaryHovered)
                    {
                        cMenu.DisplaySetOperation(CurrentMenu.SetOperation.SetUnion);
                        break;
                    }

                    if (ButtonStatistics.isPrimaryHovered)
                    {
                        cMenu.DisplaySetOperation(CurrentMenu.SetOperation.SetRelativeComplement);
                        break;
                    }

                    if (ButtonHide_Show.isPrimaryHovered)
                    {
                        cMenu.DisplaySetOperation(CurrentMenu.SetOperation.Confirm);
                        break;
                    }

                    if (ButtonHelp_Options.isPrimaryHovered)
                    {
                        cMenu.DisplaySetOperation(CurrentMenu.SetOperation.Return);
                        break;
                    }

                    cMenu.DisplaySetOperation(cMenu.GetCurrentMenuSetOperation());
                    break;
                }

                default:             //Selection Menu behavior
                {
                    if (ButtonCreation.isPrimaryHovered)
                    {
                        cMenu.DisplaySelection(CurrentMenu.Selection.Modification);
                        break;
                    }

                    if (ButtonSelection.isPrimaryHovered)
                    {
                        cMenu.DisplaySelection(CurrentMenu.Selection.Erase);
                        break;
                    }


                    if (ButtonStatistics.isPrimaryHovered)
                    {
                        cMenu.DisplaySelection(CurrentMenu.Selection.SetOperation);
                        break;
                    }

                    if (ButtonHide_Show.isPrimaryHovered)
                    {
                        cMenu.DisplaySelection(CurrentMenu.Selection.Return);
                        break;
                    }

                    cMenu.DisplaySelection(cMenu.GetCurrentMenuSelection());
                    break;
                }
                }

                break;
            }

            default:     // General Menu Behavior
            {
                if (ButtonCreation.isPrimaryHovered)
                {
                    cMenu.DisplayMenu(CurrentMenu.Menu.Creation);
                    break;
                }

                if (ButtonSelection.isPrimaryHovered)
                {
                    cMenu.DisplayMenu(CurrentMenu.Menu.Selection);
                    break;
                }

                if (ButtonStatistics.isPrimaryHovered)
                {
                    cMenu.DisplayMenu(CurrentMenu.Menu.Statistics);
                    break;
                }

                if (ButtonHide_Show.isPrimaryHovered)
                {
                    cMenu.DisplayMenu(CurrentMenu.Menu.Hide_Show);
                    break;
                }

                if (ButtonHelp_Options.isPrimaryHovered)
                {
                    cMenu.DisplayMenu(CurrentMenu.Menu.Help_Options);
                    break;
                }

                if (ButtonQuit.isPrimaryHovered)
                {
                    cMenu.DisplayMenu(CurrentMenu.Menu.Quit);
                    break;
                }

                cMenu.DisplayMenu(cMenu.GetCurrentMenu());
                break;
            }
            }

            return;
        }