From 127ebdea9736eef70f31315b57a53b1df553a815 Mon Sep 17 00:00:00 2001 From: Carifio24 Date: Mon, 31 Jan 2022 14:24:18 -0500 Subject: [PATCH 1/4] Add an explicit call to OnResize in the Earth3d constructor to remove jagged lines in HiDPI displays. --- WWTExplorer3d/3dWindow.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/WWTExplorer3d/3dWindow.cs b/WWTExplorer3d/3dWindow.cs index d2777e3..32b199f 100644 --- a/WWTExplorer3d/3dWindow.cs +++ b/WWTExplorer3d/3dWindow.cs @@ -1180,6 +1180,11 @@ public Earth3d() { } } + + // On HiDPI displays, jagged lines can appear when the client starts up, + // but disappear on a window resize. + // So, to avoid this, we explicitly call OnResize here + OnResize(EventArgs.Empty); } public static void BackgroundInit() From 90f3063dbe9c38b8f7dc0739819d0c14d89a8f7e Mon Sep 17 00:00:00 2001 From: Carifio24 Date: Mon, 31 Jan 2022 21:31:24 -0500 Subject: [PATCH 2/4] When a reference frame's mean radius is changed in the UI, mark all of that frame's layers as dirty. --- WWTExplorer3d/FrameWizardMain.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/WWTExplorer3d/FrameWizardMain.cs b/WWTExplorer3d/FrameWizardMain.cs index ac8d603..2fe7d86 100644 --- a/WWTExplorer3d/FrameWizardMain.cs +++ b/WWTExplorer3d/FrameWizardMain.cs @@ -41,6 +41,7 @@ public override bool Save() { bool failed = false; + double initialMeanRadius = frame.MeanRadius; frame.MeanRadius = ParseAndValidateDouble(MeanRadius, frame.MeanRadius, ref failed); frame.Oblateness = ParseAndValidateDouble(Oblateness, frame.Oblateness, ref failed); frame.Scale = ParseAndValidateDouble(Scale, frame.Scale, ref failed); @@ -52,6 +53,18 @@ public override bool Save() frame.ShowAsPoint = ShowAsPoint.Checked; frame.ShowOrbitPath = ShowOrbitPath.Checked; + + // If the mean radius changes, mark each of the frame's layers as dirty so that it is re-drawn + bool radiusChanged = initialMeanRadius != frame.MeanRadius; + if (radiusChanged && LayerManager.AllMaps.ContainsKey(frame.name)) + { + LayerMap map = LayerManager.AllMaps[frame.name]; + foreach (Layer layer in map.Layers) + { + layer.CleanUp(); + } + } + return !failed; } From 3a4e607e32348df032c425f970241f8d7f13512b Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Fri, 11 Feb 2022 10:53:42 +0000 Subject: [PATCH 3/4] Update default WMS URL --- WWTExplorer3d/WmsLayer.cs | 2 +- WWTExplorer3d/WmsLayerWizard.Designer.cs | 2 +- WWTExplorer3d/WmsLayerWizard.resx | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/WWTExplorer3d/WmsLayer.cs b/WWTExplorer3d/WmsLayer.cs index f4d36db..42917fc 100644 --- a/WWTExplorer3d/WmsLayer.cs +++ b/WWTExplorer3d/WmsLayer.cs @@ -227,7 +227,7 @@ public TimeSpan TimeStep } } - string serviceUrl = "http://svs.gsfc.nasa.gov/cgi-bin/wms?"; + string serviceUrl = "https://gibs.earthdata.nasa.gov/wms/epsg4326/best/wms.cgi?"; [LayerProperty] public string ServiceUrl diff --git a/WWTExplorer3d/WmsLayerWizard.Designer.cs b/WWTExplorer3d/WmsLayerWizard.Designer.cs index dff7cb2..4e59a69 100644 --- a/WWTExplorer3d/WmsLayerWizard.Designer.cs +++ b/WWTExplorer3d/WmsLayerWizard.Designer.cs @@ -61,7 +61,7 @@ private void InitializeComponent() this.wmsUrl.Name = "wmsUrl"; this.wmsUrl.Size = new System.Drawing.Size(339, 20); this.wmsUrl.TabIndex = 3; - this.wmsUrl.Text = "http://svs.gsfc.nasa.gov/cgi-bin/wms"; + this.wmsUrl.Text = "https://gibs.earthdata.nasa.gov/wms/epsg4326/best/wms.cgi"; this.wmsUrl.TextChanged += new System.EventHandler(this.wmsUrl_TextChanged); // // label1 diff --git a/WWTExplorer3d/WmsLayerWizard.resx b/WWTExplorer3d/WmsLayerWizard.resx index 9976ca5..f85beff 100644 --- a/WWTExplorer3d/WmsLayerWizard.resx +++ b/WWTExplorer3d/WmsLayerWizard.resx @@ -112,12 +112,12 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + 17, 17 \ No newline at end of file From 94df3f67bb5b2423b327d90af0218a9d79ee23ab Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Fri, 11 Feb 2022 13:28:57 +0000 Subject: [PATCH 4/4] WWTExplorer3d/Healpix/HealpixTile.cs: add HiPS analytics Add a query-string to HiPS tile URLs that will allow providers to get some analytics on traffic sources. With the Windows client, we could set the User-Agent, but that's not an option for the web-based client(s), and it will keep things cleaner to use a single mechanism across platforms. --- WWTExplorer3d/Healpix/HealpixTile.cs | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/WWTExplorer3d/Healpix/HealpixTile.cs b/WWTExplorer3d/Healpix/HealpixTile.cs index 3ea82ce..ca621f6 100644 --- a/WWTExplorer3d/Healpix/HealpixTile.cs +++ b/WWTExplorer3d/Healpix/HealpixTile.cs @@ -320,7 +320,7 @@ private void createGeometry() static bool galMatInit = false; static Matrix3d galacticMatrix = Matrix3d.Identity; - public string GetDirectory(IImageSet dataset, int level, int x, int y) + public new string GetDirectory(IImageSet dataset, int level, int x, int y) { StringBuilder sb = new StringBuilder(); @@ -345,7 +345,7 @@ public string GetDirectory(IImageSet dataset, int level, int x, int y) public string GetFilename() { - string extention = GetHipsFileExtention(); + string extention = GetHipsFileExtension(); StringBuilder sb = new StringBuilder(); sb.Append(Properties.Settings.Default.CahceDirectory); @@ -439,10 +439,9 @@ public static void GenerateLevel2(string filename) } } - public string GetUrl(IImageSet dataset, int level, int x, int y) + public new string GetUrl(IImageSet dataset, int level, int x, int y) { - string returnUrl = ""; - string extention = GetHipsFileExtention(); + string extension = GetHipsFileExtension(); int tileTextureIndex = -1; if (level == 0) @@ -453,6 +452,7 @@ public string GetUrl(IImageSet dataset, int level, int x, int y) { tileTextureIndex = this.face * nside * nside / 4 + this.tileIndex; } + StringBuilder sb = new StringBuilder(); int subDirIndex = tileTextureIndex / 10000; @@ -467,12 +467,18 @@ public string GetUrl(IImageSet dataset, int level, int x, int y) sb.Append("0"); } - returnUrl = string.Format(dataset.Url, level.ToString(), sb.ToString(), tileTextureIndex.ToString() + extention); - - return returnUrl; + // Add a query string component to help the HiPS services do analytics on their traffic. + // Here on Windows we could use a user-agent, but that isn't an option for the web-based + // client(s), and it'll keep things simpler to use the same mechanism across platforms. + return string.Format( + dataset.Url, + level.ToString(), + sb.ToString(), + tileTextureIndex.ToString() + extension + "?client=wwt6windows" + ); } - private string GetHipsFileExtention() + private string GetHipsFileExtension() { // The extension will contain either a list of type or a single type // The imageset can be set to the perfrered file type if desired IE: FITS will never be chosen if others are avaialbe,