示例#1
0
		private NltTerrainAccessor getTerrainAccessorFromXML(WorldXmlDescriptor.TerrainAccessor curTerrainAccessorType)
		{
			double east = curTerrainAccessorType.LatLonBoundingBox.East.Value.DoubleValue();
			double west = curTerrainAccessorType.LatLonBoundingBox.West.Value.DoubleValue();
			double north = curTerrainAccessorType.LatLonBoundingBox.North.Value.DoubleValue();
			double south = curTerrainAccessorType.LatLonBoundingBox.South.Value.DoubleValue();

			NltTerrainAccessor[] subsets = null;
			if(curTerrainAccessorType.HasHigherResolutionSubsets())
			{
				subsets = new NltTerrainAccessor[curTerrainAccessorType.HigherResolutionSubsetsCount];
				for(int i = 0; i < curTerrainAccessorType.HigherResolutionSubsetsCount; i++)
				{
					subsets[i] = this.getTerrainAccessorFromXML(curTerrainAccessorType.GetHigherResolutionSubsetsAt(i));
				}
			}

			if(curTerrainAccessorType.HasDownloadableWMSSet())
			{
			/*	WMSLayerAccessor wmsLayer = new WMSLayerAccessor();

				wmsLayer.ImageFormat = curTerrainAccessorType.DownloadableWMSSet.ImageFormat.Value;
				wmsLayer.IsTransparent = curTerrainAccessorType.DownloadableWMSSet.UseTransparency.Value;
				wmsLayer.ServerGetMapUrl = curTerrainAccessorType.DownloadableWMSSet.ServerGetMapUrl.Value;
				wmsLayer.Version = curTerrainAccessorType.DownloadableWMSSet.Version.Value;
				wmsLayer.WMSLayerName = curTerrainAccessorType.DownloadableWMSSet.WMSLayerName.Value;

				if(curTerrainAccessorType.DownloadableWMSSet.HasUsername())
					wmsLayer.Username = curTerrainAccessorType.DownloadableWMSSet.Username.Value;

				if(curTerrainAccessorType.DownloadableWMSSet.HasPassword())
					wmsLayer.Password = curTerrainAccessorType.DownloadableWMSSet.Password.Value;

				if(curTerrainAccessorType.DownloadableWMSSet.HasWMSLayerStyle())
					wmsLayer.WMSLayerStyle = curTerrainAccessorType.DownloadableWMSSet.WMSLayerStyle.Value;
				else
					wmsLayer.WMSLayerStyle = "";

				if(curTerrainAccessorType.DownloadableWMSSet.HasBoundingBoxOverlap())
					wmsLayer.BoundingBoxOverlap = curTerrainAccessorType.DownloadableWMSSet.BoundingBoxOverlap.DoubleValue();

				return new NltTerrainAccessor(
					curTerrainAccessorType.Name.Value,
					west,
					south,
					east,
					north,
					wmsLayer,
					subsets
					);
					*/
			}
			else if(curTerrainAccessorType.HasTerrainTileService())
			{
				/*string serverUrl = curTerrainAccessorType.TerrainTileService.ServerUrl.Value;
				double levelZeroTileSizeDegrees = curTerrainAccessorType.TerrainTileService.LevelZeroTileSizeDegrees.DoubleValue();
				int numberLevels = curTerrainAccessorType.TerrainTileService.NumberLevels.Value;
				int samplesPerTile = curTerrainAccessorType.TerrainTileService.SamplesPerTile.Value;
				string fileExtension = curTerrainAccessorType.TerrainTileService.FileExtension.Value;

				TerrainTileService tts = new TerrainTileService(
					serverUrl,
					curTerrainAccessorType.TerrainTileService.DataSetName.Value,
					levelZeroTileSizeDegrees,
					samplesPerTile,
					fileExtension,
					numberLevels,
					Path.Combine(this.worldWindow.Cache.CacheDirectory,
					Path.Combine(Path.Combine( worldWindow.CurrentWorld.Name, "TerrainAccessor"), curTerrainAccessorType.Name.Value )));

				return new NltTerrainAccessor(
					curTerrainAccessorType.Name.Value,
					west,
					south,
					east,
					north,
					tts,
					subsets
					);*/
			}

			return null;
		}
示例#2
0
      /// <summary>
			/// Initializes a new instance of the <see cref= "T:WorldWind.GotoDialog"/> class.
      /// </summary>
      /// <param name="ww"></param>
      /// <param name="currentWorld"></param>
      /// <param name="worldsXMLFilePath"></param>
      public GotoDialog(WorldWindow ww, WorldXmlDescriptor.WorldType currentWorld, string worldsXMLFilePath)
      {
         // Required for Windows Form Designer support
         InitializeComponent();

		  /*
         // manually add the search progress bar to the statusBar controls
         this.statusBar.Controls.Add(this.progressBarSearch);
         
         // keep track of our output window and the current World.
         this.worldWindow = ww;
         this.currentWorld = currentWorld;

         this.listViewResults.WorldWindow = ww;
         this.listViewFavorites.WorldWindow = ww;
         this.listViewHistory.WorldWindow = ww;

         this.listViewResults.Favorites = this.listViewFavorites;
         this.listViewResults.RecentFinds = this.listViewHistory;

         this.listViewHistory.Favorites = this.listViewFavorites;
         this.listViewFavorites.RecentFinds = this.listViewHistory;



         // create list of tiled placenamesets for this world
         if(this.currentWorld.HasLayerDirectory())
         {
            string dirPath = this.currentWorld.LayerDirectory.Value;

            // if LayerDirectory is not an absolute path, prepend worldsXMLFilePath
            if(!Path.IsPathRooted(this.currentWorld.LayerDirectory.Value)) 
            {
               dirPath = Path.Combine( worldsXMLFilePath, dirPath );
            }

            // handle all XML files in that directory
            foreach(string layerSetFileName in Directory.GetFiles(dirPath, "*.xml"))
            {
							try
							{
								LayerSet.LayerSetDoc curLayerSetDoc = new LayerSet.LayerSetDoc();
								LayerSet.Type_LayerSet curLayerSet = new LayerSet.Type_LayerSet(curLayerSetDoc.Load(layerSetFileName));
								this.collectTiledPlacenamesSets(curLayerSet);
							}
							catch (IOException caught)
							{
								Log.Write(LogCategory, "Problem reading place names: " + caught.Message);
							}
							catch (System.Xml.XmlException)
							{
								// Malformed XML (problem already reported to user on app load - ignore)
							}
            }
         }

         // fast search can be switched on only if all indices required for QuickFind are available
         this.checkBoxFastSearch.Enabled = true;

         // make fast search the default - if possible.
         this.checkBoxFastSearch.Checked = this.AllIndicesAvailable();
		 */
      }