/// <summary>
        /// 闪烁查询到要素
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void flashFeature(object sender, UploadStringCompletedEventArgs e)
        {
            geoObj = this.IMSCatalog.ActiveLayerObj.OnGetGeomByFID(e);
            if (geoObj == null)
            {
                return;
            }
            List <Point> pntArr = new List <Point>();

            for (int i = 0; i < geoObj.RegGeom[0].Rings.Length; i++)
            {
                for (int j = 0; j < geoObj.RegGeom[0].Rings[i].Arcs.Length; j++)
                {
                    for (int k = 0; k < geoObj.RegGeom[0].Rings[i].Arcs[j].Dots.Length; k++)
                    {
                        pntArr.Add(new Point(geoObj.RegGeom[0].Rings[i].Arcs[j].Dots[k].x, geoObj.RegGeom[0].Rings[i].Arcs[j].Dots[k].y));
                    }
                }
            }
            if (pntArr[0].X <this.IMSCatalog.ActiveLayerObj.MapContainer.WinViewBound.XMin || pntArr[0].X> this.IMSCatalog.ActiveLayerObj.MapContainer.WinViewBound.XMax ||
                pntArr[0].Y <this.IMSCatalog.ActiveLayerObj.MapContainer.WinViewBound.YMin || pntArr[0].Y> this.IMSCatalog.ActiveLayerObj.MapContainer.WinViewBound.YMax)
            {
                this.IMSCatalog.ActiveLayerObj.MapContainer.PanTo(pntArr[0].X, pntArr[0].Y);
            }
            m_graphics = new IMSPolygon(CoordinateType.Logic)
            {
                Points = pntArr
            };
            m_graphicsLayer.AddGraphics(m_graphics);
            m_graphics.FlickerOverCallback = new GraphicsFlickerOverDelegate(FlickerOverCallback);
            m_graphics.Draw();
            m_graphics.Flicker();
        }
Beispiel #2
0
        /// <summary>
        /// 闪烁图形
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void FlashFeature(object sender, UploadStringCompletedEventArgs e)
        {
            try
            {
                m_featureGeo = activeMapDoc.OnGetGeomByID(e);
            }
            catch (Exception ex)
            {
                MessageBox.Show("获取该要素空间信息失败!" + ex.Message);
                return;
            }
            bool flg = false;

            if (m_featureGeo.LinGeom != null && m_featureGeo.LinGeom.Length > 0)
            {
                List <Point> pntArr = new List <Point>();
                for (int i = 0; i < m_featureGeo.LinGeom.Length; i++)
                {
                    for (int j = 0; j < m_featureGeo.LinGeom[i].Line.Arcs.Length; j++)
                    {
                        for (int k = 0; k < m_featureGeo.LinGeom[i].Line.Arcs[j].Dots.Length; k++)
                        {
                            pntArr.Add(new Point(m_featureGeo.LinGeom[i].Line.Arcs[j].Dots[k].x, m_featureGeo.LinGeom[i].Line.Arcs[j].Dots[k].y));
                        }
                    }
                }
                if (pntArr[0].X <activeMapDoc.MapContainer.WinViewBound.XMin || pntArr[0].X> activeMapDoc.MapContainer.WinViewBound.XMax ||
                    pntArr[0].Y <activeMapDoc.MapContainer.WinViewBound.YMin || pntArr[0].Y> activeMapDoc.MapContainer.WinViewBound.YMax)
                {
                    activeMapDoc.MapContainer.PanTo(pntArr[0].X, pntArr[0].Y);
                }
                m_graphics = new IMSPolyline(CoordinateType.Logic)
                {
                    Points          = pntArr,
                    StrokeThickness = 4
                };
                flg = true;
            }
            if (m_featureGeo.PntGeom != null && m_featureGeo.PntGeom.Length > 0)
            {
                if (m_featureGeo.PntGeom[0].Dot.x <activeMapDoc.MapContainer.WinViewBound.XMin || m_featureGeo.PntGeom[0].Dot.x> activeMapDoc.MapContainer.WinViewBound.XMax ||
                    m_featureGeo.PntGeom[0].Dot.y <activeMapDoc.MapContainer.WinViewBound.YMin || m_featureGeo.PntGeom[0].Dot.y> activeMapDoc.MapContainer.WinViewBound.YMax)
                {
                    activeMapDoc.MapContainer.PanTo(m_featureGeo.PntGeom[0].Dot.x, m_featureGeo.PntGeom[0].Dot.y);
                }
                m_graphics = new IMSCircle(CoordinateType.Logic)
                {
                    CenX     = m_featureGeo.PntGeom[0].Dot.x,
                    CenY     = m_featureGeo.PntGeom[0].Dot.y,
                    RadiusEx = 6
                };
                flg = true;
            }
            if (m_featureGeo.RegGeom != null && m_featureGeo.RegGeom.Length > 0)
            {
                List <Point> pntArr = new List <Point>();
                for (int i = 0; i < m_featureGeo.RegGeom[0].Rings.Length; i++)
                {
                    for (int j = 0; j < m_featureGeo.RegGeom[0].Rings[i].Arcs.Length; j++)
                    {
                        for (int k = 0; k < m_featureGeo.RegGeom[0].Rings[i].Arcs[j].Dots.Length; k++)
                        {
                            pntArr.Add(new Point(m_featureGeo.RegGeom[0].Rings[i].Arcs[j].Dots[k].x, m_featureGeo.RegGeom[0].Rings[i].Arcs[j].Dots[k].y));
                        }
                    }
                }
                if (pntArr[0].X <activeMapDoc.MapContainer.WinViewBound.XMin || pntArr[0].X> activeMapDoc.MapContainer.WinViewBound.XMax ||
                    pntArr[0].Y <activeMapDoc.MapContainer.WinViewBound.YMin || pntArr[0].Y> activeMapDoc.MapContainer.WinViewBound.YMax)
                {
                    activeMapDoc.MapContainer.PanTo(pntArr[0].X, pntArr[0].Y);
                }
                m_graphics = new IMSPolygon(CoordinateType.Logic)
                {
                    Points = pntArr
                };
                flg = true;
            }
            if (flg)
            {
                m_graphicsLayer.AddGraphics(m_graphics);
                m_graphics.FlickerOverCallback = new GraphicsFlickerOverDelegate(FlickerOverCallback);
                m_graphics.Draw();
                m_graphics.Flicker();
            }
        }
