Пример #1
0
        public SkyLabel(RenderContext11 renderContext, Vector3d point, string text, LabelSytle style)
        {
            Text  = text;
            Style = style;

            if (texture == null)
            {
                texture = Texture11.FromBitmap(Properties.Resources.circle, 0);
            }


            pos = point;

            center = new Vector3(9, 9, 0);

            textBatch = new Text3dBatch(80);

            if (style == LabelSytle.Telrad)
            {
                // Telrad-style labels are always screen-aligned
                Text3d t3 = new Text3d(new Vector3d(0, 0, 0.1), new Vector3d(0, 1, 0), text, 20, .01);
                t3.alignment = Text3d.Alignment.Left;
                textBatch.Add(t3);
            }
            else
            {
                // This will produce sky or orbit aligned text
                textBatch.Add(new Text3d(pos, new Vector3d(0, 1, 0), text, 20, .01));
            }
        }
Пример #2
0
        public SkyLabel(RenderContext11 renderContext, double ra, double dec, string text, LabelSytle style, double distance)
        {
            RA    = ra;
            Dec   = dec;
            Text  = text;
            Style = style;

            Distance = distance;

            if (texture == null)
            {
                texture = Texture11.FromBitmap(Properties.Resources.circle, 0);
            }

            Vector3d up      = new Vector3d();
            Vector3d textPos = new Vector3d();

            if (Earth3d.MainWindow.SolarSystemMode)
            {
                pos = Coordinates.RADecTo3d(ra, -dec, distance);
                up  = Coordinates.RADecTo3d(ra, -dec + 90, distance);

                pos.RotateX(Coordinates.MeanObliquityOfEcliptic(SpaceTimeController.JNow) / 180.0 * Math.PI);
                pos.Add(Planets.GetPlanet3dLocation(SolarSystemObjects.Earth));

                up.RotateX(Coordinates.MeanObliquityOfEcliptic(SpaceTimeController.JNow) / 180.0 * Math.PI);
                up.Add(Planets.GetPlanet3dLocation(SolarSystemObjects.Earth));
            }
            else
            {
                pos     = Coordinates.RADecTo3d(ra + 12, dec, distance);
                textPos = Coordinates.RADecTo3d(ra + 12, dec + 2, distance);
                up      = Coordinates.RADecTo3d(ra + 12, dec + 92, distance);
            }
            center = new Vector3(9, 9, 0);

            textBatch = new Text3dBatch(24);
            if (style == LabelSytle.Telrad)
            {
                // Telrad-style labels are always screen-aligned
                Text3d t3 = new Text3d(new Vector3d(0, 0, 0.1), new Vector3d(0, 1, 0), text, 20, .01);
                t3.alignment = Text3d.Alignment.Left;
                textBatch.Add(t3);
            }
            else
            {
                up.Normalize();
                textPos.Normalize();
                textBatch.Add(new Text3d(textPos, up, text, 20, .0005));
            }
        }
Пример #3
0
        public static void InitializeConstellationNames()
        {
            NamesBatch = new Text3dBatch(80);
            foreach (IPlace centroid in ConstellationNamePositions.Values)
            {
                Vector3d center = Coordinates.RADecTo3d(centroid.RA + 12, centroid.Dec, 1);
                Vector3d up     = new Vector3d(0, 1, 0);
                string   name   = centroid.Name;

                name = FullNames[centroid.Constellation];

                if (centroid.Name == "Triangulum Australe")
                {
                    name = name.Replace(" ", "\n   ");
                }
                NamesBatch.Add(new Text3d(center, up, name, 80, .000125));
            }
        }
Пример #4
0
        public SkyLabel(RenderContext11 renderContext, Vector3d point, string text, LabelSytle style)
        {
            Text = text;
            Style = style;

            if (texture == null)
            {
                texture = Texture11.FromBitmap(Resources.circle, 0);
            }

            pos = point;

            center = new Vector3(9, 9, 0);

            textBatch = new Text3dBatch(80);

            if (style == LabelSytle.Telrad)
            {
                // Telrad-style labels are always screen-aligned
                var t3 = new Text3d(new Vector3d(0, 0, 0.1), new Vector3d(0, 1, 0), text, 20, .01);
                t3.alignment = Text3d.Alignment.Left;
                textBatch.Add(t3);
            }
            else
            {
                // This will produce sky or orbit aligned text
                textBatch.Add(new Text3d(pos, new Vector3d(0,1,0), text, 20, .01));
            }
        }
