Esempio n. 1
0
        public override void OnKeyDown(int keyCode, int shift)
        {
            // TODO:  添加 DrawArcCenRadFATA.OnKeyDown 实现
            base.OnKeyDown(keyCode, shift);

            if (keyCode == 13 || keyCode == 32)            //按ENTER 键、SPACEBAR 键
            {
                EndDrawArcCenRadFATA(m_pAnchorPoint, shift);
            }

            if (keyCode == 27)             //ESC 键,取消所有操作
            {
                Reset();

                this.Stop();
                WSGRI.DigitalFactory.Commands.ICommand command = DFApplication.Application.GetCommand("WSGRI.DigitalFactory.DF2DControl.cmdPan");
                if (command != null)
                {
                    command.Execute();
                }

                return;
            }

            if (keyCode == 80)            //按P键平行尺
            {
                m_pSegment  = null;
                m_bKeyCodeP = true;
                return;
            }
        }
Esempio n. 2
0
        //键盘事件(定义的快捷键)
        public override void OnKeyDown(int keyCode, int shift)
        {
            // TODO:  添加 DrawLine.OnKeyDown 实现
            base.OnKeyDown(keyCode, shift);

            if ((keyCode == 69 || keyCode == 13 || keyCode == 32) && m_bInUse && m_pRecordPointArray.Count >= 2)//按E键、ENTER 键、SPACEBAR 键结束绘制
            {
                EndCalculateDistance();

                return;
            }

            if (keyCode == 27)//ESC 键,取消所有操作
            {
                Reset();

                this.Stop();
                WSGRI.DigitalFactory.Commands.ICommand command = DFApplication.Application.GetCommand("WSGRI.DigitalFactory.DF2DControl.cmdPan");
                if (command != null)
                {
                    command.Execute();
                }


                return;
            }
        }
Esempio n. 3
0
        public override void OnKeyDown(int keyCode, int shift)
        {
            // TODO:  添加 CalculateZimuth.OnKeyDown 实现
            base.OnKeyDown(keyCode, shift);


            if ((keyCode == 13 || keyCode == 32) && m_bInUse)            //按ENTER 键、SPACEBAR 键
            {
                CalculateZimuthMouseDown(m_pAnchorPoint);

                return;
            }

            if (keyCode == 27)             //ESC 键,取消所有操作
            {
                Reset();

                this.Stop();

                WSGRI.DigitalFactory.Commands.ICommand command = DFApplication.Application.GetCommand("WSGRI.DigitalFactory.DF2DControl.cmdPan");
                if (command != null)
                {
                    command.Execute();
                }


                return;
            }
        }
Esempio n. 4
0
        public override void OnKeyDown(int keyCode, int shift)
        {
            base.OnKeyDown(keyCode, shift);

            if (keyCode == 27)             //ESC 键,取消所有操作
            {
                Reset();

                this.Stop();
                WSGRI.DigitalFactory.Commands.ICommand command = DFApplication.Application.GetCommand("WSGRI.DigitalFactory.DF2DControl.cmdPan");
                if (command != null)
                {
                    command.Execute();
                }

                return;
            }

            if (keyCode == 46)               //DEL键,删除选中的要素
            {
                CommonFunction.DelFeaturesFromArray(m_MapControl, ref m_OriginFeatureArray);

                Reset();

                return;
            }

            if (!m_bBeginDrawLineFeed)
            {
                if (keyCode == 13 || keyCode == 32)                //按ENTER、SPACEBAR键开始绘制切割线
                {
                    m_bBeginDrawLineFeed = true;
                }
            }
            else            //执行切割线\面操作
            {
                DoSplit();

                return;
            }
        }
Esempio n. 5
0
        public override void OnKeyDown(int keyCode, int shift)
        {
            base.OnKeyDown(keyCode, shift);

            if (keyCode == 27)//ESC 键,取消所有操作
            {
                Reset();

                this.Stop();
                WSGRI.DigitalFactory.Commands.ICommand command = DFApplication.Application.GetCommand("WSGRI.DigitalFactory.DF2DControl.cmdPan");
                if (command != null)
                {
                    command.Execute();
                }

                return;
            }

            if (keyCode == 13 || keyCode == 32) //按ENTER 键、SPACEBAR 键,执行转化工作
            {
                DoCalculate();                  //计算操作
            }
        }
