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 UCCameraTour(); 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, EventArgs e) { FrmPropertyQuery dialog = new FrmPropertyQuery(this.CommandName, "Owner", "PipeLine"); 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, "PipeLine"); }
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, 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, 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 RestoreEnv() { DF3DApplication app = DF3DApplication.Application; if (app == null || app.Current3DMapControl == null) { return; } app.Current3DMapControl.ObjectEditor.FinishEdit(); RenderControlEditServices.Instance().RenderEditorType = RenderEditorType.UnKnownType; app.Current3DMapControl.InteractMode = this._InteractaMode; app.Current3DMapControl.RcFeaturesMoving -= new Gvitech.CityMaker.Controls._IRenderControlEvents_RcFeaturesMovingEventHandler(this.AxRenderControl_RcFeaturesMoving); SelectCollection.Instance().SelectionMovingEvent -= new System.Action <IVector3>(this.SelectionMovingEvent); SelectCollection.Instance().ClearRowBuffers(); if (this._uPanel != null) { this._uPanel.GetControlContainer().Controls.Clear(); this._uPanel.Close(); this._uPanel = null; } }
public override void RestoreEnv() { if (this._uPanel != null) { this._uPanel.GetControlContainer().Controls.Clear(); this._uPanel.Close(); this._uPanel = null; } IMap2DView mapView = UCService.GetContent(typeof(Map2DView)) as Map2DView; DF2DApplication app = DF2DApplication.Application; if (app == null || app.Current2DMapControl == null) { return; } app.Current2DMapControl.ActiveView.FocusMap.ClearSelection(); if (mapView == null) { return; } mapView.UnBind(this); Map2DCommandManager.Pop(); }
public override void RestoreEnv() { bool _isAuth = Authority3DService.Instance.IsAuthorized; if (!_isAuth) { return; } DF3DApplication app = DF3DApplication.Application; if (app == null || app.Current3DMapControl == null) { return; } SelectCollection.Instance().ClearRowBuffers(); if (this._uPanel != null) { this._uPanel.GetControlContainer().Controls.Clear(); this._uPanel.Close(); this._uPanel = null; } }
public override void RestoreEnv() { if (dict != null) { foreach (KeyValuePair <IBaseLayer, bool> kv in dict) { kv.Key.Visible = kv.Value; } } 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; } Map3DCommandManager.Pop(); }
public override void OnMouseDown(int button, int shift, int x, int y, double mapX, double mapY) { DF2DApplication app = DF2DApplication.Application; this._dict.Clear(); m_ActiveView = app.Current2DMapControl.ActiveView; if (this.m_ActiveView.FocusMap.FeatureSelection != null) { this.m_ActiveView.FocusMap.ClearSelection(); } bool ready = false; bool haveone = false; if (app == null || app.Current2DMapControl == null || app.Workbench == null) { return; } app.Workbench.SetMenuEnable(true); IGeometry pGeo = null; try { if (button == 1) { WaitForm.Start("正在查询...", "请稍后"); PointClass searchPoint = new PointClass(); searchPoint.PutCoords(mapX, mapY); pGeo = PublicFunction.DoBuffer(searchPoint, PublicFunction.ConvertPixelsToMapUnits(m_ActiveView, GlobalValue.System_Selection_Option().Tolerate)); if (pGeo == null) { return; } ready = true; if (ready == true) { //foreach (LogicGroup lg in LogicDataStructureManage2D.Instance.RootLogicGroups) //{ IFeatureCursor pFeatureCursor = null; IFeature pFeature = null; ISpatialFilter pSpatialFilter = new SpatialFilter(); IFeatureClass fc; DF2DFeatureClass dffc; //foreach (MajorClass mc in lg.MajorClasses) foreach (MajorClass mc in FrmMajorClass.Instance.MajorClasses) { foreach (SubClass sc in mc.SubClasses) { if (!sc.Visible2D) { continue; } string[] arrFc2DId = mc.Fc2D.Split(';'); if (arrFc2DId == null) { continue; } foreach (string fc2DId in arrFc2DId) { dffc = DF2DFeatureClassManager.Instance.GetFeatureClassByID(fc2DId); if (dffc == null) { continue; } fc = dffc.GetFeatureClass(); FacilityClass facc = dffc.GetFacilityClass(); if (facc.Name != "PipeLine") { continue; } if (fc == null || pGeo == null) { continue; } pSpatialFilter = new SpatialFilter(); pSpatialFilter.Geometry = pGeo; pSpatialFilter.SpatialRel = esriSpatialRelEnum.esriSpatialRelIntersects; string whereClause = UpOrDown.DecorateWhereClasuse(fc) + mc.ClassifyField + " = '" + sc.Name + "'"; pSpatialFilter.WhereClause = whereClause; pFeatureCursor = fc.Search(pSpatialFilter, false); if (pFeatureCursor == null) { continue; } pFeature = pFeatureCursor.NextFeature(); if (pFeature == null) { continue; } DataTable dt = new DataTable(); dt.TableName = facc.Name; DataColumn oidcol = new DataColumn(); oidcol.ColumnName = "oid"; oidcol.Caption = "ID"; dt.Columns.Add(oidcol); foreach (DFDataConfig.Class.FieldInfo fitemp in facc.FieldInfoCollection) { if (!fitemp.CanQuery) { continue; } DataColumn col = new DataColumn(); col.ColumnName = fitemp.Name; col.Caption = fitemp.Alias; dt.Columns.Add(col); } DataRow dtRow = dt.NewRow(); dtRow["oid"] = pFeature.get_Value(pFeature.Fields.FindField("OBJECTID")); foreach (DataColumn col in dt.Columns) { int index1 = pFeature.Fields.FindField(col.ColumnName); if (index1 < 0) { continue; } object obj1 = GetFieldValueByIndex(pFeature, index1); string str = ""; if (obj1 != null) { IField field = pFeature.Fields.get_Field(index1); switch (field.Type) { case esriFieldType.esriFieldTypeBlob: case esriFieldType.esriFieldTypeGeometry: case esriFieldType.esriFieldTypeRaster: continue; case esriFieldType.esriFieldTypeDouble: double d; if (double.TryParse(obj1.ToString(), out d)) { str = d.ToString("0.00"); } break; default: str = obj1.ToString(); break; } } dtRow[col.ColumnName] = str; } dt.Rows.Add(dtRow); if (dt.Rows.Count > 0) { this._dict[sc.Name] = dt; } haveone = true; break; } if (haveone) { break; } } if (haveone) { break; } } } #region 查询建筑物 if (!haveone) { FacilityClass facBuild = FacilityClassManager.Instance.GetFacilityClassByName("Building"); if (facBuild != null) { haveone = HaveOne(facBuild, pGeo); } if (!haveone) { FacilityClass facStruct = FacilityClassManager.Instance.GetFacilityClassByName("Structure"); if (facStruct != null) { haveone = HaveOne(facStruct, pGeo); } } } #endregion try { if (!haveone) { WaitForm.Stop(); XtraMessageBox.Show("未选中要素,请重新选择", "提示"); 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; if (this._ucPropInfo2D == null) { this._ucPropInfo2D = new UCPropertyInfo2D(); } this._ucPropInfo2D.Dock = System.Windows.Forms.DockStyle.Fill; this._uPanel.RegisterEvent(new PanelClose(this.Close)); this._dockPanel.Controls.Add(this._ucPropInfo2D); this._ucPropInfo2D.Init(); this._ucPropInfo2D.SetPropertyInfo(this._dict); WaitForm.Stop(); } catch { WaitForm.Stop(); } } //} } catch { WaitForm.Stop(); } finally { } }
public override void OnMouseDown(int button, int shift, int x, int y, double mapX, double mapY) { DF2DApplication app = DF2DApplication.Application; this._dict.Clear(); 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; IGeometry pGeo = null; 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; //pColor = Convert.ToUInt32(SystemInfo.Instance.LineColor, 16); IRubberBand pRubberBand; pRubberBand = new RubberLineClass(); IGeometry pLine; pLine = pRubberBand.TrackNew(m_Display, null); //IPolyline pLine = app.Current2DMapControl.TrackLine() as IPolyline; object symbol = pLineSym as object; app.Current2DMapControl.DrawShape(pLine, ref symbol); WaitForm.Start("正在查询...", "请稍后"); //if (GlobalValue.System_Selection_Environment(m_ActiveView).CombinationMethod == 0)//new selection //{ // this.m_ActiveView.FocusMap.ClearSelection(); //} pGeo = PublicFunction.DoBuffer(pLine, PublicFunction.ConvertPixelsToMapUnits(m_ActiveView, GlobalValue.System_Selection_Option().Tolerate)); if (pGeo == null) { return; } //m_ActiveView.FocusMap.SelectByShape(pGeo, GlobalValue.System_Selection_Environment(m_ActiveView), false); //if (m_ActiveView.FocusMap.SelectionCount > 0) //{ // ready = true; // m_ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeoSelection, null, null); //} //else //{ // m_ActiveView.Refresh(); //} if (ready) { //foreach (LogicGroup lg in LogicDataStructureManage2D.Instance.RootLogicGroups) //{ foreach (MajorClass mc in FrmMajorClass.Instance.MajorClasses) { foreach (SubClass sc in mc.SubClasses) { if (!sc.Visible2D) { continue; } string[] arrFc2DId = mc.Fc2D.Split(';'); if (arrFc2DId == null) { continue; } IFeatureCursor pFeatureCursor = null; IFeature pFeature = null; foreach (string fc2DId in arrFc2DId) { DF2DFeatureClass dffc = DF2DFeatureClassManager.Instance.GetFeatureClassByID(fc2DId); if (dffc == null) { continue; } IFeatureClass fc = dffc.GetFeatureClass(); FacilityClass facc = dffc.GetFacilityClass(); if (facc.Name != "PipeLine") { continue; } if (fc == null || pGeo == null) { continue; } ISpatialFilter pSpatialFilter = new SpatialFilter(); pSpatialFilter.Geometry = pGeo; pSpatialFilter.SpatialRel = esriSpatialRelEnum.esriSpatialRelIntersects; string whereClause = UpOrDown.DecorateWhereClasuse(fc) + mc.ClassifyField + " = '" + sc.Name + "'"; pSpatialFilter.WhereClause = whereClause; pFeatureCursor = fc.Search(pSpatialFilter, false); if (pFeatureCursor == null) { continue; } DataTable dt = new DataTable(); dt.TableName = facc.Name; DataColumn oidcol = new DataColumn(); oidcol.ColumnName = "oid"; oidcol.Caption = "ID"; dt.Columns.Add(oidcol); foreach (DFDataConfig.Class.FieldInfo fitemp in facc.FieldInfoCollection) { if (!fitemp.CanQuery) { continue; } DataColumn col = new DataColumn(); col.ColumnName = fitemp.Name; col.Caption = fitemp.Alias; dt.Columns.Add(col); } while ((pFeature = pFeatureCursor.NextFeature()) != null) { DataRow dtRow = dt.NewRow(); dtRow["oid"] = pFeature.get_Value(pFeature.Fields.FindField("OBJECTID")); foreach (DataColumn col in dt.Columns) { int index1 = pFeature.Fields.FindField(col.ColumnName); if (index1 < 0) { continue; } object obj1 = pFeature.get_Value(index1); string str = ""; if (obj1 != null) { IField field = pFeature.Fields.get_Field(index1); switch (field.Type) { case esriFieldType.esriFieldTypeBlob: case esriFieldType.esriFieldTypeGeometry: case esriFieldType.esriFieldTypeRaster: continue; case esriFieldType.esriFieldTypeDouble: double d; if (double.TryParse(obj1.ToString(), out d)) { str = d.ToString("0.00"); } break; default: str = obj1.ToString(); break; } } dtRow[col.ColumnName] = str; } dt.Rows.Add(dtRow); } if (dt.Rows.Count > 0) { this._dict.Add(sc.Name, dt); } } } } } } WaitForm.Stop(); try { 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; if (this._ucPropInfo2D == null) { this._ucPropInfo2D = new UCPropertyInfo2D(); } this._ucPropInfo2D.Dock = System.Windows.Forms.DockStyle.Fill; this._uPanel.RegisterEvent(new PanelClose(this.Close)); this._dockPanel.Controls.Add(this._ucPropInfo2D); this._ucPropInfo2D.Init(); this._ucPropInfo2D.SetPropertyInfo(this._dict); } catch { } //} } catch { } }
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(); } }