Пример #5
0
        public SkyLabel(RenderContext11 renderContext, double ra, double dec, string text, LabelSytle style, double distance)
        {
            RA = ra;
            Dec = dec;
            Text = text;
            Style = style;

            Distance = distance;

            if (texture == null)
            {
                texture = Texture11.FromBitmap(Resources.circle, 0);
            }

            var up = new Vector3d();
            var textPos = new Vector3d();
            if (Earth3d.MainWindow.SolarSystemMode)
            {
                pos = Coordinates.RADecTo3d(ra, -dec, distance);
                up = Coordinates.RADecTo3d(ra, -dec + 90, distance);

                pos.RotateX(Coordinates.MeanObliquityOfEcliptic(SpaceTimeController.JNow) / 180.0 * Math.PI);
                pos.Add(Planets.GetPlanet3dLocation(SolarSystemObjects.Earth));

                up.RotateX(Coordinates.MeanObliquityOfEcliptic(SpaceTimeController.JNow) / 180.0 * Math.PI);
                up.Add(Planets.GetPlanet3dLocation(SolarSystemObjects.Earth));
               }
            else
            {
                pos = Coordinates.RADecTo3d(ra+12, dec, distance);
                textPos = Coordinates.RADecTo3d(ra + 12, dec + 2, distance);
                up = Coordinates.RADecTo3d(ra+12, dec + 92, distance);

            }
            center = new Vector3(9, 9, 0);

            textBatch = new Text3dBatch(24);
            if (style == LabelSytle.Telrad)
            {
                // Telrad-style labels are always screen-aligned
                var t3 = new Text3d(new Vector3d(0, 0, 0.1), new Vector3d(0, 1, 0), text, 20, .01);
                t3.alignment = Text3d.Alignment.Left;
                textBatch.Add(t3);
            }
            else
            {
                up.Normalize();
                textPos.Normalize();
                textBatch.Add(new Text3d(textPos, up, text, 20, .0005));
            }
        }
