Ejemplo n.º 1
0
        private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            DevExpress.XtraEditors.Controls.EditorButton btn = e.Button;
            switch (btn.Caption)
            {
            case "定位":
                DF3DApplication app = DF3DApplication.Application;
                if (app == null || app.Current3DMapControl == null)
                {
                    return;
                }
                int focusedRowHandle = this.gridView1.FocusedRowHandle;
                if (focusedRowHandle == -1)
                {
                    return;
                }
                DataRow dr = this.gridView1.GetDataRow(focusedRowHandle);
                if (dr["geo"] != null && dr["Name"] != null && dr["fcName"] != null)
                {
                    ISurfaceSymbol ss = new SurfaceSymbolClass();
                    ss.Color = 0xcc00ff00;
                    ICurveSymbol cs = new CurveSymbolClass();
                    cs.Color          = 0xff00ff00;
                    cs.Width          = -5;
                    ss.BoundarySymbol = cs;
                    ISimplePointSymbol ps = new SimplePointSymbol();
                    ps.Size      = SystemInfo.Instance.SymbolSize;
                    ps.FillColor = Convert.ToUInt32(SystemInfo.Instance.FillColor, 16);
                    IGeometry objGeo = dr["geo"] as IGeometry;
                    IPoint    pt     = null;
                    if (objGeo.GeometryType == gviGeometryType.gviGeometryMultiPolyline)
                    {
                        double         x         = 0;
                        double         y         = 0;
                        double         z         = 0;
                        IMultiPolyline mPolyline = objGeo as IMultiPolyline;
                        for (int m = 0; m < mPolyline.GeometryCount; m++)
                        {
                            IPolyline polyline = mPolyline.GetPolyline(m);
                            IPoint    pttemp   = polyline.Midpoint;
                            x += pttemp.X;
                            y += pttemp.Y;
                            z += pttemp.Z;
                        }
                        x    = x / mPolyline.GeometryCount;
                        y    = y / mPolyline.GeometryCount;
                        z    = z / mPolyline.GeometryCount;
                        pt   = (new GeometryFactory()).CreatePoint(gviVertexAttribute.gviVertexAttributeZ);
                        pt.X = x;
                        pt.Y = y;
                        pt.Z = z;
                        IRenderMultiPolyline rMPolyline = app.Current3DMapControl.ObjectManager.CreateRenderMultiPolyline(mPolyline, cs, app.Current3DMapControl.ProjectTree.RootID);
                        rMPolyline.HeightStyle = gviHeightStyle.gviHeightOnEverything;
                        rMPolyline.Glow(8000);
                        this._listRender.Add(rMPolyline.Guid);
                    }
                    else if (objGeo.GeometryType == gviGeometryType.gviGeometryMultiPolygon)
                    {
                        double        x        = 0;
                        double        y        = 0;
                        double        z        = 0;
                        IMultiPolygon mPolygon = objGeo as IMultiPolygon;
                        for (int m = 0; m < mPolygon.GeometryCount; m++)
                        {
                            IPolygon polygon = mPolygon.GetPolygon(m);
                            IPoint   pttemp  = polygon.Centroid;
                            x += pttemp.X;
                            y += pttemp.Y;
                            z += pttemp.Z;
                        }
                        x    = x / mPolygon.GeometryCount;
                        y    = y / mPolygon.GeometryCount;
                        z    = z / mPolygon.GeometryCount;
                        pt   = (new GeometryFactory()).CreatePoint(gviVertexAttribute.gviVertexAttributeZ);
                        pt.X = x;
                        pt.Y = y;
                        pt.Z = z;
                        IRenderMultiPolygon rMPolygon = app.Current3DMapControl.ObjectManager.CreateRenderMultiPolygon(mPolygon, ss, app.Current3DMapControl.ProjectTree.RootID);
                        rMPolygon.HeightStyle = gviHeightStyle.gviHeightOnEverything;
                        rMPolygon.Glow(8000);
                        this._listRender.Add(rMPolygon.Guid);
                    }
                    else if (objGeo.GeometryType == gviGeometryType.gviGeometryPolyline)
                    {
                        IPolyline polyline = objGeo as IPolyline;
                        pt = polyline.Midpoint;
                        IRenderPolyline rPolyline = app.Current3DMapControl.ObjectManager.CreateRenderPolyline(polyline, cs, app.Current3DMapControl.ProjectTree.RootID);
                        rPolyline.HeightStyle = gviHeightStyle.gviHeightOnEverything;
                        rPolyline.Glow(8000);
                        this._listRender.Add(rPolyline.Guid);
                    }
                    else if (objGeo.GeometryType == gviGeometryType.gviGeometryPoint)
                    {
                        IPoint point = objGeo as IPoint;
                        pt = point;
                        IRenderPoint rPoint = app.Current3DMapControl.ObjectManager.CreateRenderPoint(point, ps, app.Current3DMapControl.ProjectTree.RootID);
                        rPoint.Glow(8000);
                        this._listRender.Add(rPoint.Guid);
                    }
                    else if (objGeo.GeometryType == gviGeometryType.gviGeometryPolygon)
                    {
                        IPolygon polygon = objGeo as IPolygon;
                        pt = polygon.Centroid;
                        IRenderPolygon rPolygon = app.Current3DMapControl.ObjectManager.CreateRenderPolygon(polygon, ss, app.Current3DMapControl.ProjectTree.RootID);
                        rPolygon.HeightStyle = gviHeightStyle.gviHeightOnEverything;
                        rPolygon.Glow(8000);
                        this._listRender.Add(rPolygon.Guid);
                    }
                    else
                    {
                        return;
                    }

                    ITableLabel tl = DrawTool.CreateTableLabel1(1);
                    tl.TitleText = dr["fcName"].ToString();
                    tl.SetRecord(0, 0, dr["Name"].ToString());
                    tl.Position = pt;

                    this._listRender.Add(tl.Guid);

                    app.Current3DMapControl.Camera.FlyToObject(tl.Guid, gviActionCode.gviActionFlyTo);
                }
                break;
            }
        }
