public override void Run(object sender, System.EventArgs e) { if (!Authority3DService.Instance.IsAuthorized) { XtraMessageBox.Show("该功能需要高级授权!", "提示"); return; } try { Map3DCommandManager.Push(this); 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 UCAlongRoadVisibility(); this._uc.Dock = System.Windows.Forms.DockStyle.Fill; this._uPanel.RegisterEvent(new PanelClose(this.Close)); this._dockPanel.Controls.Add(this._uc); } catch (Exception ex) { LoggingService.Error(ex.Message + "\r\n" + ex.StackTrace); } }
public override void Run(object sender, System.EventArgs e) { _isAuth = Authority3DService.Instance.IsAuthorized; //if (!_isAuth) //{ // XtraMessageBox.Show("此功能需要USB Key。", "提示"); // return; //} Map3DCommandManager.Push(this); IMap3DView map3DView = UCService.GetContent(typeof(Map3DView)) as Map3DView; if (map3DView == null) { return; } bool b3DBind = map3DView.Bind(this); if (!b3DBind) { return; } if (DF3DApplication.Application != null && DF3DApplication.Application.Current3DMapControl != null) { DF3DApplication.Application.Current3DMapControl.InteractMode = Gvitech.CityMaker.RenderControl.gviInteractMode.gviInteractSelect; DF3DApplication.Application.Current3DMapControl.MouseSelectObjectMask = Gvitech.CityMaker.RenderControl.gviMouseSelectObjectMask.gviSelectFeatureLayer; DF3DApplication.Application.Current3DMapControl.MouseSelectMode = Gvitech.CityMaker.RenderControl.gviMouseSelectMode.gviMouseSelectClick | Gvitech.CityMaker.RenderControl.gviMouseSelectMode.gviMouseSelectDrag; this._listRender = new List <Guid>(); } }
public override void Run(object sender, System.EventArgs e) { Map3DCommandManager.Push(this); IMap3DView map3DView = UCService.GetContent(typeof(Map3DView)) as Map3DView; if (map3DView == null) { return; } bool b3DBind = map3DView.Bind(this); if (!b3DBind) { return; } DF3DApplication app = DF3DApplication.Application; if (app == null || app.Current3DMapControl == null) { return; } app.Current3DMapControl.InteractMode = gviInteractMode.gviInteractSelect; app.Current3DMapControl.MouseSelectObjectMask = gviMouseSelectObjectMask.gviSelectFeatureLayer; app.Current3DMapControl.MouseSelectMode = gviMouseSelectMode.gviMouseSelectClick; }
public override void Run(object sender, EventArgs e) { bool _isAuth = Authority3DService.Instance.IsAuthorized; if (!_isAuth) { XtraMessageBox.Show("此功能需要USB Key。", "提示"); return; } DF3DApplication app = DF3DApplication.Application; if (app == null || app.Current3DMapControl == null || app.Workbench == null) { return; } Map3DCommandManager.Push(this); RenderControlEditServices.Instance().StopGeometryEdit(true); System.DateTime birthDay = System.DateTime.Now; if (CommonUtils.Instance().EnableTemproalEdit) { using (DateSettingDialog dateSettingDialog = new DateSettingDialog(true)) { if (dateSettingDialog.ShowDialog() != DialogResult.OK) { return; } birthDay = dateSettingDialog.Time; } } app.Workbench.SetMenuEnable(false); dlg = new FrmAddPipeBuild(); dlg.SetBirthDay(birthDay); dlg.Show(); dlg.FormClosed += new FormClosedEventHandler(dlg_FormClosed); }
public override void Run(object sender, System.EventArgs e) { Map3DCommandManager.Push(this); DF3DApplication app = DF3DApplication.Application; if (app == null || app.Current3DMapControl == null) { return; } app.Current3DMapControl.InteractMode = gviInteractMode.gviInteractWalk; }
public override void Run(object sender, System.EventArgs e) { Map3DCommandManager.Push(this); this._drawTool = DrawToolService.Instance.CreateDrawTool(DrawType.Circle); if (this._drawTool != null) { this._drawTool.OnStartDraw += new OnStartDraw(this.OnStartDraw); this._drawTool.OnFinishedDraw += new OnFinishedDraw(this.OnFinishedDraw); this._drawTool.Start(); } }
public override void Run(object sender, EventArgs e) { Map3DCommandManager.Push(this); DF3DApplication app = (DF3DApplication)this.Hook; if (app == null || app.Current3DMapControl == null) { return; } app.Current3DMapControl.InteractMode = gviInteractMode.gviInteractMeasurement; app.Current3DMapControl.MeasurementMode = gviMeasurementMode.gviMeasureVerticalDistance; }
public override void Run(object sender, System.EventArgs e) { Map3DCommandManager.Push(this); DF3DApplication app = DF3DApplication.Application; if (app == null || app.Current3DMapControl == null) { return; } app.Current3DMapControl.InteractMode = gviInteractMode.gviInteractNormal; app.Current3DMapControl.TransformHelper.Type = gviEditorType.gviEditorNone; app.Current3DMapControl.MouseSelectObjectMask = gviMouseSelectObjectMask.gviSelectAll; app.Current3DMapControl.MouseSelectMode = gviMouseSelectMode.gviMouseSelectMove; }
public override void Run(object sender, System.EventArgs e) { if (CommonUtils.Instance().CheckCurrentFeatureDatasetEncrypted()) { XtraMessageBox.Show("数据集已加密!", "提示信息"); } else { Map3DCommandManager.Push(this); RenderControlEditServices.Instance().StopGeometryEdit(true); //WorkSpaceServices.Instance().PropertyCanEdit = true; SplitDlg splitDlg = new SplitDlg(); splitDlg.Show(DF3DApplication.Application.Workbench); } }
public override void Run(object sender, EventArgs e) { Map3DCommandManager.Push(this); DF3DApplication app = DF3DApplication.Application; if (app == null || app.Current3DMapControl == null || app.Workbench == null) { return; } app.Workbench.SetMenuEnable(false); FrmNormalRegionQuery.Instance.Show(); FrmNormalRegionQuery.Instance.Init(); FrmNormalRegionQuery.Instance.FormClosed += new System.Windows.Forms.FormClosedEventHandler(Instance_FormClosed); }
public override void Run(object sender, System.EventArgs e) { try { if (DF3DApplication.Application == null || DF3DApplication.Application.Current3DMapControl == null) { return; } d3 = DF3DApplication.Application.Current3DMapControl; if (!d3.Terrain.IsRegistered) { return; } Map3DCommandManager.Push(this); d3.Terrain.DemAvailable = true; DF3DApplication.Application.Workbench.UpdateMenu(); List <DF3DFeatureClass> list = Dictionary3DTable.Instance.GetFeatureClassByFacilityClassName("DX3DMODEL"); if (list != null) { dict = new Dictionary <IBaseLayer, bool>(); foreach (DF3DFeatureClass dffc in list) { IBaseLayer bl = dffc.GetTreeLayer(); dict[bl] = bl.Visible; if (bl != null) { bl.Visible = false; } } } 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 UCEarthworkCalculation(); this._uc.Dock = System.Windows.Forms.DockStyle.Fill; this._uPanel.RegisterEvent(new PanelClose(this.Close)); this._dockPanel.Controls.Add(this._uc); } catch (Exception ex) { LoggingService.Error(ex.Message + "\r\n" + ex.StackTrace); } }
public override void Run(object sender, System.EventArgs e) { DF3DApplication app = DF3DApplication.Application; if (app == null || app.Current3DMapControl == null) { return; } RenderControlEditServices.Instance().StopGeometryEdit(true); int count = SelectCollection.Instance().GetCount(false); if (count > 10000) { XtraMessageBox.Show("批量编辑超过上限,请重新选择"); base.HighLight = false; return; } if (CommonUtils.Instance().EnableTemproalEdit) { using (DateSettingDialog dateSettingDialog = new DateSettingDialog()) { if (dateSettingDialog.ShowDialog() != System.Windows.Forms.DialogResult.OK) { base.HighLight = false; return; } this.time = dateSettingDialog.Time; } } Map3DCommandManager.Push(this); 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 UCGeometryEdit(); this._uc.Dock = System.Windows.Forms.DockStyle.Fill; this._uPanel.RegisterEvent(new PanelClose(this.Close)); this._dockPanel.Controls.Add(this._uc); this._InteractaMode = app.Current3DMapControl.InteractMode; this.SetMoveProperty(SelectCollection.Instance().GetSelectGeometrys()); SelectCollection.Instance().SelectionMovingEvent += new System.Action <IVector3>(this.SelectionMovingEvent); app.Current3DMapControl.RcFeaturesMoving += new Gvitech.CityMaker.Controls._IRenderControlEvents_RcFeaturesMovingEventHandler(this.AxRenderControl_RcFeaturesMoving); }
public override void Run(object sender, System.EventArgs e) { DF3DApplication app = DF3DApplication.Application; if (app == null || app.Current3DMapControl == null) { return; } Map3DCommandManager.Push(this); RenderControlEditServices.Instance().StopGeometryEdit(true); //FDECommand fDECommand = new FDECommand(true, false); SelectCollection.Instance().Clear(); SelectCollection.Instance().ClearRowBuffers(); RenderControlEditServices.Instance().SetEditorPosition(null); //fDECommand.SetSelectionMap(); //CommandManagerServices.Instance().CallCommand(fDECommand); app.Workbench.UpdateMenu(); }
public override void Run(object sender, System.EventArgs e) { try { Map3DCommandManager.Push(this); 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 UCHeightControl(); this._uc.Dock = System.Windows.Forms.DockStyle.Fill; this._uPanel.RegisterEvent(new PanelClose(this.Close)); this._dockPanel.Controls.Add(this._uc); } catch (Exception ex) { LoggingService.Error(ex.Message + "\r\n" + ex.StackTrace); } }
public override void Run(object sender, System.EventArgs e) { RenderControlEditServices.Instance().StopGeometryEdit(true); int count = SelectCollection.Instance().GetCount(false); if (count > 10000) { XtraMessageBox.Show("批量编辑超过上限,请重新选择"); base.HighLight = false; return; } if (CommonUtils.Instance().EnableTemproalEdit) { using (DateSettingDialog dateSettingDialog = new DateSettingDialog()) { if (dateSettingDialog.ShowDialog() != System.Windows.Forms.DialogResult.OK) { base.HighLight = false; return; } this.time = dateSettingDialog.Time; } } Map3DCommandManager.Push(this); 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 UCGeometryEdit(); this._uc.Dock = System.Windows.Forms.DockStyle.Fill; this._uPanel.RegisterEvent(new PanelClose(this.Close)); this._dockPanel.Controls.Add(this._uc); RenderControlEditServices.Instance().RenderEditorType = RenderEditorType.ScaleAllType; this.bInit = false; this.BeginScale(SelectCollection.Instance().GetSelectGeometrys()); RenderControlEditServices.Instance().SetEditorPosition(this.beginRowbufferMap); }
public override void Run(object sender, System.EventArgs e) { if (DF3DApplication.Application == null || DF3DApplication.Application.Current3DMapControl == null) { return; } d3 = DF3DApplication.Application.Current3DMapControl; if (!d3.Terrain.IsRegistered) { return; } Map3DCommandManager.Push(this); d3.Terrain.DemAvailable = true; DF3DApplication.Application.Workbench.UpdateMenu(); List <DF3DFeatureClass> list = Dictionary3DTable.Instance.GetFeatureClassByFacilityClassName("DX3DMODEL"); if (list != null) { dict = new Dictionary <IBaseLayer, bool>(); foreach (DF3DFeatureClass dffc in list) { IBaseLayer bl = dffc.GetTreeLayer(); dict[bl] = bl.Visible; if (bl != null) { bl.Visible = false; } } } DF3DApplication.Application.Workbench.SetStatusInfo("请绘制挖洞区域"); this._drawTool = DrawToolService.Instance.CreateDrawTool(DrawType.Polygon); if (this._drawTool != null) { this._drawTool.OnStartDraw += new OnStartDraw(this.OnStartDraw); this._drawTool.OnFinishedDraw += new OnFinishedDraw(this.OnFinishedDraw); this._drawTool.Start(); } }
public override void Run(object sender, EventArgs e) { DF3DApplication app = DF3DApplication.Application; if (app == null || app.Current3DMapControl == null) { return; } RenderControlEditServices.Instance().StopGeometryEdit(true); int count = SelectCollection.Instance().GetCount(false); if (count > 1) { XtraMessageBox.Show("批量编辑超过上限,请重新选择"); base.HighLight = false; return; } if (CommonUtils.Instance().EnableTemproalEdit) { using (DateSettingDialog dateSettingDialog = new DateSettingDialog()) { if (dateSettingDialog.ShowDialog() != System.Windows.Forms.DialogResult.OK) { base.HighLight = false; return; } this.time = dateSettingDialog.Time; } } Map3DCommandManager.Push(this); this._InteractaMode = app.Current3DMapControl.InteractMode; app.Current3DMapControl.InteractMode = gviInteractMode.gviInteractEdit; app.Current3DMapControl.RcObjectEditing += new Gvitech.CityMaker.Controls._IRenderControlEvents_RcObjectEditingEventHandler(Current3DMapControl_RcObjectEditing); app.Current3DMapControl.RcObjectEditFinish += new EventHandler(Current3DMapControl_RcObjectEditFinish); this.SetVertexProperty(SelectCollection.Instance().GetSelectGeometrys()); }
public override void Run(object sender, System.EventArgs e) { DF3DApplication app = DF3DApplication.Application; if (app == null || app.Current3DMapControl == null) { return; } try { Map3DCommandManager.Push(this); RenderControlEditServices.Instance().StopGeometryEdit(true); app.Current3DMapControl.PauseRendering(false); System.Collections.Generic.IList <System.Collections.Generic.KeyValuePair <int, string> > list = new System.Collections.Generic.List <System.Collections.Generic.KeyValuePair <int, string> >(); HashMap featureClassInfoMap = SelectCollection.Instance().FeatureClassInfoMap; DF3DFeatureClass featureClassInfo = null; System.Collections.Generic.IList <int> list2 = new System.Collections.Generic.List <int>(); System.Collections.IEnumerator enumerator = featureClassInfoMap.Keys.GetEnumerator(); try { if (enumerator.MoveNext()) { DF3DFeatureClass featureClassInfo2 = (DF3DFeatureClass)enumerator.Current; featureClassInfo = featureClassInfo2; ResultSetInfo resultSetInfo = featureClassInfoMap[featureClassInfo2] as ResultSetInfo; foreach (DataRow dataRow in resultSetInfo.ResultSetTable.Rows) { int num = int.Parse(dataRow[featureClassInfo.GetFeatureClass().FidFieldName].ToString()); string value = num.ToString(); System.Collections.Generic.KeyValuePair <int, string> item = new System.Collections.Generic.KeyValuePair <int, string>(num, value); list.Add(item); list2.Add(num); } } } finally { System.IDisposable disposable = enumerator as System.IDisposable; if (disposable != null) { disposable.Dispose(); } } if (featureClassInfo != null) { using (MergeDlg mergeDlg = new MergeDlg(list)) { if (mergeDlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) { if (System.Windows.Forms.DialogResult.No != XtraMessageBox.Show("模型合并不支持撤销操作,是否继续?", "提示", System.Windows.Forms.MessageBoxButtons.YesNo, System.Windows.Forms.MessageBoxIcon.Exclamation)) { int fid = mergeDlg.Fid; using (new WaitDialogForm("", "正在进行模型合并,请稍后...")) { IFeatureClass featureClass = featureClassInfo.GetFeatureClass(); string geometryFieldName = featureClassInfo.GetFeatureLayer().GeometryFieldName; IModelPoint model = this.GetModel(featureClass, geometryFieldName, fid); IResourceManager resourceManager = CommonUtils.Instance().GetCurrentFeatureDataset() as IResourceManager; if (resourceManager != null) { if (!this.MergeModels(featureClass, geometryFieldName, list2.ToArray <int>(), resourceManager, ref model)) { XtraMessageBox.Show("模型合并失败!"); } else { if (list2.Remove(fid)) { featureClass.Delete(new QueryFilterClass { IdsFilter = list2.ToArray <int>() }); CommonUtils.Instance().Delete(featureClassInfo, list2.ToArray <int>()); app.Current3DMapControl.FeatureManager.DeleteFeatures(featureClass, list2.ToArray <int>()); } app.Current3DMapControl.RefreshModel(CommonUtils.Instance().GetCurrentFeatureDataset(), model.ModelName); IFdeCursor fdeCursor = featureClass.Update(new QueryFilterClass { IdsFilter = new int[] { fid } }); IRowBuffer rowBuffer = fdeCursor.NextRow(); if (rowBuffer != null) { int num2 = rowBuffer.FieldIndex(geometryFieldName); if (num2 != -1) { rowBuffer.SetValue(num2, model); } fdeCursor.UpdateRow(rowBuffer); System.Runtime.InteropServices.Marshal.ReleaseComObject(fdeCursor); app.Current3DMapControl.FeatureManager.EditFeature(featureClass, rowBuffer); } //System.Runtime.InteropServices.Marshal.ReleaseComObject(featureClass); } } } } } } } } catch (System.Runtime.InteropServices.COMException ex) { XtraMessageBox.Show(ex.Message); } catch (System.UnauthorizedAccessException var_23_389) { XtraMessageBox.Show("拒绝访问"); } catch (System.Exception ex2) { XtraMessageBox.Show(ex2.Message); } finally { app.Current3DMapControl.ResumeRendering(); } }
public override void Run(object sender, EventArgs e) { try { app = DF3DApplication.Application; if (app == null || app.Current3DMapControl == null) { return; } this._geoFact = new GeometryFactory(); Map3DCommandManager.Push(this); DF3DFeatureClass dffc = CommonUtils.Instance().CurEditLayer; if (dffc != null) { this._facType = dffc.GetFacilityClassName(); _strGeometryFieldName = ""; if (this._facType == "PipeLine" || this._facType == "PipeNode" || this._facType == "PipeBuild" || this._facType == "PipeBuild1") { _strGeometryFieldName = "Shape"; } else { IFeatureLayer fl = dffc.GetFeatureLayer(); if (fl != null) { _strGeometryFieldName = fl.GeometryFieldName; } } if (!string.IsNullOrEmpty(_strGeometryFieldName)) { IFeatureClass fc = dffc.GetFeatureClass(); if (fc != null) { IFieldInfoCollection fiCol = fc.GetFields(); int index = fiCol.IndexOf(_strGeometryFieldName); if (index != -1) { IFieldInfo fi = fiCol.Get(index); if (fi.GeometryDef != null) { this._geoType = fi.GeometryDef.GeometryColumnType; } } } switch (this._geoType) { case gviGeometryColumnType.gviGeometryColumnModelPoint: //添加方式:1、鼠标添加;2、文件添加 FrmInsertModel dlg = new FrmInsertModel(); if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) { string filePath = dlg.FilePath; string ext = Path.GetExtension(filePath); if (File.Exists(filePath)) { int insertType = dlg.InsertType; if (insertType == 0 && ext.ToLower() == ".osg") { this._drawTool = DrawToolService.Instance.CreateDrawTool(DrawType._3DModel); if (this._drawTool != null) { (this._drawTool as Draw3DModel).Set3DModelFilePath(filePath); this._drawTool.OnStartDraw += new OnStartDraw(this.OnStartDraw); this._drawTool.OnFinishedDraw += new OnFinishedDraw(this.OnFinishedDraw); this._drawTool.Start(); } } else if (insertType == 1 && ext.ToLower() == ".xml") { } } } break; case gviGeometryColumnType.gviGeometryColumnPoint: if (this._facType == "PipeNode") { // 添加附属设施或者管点 } else { // 添加点 this._drawTool = DrawToolService.Instance.CreateDrawTool(DrawType.Point); if (this._drawTool != null) { this._drawTool.OnStartDraw += new OnStartDraw(this.OnStartDraw); this._drawTool.OnFinishedDraw += new OnFinishedDraw(this.OnFinishedDraw); this._drawTool.Start(); } } break; case gviGeometryColumnType.gviGeometryColumnPolyline: if (this._facType == "PipeLine" || this._facType == "PipeBuild" || this._facType == "PipeBuild1") { // 选择管线或辅助样式 } else { // 添加线 this._drawTool = DrawToolService.Instance.CreateDrawTool(DrawType.Polyline); if (this._drawTool != null) { this._drawTool.OnStartDraw += new OnStartDraw(this.OnStartDraw); this._drawTool.OnFinishedDraw += new OnFinishedDraw(this.OnFinishedDraw); this._drawTool.Start(); } } break; case gviGeometryColumnType.gviGeometryColumnPolygon: if (this._facType == "PipeBuild" || this._facType == "PipeBuild1") { // 选择管线辅助样式 } else { // 添加面 this._drawTool = DrawToolService.Instance.CreateDrawTool(DrawType.Polygon); if (this._drawTool != null) { this._drawTool.OnStartDraw += new OnStartDraw(this.OnStartDraw); this._drawTool.OnFinishedDraw += new OnFinishedDraw(this.OnFinishedDraw); this._drawTool.Start(); } } break; default: return; } } } } catch (Exception ex) { } finally { } }