Exemple #1
0
        //鼠标在场景中停留两秒中显示坡度坡向信息
        private void timer_tick(Object sender, EventArgs e)
        {
            if (m_slope != null)
            {
                if (m_lastPoint3D != m_point3D)
                {
                    this.m_sceneControl.Scene.TrackingLayer.Clear();
                    double slopeValue     = m_slope.GetSlopeValue(m_point3D);
                    double slopeDirection = m_slope.GetSlopeDirectionValue(m_point3D);

                    TextStyle textstyle = new TextStyle();
                    textstyle.IsSizeFixed = true;
                    textstyle.FontName    = "微软雅黑";
                    textstyle.ForeColor   = Color.Black;
                    textstyle.FontScale   = 2;
                    textstyle.FontHeight  = 3;

                    TextPart3D textPart3D = new TextPart3D();
                    textPart3D.Text        = String.Format("Longitude: {0}\nLatitude:{1}\nAltitude: {2}\nSlopeValue: {3}\nSlopeDirection: {4}", m_point3D.X, m_point3D.Y, m_point3D.Z, slopeValue, slopeDirection);
                    textPart3D.AnchorPoint = m_point3D;
                    GeoText3D geoText3D = new GeoText3D(textPart3D);
                    geoText3D.TextStyle = textstyle;
                    GeoStyle3D style3D = new GeoStyle3D();
                    style3D.AltitudeMode   = AltitudeMode.Absolute;
                    style3D.BottomAltitude = 10;
                    geoText3D.Style3D      = style3D;
                    this.m_sceneControl.Scene.TrackingLayer.Add(geoText3D, "Text");


                    m_lastPoint3D = m_point3D;
                }
            }
        }