Beispiel #3
0
        private void DrawFeature(object sender, UploadStringCompletedEventArgs e)
        {
            SFeatureGeometry geoObj = null;

            try
            {
                geoObj = ActiveMapDoc.OnGetGeomByID(e);
            }
            catch (Exception ex)
            {
                MessageBox.Show("获取该要素空间信息失败!" + ex.Message);
                return;
            }
            m_targetGeo = geoObj;
            bool flg = false;

            if (geoObj.LinGeom != null && geoObj.LinGeom.Length > 0)
            {
                List <Point> pntArr = new List <Point>();
                for (int i = 0; i < geoObj.LinGeom.Length; i++)
                {
                    for (int j = 0; j < geoObj.LinGeom[i].Line.Arcs.Length; j++)
                    {
                        for (int k = 0; k < geoObj.LinGeom[i].Line.Arcs[j].Dots.Length; k++)
                        {
                            pntArr.Add(new Point(geoObj.LinGeom[i].Line.Arcs[j].Dots[k].x, geoObj.LinGeom[i].Line.Arcs[j].Dots[k].y));
                        }
                    }
                }
                if (pntArr[0].X <ActiveMapDoc.MapContainer.WinViewBound.XMin || pntArr[0].X> ActiveMapDoc.MapContainer.WinViewBound.XMax ||
                    pntArr[0].Y <ActiveMapDoc.MapContainer.WinViewBound.YMin || pntArr[0].Y> ActiveMapDoc.MapContainer.WinViewBound.YMax)
                {
                    ActiveMapDoc.MapContainer.PanTo(pntArr[0].X, pntArr[0].Y);
                }
                m_graphics = new IMSPolyline(CoordinateType.Logic)
                {
                    Points          = pntArr,
                    StrokeThickness = 4
                };
                flg = true;
            }
            if (geoObj.PntGeom != null && geoObj.PntGeom.Length > 0)
            {
                if (geoObj.PntGeom[0].Dot.x <ActiveMapDoc.MapContainer.WinViewBound.XMin || geoObj.PntGeom[0].Dot.x> ActiveMapDoc.MapContainer.WinViewBound.XMax ||
                    geoObj.PntGeom[0].Dot.y <ActiveMapDoc.MapContainer.WinViewBound.YMin || geoObj.PntGeom[0].Dot.y> ActiveMapDoc.MapContainer.WinViewBound.YMax)
                {
                    ActiveMapDoc.MapContainer.PanTo(geoObj.PntGeom[0].Dot.x, geoObj.PntGeom[0].Dot.y);
                }
                m_graphics = new IMSCircle(CoordinateType.Logic)
                {
                    CenX     = geoObj.PntGeom[0].Dot.x,
                    CenY     = geoObj.PntGeom[0].Dot.y,
                    RadiusEx = 6
                };
                flg = true;
            }
            if (geoObj.RegGeom != null && geoObj.RegGeom.Length > 0)
            {
                List <Point> pntArr = new List <Point>();
                for (int i = 0; i < geoObj.RegGeom[0].Rings.Length; i++)
                {
                    for (int j = 0; j < geoObj.RegGeom[0].Rings[i].Arcs.Length; j++)
                    {
                        for (int k = 0; k < geoObj.RegGeom[0].Rings[i].Arcs[j].Dots.Length; k++)
                        {
                            pntArr.Add(new Point(geoObj.RegGeom[0].Rings[i].Arcs[j].Dots[k].x, geoObj.RegGeom[0].Rings[i].Arcs[j].Dots[k].y));
                        }
                    }
                }
                if (pntArr[0].X <ActiveMapDoc.MapContainer.WinViewBound.XMin || pntArr[0].X> ActiveMapDoc.MapContainer.WinViewBound.XMax ||
                    pntArr[0].Y <ActiveMapDoc.MapContainer.WinViewBound.YMin || pntArr[0].Y> ActiveMapDoc.MapContainer.WinViewBound.YMax)
                {
                    ActiveMapDoc.MapContainer.PanTo(pntArr[0].X, pntArr[0].Y);
                }
                m_graphics = new IMSPolygon(CoordinateType.Logic)
                {
                    Points = pntArr
                };
                flg = true;
            }
            if (flg)
            {
                GraphicsLayer.AddGraphics(m_graphics);
                m_graphics.EnableEdit      = true;
                m_graphics.EnableEditMark2 = false;
                m_graphics.Draw();
            }
        }
        private void DrawFeature(object sender, UploadStringCompletedEventArgs e)
        {
            SFeatureGeometry geoObj = ActiveLayerObj.OnGetGeomByFID(e);

            m_targetGeo = geoObj;
            bool flg = false;

            //RectBound rect = new RectBound(double.MaxValue, double.MaxValue, double.MinValue, double.MinValue);
            if (geoObj.LinGeom != null && geoObj.LinGeom.Length > 0)
            {
                List <Point> pntArr = new List <Point>();
                for (int i = 0; i < geoObj.LinGeom.Length; i++)
                {
                    for (int j = 0; j < geoObj.LinGeom[i].Line.Arcs.Length; j++)
                    {
                        for (int k = 0; k < geoObj.LinGeom[i].Line.Arcs[j].Dots.Length; k++)
                        {
                            pntArr.Add(new Point(geoObj.LinGeom[i].Line.Arcs[j].Dots[k].x, geoObj.LinGeom[i].Line.Arcs[j].Dots[k].y));
                        }
                    }
                }
                if (pntArr[0].X <ActiveLayerObj.MapContainer.WinViewBound.XMin || pntArr[0].X> ActiveLayerObj.MapContainer.WinViewBound.XMax ||
                    pntArr[0].Y <ActiveLayerObj.MapContainer.WinViewBound.YMin || pntArr[0].Y> ActiveLayerObj.MapContainer.WinViewBound.YMax)
                {
                    ActiveLayerObj.MapContainer.PanTo(pntArr[0].X, pntArr[0].Y);
                }
                //(ActiveLayerObj.MapContainer as IMSMap).JumpByRectBound(
                m_graphics = new IMSPolyline(CoordinateType.Logic)
                {
                    Points          = pntArr,
                    StrokeThickness = 4
                };
                flg = true;
            }
            if (geoObj.PntGeom != null && geoObj.PntGeom.Length > 0)
            {
                if (geoObj.PntGeom[0].Dot.x <ActiveLayerObj.MapContainer.WinViewBound.XMin || geoObj.PntGeom[0].Dot.x> ActiveLayerObj.MapContainer.WinViewBound.XMax ||
                    geoObj.PntGeom[0].Dot.y <ActiveLayerObj.MapContainer.WinViewBound.YMin || geoObj.PntGeom[0].Dot.y> ActiveLayerObj.MapContainer.WinViewBound.YMax)
                {
                    ActiveLayerObj.MapContainer.PanTo(geoObj.PntGeom[0].Dot.x, geoObj.PntGeom[0].Dot.y);
                }
                m_graphics = new IMSCircle(CoordinateType.Logic)
                {
                    CenX     = geoObj.PntGeom[0].Dot.x,
                    CenY     = geoObj.PntGeom[0].Dot.y,
                    RadiusEx = 6
                };
                flg = true;
            }
            if (geoObj.RegGeom != null && geoObj.RegGeom.Length > 0)
            {
                List <Point> pntArr = new List <Point>();
                for (int i = 0; i < geoObj.RegGeom[0].Rings.Length; i++)
                {
                    for (int j = 0; j < geoObj.RegGeom[0].Rings[i].Arcs.Length; j++)
                    {
                        for (int k = 0; k < geoObj.RegGeom[0].Rings[i].Arcs[j].Dots.Length; k++)
                        {
                            pntArr.Add(new Point(geoObj.RegGeom[0].Rings[i].Arcs[j].Dots[k].x, geoObj.RegGeom[0].Rings[i].Arcs[j].Dots[k].y));
                        }
                    }
                }
                if (pntArr[0].X <ActiveLayerObj.MapContainer.WinViewBound.XMin || pntArr[0].X> ActiveLayerObj.MapContainer.WinViewBound.XMax ||
                    pntArr[0].Y <ActiveLayerObj.MapContainer.WinViewBound.YMin || pntArr[0].Y> ActiveLayerObj.MapContainer.WinViewBound.YMax)
                {
                    ActiveLayerObj.MapContainer.PanTo(pntArr[0].X, pntArr[0].Y);
                }
                m_graphics = new IMSPolygon(CoordinateType.Logic)
                {
                    Points = pntArr
                };
                flg = true;
            }
            if (flg)
            {
                GraphicsLayer.AddGraphics(m_graphics);
                m_graphics.EnableEdit      = true;
                m_graphics.EnableEditMark2 = false;
                m_graphics.Draw();
            }
        }