/// <summary>
        /// Occurs when this command is created
        /// </summary>
        /// <param name="hook">Instance of the application</param>
        public override void OnCreate(object hook)
        {
            try
            {
                if (hook == null)
                {
                    return;
                }

                m_application          = hook as IApplication;
                m_sceneHookHelper      = new SceneHookHelperClass();
                m_sceneHookHelper.Hook = hook;
                if (m_sceneHookHelper.ActiveViewer == null)
                {
                    m_sceneHookHelper = null;
                }

                if (m_sceneHookHelper == null)
                {
                    base.m_enabled = false;
                }
                else
                {
                    base.m_enabled = true;
                }
            }
            catch (Exception err)
            {
                m_sceneHookHelper = null;
                MessageBox.Show(err.ToString());
            }

            // TODO:  Add other initialization code
        }
Example #2
0
        /// <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_sceneHookHelper = new SceneHookHelperClass();
                m_sceneHookHelper.Hook = hook;
                if (m_sceneHookHelper.ActiveViewer == null)
                {
                    m_sceneHookHelper = null;
                }
            }
            catch
            {
                m_sceneHookHelper = null;
            }

            if (m_sceneHookHelper == null)
                base.m_enabled = false;
            else
                base.m_enabled = true;

            // TODO:  Add other initialization code
        }
Example #3
0
        /// <summary>
        /// Occurs when this tool is created
        /// </summary>
        /// <param name="hook">Instance of the application</param>
        public override void OnCreate(object hook)
        {
            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)
            {
                base.m_enabled = false;
            }
            else
            {
                base.m_enabled = true;
            }

            // TODO:  Add other initialization code
        }
Example #4
0
        public FullExtent()
        {
            base.m_category = "Sample_SceneControl(C#)";
            base.m_caption  = "Full Extent";
            base.m_toolTip  = "Full Extent";
            base.m_name     = "Sample_SceneControl(C#)/FullExtent";
            base.m_message  = "Displays the scene at full extent";

            //Load resources
            string[] res = GetType().Assembly.GetManifestResourceNames();
            if (res.GetLength(0) > 0)
            {
                base.m_bitmap = new System.Drawing.Bitmap(GetType().Assembly.GetManifestResourceStream("sceneTools.fullextent.bmp"));
            }
            m_pSceneHookHelper = new SceneHookHelperClass();
        }
Example #5
0
        public NarrowFOV()
        {
            base.m_category = "Sample_SceneControl(C#)";
            base.m_caption  = "Narrow Field of View";
            base.m_toolTip  = "Narrow Field of View";
            base.m_name     = "Sample_SceneControl(C#)/Narrow Field of View";
            base.m_message  = "Narrow the Field of View";

            //Load resources
            string[] res = GetType().Assembly.GetManifestResourceNames();
            if (res.GetLength(0) > 0)
            {
                base.m_bitmap = new System.Drawing.Bitmap(GetType().Assembly.GetManifestResourceStream("LTE.GIS.SceneTool.narrow.bmp"));
            }
            m_pSceneHookHelper = new SceneHookHelperClass();
        }
Example #6
0
        public TargetCenter()
        {
            base.m_category = "Sample_SceneControl(C#)";
            base.m_caption  = "Target Center";
            base.m_toolTip  = "Center on Target";
            base.m_name     = "Sample_SceneControl(C#)/TargetCenter";
            base.m_message  = "Center view at selected target";

            //Load resources
            string[] res = GetType().Assembly.GetManifestResourceNames();
            if (res.GetLength(0) > 0)
            {
                base.m_bitmap = new System.Drawing.Bitmap(GetType().Assembly.GetManifestResourceStream("LTE.GIS.SceneTool.TargetCenter.bmp"));
            }
            m_pCursor = new System.Windows.Forms.Cursor(GetType().Assembly.GetManifestResourceStream("LTE.GIS.SceneTool.targetcenter.cur"));

            m_pSceneHookHelper = new SceneHookHelperClass();
        }
        public ZoomOut()
        {
            base.m_category = "Sample_SceneControl(C#)";
            base.m_caption  = "Zoom Out";
            base.m_toolTip  = "Zoom Out";
            base.m_name     = "Sample_SceneControl(C#)/Zoom Out";
            base.m_message  = "Zooms in out the scene";

            //Load resources
            string[] res = GetType().Assembly.GetManifestResourceNames();
            if (res.GetLength(0) > 0)
            {
                base.m_bitmap = new System.Drawing.Bitmap(GetType().Assembly.GetManifestResourceStream("sceneTools.zoomout.bmp"));
            }
            m_pCursor = new System.Windows.Forms.Cursor(GetType().Assembly.GetManifestResourceStream("sceneTools.ZOOMOUT.CUR"));

            m_pSceneHookHelper = new SceneHookHelperClass();
        }
