Example #1
0
		private void menuItemWMS_Click(object sender, System.EventArgs e)
		{
			if(this.rapidFireModisManager != null && this.rapidFireModisManager.Visible)
			{
				this.menuItemModisHotSpots.Checked = false;
				this.rapidFireModisManager.Reset();
				this.rapidFireModisManager.Visible = false;
			}

			if(this.animatedEarthMananger != null && this.animatedEarthMananger.Visible)
			{
				this.menuItemAnimatedEarth.Checked = false;
				this.animatedEarthMananger.Reset();
				this.animatedEarthMananger.Visible = false;
			}

			if(this.wmsBrowser == null)
			{
				this.wmsBrowser = new WMSBrowser(this.worldWindow);
				this.wmsBrowser.Icon = this.Icon;
			}

			menuItemWMS.Checked = !menuItemWMS.Checked;
			this.wmsBrowser.Visible = menuItemWMS.Checked;
			this.wmsBrowser.WindowState = FormWindowState.Normal;
			UpdateToolBarStates();
		}
Example #2
0
		/// <summary>
		/// Loads a new planet
		/// </summary>
		private void OpenWorld(string worldXmlFile)
		{
			
			if(this.worldWindow.CurrentWorld != null)
			{
				try
				{
					this.worldWindow.ResetToolbar();
				}
				catch
				{}

				try
				{
					foreach(PluginInfo p in this.compiler.Plugins)
					{
						try
						{
							if(p.Plugin.IsLoaded)
								p.Plugin.Unload();
						}
						catch
						{}
					}
				}
				catch
				{}
				
				try
				{
					this.worldWindow.CurrentWorld.Dispose();
				}
				catch
				{}
				
			}


			if(this.gotoDialog != null)
			{
				this.gotoDialog.Dispose();
				this.gotoDialog = null;
			}

			if(this.rapidFireModisManager != null)
			{
				this.rapidFireModisManager.Dispose();
				this.rapidFireModisManager = null;
			}

			if(this.animatedEarthMananger != null)
			{
				this.animatedEarthMananger.Dispose();
				this.animatedEarthMananger = null;
			}

			if(this.wmsBrowser != null)
			{
				this.wmsBrowser.Dispose();
				this.wmsBrowser = null;
			}

			//currentWorld = world;

		//	TerrainAccessor terrainAccessor = null;
		//	if(worldDescriptor.HasTerrainAccessor())
		//		terrainAccessor = this.getTerrainAccessorFromXML(worldDescriptor.TerrainAccessor);

			worldWindow.CurrentWorld = WorldWind.ConfigurationLoader.Load(worldXmlFile, worldWindow.Cache);


		/*	if(this.currentWorld.HasLayerDirectory())
			{
				string dirPath = worldDescriptor.LayerDirectory.Value;
				if(!Path.IsPathRooted(dirPath))
					if (worldDescriptor.LayerDirectory.Value.IndexOf("//") < 0) // ?
						dirPath = Path.Combine(  Settings.ConfigPath, dirPath );

				ArrayList nodes = new ArrayList();
				foreach (string layerSetFile in Directory.GetFiles( dirPath, "*.xml" ))
				{
					try
					{
						
						LayerSet.LayerSetDoc curLayerSetDoc = new LayerSet.LayerSetDoc();
						LayerSet.Type_LayerSet curLayerSet = new LayerSet.Type_LayerSet(curLayerSetDoc.Load(layerSetFile));

						RenderableObject wwroi = getRenderableObjectListFromLayerSet(this.worldWindow.CurrentWorld, curLayerSet, layerSetFile);
						world.RenderableObjects.Add( wwroi );
					}
					catch (Exception caught)
					{
						// Altova throws System.Exception
						splashScreen.SetError(
							String.Format(CultureInfo.CurrentCulture, "The file '{0}' is invalid: {1}",
							Path.GetFileName(layerSetFile), caught.Message) );
					}
				}

				this.layerTreeNodes = (TreeNode[])nodes.ToArray(typeof(TreeNode));
			}
*/
			
			this.splashScreen.SetText("Initializing menus...");
				
			InitializePluginCompiler();

			foreach(RenderableObject worldRootObject in this.worldWindow.CurrentWorld.RenderableObjects.ChildObjects)
			{
				this.AddLayerMenuButtons(this.worldWindow, worldRootObject);
			}

			this.AddInternalPluginMenuButtons();

			this.menuItemModisHotSpots.Enabled = worldWindow.CurrentWorld.IsEarth;
			this.menuItemAnimatedEarth.Enabled = worldWindow.CurrentWorld.IsEarth;
		

		}
Example #3
0
		private void AddInternalPluginMenuButtons()
		{
		/*	this.gotoDialog = new GotoDialog(this.worldWindow, this.currentWorld, Settings.ConfigPath);
			this.gotoDialog.Icon = this.Icon;
			this.worldWindow.MenuBar.AddToolsMenuButton( new WindowsControlMenuButton( "Place Finder", DirectoryPath + "\\Data\\Icons\\Interface\\search.png", this.gotoDialog));
*/
			if(this.worldWindow.CurrentWorld.IsEarth)
			{
				this.rapidFireModisManager = new RapidFireModisManager(this.worldWindow);
				this.rapidFireModisManager.Icon = this.Icon;
				this.worldWindow.MenuBar.AddToolsMenuButton( new WindowsControlMenuButton( "Rapid Fire MODIS", DirectoryPath + "\\Data\\Icons\\Interface\\modis.png", this.rapidFireModisManager) );
			}
			this.wmsBrowser = new WMSBrowser(this.worldWindow);
			this.wmsBrowser.Icon = this.Icon;
			this.worldWindow.MenuBar.AddToolsMenuButton( new WindowsControlMenuButton( "WMS Browser", DirectoryPath + "\\Data\\Icons\\Interface\\wms.png", this.wmsBrowser ));

			if(this.worldWindow.CurrentWorld.IsEarth)
			{
				this.animatedEarthMananger = new AnimatedEarthManager(this.worldWindow);
				this.animatedEarthMananger.Icon = this.Icon;
				this.worldWindow.MenuBar.AddToolsMenuButton( new WindowsControlMenuButton( "Scientific Visualization Studio", DirectoryPath + "\\Data\\Icons\\Interface\\svs2.png", this.animatedEarthMananger));
			}
		}