public CreateCirclePolygonFeatureTool() { //if (featureLayer.FeatureClass.ShapeType == esriGeometryType.esriGeometryPolygon) //{ // m_pCurrentLayer = featureLayer; //} //else //{ // return; //} // TODO: Define values for the public properties // base.m_category = ""; //localizable text base.m_caption = ""; //localizable text base.m_message = ""; //localizable text base.m_toolTip = ""; //localizable text base.m_name = ""; //unique id, non-localizable (e.g. "MyCategory_MyTool") try { // // TODO: change resource name if necessary // string bitmapResourceName = GetType().Name + ".bmp"; base.m_bitmap = new Bitmap(GetType(), bitmapResourceName); base.m_cursor = new System.Windows.Forms.Cursor(GetType(), GetType().Name + ".cur"); } catch (Exception ex) { System.Diagnostics.Trace.WriteLine(ex.Message, "Invalid Bitmap"); } m_EngineEditProperties = new EngineEditorClass(); }
public CreateEnvelopeTool() { // // TODO: Define values for the public properties // base.m_category = ""; //localizable text base.m_caption = ""; //localizable text base.m_message = ""; //localizable text base.m_toolTip = ""; //localizable text base.m_name = ""; //unique id, non-localizable (e.g. "MyCategory_MyTool") try { // // TODO: change resource name if necessary // string bitmapResourceName = GetType().Name + ".bmp"; base.m_bitmap = new Bitmap(GetType(), bitmapResourceName); base.m_cursor = new System.Windows.Forms.Cursor(GetType(), GetType().Name + ".cur"); } catch (Exception ex) { System.Diagnostics.Trace.WriteLine(ex.Message, "Invalid Bitmap"); } m_EngineEditProperties = new EngineEditorClass(); }
public Modify1SegmentOfAPolyline() { base.m_category = "GeometryAndSR"; base.m_caption = "移动线段"; base.m_message = "移动线段"; base.m_toolTip = "移动线段"; base.m_name = "Modify1Segment"; m_engineEditor = new EngineEditorClass(); }
public Move1VertexOfGeometry() { base.m_category = "GeometryAndSR"; base.m_caption = "移动要素顶点"; base.m_message = "移动要素顶点"; base.m_toolTip = "移动要素顶点"; base.m_name = "Modify1Vertex"; m_engineEditor = new EngineEditorClass(); }
/// <summary> /// Occurs when this tool is clicked /// </summary> public override void OnClick() { m_toolPhase = ToolPhase.SelectFeature; m_engineEditor = new EngineEditorClass(); ILayer layer = m_engineEditor.TargetLayer; if (layer == null) { MessageBox.Show("请先启动编辑!!", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } }
private void btn_StartEditing_Click(object sender, EventArgs e) { ICommand cmd = new ControlsEditingStartCommandClass(); cmd.OnCreate(m_MapControl.Object); cmd.OnClick(); m_EngineEditProperties = new EngineEditorClass(); if (m_EngineEditProperties.TargetLayer != null) { EnableControlInEditorToolBar(); cbx_EditTask.SelectedIndex = 0; } }
public override void OnClick() { m_engineEditor = new EngineEditorClass(); ILayer layer = m_engineEditor.TargetLayer; m_activeView = m_hookHelper.ActiveView; m_map = m_hookHelper.FocusMap; IEnumFeature selectedFeatures = GetSelectedFeatures(); if (selectedFeatures == null) { return; } SelectSourceFeature(selectedFeatures); UnionFeatures(selectedFeatures, pMergeFeature); m_activeView.PartialRefresh(esriViewDrawPhase.esriViewGeography | esriViewDrawPhase.esriViewGeoSelection, null, m_activeView.Extent); }
public DeleteFeature() { base.m_category = "SpatialQueryAndAnalysis"; base.m_caption = "删除要素"; base.m_message = "删除要素"; base.m_toolTip = "删除要素"; base.m_name = "DeleteFeature"; try { string bitmapResourceName = GetType().Name + ".bmp"; base.m_bitmap = new Bitmap(GetType(), bitmapResourceName); base.m_cursor = new System.Windows.Forms.Cursor(GetType(), GetType().Name + ".cur"); } catch (Exception ex) { System.Diagnostics.Trace.WriteLine(ex.Message, "Invalid Bitmap"); } eep = new EngineEditorClass(); }
public void DrawShape(IDisplay pScreenDisplay, IGeometry pPolyLine) { IEngineEditProperties properties = this._editor as IEngineEditProperties; ILineSymbol sketchSymbol = properties.SketchSymbol; IMarkerSymbol sketchVertexSymbol = properties.SketchVertexSymbol; ITransformation displayTransformation = pScreenDisplay.DisplayTransformation; ISymbol symbol3 = sketchSymbol as ISymbol; symbol3.SetupDC(pScreenDisplay.hDC, displayTransformation); symbol3.Draw(pPolyLine); symbol3.ResetDC(); symbol3 = sketchVertexSymbol as ISymbol; IPointCollection points = pPolyLine as IPointCollection; symbol3.SetupDC(pScreenDisplay.hDC, displayTransformation); for (int i = 0; i < points.PointCount; i++) { IPoint geometry = points.get_Point(i); symbol3.Draw(geometry); } symbol3.ResetDC(); }
public override void OnMouseDown(int Button, int Shift, int X, int Y) { if (Button != (int)Keys.LButton) { return; } m_activeView = m_hookHelper.ActiveView; m_map = m_hookHelper.FocusMap; if (m_map == null || m_activeView == null) { return; } m_engineEditor = new EngineEditorClass(); ILayer layer = m_engineEditor.TargetLayer; if (layer == null) { MessageBox.Show("请先启动编辑!!", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } m_activePoint = m_activeView.ScreenDisplay.DisplayTransformation.ToMapPoint(X, Y); switch (m_toolPhase) { case (ToolPhase.SelectFeature): //base.m_cursor = new System.Windows.Forms.Cursor(GetType(), "arrow_l.cur"); GetSelectedFeature(); // base.m_cursor = new System.Windows.Forms.Cursor(GetType(), "pen.cur"); break; case (ToolPhase.Cut): // base.m_cursor = new System.Windows.Forms.Cursor(GetType(), "pen.cur"); CutSelectedPolygon(); // base.m_cursor = new System.Windows.Forms.Cursor(GetType(), "arrow_l.cur"); break; } }
public UnionFeaturesCmd() { m_engineEditor = new EngineEditorClass(); }
public PolygonsDifference() { m_engineEditor = new EngineEditorClass(); }