public override void OnMouseMove(int Button, int Shift, int X, int Y) { if (m_hookHelper != null) { if (m_blnInMouseDown == false) { return; } IPoint pPt; pPt = m_pScreenDisplay.DisplayTransformation.ToMapPoint(X, Y); m_blnSnap = false; if (m_pNewLineFeedback != null) { m_pNewLineFeedback.MoveTo(pPt); } if (ClsDeclare.g_blnSnap == true) { m_pSnapPoint = MeasureSnapPoint(pPt); if (m_pSnapPoint != null) { m_blnSnap = true; } else { m_blnSnap = false; } } if (m_pNewLineFeedback != null) { if (m_blnSnap == true) { m_pNewLineFeedback.MoveTo(m_pSnapPoint); } else { m_pNewLineFeedback.MoveTo(pPt); } } double deltaX; double deltaY; if (m_pPoint != null && m_pNewLineFeedback != null) { m_pGeometry = pPt; deltaX = ClsDeclare.g_UnitConverter.ConvertPointCoordinate(pPt).X - ClsDeclare.g_UnitConverter.ConvertPointCoordinate(m_pPoint).X; deltaY = ClsDeclare.g_UnitConverter.ConvertPointCoordinate(pPt).Y - ClsDeclare.g_UnitConverter.ConvertPointCoordinate(m_pPoint).Y; m_douDistance = System.Math.Round(System.Math.Sqrt((deltaX * deltaX) + (deltaY * deltaY)), 3); m_douTotal = m_douTotal + m_douDistance; ClsDeclare.g_strUnit = ClsDeclare.g_UnitConverter.CurrentUnitName; ClsDeclare.g_txtMeasure.Clear(); ClsDeclare.g_txtMeasure.Text = "长度量算" + "\r" + "\n" + "段长度:" + m_douDistance + ClsDeclare.g_strUnit + "\r" + "\n" + "总长度:" + m_douTotal + ClsDeclare.g_strUnit; m_douTotal = m_douTotal - m_douDistance; } } else if (m_sceneHookHelper != null) { } else if (m_globeHookHelper != null) { } }
public override void OnMouseMove(int button, int shift, int x, int y, double mapX, double mapY) { // TODO: 添加 DrawCircle3P.OnMouseMove 实现 base.OnMouseMove(button, shift, x, y, mapX, mapY); m_pPoint = m_pActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(x, y); m_pAnchorPoint = m_pPoint; //+++++++++++++开始捕捉+++++++++++++++++++++ if (m_pLastPoint != null) { if (m_pLastPoint.IsEmpty) { bool flag = CommonFunction.Snap(m_MapControl, m_App.CurrentConfig.cfgSnapEnvironmentSet, null, m_pAnchorPoint); } } else { if (!m_pLastPoint.IsEmpty) { bool flag = CommonFunction.Snap(m_MapControl, m_App.CurrentConfig.cfgSnapEnvironmentSet, m_pLastPoint, m_pAnchorPoint); } } if (m_bFirst) //如果已经形成圆周上的两个点 { //########################平行尺######################## CommonFunction.ParallelRule(ref m_bKeyCodeP, m_pActiveView, m_dblTolerance, ref m_pSegment, m_pLastPoint, m_pPoint, ref m_pAnchorPoint); //&&&&&&&&&&&&&&&&&&&&&&&& 正 交 &&&&&&&&&&&&&&&&&&&&&&& CommonFunction.PositiveCross(m_pLastPoint, ref m_pAnchorPoint, m_App.CurrentConfig.cfgPositiveCross.IsPositiveCross); if (m_bSecond) { m_pCenterPoint = CommonFunction.GetCenter_P123(m_pPoint1, m_pPoint2, m_pAnchorPoint); m_pCircleFeed = (NewCircleFeedbackClass)m_pFeedback; m_pCircleFeed.Display = m_pActiveView.ScreenDisplay; m_pCircleFeed.Stop(); m_pCircleFeed.Start(m_pCenterPoint); m_pFeedback.MoveTo(m_pAnchorPoint); } } if (m_bFirst && !m_bSecond && !m_bThree) { m_pLineFeed.MoveTo(m_pAnchorPoint); } }
public override void OnMouseMove(int Button, int Shift, int x, int y) { IActiveView activeView = _context.ActiveView; IPoint point = activeView.ScreenDisplay.DisplayTransformation.ToMapPoint(x, y); ISnappingResult snappingResult = _pointSnapper.Snap(point); if (snappingResult == null) { _lineFeedback?.MoveTo(point); } else { point = snappingResult.Location; _lineFeedback?.MoveTo(point); } }
public void OnMouseMove(int button, int shift, int x, int y) { if (m_pLinefeedback != null) { IPoint pPoint = m_pScreenDisplay.DisplayTransformation.ToMapPoint(x, y); m_pLinefeedback.MoveTo(pPoint); } }
//鼠标在Map上的移动事件 public override void OnMouseMove(int Button, int Shift, int X, int Y) { if (m_NewLineFeedBack != null) { IPoint pPnt = m_ScreenDisplay.DisplayTransformation.ToMapPoint(X, Y); m_NewLineFeedBack.MoveTo(pPnt); } }
/// <summary> /// 鼠标移动时运行 /// </summary> /// <param name="movePT">地图点</param> public void OnMouseMoveRun(IPoint movePT) { if (lineFeedback != null) { lineFeedback.MoveTo(movePT); currentLength = Math.Round(Math.Sqrt(Math.Pow(tempPT.X - movePT.X, 2) + Math.Pow(tempPT.Y - movePT.Y, 2)), 3); lengthResult = totalLength + currentLength; } }
public override void OnMouseMove(int Button, int Shift, int x, int y) { if (this._inLine) { IActiveView focusMap = (IActiveView)_context.ActiveView; _lineFeedback.MoveTo(focusMap.ScreenDisplay.DisplayTransformation.ToMapPoint(x, y)); } }
protected override void OnMouseMove(MouseEventArgs arg) { base.OnMouseMove(arg); if (isDrawing && arg.Button == MouseButtons.Left && Editor.ActiveLayer != null) { IPoint moveCoor = Raster.ScreenCoor2MapCoor(arg.X, arg.Y); newLineFeedback.MoveTo(moveCoor); } }
//鼠标移动, 将工具也移动到点的位置 public override void OnMouseMove(int Button, int Shift, int X, int Y) { base.OnMouseMove(Button, Shift, X, Y); if (m_pNewLineFeedback != null) { IPoint pPoint = m_MapControl.ActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(X, Y); m_pNewLineFeedback.MoveTo(pPoint); } }
public override void OnMouseMove(int button, int shift, int x, int y, double mapX, double mapY) { if (m_pNewLineFeedback != null) { movePoint = this.m_pMapControl.ActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(x, y); movePoint.X = downPoint.X; m_pNewLineFeedback.MoveTo(movePoint); } }
public override void OnMouseMove(int Button, int Shift, int X, int Y) { // TODO: Add SelectPoint.OnMouseMove implementation IPoint pPt = pActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(X, Y); if (pLineFeedback != null) { pLineFeedback.MoveTo(pPt); toPoint = pPt; } }
public override void OnMouseMove(int Button, int Shift, int X, int Y) { IPoint pPt = m_ActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(X, Y); //MoveTo方法继承自IDisplayFeedback接口的定义 if (pLineFeedback != null) { pLineFeedback.MoveTo(pPt); } m_pPoint = m_ActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(X, Y); }
public override void OnMouseMove(int button, int shift, int x, int y, double mapX, double mapY) { { if (m_pNewLineFeedback != null) { m_pLastPoint = this.m_pMapControl.ActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(x, y); m_pNewLineFeedback.MoveTo(m_pLastPoint); m_dblDistance = CommonFunction.GetDistance_P12(m_pAnchorPoint, m_pLastPoint); } } }
public override void OnMouseMove(int Button, int Shift, int x, int y) { if (_lineFeedback == null) { return; } IActiveView activeView = _context.ActiveView; IPoint point = activeView.ScreenDisplay.DisplayTransformation.ToMapPoint(x, y); _lineFeedback?.MoveTo(point); }
/// <summary> /// Method to use when you need to move a feedback line to a point /// This forces a new point to be used, sometimes this method projects the point to a different spatial reference /// </summary> /// <param name="point"></param> internal void FeedbackMoveTo(IPoint point) { if (feedback == null || point == null) { return; } feedback.MoveTo(new Point() { X = point.X, Y = point.Y, SpatialReference = point.SpatialReference }); }
public override void OnMouseMove(int Button, int Shift, int X, int Y) { // TODO: Add ToolAddControlPoints.OnMouseMove implementation if (FirstPoint == false) { IMapControl2 pMapCtr = (((IToolbarControl)m_hookHelper.Hook).Buddy) as IMapControl2; if (pMapCtr != null) { IPoint mapPoint = pMapCtr.ToMapPoint(X, Y); m_NewLineFeedback.MoveTo(mapPoint); } } }
/// <summary> /// 移动鼠标位置,动态改变折线或多边形最后节点的位置, /// 重新计算各个测量值,建议在Map的MouseMove事件中调用, /// 并提取当前的测量结果进行显示 /// </summary> /// <param name="point">终点</param> public void MoveTo(IPoint point) { if (_eMeasureType == EMeasureType.Distance || _eMeasureType == EMeasureType.Angle) { _newLineFeedback.MoveTo(point); CalculateLength(point); CalculateDirection(point); CalculateAngle(point); } else if (_eMeasureType == EMeasureType.Area) { _newPolygonFeedback.MoveTo(point); CalculateArea(point); } }
public override void OnMouseMove(int button, int shift, int x, int y, double mapX, double mapY) { // TODO: 添加 CalculateZimuth.OnMouseMove 实现 { if (m_pNewLineFeedback != null) { movePoint = this.m_pMapControl.ActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(x, y); m_pNewLineFeedback.MoveTo(movePoint); } } base.OnMouseMove(button, shift, x, y, mapX, mapY); }
public override void OnMouseMove(int Button, int Shift, int X, int Y) { //鼠标在选择集的范围外为选择功能 IPoint pPnt = m_hookHelper.ActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(X, Y); if (ModPublic.MouseOnSelection(pPnt, m_hookHelper.ActiveView) == false && m_bMouseDown == false) {//若光标不在选择的对象上,为选择功能 ControlsEditSelFeature clsSelectFeature = new ControlsEditSelFeature(); clsSelectFeature.OnCreate(m_hookHelper.Hook); clsSelectFeature.OnClick(); m_MapControl.CurrentTool = clsSelectFeature as ITool; return; } //鼠标在选择要素节点上时为节点移动功能 if (m_MapControl.Map.SelectionCount == 1) { IEnumFeature pEnumFeature = m_MapControl.Map.FeatureSelection as IEnumFeature; pEnumFeature.Reset(); IFeature pFeature = pEnumFeature.Next(); if (ModPublic.MouseOnFeatureVertex(pPnt, pFeature, m_hookHelper.ActiveView) == true && MoData.v_bVertexSelectionTracker == true) { ControlsMoveVertex pControlsMoveVertex = new ControlsMoveVertex(); pControlsMoveVertex.OnCreate(m_hookHelper.Hook); pControlsMoveVertex.OnClick(); m_MapControl.CurrentTool = pControlsMoveVertex as ITool; return; } } //捕捉节点 if (MoData.v_bSnapStart) { ModPublic.SnapPoint(pPnt, m_hookHelper.ActiveView); } if (Button != 1) { return; } //进行移动 if (m_MapControl.Map.SelectionCount > 0 && m_pMoveGeometryFeedback != null && m_pNewLineFeedback != null) { m_pMoveGeometryFeedback.MoveTo(pPnt); m_pNewLineFeedback.MoveTo(pPnt); } }
protected override void OnMouseMove(ESRI.ArcGIS.Desktop.AddIns.Tool.MouseEventArgs arg) { base.OnMouseMove(arg); try { if (LineFeedBack != null) { IDisplay display = mDoc.ActiveView.ScreenDisplay; IPoint p = mDoc.ActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(arg.X, arg.Y); LineFeedBack.MoveTo(p); } CurrentPos = mDoc.ActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(arg.X, arg.Y); } catch { } }
public override void OnMouseMove(int Button, int Shift, int X, int Y) { IPoint pt = m_hookHelper.ActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(X, Y); pt = GIS.GraphicEdit.SnapSetting.getSnapPoint(pt); if (m_NewLineFeedback == null) { return; } m_NewLineFeedback.MoveTo(pt); if (m_ptColl.PointCount == 0) { return; } double d_Total = 0; double d_segment = 0; IPoint lastPt = m_ptColl.get_Point(m_ptColl.PointCount - 1); ILine line = new LineClass(); line.PutCoords(lastPt, pt); //节距离 d_segment = line.Length; _MsgInfo.Segment = d_segment; try { IPolyline polyline = m_ptColl as IPolyline; if (polyline.IsEmpty) { d_Total = d_segment; } else { d_Total = polyline.Length + d_segment; } } catch { } //赋值给总长度 _MsgInfo.Total = d_Total; _MsgInfo.LineResultChange(); }
public override void OnBeforeScreenDraw(int hdc) { // TODO: 添加 DrawLine.OnBeforeScreenDraw 实现 base.OnBeforeScreenDraw(hdc); if (m_pRecordPointArray.Count != 0) { IPoint pStartPoint = new PointClass(); IPoint pEndPoint = new PointClass(); pStartPoint = (IPoint)m_pRecordPointArray.get_Element(0); pEndPoint = (IPoint)m_pRecordPointArray.get_Element(m_pRecordPointArray.Count - 1); if (m_pLineFeed != null) { m_pLineFeed.MoveTo(pEndPoint); } } }
public override void OnBeforeScreenDraw(int hdc) { // TODO: 添加 DrawArc3P.OnBeforeScreenDraw 实现 base.OnBeforeScreenDraw(hdc); if (m_pFeedback != null && pLineArray.Count != 0) { if (pLineArray.Count >= 0) { m_pLineFeed.MoveTo((IPoint)pLineArray.get_Element(pLineArray.Count - 1)); } if (pLineArray.Count >= 2) { m_pLineFeed.Stop(); } } }
protected override void OnMouseMove(ESRI.ArcGIS.Desktop.AddIns.Tool.MouseEventArgs arg) { try { if (m_schematicFeature1 != null) { ESRI.ArcGIS.ArcMapUI.IMxApplication mxApp = (ESRI.ArcGIS.ArcMapUI.IMxApplication)m_app; if (mxApp == null) { return; } ESRI.ArcGIS.Display.IAppDisplay appDisplay = mxApp.Display; if (appDisplay == null) { return; } IScreenDisplay screenDisplay = appDisplay.FocusScreen; if (screenDisplay == null) { return; } //Move the Feedback to the current mouse location IPoint pnt = screenDisplay.DisplayTransformation.ToMapPoint(arg.X, arg.Y); if (pnt != null && m_linkFbk != null) { m_linkFbk.MoveTo(pnt); } } } catch (System.Exception e) { System.Windows.Forms.MessageBox.Show(e.Message); } return; }
public void OnMouseMove(int button, int shift, int x, int y) { IPoint pPt = m_activeView.ScreenDisplay.DisplayTransformation.ToMapPoint(x, y); if (m_EngineEditLayers == null) return; //获取编辑目标图层 IFeatureLayer pFeatLyr = m_EngineEditLayers.TargetLayer; if (pFeatLyr == null) return; IFeatureClass pFeatCls = pFeatLyr.FeatureClass; if (pFeatCls == null) return; switch (pFeatCls.ShapeType) { case esriGeometryType.esriGeometryPolyline: if (m_newLineFeedBack != null) m_newLineFeedBack.MoveTo(pPt); break; case esriGeometryType.esriGeometryPolygon: if (m_newPolyFeedBack != null) m_newPolyFeedBack.MoveTo(pPt); break; } }
public override void OnBeforeScreenDraw(int hdc) { // TODO: 添加 DrawPolyline.OnBeforeScreenDraw 实现 base.OnBeforeScreenDraw(hdc); if (m_pUndoArray.Count != 0) { IPoint pStartPoint = new PointClass(); IPoint pEndPoint = new PointClass(); pStartPoint = ((PointStruct)m_pUndoArray.get_Element(0)).Point; pEndPoint = ((PointStruct)m_pUndoArray.get_Element(m_pUndoArray.Count - 1)).Point; if (m_pLineFeed != null) { m_pLineFeed.MoveTo(pEndPoint); } if (m_pLastLineFeed != null) { m_pLastLineFeed.MoveTo(pStartPoint); } } }
public void frmMove(ref IPoint pPoint, ref INewLineFeedback m_FeedbackLine) { if (tbtnLine.Checked == true) { IPoint pPnt = pPoint; m_CurPoint = pPnt; if (m_FeedbackLine != null) { m_FeedbackLine.MoveTo(pPnt); double MoveLength = 0.0; IPoint m_LastPoint = pCollection.get_Point(pCollection.PointCount - 1); if (m_LastPoint != null) { SegLength = Math.Sqrt(Math.Pow((m_LastPoint.X - m_CurPoint.X), 2) + Math.Pow((m_LastPoint.Y - m_CurPoint.Y), 2)); MoveLength = TotalLength + SegLength; } SegLength = CntUnit.ConvertUnits(SegLength, inUnit.pUnit, outUnit.pUnit); MoveLength = CntUnit.ConvertUnits(MoveLength, inUnit.pUnit, outUnit.pUnit); //单位变换 m_SegLen.value = SegLength; m_SegLen.units = outUnit.pUnit; m_TotLen.value = MoveLength; m_TotLen.units = outUnit.pUnit; SegLength = Math.Round(SegLength, 6); MoveLength = Math.Round(MoveLength, 6); double tempSumLen = SumLengths + MoveLength; UnitSumLen = tempSumLen; txtMessage.Text = "测量线" + "\r\n线段的长度是:" + SegLength + outUnit.UnitName + "\r\n总长度是:" + MoveLength + outUnit.UnitName; if (tbtnSum.Checked == true) { txtMessage.Text += "\r\n" + "\r\n线段长度之和是:" + tempSumLen + outUnit.UnitName; } } } }
public override void OnMouseMove(int Button, int Shift, int X, int Y) { IFeatureLayer m_FeatureLayer = (IFeatureLayer)CreateShape.m_CurrentLayer;; if (m_FeatureLayer.FeatureClass == null) { return; } // 移动鼠标形成线、面的节点 IActiveView m_ActiveView = m_AxMapControl.ActiveView; IPoint pMovePoint = m_ActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(X, Y); if (m_pNewLineFeedback != null) { m_pNewLineFeedback.MoveTo(pMovePoint); } else if (m_pPlygonFeadback != null) { m_pPlygonFeadback.MoveTo(pMovePoint); } }
public override void OnBeforeScreenDraw(int hdc) { // TODO: 添加 DrawBeizerCurve.OnBeforeScreenDraw 实现 base.OnBeforeScreenDraw(hdc); if (m_pUndoArray.Count != 0) { IPoint pStartPoint = new PointClass(); IPoint pEndPoint = new PointClass(); pStartPoint = (IPoint)m_pUndoArray.get_Element(0); pEndPoint = (IPoint)m_pUndoArray.get_Element(m_pUndoArray.Count - 1); if (m_pBezierCurveFeed != null) { m_pBezierCurveFeed.MoveTo(pEndPoint); } if (m_pLastLineFeed != null) { m_pLastLineFeed.MoveTo(pStartPoint); } } }
public void OnMouseMove(int button, int shift, int x, int y) { IPoint point = activeView.ScreenDisplay.DisplayTransformation.ToMapPoint(x, y); if (engineEditLayers == null) { return; } //获取编辑目标图层 IFeatureLayer featureLayer = engineEditLayers.TargetLayer; if (featureLayer == null) { return; } IFeatureClass featureClass = featureLayer.FeatureClass; if (featureClass == null) { return; } switch (featureClass.ShapeType) { case esriGeometryType.esriGeometryPolyline: if (newLineFeedback != null) { newLineFeedback.MoveTo(point); } break; case esriGeometryType.esriGeometryPolygon: if (newLineFeedback != null) { newPolygonFeedback.MoveTo(point); } break; } }
public void frmMove(ref IPoint pPoint,ref INewLineFeedback m_FeedbackLine ) { if (tbtnLine.Checked == true) { IPoint pPnt = pPoint; m_CurPoint = pPnt; if (m_FeedbackLine != null) { m_FeedbackLine.MoveTo(pPnt); double MoveLength = 0.0; IPoint m_LastPoint = pCollection.get_Point(pCollection.PointCount - 1); if (m_LastPoint != null) { SegLength = Math.Sqrt(Math.Pow((m_LastPoint.X - m_CurPoint.X),2) + Math.Pow((m_LastPoint.Y - m_CurPoint.Y),2)); MoveLength = TotalLength + SegLength; } SegLength = CntUnit.ConvertUnits(SegLength, inUnit.pUnit, outUnit.pUnit); MoveLength = CntUnit.ConvertUnits(MoveLength, inUnit.pUnit, outUnit.pUnit); //单位变换 m_SegLen.value = SegLength; m_SegLen.units = outUnit.pUnit; m_TotLen.value = MoveLength; m_TotLen.units = outUnit.pUnit; SegLength = Math.Round(SegLength, 6); MoveLength = Math.Round(MoveLength, 6); double tempSumLen = SumLengths + MoveLength; UnitSumLen = tempSumLen; txtMessage.Text = "测量线"+"\r\n线段的长度是:" + SegLength +outUnit.UnitName + "\r\n总长度是:" + MoveLength+outUnit .UnitName; if(tbtnSum.Checked==true) txtMessage.Text += "\r\n" + "\r\n线段长度之和是:" + tempSumLen+ outUnit.UnitName; } } }