Esempio n. 6
0
        public override void OnKeyDown(int keyCode, int shift)
        {
            // TODO:  添加 DrawCircle3P.OnKeyDown 实现
            base.OnKeyDown(keyCode, shift);

            if (keyCode == 65)            //按A键,输入绝对坐标
            {
                frmAbsXYZ.m_pPoint = m_pAnchorPoint;
                frmAbsXYZ formXYZ = new frmAbsXYZ();
                formXYZ.ShowDialog();

                if (m_bInputWindowCancel == false)               //若用户没用取消输入
                {
                    DrawCircle3PMouseDown(m_pAnchorPoint, 0);
                }

                return;
            }

            if (keyCode == 82 && (m_bFirst || m_bSecond))          //按R键,输入相对坐标
            {
                IPoint tempPoint = new PointClass();
                tempPoint.X         = m_pLastPoint.X;
                tempPoint.Y         = m_pLastPoint.Y;
                frmRelaXYZ.m_pPoint = tempPoint;
                frmRelaXYZ formRelaXYZ = new frmRelaXYZ();
                formRelaXYZ.ShowDialog();

                if (m_bInputWindowCancel == false)               //若用户没用取消输入
                {
                    DrawCircle3PMouseDown(m_pAnchorPoint, 0);
                }

                return;
            }

            if ((keyCode == 13 || keyCode == 32) && m_bSecond)             //按ENTER 键、SPACEBAR 键
            {
                DrawCircle3PMouseDown(m_pAnchorPoint, shift);

                return;
            }

            if (keyCode == 27)             //ESC 键,取消所有操作
            {
                Reset();

                this.Stop();

                WSGRI.DigitalFactory.Commands.ICommand command = DFApplication.Application.GetCommand("WSGRI.DigitalFactory.DF2DControl.cmdPan");
                if (command != null)
                {
                    command.Execute();
                }

                return;
            }

            if (keyCode == 80 && m_bFirst)            //按P键平行尺
            {
                m_pSegment  = null;
                m_bKeyCodeP = true;

                return;
            }
        }
