private void Class_Initialize() { INewLineFeedback pNewLineFeedback; bBegineMove = false; m_pOffsetTraceLine = new PolygonClass(); pNewLineFeedback = new NewLineFeedbackClass(); m_pSymbol = (ISimpleLineSymbol)pNewLineFeedback.Symbol; m_pGraph = new SegmentGraphClass(); //获得状态栏的服务 //m_pStatusBarService = (IStatusBarService)ServiceManager.Services.GetService(typeof(WSGRI.DigitalFactory.Services.UltraStatusBarService)); }
public override void OnCreate(object hook) { _context = hook as IAppContext; this.m_caption = "跟踪"; this.m_category = "编辑器"; this.m_name = "Edit_FollowAlong"; this._key = "Edit_FollowAlong"; this.m_message = "跟踪"; this.m_toolTip = "跟踪"; this.m_bitmap = Properties.Resources.icon_edit_track; this.m_cursor = new System.Windows.Forms.Cursor(new MemoryStream(Resource.Digitise)); this.bool_2 = false; this.iconstructCurve_0 = new Polyline() as IConstructCurve; this.isimpleLineSymbol_0 = new SimpleLineSymbol(); this.isimpleLineSymbol_0.Width = 1.0; this.isegmentGraph_0 = new SegmentGraph(); DisplayStyleYT = DisplayStyleYT.Image; base.TextImageRelationYT = TextImageRelationYT.ImageAboveText; base.ToolStripItemImageScalingYT = ToolStripItemImageScalingYT.None; _itemType = RibbonItemType.Button; if (_context is IApplicationEvents) { (_context as IApplicationEvents).OnActiveHookChanged += new OnActiveHookChangedHandler(this.AppContext_ActiveHookChanged); } if (this.iactiveViewEvents_Event_0 != null) { try { this.iactiveViewEvents_Event_0.AfterDraw -= new IActiveViewEvents_AfterDrawEventHandler(ActiveView_AfterDraw); } catch { } } if (_context.FocusMap != null) { this.iactiveViewEvents_Event_0 = (_context.ActiveView as IActiveViewEvents_Event); this.iactiveViewEvents_Event_0.AfterDraw += new IActiveViewEvents_AfterDrawEventHandler(ActiveView_AfterDraw); this.snapHelper_0 = new SnapHelper(_context); } }
private ICurve ConstructOffset(IPolyline inPolyline, double distanceFromCurve, bool isRightSide, double elevation) { if (inPolyline == null || inPolyline.IsEmpty) { return(null); } object Missing = Type.Missing; IPolyline pPoly = new ESRI.ArcGIS.Geometry.Polyline() as IPolyline; IConstructCurve constructCurve = (IConstructCurve)pPoly; if (!isRightSide) { distanceFromCurve = -distanceFromCurve; } constructCurve.ConstructOffset(inPolyline, distanceFromCurve, ref Missing, ref Missing); IRgbColor rgbColor = GetColor(0, 0, 0); AddTempolralPathToMap(m_MapMapControl, constructCurve as IGeometry, rgbColor); AddTempolralPathToGlobe(constructCurve as IGeometry, elevation); return(constructCurve as ICurve); }
public override void OnKeyDown(int int_2, int int_3) { if (int_2 != 27) { switch (int_2) { case 68: { frmTrackSet frmTrackSet = new frmTrackSet(); frmTrackSet.offset = this.double_0; frmTrackSet.ConstructOffset = this.int_1; if (frmTrackSet.ShowDialog() == System.Windows.Forms.DialogResult.OK) { this.double_0 = frmTrackSet.offset; this.int_1 = frmTrackSet.ConstructOffset; if (this.bool_2) { this.ipolyline_0 = this.isegmentGraphCursor_0.CurrentTrace; object value = Missing.Value; object obj = esriConstructOffsetEnum.esriConstructOffsetSimple; this.iconstructCurve_0.ConstructOffset(this.ipolyline_0, this.double_0, ref obj, ref value); this.method_4(); } } break; } case 69: break; case 70: { this.iline_0 = null; this.ipolyline_0 = this.isegmentGraphCursor_0.CurrentTrace; object value = Missing.Value; object obj = this.int_1; this.iconstructCurve_0.ConstructOffset(this.ipolyline_0, this.double_0, ref obj, ref value); this.method_1(); this.method_2(this.iconstructCurve_0 as IPolyline); if (SketchToolAssist.Feedback != null) { this.method_0(); } break; } default: if (int_2 == 119) { this.bool_5 = !this.bool_5; } break; } } else { this.iline_0 = null; this.ipolyline_0 = null; this.iconstructCurve_0 = new Polyline() as IConstructCurve; IInvalidArea invalidArea = new InvalidAreaClass { Display = _context.ActiveView.ScreenDisplay }; invalidArea.Add(this.iconstructCurve_0); invalidArea.Invalidate(0); this.method_1(); SketchShareEx.m_pLastPoint1 = null; SketchShareEx.m_pEndPoint1 = null; SketchShareEx.m_totalLength = 0.0; SketchShareEx.m_bInUse = false; SketchShareEx.LastPoint = null; SketchToolAssist.Feedback = null; SketchShareEx.PointCount = 0; SketchShareEx.m_bInUse = false; SketchShareEx.m_LastPartGeometry = null; _context.ActiveView.Refresh(); string string_ = "取消创建要素"; _context.ShowCommandString(string_, CommandTipsType.CTTInput); _context.ShowCommandString("", CommandTipsType.CTTActiveEnd); } }