Ejemplo n.º 2
0
        private void GetData()
        {
            if (this.cbLayer.SelectedItem == null)
            {
                return;
            }
            DF3DFeatureClass dffc = this.cbLayer.SelectedItem as DF3DFeatureClass;

            if (dffc == null)
            {
                return;
            }
            IFeatureClass fc = dffc.GetFeatureClass();

            if (fc == null)
            {
                return;
            }

            if (_num > _count || _count == 0)
            {
                return;
            }

            ISpatialFilter filter = this._filter;

            filter.ResultBeginIndex = _num - 1;
            filter.ResultLimit      = 1;
            IFdeCursor cursor = null;
            IRowBuffer row    = null;

            try
            {
                cursor = fc.Search(filter, false);
                if ((row = cursor.NextRow()) != null)
                {
                    #region 定位
                    int             geoindex = row.FieldIndex("Geometry");
                    DF3DApplication app      = DF3DApplication.Application;
                    if (geoindex != -1 && !row.IsNull(geoindex) && app != null && app.Current3DMapControl != null)
                    {
                        ISurfaceSymbol ss = new SurfaceSymbolClass();
                        ss.Color = 0xcc00ff00;
                        ICurveSymbol cs = new CurveSymbolClass();
                        cs.Color          = 0xff00ff00;
                        cs.Width          = -5;
                        ss.BoundarySymbol = cs;
                        ISimplePointSymbol ps = new SimplePointSymbol();
                        ps.Size      = SystemInfo.Instance.SymbolSize;
                        ps.FillColor = Convert.ToUInt32(SystemInfo.Instance.FillColor, 16);
                        IGeometry geo  = row.GetValue(geoindex) as IGeometry;
                        IPoint    ptTL = null;
                        if (geo.GeometryType == gviGeometryType.gviGeometryMultiPolyline)
                        {
                            double         x         = 0;
                            double         y         = 0;
                            double         z         = 0;
                            IMultiPolyline mPolyline = geo as IMultiPolyline;
                            for (int m = 0; m < mPolyline.GeometryCount; m++)
                            {
                                IPolyline polyline = mPolyline.GetPolyline(m);
                                IPoint    pttemp   = polyline.Midpoint;
                                x += pttemp.X;
                                y += pttemp.Y;
                                z += pttemp.Z;
                            }
                            x      = x / mPolyline.GeometryCount;
                            y      = y / mPolyline.GeometryCount;
                            z      = z / mPolyline.GeometryCount;
                            ptTL   = (new GeometryFactory()).CreatePoint(gviVertexAttribute.gviVertexAttributeZ);
                            ptTL.X = x;
                            ptTL.Y = y;
                            ptTL.Z = z;
                            IRenderMultiPolyline rMPolyline = app.Current3DMapControl.ObjectManager.CreateRenderMultiPolyline(mPolyline, cs, app.Current3DMapControl.ProjectTree.RootID);
                            rMPolyline.HeightStyle = gviHeightStyle.gviHeightOnEverything;
                            rMPolyline.Glow(8000);
                            app.Current3DMapControl.ObjectManager.DelayDelete(rMPolyline.Guid, 8000);
                            app.Current3DMapControl.Camera.FlyToObject(rMPolyline.Guid, gviActionCode.gviActionJump);
                        }
                        else if (geo.GeometryType == gviGeometryType.gviGeometryMultiPolygon)
                        {
                            double        x        = 0;
                            double        y        = 0;
                            double        z        = 0;
                            IMultiPolygon mPolygon = geo as IMultiPolygon;
                            for (int m = 0; m < mPolygon.GeometryCount; m++)
                            {
                                IPolygon polygon = mPolygon.GetPolygon(m);
                                IPoint   pttemp  = polygon.Centroid;
                                x += pttemp.X;
                                y += pttemp.Y;
                                z += pttemp.Z;
                            }
                            x      = x / mPolygon.GeometryCount;
                            y      = y / mPolygon.GeometryCount;
                            z      = z / mPolygon.GeometryCount;
                            ptTL   = (new GeometryFactory()).CreatePoint(gviVertexAttribute.gviVertexAttributeZ);
                            ptTL.X = x;
                            ptTL.Y = y;
                            ptTL.Z = z;
                            IRenderMultiPolygon rMPolygon = app.Current3DMapControl.ObjectManager.CreateRenderMultiPolygon(mPolygon, ss, app.Current3DMapControl.ProjectTree.RootID);
                            rMPolygon.HeightStyle = gviHeightStyle.gviHeightOnEverything;
                            rMPolygon.Glow(8000);
                            app.Current3DMapControl.ObjectManager.DelayDelete(rMPolygon.Guid, 8000);
                            app.Current3DMapControl.Camera.FlyToObject(rMPolygon.Guid, gviActionCode.gviActionJump);
                        }
                        else if (geo.GeometryType == gviGeometryType.gviGeometryPolyline)
                        {
                            IPolyline polyline = geo as IPolyline;
                            ptTL = polyline.Midpoint;
                            IRenderPolyline rPolyline = app.Current3DMapControl.ObjectManager.CreateRenderPolyline(polyline, cs, app.Current3DMapControl.ProjectTree.RootID);
                            rPolyline.HeightStyle = gviHeightStyle.gviHeightOnEverything;
                            rPolyline.Glow(8000);
                            app.Current3DMapControl.ObjectManager.DelayDelete(rPolyline.Guid, 8000);
                            app.Current3DMapControl.Camera.FlyToObject(rPolyline.Guid, gviActionCode.gviActionJump);
                        }
                        else if (geo.GeometryType == gviGeometryType.gviGeometryPoint)
                        {
                            IPoint point = geo as IPoint;
                            ptTL = point;
                            IRenderPoint rPoint = app.Current3DMapControl.ObjectManager.CreateRenderPoint(point, ps, app.Current3DMapControl.ProjectTree.RootID);
                            rPoint.Glow(8000);
                            app.Current3DMapControl.ObjectManager.DelayDelete(rPoint.Guid, 8000);
                            app.Current3DMapControl.Camera.FlyToObject(rPoint.Guid, gviActionCode.gviActionJump);
                        }
                        else if (geo.GeometryType == gviGeometryType.gviGeometryPolygon)
                        {
                            IPolygon polygon = geo as IPolygon;
                            ptTL = polygon.Centroid;
                            IRenderPolygon rPolygon = app.Current3DMapControl.ObjectManager.CreateRenderPolygon(polygon, ss, app.Current3DMapControl.ProjectTree.RootID);
                            rPolygon.HeightStyle = gviHeightStyle.gviHeightOnEverything;
                            rPolygon.Glow(8000);
                            app.Current3DMapControl.ObjectManager.DelayDelete(rPolygon.Guid, 8000);
                            app.Current3DMapControl.Camera.FlyToObject(rPolygon.Guid, gviActionCode.gviActionJump);
                        }
                        else if (geo.GeometryType == gviGeometryType.gviGeometryModelPoint)
                        {
                            ptTL = (new GeometryFactory()).CreatePoint(gviVertexAttribute.gviVertexAttributeZ);
                            IModelPoint mp = geo as IModelPoint;
                            ptTL.X = mp.X;
                            ptTL.Y = mp.Y;
                            ptTL.Z = mp.Z;
                            IModelPointSymbol mps = new ModelPointSymbol();
                            mps.SetResourceDataSet(fc.FeatureDataSet);
                            IRenderGeometry render = app.Current3DMapControl.ObjectManager.CreateRenderModelPoint(mp, mps, app.Current3DMapControl.ProjectTree.RootID);
                            render.Glow(8000);
                            app.Current3DMapControl.ObjectManager.DelayDelete(render.Guid, 8000);
                            app.Current3DMapControl.Camera.FlyToObject(render.Guid, gviActionCode.gviActionJump);
                        }
                        if (ptTL != null)
                        {
                            ITableLabel tl = DrawTool.CreateTableLabel1(1);
                            tl.TitleText = "属性查询";
                            tl.SetRecord(0, 0, dffc.ToString());
                            if (ptTL != null)
                            {
                                tl.Position = ptTL;
                            }
                            app.Current3DMapControl.Camera.FlyToObject(tl.Guid, gviActionCode.gviActionFlyTo);
                            app.Current3DMapControl.ObjectManager.DelayDelete(tl.Guid, 8000);
                        }
                    }
                    #endregion
                    FacilityClass facc = dffc.GetFacilityClass();
                    if (facc == null)
                    {
                        IFieldInfoCollection fiCol = fc.GetFields();
                        for (int i = 0; i < fiCol.Count; i++)
                        {
                            IFieldInfo fi  = fiCol.Get(i);
                            object     obj = row.GetValue(i);
                            string     str = "";
                            switch (fi.FieldType)
                            {
                            case gviFieldType.gviFieldBlob:
                            case gviFieldType.gviFieldUnknown:
                            case gviFieldType.gviFieldGeometry:
                                continue;

                            case gviFieldType.gviFieldFloat:
                            case gviFieldType.gviFieldDouble:
                                double d;
                                if (double.TryParse(obj.ToString(), out d))
                                {
                                    str = d.ToString("0.00");
                                }
                                break;

                            default:
                                str = obj.ToString();
                                break;
                            }
                            DataRow dr = this._dtShow.NewRow();
                            dr["Property"] = string.IsNullOrEmpty(fi.Alias) ? fi.Name : fi.Alias;
                            dr["Value"]    = str;
                            this._dtShow.Rows.Add(dr);
                        }
                    }
                    else
                    {
                        List <DFDataConfig.Class.FieldInfo> facFields = facc.FieldInfoCollection;
                        if (facFields != null)
                        {
                            foreach (DFDataConfig.Class.FieldInfo facField in facFields)
                            {
                                if (!facField.CanQuery)
                                {
                                    continue;
                                }
                                int index = row.FieldIndex(facField.Name);
                                if (index != -1 && !row.IsNull(index))
                                {
                                    object     obj  = row.GetValue(index);
                                    string     str  = "";
                                    IFieldInfo fiFC = row.Fields.Get(index);
                                    switch (fiFC.FieldType)
                                    {
                                    case gviFieldType.gviFieldBlob:
                                    case gviFieldType.gviFieldUnknown:
                                    case gviFieldType.gviFieldGeometry:
                                        continue;

                                    case gviFieldType.gviFieldFloat:
                                    case gviFieldType.gviFieldDouble:
                                        double d;
                                        if (double.TryParse(obj.ToString(), out d))
                                        {
                                            str = d.ToString("0.00");
                                        }
                                        break;

                                    default:
                                        str = obj.ToString();
                                        break;
                                    }
                                    DataRow dr = this._dtShow.NewRow();
                                    dr["Property"] = facField.ToString();
                                    dr["Value"]    = str;
                                    this._dtShow.Rows.Add(dr);
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
            }
            finally
            {
                if (cursor != null)
                {
                    System.Runtime.InteropServices.Marshal.ReleaseComObject(cursor);
                    cursor = null;
                }
                if (row != null)
                {
                    System.Runtime.InteropServices.Marshal.ReleaseComObject(row);
                    row = null;
                }
            }
        }
Ejemplo n.º 3
0
        private void ClickQuery()
        {
            DF3DApplication app = DF3DApplication.Application;

            if (app == null || app.Current3DMapControl == null)
            {
                return;
            }
            try
            {
                IFeatureLayer fl = this._drawTool.GetSelectFeatureLayerPickResult().FeatureLayer;
                if (fl == null)
                {
                    return;
                }
                int           featureId = this._drawTool.GetSelectFeatureLayerPickResult().FeatureId;
                FacilityClass facc      = Dictionary3DTable.Instance.GetFacilityClassByDFFeatureClassID(fl.FeatureClassId.ToString());
                if (facc == null || facc.Name != "PipeNode")
                {
                    XtraMessageBox.Show("您选中的不是管点设施,请选择管点设施。", "提示");
                    return;
                }
                DF3DFeatureClass dffc = DF3DFeatureClassManager.Instance.GetFeatureClassByID(fl.FeatureClassId.ToString());
                if (dffc == null || dffc.GetFeatureClass() == null)
                {
                    return;
                }
                IFeatureClass fc = dffc.GetFeatureClass();
                if (this._bFinished)
                {
                    Clear();
                    this._startFCGuid = fc.Guid.ToString();
                    this._startOid    = featureId;
                    this._bFinished   = false;

                    ILabel label = app.Current3DMapControl.ObjectManager.CreateLabel(app.Current3DMapControl.ProjectTree.RootID);
                    label.Text = "起点";
                    ITextSymbol ts = new TextSymbol();
                    ts.TextAttribute.TextSize  = SystemInfo.Instance.TextSize;
                    ts.TextAttribute.TextColor = Convert.ToUInt32(SystemInfo.Instance.TextColor, 16);
                    label.TextSymbol           = ts;
                    label.Position             = this._drawTool.GetSelectPoint();
                    this._listRGuid.Add(label.Guid);
                }
                else
                {
                    if (this._startFCGuid == fc.Guid.ToString() && this._startOid == featureId)
                    {
                        XtraMessageBox.Show("您选中的是同一个管点设施。", "提示");
                        return;
                    }
                    this._bFinished = true;
                    ILabel label = app.Current3DMapControl.ObjectManager.CreateLabel(app.Current3DMapControl.ProjectTree.RootID);
                    label.Text = "终点";
                    ITextSymbol ts = new TextSymbol();
                    ts.TextAttribute.TextSize  = SystemInfo.Instance.TextSize;
                    ts.TextAttribute.TextColor = Convert.ToUInt32(SystemInfo.Instance.TextColor, 16);
                    label.TextSymbol           = ts;
                    label.Position             = this._drawTool.GetSelectPoint();
                    this._listRGuid.Add(label.Guid);
                    if (this._startFCGuid != fc.Guid.ToString())
                    {
                        XtraMessageBox.Show("您选中的不是同一类管点设施。", "提示");
                        return;
                    }
                    else
                    {
                        WaitForm.Start("正在分析...", "请稍后");
                        FacClassReg reg = FacilityInfoService.GetFacClassRegByFeatureClassID(fc.Guid.ToString());
                        if (reg == null)
                        {
                            return;
                        }
                        TopoClass tc = FacilityInfoService.GetTopoClassByFacClassCode(reg.FacClassCode);
                        if (tc == null)
                        {
                            return;
                        }
                        TopoNetwork net = tc.GetNetwork();
                        if (net == null)
                        {
                            XtraMessageBox.Show("构建拓扑网络失败!", "提示");
                            return;
                        }
                        else
                        {
                            string        startId = this._startFCGuid + "_" + this._startOid.ToString();
                            string        endId   = fc.Guid.ToString() + "_" + featureId.ToString();
                            List <string> path;
                            double        shortestLength = net.SPFA(startId, endId, out path);
                            if ((shortestLength > 0.0 && shortestLength != double.MaxValue) || (path != null && path.Count > 0))
                            {
                                List <IPoint> listPt = new List <IPoint>();
                                foreach (string nodeId in path)
                                {
                                    int              index    = nodeId.LastIndexOf("_");
                                    string           fcguid   = nodeId.Substring(0, index);
                                    string           oid      = nodeId.Substring(index + 1, nodeId.Length - index - 1);
                                    DF3DFeatureClass dffcTemp = DF3DFeatureClassManager.Instance.GetFeatureClassByID(fcguid);
                                    if (dffcTemp == null || dffcTemp.GetFeatureClass() == null)
                                    {
                                        continue;
                                    }
                                    if (dffcTemp.GetFacilityClassName() != "PipeNode")
                                    {
                                        continue;
                                    }
                                    IQueryFilter filter = new QueryFilter();
                                    filter.WhereClause = "oid = " + oid;
                                    filter.SubFields   = "oid,Shape";
                                    IRowBuffer row    = null;
                                    IFdeCursor cursor = null;
                                    try
                                    {
                                        cursor = dffcTemp.GetFeatureClass().Search(filter, false);
                                        while ((row = cursor.NextRow()) != null)
                                        {
                                            if (!row.IsNull(1) && (row.GetValue(1) is IGeometry))
                                            {
                                                IGeometry geo = row.GetValue(1) as IGeometry;
                                                switch (geo.GeometryType)
                                                {
                                                case gviGeometryType.gviGeometryPoint:
                                                    IPoint pt = geo as IPoint;
                                                    pt.Z = pt.Z + 1;
                                                    listPt.Add(pt);
                                                    break;
                                                }
                                            }
                                        }
                                    }
                                    catch (Exception ex)
                                    {
                                    }
                                    finally
                                    {
                                        if (cursor != null)
                                        {
                                            System.Runtime.InteropServices.Marshal.ReleaseComObject(cursor);
                                            cursor = null;
                                        }
                                        if (row != null)
                                        {
                                            System.Runtime.InteropServices.Marshal.ReleaseComObject(row);
                                            row = null;
                                        }
                                    }
                                }
                                IPolyline polyline = (new GeometryFactory()).CreateGeometry(gviGeometryType.gviGeometryPolyline, gviVertexAttribute.gviVertexAttributeZ) as IPolyline;
                                foreach (IPoint pt in listPt)
                                {
                                    ISimplePointSymbol ps = new SimplePointSymbol();
                                    ps.Size      = 5;
                                    ps.Style     = gviSimplePointStyle.gviSimplePointCircle;
                                    ps.FillColor = Convert.ToUInt32(SystemInfo.Instance.FillColor, 16);
                                    IRenderPoint rp = app.Current3DMapControl.ObjectManager.CreateRenderPoint(pt, ps, app.Current3DMapControl.ProjectTree.RootID);
                                    rp.Glow(5000);
                                    polyline.AppendPoint(pt);
                                    this._listRGuid.Add(rp.Guid);
                                }
                                ICurveSymbol cs = new CurveSymbol();
                                cs.Color = Convert.ToUInt32(SystemInfo.Instance.LineColor, 16);
                                cs.Width = -5;
                                IRenderPolyline rpl = app.Current3DMapControl.ObjectManager.CreateRenderPolyline(polyline, cs, app.Current3DMapControl.ProjectTree.RootID);
                                rpl.Glow(5000);
                                this._listRGuid.Add(rpl.Guid);
                            }
                            else
                            {
                                XtraMessageBox.Show("两点不连通!", "提示");
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show("分析出错!", "提示");
            }
            finally
            {
                WaitForm.Stop();
            }
        }
Ejemplo n.º 4
0
        void axRenderControl1_RcMouseClickSelect(IPickResult PickResult, IPoint IntersectPoint, gviModKeyMask Mask, gviMouseSelectMode EventSender)
        {
            //删除包围框
            for (int i = 0; i < rPolylinelist.Count; i++)
            {
                this.axRenderControl1.ObjectManager.DeleteObject((rPolylinelist[i] as IRenderPolyline).Guid);
            }
            rPolylinelist.Clear();
            for (int i = 0; i < rPolylinelistWhole.Count; i++)
            {
                this.axRenderControl1.ObjectManager.DeleteObject((rPolylinelistWhole[i] as IRenderPolyline).Guid);
            }
            rPolylinelistWhole.Clear();

            for (int i = 0; i < tableLabelList.Count; i++)
            {
                this.axRenderControl1.ObjectManager.DeleteObject((tableLabelList[i] as ITableLabel).Guid);
            }
            tableLabelList.Clear();

            for (int i = 0; i < modelpointList.Count; i++)
            {
                this.axRenderControl1.ObjectManager.DeleteObject((modelpointList[i] as IRenderModelPoint).Guid);
            }
            modelpointList.Clear();

            if (rpl1 != null)
            {
                this.axRenderControl1.ObjectManager.DeleteObject(rpl1.Guid);
            }
            if (rpl2 != null)
            {
                this.axRenderControl1.ObjectManager.DeleteObject(rpl2.Guid);
            }

            this.axRenderControl1.HighlightHelper.SetRegion(null);

            if (EventSender == gviMouseSelectMode.gviMouseSelectClick)
            {
                IPickResult pr = PickResult;
                if (pr == null)
                {
                    return;
                }
                if (pr.Type == gviObjectType.gviObject3DTileLayer)
                {
                    if (Mode == 1)
                    {
                        IPoint intersectPoint          = IntersectPoint;
                        IRelationalOperator2D relation = intersectPoint as IRelationalOperator2D;

                        foreach (IFeatureClass fc in fcMap.Keys)
                        {
                            List <string> geoNames = fcMap[fc] as List <string>;
                            if (geoNames.Count == 0)
                            {
                                continue;
                            }

                            IFdeCursor        cursor = null;
                            IRowBuffer        row    = null;
                            List <IRowBuffer> list   = new List <IRowBuffer>();
                            try
                            {
                                ISpatialFilter filter = new SpatialFilter();
                                filter.Geometry      = intersectPoint;
                                filter.SpatialRel    = gviSpatialRel.gviSpatialRelEnvelope;
                                filter.GeometryField = "Geometry";
                                cursor = fc.Search(filter, false);
                                while ((row = cursor.NextRow()) != null)
                                {
                                    list.Add(row);
                                }
                                //开始遍历
                                foreach (IRowBuffer r in list)
                                {
                                    int geometryIndex = -1;
                                    geometryIndex = r.FieldIndex(geoNames[0].ToString());
                                    if (geometryIndex != -1)
                                    {
                                        IGeometry polygon = r.GetValue(geometryIndex) as IGeometry;
                                        if (relation.Within2D(polygon))
                                        {
                                            this.axRenderControl1.HighlightHelper.SetRegion(polygon);
                                        }
                                    }
                                }
                            }
                            catch (System.Exception ex)
                            {
                                if (ex.GetType().Name.Equals("UnauthorizedAccessException"))
                                {
                                    MessageBox.Show("需要标准runtime授权");
                                }
                                else
                                {
                                    MessageBox.Show(ex.Message);
                                }
                            }
                            finally
                            {
                                if (cursor != null)
                                {
                                    //System.Runtime.InteropServices.//Marshal.ReleaseComObject(cursor);
                                    cursor = null;
                                }
                            }

                            if (Mask != gviModKeyMask.gviModKeyCtrl && Mask != gviModKeyMask.gviModKeyShift)
                            {
                                if (list.Count > 0)
                                {
                                    break;
                                }
                            }
                        }
                    }
                    else if (Mode == 2)
                    {
                        this.axRenderControl1.Camera.GetCamera2(out cameraPoint, out cameraAngle);
                        IProximityOperator disOperator = cameraPoint as IProximityOperator;
                        double             length      = disOperator.Distance3D(IntersectPoint);
                        //向相机方向延伸n米:n跟眼睛到交点距离有关,当距离远时n大,当距离近时n小。
                        factor = length * 0.001;

                        IPoint    aimingPoint      = this.axRenderControl1.Camera.GetAimingPoint2(IntersectPoint, cameraAngle, factor);
                        IPoint    sourcePoint      = this.axRenderControl1.Camera.GetAimingPoint2(IntersectPoint, cameraAngle, -factor);
                        IPolyline intersetPolyline = geoFactory.CreateGeometry(gviGeometryType.gviGeometryPolyline, gviVertexAttribute.gviVertexAttributeZ) as IPolyline;
                        intersetPolyline.SpatialCRS = _currentCRS;
                        intersetPolyline.AppendPoint(sourcePoint);
                        //瓦片焦点可能在ModelPoint内部,导致拾取不上。因此要向intersectPoint内外各拉一定距离。
                        //intersetPolyline.AppendPoint(IntersectPoint);
                        intersetPolyline.AppendPoint(aimingPoint);

                        ICurveSymbol cs = new CurveSymbol();
                        cs.Color = System.Drawing.Color.Yellow;
                        cs.Width = -5;
                        rpl1     = this.axRenderControl1.ObjectManager.CreateRenderPolyline(intersetPolyline, cs, rootId);
                        rpl1.Glow(-1);

                        //IPolyline intersetPolyline2 = geoFactory.CreateGeometry(gviGeometryType.gviGeometryPolyline, gviVertexAttribute.gviVertexAttributeZ) as IPolyline;
                        //intersetPolyline2.AppendPoint(cameraPoint);
                        //intersetPolyline2.AppendPoint(IntersectPoint);
                        //cs.Color = System.Drawing.Color.Yellow;
                        //rpl2 = this.axRenderControl1.ObjectManager.CreateRenderPolyline(intersetPolyline2, cs, rootId);
                        //rpl2.Glow(-1);


                        foreach (IFeatureClass fc in fcMap.Keys)
                        {
                            ISpatialFilter sp = new SpatialFilter();
                            sp.Geometry      = intersetPolyline;
                            sp.SpatialRel    = gviSpatialRel.gviSpatialRelIntersects;
                            sp.GeometryField = "Geometry";
                            IFdeCursor cursor = null;
                            try
                            {
                                cursor = fc.Search(sp, false);
                                IRowBuffer row = null;
                                while ((row = cursor.NextRow()) != null)
                                {
                                    int         index = row.FieldIndex("Geometry");
                                    IModelPoint mp    = row.GetValue(index) as IModelPoint;
                                    //DrawEnvelope(mp.Envelope, mp.SpatialCRS, out rPolylinelist);
                                    //rPolylinelistWhole.AddRange(rPolylinelist);

                                    //创建RenderModelPoint,显示轮廓线
                                    //IModelPointSymbol mps = new ModelPointSymbol();
                                    //mps.Color = 0; //防止与瓦片同时显示时打架
                                    //mps.EnableColor = true;
                                    //mps.SetResourceDataSet(fc.FeatureDataSet);
                                    //IRenderModelPoint rmp = this.axRenderControl1.ObjectManager.CreateRenderModelPoint(mp, mps, rootId);
                                    //rmp.ShowOutline = true;
                                    //modelpointList.Add(rmp);

                                    //创建RenderModelPoint,禁止深度检测
                                    IModelPointSymbol mps = new ModelPointSymbol();
                                    mps.Color         = System.Drawing.Color.Red;
                                    mps.EnableColor   = true;
                                    mps.EnableTexture = false;
                                    mps.SetResourceDataSet(fc.FeatureDataSet);
                                    IRenderModelPoint rmp = this.axRenderControl1.ObjectManager.CreateRenderModelPoint(mp, mps, rootId);
                                    rmp.DepthTestMode = gviDepthTestMode.gviDepthTestDisable; //防止与瓦片同时显示时打架
                                    modelpointList.Add(rmp);

                                    //创建TableLabel
                                    if (fde_point == null)
                                    {
                                        fde_point = (new GeometryFactory()).CreatePoint(gviVertexAttribute.gviVertexAttributeZ);
                                    }
                                    fde_point.Position   = mp.Position;
                                    fde_point.SpatialCRS = mp.SpatialCRS;
                                    tableLabelList.Add(DrawTableLabel(row, fde_point));
                                }
                            }
                            catch (COMException ex)
                            {
                                System.Diagnostics.Trace.WriteLine(ex.Message);
                            }
                            finally
                            {
                                if (cursor != null)
                                {
                                    //System.Runtime.InteropServices.//Marshal.ReleaseComObject(cursor);
                                    cursor = null;
                                }
                            }
                        }
                    }
                }
            }
        }