/// <summary> /// Default constructor /// </summary> /// <param name="oDAPbuilder"></param> internal GIS(Dapple.LayerGeneration.DAPQuadLayerBuilder oDAPbuilder) : base(oDAPbuilder) { InitializeComponent(); cbOptions.DataSource = Options.GIS.OMDownloadOptionStrings; cbOptions.SelectedIndex = 0; tbGroupName.Text = oDAPbuilder.Title; tbFilename.Text = System.IO.Path.ChangeExtension(oDAPbuilder.Title, MAP_EXT); if (MainForm.Client == Options.Client.ClientType.MapInfo) { cbOptions.SelectedIndex = SAVE_AS_TAB_IMPORT; lOptions.Visible = false; cbOptions.Visible = false; cbOptions.Enabled = false; } if (MainForm.Client == Options.Client.ClientType.ArcMAP) { cbOptions.SelectedIndex = SAVE_AS_SHP_IMPORT; lOptions.Visible = false; cbOptions.Visible = false; cbOptions.Enabled = false; } ConfigureDialog(); }
/// <summary> /// Default constructor /// </summary> /// <param name="oMainForm"></param> /// <param name="oDAPLayer"></param> internal DownloadOptions(Dapple.LayerGeneration.DAPQuadLayerBuilder oDAPLayer) : this() { m_oDAPLayer = oDAPLayer; m_oViewedAoi = WorldWind.GeographicBoundingBox.FromQuad(MainForm.WorldWindowSingleton.CurrentAreaOfInterest); m_oMapAoi = MainForm.MapAoi; m_strMapProjection = MainForm.MapAoiCoordinateSystem; if (oDAPLayer != null) m_strLayerProjection = MainForm.MontajInterface.GetProjection(m_oDAPLayer.ServerURL, m_oDAPLayer.DatasetName); }
/// <summary> /// Default constructor /// </summary> /// <param name="oDAPbuilder"></param> internal Voxel(Dapple.LayerGeneration.DAPQuadLayerBuilder oDAPbuilder) : base(oDAPbuilder) { InitializeComponent(); tbFilename.Text = System.IO.Path.ChangeExtension(oDAPbuilder.Title, MAP_EXT); tbGroupName.Text = oDAPbuilder.Title; oResolution.SetDownloadOptions(this); SetDefaultResolution(); }
/// <summary> /// Default constructor /// </summary> /// <param name="oDAPbuilder"></param> internal SectionPicture(Dapple.LayerGeneration.DAPQuadLayerBuilder oDAPbuilder) : base(oDAPbuilder) { InitializeComponent(); tbFilename.Text = System.IO.Path.ChangeExtension(oDAPbuilder.Title, TIF_EXT); cbDisplayOptions.DataSource = Options.SectionPicture.DisplayOptionStrings; cbDisplayOptions.SelectedIndex = 0; oResolution.SetDownloadOptions(this); SetDefaultResolution(); }
/// <summary> /// Default constructor /// </summary> /// <param name="oDAPbuilder"></param> internal PictureWithoutResolution(Dapple.LayerGeneration.LayerBuilder oBuilder) : base(oBuilder as Dapple.LayerGeneration.DAPQuadLayerBuilder) { InitializeComponent(); m_oNonDapBuilder = oBuilder; cbDisplayOptions.DataSource = Options.Picture.DisplayOptionStrings; cbDisplayOptions.SelectedIndex = 0; tbFilename.Text = System.IO.Path.ChangeExtension(oBuilder.Title, TIF_EXT); }
/// <summary> /// Default constructor /// </summary> /// <param name="oDAPbuilder"></param> internal Document(Dapple.LayerGeneration.DAPQuadLayerBuilder oDAPbuilder) : base(oDAPbuilder) { InitializeComponent(); MainForm.MontajInterface.GetDocumentExtension(m_oDAPLayer.ServerURL, m_oDAPLayer.DatasetName, out m_szExtension); tbFilename.Text = System.IO.Path.ChangeExtension(oDAPbuilder.Title, m_szExtension); cbDownload.DataSource = Options.Document.DownloadOptionStrings; cbDownload.SelectedIndex = 0; }
/// <summary> /// Default constructor /// </summary> /// <param name="oDAPbuilder"></param> internal HyperMAP(Dapple.LayerGeneration.DAPQuadLayerBuilder oDAPbuilder) : base(oDAPbuilder) { InitializeComponent(); if (MainForm.MontajInterface.HostHasOpenMap() && !string.IsNullOrEmpty(MainForm.MapFileName)) { tbFilename.Text = System.IO.Path.GetFileName(MainForm.MapFileName); tbFilename.Enabled = false; } else { tbFilename.Text = System.IO.Path.ChangeExtension(oDAPbuilder.Title, MAP_EXT); } tbGroupName.Text = oDAPbuilder.Title; oResolution.SetDownloadOptions(this); SetDefaultResolution(); }
/// <summary> /// Constructor /// </summary> /// <param name="oDAPbuilder"></param> internal Generic(Dapple.LayerGeneration.DAPQuadLayerBuilder oDAPbuilder) : base(oDAPbuilder) { InitializeComponent(); }
/// <summary> /// Default constructor /// </summary> /// <param name="oDAPbuilder"></param> internal HyperXYZ(Dapple.LayerGeneration.DAPQuadLayerBuilder oDAPbuilder) : base(oDAPbuilder) { InitializeComponent(); tbFilename.Text = System.IO.Path.ChangeExtension(oDAPbuilder.Title, ExtensionForHXYZ); }
internal void SaveToView(Dapple.DappleView oView) { dappleview.serversType oServers = oView.View.Newservers(); m_oDAPRootNode.SaveToView(oServers); m_oTileRootNode.SaveToView(oServers); m_oVERootNode.SaveToView(oServers); dappleview.builderentryType oWMSBuilder = oServers.Newbuilderentry(); dappleview.builderdirectoryType oWMSDir = oWMSBuilder.Newbuilderdirectory(); oWMSDir.Addname(new Altova.Types.SchemaString("WMS Servers")); oWMSDir.Addspecialcontainer(new dappleview.SpecialDirectoryType("WMSServers")); m_oWMSRootNode.SaveToView(oWMSDir); m_oArcIMSRootNode.SaveToView(oWMSDir); oWMSBuilder.Addbuilderdirectory(oWMSDir); oServers.Addbuilderentry(oWMSBuilder); oView.View.Addservers(oServers); }
internal void SaveToView(Dapple.DappleView oView) { m_oRootNode.SaveToView(oView); if (m_oFavouriteServer != null) { oView.View.Addfavouriteserverurl(new Altova.Types.SchemaString(m_oFavouriteServer.Uri.ToString())); } }
internal void LoadFromView(Dapple.DappleView oSource) { lock (m_oLock) { ClearModel(); ServerModelNode oFavouriteServer = null; // --- Create favourite server Uri --- Uri oFavouriteServerUri = null; if (oSource.View.Hasfavouriteserverurl() && !String.IsNullOrEmpty(oSource.View.favouriteserverurl.Value)) { try { oFavouriteServerUri = new Uri(oSource.View.favouriteserverurl.Value); } catch (UriFormatException) { // --- The favourite server is invalid. Default to no favourite server --- } } // --- Load the servers --- if (oSource.View.Hasservers()) { for (int i = 0; i < oSource.View.servers.builderentryCount; i++) { dappleview.builderentryType entry = oSource.View.servers.GetbuilderentryAt(i); ServerModelNode temp = LoadBuilderEntryType(entry, oFavouriteServerUri); if (temp != null) oFavouriteServer = temp; } } if (oFavouriteServer != null) { SetFavouriteServer(oFavouriteServer, false); } else if (oSource.View.Hasfavouriteserverurl() && PersonalDapServerModelNode.PersonalDapRunning && oSource.View.favouriteserverurl.Value.Equals(Geosoft.GX.DAPGetData.Server.PERSONAL_DAP_URI)) { SetFavouriteServer(PersonalDapServer, false); } OnLoaded(EventArgs.Empty); } }
internal MainForm(string strView, string strGeoTiff, string strGeotiffName, bool bGeotiffTmp, string strKMLFile, string strKMLName, bool blKMLTmp, string strLastView, Dapple.Extract.Options.Client.ClientType eClientType, RemoteInterface oMRI, GeographicBoundingBox oAoi, string strAoiCoordinateSystem, string strMapFileName) { if (String.Compare(Path.GetExtension(strView), ViewExt, true) == 0 && File.Exists(strView)) this.openView = strView; m_strOpenGeoTiffFile = strGeoTiff; m_strOpenGeoTiffName = strGeotiffName; m_blOpenGeoTiffTmp = bGeotiffTmp; m_strOpenKMLFile = strKMLFile; m_strOpenKMLName = strKMLName; m_blOpenKMLTmp = blKMLTmp; this.lastView = strLastView; s_oMontajRemoteInterface = oMRI; // Establish the version number string used for user display, // such as the Splash and Help->About screens. // To change the Application.ProductVersion make the // changes in \WorldWind\AssemblyInfo.cs // For alpha/beta versions, include " alphaN" or " betaN" // at the end of the format string. Version ver = new Version(Application.ProductVersion); Release = string.Format(CultureInfo.InvariantCulture, "{0}.{1}.{2}", ver.Major, ver.Minor, ver.Build); if (ver.Build % 2 != 0) Release += " (BETA)"; // Name the main thread. System.Threading.Thread.CurrentThread.Name = ThreadNames.EventDispatch; // Copy/Update any configuration files and other files if needed now CurrentSettingsDirectory = Path.Combine(UserPath, "Config"); Directory.CreateDirectory(CurrentSettingsDirectory); Settings.CachePath = Path.Combine(UserPath, "Cache"); Directory.CreateDirectory(Settings.CachePath); this.metaviewerDir = Path.Combine(UserPath, "Metadata"); Directory.CreateDirectory(this.metaviewerDir); string[] cfgFiles = Directory.GetFiles(Path.Combine(DirectoryPath, "Config"), "*.xml"); foreach (string strCfgFile in cfgFiles) { string strUserCfg = Path.Combine(CurrentSettingsDirectory, Path.GetFileName(strCfgFile)); if (!File.Exists(strUserCfg)) File.Copy(strCfgFile, strUserCfg); } string[] metaFiles = Directory.GetFiles(Path.Combine(Path.Combine(DirectoryPath, "Data"), "MetaViewer"), "*.*"); foreach (string strMetaFile in metaFiles) { string strUserMeta = Path.Combine(this.metaviewerDir, Path.GetFileName(strMetaFile)); File.Copy(strMetaFile, strUserMeta, true); } // --- Set up a new user's favorites list and home view --- /*if (!File.Exists(Path.Combine(CurrentSettingsDirectory, "user.dapple_serverlist"))) { File.Copy(Path.Combine(Path.Combine(DirectoryPath, "Data"), "default.dapple_serverlist"), Path.Combine(CurrentSettingsDirectory, "user.dapple_serverlist")); }*/ HomeView.CreateDefault(); InitSettings(); if (Settings.NewCachePath.Length > 0) { try { // We want to make sure the new cache path is writable Directory.CreateDirectory(Settings.NewCachePath); if (Directory.Exists(Settings.CachePath)) Utility.FileSystem.DeleteFolderGUI(this, Settings.CachePath, "Deleting Existing Cache"); Settings.CachePath = Settings.NewCachePath; } catch { } Settings.NewCachePath = ""; } if (Settings.ConfigurationWizardAtStartup) { Wizard frm = new Wizard(Settings); frm.ShowDialog(this); Settings.ConfigurationWizardAtStartup = false; } if (Settings.ConfigurationWizardAtStartup) { // If the settings file doesn't exist, then we are using the // default settings, and the default is to show the Configuration // Wizard at startup. We only want that to happen the first time // World Wind is started, so change the setting to false(the user // can change it to true if they want). if (!File.Exists(Settings.FileName)) { Settings.ConfigurationWizardAtStartup = false; } ConfigurationWizard.Wizard wizard = new ConfigurationWizard.Wizard(Settings); wizard.TopMost = true; wizard.ShowInTaskbar = true; wizard.ShowDialog(); // TODO: should settings be saved now, in case of program crashes, // and so that XML file on disk matches in-memory settings? } //#if !DEBUG using (this.splashScreen = new Splash()) { this.splashScreen.Owner = this; this.splashScreen.Show(); Application.DoEvents(); //#endif // --- setup the list of images used for the different datatypes --- s_oImageList.ColorDepth = ColorDepth.Depth32Bit; s_oImageList.ImageSize = new Size(16, 16); s_oImageList.TransparentColor = Color.Transparent; s_oImageList.Images.Add(EnabledServerIconKey, Resources.enserver); s_oImageList.Images.Add(DisabledServerIconKey, Resources.disserver); s_oImageList.Images.Add(OfflineServerIconKey, Resources.offline); s_oImageList.Images.Add(DapIconKey, Resources.dap); s_oImageList.Images.Add(DapDatabaseIconKey, Resources.dap_database); s_oImageList.Images.Add(DapDocumentIconKey, Resources.dap_document); s_oImageList.Images.Add(DapGridIconKey, Resources.dap_grid); s_oImageList.Images.Add(DapMapIconKey, Resources.dap_map); s_oImageList.Images.Add(DapPictureIconKey, Resources.dap_picture); s_oImageList.Images.Add(DapPointIconKey, Resources.dap_point); s_oImageList.Images.Add(DapSpfIconKey, Resources.dap_spf); s_oImageList.Images.Add(DapVoxelIconKey, Resources.dap_voxel); s_oImageList.Images.Add(FolderIconKey, Resources.folder); s_oImageList.Images.Add(DapArcGisIconKey, global::Dapple.Properties.Resources.dap_arcgis); s_oImageList.Images.Add(KmlIconKey, Resources.kml); s_oImageList.Images.Add(ErrorIconKey, global::Dapple.Properties.Resources.error); s_oImageList.Images.Add(LayerIconKey, global::Dapple.Properties.Resources.layer); s_oImageList.Images.Add(LiveMapsIconKey, global::Dapple.Properties.Resources.live); s_oImageList.Images.Add(TileIconKey, global::Dapple.Properties.Resources.tile); s_oImageList.Images.Add(GeorefImageIconKey, global::Dapple.Properties.Resources.georef_image); s_oImageList.Images.Add(WmsIconKey, Resources.wms); s_oImageList.Images.Add(ArcImsIconKey, global::Dapple.Properties.Resources.arcims); s_oImageList.Images.Add(BlueMarbleIconKey, Dapple.Properties.Resources.blue_marble); s_oImageList.Images.Add(DesktopCatalogerIconKey, Dapple.Properties.Resources.dcat); c_oWorldWindow = new WorldWindow(); #if !DEBUG Utility.AbortUtility.ProgramAborting += new MethodInvoker(c_oWorldWindow.KillD3DAndWorkerThread); #endif c_oWorldWindow.AllowDrop = true; c_oWorldWindow.DragOver += new DragEventHandler(c_oWorldWindow_DragOver); c_oWorldWindow.DragDrop += new DragEventHandler(c_oWorldWindow_DragDrop); c_oWorldWindow.Resize += new EventHandler(c_oWorldWindow_Resize); InitializeComponent(); this.SuspendLayout(); c_oLayerList.ImageList = s_oImageList; /*#if DEBUG // --- Make the server tree HOOGE --- this.splitContainerMain.SplitterDistance = 400; this.splitContainerLeftMain.SplitterDistance = 400; #endif*/ this.Icon = new System.Drawing.Icon(@"app.ico"); DappleToolStripRenderer oTSR = new DappleToolStripRenderer(); c_tsSearch.Renderer = oTSR; c_tsLayers.Renderer = oTSR; c_tsOverview.Renderer = oTSR; c_tsMetadata.Renderer = oTSR; c_tsNavigation.Renderer = new BorderlessToolStripRenderer(); // set Upper and Lower limits for Cache size control, in bytes long CacheUpperLimit = (long)Settings.CacheSizeGigaBytes * 1024L * 1024L * 1024L; long CacheLowerLimit = (long)Settings.CacheSizeGigaBytes * 768L * 1024L * 1024L; //75% of upper limit try { Directory.CreateDirectory(Settings.CachePath); } catch { // We get here when people used a cache drive that since dissappeared (e.g. USB flash) // Revert to default cache directory in this case Settings.CachePath = Path.Combine(UserPath, "Cache"); Directory.CreateDirectory(Settings.CachePath); } //Set up the cache c_oWorldWindow.Cache = new Cache( Settings.CachePath, CacheLowerLimit, CacheUpperLimit, Settings.CacheCleanupInterval, Settings.TotalRunTime); #region Plugin + World Init. WorldWind.Terrain.TerrainTileService terrainTileService = new WorldWind.Terrain.TerrainTileService("http://worldwind25.arc.nasa.gov/wwelevation/wwelevation.aspx", "srtm30pluszip", 20, 150, "bil", 12, Path.Combine(Settings.CachePath, "Earth\\TerrainAccessor\\SRTM"), TimeSpan.FromMinutes(30), "Int16"); WorldWind.Terrain.TerrainAccessor terrainAccessor = new WorldWind.Terrain.NltTerrainAccessor("SRTM", -180, -90, 180, 90, terrainTileService, null); WorldWind.World world = new WorldWind.World("Earth", new Point3d(0, 0, 0), Quaternion4d.RotationYawPitchRoll(0, 0, 0), (float)6378137, System.IO.Path.Combine(c_oWorldWindow.Cache.CacheDirectory, "Earth"), terrainAccessor); c_oWorldWindow.CurrentWorld = world; c_oWorldWindow.DrawArgs.WorldCamera.CameraChanged += new EventHandler(c_oWorldWindow_CameraChanged); string strPluginsDir = Path.Combine(DirectoryPath, "Plugins"); this.scalebarPlugin = new NASA.Plugins.ScaleBarLegend(); this.scalebarPlugin.PluginLoad(this, strPluginsDir); this.scalebarPlugin.IsVisible = World.Settings.ShowScaleBar; this.starsPlugin = new Stars3D.Plugin.Stars3D(); this.starsPlugin.PluginLoad(this, Path.Combine(strPluginsDir, "Stars3D")); this.compassPlugin = new Murris.Plugins.Compass(); this.compassPlugin.PluginLoad(this, Path.Combine(strPluginsDir, "Compass")); String szGlobalCloudsCacheDir = Path.Combine(Settings.CachePath, @"Plugins\GlobalClouds"); Directory.CreateDirectory(szGlobalCloudsCacheDir); String szGlobalCloudsPluginDir = Path.Combine(CurrentSettingsDirectory, @"Plugins\GlobalClouds"); Directory.CreateDirectory(szGlobalCloudsPluginDir); if (!File.Exists(Path.Combine(szGlobalCloudsPluginDir, Murris.Plugins.GlobalCloudsLayer.serverListFileName))) { File.Copy(Path.Combine(Path.Combine(strPluginsDir, "GlobalClouds"), Murris.Plugins.GlobalCloudsLayer.serverListFileName), Path.Combine(szGlobalCloudsPluginDir, Murris.Plugins.GlobalCloudsLayer.serverListFileName)); } this.cloudsPlugin = new Murris.Plugins.GlobalClouds(szGlobalCloudsCacheDir); this.cloudsPlugin.PluginLoad(this, szGlobalCloudsPluginDir); this.skyPlugin = new Murris.Plugins.SkyGradient(); this.skyPlugin.PluginLoad(this, Path.Combine(strPluginsDir, "SkyGradient")); this.threeDConnPlugin = new ThreeDconnexion.Plugin.TDxWWInput(); this.threeDConnPlugin.PluginLoad(this, Path.Combine(strPluginsDir, "3DConnexion")); ThreadPool.QueueUserWorkItem(LoadPlacenames); c_scWorldMetadata.Panel1.Controls.Add(c_oWorldWindow); c_oWorldWindow.Dock = DockStyle.Fill; #endregion float[] verticalExaggerationMultipliers = { 0.0f, 1.0f, 1.5f, 2.0f, 3.0f, 5.0f, 7.0f, 10.0f }; foreach (float multiplier in verticalExaggerationMultipliers) { ToolStripMenuItem curItem = new ToolStripMenuItem(multiplier.ToString("f1", System.Threading.Thread.CurrentThread.CurrentCulture) + "x", null, new EventHandler(menuItemVerticalExaggerationChange)); c_miVertExaggeration.DropDownItems.Add(curItem); curItem.CheckOnClick = true; if (Math.Abs(multiplier - World.Settings.VerticalExaggeration) < 0.1f) curItem.Checked = true; } this.c_miShowCompass.Checked = World.Settings.ShowCompass; this.c_miShowDLProgress.Checked = World.Settings.ShowDownloadIndicator; this.c_miShowCrosshair.Checked = World.Settings.ShowCrosshairs; this.c_miShowInfoOverlay.Checked = World.Settings.ShowPosition; this.c_miShowGridlines.Checked = World.Settings.ShowLatLonLines; this.c_miShowGlobalClouds.Checked = World.Settings.ShowClouds; if (World.Settings.EnableSunShading) { if (!World.Settings.SunSynchedWithTime) this.c_miSunshadingEnabled.Checked = true; else this.c_miSunshadingSync.Checked = true; } else this.c_miSunshadingDisabled.Checked = true; this.c_miShowAtmoScatter.Checked = World.Settings.EnableAtmosphericScattering; this.c_miAskLastViewAtStartup.Checked = Settings.AskLastViewAtStartup; if (!Settings.AskLastViewAtStartup) this.c_miOpenLastViewAtStartup.Checked = Settings.LastViewAtStartup; #region OverviewPanel // Fix: earlier versions of Dapple set the DataPath as an absolute reference, so if Dapple was uninstalled, OMapple could not find // the file for the overview control. To fix this, switch the variable to a relative reference if the absolute one doesn't resolve. // Dapple will still work; the relative reference will be from whatever directory Dapple is being run. if (!Directory.Exists(Settings.DataPath)) Settings.DataPath = "Data"; #endregion c_oWorldWindow.MouseEnter += new EventHandler(this.c_oWorldWindow_MouseEnter); c_oWorldWindow.MouseLeave += new EventHandler(this.c_oWorldWindow_MouseLeave); c_oOverview.AOISelected += new Overview.AOISelectedDelegate(c_oOverview_AOISelected); #region Search view setup this.c_oServerList = new ServerList(); m_oModel = new DappleModel(c_oLayerList); m_oModel.SelectedNodeChanged += new EventHandler(m_oModel_SelectedNodeChanged); c_oLayerList.Attach(m_oModel); NewServerTree.View.ServerTree newServerTree = new NewServerTree.View.ServerTree(); newServerTree.Attach(m_oModel); c_oServerList.Attach(m_oModel); c_oLayerList.LayerSelectionChanged += new EventHandler(c_oLayerList_LayerSelectionChanged); m_oMetadataDisplay = new MetadataDisplayThread(this); m_oMetadataDisplay.AddBuilder(null); c_oServerList.LayerList = c_oLayerList; c_oLayerList.GoTo += new LayerList.GoToHandler(this.GoTo); c_oLayerList.ViewMetadata += new ViewMetadataHandler(m_oMetadataDisplay.AddBuilder); c_oServerList.ViewMetadata += new ViewMetadataHandler(m_oMetadataDisplay.AddBuilder); c_oServerList.LayerSelectionChanged += new EventHandler(c_oServerList_LayerSelectionChanged); this.cServerViewsTab = new JanaTab(); this.cServerViewsTab.SetImage(0, Resources.tab_tree); this.cServerViewsTab.SetImage(1, Resources.tab_list); this.cServerViewsTab.SetToolTip(0, "Server tree view"); this.cServerViewsTab.SetToolTip(1, "Server list view"); this.cServerViewsTab.SetNameAndText(0, "TreeView"); this.cServerViewsTab.SetNameAndText(1, "ListView"); this.cServerViewsTab.SetPage(0, newServerTree); this.cServerViewsTab.SetPage(1, this.c_oServerList); cServerViewsTab.PageChanged += new JanaTab.PageChangedDelegate(ServerPageChanged); c_oDappleSearch = new DappleSearchList(); c_oDappleSearch.LayerSelectionChanged += new EventHandler(c_oDappleSearch_LayerSelectionChanged); c_oDappleSearch.Attach(m_oModel, c_oLayerList); c_tcSearchViews.TabPages[0].Controls.Add(cServerViewsTab); cServerViewsTab.Dock = DockStyle.Fill; c_tcSearchViews.TabPages[1].Controls.Add(c_oDappleSearch); c_oDappleSearch.Dock = DockStyle.Fill; c_oLayerList.SetBaseLayer(new BlueMarbleBuilder()); this.ResumeLayout(false); #endregion this.PerformLayout(); while (!this.splashScreen.IsDone) System.Threading.Thread.Sleep(50); // Force initial render to avoid showing random contents of frame buffer to user. c_oWorldWindow.Render(); WorldWindow.Focus(); #region OM Forked Process configuration if (IsRunningAsDapClient) { c_oLayerList.OMFeaturesEnabled = true; this.MinimizeBox = false; if (oAoi != null && !string.IsNullOrEmpty(strAoiCoordinateSystem)) { s_oOMMapExtentNative = oAoi; s_strAoiCoordinateSystem = strAoiCoordinateSystem; s_strOpenMapFileName = strMapFileName; s_oOMMapExtentWGS84 = s_oOMMapExtentNative.Clone() as GeographicBoundingBox; s_oMontajRemoteInterface.ProjectBoundingRectangle(strAoiCoordinateSystem, ref s_oOMMapExtentWGS84.West, ref s_oOMMapExtentWGS84.South, ref s_oOMMapExtentWGS84.East, ref s_oOMMapExtentWGS84.North, Dapple.Extract.Resolution.WGS_84); } s_eClientType = eClientType; c_miLastView.Enabled = false; c_miLastView.Visible = false; c_miDappleHelp.Visible = false; c_miDappleHelp.Enabled = false; toolStripSeparator10.Visible = false; c_miOpenImage.Visible = false; c_miOpenImage.Enabled = false; c_miOpenKeyhole.Visible = false; c_miOpenKeyhole.Enabled = false; // Hide and disable the file menu c_miFile.Visible = false; c_miFile.Enabled = false; c_miOpenSavedView.Visible = false; c_miOpenSavedView.Enabled = false; c_miOpenHomeView.Visible = false; c_miOpenHomeView.Enabled = false; c_miSetHomeView.Visible = false; c_miSetHomeView.Enabled = false; c_miSaveView.Visible = false; c_miSaveView.Enabled = false; c_miSendViewTo.Visible = false; c_miSendViewTo.Enabled = false; c_miOpenKeyhole.Visible = false; c_miOpenKeyhole.Enabled = false; // Show the OM help menu c_miGetDatahelp.Enabled = true; c_miGetDatahelp.Visible = true; // Don't let the user check for updates. EVER. c_miCheckForUpdates.Visible = false; c_miCheckForUpdates.Enabled = false; } else { c_miExtractLayers.Visible = false; c_miExtractLayers.Enabled = false; } #endregion loadCountryList(); populateAoiComboBox(); LoadMRUList(); CenterNavigationToolStrip(); //#if !DEBUG c_tbSearchKeywords.Text = NO_SEARCH; } //#endif }
/// <summary> /// Default constructor /// </summary> /// <param name="oDAPbuilder"></param> internal PictureWithoutResolution(Dapple.LayerGeneration.DAPQuadLayerBuilder oDAPbuilder) : this(oDAPbuilder as Dapple.LayerGeneration.LayerBuilder) { }
/// <summary> /// Create the correct control for this dataset /// </summary> /// <param name="oContainer"></param> /// <returns></returns> private DownloadOptions CreateUserControl(Dapple.LayerGeneration.LayerBuilder oBuilder) { if (!WorldWind.GeographicBoundingBox.FromQuad(MainForm.WorldWindowSingleton.CurrentAreaOfInterest).Intersects(oBuilder.Extents)) { return new Disabled("This data layer cannot be " + GetExtractionVerb(oBuilder) + "ed. View the data layer extents within the currently viewed area and try again."); } DownloadOptions oControl = null; if (oBuilder is Dapple.LayerGeneration.DAPQuadLayerBuilder) { Dapple.LayerGeneration.DAPQuadLayerBuilder oDAPbuilder = (Dapple.LayerGeneration.DAPQuadLayerBuilder)oBuilder; double dummy1 = 0, dummy2 = 0, dummy3 = 0, dummy4 = 0; if (MainForm.MontajInterface.GetExtents(oDAPbuilder.ServerURL, oDAPbuilder.DatasetName, out dummy1, out dummy2, out dummy3, out dummy4) == false) { return new Disabled("This data layer will not be extracted because its metadata could not be accessed. This usually indicates that you do not have the required permissions to access it."); } if (oDAPbuilder.IsFromPersonalDapServer) { if (MainForm.Client == Options.Client.ClientType.ArcMAP && oDAPbuilder.DAPType.Equals("spf", StringComparison.OrdinalIgnoreCase) && oDAPbuilder.LocalFilename.EndsWith("(TAB)", StringComparison.OrdinalIgnoreCase)) { return new Disabled("This data layer will not be opened because TAB files are not supported in ArcMap."); } oControl = new PersonalDataset(oDAPbuilder); oControl.ErrorProvider = cErrorProvider; return oControl; } if (oDAPbuilder.DAPType.ToLower() == "map") { oControl = new HyperMAP(oDAPbuilder); } else if (oDAPbuilder.DAPType.ToLower() == "grid") { oControl = new Grid(oDAPbuilder); } else if (oDAPbuilder.DAPType.ToLower() == "picture") { oControl = new Picture(oDAPbuilder); } else if (oDAPbuilder.DAPType.ToLower() == "point") { oControl = new HyperXYZ(oDAPbuilder); } else if (oDAPbuilder.DAPType.ToLower() == "database") { oControl = new Database(oDAPbuilder); } else if (oDAPbuilder.DAPType.ToLower() == "document") { oControl = new Document(oDAPbuilder); } else if (oDAPbuilder.DAPType.ToLower() == "spf") { oControl = new GIS(oDAPbuilder); } else if (oDAPbuilder.DAPType.ToLower() == "generic") { if (MainForm.Client != Options.Client.ClientType.MapInfo) { oControl = new Generic(oDAPbuilder); } else { oControl = new Disabled("This data layer will not be extracted as acQuire connections are not a supported format in MapInfo."); } } else if (oDAPbuilder.DAPType.ToLower() == "voxel") { if (MainForm.Client != Options.Client.ClientType.MapInfo) { oControl = new Voxel(oDAPbuilder); } else { oControl = new Disabled("This data layer will not be extracted as voxel is not a supported format in MapInfo."); } } else if (oDAPbuilder.DAPType.ToLower() == "arcgis") { if (MainForm.Client != Options.Client.ClientType.MapInfo) { oControl = new ArcGIS(oDAPbuilder); } else { oControl = new Disabled("This data layer will not be extracted as LYR is not a supported format in MapInfo."); } } else if (oDAPbuilder.DAPType.ToLower() == "imageserver") { oControl = new PictureWithoutResolution(oDAPbuilder); } else if (oDAPbuilder.DAPType.ToLower() == "picturesection") { oControl = new SectionPicture(oDAPbuilder); } else if (oDAPbuilder.DAPType.ToLower() == "gridsection") { oControl = new SectionGrid(oDAPbuilder); } } else if (oBuilder is KML.KMLLayerBuilder) { oControl = new Disabled("This data layer will not be extracted as KML extraction is not currently supported."); } else { oControl = new PictureWithoutResolution(oBuilder); } if (oControl != null) oControl.ErrorProvider = cErrorProvider; return oControl; }
private static string GetExtractionVerb(Dapple.LayerGeneration.LayerBuilder oBuilder) { if (oBuilder is Dapple.LayerGeneration.DAPQuadLayerBuilder && (oBuilder as Dapple.LayerGeneration.DAPQuadLayerBuilder).IsFromPersonalDapServer) { return "open"; } return "extract"; }