Esempio n. 7
0
        public override void OnKeyDown(int keyCode, int shift)
        {
            // TODO:  添加 DrawBeizerCurve.OnKeyDown 实现
            base.OnKeyDown(keyCode, shift);


            if (keyCode == 85 && m_bInUse)            //按U键,回退
            {
                Undo();

                return;
            }

            if (keyCode == 78 && m_pUndoArray.Count >= 2)           //按N键输入折角方向
            {
                frmLeftCorner fromFixLeftCorner = new frmLeftCorner();
                fromFixLeftCorner.ShowDialog();

                return;
            }

            if (keyCode == 79 && m_bInUse)            //按(O)orientation键输入固定方向
            {
                frmFixAzim fromFixAzim = new frmFixAzim();
                fromFixAzim.ShowDialog();

                return;
            }

            if (keyCode == 68 && m_bInUse)            //按D键输入固定长度
            {
                frmFixLength fromFixLength = new frmFixLength();
                fromFixLength.ShowDialog();

                return;
            }

            if (keyCode == 70 && m_bInUse)            //按F键输入长度+方位角
            {
                frmLengthAzim.m_pPoint = m_pLastPoint;
                frmLengthAzim fromLengthDirect = new frmLengthAzim();
                fromLengthDirect.ShowDialog();
                if (m_bInputWindowCancel == false)               //若用户没用取消输入
                {
                    DrawBezierCurveMouseDown(m_pAnchorPoint);
                }

                return;
            }

            if (keyCode == 65)             //按A键输入绝对坐标
            {
                frmAbsXYZ.m_pPoint = m_pAnchorPoint;
                frmAbsXYZ formXYZ = new frmAbsXYZ();
                formXYZ.ShowDialog();
                if (m_bInputWindowCancel == false)               //若用户没用取消输入
                {
                    DrawBezierCurveMouseDown(m_pAnchorPoint);
                }

                return;
            }

            if (keyCode == 82 && m_bInUse)            //按R键输入相对坐标
            {
                frmRelaXYZ.m_pPoint = m_pLastPoint;
                frmRelaXYZ formRelaXYZ = new frmRelaXYZ();
                formRelaXYZ.ShowDialog();
                if (m_bInputWindowCancel == false)               //若用户没用取消输入
                {
                    DrawBezierCurveMouseDown(m_pAnchorPoint);
                }

                return;
            }


            if ((keyCode == 69 || keyCode == 13 || keyCode == 32) && m_bInUse && m_pUndoArray.Count >= 2)          //按E键、ENTER 键、SPACEBAR 键结束绘制
            {
                EndDrawBezierCurve();

                return;
            }

            if (keyCode == 83 && m_pUndoArray.Count >= 2)          //按S键生成直角
            {
                m_bkeyCodeS = true;

                if (((IFeatureLayer)m_CurrentLayer).FeatureClass.ShapeType == esriGeometryType.esriGeometryPolyline)
                {
                    m_pLastFeedback = new NewLineFeedbackClass();
                    m_pLastLineFeed = (INewLineFeedback)m_pLastFeedback;
                    m_pLastLineFeed.Start((IPoint)m_pUndoArray.get_Element(0));
                }

                return;
            }

            if (keyCode == 80 && m_bInUse)            //按P键平行尺
            {
                m_pSegment  = null;
                m_bKeyCodeP = true;

                return;
            }

            if (keyCode == 67 && m_pUndoArray.Count >= 3)          //按C键封闭结束绘制
            {
                if (m_bInUse)
                {
                    m_pUndoArray.Add((IPoint)m_pUndoArray.get_Element(0));

                    EndDrawBezierCurve();
                }

                return;
            }

            if (keyCode == 27)             //ESC 键,取消所有操作
            {
                Reset();

                this.Stop();
                WSGRI.DigitalFactory.Commands.ICommand command = DFApplication.Application.GetCommand("WSGRI.DigitalFactory.DF2DControl.cmdPan");
                if (command != null)
                {
                    command.Execute();
                }

                return;
            }
        }
Esempio n. 8
0
        public override void OnKeyDown(int keyCode, int shift)
        {
            // TODO:  添加 DrawRectRelative2P.OnKeyDown 实现
            base.OnKeyDown(keyCode, shift);

            if (keyCode == 85 && m_mouseDownCount == 1)          //按U键,回退
            {
                Undo();

                return;
            }

            if (keyCode == 70 && m_mouseDownCount == 1)          //按F键,输入长度+方位角
            {
                frmLengthAzim.m_pPoint = m_pLastPoint;
                frmLengthAzim fromLengthDirect = new frmLengthAzim();
                fromLengthDirect.ShowDialog();
                if (m_bInputWindowCancel == false)               //若用户没用取消输入
                {
                    DrawRectRelative2PMouseDown(m_pAnchorPoint);
                }

                return;
            }

            if (keyCode == 68 && m_mouseDownCount == 1)          //按D键,输入固定长度
            {
                frmFixLength fromFixLength = new frmFixLength();
                fromFixLength.ShowDialog();

                return;
            }

            if (keyCode == 79 && m_mouseDownCount == 1)          //按(O)orientation键,输入方向
            {
                frmFixAzim fromFixAzim = new frmFixAzim();
                fromFixAzim.ShowDialog();

                return;
            }

            if (keyCode == 66 && m_mouseDownCount == 2)          //按B键,输入边长
            {
                frmFixSideLength fromFixSideLength = new frmFixSideLength();
                fromFixSideLength.ShowDialog();

                return;
            }

            if (keyCode == 65 && m_mouseDownCount == 1)          //按A键,输入绝对坐标
            {
                frmAbsXYZ.m_pPoint = m_pAnchorPoint;
                frmAbsXYZ formXYZ = new frmAbsXYZ();
                formXYZ.ShowDialog();
                if (m_bInputWindowCancel == false)               //若用户没用取消输入
                {
                    DrawRectRelative2PMouseDown(m_pAnchorPoint);
                }

                return;
            }

            if (keyCode == 82 && m_mouseDownCount == 1)          //按R键,输入相对坐标
            {
                frmRelaXYZ.m_pPoint = m_pLastPoint;
                frmRelaXYZ formRelaXYZ = new frmRelaXYZ();
                formRelaXYZ.ShowDialog();
                if (m_bInputWindowCancel == false)               //若用户没用取消输入
                {
                    DrawRectRelative2PMouseDown(m_pAnchorPoint);
                }

                return;
            }

            if (keyCode == 80 && m_mouseDownCount == 1)          //按P键,平行尺
            {
                m_pSegment  = null;
                m_bKeyCodeP = true;

                return;
            }

            if ((keyCode == 69 || keyCode == 13 || keyCode == 32) && m_mouseDownCount == 2)           //按E键、ENTER 键、SPACEBAR 键结束绘制
            {
                EndDrawRectRelative2P();

                return;
            }

            if (keyCode == 27)             //ESC 键,取消所有操作
            {
                Reset();

                this.Stop();
                WSGRI.DigitalFactory.Commands.ICommand command = DFApplication.Application.GetCommand("WSGRI.DigitalFactory.DF2DControl.cmdPan");
                if (command != null)
                {
                    command.Execute();
                }

                return;
            }
        }
