/// <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> /// <param name="gLayer">GraphicsLayer图层对象</param> /// <param name="graphics">绘图对象</param> /// <param name="logPntArr">绘图保存的逻辑坐标数组</param> public void AddLine(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; } AnyLine line = new AnyLine(); line.Arcs = new Arc[1]; Arc arc = new Arc(); arc.Dots = new Dot_2D[logPntArr.Count]; for (int i = 0; i < logPntArr.Count; i++) { arc.Dots[i] = new Dot_2D() { x = logPntArr[i].X, y = logPntArr[i].Y }; } line.Arcs[0] = arc; m_targetGeo = line; CSetLayerIndex setIdx = new CSetLayerIndex(); setIdx.GdbIndex = ActiveLayerObj.ActiveGdbIndex; setIdx.LayerIndex = ActiveLayerObj.ActiveLayerIndex; ActiveLayerObj.GetGeomType(setIdx, new UploadStringCompletedEventHandler(CheckLineType)); } }
private void SubmitForEdit(object sender, RoutedEventArgs e) { CSetLayerIndex setLayerIdx = new CSetLayerIndex() { GdbIndex = ActiveLayerObj.ActiveGdbIndex, LayerIndex = ActiveLayerObj.ActiveLayerIndex }; ActiveLayerObj.GetGeomType(setLayerIdx, new UploadStringCompletedEventHandler(GetTypeForEdit)); }
/// <summary> /// 添加点 /// </summary> /// <param name="gLayer">GraphicsLayer图层对象</param> /// <param name="graphics">绘图对象</param> /// <param name="logPntArr">绘图保存的逻辑坐标数组</param> public void AddDot(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; } Dot_2D dot = new Dot_2D(); dot.x = logPntArr[0].X; dot.y = logPntArr[0].Y; m_targetGeo = dot; CSetLayerIndex setIdx = new CSetLayerIndex(); setIdx.GdbIndex = ActiveLayerObj.ActiveGdbIndex; setIdx.LayerIndex = ActiveLayerObj.ActiveLayerIndex; ActiveLayerObj.GetGeomType(setIdx, new UploadStringCompletedEventHandler(CheckPointType)); } }