public override void Run(object sender, System.EventArgs e) { Map2DCommandManager.Push(this); IMap2DView mapView = UCService.GetContent(typeof(Map2DView)) as Map2DView; if (mapView == null) { return; } bool bBind = mapView.Bind(this); if (!bBind) { return; } m_App = DF2DApplication.Application; if (m_App == null || m_App.Current2DMapControl == null) { return; } m_MapControl = m_App.Current2DMapControl; m_FocusMap = m_App.Current2DMapControl.ActiveView.FocusMap; SaveEditing(m_FocusMap); }
public override void Run(object sender, System.EventArgs e) { Map2DCommandManager.Push(this); IMap2DView mapView = UCService.GetContent(typeof(Map2DView)) as Map2DView; if (mapView == null) { return; } bool bBind = mapView.Bind(this); if (!bBind) { return; } DF2DApplication app = DF2DApplication.Application; if (app == null || app.Current2DMapControl == null) { return; } m_ActiveView = app.Current2DMapControl.ActiveView; m_Display = app.Current2DMapControl.ActiveView.ScreenDisplay; app.Current2DMapControl.MousePointer = esriControlsMousePointer.esriPointerArrow; }
public override void Run(object sender, System.EventArgs e) { DF2DApplication app = DF2DApplication.Application; if (app == null || app.Current2DMapControl == null) { return; } ComboBoxEdit cbEdit = sender as ComboBoxEdit; string type = cbEdit.SelectedItem.ToString(); if (type != null) { switch (type) { case "相交": Class.SelectionEnv.SelectRelation = 1; break; case "包含": Class.SelectionEnv.SelectRelation = 8; break; } } else { } }
public override void Run(object sender, System.EventArgs e) { Map2DCommandManager.Push(this); IMap2DView mapView = UCService.GetContent(typeof(Map2DView)) as Map2DView; if (mapView == null) { return; } bool bBind = mapView.Bind(this); if (!bBind) { return; } DF2DApplication app = DF2DApplication.Application; if (app == null || app.Current2DMapControl == null || app.Workbench == null) { return; } app.Workbench.SetMenuEnable(false); app.Current2DMapControl.MousePointer = esriControlsMousePointer.esriPointerArrow; //FrmCompoundConditionStats2D dialog = new FrmCompoundConditionStats2D(); //dialog.SetData(LogicDataStructureManage2D.Instance.RootLogicGroups, LogicDataStructureManage2D.Instance.RootMajorClasses, null); //dialog.ShowDialog(); }
public override void Run(object sender, EventArgs e) { Map2DCommandManager.Push(this); mapView = UCService.GetContent(typeof(Map2DView)) as Map2DView; bool bBind = mapView.Bind(this); if (!bBind) { return; } app = (DF2DApplication)this.Hook; if (app == null || app.Current2DMapControl == null) { return; } m_pMapControl = app.Current2DMapControl; m_pMap = m_pMapControl.Map; m_pActiveView = m_pMapControl.ActiveView; if (mapView == null) { return; } else { m_arrPntLayer = new ArrayList(); GetPointLayer(); } }
public bool IsValid(object caller, ICSharpCode.Core.Condition condition) { bool hasUndos = false; DF2DApplication app = DF2DApplication.Application; if (app == null || app.Current2DMapControl == null) { return(false); } IWorkspaceEdit pWorkspaceEdit = Class.Common.CurWspEdit; if (pWorkspaceEdit == null) { return(false); } if (pWorkspaceEdit.IsBeingEdited()) { pWorkspaceEdit.HasUndos(ref hasUndos); if (hasUndos) { return(true); } else { return(false); } } else { return(false); } }
private void _3DLink2D(double x, double y, double z) { if (b3To2 || b2To3) { b3To2 = false; b2To3 = false; return; } b3To2 = true; DF2DApplication app2D = DF2DApplication.Application; DF3DApplication app3D = DF3DApplication.Application; if (app2D == null || app3D == null || app2D.Current2DMapControl == null || app3D.Current3DMapControl == null) { return; } ICamera camera3D = app3D.Current3DMapControl.Camera; Gvitech.CityMaker.Math.IEulerAngle angle = new Gvitech.CityMaker.Math.EulerAngle(); Gvitech.CityMaker.Math.IVector3 pos = new Gvitech.CityMaker.Math.Vector3(); camera3D.GetCamera(out pos, out angle); ESRI.ArcGIS.Geometry.IEnvelope env = app2D.Current2DMapControl.Extent; double width = env.XMax - env.XMin; double height = env.YMax - env.YMin; double rate = width / height; double xmin, ymin, xmax, ymax; Link2DAnd3D._3DLink2D(x, y, z, Math.Abs(angle.Tilt * Math.PI / 180), camera3D.VerticalFieldOfView * Math.PI / 180, rate, out xmin, out ymin, out xmax, out ymax); ESRI.ArcGIS.Geometry.IEnvelope env1 = new ESRI.ArcGIS.Geometry.EnvelopeClass(); env1.PutCoords(xmin, ymin, xmax, ymax); app2D.Current2DMapControl.Extent = env1; }
public override void Run(object sender, EventArgs e) { mapView = UCService.GetContent(typeof(Map2DView)) as Map2DView; if (mapView == null) { return; } bool bBind = mapView.Bind(this); if (!bBind) { return; } app = (DF2DApplication)this.Hook; if (app == null || app.Current2DMapControl == null) { return; } m_pMapControl = app.Current2DMapControl; //道路检测 PipeRoadCheck(); WaitForm.Stop(); FormCheckResult dlg = new FormCheckResult(dict, m_pMapControl); dlg.Text = this.CommandName; dlg.Show(); }
public override void Run(object sender, System.EventArgs e) { Map2DCommandManager.Push(this); IMap2DView mapView = UCService.GetContent(typeof(Map2DView)) as Map2DView; if (mapView == null) { return; } bool bBind = mapView.Bind(this); if (!bBind) { return; } DF2DApplication app = DF2DApplication.Application; if (app == null || app.Current2DMapControl == null) { return; } if (Class.Common.CurEditLayer != null) { System.Windows.Forms.Form mainForm = (System.Windows.Forms.Form)app.Workbench; Form.frmLayerProperty frm = new Form.frmLayerProperty(); frm.FeatureLayer = Class.Common.CurEditLayer as IFeatureLayer; frm.MapControl = app.Current2DMapControl; if (frm.ShowDialog(mainForm) == System.Windows.Forms.DialogResult.OK) { app.Current2DMapControl.ActiveView.Refresh(); } } }
public override void Run(object sender, System.EventArgs e) { Map2DCommandManager.Push(this); IMap2DView mapView = UCService.GetContent(typeof(Map2DView)) as Map2DView; if (mapView == null) { return; } bool bBind = mapView.Bind(this); if (!bBind) { return; } DF2DApplication app = DF2DApplication.Application; if (app == null || app.Current2DMapControl == null) { return; } FrmCertainLoc frmCertainLoc = new FrmCertainLoc(); frmCertainLoc.Show(); }
public override void Run(object sender, System.EventArgs e) { IMap2DView mapView = UCService.GetContent(typeof(Map2DView)) as Map2DView; if (mapView == null) { return; } bool bBind = mapView.Bind(this); if (!bBind) { return; } DF2DApplication app = DF2DApplication.Application; if (app == null || app.Current2DMapControl == null) { return; } IExtentStack pExtentStack = app.Current2DMapControl.ActiveView.ExtentStack; if (pExtentStack.CanRedo()) { pExtentStack.Redo(); } app.Current2DMapControl.ActiveView.Refresh(); }
public override void Run(object sender, System.EventArgs e) { Map2DCommandManager.Push(this); IMap2DView mapView = UCService.GetContent(typeof(Map2DView)) as Map2DView; if (mapView == null) { return; } Layer2DTreePad wsPad = (Layer2DTreePad)UCService.GetContent(typeof(Layer2DTreePad)); this.treelist = wsPad.TreeList; bool bBind = mapView.Bind(this); if (!bBind) { return; } DF2DApplication app = DF2DApplication.Application; if (app == null || app.Current2DMapControl == null || app.Workbench == null) { return; } app.Workbench.SetMenuEnable(false); app.Current2DMapControl.MousePointer = esriControlsMousePointer.esriPointerArrow; FrmMajorClass.Instance.Show(); }
public override void Run(object sender, System.EventArgs e) { Map2DCommandManager.Push(this); IMap2DView mapView = UCService.GetContent(typeof(Map2DView)) as Map2DView; if (mapView == null) { return; } bool bBind = mapView.Bind(this); if (!bBind) { return; } m_App = DF2DApplication.Application; if (m_App == null || m_App.Current2DMapControl == null) { return; } m_MapControl = m_App.Current2DMapControl; Class.Common.CutObjects(m_MapControl); m_App.Workbench.UpdateMenu(); }
public override void RestoreEnv() { if (this._uc != null) { this._uc.RestoreEnv(); this._uc.Dispose(); this._uc = null; } if (this._uPanel != null) { this._uPanel.GetControlContainer().Controls.Clear(); this._uPanel.Close(); this._uPanel = null; } IMap2DView mapView = UCService.GetContent(typeof(Map2DView)) as Map2DView; if (mapView == null) { return; } DF2DApplication app = DF2DApplication.Application; if (app == null || app.Current2DMapControl == null || app.Workbench == null) { return; } //app.Workbench.SetMenuEnable(true); IGraphicsContainer gc = app.Current2DMapControl.Map as IGraphicsContainer; gc.DeleteAllElements(); app.Current2DMapControl.ActiveView.Refresh(); mapView.UnBind(this); WaitForm.Stop(); Map2DCommandManager.Pop(); }
public override void Run(object sender, System.EventArgs e) { Map2DCommandManager.Push(this); IMap2DView mapView = UCService.GetContent(typeof(Map2DView)) as Map2DView; if (mapView == null) { return; } bool bBind = mapView.Bind(this); if (!bBind) { return; } DF2DApplication app = DF2DApplication.Application; if (app == null || app.Current2DMapControl == null || app.Workbench == null) { return; } //app.Workbench.SetMenuEnable(false); app.Current2DMapControl.MousePointer = esriControlsMousePointer.esriPointerArrow; _bFinished = true; }
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) { return; } 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 pGeo = band.TrackNew(m_Display, null); app.Current2DMapControl.DrawShape(pGeo, ref symbol); WaitForm.Start("正在查询...", "请稍后"); if (pGeo.IsEmpty) { IPoint searchPoint = new PointClass(); searchPoint.PutCoords(mapX, mapY); pGeo = PublicFunction.DoBuffer(searchPoint, PublicFunction.ConvertPixelsToMapUnits(m_ActiveView, GlobalValue.System_Selection_Option().Tolerate)); //m_ActiveView.FocusMap.SelectByShape(geo, s, false); } if (ready) { IMap pMap = app.Current2DMapControl.Map; ISelectionEnvironment selEnv = new SelectionEnvironmentClass(); pMap.SelectByShape(pGeo, selEnv, false); ISelection pSelection = pMap.FeatureSelection; FrmDxfExport dialog = new FrmDxfExport(pSelection, pMap); WaitForm.Stop(); dialog.ShowDialog(); } } } catch (System.Exception ex) { WaitForm.Stop(); } }
public override void Execute() { base.Execute(); if (!(this.Hook is IDFApplication)) { return; } else { m_App = (IDFApplication)this.Hook; } m_MapView = m_App.Workbench.GetView(typeof(MapView)) as IMapView; if (m_MapView == null) { return; } m_MapView.CurrentTool = this; m_MapControl = m_App.CurrentMapControl; m_FocusMap = m_MapControl.ActiveView.FocusMap; m_pActiveView = (IActiveView)this.m_FocusMap; m_CurrentLayer = m_App.CurrentEditLayer; m_pStatusBarService = m_App.StatusBarService; //获得状态服务 CurrentTool.m_CurrentToolName = CurrentTool.CurrentToolName.modifyUnion; //CommonFunction.MapRefresh(m_pActiveView); }
public override void Run(object sender, System.EventArgs e) { Map2DCommandManager.Push(this); IMap2DView mapView = UCService.GetContent(typeof(Map2DView)) as Map2DView; if (mapView == null) { return; } bool bBind = mapView.Bind(this); if (!bBind) { return; } m_App = DF2DApplication.Application; if (m_App == null || m_App.Current2DMapControl == null) { return; } m_pActiveView = m_App.Current2DMapControl.ActiveView; m_FocusMap = m_App.Current2DMapControl.ActiveView.FocusMap; Class.Common.MapRefresh(m_pActiveView); RedoEditing(m_FocusMap); m_App.Workbench.UpdateMenu(); }
private void FrmSheetLoc_FormClosed(object sender, FormClosedEventArgs e) { DF2DApplication app = DF2DApplication.Application; app.Current2DMapControl.ActiveView.GraphicsContainer.DeleteAllElements(); app.Current2DMapControl.ActiveView.Refresh(); }
public override void Run(object sender, System.EventArgs e) { Map2DCommandManager.Push(this); IMap2DView mapView = UCService.GetContent(typeof(Map2DView)) as Map2DView; if (mapView == null) { return; } bool bBind = mapView.Bind(this); if (!bBind) { return; } m_App = DF2DApplication.Application; if (m_App == null || m_App.Current2DMapControl == null) { return; } m_MapControl = m_App.Current2DMapControl; m_FocusMap = m_MapControl.ActiveView.FocusMap; m_pActiveView = (IActiveView)this.m_FocusMap; m_MapControl.MousePointer = esriControlsMousePointer.esriPointerCrosshair; Class.Common.MapRefresh(m_pActiveView); m_App.Workbench.SetStatusInfo("快捷键提示:A:输入绝对XY坐标"); }
public override void Run(object sender, System.EventArgs e) { Map2DCommandManager.Push(this); IMap2DView mapView = UCService.GetContent(typeof(Map2DView)) as Map2DView; if (mapView == null) { return; } bool bBind = mapView.Bind(this); if (!bBind) { return; } m_App = DF2DApplication.Application; if (m_App == null || m_App.Current2DMapControl == null) { return; } m_MapControl = m_App.Current2DMapControl; m_FocusMap = m_MapControl.ActiveView.FocusMap; m_pActiveView = (IActiveView)this.m_FocusMap; m_MapControl.MousePointer = esriControlsMousePointer.esriPointerCrosshair; m_dblTolerance = Class.Common.ConvertPixelsToMapUnits(m_MapControl.ActiveView, 4); Class.Common.MapRefresh(m_pActiveView); m_App.Workbench.SetStatusInfo("提示:依次指定1.圆心;2.圆周上的一点。(A:绝对XY/ESC:取消/ENTER:结束)");//向状态栏传送提示信息 }
private void _2DLink3D() { if (b3To2 || b2To3) { b3To2 = false; b2To3 = false; return; } b2To3 = true; DF2DApplication app2D = DF2DApplication.Application; DF3DApplication app3D = DF3DApplication.Application; if (app2D == null || app3D == null || app2D.Current2DMapControl == null || app3D.Current3DMapControl == null) { return; } ESRI.ArcGIS.Geometry.IEnvelope env = app2D.Current2DMapControl.Extent; ICamera camera3D = app3D.Current3DMapControl.Camera; Gvitech.CityMaker.Math.IEulerAngle angle = new Gvitech.CityMaker.Math.EulerAngle(); Gvitech.CityMaker.Math.IVector3 pos = new Gvitech.CityMaker.Math.Vector3(); camera3D.GetCamera(out pos, out angle); double ox, oy, oz; Link2DAnd3D._2DLink3D(env.XMin, env.XMax, env.YMin, env.YMax, Math.Abs(angle.Tilt * Math.PI / 180), camera3D.VerticalFieldOfView * Math.PI / 180, out ox, out oy, out oz); pos.Set(ox, oy, oz); camera3D.SetCamera(pos, angle, gviSetCameraFlags.gviSetCameraNoFlags); }
public override void Run(object sender, EventArgs e) { mapView = UCService.GetContent(typeof(Map2DView)) as Map2DView; if (mapView == null) { return; } bool bBind = mapView.Bind(this); if (!bBind) { return; } app = (DF2DApplication)this.Hook; if (app == null || app.Current2DMapControl == null) { return; } m_pMapControl = app.Current2DMapControl; FrmStatsByRoad2D frmStatsByRoad2D = new FrmStatsByRoad2D(this.CommandName, "Road"); if (frmStatsByRoad2D.ShowDialog() != DialogResult.OK) { return; } DataTable dt = frmStatsByRoad2D.DTTemp; DataTable dtstats = frmStatsByRoad2D.DTStats; FrmStatsByRoadOutput2D frmStatsByRoadOutput2D = new FrmStatsByRoadOutput2D(); frmStatsByRoadOutput2D.SetData(dt); frmStatsByRoadOutput2D.SetStatsData(dtstats); frmStatsByRoadOutput2D.Show(); }
public override void Run(object sender, System.EventArgs e) { Map2DCommandManager.Push(this); IMap2DView mapView = UCService.GetContent(typeof(Map2DView)) as Map2DView; if (mapView == null) { return; } bool bBind = mapView.Bind(this); if (!bBind) { return; } m_App = DF2DApplication.Application; if (m_App == null || m_App.Current2DMapControl == null) { return; } m_MapControl = m_App.Current2DMapControl; m_MapControl.MousePointer = esriControlsMousePointer.esriPointerArrow; m_ActiveView = m_MapControl.ActiveView; m_Display = m_ActiveView.ScreenDisplay; this.m_pCurEditLayer = Class.Common.CurEditLayer as IFeatureLayer; if (Class.Common.System_ModifyFeature_Form == null) { Class.Common.System_ModifyFeature_Form = new Form.frmModifyFeaturePro(); Class.Common.System_ModifyFeature_Form.MapControl = m_MapControl; Class.Common.System_ModifyFeature_Form.Show(); } }
public override void Run(object sender, System.EventArgs e) { Map2DCommandManager.Push(this); IMap2DView mapView = UCService.GetContent(typeof(Map2DView)) as Map2DView; if (mapView == null) { return; } bool bBind = mapView.Bind(this); if (!bBind) { return; } m_App = DF2DApplication.Application; if (m_App == null || m_App.Current2DMapControl == null) { return; } m_MapControl = m_App.Current2DMapControl; this.m_ActiveView = m_MapControl.ActiveView; this.m_Display = m_ActiveView.ScreenDisplay; this.m_pCurEditLayer = Class.Common.CurEditLayer as IFeatureLayer; }
public override void Run(object sender, EventArgs e) { Map2DCommandManager.Push(this); IMap2DView mapView = UCService.GetContent(typeof(Map2DView)) as Map2DView; if (mapView == null) { return; } bool bBind = mapView.Bind(this); if (!bBind) { return; } app = DF2DApplication.Application; if (app == null || app.Current2DMapControl == null || app.Workbench == null) { return; } //app.Workbench.SetMenuEnable(false); m_ActiveView = app.Current2DMapControl.ActiveView; m_Display = app.Current2DMapControl.ActiveView.ScreenDisplay; pGraphicsContainer = app.Current2DMapControl.ActiveView.GraphicsContainer; app.Current2DMapControl.MousePointer = esriControlsMousePointer.esriPointerArrow; }
public override void Run(object sender, EventArgs e) { mapView = UCService.GetContent(typeof(Map2DView)) as Map2DView; if (mapView == null) { return; } bool bBind = mapView.Bind(this); if (!bBind) { return; } app = (DF2DApplication)this.Hook; if (app == null || app.Current2DMapControl == null) { return; } m_pMapControl = app.Current2DMapControl; m_pActiveView = m_pMapControl.ActiveView; m_FocusMap = m_pMapControl.ActiveView.FocusMap; /* IEnvelope pEnv = this.m_pMapControl.TrackRectangle();*/ // IGeometry pGeo = pEnv as IGeometry; // this.m_pMapControl.Map.SelectByShape(pGeo, null, false); // this.m_pMapControl.Map.ClearSelection(); // this.m_pMapControl.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeoSelection, null, m_pActiveView.Extent); // IRectangleElement rectangleElement = new RectangleElementClass(); // IElement pelement = (IElement)rectangleElement; // pelement.Geometry = pEnv; // pGraphicsContainer = this.m_pMapControl.ActiveView as IGraphicsContainer; // pGraphicsContainer.AddElement(pelement, 0); this.m_pMapControl.ActiveView.GraphicsContainer.DeleteAllElements(); // IGraphicsContainerSelect graphicsContainerSelect = (IGraphicsContainerSelect)this.m_pMapControl; // if (graphicsContainerSelect != null) // { // IEnumElement enumElement = graphicsContainerSelect.SelectedElements; // if (enumElement == null) return; // // enumElement.Reset(); // // IMap pMap = this.m_pMapControl.ActiveView.FocusMap; // // IElement element = enumElement.Next(); // if (element != null) // { // if (element == app.Current2DMapControl.ActiveView.GraphicsContainer.FindFrame(pMap)) // { // System.Windows.Forms.MessageBox.Show("地图数据框不可删除", "错误"); // } // else // { // this.m_pMapControl.ActiveView.GraphicsContainer.DeleteElement(element); // } // element = enumElement.Next(); // } this.m_pMapControl.ActiveView.Refresh(); }
public override void Run(object sender, System.EventArgs e) { DF2DApplication app = DF2DApplication.Application; IMap map = app.Current2DMapControl.Map; FrmSpecialMap dialog = new FrmSpecialMap(map); dialog.Show(); }
private void btn_close_Click(object sender, EventArgs e) { this.Close(); DF2DApplication app = DF2DApplication.Application; app.Current2DMapControl.ActiveView.GraphicsContainer.DeleteAllElements(); app.Current2DMapControl.ActiveView.Refresh(); }
public override void RestoreEnv() { IMap2DView mapView = UCService.GetContent(typeof(Map2DView)) as Map2DView; if (mapView == null) return; mapView.UnBind(this); DF2DApplication app = DF2DApplication.Application; if (app == null || app.Current2DMapControl == null) return; app.Current2DMapControl.MousePointer = esriControlsMousePointer.esriPointerDefault; Map2DCommandManager.Pop(); }