Exemple #1
0
 private void ChkTip_CheckedChanged(object sender, System.EventArgs e)
 {
     if (ChkTip.Checked == false)
     {
         axGlobeControl1.ShowGlobeTips = esriGlobeTipsType.esriGlobeTipsTypeNone;
         axGlobeControl1.GlobeDisplay.RefreshViewers();
         cmbTipType.Enabled  = false;
         TxtTipDelay.Enabled = false;
     }
     else
     {
         cmbTipType.Enabled  = true;
         TxtTipDelay.Enabled = true;
         string sVal = TxtTipDelay.Text;
         if (Convert.ToInt32(sVal) == 0)
         {
             sVal = "500";                                           //set it to default..miliseconds
         }
         if (cmbTipType.SelectedIndex >= 0)
         {
             m_penumTips = (esriGlobeTipsType)cmbTipType.SelectedIndex;
         }
         axGlobeControl1.TipDelay = Convert.ToInt32(sVal);
         axGlobeControl1.TipStyle = esriTipStyle.esriTipStyleSolid;
         axGlobeControl1.GlobeViewer.GlobeDisplay.Globe.ShowGlobeTips = m_penumTips;
         axGlobeControl1.GlobeDisplay.RefreshViewers();
     }
 }
Exemple #2
0
        private void axGlobeControl1_OnGlobeReplaced(object sender, ESRI.ArcGIS.Controls.IGlobeControlEvents_OnGlobeReplacedEvent e)
        {
            IGlobeDisplayRendering pglbbDispRend = (IGlobeDisplayRendering)axGlobeControl1.GlobeDisplay;
            bool bsun = pglbbDispRend.IsSunEnabled;

            if (bsun == true)
            {
                chkSun.Checked = true;                         //checked
            }
            //get the state of globetips from the loaded doc.....
            m_penumTips = axGlobeControl1.GlobeViewer.GlobeDisplay.Globe.ShowGlobeTips;
        }
Exemple #3
0
 private void cmbTipType_SelectedIndexChanged(object sender, System.EventArgs e)
 {
     m_penumTips = (esriGlobeTipsType)cmbTipType.SelectedIndex;
     if (ChkTip.Checked == true)
     {
         string sVal = TxtTipDelay.Text;
         if (Convert.ToSingle(sVal) == 0)
         {
             sVal = "500";                                               //set it to default..miliseconds
         }
         axGlobeControl1.TipDelay      = Convert.ToInt32(sVal);
         axGlobeControl1.TipStyle      = esriTipStyle.esriTipStyleSolid;
         axGlobeControl1.ShowGlobeTips = m_penumTips;
         axGlobeControl1.GlobeDisplay.RefreshViewers();
     }
 }
