コード例 #1
0
ファイル: WorldWind.cs プロジェクト: jpespartero/WorldWind
		protected override void Dispose( bool disposing )
		{
			if(animatedEarthMananger!=null)
			{
				animatedEarthMananger.Dispose();
				animatedEarthMananger = null;
			}
			if( disposing )
			{
				if (components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}
コード例 #2
0
ファイル: WorldWind.cs プロジェクト: jpespartero/WorldWind
		private void menuItemAnimatedEarth_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.wmsBrowser != null && this.wmsBrowser.Visible)
			{
				this.menuItemWMS.Checked = false;
				//this.wmsBrowser.Reset();
				this.wmsBrowser.Visible = false;
			}

			if (this.animatedEarthMananger == null)
			{
				this.animatedEarthMananger = new AnimatedEarthManager(this.worldWindow);
				this.animatedEarthMananger.Icon = this.Icon;
			}

			menuItemAnimatedEarth.Checked = !menuItemAnimatedEarth.Checked;
			this.animatedEarthMananger.Visible = this.menuItemAnimatedEarth.Checked;
			this.animatedEarthMananger.WindowState = FormWindowState.Normal;
			UpdateToolBarStates();
		}
コード例 #3
0
ファイル: WorldWind.cs プロジェクト: jpespartero/WorldWind
		/// <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;
		

		}
コード例 #4
0
ファイル: WorldWind.cs プロジェクト: jpespartero/WorldWind
		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));
			}
		}