Beispiel #1
0
 private bool canRender(CelestialBody CB)
 {
     return((this.ViewMode == SolarMax.ViewMode.TopDown || CB != camera.BodyWithCamera) &&
            (!(CB is Star) || (CanViewStars && (CB as Star).Magnitude < MinStarBrightness)) &&
            (ConstellationMode != SolarMax.ConstellationMode.None || !(CB is Constellation)));
 }
Beispiel #2
0
        public bool SendCommand(QCommand Command)
        {
            if (Command.CommandCode == CommandCode.MouseClick)
            {
                CelestialBody cb = findClosestBody(Command.Point, renderer.RenderLocations, renderer.NumRenderLocations);
                if (cb != null)
                {
                    ResetPanningAdjustments();
                    if (Command.Shift)
                    {
                        setHome(cb);
                    }
                    else
                    {
                        setViewTarget(cb);
                    }

                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            if (currentDialog != null)
            {
                if (currentDialog.SendCommand(Command))
                {
                    return(true);
                }
            }

            switch (Command.CommandCode)
            {
            case CommandCode.MouseHorizontal:
                if (Command.Shift)
                {
                    tilt(Command.Data);
                }
                else if (!Command.Control)
                {
                    panHorizontal(Command.Data);
                }
                break;

            case CommandCode.MouseVertical:
                if (Command.Control)
                {
                    zoom(Command.Data);
                }
                else if (!Command.Shift)
                {
                    panVertical(Command.Data);
                }
                break;

            case CommandCode.MouseWheel:
                zoom(Command.Data);
                break;

            case CommandCode.Escape:
                if (screenSaverMode != ScreenSaverMode.ScreenSaverPreview)
                {
                    shutdownCallback();
                }
                break;

            case CommandCode.Enter:
                this.settle();
                break;

            case CommandCode.UpArrow:
                this.setHome(Forward: true);
                break;

            case CommandCode.DownArrow:
                this.setHome(Forward: false);
                break;

            case CommandCode.LeftArrow:
                this.setViewTarget(Forward: false);
                break;

            case CommandCode.RightArrow:
                this.setViewTarget(Forward: true);
                break;

            case CommandCode.Five:
                this.ShowEclipticGrid = !this.ShowEclipticGrid;
                break;

            case CommandCode.Six:
                this.ShowEquatorialGrid = !this.ShowEquatorialGrid;
                break;

            case CommandCode.Seven:
                this.ShowLocalGrid = !this.ShowLocalGrid;
                break;

            case CommandCode.F1:
                this.InHelpMode = !this.InHelpMode;
                break;

            case CommandCode.F2:
                this.ShowData = !this.ShowData;
                break;

            case CommandCode.F3:
                this.InFindMode = !this.InFindMode;
                break;

            case CommandCode.F4:

                if (Command.Alt)
                {
                    return(false);
                }

                this.ShowInstruments = !this.ShowInstruments;
                break;

            case CommandCode.F5:
                this.switchCaptionMode();
                break;

            case CommandCode.F6:
                this.WireFrameBodyRender = !this.WireFrameBodyRender;
                break;

            case CommandCode.F7:
                this.adjustMinBrightness(-1f);
                break;

            case CommandCode.F8:
                this.adjustMinBrightness(1f);
                break;

            case CommandCode.F9:
                this.switchConstellationMode();
                break;

            case CommandCode.F10:
                this.switchConstellationSet();
                break;

            case CommandCode.F11:
                this.ShowConstellationBoundaries = !this.ShowConstellationBoundaries;
                break;

            case CommandCode.PageDown:
                this.ZoomOut(getAdjustmentCode(Command));
                break;

            case CommandCode.PageUp:
                this.zoomIn(getAdjustmentCode(Command));
                break;

            case CommandCode.End:
                this.ZoomOut(AdjustmentAmount.All);
                break;

            case CommandCode.Home:
                this.zoomIn(AdjustmentAmount.All);
                break;

            case CommandCode.P:
            case CommandCode.Pause:
                if (!this.InDateTimeAdjustMode)
                {
                    this.UserPaused = !this.UserPaused;
                }
                break;

            case CommandCode.Backspace:
                this.InLatLongAdjustaMode = !this.InLatLongAdjustaMode;
                break;

            case CommandCode.BackslashPipe:
                if (physicsStartupDone)
                {
                    this.InDateTimeAdjustMode = !this.InDateTimeAdjustMode;
                }
                break;

            case CommandCode.PlusEquals:
                this.DisplayTimeUTC = !this.DisplayTimeUTC;
                break;

            case CommandCode.One:
                this.ViewMode = ViewMode.Ecliptic;
                break;

            case CommandCode.Two:
                this.ViewMode = ViewMode.Surface;
                break;

            case CommandCode.Three:
                this.ViewMode = ViewMode.TopDown;
                break;

            case CommandCode.Four:
                this.ViewMode = ViewMode.Follow;
                break;

            case CommandCode.T:
                goToToday();
                break;

            case CommandCode.Z:
                slowDown(getAdjustmentCode(Command));
                break;

            case CommandCode.X:
                speedUp(getAdjustmentCode(Command));
                break;

            case CommandCode.R:
                swapViewAndHome();
                break;

            case CommandCode.C:
                reverseTime();
                break;

            case CommandCode.A:
                panLeft(getAdjustmentCode(Command));
                break;

            case CommandCode.D:
                panRight(getAdjustmentCode(Command));
                break;

            case CommandCode.W:
                panUp(getAdjustmentCode(Command));
                break;

            case CommandCode.S:
                panDown(getAdjustmentCode(Command));
                break;

            case CommandCode.Q:
                tiltLeft(getAdjustmentCode(Command));
                break;

            case CommandCode.E:
                tiltRight(getAdjustmentCode(Command));
                break;

            case CommandCode.Space:
                ResetPanningAdjustments();
                break;

            case CommandCode.TildeBackTick:
                switchProjectionMode();
                break;

            case CommandCode.Insert:
                HighQualityRender = !HighQualityRender;
                break;

            case CommandCode.CommaLeftAngle:
                findTarget();
                break;

            case CommandCode.PeriodRightAngle:
                findHome();
                break;

            case CommandCode.F12:
                this.HighlightSunlitAreas = !this.HighlightSunlitAreas;
                break;

            default:
                return(false);
            }
            return(true);
        }