private void PloyConSelectCallback(GraphicsLayer gLayer, IGraphics graphics, List <Point> logPntArr) { if (logPntArr.Count > 2) { ZDIMS.BaseLib.Polygon ploy = new ZDIMS.BaseLib.Polygon(); ploy.Dots = new Dot_2D[logPntArr.Count + 1]; for (int i = 0; i < logPntArr.Count; i++) { ploy.Dots[i] = new Dot_2D() { x = logPntArr[i].X, y = logPntArr[i].Y }; } ploy.Dots[ploy.Dots.Length - 1] = ploy.Dots[0]; if (m_catalog.ActiveMapDoc != null && m_catalog.ActiveMapDoc.Display) { m_mapDocConditionInput.SelectionType = SelectionType.Both; m_mapDocConditionInput.QueryGeoObj = ploy; m_mapDocConditionInput.Show(); } if (m_catalog.ActiveLayerObj != null && m_catalog.ActiveLayerObj.Display) { m_layerConditionInput.SelectionType = SelectionType.Both; m_layerConditionInput.QueryGeoObj = ploy; m_layerConditionInput.Show(); } } }
/// <summary> /// 添加区 /// </summary> /// <param name="gLayer">GraphicsLayer图层对象</param> /// <param name="graphics">绘图对象</param> /// <param name="logPntArr">绘图保存的逻辑坐标数组</param> public void AddArea(GraphicsLayer gLayer, IGraphics graphics, List <Point> logPntArr) { if (ActiveMapDoc != null && logPntArr.Count > 0) { if (ActiveMapDoc.ActiveLayerIndex < 0) { MessageBox.Show("请激活文档的一个区图层", "提示", MessageBoxButton.OK); return; } SFclsGeomType type = ActiveMapDoc.ActiveLayerGeoType; if (!type.Equals(SFclsGeomType.Reg)) { MessageBox.Show("当前图层不能添加该几何类型的要素", "提示", MessageBoxButton.OK); return; } ZDIMS.BaseLib.Polygon polygon = new ZDIMS.BaseLib.Polygon(); polygon.Dots = new Dot_2D[logPntArr.Count]; for (int i = 0; i < logPntArr.Count; i++) { polygon.Dots[i] = new Dot_2D() { x = logPntArr[i].X, y = logPntArr[i].Y }; } m_targetGeo = polygon; GetActiveLayerAttStruct(); } }
/// <summary> /// 添加区 /// </summary> /// <param name="gLayer">GraphicsLayer图层对象</param> /// <param name="graphics">绘图对象</param> /// <param name="logPntArr">绘图保存的逻辑坐标数组</param> public void AddArea(GraphicsLayer gLayer, IGraphics graphics, List <Point> logPntArr) { if (ActiveLayerObj != null && logPntArr.Count > 0) { if (ActiveLayerObj.ActiveGdbIndex < 0 || ActiveLayerObj.ActiveLayerIndex < 0) { MessageBox.Show("请激活矢量图层的一个区图层", "提示", MessageBoxButton.OK); return; } ZDIMS.BaseLib.Polygon polygon = new ZDIMS.BaseLib.Polygon(); polygon.Dots = new Dot_2D[logPntArr.Count]; for (int i = 0; i < logPntArr.Count; i++) { polygon.Dots[i] = new Dot_2D() { x = logPntArr[i].X, y = logPntArr[i].Y }; } m_targetGeo = polygon; CSetLayerIndex setIdx = new CSetLayerIndex(); setIdx.GdbIndex = ActiveLayerObj.ActiveGdbIndex; setIdx.LayerIndex = ActiveLayerObj.ActiveLayerIndex; ActiveLayerObj.GetGeomType(setIdx, new UploadStringCompletedEventHandler(CheckPolyType)); } }
/// <summary> /// 多边形查询回调 /// </summary> private void PolySelect(GraphicsLayer gLayer, IGraphics graphics, List <Point> logPntArr) { if (logPntArr.Count > 2) { ZDIMS.BaseLib.Polygon poly = new ZDIMS.BaseLib.Polygon(); poly.Dots = new Dot_2D[logPntArr.Count + 1]; for (int i = 0; i < logPntArr.Count; i++) { poly.Dots[i] = new Dot_2D() { x = logPntArr[i].X, y = logPntArr[i].Y }; } poly.Dots[poly.Dots.Length - 1] = poly.Dots[0]; this.select(poly, SelectionType.SpatialRange); } }
/// <summary> /// 多边形查询 /// </summary> /// <param name="gLayer"></param> /// <param name="graphics"></param> /// <param name="logPntArr"></param> public void LayerPloySelect(GraphicsLayer gLayer, IGraphics graphics, List <Point> logPntArr) { if (logPntArr.Count > 2) { ZDIMS.BaseLib.Polygon ploy = new ZDIMS.BaseLib.Polygon(); ploy.Dots = new Dot_2D[logPntArr.Count + 1]; for (int i = 0; i < logPntArr.Count; i++) { ploy.Dots[i] = new Dot_2D() { x = logPntArr[i].X, y = logPntArr[i].Y }; } if (dot == null) { dot = new Dot_2D[ploy.Dots.Length]; } ploy.Dots[ploy.Dots.Length - 1] = ploy.Dots[0]; dot = ploy.Dots; } this.clipLayer(); }