Ejemplo n.º 1
0
        public override void OnMouseDown(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_newBezierCurveFeedback == null)
            {
                m_newBezierCurveFeedback         = new NewBezierCurveFeedbackClass();
                m_newBezierCurveFeedback.Display = m_hookHelper.ActiveView.ScreenDisplay;
                m_newBezierCurveFeedback.Start(pt);
            }
            else
            {
                m_newBezierCurveFeedback.AddPoint(pt);
            }
        }
Ejemplo n.º 2
0
        //更新m_pBezierCurveFeed
        public void UpdataBezierCurveFeed(IMapControl2 MapControl, ref IArray pUndoArray)
        {
            if (m_pBezierCurveFeed != null)
            {
                m_pBezierCurveFeed.Stop();
            }

            m_pActiveView.PartialRefresh(esriViewDrawPhase.esriViewForeground, null, null);
            m_pActiveView.ScreenDisplay.UpdateWindow();

            m_pBezierCurveFeed.Start((IPoint)m_pUndoArray.get_Element(0));
            CommonFunction.DrawPointSMSSquareSymbol(MapControl, (IPoint)pUndoArray.get_Element(0));
            for (int i = 0; i < pUndoArray.Count; i++)
            {
                m_pBezierCurveFeed.AddPoint((IPoint)pUndoArray.get_Element(i));
                CommonFunction.DrawPointSMSSquareSymbol(MapControl, (IPoint)pUndoArray.get_Element(i));
            }
        }
Ejemplo n.º 3
0
 public override void OnMouseDown(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_newBezierCurveFeedback == null)
     {
         m_newBezierCurveFeedback = new NewBezierCurveFeedbackClass();
         m_newBezierCurveFeedback.Display = m_hookHelper.ActiveView.ScreenDisplay;
         m_newBezierCurveFeedback.Start(pt);
     }
     else
     {
         m_newBezierCurveFeedback.AddPoint(pt);
     }
 }
Ejemplo n.º 4
0
        private void DrawBezierCurveMouseDown(IPoint pPoint)
        {
            if (!m_bInUse)           //如果命令没有使用
            {
                m_bInUse = true;

                m_pUndoArray.Add(pPoint);

                CommonFunction.DrawPointSMSSquareSymbol(m_MapControl, pPoint);

                m_pFeedback        = new NewBezierCurveFeedbackClass();
                m_pBezierCurveFeed = (INewBezierCurveFeedback)m_pFeedback;
                m_pBezierCurveFeed.Start(pPoint);
                if (m_pFeedback != null)
                {
                    m_pFeedback.Display = m_pActiveView.ScreenDisplay;
                }

                if (((IFeatureLayer)m_CurrentLayer).FeatureClass.ShapeType == esriGeometryType.esriGeometryPolygon)
                {
                     
                    //若当前图层是面层,则显示回馈开始点到鼠标点的线段
                        m_pLastFeedback = new NewLineFeedbackClass();
                    m_pLastLineFeed = (INewLineFeedback)m_pLastFeedback;
                    m_pLastLineFeed.Start(pPoint);
                    if (m_pLastFeedback != null)
                    {
                        m_pLastFeedback.Display = m_pActiveView.ScreenDisplay;
                    }
                }
            }
            else            //若果命令正使用中
            {
                m_pBezierCurveFeed = (INewBezierCurveFeedback)m_pFeedback;
                m_pBezierCurveFeed.AddPoint(pPoint);

                IPoint tempPoint = new PointClass();
                tempPoint.X = pPoint.X;
                tempPoint.Y = pPoint.Y;
                m_pUndoArray.Add(tempPoint);
                UpdataBezierCurveFeed(m_MapControl, ref m_pUndoArray);               //刷新屏幕

                if ((m_bFixLength == true) && (m_bFixDirection == false))            //可以给定一个长度值
                {
                    m_bFixLength = false;
                }
                else if ((m_bFixLength == false) && (m_bFixDirection == true))                 //可以给定一个固定方向值
                {
                    m_bFixDirection = false;
                }
                else if ((m_bFixLength == true) && (m_bFixDirection == true))
                {
                    m_bFixLength    = false;
                    m_bFixDirection = false;
                }

                if (m_bFixLeftCorner)
                {
                    m_bFixLeftCorner = false;
                }
            }

            m_pLastPoint = pPoint;

            if (m_bkeyCodeS == true)             //直角结束
            {
                m_bkeyCodeS = false;
                if (((IFeatureLayer)m_CurrentLayer).FeatureClass.ShapeType == esriGeometryType.esriGeometryPolyline)
                {
                    m_pLastLineFeed.Stop();
                }
            }

            m_pSegment = null;            //清空捕捉到的片断
        }