private void frmBurstReport_Load(object obj, EventArgs eventArgs) { ArrayList arrayList = new ArrayList(); CMapOperator.GetMapILayers(m_iApp.FocusMap, null, arrayList); //string pointTableFieldName = m_Config.GetPointTableFieldName("点性"); //this.label1.Text = pointTableFieldName; //for (int i = 0; i < arrayList.Count; i++) //{ // IFeatureLayer featureLayer = arrayList[i] as IFeatureLayer; // if (featureLayer == null || featureLayer.FeatureClass == null) continue; // if (featureLayer.FeatureClass.ShapeType != esriGeometryType.esriGeometryPoint) continue; // //! 在这儿修改判断条件,判断图层为点图层而且为管线点图层的方式需要做修改 // IBasicLayerInfo pipePoint = m_Config.GetBasicLayerInfo(featureLayer.FeatureClass.AliasName) as IBasicLayerInfo; // if (pipePoint!=null) // { // if (pipePoint.DataType != enumPipelineDataType.Point) continue; // IFeatureClass featureClass = featureLayer.FeatureClass; // this.label1.Text = pipePoint.GetFieldName(PipeConfigWordHelper.PointWords.FSW); // int num = featureClass.Fields.FindField(pipePoint.GetFieldName(PipeConfigWordHelper.PointWords.FSW)); // if (num != -1) // { // ArrayList uVByQueryDef = this.GetUVByQueryDef(featureLayer, pipePoint.GetFieldName(PipeConfigWordHelper.PointWords.FSW)); // for (int j = 0; j < uVByQueryDef.Count; j++) // { // string text = uVByQueryDef[j].ToString(); // if (text.Trim() != "" && !this.cmbDomainValues.Items.Contains(text)) // { // this.cmbDomainValues.Items.Add(text); // } // this.cmbDomainValues.Items.Add(text); // } // } // } //} //if (this.cmbDomainValues.Items.Count > 0) //{ // this.cmbDomainValues.SelectedIndex = 0; //} //ArrayList arrayList2 = new ArrayList(); //GetValues(arrayList2); //for (int j = 0; j < arrayList2.Count; j++) //{ // this.listFieldValues.Items.Add(arrayList2[j].ToString()); //} //if (this.listFieldValues.Items.Count == 0) //{ // this.listFieldValues.Items.Add("阀门"); // this.listFieldValues.Items.Add("阀门井"); //} this.radioUpAndDown.Checked = true; }
private void timer_0_Tick(object obj, EventArgs eventArgs) { if (!base.Visible || this.m_nTimerCount > 1) { this.m_nTimerCount = 0; this.timer_0.Stop(); IActiveView activeView = _context.ActiveView; activeView.PartialRefresh((esriViewDrawPhase)8, null, null); } CMapOperator.ShowFeatureWithWink(_context.ActiveView.ScreenDisplay, this._curShape); this.m_nTimerCount++; }
private void timer1_Tick(object sender, EventArgs e) { if (!base.Visible || this.m_nTimerCount > 1) { this.m_nTimerCount = 0; this.timer1.Stop(); IActiveView activeView = m_context.ActiveView; activeView.PartialRefresh((esriViewDrawPhase)8, null, null); this.m_pGeoFlash = null; } else { CMapOperator.ShowFeatureWithWink(m_context.ActiveView.ScreenDisplay, this.m_pGeoFlash); this.m_nTimerCount++; } }
private void FormMaiShenAnalysis_Load(object obj, EventArgs eventArgs) { IFeature feature = ((IEnumFeature)_context.FocusMap.FeatureSelection).Next(); //if (feature == null || feature.Shape.GeometryType != esriGeometryType.esriGeometryPolygon) //{ // this.chkRegionAnalysis.Visible = false; //} ArrayList arrayList = new ArrayList(); CMapOperator.GetMapILayers(_context.FocusMap, null, arrayList); for (int i = 0; i < arrayList.Count; i++) { if (arrayList[i] is IFeatureLayer) { IFeatureLayer featureLayer = (IFeatureLayer)arrayList[i]; if (_config.IsPipelineLayer(featureLayer.Name, enumPipelineDataType.Line)) { CheckListFeatureLayerItem class1 = new CheckListFeatureLayerItem(); class1.m_pFeatureLayer = featureLayer; this.checkedListBox1.Items.Add(class1, true); } } } }
private void treeView1_AfterSelect(object obj, TreeViewEventArgs treeViewEventArgs) { if (this.treeView1.SelectedNode != null) { if (this.treeView1.SelectedNode.Parent == null) { IPolyline polyline = this.treeView1.SelectedNode.Tag as IPolyline; if (polyline != null) { CMapOperator.ShowFeatureWithWink(_context.ActiveView.ScreenDisplay, polyline); // FlashUtility.FlashGeometry(polyline,_context.MapControl); } } else { IFeature feature = this.treeView1.SelectedNode.Tag as IFeature; if (feature != null) { // FlashUtility.FlashGeometry(feature.Shape, _context.MapControl); CMapOperator.ShowFeatureWithWink(_context.ActiveView.ScreenDisplay, feature.Shape); } } } }
private void SetButton_Click(object obj, EventArgs eventArgs) { int count = this.listJunctionFlag.Count; int count2 = this.listEdgeFlag.Count; int count3 = this.listJunctionBarrier.Count; int count4 = this.listEdgeBarrier.Count; if (count < 1 && count2 < 1) { MessageBox.Show("请用户选择要分析的点或线!"); } else { IEdgeFlag[] array = new EdgeFlag[count2]; IJunctionFlag[] array2 = new JunctionFlag[count]; INetwork network = null; INetworkClass networkClass = null; if (count > 0) { for (int i = 0; i < count; i++) { IFeature feature = this.listJunctionFlag[i]; networkClass = (feature.Class as INetworkClass); network = networkClass.GeometricNetwork.Network; INetElements netElements = network as INetElements; INetFlag netFlag = new JunctionFlag() as INetFlag; ISimpleJunctionFeature simpleJunctionFeature = feature as ISimpleJunctionFeature; int userClassID; int userID; int userSubID; netElements.QueryIDs(simpleJunctionFeature.EID, (esriElementType)1, out userClassID, out userID, out userSubID); netFlag.UserClassID = (userClassID); netFlag.UserID = (userID); netFlag.UserSubID = (userSubID); IJunctionFlag junctionFlag = netFlag as IJunctionFlag; array2[i] = junctionFlag; } } if (count2 > 0) { for (int j = 0; j < count2; j++) { IFeature feature2 = this.listEdgeFlag[j]; networkClass = (feature2.Class as INetworkClass); network = networkClass.GeometricNetwork.Network; INetElements netElements2 = network as INetElements; INetFlag netFlag2 = new EdgeFlag() as INetFlag; ISimpleEdgeFeature simpleEdgeFeature = feature2 as ISimpleEdgeFeature; int userClassID2; int userID2; int userSubID2; netElements2.QueryIDs(simpleEdgeFeature.EID, (esriElementType)2, out userClassID2, out userID2, out userSubID2); netFlag2.UserClassID = (userClassID2); netFlag2.UserID = (userID2); netFlag2.UserSubID = (userSubID2); IEdgeFlag edgeFlag = netFlag2 as IEdgeFlag; array[j] = edgeFlag; } } ITraceFlowSolverGEN traceFlowSolverGEN = new TraceFlowSolver() as ITraceFlowSolverGEN; INetSolver netSolver = traceFlowSolverGEN as INetSolver; INetElementBarriersGEN netElementBarriersGEN = new NetElementBarriers(); netElementBarriersGEN.Network = (network); netElementBarriersGEN.ElementType = (esriElementType)(1); int[] array3 = new int[count3]; int num = 0; if (count3 > 0) { for (int k = 0; k < count3; k++) { IFeature feature3 = this.listJunctionBarrier[k]; networkClass = (feature3.Class as INetworkClass); network = networkClass.GeometricNetwork.Network; INetElements netElements3 = network as INetElements; new EdgeFlag(); ISimpleJunctionFeature simpleJunctionFeature2 = feature3 as ISimpleJunctionFeature; int num2; int num3; netElements3.QueryIDs(simpleJunctionFeature2.EID, (esriElementType)1, out num, out num2, out num3); array3[k] = num2; } netElementBarriersGEN.SetBarriers(num, ref array3); netSolver.set_ElementBarriers((esriElementType)1, (INetElementBarriers)netElementBarriersGEN); } INetElementBarriersGEN netElementBarriersGEN2 = new NetElementBarriers(); netElementBarriersGEN2.Network = (network); netElementBarriersGEN2.ElementType = (esriElementType)(2); int[] array4 = new int[count4]; if (count4 > 0) { for (int l = 0; l < count4; l++) { IFeature feature4 = this.listEdgeBarrier[l]; networkClass = (feature4.Class as INetworkClass); network = networkClass.GeometricNetwork.Network; INetElements netElements4 = network as INetElements; new EdgeFlag(); ISimpleEdgeFeature simpleEdgeFeature2 = feature4 as ISimpleEdgeFeature; int num4; int num5; netElements4.QueryIDs(simpleEdgeFeature2.EID, (esriElementType)2, out num, out num4, out num5); array4[l] = num4; } netElementBarriersGEN2.SetBarriers(num, ref array4); netSolver.set_ElementBarriers((esriElementType)2, (INetElementBarriers)netElementBarriersGEN2); } netSolver.SourceNetwork = (network); if (count > 0) { traceFlowSolverGEN.PutJunctionOrigins(ref array2); } if (count2 > 0) { traceFlowSolverGEN.PutEdgeOrigins(ref array); } IEnumNetEID enumNetEID = null; IEnumNetEID enumNetEID2 = null; object[] array5 = new object[1]; if (this.WayCom.SelectedIndex == 0) { traceFlowSolverGEN.FindSource(0, (esriShortestPathObjFn)1, out enumNetEID, out enumNetEID2, count + count2, ref array5); } if (this.WayCom.SelectedIndex == 1) { traceFlowSolverGEN.FindSource((esriFlowMethod)1, (esriShortestPathObjFn)1, out enumNetEID, out enumNetEID2, count + count2, ref array5); } IPolyline polyline = new Polyline() as IPolyline; IGeometryCollection geometryCollection = polyline as IGeometryCollection; ISpatialReference spatialReference = this.m_iApp.FocusMap.SpatialReference; IEIDHelper iEIDHelper = new EIDHelper(); iEIDHelper.GeometricNetwork = (networkClass.GeometricNetwork); iEIDHelper.OutputSpatialReference = (spatialReference); iEIDHelper.ReturnGeometries = (true); iEIDHelper.ReturnFeatures = (true); int selectedIndex = this.LayerCom.SelectedIndex; if (selectedIndex >= 0 && this.MapControl != null) { this.LayerCom.SelectedItem.ToString(); IFeatureLayer ifeatureLayer_ = ((TrackingAnalyForm.LayerInfo) this.LayerCom.SelectedItem)._layer; if (ifeatureLayer_ != null) { IFeatureSelection featureSelection = (IFeatureSelection)ifeatureLayer_; featureSelection.Clear(); if (enumNetEID2 != null) { IEnumEIDInfo enumEIDInfo = iEIDHelper.CreateEnumEIDInfo(enumNetEID2); int count5 = enumEIDInfo.Count; enumEIDInfo.Reset(); for (int m = 0; m < count5; m++) { IEIDInfo iEIDInfo = enumEIDInfo.Next(); featureSelection.Add(iEIDInfo.Feature); IGeometry geometry = iEIDInfo.Geometry; geometryCollection.AddGeometryCollection(geometry as IGeometryCollection); } } featureSelection.SelectionSet.Refresh(); IActiveView activeView = this.m_iApp.ActiveView; activeView.Refresh(); CMapOperator.ShowFeatureWithWink(this.m_iApp.ActiveView.ScreenDisplay, polyline); } } } }