Esempio n. 9
0
        public override void OnKeyDown(int keyCode, int shift)
        {
            // TODO:  添加 DrawTraceLine.OnKeyDown 实现
            base.OnKeyDown(keyCode, shift);

            //if (CurrentTool.m_CurrentToolName  != CurrentTool.CurrentToolName.drawTraceLine) return;

            if (keyCode == 27)             //ESC 键,取消所有操作
            {
                Reset();

                this.Stop();
                WSGRI.DigitalFactory.Commands.ICommand command = DFApplication.Application.GetCommand("WSGRI.DigitalFactory.DF2DControl.cmdPan");
                if (command != null)
                {
                    command.Execute();
                }

                return;
            }

            if (keyCode == 68)            //按D键输入固定长度
            {
                frmFixLength formFixDist = new frmFixLength();
                formFixDist.ShowDialog();
                return;
            }

            if ((keyCode == 13 || keyCode == 32) && m_OriginFeatureArray.Count > 0)            //按ENTER 键、SPACEBAR 键,停止选择
            {
                if (m_OriginFeatureArray.Count == 0)
                {
                    return;
                }

                if (button1 == 2)                //结束跟踪,复位
                {
                    object a = esriConstructOffsetEnum.esriConstructOffsetSimple;
                    object b = System.Reflection.Missing.Value;
                    m_pTraceLine = m_pCursor.CurrentTrace;
                    m_pOffsetTraceLine.ConstructOffset(m_pTraceLine, m_dOffsetDistance, ref a, ref b);

                    IGeometry pGeometry = (IGeometry)m_pOffsetTraceLine;
                    if (((IFeatureLayer)m_App.CurrentEditLayer).FeatureClass.ShapeType == esriGeometryType.esriGeometryPolyline)
                    {
                        pGeometry = (IGeometry)CommonFunction.GetPolygonBoundary((IPolygon)pGeometry);
                    }
                    m_pEnvelope = pGeometry.Envelope;
                    if (m_pEnvelope != null && !m_pEnvelope.IsEmpty)
                    {
                        m_pEnvelope.Expand(1, 1, false);
                    }
                    ;
                    CommonFunction.CreateFeature(m_App.Workbench, pGeometry, m_FocusMap, m_CurrentLayer);
                    Reset();                    //复位
                    return;
                }

                CreateGraph();
                bBegineMove = true;
                return;
            }

            if (keyCode == 46)              //DEL键,删除选中的要素
            {
                CommonFunction.DelFeaturesFromArray(m_MapControl, ref m_OriginFeatureArray);
                Reset();
                return;
            }
        }