/// <summary> /// Occurs when this command is created /// </summary> /// <param name="hook">Instance of the application</param> public override void OnCreate(object hook) { if (hook == null) { return; } try { m_globeHookHelper = new GlobeHookHelperClass(); m_globeHookHelper.Hook = hook; pToolbarControl = hook as IToolbarControl; //if (m_globeHookHelper.ActiveViewer == null) //{ // m_globeHookHelper = null; //} } catch { m_globeHookHelper = null; } if (m_globeHookHelper == null) { base.m_enabled = false; } else { base.m_enabled = true; } // TODO: Add other initialization code }
/// <summary> /// Occurs when this command is created /// </summary> /// <param name="hook">Instance of the application</param> public override void OnCreate(object hook) { //Instantiate the hook helper if (null == m_globeHookHelper) { m_globeHookHelper = new GlobeHookHelperClass(); } //set the hook m_globeHookHelper.Hook = hook; //get the relevant members IGlobe globe = m_globeHookHelper.Globe; m_scene = globe as IScene; m_globeDsp = m_globeHookHelper.GlobeDisplay; m_globeViewUtil = m_globeHookHelper.Camera as IGlobeViewUtil; //connect to the ZipCodes featureclass //get the ArcGIS path from the registry String versionNumber = RuntimeManager.ActiveRuntime.Version; RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\ESRI\ArcObjectsSdk" + versionNumber); string path = Convert.ToString(key.GetValue("InstallDir")); path = System.IO.Path.Combine(path, @"Samples\data\USZipCodeData"); IWorkspaceFactory wf = new ShapefileWorkspaceFactoryClass() as IWorkspaceFactory; IWorkspace ws = wf.OpenFromFile(path, 0); IFeatureWorkspace fw = ws as IFeatureWorkspace; m_featureClass = fw.OpenFeatureClass("US_ZipCodes"); }
/// <summary> /// Occurs when this command is created /// </summary> /// <param name="hook">Instance of the application</param> public override void OnCreate(object hook) { if (hook == null) return; try { m_globeHookHelper = new GlobeHookHelperClass(); m_globeHookHelper.Hook = hook; if (m_globeHookHelper.ActiveViewer == null) { m_globeHookHelper = null; } } catch { m_globeHookHelper = null; } if (m_globeHookHelper == null) base.m_enabled = false; else base.m_enabled = true; // TODO: Add other initialization code }
public override void OnCreate(object hook) { if (hook == null) { return; } try { m_globeHookHelper = new GlobeHookHelperClass(); m_globeHookHelper.Hook = hook; if (m_globeHookHelper.ActiveViewer == null) { m_globeHookHelper = null; } } catch { m_globeHookHelper = null; } if (m_globeHookHelper == null) { base.m_enabled = false; } else { base.m_enabled = true; } m_DialogSaveGlobe = new SaveFileDialog(); m_DialogSaveGlobe.Filter = "Globe场景(*.3dd) |*.3dd"; }
/// <summary> /// Occurs when this command is created /// </summary> /// <param name="hook">Instance of the application</param> public override void OnCreate(object hook) { //initialize the hook-helper if (m_globeHookHelper == null) { m_globeHookHelper = new GlobeHookHelper(); } //set the hook m_globeHookHelper.Hook = hook; //get the ArcGIS path from the registry RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\ESRI\ArcObjectsSDK10.2"); string path = Convert.ToString(key.GetValue("InstallDir")); //set the path to the featureclass used by the GPS simulator m_shapefileName = System.IO.Path.Combine(path, "Samples\\data\\USAMajorHighways\\usa_major_highways.shp"); //get the GlobeDisplsy from the hook helper m_globeDisplay = m_globeHookHelper.GlobeDisplay; //initialize the real-time manager if (null == m_realTimeFeedManager) { m_realTimeFeedManager = new RealTimeFeedManagerClass(); } //use the built in simulator of the real-time manager m_realTimeFeedManager.RealTimeFeed = m_realTimeFeedManager.RealTimeFeedSimulator as IRealTimeFeed; m_realTimeFeed = m_realTimeFeedManager.RealTimeFeed; }
public override void OnCreate(object hook) { if (hook == null) { return; } try { m_globeHookHelper = new GlobeHookHelperClass(); m_globeHookHelper.Hook = hook; if (m_globeHookHelper.ActiveViewer == null) { m_globeHookHelper = null; } } catch { m_globeHookHelper = null; } if (m_globeHookHelper == null) { base.m_enabled = false; } else { base.m_enabled = true; } m_DialogDem.Filter = "所有类型(*.img;*.dem;*.tif;*.ovr;*.sid) | *.img;*.dem;*.tif;*.ovr;*.sid"; // TODO: Add other initialization code }
/// <summary> /// Occurs when this command is created /// </summary> /// <param name="hook">Instance of the application</param> public override void OnCreate(object hook) { //Instantiate the hook helper if (null == m_globeHookHelper) { m_globeHookHelper = new GlobeHookHelperClass(); } //set the hook m_globeHookHelper.Hook = hook; //get the relevant members IGlobe globe = m_globeHookHelper.Globe; m_scene = globe as IScene; m_globeDsp = m_globeHookHelper.GlobeDisplay; m_globeViewUtil = m_globeHookHelper.Camera as IGlobeViewUtil; //connect to the ZipCodes featureclass string path = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); path = System.IO.Path.Combine(path, @"ArcGIS\data\USZipCodeData"); if (!Directory.Exists(path)) { throw new Exception(string.Format("Fix code to point to your sample data: {0} was not found", path)); } IWorkspaceFactory wf = new ShapefileWorkspaceFactoryClass() as IWorkspaceFactory; IWorkspace ws = wf.OpenFromFile(path, 0); IFeatureWorkspace fw = ws as IFeatureWorkspace; m_featureClass = fw.OpenFeatureClass("US_ZipCodes"); }
/// <summary> /// Occurs when this command is created /// </summary> /// <param name="hook">Instance of the application</param> public override void OnCreate(object hook) { if (null == m_globeHookHelper) { m_globeHookHelper = new GlobeHookHelperClass(); } m_globeHookHelper.Hook = hook; m_scene = m_globeHookHelper.Globe as IScene; }
/// <summary> /// Occurs when this command is created /// </summary> /// <param name="hook">Instance of the application</param> public override void OnCreate(object hook) { //Instantiate the hook helper if (null == m_globeHookHelper) { m_globeHookHelper = new GlobeHookHelperClass(); } //set the hook m_globeHookHelper.Hook = hook; m_bConnected = false; }
/// <summary> /// Occurs when this command is created /// </summary> /// <param name="hook">Instance of the application</param> public override void OnCreate(object hook) { //Instantiate the hook helper if (null == m_globeHookHelper) { m_globeHookHelper = new GlobeHookHelperClass(); } //set the hook m_globeHookHelper.Hook = hook; m_scene = m_globeHookHelper.Globe as IScene; }
/// <summary> /// Occurs when this command is created /// </summary> /// <param name="hook">Instance of the application</param> public override void OnCreate(object hook) { if (hook == null) { return; } // Test the hook that calls this command and disable if nothing is valid try { m_hookHelper = new HookHelperClass(); m_hookHelper.Hook = hook; if (m_hookHelper.ActiveView == null) { m_hookHelper = null; } } catch { m_hookHelper = null; } if (m_hookHelper == null) { //Can be globe try { m_globeHookHelper = new GlobeHookHelperClass(); m_globeHookHelper.Hook = hook; if (m_globeHookHelper.ActiveViewer == null) { m_globeHookHelper = null; } } catch { m_globeHookHelper = null; } } if (m_globeHookHelper == null && m_hookHelper == null) { base.m_enabled = false; } else { base.m_enabled = true; } //TODO: Add other initialization code }
public override void OnCreate(object hook) { // Test the hook that calls this command and disable if nothing valid try { m_hookHelper = new HookHelperClass(); m_hookHelper.Hook = hook; if (m_hookHelper.ActiveView == null) { m_hookHelper = null; } } catch { m_hookHelper = null; } if (m_hookHelper == null) { //Can be globe try { m_globeHookHelper = new GlobeHookHelperClass(); m_globeHookHelper.Hook = hook; if (m_globeHookHelper.ActiveViewer == null) { //Nothing valid! m_globeHookHelper = null; } } catch { m_globeHookHelper = null; } } if (m_globeHookHelper == null && m_hookHelper == null) { base.m_enabled = false; } else { base.m_enabled = true; } }
/// <summary> /// Occurs when this command is created /// </summary> /// <param name="hook">Instance of the application</param> public override void OnCreate(object hook) { //initialize the hook-helper if (m_globeHookHelper == null) { m_globeHookHelper = new GlobeHookHelper(); } //set the hook m_globeHookHelper.Hook = hook; //set the path to the featureclass used by the GPS simulator string path = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); m_shapefileName = System.IO.Path.Combine(path, @"ArcGIS\data\USAMajorHighways\usa_major_highways.shp"); System.Diagnostics.Debug.WriteLine(string.Format("File path for data root: {0}", m_shapefileName)); if (!File.Exists(m_shapefileName)) { throw new Exception(string.Format("Fix code to point to your sample data: {0} was not found", m_shapefileName)); } //get the GlobeDisplsy from the hook helper m_globeDisplay = m_globeHookHelper.GlobeDisplay; //initialize the real-time manager if (null == m_realTimeFeedManager) { m_realTimeFeedManager = new RealTimeFeedManagerClass(); } //use the built in simulator of the real-time manager m_realTimeFeedManager.RealTimeFeed = m_realTimeFeedManager.RealTimeFeedSimulator as IRealTimeFeed; m_realTimeFeed = m_realTimeFeedManager.RealTimeFeed; }
/// <summary> /// Occurs when this command is created /// </summary> /// <param name="hook">Instance of the application</param> public override void OnCreate(object hook) { if (null == m_globeHookHelper) m_globeHookHelper = new GlobeHookHelperClass(); m_globeHookHelper.Hook = hook; m_scene = m_globeHookHelper.Globe as IScene; }
public override void OnCreate(object hook) { // Test the hook that calls this command and disable if nothing valid try { m_hookHelper = new HookHelperClass(); m_hookHelper.Hook = hook; if (m_hookHelper.ActiveView == null) { m_hookHelper = null; } } catch { m_hookHelper = null; } if (m_hookHelper == null) { //Can be globe try { m_globeHookHelper = new GlobeHookHelperClass(); m_globeHookHelper.Hook = hook; if (m_globeHookHelper.ActiveViewer == null) { //Nothing valid! m_globeHookHelper = null; } } catch { m_globeHookHelper = null; } } if (m_globeHookHelper == null && m_hookHelper == null) base.m_enabled = false; else base.m_enabled = true; }
/// <summary> /// Occurs when this command is created /// </summary> /// <param name="hook">Instance of the application</param> public override void OnCreate(object hook) { //Instantiate the hook helper if (null == m_globeHookHelper) m_globeHookHelper = new GlobeHookHelperClass(); //set the hook m_globeHookHelper.Hook = hook; m_bConnected = false; }
/// <summary> /// Occurs when this command is created /// </summary> /// <param name="hook">Instance of the application</param> public override void OnCreate(object hook) { if (hook == null) { return; } // Test the hook that calls this command and disable if nothing is valid try { m_hookHelper = new HookHelperClass(); m_hookHelper.Hook = hook; if (m_hookHelper.ActiveView == null) { m_hookHelper = null; } } catch { m_hookHelper = null; } if (m_hookHelper == null) { //Can be scene or globe try { m_sceneHookHelper = new SceneHookHelperClass(); m_sceneHookHelper.Hook = hook; if (m_sceneHookHelper.ActiveViewer == null) { m_sceneHookHelper = null; } } catch { m_sceneHookHelper = null; } if (m_sceneHookHelper == null) { //Can be globe try { m_globeHookHelper = new GlobeHookHelperClass(); m_globeHookHelper.Hook = hook; if (m_globeHookHelper.ActiveViewer == null) { m_globeHookHelper = null; } } catch { m_globeHookHelper = null; } } } if (m_globeHookHelper == null && m_sceneHookHelper == null && m_hookHelper == null) { base.m_enabled = false; } else { base.m_enabled = true; } m_pMapControl = (IMapControl3)m_hookHelper.Hook; }
/// <summary> /// Occurs when this command is created /// </summary> /// <param name="hook">Instance of the application</param> public override void OnCreate(object hook) { if (hook == null) return; // Test the hook that calls this command and disable if nothing is valid try { m_hookHelper = new HookHelperClass(); m_hookHelper.Hook = hook; if (m_hookHelper.ActiveView == null) { m_hookHelper = null; } } catch { m_hookHelper = null; } if (m_hookHelper == null) { //Can be scene or globe try { m_sceneHookHelper = new SceneHookHelperClass(); m_sceneHookHelper.Hook = hook; if (m_sceneHookHelper.ActiveViewer == null) { m_sceneHookHelper = null; } } catch { m_sceneHookHelper = null; } if (m_sceneHookHelper == null) { //Can be globe try { m_globeHookHelper = new GlobeHookHelperClass(); m_globeHookHelper.Hook = hook; if (m_globeHookHelper.ActiveViewer == null) { m_globeHookHelper = null; } } catch { m_globeHookHelper = null; } } } if (m_globeHookHelper == null && m_sceneHookHelper == null && m_hookHelper == null) base.m_enabled = false; else base.m_enabled = true; //TODO: Add other initialization code }
/// <summary> /// Occurs when this command is created /// </summary> /// <param name="hook">Instance of the application</param> public override void OnCreate(object hook) { //Instantiate the hook helper if (null == m_globeHookHelper) m_globeHookHelper = new GlobeHookHelperClass(); //set the hook m_globeHookHelper.Hook = hook; m_scene = m_globeHookHelper.Globe as IScene; }
/// <summary> /// Occurs when this command is created /// </summary> /// <param name="hook">Instance of the application</param> public override void OnCreate(object hook) { if (hook == null) { return; } m_application = hook as IApplication; //Disable if it is not ArcMap if (hook is IMxApplication) { base.m_enabled = true; } else { base.m_enabled = false; } try { m_hookHelper = new HookHelperClass(); m_hookHelper.Hook = hook; if (m_hookHelper.ActiveView == null) { m_hookHelper = null; } } catch { m_hookHelper = null; } if (m_hookHelper == null) { //Can be scene or globe try { m_sceneHookHelper = new SceneHookHelperClass(); m_sceneHookHelper.Hook = hook; if (m_sceneHookHelper.ActiveViewer == null) { m_sceneHookHelper = null; } } catch { m_sceneHookHelper = null; } if (m_sceneHookHelper == null) { //Can be globe try { m_globeHookHelper = new GlobeHookHelperClass(); m_globeHookHelper.Hook = hook; if (m_globeHookHelper.ActiveViewer == null) { m_globeHookHelper = null; } } catch { m_globeHookHelper = null; } } } if (m_globeHookHelper == null && m_sceneHookHelper == null && m_hookHelper == null) { base.m_enabled = false; } else { base.m_enabled = true; } }
/// <summary> /// Occurs when this command is created /// </summary> /// <param name="hook">Instance of the application</param> public override void OnCreate(object hook) { if (hook == null) return; try { m_globeHookHelper = new GlobeHookHelperClass(); m_globeHookHelper.Hook = hook; if (m_globeHookHelper.ActiveViewer == null) { m_globeHookHelper = null; } } catch { m_globeHookHelper = null; } if (m_globeHookHelper == null) base.m_enabled = false; else base.m_enabled = true; m_DialogOpenGlobe = new OpenFileDialog(); m_DialogOpenGlobe.Filter = "Globe场景(*.3dd) |*.3dd"; }
/// <summary> /// Occurs when this command is created /// </summary> /// <param name="hook">Instance of the application</param> public override void OnCreate(object hook) { //Instantiate the hook helper if (null == m_globeHookHelper) m_globeHookHelper = new GlobeHookHelperClass(); //set the hook m_globeHookHelper.Hook = hook; //get the relevant members IGlobe globe = m_globeHookHelper.Globe; m_scene = globe as IScene; m_globeDsp = m_globeHookHelper.GlobeDisplay; m_globeViewUtil = m_globeHookHelper.Camera as IGlobeViewUtil; //connect to the ZipCodes featureclass //get the ArcGIS path from the registry String versionNumber = RuntimeManager.ActiveRuntime.Version; RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\ESRI\ArcObjectsSdk" + versionNumber); string path = Convert.ToString(key.GetValue("InstallDir")); path = System.IO.Path.Combine(path, @"Samples\data\USZipCodeData"); IWorkspaceFactory wf = new ShapefileWorkspaceFactoryClass() as IWorkspaceFactory; IWorkspace ws = wf.OpenFromFile(path, 0); IFeatureWorkspace fw = ws as IFeatureWorkspace; m_featureClass = fw.OpenFeatureClass("US_ZipCodes"); }
public override void OnCreate(object hook) { if (hook == null) return; try { m_globeHookHelper = new GlobeHookHelperClass(); m_globeHookHelper.Hook = hook; if (m_globeHookHelper.ActiveViewer == null) { m_globeHookHelper = null; } } catch { m_globeHookHelper = null; } if (m_globeHookHelper == null) base.m_enabled = false; else base.m_enabled = true; m_DialogDem.Filter = "所有类型(*.img;*.dem;*.tif;*.ovr;*.sid) | *.img;*.dem;*.tif;*.ovr;*.sid"; // TODO: Add other initialization code }
/// <summary> /// Occurs when this command is created /// </summary> /// <param name="hook">Instance of the application</param> public override void OnCreate(object hook) { //initialize the hook-helper if (m_globeHookHelper == null) m_globeHookHelper = new GlobeHookHelper(); //set the hook m_globeHookHelper.Hook = hook; //get the ArcGIS path from the registry RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\ESRI\ArcObjectsSDK10.2"); string path = Convert.ToString(key.GetValue("InstallDir")); //set the path to the featureclass used by the GPS simulator m_shapefileName = System.IO.Path.Combine(path, "Samples\\data\\USAMajorHighways\\usa_major_highways.shp"); //get the GlobeDisplsy from the hook helper m_globeDisplay = m_globeHookHelper.GlobeDisplay; //initialize the real-time manager if (null == m_realTimeFeedManager) m_realTimeFeedManager = new RealTimeFeedManagerClass(); //use the built in simulator of the real-time manager m_realTimeFeedManager.RealTimeFeed = m_realTimeFeedManager.RealTimeFeedSimulator as IRealTimeFeed; m_realTimeFeed = m_realTimeFeedManager.RealTimeFeed; }