Exemple #4
0
        private void Form1_Load(object sender, System.EventArgs e)
        {
            //relative file path to the sample data from project location
            string sGlbData = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);

            sGlbData = Path.Combine(sGlbData, @"ArcGIS\data\Globe\World Imagery.3dd");
            var filePath = new DirectoryInfo(sGlbData);

            System.Diagnostics.Debug.WriteLine(string.Format("File path for data root: {0} [{1}]", filePath.FullName, Directory.GetCurrentDirectory()));
            if (!File.Exists(sGlbData))
            {
                throw new Exception(string.Format("Fix code to point to your sample data: {0} [{1}] was not found", filePath.FullName, Directory.GetCurrentDirectory()));
            }

            if (axGlobeControl1.Check3dFile(sGlbData))
            {
                axGlobeControl1.Load3dFile(sGlbData);
            }

            //Enable north arrow, HUD and GlobeTips.
            bool bChkArrow = axGlobeControl1.GlobeViewer.NorthArrowEnabled;
            bool bHUD      = axGlobeControl1.GlobeViewer.HUDEnabled;

            ChkHUD.Checked   = bHUD;
            ChkArrow.Checked = bChkArrow;
            //get the state of globetips from the loaded doc.....
            m_penumTips = axGlobeControl1.GlobeViewer.GlobeDisplay.Globe.ShowGlobeTips;
            //if no tip value (not set) in the loaded doc set it to default..
            if (m_penumTips <= 0)
            {
                m_penumTips = esriGlobeTipsType.esriGlobeTipsTypeLatLon;
            }
            cmbTipType.Items.Insert(0, "esriGlobeTipsTypeNone");
            cmbTipType.Items.Insert(1, "esriGlobeTipsTypeLatLon");
            cmbTipType.Items.Insert(2, "esriGlobeTipsTypeElevation");
            cmbTipType.Items.Insert(3, "esriGlobeTipsTypeLatLonElevation");

            ChkTip.Checked = true;            //tip value of the doc...
            //set the list...
            cmbTipType.SelectedIndex = (int)m_penumTips;

            //populate tip type values..
            axGlobeControl1.TipStyle = esriTipStyle.esriTipStyleSolid;
            axGlobeControl1.TipDelay = 500;             //default..
            axGlobeControl1.GlobeViewer.GlobeDisplay.Globe.ShowGlobeTips = m_penumTips;
            axGlobeControl1.GlobeDisplay.RefreshViewers();

            //Get current sun property..
            IGlobeDisplayRendering pglbDispRend = (IGlobeDisplayRendering)axGlobeControl1.GlobeDisplay;
            bool bsun = pglbDispRend.IsSunEnabled;

            if (bsun == true)
            {
                chkSun.Checked = true;                           //checked
            }
            //Get Ambient light...
            TxtAmbient.Text = pglbDispRend.AmbientLight.ToString();
            //Listen to events..
            m_globeDisplay                = axGlobeControl1.GlobeDisplay;
            globeDisplayEvents            = (IGlobeDisplayEvents_Event)m_globeDisplay;
            globeDisplayEvents.AfterDraw += new IGlobeDisplayEvents_AfterDrawEventHandler(OnAfterDraw);
            //globeDisplayEvents += new IGlobeDisplayEvents_AfterDrawEventHandler(OnAfterDraw);
            //afterDrawE = new IGlobeDisplayEvents_AfterDrawEventHandler(OnAfterDraw);
            //((IGlobeDisplayEvents_Event)axGlobeControl1.GlobeDisplay).AfterDraw+=afterDrawE;



            //globeDisplayEvents.AfterDraw += new (globeDisplayEvents_AfterDraw);
        }
