private void OnFinishedDraw() { if (this._drawTool != null && this._drawTool.GeoType == DrawType.Polygon && this._drawTool.GetGeo() != null) { try { WaitForm.Start("正在空间查询...", "请稍后"); bHaveRes = false; RegionAnalysis(); if (!bHaveRes) { WaitForm.Stop(); XtraMessageBox.Show("空间查询为空!", "提示"); return; } WaitForm.Stop(); FrmCompoundConditionQuery dialog = new FrmCompoundConditionQuery(); dialog.SetData(resRootLogicGroups, resRootMajorClasses, this._drawTool.GetGeo()); if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { this._uPanel = new UIDockPanel("查询结果", "查询结果", this.Location, this._width, this._height); this._dockPanel = FloatPanelManager.Instance.Add(ref this._uPanel, DockingStyle.Right); this._dockPanel.Visibility = DockVisibility.Visible; this._dockPanel.FloatSize = new System.Drawing.Size(this._width, this._height); this._dockPanel.Width = this._width; this._dockPanel.Height = this._height; this._uc = new UCPropertyInfo(); this._uc.Init(); this._uc.Dock = System.Windows.Forms.DockStyle.Fill; this._uPanel.RegisterEvent(new PanelClose(this.Close)); this._dockPanel.Controls.Add(this._uc); this._uc.SetPropertyInfo(dialog.Dict, dialog.FacType, this._drawTool.GetGeo().Clone2(gviVertexAttribute.gviVertexAttributeNone)); } } catch (Exception ex) { WaitForm.Stop(); } } }
public override void Run(object sender, EventArgs e) { FrmCompoundConditionQuery dialog = new FrmCompoundConditionQuery(); dialog.SetData(LogicDataStructureManage3D.Instance.RootLogicGroups, LogicDataStructureManage3D.Instance.RootMajorClasses, null); if (dialog.ShowDialog() != System.Windows.Forms.DialogResult.OK) { return; } this._uPanel = new UIDockPanel("查询结果", "查询结果", this.Location, this._width, this._height); this._dockPanel = FloatPanelManager.Instance.Add(ref this._uPanel, DockingStyle.Right); this._dockPanel.Visibility = DockVisibility.Visible; this._dockPanel.FloatSize = new System.Drawing.Size(this._width, this._height); this._dockPanel.Width = this._width; this._dockPanel.Height = this._height; this._uc = new UCPropertyInfo(); this._uc.Init(); this._uc.Dock = System.Windows.Forms.DockStyle.Fill; this._uPanel.RegisterEvent(new PanelClose(this.Close)); this._dockPanel.Controls.Add(this._uc); this._uc.SetPropertyInfo(dialog.Dict, dialog.FacType); }
public override void OnMouseDown(int button, int shift, int x, int y, double mapX, double mapY) { DF2DApplication app = DF2DApplication.Application; bool ready = true; if (app == null || app.Current2DMapControl == null || app.Workbench == null) { return; } app.Workbench.SetMenuEnable(true); m_ActiveView = app.Current2DMapControl.ActiveView; IScreenDisplay m_Display = app.Current2DMapControl.ActiveView.ScreenDisplay; try { if (button == 1) { ISimpleLineSymbol pLineSym = new SimpleLineSymbol(); IRgbColor pColor = new RgbColorClass(); pColor.Red = 255; pColor.Green = 255; pColor.Blue = 0; pLineSym.Color = pColor; pLineSym.Style = esriSimpleLineStyle.esriSLSSolid; pLineSym.Width = 2; ISimpleFillSymbol pFillSym = new SimpleFillSymbol(); pFillSym.Color = pColor; pFillSym.Style = esriSimpleFillStyle.esriSFSDiagonalCross; pFillSym.Outline = pLineSym; object symbol = pFillSym as object; IRubberBand band = new RubberPolygonClass(); IGeometry geo = band.TrackNew(m_Display, null); app.Current2DMapControl.DrawShape(geo, ref symbol); WaitForm.Start("正在查询...", "请稍后"); if (geo.IsEmpty) { IPoint searchPoint = new PointClass(); searchPoint.PutCoords(mapX, mapY); geo = PublicFunction.DoBuffer(searchPoint, PublicFunction.ConvertPixelsToMapUnits(m_ActiveView, GlobalValue.System_Selection_Option().Tolerate)); //m_ActiveView.FocusMap.SelectByShape(geo, s, false); } _geo = geo; spatialQuery = true; if (spatialQuery) { FrmCompoundConditionQuery dialog = new FrmCompoundConditionQuery(); dialog.SetData(LogicDataStructureManage2D.Instance.RootLogicGroups, LogicDataStructureManage2D.Instance.RootMajorClasses, _geo); WaitForm.Stop(); IMap2DView mapView = UCService.GetContent(typeof(Map2DView)) as Map2DView; mapView.UnBind(this); if (dialog.ShowDialog() != System.Windows.Forms.DialogResult.OK) { return; } this._uPanel = new UIDockPanel("查询结果", "查询结果", this.Location, this._width, this._height); this._dockPanel = FloatPanelManager.Instance.Add(ref this._uPanel, DockingStyle.Right); this._dockPanel.Visibility = DockVisibility.Visible; this._dockPanel.FloatSize = new System.Drawing.Size(this._width, this._height); this._dockPanel.Width = this._width; this._dockPanel.Height = this._height; this._uc = new UCPropertyInfo2D(); this._uc.Dock = System.Windows.Forms.DockStyle.Fill; this._uPanel.RegisterEvent(new PanelClose(this.Close)); this._dockPanel.Controls.Add(this._uc); this._uc.SetPropertyInfo(dialog.Dict); } } } catch { this.RestoreEnv(); } }