private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { TopoPolygon SelectedTopoPolygon = sTopoPolygonSet.TopoPolygonList[comboBox1.SelectedIndex]; textBox1.Text = string.Format("PID:\t{0}\r\n弧段数:\t{1}\r\n周长:\t{2}\r\n面积:\t{3}", SelectedTopoPolygon.PID, SelectedTopoPolygon.TopologyArcs.Count, SelectedTopoPolygon.GetPerimeter().ToString("0.00"), SelectedTopoPolygon.GetArea().ToString("0.00")); }
private void agisControl_MouseDoubleClick(object sender, MouseEventArgs e) { MouseLocation = e.Location; GridDivisionScreenRefresh(); if (this.UserOperation != UserOperationType.DisplayInGrid || GridDivisionCount_X * EachGridDivisionCount_X < 1 || GridDivisionCount_Y * EachGridDivisionCount_Y < 1 || this.IsGridVisible == false) { return; } if (e.Clicks == 2 && this.IsQueryIntersection == true && this.ShowTopology == false && this.IsGridVisible == true) { SelectPointX = SelectPointY = -1; int gridScreen_AxisX_count = GridScreen_AxisX.Count; for (int i = 0; i < gridScreen_AxisX_count; i++) { if (Math.Abs(GridScreen_AxisX[i] - this.MouseLocation.X) < this.SelectPixelThreshold) { SelectPointX = this.agisControl.GetRealWorldLocX((float)GridScreen_AxisX[i]); } } int gridScreen_AxisY_count = GridScreen_AxisY.Count; for (int i = 0; i < gridScreen_AxisY_count; i++) { if (Math.Abs(GridScreen_AxisY[i] - this.MouseLocation.Y) < this.SelectPixelThreshold) { SelectPointY = this.agisControl.GetRealWorldLocY((float)GridScreen_AxisY[i]); } } //选中了格网点 if (SelectPointX != -1 && SelectPointY != -1 && agisControl.GridIntMethod != Mehtod.GridInterpolationMehtod.None) { this.agisControl.Refresh(); string MethodName = ""; string Para = ""; if (agisControl.GridIntMethod == Mehtod.GridInterpolationMehtod.方位加权平均法) { if (agisControl.方位加权平均法SectorNum < 0) { MessageBox.Show("按方位加权平均法 参数尚未设置", "错误"); return; } MethodName = "按方位加权平均法"; Para = string.Format("{0}:{1}", "每个象限等分扇区数N0", agisControl.方位加权平均法SectorNum / 4); } else if (agisControl.GridIntMethod == Mehtod.GridInterpolationMehtod.距离平方倒数法) { if (agisControl.距离平方倒数法NearPts < 0) { MessageBox.Show("距离平方倒数法 参数尚未设置", "错误"); return; } MethodName = "距离平方倒数法"; Para = string.Format("{0}:{1}", "选取距插值点最近的N个点", agisControl.距离平方倒数法NearPts); } MessageBox.Show(string.Format("{0}\t\r\nX:{1}\t\nY:{2}\t\r\nValue:{3}\r\n\r\n{4}\r\n{5}", "格网点属性信息:", SelectPointX.ToString("0.00"), SelectPointY.ToString("0.00"), agisControl.GetGridInterpolationValue(SelectPointX, SelectPointY).ToString("0.000"), "插值方法:" + MethodName, Para ), "属性查询"); } } if (e.Clicks == 2 && this.IsQueryTopoPolygon == true && this.ShowTopology == true && this.ShowTopoPolygon == true) { TopoPoint clickLoc = new TopoPoint(agisControl.GetRealWorldLocX(e.X), agisControl.GetRealWorldLocX(e.Y), 0, false); this.SelectedTopoPolygon = this.mTopoPolygonSet.GetClickPointInsidePolygon(clickLoc); this.agisControl.Refresh(); if (SelectedTopoPolygon != null) { MessageBox.Show(string.Format("PID:{0}\r\n弧段数:{1}\r\n周长:{2}\r\n面积:{3}", SelectedTopoPolygon.PID, SelectedTopoPolygon.TopologyArcs.Count, SelectedTopoPolygon.GetPerimeter().ToString("0.00"), SelectedTopoPolygon.GetArea().ToString("0.00")), "多边形信息"); } } }