private void CloseBut_Click(object obj, EventArgs eventArgs) { base.Visible = false; if (this.checkReView.Checked) { SearchAffixAnalyDlg.DeleteAllElements(this.m_iApp.ActiveView); } }
private void SearchAffixAnalyDlg_FormClosing(object obj, FormClosingEventArgs formClosingEventArgs) { formClosingEventArgs.Cancel = true; base.Visible = false; if (this.checkReView.Checked) { SearchAffixAnalyDlg.DeleteAllElements(this.m_iApp.ActiveView); } }
public void OnMouseDown(double x, double y) { if (this.chkBoxSet.Checked) { this.txBoxX.Text = x.ToString("f3"); this.txBoxY.Text = y.ToString("f3"); SearchAffixAnalyDlg.DeleteAllElements(this.m_iApp.ActiveView); IPoint point = new ESRI.ArcGIS.Geometry.Point(); point.X = (x); point.Y = (y); SearchAffixAnalyDlg.NewBasePointElement(this.m_iApp.ActiveView, point); this.chkBoxSet.Checked = false; } }
private void method_4(object obj, EventArgs eventArgs) { IPoint point = new ESRI.ArcGIS.Geometry.Point(); if (this.txBoxX.Text == "") { point.X = (0.0); } else { point.X = (Convert.ToDouble(this.txBoxX.Text.Trim())); } if (this.txBoxY.Text == "") { point.Y = (0.0); } else { point.Y = (Convert.ToDouble(this.txBoxY.Text.Trim())); } SearchAffixAnalyDlg.NewBasePointElement(this.m_iApp.ActiveView, point); }
private void btnAnalyse_Click(object obj, EventArgs eventArgs) { if (this.MapControl != null) { this.igeometryCollection_0.RemoveGeometries(0, this.igeometryCollection_0.GeometryCount); SearchAffixAnalyDlg.DeleteAllElements(this.m_iApp.ActiveView); ((IFeatureSelection)this.ifeatureLayer_0).Clear(); IFeatureClass featureClass = this.ifeatureLayer_0.FeatureClass; ISpatialFilter spatialFilter = new SpatialFilter(); string text = ""; int count = this.list_0.Count; int num = 1; foreach (string current in this.list_0) { text += this.string_0; text += " = '"; text += current; text += "'"; if (num < count) { text += " OR "; } num++; } if (this.txBoxX.Text == "" || this.txBoxY.Text == "") { MessageBox.Show("请设置搜索中心点坐标!"); } else if (this.txBoxRadius.Text == "") { MessageBox.Show("请设置查找半径!"); } else { if (this.list_0.Count != 0) { } this.m_iApp.ActiveView.Refresh(); IPoint point = new ESRI.ArcGIS.Geometry.Point(); double num2 = 0.0; if (this.txBoxX.Text == "") { point.X = (0.0); } else { point.X = (Convert.ToDouble(this.txBoxX.Text.Trim())); } if (this.txBoxY.Text == "") { point.Y = (0.0); } else { point.Y = (Convert.ToDouble(this.txBoxY.Text.Trim())); } SearchAffixAnalyDlg.NewBasePointElement(this.m_iApp.ActiveView, point); if (this.txBoxRadius.Text != "") { num2 = Convert.ToDouble(this.txBoxRadius.Text.Trim()); } ITopologicalOperator topologicalOperator = (ITopologicalOperator)point; IGeometry geometry = topologicalOperator.Buffer(num2); spatialFilter.Geometry = (geometry); spatialFilter.SpatialRel = (esriSpatialRelEnum)(1); spatialFilter.WhereClause = (text); if (this.list_0.Count > 0) { IFeatureCursor featureCursor = featureClass.Search(spatialFilter, false); for (IFeature feature = featureCursor.NextFeature(); feature != null; feature = featureCursor.NextFeature()) { object missing = Type.Missing; this.igeometryCollection_0.AddGeometry(feature.ShapeCopy, ref missing, ref missing); SearchAffixAnalyDlg.NewPointElement(this.m_iApp.ActiveView, feature.ShapeCopy as IPoint); this.method_7(this.m_iApp.ActiveView, point, feature.Shape as IPoint); } IRgbColor rgbColor = new RgbColor(); rgbColor.Red = (255); rgbColor.Green = (0); rgbColor.Blue = (0); IRgbColor rgbColor2 = new RgbColor(); rgbColor2.Red = (0); rgbColor2.Green = (255); rgbColor2.Blue = (0); this.method_9(this.m_iApp.ActiveView, point, num2, false, rgbColor); this.method_9(this.m_iApp.ActiveView, point, num2 / 2.0, false, rgbColor2); this.FlashDstItem(); //featureCursor = featureClass.Search(spatialFilter, false); ((IFeatureSelection)this.ifeatureLayer_0).SelectFeatures(spatialFilter, esriSelectionResultEnum.esriSelectionResultNew, false); //this.m_iApp.SetResult(featureCursor, (IFeatureSelection)this.ifeatureLayer_0); } if (this.checAnaPipeline.Checked) { ILayer layer = (IFeatureLayer) CommonUtils.GetLayerByName(this.m_iApp.FocusMap, this.LayerBox.Text.Replace("点", "线")); if (layer != null) { spatialFilter = new SpatialFilter(); topologicalOperator = (ITopologicalOperator)point; geometry = topologicalOperator.Buffer(num2); spatialFilter.Geometry = (geometry); spatialFilter.SpatialRel = (esriSpatialRelEnum)(1); IFeatureCursor featureCursor2 = (layer as IFeatureLayer).FeatureClass.Search(spatialFilter, false); for (IFeature feature = featureCursor2.NextFeature(); feature != null; feature = featureCursor2.NextFeature()) { object missing = Type.Missing; this.method_5(point, feature); } featureCursor2 = (layer as IFeatureLayer).FeatureClass.Search(spatialFilter, false); ((IFeatureSelection)layer).SelectFeatures(spatialFilter, esriSelectionResultEnum.esriSelectionResultNew, false); // this.m_iApp.SetResult(featureCursor2, (IFeatureSelection)layer); } } } } }