diff --git a/Cyberpipe.suo b/Cyberpipe.suo index eac4ecb..a73bd12 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/Cyberpipe.suo b/Cyberpipe.suo index eac4ecb..a73bd12 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/MainFrm.cs b/MainFrm.cs index f6f4616..f00e84b 100644 --- a/MainFrm.cs +++ b/MainFrm.cs @@ -5632,54 +5632,7 @@ } return nid; } - /// - /// 设置除指定标注图层之外的所有标注图层不可见 - /// - /// - public void setMarkerLayerUnVisible(string layerName) - { - string[] markerStrs = new string[10]; - markerStrs[0] = "标高标注"; - markerStrs[1] = "管径标注"; - markerStrs[2] = "埋深标注"; - markerStrs[3] = "坐标标注"; - markerStrs[4] = "坡度标注"; - markerStrs[5] = "属性标注"; - markerStrs[6] = "自定义标注"; - markerStrs[7] = "距离标注"; - markerStrs[8] = "红线工具"; - markerStrs[9] = "扯旗标注"; - for (int i = 0; i < markerStrs.Length; i++) - { - GSOLayer markerLayer = globeControl1.Globe.Layers.GetLayerByCaption(markerStrs[i]); - if (markerLayer == null) continue; - if (markerStrs[i] != layerName) - { - markerLayer.Visible = false; - if (layerMarkerTree.Nodes[0].Nodes.Count > i) - { - layerMarkerTree.Nodes[0].Nodes[i].Checked = false; - } - } - else - { - markerLayer.Visible = true; - for (int j = 0; j < markerLayer.GetAllFeatures().Length; j++) - { - GSOFeature markerFeature = markerLayer.GetAt(j); - if (markerFeature != null) - { - markerFeature.Visible = false; - } - } - if (layerMarkerTree.Nodes[0].Nodes.Count > i) - { - layerMarkerTree.Nodes[0].Nodes[i].Checked = true; - } - } - } - } /// /// 判断选中的对象是否为管线 /// @@ -6421,49 +6374,31 @@ buttonClearAnalysisResult_Click(null, null); NetworkAnalysisTool.ClearAllTopAnalysis(globeControl1); - // ClearConnexityAnalysis();//清除连通性分析 - // ClearCloseValvesAnalysis();//清除阀门分析 - //清除管线间距分析 - //if (disFeature != null) - //{ - // if (disFeature.ID != 0) - // { - // globeControl1.Globe.MemoryLayer.RemoveFeatureByID(disFeature.ID); - // } - //} - //if (featureDis != null) - //{ - // if (featureDis.ID != 0) - // { - // globeControl1.Globe.MemoryLayer.RemoveFeatureByID(featureDis.ID); - // } - //} - - GSOFeatures feats = globeControl1.Globe.MemoryLayer.GetFeatureByName("粒子要素", true); - if (feats.Length > 0) - globeControl1.Globe.MemoryLayer.RemoveFeatureByID(feats[0].ID); +// GSOFeatures feats = globeControl1.Globe.MemoryLayer.GetFeatureByName("粒子要素", true); +// if (feats.Length > 0) +// globeControl1.Globe.MemoryLayer.RemoveFeatureByID(feats[0].ID); globeControl1.Globe.UnderGroundFloor.Visible = false;//隐藏地下网格线 // ClearUpDownTraceAnalysis(); //清除上下游分析 globeControl1.Globe.RemoveAllPits();//清除所有坑 - - string[] markerStrs = new string[9]; - markerStrs[0] = "标高标注"; - markerStrs[1] = "管径标注"; - markerStrs[2] = "埋深标注"; - markerStrs[3] = "坐标标注"; - markerStrs[4] = "坡度标注"; - markerStrs[5] = "属性标注"; - markerStrs[6] = "自定义标注"; - markerStrs[7] = "距离标注"; - markerStrs[8] = "扯旗标注"; - for (int i = 0; i < markerStrs.Length; i++) - { - GSOLayer markerLayer = globeControl1.Globe.Layers.GetLayerByCaption(markerStrs[i]); - markerLayer.RemoveAllFeature(); - } + MarkTools.removeAllMarker(globeControl1);//清除所有标注 +// string[] markerStrs = new string[9]; +// markerStrs[0] = "标高标注"; +// markerStrs[1] = "管径标注"; +// markerStrs[2] = "埋深标注"; +// markerStrs[3] = "坐标标注"; +// markerStrs[4] = "坡度标注"; +// markerStrs[5] = "属性标注"; +// markerStrs[6] = "自定义标注"; +// markerStrs[7] = "距离标注"; +// markerStrs[8] = "扯旗标注"; +// for (int i = 0; i < markerStrs.Length; i++) +// { +// GSOLayer markerLayer = globeControl1.Globe.Layers.GetLayerByCaption(markerStrs[i]); +// markerLayer.RemoveAllFeature(); +// } if (layerMarkerTree != null && layerMarkerTree.Nodes.Count > 0) { for (int i = 0; i < layerMarkerTree.Nodes[0].Nodes.Count; i++) @@ -7391,19 +7326,19 @@ /// /// /// - private void buttonItemBZ10_Click(object sender, EventArgs e) - { - //日志记录 - LogManager.saveLog(Utility.userName, buttonItemBZ10.Text); - setMarkerLayerUnVisible("红线工具"); - GSOLayer l = globeControl1.Globe.Layers.GetLayerByCaption("红线工具"); - if (l == null) return; - l.Visible = true; - globeControl1.Globe.DestLayerFeatureAdd = l; - l.Editable = true; - globeControl1.Globe.Action = EnumAction3D.DrawPolygon; - m_isDrawRedPology = true; - } +// private void buttonItemBZ10_Click(object sender, EventArgs e) +// { +// //日志记录 +// LogManager.saveLog(Utility.userName, buttonItemBZ10.Text); +// setMarkerLayerUnVisible("红线工具"); +// GSOLayer l = globeControl1.Globe.Layers.GetLayerByCaption("红线工具"); +// if (l == null) return; +// l.Visible = true; +// globeControl1.Globe.DestLayerFeatureAdd = l; +// l.Editable = true; +// globeControl1.Globe.Action = EnumAction3D.DrawPolygon; +// m_isDrawRedPology = true; +// } /// /// 标注管理 /// diff --git a/Cyberpipe.suo b/Cyberpipe.suo index eac4ecb..a73bd12 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/MainFrm.cs b/MainFrm.cs index f6f4616..f00e84b 100644 --- a/MainFrm.cs +++ b/MainFrm.cs @@ -5632,54 +5632,7 @@ } return nid; } - /// - /// 设置除指定标注图层之外的所有标注图层不可见 - /// - /// - public void setMarkerLayerUnVisible(string layerName) - { - string[] markerStrs = new string[10]; - markerStrs[0] = "标高标注"; - markerStrs[1] = "管径标注"; - markerStrs[2] = "埋深标注"; - markerStrs[3] = "坐标标注"; - markerStrs[4] = "坡度标注"; - markerStrs[5] = "属性标注"; - markerStrs[6] = "自定义标注"; - markerStrs[7] = "距离标注"; - markerStrs[8] = "红线工具"; - markerStrs[9] = "扯旗标注"; - for (int i = 0; i < markerStrs.Length; i++) - { - GSOLayer markerLayer = globeControl1.Globe.Layers.GetLayerByCaption(markerStrs[i]); - if (markerLayer == null) continue; - if (markerStrs[i] != layerName) - { - markerLayer.Visible = false; - if (layerMarkerTree.Nodes[0].Nodes.Count > i) - { - layerMarkerTree.Nodes[0].Nodes[i].Checked = false; - } - } - else - { - markerLayer.Visible = true; - for (int j = 0; j < markerLayer.GetAllFeatures().Length; j++) - { - GSOFeature markerFeature = markerLayer.GetAt(j); - if (markerFeature != null) - { - markerFeature.Visible = false; - } - } - if (layerMarkerTree.Nodes[0].Nodes.Count > i) - { - layerMarkerTree.Nodes[0].Nodes[i].Checked = true; - } - } - } - } /// /// 判断选中的对象是否为管线 /// @@ -6421,49 +6374,31 @@ buttonClearAnalysisResult_Click(null, null); NetworkAnalysisTool.ClearAllTopAnalysis(globeControl1); - // ClearConnexityAnalysis();//清除连通性分析 - // ClearCloseValvesAnalysis();//清除阀门分析 - //清除管线间距分析 - //if (disFeature != null) - //{ - // if (disFeature.ID != 0) - // { - // globeControl1.Globe.MemoryLayer.RemoveFeatureByID(disFeature.ID); - // } - //} - //if (featureDis != null) - //{ - // if (featureDis.ID != 0) - // { - // globeControl1.Globe.MemoryLayer.RemoveFeatureByID(featureDis.ID); - // } - //} - - GSOFeatures feats = globeControl1.Globe.MemoryLayer.GetFeatureByName("粒子要素", true); - if (feats.Length > 0) - globeControl1.Globe.MemoryLayer.RemoveFeatureByID(feats[0].ID); +// GSOFeatures feats = globeControl1.Globe.MemoryLayer.GetFeatureByName("粒子要素", true); +// if (feats.Length > 0) +// globeControl1.Globe.MemoryLayer.RemoveFeatureByID(feats[0].ID); globeControl1.Globe.UnderGroundFloor.Visible = false;//隐藏地下网格线 // ClearUpDownTraceAnalysis(); //清除上下游分析 globeControl1.Globe.RemoveAllPits();//清除所有坑 - - string[] markerStrs = new string[9]; - markerStrs[0] = "标高标注"; - markerStrs[1] = "管径标注"; - markerStrs[2] = "埋深标注"; - markerStrs[3] = "坐标标注"; - markerStrs[4] = "坡度标注"; - markerStrs[5] = "属性标注"; - markerStrs[6] = "自定义标注"; - markerStrs[7] = "距离标注"; - markerStrs[8] = "扯旗标注"; - for (int i = 0; i < markerStrs.Length; i++) - { - GSOLayer markerLayer = globeControl1.Globe.Layers.GetLayerByCaption(markerStrs[i]); - markerLayer.RemoveAllFeature(); - } + MarkTools.removeAllMarker(globeControl1);//清除所有标注 +// string[] markerStrs = new string[9]; +// markerStrs[0] = "标高标注"; +// markerStrs[1] = "管径标注"; +// markerStrs[2] = "埋深标注"; +// markerStrs[3] = "坐标标注"; +// markerStrs[4] = "坡度标注"; +// markerStrs[5] = "属性标注"; +// markerStrs[6] = "自定义标注"; +// markerStrs[7] = "距离标注"; +// markerStrs[8] = "扯旗标注"; +// for (int i = 0; i < markerStrs.Length; i++) +// { +// GSOLayer markerLayer = globeControl1.Globe.Layers.GetLayerByCaption(markerStrs[i]); +// markerLayer.RemoveAllFeature(); +// } if (layerMarkerTree != null && layerMarkerTree.Nodes.Count > 0) { for (int i = 0; i < layerMarkerTree.Nodes[0].Nodes.Count; i++) @@ -7391,19 +7326,19 @@ /// /// /// - private void buttonItemBZ10_Click(object sender, EventArgs e) - { - //日志记录 - LogManager.saveLog(Utility.userName, buttonItemBZ10.Text); - setMarkerLayerUnVisible("红线工具"); - GSOLayer l = globeControl1.Globe.Layers.GetLayerByCaption("红线工具"); - if (l == null) return; - l.Visible = true; - globeControl1.Globe.DestLayerFeatureAdd = l; - l.Editable = true; - globeControl1.Globe.Action = EnumAction3D.DrawPolygon; - m_isDrawRedPology = true; - } +// private void buttonItemBZ10_Click(object sender, EventArgs e) +// { +// //日志记录 +// LogManager.saveLog(Utility.userName, buttonItemBZ10.Text); +// setMarkerLayerUnVisible("红线工具"); +// GSOLayer l = globeControl1.Globe.Layers.GetLayerByCaption("红线工具"); +// if (l == null) return; +// l.Visible = true; +// globeControl1.Globe.DestLayerFeatureAdd = l; +// l.Editable = true; +// globeControl1.Globe.Action = EnumAction3D.DrawPolygon; +// m_isDrawRedPology = true; +// } /// /// 标注管理 /// diff --git a/MainFrm.designer.cs b/MainFrm.designer.cs index 9c3c430..9d28318 100644 --- a/MainFrm.designer.cs +++ b/MainFrm.designer.cs @@ -3685,13 +3685,7 @@ this.buttonItemBZ9.Name = "buttonItemBZ9"; this.buttonItemBZ9.Text = "属性标注"; this.buttonItemBZ9.Click += new System.EventHandler(this.buttonItemBZ9_Click); - // - // buttonItemBZ10 - // - this.buttonItemBZ10.Image = ((System.Drawing.Image)(resources.GetObject("buttonItemBZ10.Image"))); - this.buttonItemBZ10.Name = "buttonItemBZ10"; - this.buttonItemBZ10.Text = "红线工具"; - this.buttonItemBZ10.Click += new System.EventHandler(this.buttonItemBZ10_Click); + // // buttonItemBZ11 // diff --git a/Cyberpipe.suo b/Cyberpipe.suo index eac4ecb..a73bd12 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/MainFrm.cs b/MainFrm.cs index f6f4616..f00e84b 100644 --- a/MainFrm.cs +++ b/MainFrm.cs @@ -5632,54 +5632,7 @@ } return nid; } - /// - /// 设置除指定标注图层之外的所有标注图层不可见 - /// - /// - public void setMarkerLayerUnVisible(string layerName) - { - string[] markerStrs = new string[10]; - markerStrs[0] = "标高标注"; - markerStrs[1] = "管径标注"; - markerStrs[2] = "埋深标注"; - markerStrs[3] = "坐标标注"; - markerStrs[4] = "坡度标注"; - markerStrs[5] = "属性标注"; - markerStrs[6] = "自定义标注"; - markerStrs[7] = "距离标注"; - markerStrs[8] = "红线工具"; - markerStrs[9] = "扯旗标注"; - for (int i = 0; i < markerStrs.Length; i++) - { - GSOLayer markerLayer = globeControl1.Globe.Layers.GetLayerByCaption(markerStrs[i]); - if (markerLayer == null) continue; - if (markerStrs[i] != layerName) - { - markerLayer.Visible = false; - if (layerMarkerTree.Nodes[0].Nodes.Count > i) - { - layerMarkerTree.Nodes[0].Nodes[i].Checked = false; - } - } - else - { - markerLayer.Visible = true; - for (int j = 0; j < markerLayer.GetAllFeatures().Length; j++) - { - GSOFeature markerFeature = markerLayer.GetAt(j); - if (markerFeature != null) - { - markerFeature.Visible = false; - } - } - if (layerMarkerTree.Nodes[0].Nodes.Count > i) - { - layerMarkerTree.Nodes[0].Nodes[i].Checked = true; - } - } - } - } /// /// 判断选中的对象是否为管线 /// @@ -6421,49 +6374,31 @@ buttonClearAnalysisResult_Click(null, null); NetworkAnalysisTool.ClearAllTopAnalysis(globeControl1); - // ClearConnexityAnalysis();//清除连通性分析 - // ClearCloseValvesAnalysis();//清除阀门分析 - //清除管线间距分析 - //if (disFeature != null) - //{ - // if (disFeature.ID != 0) - // { - // globeControl1.Globe.MemoryLayer.RemoveFeatureByID(disFeature.ID); - // } - //} - //if (featureDis != null) - //{ - // if (featureDis.ID != 0) - // { - // globeControl1.Globe.MemoryLayer.RemoveFeatureByID(featureDis.ID); - // } - //} - - GSOFeatures feats = globeControl1.Globe.MemoryLayer.GetFeatureByName("粒子要素", true); - if (feats.Length > 0) - globeControl1.Globe.MemoryLayer.RemoveFeatureByID(feats[0].ID); +// GSOFeatures feats = globeControl1.Globe.MemoryLayer.GetFeatureByName("粒子要素", true); +// if (feats.Length > 0) +// globeControl1.Globe.MemoryLayer.RemoveFeatureByID(feats[0].ID); globeControl1.Globe.UnderGroundFloor.Visible = false;//隐藏地下网格线 // ClearUpDownTraceAnalysis(); //清除上下游分析 globeControl1.Globe.RemoveAllPits();//清除所有坑 - - string[] markerStrs = new string[9]; - markerStrs[0] = "标高标注"; - markerStrs[1] = "管径标注"; - markerStrs[2] = "埋深标注"; - markerStrs[3] = "坐标标注"; - markerStrs[4] = "坡度标注"; - markerStrs[5] = "属性标注"; - markerStrs[6] = "自定义标注"; - markerStrs[7] = "距离标注"; - markerStrs[8] = "扯旗标注"; - for (int i = 0; i < markerStrs.Length; i++) - { - GSOLayer markerLayer = globeControl1.Globe.Layers.GetLayerByCaption(markerStrs[i]); - markerLayer.RemoveAllFeature(); - } + MarkTools.removeAllMarker(globeControl1);//清除所有标注 +// string[] markerStrs = new string[9]; +// markerStrs[0] = "标高标注"; +// markerStrs[1] = "管径标注"; +// markerStrs[2] = "埋深标注"; +// markerStrs[3] = "坐标标注"; +// markerStrs[4] = "坡度标注"; +// markerStrs[5] = "属性标注"; +// markerStrs[6] = "自定义标注"; +// markerStrs[7] = "距离标注"; +// markerStrs[8] = "扯旗标注"; +// for (int i = 0; i < markerStrs.Length; i++) +// { +// GSOLayer markerLayer = globeControl1.Globe.Layers.GetLayerByCaption(markerStrs[i]); +// markerLayer.RemoveAllFeature(); +// } if (layerMarkerTree != null && layerMarkerTree.Nodes.Count > 0) { for (int i = 0; i < layerMarkerTree.Nodes[0].Nodes.Count; i++) @@ -7391,19 +7326,19 @@ /// /// /// - private void buttonItemBZ10_Click(object sender, EventArgs e) - { - //日志记录 - LogManager.saveLog(Utility.userName, buttonItemBZ10.Text); - setMarkerLayerUnVisible("红线工具"); - GSOLayer l = globeControl1.Globe.Layers.GetLayerByCaption("红线工具"); - if (l == null) return; - l.Visible = true; - globeControl1.Globe.DestLayerFeatureAdd = l; - l.Editable = true; - globeControl1.Globe.Action = EnumAction3D.DrawPolygon; - m_isDrawRedPology = true; - } +// private void buttonItemBZ10_Click(object sender, EventArgs e) +// { +// //日志记录 +// LogManager.saveLog(Utility.userName, buttonItemBZ10.Text); +// setMarkerLayerUnVisible("红线工具"); +// GSOLayer l = globeControl1.Globe.Layers.GetLayerByCaption("红线工具"); +// if (l == null) return; +// l.Visible = true; +// globeControl1.Globe.DestLayerFeatureAdd = l; +// l.Editable = true; +// globeControl1.Globe.Action = EnumAction3D.DrawPolygon; +// m_isDrawRedPology = true; +// } /// /// 标注管理 /// diff --git a/MainFrm.designer.cs b/MainFrm.designer.cs index 9c3c430..9d28318 100644 --- a/MainFrm.designer.cs +++ b/MainFrm.designer.cs @@ -3685,13 +3685,7 @@ this.buttonItemBZ9.Name = "buttonItemBZ9"; this.buttonItemBZ9.Text = "属性标注"; this.buttonItemBZ9.Click += new System.EventHandler(this.buttonItemBZ9_Click); - // - // buttonItemBZ10 - // - this.buttonItemBZ10.Image = ((System.Drawing.Image)(resources.GetObject("buttonItemBZ10.Image"))); - this.buttonItemBZ10.Name = "buttonItemBZ10"; - this.buttonItemBZ10.Text = "红线工具"; - this.buttonItemBZ10.Click += new System.EventHandler(this.buttonItemBZ10_Click); + // // buttonItemBZ11 // diff --git a/MarkInfo.cs b/MarkInfo.cs index 68ab5bd..7f2e14a 100644 --- a/MarkInfo.cs +++ b/MarkInfo.cs @@ -97,37 +97,37 @@ } - public void removeAllMarker(GSOGlobeControl globalControl) + public static void removeAllMarker(GSOGlobeControl globalControl) { GSOLayer altitudeLayer = globalControl.Globe.Layers.GetLayerByCaption("标高标注"); - altitudeLayer.RemoveAllFeature(); + if (altitudeLayer != null) altitudeLayer.RemoveAllFeature(); GSOLayer diameterLayer = globalControl.Globe.Layers.GetLayerByCaption("管径标注"); - diameterLayer.RemoveAllFeature(); + if (diameterLayer != null) diameterLayer.RemoveAllFeature(); GSOLayer depthLayer = globalControl.Globe.Layers.GetLayerByCaption("埋深标注"); - depthLayer.RemoveAllFeature(); + if (depthLayer != null) depthLayer.RemoveAllFeature(); GSOLayer locationLayer = globalControl.Globe.Layers.GetLayerByCaption("坐标标注"); - locationLayer.RemoveAllFeature(); + if (locationLayer != null) locationLayer.RemoveAllFeature(); GSOLayer slopeLayer = globalControl.Globe.Layers.GetLayerByCaption("坡度标注"); - slopeLayer.RemoveAllFeature(); + if (slopeLayer != null) slopeLayer.RemoveAllFeature(); GSOLayer propertyLayer = globalControl.Globe.Layers.GetLayerByCaption("属性标注"); - propertyLayer.RemoveAllFeature(); + if (propertyLayer != null) propertyLayer.RemoveAllFeature(); GSOLayer customLayer = globalControl.Globe.Layers.GetLayerByCaption("自定义标注"); - customLayer.RemoveAllFeature(); + if (customLayer != null) customLayer.RemoveAllFeature(); GSOLayer disLayer = globalControl.Globe.Layers.GetLayerByCaption("距离标注"); - disLayer.RemoveAllFeature(); + if (disLayer != null) disLayer.RemoveAllFeature(); GSOLayer redLineLayer = globalControl.Globe.Layers.GetLayerByCaption("红线工具"); - redLineLayer.RemoveAllFeature(); + if(redLineLayer!=null) redLineLayer.RemoveAllFeature(); GSOLayer flagLayer = globalControl.Globe.Layers.GetLayerByCaption("扯旗标注"); - flagLayer.RemoveAllFeature(); + if (flagLayer != null) flagLayer.RemoveAllFeature(); } public void showMarker(GSOFeature feature, GSOGlobeControl globalControl, diff --git a/Cyberpipe.suo b/Cyberpipe.suo index eac4ecb..a73bd12 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/MainFrm.cs b/MainFrm.cs index f6f4616..f00e84b 100644 --- a/MainFrm.cs +++ b/MainFrm.cs @@ -5632,54 +5632,7 @@ } return nid; } - /// - /// 设置除指定标注图层之外的所有标注图层不可见 - /// - /// - public void setMarkerLayerUnVisible(string layerName) - { - string[] markerStrs = new string[10]; - markerStrs[0] = "标高标注"; - markerStrs[1] = "管径标注"; - markerStrs[2] = "埋深标注"; - markerStrs[3] = "坐标标注"; - markerStrs[4] = "坡度标注"; - markerStrs[5] = "属性标注"; - markerStrs[6] = "自定义标注"; - markerStrs[7] = "距离标注"; - markerStrs[8] = "红线工具"; - markerStrs[9] = "扯旗标注"; - for (int i = 0; i < markerStrs.Length; i++) - { - GSOLayer markerLayer = globeControl1.Globe.Layers.GetLayerByCaption(markerStrs[i]); - if (markerLayer == null) continue; - if (markerStrs[i] != layerName) - { - markerLayer.Visible = false; - if (layerMarkerTree.Nodes[0].Nodes.Count > i) - { - layerMarkerTree.Nodes[0].Nodes[i].Checked = false; - } - } - else - { - markerLayer.Visible = true; - for (int j = 0; j < markerLayer.GetAllFeatures().Length; j++) - { - GSOFeature markerFeature = markerLayer.GetAt(j); - if (markerFeature != null) - { - markerFeature.Visible = false; - } - } - if (layerMarkerTree.Nodes[0].Nodes.Count > i) - { - layerMarkerTree.Nodes[0].Nodes[i].Checked = true; - } - } - } - } /// /// 判断选中的对象是否为管线 /// @@ -6421,49 +6374,31 @@ buttonClearAnalysisResult_Click(null, null); NetworkAnalysisTool.ClearAllTopAnalysis(globeControl1); - // ClearConnexityAnalysis();//清除连通性分析 - // ClearCloseValvesAnalysis();//清除阀门分析 - //清除管线间距分析 - //if (disFeature != null) - //{ - // if (disFeature.ID != 0) - // { - // globeControl1.Globe.MemoryLayer.RemoveFeatureByID(disFeature.ID); - // } - //} - //if (featureDis != null) - //{ - // if (featureDis.ID != 0) - // { - // globeControl1.Globe.MemoryLayer.RemoveFeatureByID(featureDis.ID); - // } - //} - - GSOFeatures feats = globeControl1.Globe.MemoryLayer.GetFeatureByName("粒子要素", true); - if (feats.Length > 0) - globeControl1.Globe.MemoryLayer.RemoveFeatureByID(feats[0].ID); +// GSOFeatures feats = globeControl1.Globe.MemoryLayer.GetFeatureByName("粒子要素", true); +// if (feats.Length > 0) +// globeControl1.Globe.MemoryLayer.RemoveFeatureByID(feats[0].ID); globeControl1.Globe.UnderGroundFloor.Visible = false;//隐藏地下网格线 // ClearUpDownTraceAnalysis(); //清除上下游分析 globeControl1.Globe.RemoveAllPits();//清除所有坑 - - string[] markerStrs = new string[9]; - markerStrs[0] = "标高标注"; - markerStrs[1] = "管径标注"; - markerStrs[2] = "埋深标注"; - markerStrs[3] = "坐标标注"; - markerStrs[4] = "坡度标注"; - markerStrs[5] = "属性标注"; - markerStrs[6] = "自定义标注"; - markerStrs[7] = "距离标注"; - markerStrs[8] = "扯旗标注"; - for (int i = 0; i < markerStrs.Length; i++) - { - GSOLayer markerLayer = globeControl1.Globe.Layers.GetLayerByCaption(markerStrs[i]); - markerLayer.RemoveAllFeature(); - } + MarkTools.removeAllMarker(globeControl1);//清除所有标注 +// string[] markerStrs = new string[9]; +// markerStrs[0] = "标高标注"; +// markerStrs[1] = "管径标注"; +// markerStrs[2] = "埋深标注"; +// markerStrs[3] = "坐标标注"; +// markerStrs[4] = "坡度标注"; +// markerStrs[5] = "属性标注"; +// markerStrs[6] = "自定义标注"; +// markerStrs[7] = "距离标注"; +// markerStrs[8] = "扯旗标注"; +// for (int i = 0; i < markerStrs.Length; i++) +// { +// GSOLayer markerLayer = globeControl1.Globe.Layers.GetLayerByCaption(markerStrs[i]); +// markerLayer.RemoveAllFeature(); +// } if (layerMarkerTree != null && layerMarkerTree.Nodes.Count > 0) { for (int i = 0; i < layerMarkerTree.Nodes[0].Nodes.Count; i++) @@ -7391,19 +7326,19 @@ /// /// /// - private void buttonItemBZ10_Click(object sender, EventArgs e) - { - //日志记录 - LogManager.saveLog(Utility.userName, buttonItemBZ10.Text); - setMarkerLayerUnVisible("红线工具"); - GSOLayer l = globeControl1.Globe.Layers.GetLayerByCaption("红线工具"); - if (l == null) return; - l.Visible = true; - globeControl1.Globe.DestLayerFeatureAdd = l; - l.Editable = true; - globeControl1.Globe.Action = EnumAction3D.DrawPolygon; - m_isDrawRedPology = true; - } +// private void buttonItemBZ10_Click(object sender, EventArgs e) +// { +// //日志记录 +// LogManager.saveLog(Utility.userName, buttonItemBZ10.Text); +// setMarkerLayerUnVisible("红线工具"); +// GSOLayer l = globeControl1.Globe.Layers.GetLayerByCaption("红线工具"); +// if (l == null) return; +// l.Visible = true; +// globeControl1.Globe.DestLayerFeatureAdd = l; +// l.Editable = true; +// globeControl1.Globe.Action = EnumAction3D.DrawPolygon; +// m_isDrawRedPology = true; +// } /// /// 标注管理 /// diff --git a/MainFrm.designer.cs b/MainFrm.designer.cs index 9c3c430..9d28318 100644 --- a/MainFrm.designer.cs +++ b/MainFrm.designer.cs @@ -3685,13 +3685,7 @@ this.buttonItemBZ9.Name = "buttonItemBZ9"; this.buttonItemBZ9.Text = "属性标注"; this.buttonItemBZ9.Click += new System.EventHandler(this.buttonItemBZ9_Click); - // - // buttonItemBZ10 - // - this.buttonItemBZ10.Image = ((System.Drawing.Image)(resources.GetObject("buttonItemBZ10.Image"))); - this.buttonItemBZ10.Name = "buttonItemBZ10"; - this.buttonItemBZ10.Text = "红线工具"; - this.buttonItemBZ10.Click += new System.EventHandler(this.buttonItemBZ10_Click); + // // buttonItemBZ11 // diff --git a/MarkInfo.cs b/MarkInfo.cs index 68ab5bd..7f2e14a 100644 --- a/MarkInfo.cs +++ b/MarkInfo.cs @@ -97,37 +97,37 @@ } - public void removeAllMarker(GSOGlobeControl globalControl) + public static void removeAllMarker(GSOGlobeControl globalControl) { GSOLayer altitudeLayer = globalControl.Globe.Layers.GetLayerByCaption("标高标注"); - altitudeLayer.RemoveAllFeature(); + if (altitudeLayer != null) altitudeLayer.RemoveAllFeature(); GSOLayer diameterLayer = globalControl.Globe.Layers.GetLayerByCaption("管径标注"); - diameterLayer.RemoveAllFeature(); + if (diameterLayer != null) diameterLayer.RemoveAllFeature(); GSOLayer depthLayer = globalControl.Globe.Layers.GetLayerByCaption("埋深标注"); - depthLayer.RemoveAllFeature(); + if (depthLayer != null) depthLayer.RemoveAllFeature(); GSOLayer locationLayer = globalControl.Globe.Layers.GetLayerByCaption("坐标标注"); - locationLayer.RemoveAllFeature(); + if (locationLayer != null) locationLayer.RemoveAllFeature(); GSOLayer slopeLayer = globalControl.Globe.Layers.GetLayerByCaption("坡度标注"); - slopeLayer.RemoveAllFeature(); + if (slopeLayer != null) slopeLayer.RemoveAllFeature(); GSOLayer propertyLayer = globalControl.Globe.Layers.GetLayerByCaption("属性标注"); - propertyLayer.RemoveAllFeature(); + if (propertyLayer != null) propertyLayer.RemoveAllFeature(); GSOLayer customLayer = globalControl.Globe.Layers.GetLayerByCaption("自定义标注"); - customLayer.RemoveAllFeature(); + if (customLayer != null) customLayer.RemoveAllFeature(); GSOLayer disLayer = globalControl.Globe.Layers.GetLayerByCaption("距离标注"); - disLayer.RemoveAllFeature(); + if (disLayer != null) disLayer.RemoveAllFeature(); GSOLayer redLineLayer = globalControl.Globe.Layers.GetLayerByCaption("红线工具"); - redLineLayer.RemoveAllFeature(); + if(redLineLayer!=null) redLineLayer.RemoveAllFeature(); GSOLayer flagLayer = globalControl.Globe.Layers.GetLayerByCaption("扯旗标注"); - flagLayer.RemoveAllFeature(); + if (flagLayer != null) flagLayer.RemoveAllFeature(); } public void showMarker(GSOFeature feature, GSOGlobeControl globalControl, diff --git a/bin/x86/Debug/Cyberpipe.exe b/bin/x86/Debug/Cyberpipe.exe index b41a66f..960f56c 100644 --- a/bin/x86/Debug/Cyberpipe.exe +++ b/bin/x86/Debug/Cyberpipe.exe Binary files differ diff --git a/Cyberpipe.suo b/Cyberpipe.suo index eac4ecb..a73bd12 100644 --- a/Cyberpipe.suo +++ b/Cyberpipe.suo Binary files differ diff --git a/MainFrm.cs b/MainFrm.cs index f6f4616..f00e84b 100644 --- a/MainFrm.cs +++ b/MainFrm.cs @@ -5632,54 +5632,7 @@ } return nid; } - /// - /// 设置除指定标注图层之外的所有标注图层不可见 - /// - /// - public void setMarkerLayerUnVisible(string layerName) - { - string[] markerStrs = new string[10]; - markerStrs[0] = "标高标注"; - markerStrs[1] = "管径标注"; - markerStrs[2] = "埋深标注"; - markerStrs[3] = "坐标标注"; - markerStrs[4] = "坡度标注"; - markerStrs[5] = "属性标注"; - markerStrs[6] = "自定义标注"; - markerStrs[7] = "距离标注"; - markerStrs[8] = "红线工具"; - markerStrs[9] = "扯旗标注"; - for (int i = 0; i < markerStrs.Length; i++) - { - GSOLayer markerLayer = globeControl1.Globe.Layers.GetLayerByCaption(markerStrs[i]); - if (markerLayer == null) continue; - if (markerStrs[i] != layerName) - { - markerLayer.Visible = false; - if (layerMarkerTree.Nodes[0].Nodes.Count > i) - { - layerMarkerTree.Nodes[0].Nodes[i].Checked = false; - } - } - else - { - markerLayer.Visible = true; - for (int j = 0; j < markerLayer.GetAllFeatures().Length; j++) - { - GSOFeature markerFeature = markerLayer.GetAt(j); - if (markerFeature != null) - { - markerFeature.Visible = false; - } - } - if (layerMarkerTree.Nodes[0].Nodes.Count > i) - { - layerMarkerTree.Nodes[0].Nodes[i].Checked = true; - } - } - } - } /// /// 判断选中的对象是否为管线 /// @@ -6421,49 +6374,31 @@ buttonClearAnalysisResult_Click(null, null); NetworkAnalysisTool.ClearAllTopAnalysis(globeControl1); - // ClearConnexityAnalysis();//清除连通性分析 - // ClearCloseValvesAnalysis();//清除阀门分析 - //清除管线间距分析 - //if (disFeature != null) - //{ - // if (disFeature.ID != 0) - // { - // globeControl1.Globe.MemoryLayer.RemoveFeatureByID(disFeature.ID); - // } - //} - //if (featureDis != null) - //{ - // if (featureDis.ID != 0) - // { - // globeControl1.Globe.MemoryLayer.RemoveFeatureByID(featureDis.ID); - // } - //} - - GSOFeatures feats = globeControl1.Globe.MemoryLayer.GetFeatureByName("粒子要素", true); - if (feats.Length > 0) - globeControl1.Globe.MemoryLayer.RemoveFeatureByID(feats[0].ID); +// GSOFeatures feats = globeControl1.Globe.MemoryLayer.GetFeatureByName("粒子要素", true); +// if (feats.Length > 0) +// globeControl1.Globe.MemoryLayer.RemoveFeatureByID(feats[0].ID); globeControl1.Globe.UnderGroundFloor.Visible = false;//隐藏地下网格线 // ClearUpDownTraceAnalysis(); //清除上下游分析 globeControl1.Globe.RemoveAllPits();//清除所有坑 - - string[] markerStrs = new string[9]; - markerStrs[0] = "标高标注"; - markerStrs[1] = "管径标注"; - markerStrs[2] = "埋深标注"; - markerStrs[3] = "坐标标注"; - markerStrs[4] = "坡度标注"; - markerStrs[5] = "属性标注"; - markerStrs[6] = "自定义标注"; - markerStrs[7] = "距离标注"; - markerStrs[8] = "扯旗标注"; - for (int i = 0; i < markerStrs.Length; i++) - { - GSOLayer markerLayer = globeControl1.Globe.Layers.GetLayerByCaption(markerStrs[i]); - markerLayer.RemoveAllFeature(); - } + MarkTools.removeAllMarker(globeControl1);//清除所有标注 +// string[] markerStrs = new string[9]; +// markerStrs[0] = "标高标注"; +// markerStrs[1] = "管径标注"; +// markerStrs[2] = "埋深标注"; +// markerStrs[3] = "坐标标注"; +// markerStrs[4] = "坡度标注"; +// markerStrs[5] = "属性标注"; +// markerStrs[6] = "自定义标注"; +// markerStrs[7] = "距离标注"; +// markerStrs[8] = "扯旗标注"; +// for (int i = 0; i < markerStrs.Length; i++) +// { +// GSOLayer markerLayer = globeControl1.Globe.Layers.GetLayerByCaption(markerStrs[i]); +// markerLayer.RemoveAllFeature(); +// } if (layerMarkerTree != null && layerMarkerTree.Nodes.Count > 0) { for (int i = 0; i < layerMarkerTree.Nodes[0].Nodes.Count; i++) @@ -7391,19 +7326,19 @@ /// /// /// - private void buttonItemBZ10_Click(object sender, EventArgs e) - { - //日志记录 - LogManager.saveLog(Utility.userName, buttonItemBZ10.Text); - setMarkerLayerUnVisible("红线工具"); - GSOLayer l = globeControl1.Globe.Layers.GetLayerByCaption("红线工具"); - if (l == null) return; - l.Visible = true; - globeControl1.Globe.DestLayerFeatureAdd = l; - l.Editable = true; - globeControl1.Globe.Action = EnumAction3D.DrawPolygon; - m_isDrawRedPology = true; - } +// private void buttonItemBZ10_Click(object sender, EventArgs e) +// { +// //日志记录 +// LogManager.saveLog(Utility.userName, buttonItemBZ10.Text); +// setMarkerLayerUnVisible("红线工具"); +// GSOLayer l = globeControl1.Globe.Layers.GetLayerByCaption("红线工具"); +// if (l == null) return; +// l.Visible = true; +// globeControl1.Globe.DestLayerFeatureAdd = l; +// l.Editable = true; +// globeControl1.Globe.Action = EnumAction3D.DrawPolygon; +// m_isDrawRedPology = true; +// } /// /// 标注管理 /// diff --git a/MainFrm.designer.cs b/MainFrm.designer.cs index 9c3c430..9d28318 100644 --- a/MainFrm.designer.cs +++ b/MainFrm.designer.cs @@ -3685,13 +3685,7 @@ this.buttonItemBZ9.Name = "buttonItemBZ9"; this.buttonItemBZ9.Text = "属性标注"; this.buttonItemBZ9.Click += new System.EventHandler(this.buttonItemBZ9_Click); - // - // buttonItemBZ10 - // - this.buttonItemBZ10.Image = ((System.Drawing.Image)(resources.GetObject("buttonItemBZ10.Image"))); - this.buttonItemBZ10.Name = "buttonItemBZ10"; - this.buttonItemBZ10.Text = "红线工具"; - this.buttonItemBZ10.Click += new System.EventHandler(this.buttonItemBZ10_Click); + // // buttonItemBZ11 // diff --git a/MarkInfo.cs b/MarkInfo.cs index 68ab5bd..7f2e14a 100644 --- a/MarkInfo.cs +++ b/MarkInfo.cs @@ -97,37 +97,37 @@ } - public void removeAllMarker(GSOGlobeControl globalControl) + public static void removeAllMarker(GSOGlobeControl globalControl) { GSOLayer altitudeLayer = globalControl.Globe.Layers.GetLayerByCaption("标高标注"); - altitudeLayer.RemoveAllFeature(); + if (altitudeLayer != null) altitudeLayer.RemoveAllFeature(); GSOLayer diameterLayer = globalControl.Globe.Layers.GetLayerByCaption("管径标注"); - diameterLayer.RemoveAllFeature(); + if (diameterLayer != null) diameterLayer.RemoveAllFeature(); GSOLayer depthLayer = globalControl.Globe.Layers.GetLayerByCaption("埋深标注"); - depthLayer.RemoveAllFeature(); + if (depthLayer != null) depthLayer.RemoveAllFeature(); GSOLayer locationLayer = globalControl.Globe.Layers.GetLayerByCaption("坐标标注"); - locationLayer.RemoveAllFeature(); + if (locationLayer != null) locationLayer.RemoveAllFeature(); GSOLayer slopeLayer = globalControl.Globe.Layers.GetLayerByCaption("坡度标注"); - slopeLayer.RemoveAllFeature(); + if (slopeLayer != null) slopeLayer.RemoveAllFeature(); GSOLayer propertyLayer = globalControl.Globe.Layers.GetLayerByCaption("属性标注"); - propertyLayer.RemoveAllFeature(); + if (propertyLayer != null) propertyLayer.RemoveAllFeature(); GSOLayer customLayer = globalControl.Globe.Layers.GetLayerByCaption("自定义标注"); - customLayer.RemoveAllFeature(); + if (customLayer != null) customLayer.RemoveAllFeature(); GSOLayer disLayer = globalControl.Globe.Layers.GetLayerByCaption("距离标注"); - disLayer.RemoveAllFeature(); + if (disLayer != null) disLayer.RemoveAllFeature(); GSOLayer redLineLayer = globalControl.Globe.Layers.GetLayerByCaption("红线工具"); - redLineLayer.RemoveAllFeature(); + if(redLineLayer!=null) redLineLayer.RemoveAllFeature(); GSOLayer flagLayer = globalControl.Globe.Layers.GetLayerByCaption("扯旗标注"); - flagLayer.RemoveAllFeature(); + if (flagLayer != null) flagLayer.RemoveAllFeature(); } public void showMarker(GSOFeature feature, GSOGlobeControl globalControl, diff --git a/bin/x86/Debug/Cyberpipe.exe b/bin/x86/Debug/Cyberpipe.exe index b41a66f..960f56c 100644 --- a/bin/x86/Debug/Cyberpipe.exe +++ b/bin/x86/Debug/Cyberpipe.exe Binary files differ diff --git a/bin/x86/Debug/Cyberpipe.pdb b/bin/x86/Debug/Cyberpipe.pdb index 204ed44..23fa0ef 100644 --- a/bin/x86/Debug/Cyberpipe.pdb +++ b/bin/x86/Debug/Cyberpipe.pdb Binary files differ