Пример #6
0
        private void Earth3d_Load(object sender, System.EventArgs e)
        {
            CheckOSVersion();
            string path = Properties.Settings.Default.ImageSetUrl;

            if (Properties.Settings.Default.ImageSetUrl.ToLower().Contains("imagesetsnew"))
            {
                Properties.Settings.Default.ImageSetUrl = "http://www.worldwidetelescope.org/wwtweb/catalog.aspx?X=ImageSets5";
            }
             
            Earth3d.MainWindow = this;
            this.dsm = new DataSetManager();
            Constellations.Containment = this.constellationCheck;

            ContextSearch.InitializeDatabase(true);

            LoadExploreRoot();
            if (explorerRoot != null)
            {
                ContextSearch.AddFolderToSearch(explorerRoot, true);
            }
            ContextSearch.AddCatalogs(true);

            BackInitDelegate initBackground = SearchInit;

            initBackground.BeginInvoke(null, null);

            this.WindowState = FormWindowState.Maximized;



            this.FormBorderStyle = TouchKiosk ? FormBorderStyle.None : FormBorderStyle.Sizable;
            TileCache.StartQueue();
            this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            this.SetStyle(ControlStyles.UserPaint, true);
            Earth3d.MainWindow.Config.DomeTilt = (float)Properties.Settings.Default.DomeTilt;
            if (ProjectorServer)
            {
                ShowFullScreen(true);
                this.timer.Interval = 1000;
                this.InputTimer.Enabled = false;
                Cursor.Hide();
                Properties.Settings.Default.ShowCrosshairs = false;
                Properties.Settings.Default.SolarSystemMultiRes = true;
                NetControl.Start();

            }
            else
            {
                if (Properties.Settings.Default.ListenMode || Settings.DomeView)
                {
                    NetControl.Start();
                }
            }
            if (Settings.MasterController)
            {
                NetControl.StartStatusListner();
            }

            if (Settings.MasterController)
            {
                NetControl.LoadNodeList();
            }

            if (Earth3d.TouchKiosk)
            {
                this.menuTabs.IsVisible = false;
                this.kioskTitleBar.Visible = true;
                Properties.Settings.Default.ShowTouchControls = true;
                ShowFullScreen(true);
            }

            if (NoUi)
            {
                this.menuTabs.IsVisible = false;
                Properties.Settings.Default.ShowTouchControls = true;
                ShowFullScreen(true);
            }

            Tile.GrayscaleStyle = Properties.Settings.Default.MonochromeImageStyle;



            // This forces a init at startup does not do anything but force the static contstuctor to fire now
            LayerManager.LoadTree();

            listenUpBoysToolStripMenuItem.Checked = Properties.Settings.Default.ListenMode;
            int id = Properties.Settings.Default.StartUpLookAt;
            if (Properties.Settings.Default.StartUpLookAt == 5)
            {
                id = Properties.Settings.Default.LastLookAtMode;
            }

            if (Properties.Settings.Default.StartUpLookAt == 6)
            {
                Random rnd = new Random();
                id = rnd.Next(-1, 5);
                Properties.Settings.Default.LastLookAtMode = id;
            }

            CurrentImageSet = GetDefaultImageset((ImageSetType)id, BandPass.Visible);

            Properties.Settings.Default.SettingChanging += new System.Configuration.SettingChangingEventHandler(Default_SettingChanging);
            Properties.Settings.Default.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(Default_PropertyChanged);

            if (Properties.Settings.Default.LocalHorizonMode)
            {
                viewType = ViewTypes.AltAz;
            }
            else
            {
                viewType = ViewTypes.Equatorial;
            }
            InitSpaceNavigator();
            ReadyToRender = true;
            Refresh();

            try
            {
                fov = new FieldOfView(Properties.Settings.Default.FovTelescope, Properties.Settings.Default.FovCamera, Properties.Settings.Default.FovEyepiece);
            }
            catch
            {
            }

            SpaceTimeController.Altitude = Properties.Settings.Default.LocationAltitude;
            SpaceTimeController.Location = Coordinates.FromLatLng(Properties.Settings.Default.LocationLat, Properties.Settings.Default.LocationLng);

            TourPlayer.TourEnded += new EventHandler(TourPlayer_TourEnded);
            if (KmlMarkers == null)
            {
                KmlMarkers = new KmlLabels();
            }
            ReadyToRender = true;
            Initialized = true;
            this.Activate();
            fadeImageSet.State = false;
            fadeImageSet.State = true;
            fadeImageSet.TargetState = false;

            // Force settings 
            Properties.Settings.Default.ActualPlanetScale = true;
            Properties.Settings.Default.HighPercitionPlanets = true;
            Properties.Settings.Default.ShowMoonsAsPointSource = false;
            Properties.Settings.Default.ShowSolarSystem.TargetState = true;

            toolStripMenuItem2.Checked = Settings.MasterController;

            viewCamera.Target = SolarSystemObjects.Sun;

            if (!ProjectorServer)
            {
                webServer.Startup();

                sampConnection = new Samp();

                // Register goto
                SampMessageHandler.RegiseterMessage(new SampCoordPointAtSky(new CoordPointAtSkyDelegate(SampGoto)));
                SampMessageHandler.RegiseterMessage(new SampTableLoadVoTable(new TableLoadVoTableDelegate(SampLoadTable)));
                SampMessageHandler.RegiseterMessage(new SampImageLoadFits(new ImageLoadFitsDelegate(SampLoadFitsImage)));
                SampMessageHandler.RegiseterMessage(new SampTableHighlightRow(new TableHighlightRowDelegate(SampHighlightRow)));

                NetworkChange.NetworkAddressChanged += new NetworkAddressChangedEventHandler(NetworkChange_NetworkAddressChanged);

                MidiMapManager.Startup();

            }

            Fader.TargetState = false;

            hold = new Text3dBatch(80);
            hold.Add(new Text3d(new Vector3d(0, 0, 1), new Vector3d(0, 1, 0), " 0hr123456789-+", 80, .0001f));
            hold.Add(new Text3d(new Vector3d(0, 0, 1), new Vector3d(0, 1, 0), "JanuyFebMcApilg", 80, .0001f));
            hold.Add(new Text3d(new Vector3d(0, 0, 1), new Vector3d(0, 1, 0), "stSmOoNvDBCEdqV", 80, .0001f));
            hold.Add(new Text3d(new Vector3d(0, 0, 1), new Vector3d(0, 1, 0), "jxGHILPRTU", 80, .0001f));
            hold.PrepareBatch();

            Constellations.InitializeConstellationNames();

            if (Properties.Settings.Default.ShowClientNodeList && !ProjectorServer)
            {

                ClientNodeList.ShowNodeList();
            }

            if (DetachScreenId > -1)
            {
                FreeFloatRenderWindow(DetachScreenId);
            }

            if (!string.IsNullOrWhiteSpace(Properties.Settings.Default.RefreshToken))
            {
                WindowsLiveSignIn();
            }
        }
Пример #7
0
        public static void InitializeConstellationNames()
        {
            NamesBatch = new Text3dBatch(80);
            foreach (IPlace centroid in ConstellationNamePositions.Values)
            {
                Vector3d center = Coordinates.RADecTo3d(centroid.RA + 12, centroid.Dec, 1);
                Vector3d up = new Vector3d(0, 1, 0);
                string name = centroid.Name;

                name = FullNames[centroid.Constellation];

                if (centroid.Name == "Triangulum Australe")
                {
                    name = name.Replace(" ", "\n   ");
                }
                NamesBatch.Add(new Text3d(center, up, name, 80, .000125));
            }
        }