Example #8
0
        public SelectFeatures()
        {
            base.m_category = "Sample_SceneControl(C#)";
            base.m_caption  = "Select Features";
            base.m_toolTip  = "Select Features";
            base.m_name     = "Sample_SceneControl(C#)/SelectFeatures";
            base.m_message  = "Select features by clicking";

            //Load resources
            string[] res = GetType().Assembly.GetManifestResourceNames();
            if (res.GetLength(0) > 0)
            {
                base.m_bitmap = new System.Drawing.Bitmap(GetType().Assembly.GetManifestResourceStream("sceneTools.SelectFeatures.bmp"));
            }
            m_pCursor = new System.Windows.Forms.Cursor(GetType().Assembly.GetManifestResourceStream("sceneTools.SelectFeatures.cur"));

            m_pSceneHookHelper = new SceneHookHelperClass();
        }
Example #9
0
        public Fly()
        {
            base.m_category = "Sample_SceneControl(C#)";
            base.m_caption  = "Fly";
            base.m_toolTip  = "Fly";
            base.m_name     = "Sample_SceneControl(C#)/Fly";
            base.m_message  = "Flies through the scene";

            //Load resources
            string[] res = GetType().Assembly.GetManifestResourceNames();
            if (res.GetLength(0) > 0)
            {
                base.m_bitmap = new System.Drawing.Bitmap(GetType().Assembly.GetManifestResourceStream("sceneTools.fly.bmp"));
            }
            m_flyCur           = new System.Windows.Forms.Cursor(GetType().Assembly.GetManifestResourceStream("sceneTools.fly.cur"));
            m_moveFlyCur       = new System.Windows.Forms.Cursor(GetType().Assembly.GetManifestResourceStream("sceneTools.fly1.cur"));
            m_pSceneHookHelper = new SceneHookHelperClass();
            m_iSpeed           = 0;
        }
        public Pan()
        {
            base.m_category = "Sample_SceneControl(C#)";
            base.m_caption  = "Pan";
            base.m_toolTip  = "Pan";
            base.m_name     = "Sample_SceneControl(C#)/Pan";
            base.m_message  = "Pans the scene";

            //Load resources
            string[] res = GetType().Assembly.GetManifestResourceNames();
            if (res.GetLength(0) > 0)
            {
                base.m_bitmap = new System.Drawing.Bitmap(GetType().Assembly.GetManifestResourceStream("sceneTools.pan.bmp"));
            }
            m_pCursorStop = new System.Windows.Forms.Cursor(GetType().Assembly.GetManifestResourceStream("sceneTools.HAND.CUR"));
            m_pCursorMove = new System.Windows.Forms.Cursor(GetType().Assembly.GetManifestResourceStream("sceneTools.movehand.cur"));

            m_pSceneHookHelper = new SceneHookHelperClass();
        }
        public Navigate()
        {
            base.m_category = "Sample_SceneControl(C#)";
            base.m_caption  = "Navigate";
            base.m_toolTip  = "Navigate";
            base.m_name     = "Sample_SceneControl(C#)/Navigate";
            base.m_message  = "Navigates the scene";

            //Load resources
            string[] res = GetType().Assembly.GetManifestResourceNames();
            if (res.GetLength(0) > 0)
            {
                base.m_bitmap = new System.Drawing.Bitmap(GetType().Assembly.GetManifestResourceStream("sceneTools.Navigation.bmp"));
            }
            m_pCursorNav  = new System.Windows.Forms.Cursor(GetType().Assembly.GetManifestResourceStream("sceneTools.navigation.cur"));
            m_pCursorPan  = new System.Windows.Forms.Cursor(GetType().Assembly.GetManifestResourceStream("sceneTools.movehand.cur"));
            m_pCursorZoom = new System.Windows.Forms.Cursor(GetType().Assembly.GetManifestResourceStream("sceneTools.ZOOMINOUT.CUR"));
            m_pCursorGest = new System.Windows.Forms.Cursor(GetType().Assembly.GetManifestResourceStream("sceneTools.gesture.cur"));

            m_pSceneHookHelper = new SceneHookHelperClass();
        }