Exemple #5
0
        private void Form1_Load(object sender, System.EventArgs e)
        {
            // Get the SDK location
            string sGlbData = RuntimeManager.ActiveRuntime.Path.ToString();

            sGlbData = Directory.GetParent(sGlbData).ToString();
            // first time removes the directory separator
            sGlbData = Directory.GetParent(sGlbData).ToString();
            sGlbData = sGlbData + "\\DeveloperKit" + RuntimeManager.ActiveRuntime.Version + "\\Samples\\data\\Globe\\World Imagery.3dd";
            if (axGlobeControl1.Check3dFile(sGlbData))
            {
                axGlobeControl1.Load3dFile(sGlbData);
            }

            //Enable north arrow, HUD and GlobeTips.
            bool bChkArrow = axGlobeControl1.GlobeViewer.NorthArrowEnabled;
            bool bHUD      = axGlobeControl1.GlobeViewer.HUDEnabled;

            ChkHUD.Checked   = bHUD;
            ChkArrow.Checked = bChkArrow;
            //get the state of globetips from the loaded doc.....
            m_penumTips = axGlobeControl1.GlobeViewer.GlobeDisplay.Globe.ShowGlobeTips;
            //if no tip value (not set) in the loaded doc set it to default..
            if (m_penumTips <= 0)
            {
                m_penumTips = esriGlobeTipsType.esriGlobeTipsTypeLatLon;
            }
            cmbTipType.Items.Insert(0, "esriGlobeTipsTypeNone");
            cmbTipType.Items.Insert(1, "esriGlobeTipsTypeLatLon");
            cmbTipType.Items.Insert(2, "esriGlobeTipsTypeElevation");
            cmbTipType.Items.Insert(3, "esriGlobeTipsTypeLatLonElevation");

            ChkTip.Checked = true;            //tip value of the doc...
            //set the list...
            cmbTipType.SelectedIndex = (int)m_penumTips;

            //populate tip type values..
            axGlobeControl1.TipStyle = esriTipStyle.esriTipStyleSolid;
            axGlobeControl1.TipDelay = 500;             //default..
            axGlobeControl1.GlobeViewer.GlobeDisplay.Globe.ShowGlobeTips = m_penumTips;
            axGlobeControl1.GlobeDisplay.RefreshViewers();

            //Get current sun property..
            IGlobeDisplayRendering pglbDispRend = (IGlobeDisplayRendering)axGlobeControl1.GlobeDisplay;
            bool bsun = pglbDispRend.IsSunEnabled;

            if (bsun == true)
            {
                chkSun.Checked = true;                           //checked
            }
            //Get Ambient light...
            TxtAmbient.Text = pglbDispRend.AmbientLight.ToString();
            //Listen to events..
            m_globeDisplay                = axGlobeControl1.GlobeDisplay;
            globeDisplayEvents            = (IGlobeDisplayEvents_Event)m_globeDisplay;
            globeDisplayEvents.AfterDraw += new IGlobeDisplayEvents_AfterDrawEventHandler(OnAfterDraw);
            //globeDisplayEvents += new IGlobeDisplayEvents_AfterDrawEventHandler(OnAfterDraw);
            //afterDrawE = new IGlobeDisplayEvents_AfterDrawEventHandler(OnAfterDraw);
            //((IGlobeDisplayEvents_Event)axGlobeControl1.GlobeDisplay).AfterDraw+=afterDrawE;



            //globeDisplayEvents.AfterDraw += new (globeDisplayEvents_AfterDraw);
        }
		private void axGlobeControl1_OnGlobeReplaced(object sender, ESRI.ArcGIS.Controls.IGlobeControlEvents_OnGlobeReplacedEvent e)
		{
			IGlobeDisplayRendering pglbbDispRend = (IGlobeDisplayRendering) axGlobeControl1.GlobeDisplay;
			bool bsun = pglbbDispRend.IsSunEnabled;
			if (bsun==true) chkSun.Checked = true; //checked
			//get the state of globetips from the loaded doc.....
			m_penumTips = axGlobeControl1.GlobeViewer.GlobeDisplay.Globe.ShowGlobeTips;
		}
		private void ChkTip_CheckedChanged(object sender, System.EventArgs e)
		{
			if (ChkTip.Checked == false)
			{
				axGlobeControl1.ShowGlobeTips = esriGlobeTipsType.esriGlobeTipsTypeNone;
				axGlobeControl1.GlobeDisplay.RefreshViewers();
				cmbTipType.Enabled = false;
				TxtTipDelay.Enabled = false;
			}
			else
			{
				cmbTipType.Enabled = true;
				TxtTipDelay.Enabled = true;
				string sVal = TxtTipDelay.Text;
				if (Convert.ToInt32(sVal) == 0) sVal="500"; //set it to default..miliseconds
				if (cmbTipType.SelectedIndex >= 0) m_penumTips = (esriGlobeTipsType) cmbTipType.SelectedIndex;
				axGlobeControl1.TipDelay = Convert.ToInt32(sVal);
				axGlobeControl1.TipStyle = esriTipStyle.esriTipStyleSolid;
				axGlobeControl1.GlobeViewer.GlobeDisplay.Globe.ShowGlobeTips = m_penumTips;
				axGlobeControl1.GlobeDisplay.RefreshViewers();
			}
		}
		private void cmbTipType_SelectedIndexChanged(object sender, System.EventArgs e)
		{
			m_penumTips = (esriGlobeTipsType) cmbTipType.SelectedIndex;
			if (ChkTip.Checked == true)
			{
				string sVal = TxtTipDelay.Text;
				if (Convert.ToSingle(sVal) == 0) sVal="500";	//set it to default..miliseconds
				axGlobeControl1.TipDelay = Convert.ToInt32(sVal);
				axGlobeControl1.TipStyle = esriTipStyle.esriTipStyleSolid;
				axGlobeControl1.ShowGlobeTips = m_penumTips;
				axGlobeControl1.GlobeDisplay.RefreshViewers();
			}
		}
		private void Form1_Load(object sender, System.EventArgs e)
		{
      // Get the SDK location
      string sGlbData = RuntimeManager.ActiveRuntime.Path.ToString();
      sGlbData = Directory.GetParent(sGlbData).ToString();
      // first time removes the directory separator
      sGlbData = Directory.GetParent(sGlbData).ToString();
      sGlbData = sGlbData + "\\DeveloperKit" + RuntimeManager.ActiveRuntime.Version + "\\Samples\\data\\Globe\\World Imagery.3dd";
      if (axGlobeControl1.Check3dFile(sGlbData)) axGlobeControl1.Load3dFile(sGlbData);

			//Enable north arrow, HUD and GlobeTips.
			bool bChkArrow = axGlobeControl1.GlobeViewer.NorthArrowEnabled;
			bool bHUD = axGlobeControl1.GlobeViewer.HUDEnabled;
			ChkHUD.Checked = bHUD;
			ChkArrow.Checked = bChkArrow;
			//get the state of globetips from the loaded doc.....
			m_penumTips = axGlobeControl1.GlobeViewer.GlobeDisplay.Globe.ShowGlobeTips;
			//if no tip value (not set) in the loaded doc set it to default..
			if (m_penumTips <= 0)
			{
				m_penumTips = esriGlobeTipsType.esriGlobeTipsTypeLatLon;
			}
			cmbTipType.Items.Insert(0, "esriGlobeTipsTypeNone");
			cmbTipType.Items.Insert(1, "esriGlobeTipsTypeLatLon");
			cmbTipType.Items.Insert(2, "esriGlobeTipsTypeElevation");
			cmbTipType.Items.Insert(3, "esriGlobeTipsTypeLatLonElevation");

			ChkTip.Checked = true;//tip value of the doc...
			//set the list...
			cmbTipType.SelectedIndex = (int) m_penumTips;

			//populate tip type values..
			axGlobeControl1.TipStyle = esriTipStyle.esriTipStyleSolid;
			axGlobeControl1.TipDelay = 500; //default..
			axGlobeControl1.GlobeViewer.GlobeDisplay.Globe.ShowGlobeTips = m_penumTips;
			axGlobeControl1.GlobeDisplay.RefreshViewers();

			//Get current sun property..
			IGlobeDisplayRendering pglbDispRend = (IGlobeDisplayRendering)axGlobeControl1.GlobeDisplay;
			bool bsun = pglbDispRend.IsSunEnabled;
			if (bsun == true) chkSun.Checked = true; //checked
			//Get Ambient light...
			TxtAmbient.Text = pglbDispRend.AmbientLight.ToString();
			//Listen to events..
      m_globeDisplay = axGlobeControl1.GlobeDisplay;
      globeDisplayEvents = (IGlobeDisplayEvents_Event)m_globeDisplay;
      globeDisplayEvents.AfterDraw += new IGlobeDisplayEvents_AfterDrawEventHandler(OnAfterDraw);
      //globeDisplayEvents += new IGlobeDisplayEvents_AfterDrawEventHandler(OnAfterDraw);
			//afterDrawE = new IGlobeDisplayEvents_AfterDrawEventHandler(OnAfterDraw);
			//((IGlobeDisplayEvents_Event)axGlobeControl1.GlobeDisplay).AfterDraw+=afterDrawE;


     
      
      //globeDisplayEvents.AfterDraw += new (globeDisplayEvents_AfterDraw);
		}