Example #12
0
        /// <summary>
        /// Occurs when this command is created
        /// </summary>
        /// <param name="hook">Instance of the application</param>
        public override void OnCreate(object hook)
        {
            try
            {
                if (hook == null)
                {
                    return;
                }

                m_application = hook as IApplication;

                //判断应用类型
                if (hook is IMxApplication)
                {
                    applicationType = ApplicationType.ArcMap;
                }
                if (hook is ISxApplication)
                {
                    applicationType        = ApplicationType.ArcScene;
                    m_sceneHookHelper      = new SceneHookHelperClass();
                    m_sceneHookHelper.Hook = hook;
                }

                //判断应用类型不为None则启用工具
                if (applicationType != ApplicationType.None)
                {
                    base.m_enabled = true;
                }
                else
                {
                    base.m_enabled = false;
                }
            }
            catch (Exception err)
            {
                MessageBox.Show(err.ToString());
            }
        }
        /// <summary>
        /// Occurs when this tool is created
        /// </summary>
        /// <param name="hook">Instance of the application</param>
        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)
            {
                try
                {
                    //Can be a scene or globe
                    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)
                        {
                            //Nothing valid!
                            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;
            }
            //ClsDeclare.g_pMap = m_hookHelper.FocusMap;
        }
Example #14
0
        /// <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
        }
		public FullExtent()
		{
			base.m_category = "Sample_SceneControl(C#)";
			base.m_caption = "Full Extent";
			base.m_toolTip = "Full Extent";
			base.m_name = "Sample_SceneControl(C#)/FullExtent";
			base.m_message = "Displays the scene at full extent";

			//Load resources
			string[] res = GetType().Assembly.GetManifestResourceNames();
			if(res.GetLength(0) > 0)
			{
				base.m_bitmap = new System.Drawing.Bitmap(GetType().Assembly.GetManifestResourceStream("sceneTools.fullextent.bmp"));
			}
			m_pSceneHookHelper = new SceneHookHelperClass ();
		}
		public SelectFeatures()
		{
			base.m_category = "Sample_SceneControl(C#)";
			base.m_caption = "Select Features";
			base.m_toolTip = "Select Features";
			base.m_name = "Sample_SceneControl(C#)/SelectFeatures";
			base.m_message = "Select features by clicking";

			//Load resources
			string[] res = GetType().Assembly.GetManifestResourceNames();
			if(res.GetLength(0) > 0)
			{
				base.m_bitmap = new System.Drawing.Bitmap(GetType().Assembly.GetManifestResourceStream("sceneTools.SelectFeatures.bmp"));
			}
			m_pCursor = new System.Windows.Forms.Cursor(GetType().Assembly.GetManifestResourceStream("sceneTools.SelectFeatures.cur"));
		
			m_pSceneHookHelper = new SceneHookHelperClass ();
		}
		public NarrowFOV()
		{
			base.m_category = "Sample_SceneControl(C#)";
			base.m_caption = "Narrow Field of View";
			base.m_toolTip = "Narrow Field of View";
			base.m_name = "Sample_SceneControl(C#)/Narrow Field of View";
			base.m_message = "Narrow the Field of View";

			//Load resources
			string[] res = GetType().Assembly.GetManifestResourceNames();
			if(res.GetLength(0) > 0)
			{
				base.m_bitmap = new System.Drawing.Bitmap(GetType().Assembly.GetManifestResourceStream("sceneTools.narrow.bmp"));
			}
			m_pSceneHookHelper = new SceneHookHelperClass ();
		}
Example #18
0
        /// <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;
            }
        }
		public TargetZoom()
		{
			base.m_category = "Sample_SceneControl(C#)";
			base.m_caption = "Target Zoom";
			base.m_toolTip = "Zoom to Target";
			base.m_name = "Sample_SceneControl(C#)/TargetZoom";
			base.m_message = "Zoom to selected target";

			//Load resources
			string[] res = GetType().Assembly.GetManifestResourceNames();
			if(res.GetLength(0) > 0)
			{
				base.m_bitmap = new System.Drawing.Bitmap(GetType().Assembly.GetManifestResourceStream("sceneTools.TargetZoom.bmp"));
			}
			m_pCursor = new System.Windows.Forms.Cursor(GetType().Assembly.GetManifestResourceStream("sceneTools.targetzoom.cur"));
		
			m_pSceneHookHelper = new SceneHookHelperClass ();
		}
		public Navigate()
		{
			base.m_category = "Sample_SceneControl(C#)";
			base.m_caption = "Navigate";
			base.m_toolTip = "Navigate";
			base.m_name = "Sample_SceneControl(C#)/Navigate";
			base.m_message = "Navigates the scene";

			//Load resources
			string[] res = GetType().Assembly.GetManifestResourceNames();
			if(res.GetLength(0) > 0)
			{
				base.m_bitmap = new System.Drawing.Bitmap(GetType().Assembly.GetManifestResourceStream("sceneTools.Navigation.bmp"));
			}
			m_pCursorNav = new System.Windows.Forms.Cursor(GetType().Assembly.GetManifestResourceStream("sceneTools.navigation.cur"));
			m_pCursorPan = new System.Windows.Forms.Cursor(GetType().Assembly.GetManifestResourceStream("sceneTools.movehand.cur"));
			m_pCursorZoom = new System.Windows.Forms.Cursor(GetType().Assembly.GetManifestResourceStream("sceneTools.ZOOMINOUT.CUR"));
			m_pCursorGest = new System.Windows.Forms.Cursor(GetType().Assembly.GetManifestResourceStream("sceneTools.gesture.cur"));

			m_pSceneHookHelper = new SceneHookHelperClass ();
		}
Example #21
0
        /// <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
        }
		public Fly()
		{
			base.m_category = "Sample_SceneControl(C#)";
			base.m_caption = "Fly";
			base.m_toolTip = "Fly";
			base.m_name = "Sample_SceneControl(C#)/Fly";
			base.m_message = "Flies through the scene";

			//Load resources
			string[] res = GetType().Assembly.GetManifestResourceNames();
			if(res.GetLength(0) > 0)
			{
				base.m_bitmap = new System.Drawing.Bitmap(GetType().Assembly.GetManifestResourceStream("sceneTools.fly.bmp"));
			}
			m_flyCur = new System.Windows.Forms.Cursor(GetType().Assembly.GetManifestResourceStream("sceneTools.fly.cur"));
			m_moveFlyCur = new System.Windows.Forms.Cursor(GetType().Assembly.GetManifestResourceStream("sceneTools.fly1.cur"));
			m_pSceneHookHelper = new SceneHookHelperClass ();
			m_iSpeed = 0;
		}
		public ZoomInOut()
		{
			base.m_category = "Sample_SceneControl(C#)";
			base.m_caption = "Zoom In/Out";
			base.m_toolTip = "Zoom In/Out";
			base.m_name = "Sample_SceneControl(C#)/Zoom In/Out";
			base.m_message = "Dynamically zooms in and out on the scene";

			//Load resources
			string[] res = GetType().Assembly.GetManifestResourceNames();
			if(res.GetLength(0) > 0)
			{
				base.m_bitmap = new System.Drawing.Bitmap(GetType().Assembly.GetManifestResourceStream("sceneTools.ZoomInOut.bmp"));
			}
			m_pCursor = new System.Windows.Forms.Cursor(GetType().Assembly.GetManifestResourceStream("sceneTools.ZOOMINOUT.CUR"));
		
			m_pSceneHookHelper = new SceneHookHelperClass ();
		}
Example #24
0
        /// <summary>
        /// Occurs when this tool is created
        /// </summary>
        /// <param name="hook">Instance of the application</param>
        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)
            {
                try
                {
                    //Can be a scene or globe
                    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)
                        {
                            //Nothing valid!
                            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;
        }
		public Pan()
		{
			base.m_category = "Sample_SceneControl(C#)";
			base.m_caption = "Pan";
			base.m_toolTip = "Pan";
			base.m_name = "Sample_SceneControl(C#)/Pan";
			base.m_message = "Pans the scene";

			//Load resources
			string[] res = GetType().Assembly.GetManifestResourceNames();
			if(res.GetLength(0) > 0)
			{
				base.m_bitmap = new System.Drawing.Bitmap(GetType().Assembly.GetManifestResourceStream("sceneTools.pan.bmp"));
			}
			m_pCursorStop = new System.Windows.Forms.Cursor(GetType().Assembly.GetManifestResourceStream("sceneTools.HAND.CUR"));
			m_pCursorMove = new System.Windows.Forms.Cursor(GetType().Assembly.GetManifestResourceStream("sceneTools.movehand.cur"));
		
			m_pSceneHookHelper = new SceneHookHelperClass ();
		}