Пример #1
0
        public override void OnMouseUp(int Button, int Shift, int X, int Y)
        {
            if (m_pNewEnvelope == null)
            {
                return;
            }

            IEnvelope pEnvelope     = m_pNewEnvelope.Stop();
            int       iPiexl        = 3;
            double    iMapTolerance = ConvertPixelsToMapUnits(m_MapControl.ActiveView, iPiexl);
            IGeometry pGeometry     = null;

            if (pEnvelope == null || pEnvelope.IsEmpty)
            {
                ITopologicalOperator pTopo = (ITopologicalOperator)m_pPoint;
                if (pTopo != null)
                {
                    pGeometry = pTopo.Buffer(iMapTolerance);
                }
            }
            else
            {
                pEnvelope.SpatialReference = m_MapControl.ActiveView.FocusMap.SpatialReference;
                pGeometry = pEnvelope;
            }
            m_pNewEnvelope = null;

            if (m_frmQuery == null)
            {
                m_frmQuery             = new frmQuery(m_MapControl, m_enumQueryMode);
                m_frmQuery.Owner       = m_mainFrm;
                m_frmQuery.FormClosed += new FormClosedEventHandler(frmQuery_FormClosed);
            }

            //m_frmQuery.Show();
            //m_frmQuery.FillData(m_MapControl.ActiveView.FocusMap, pGeometry);
            _QuerBar.m_pMapControl = m_MapControl;
            _QuerBar.EmergeQueryData(m_MapControl.ActiveView.FocusMap, pGeometry, esriSpatialRelEnum.esriSpatialRelIntersects);
            try
            {
                DevComponents.DotNetBar.Bar pBar = _QuerBar.Parent.Parent as DevComponents.DotNetBar.Bar;
                if (pBar != null)
                {
                    pBar.AutoHide = false;
                    //pBar.SelectedDockTab = 1;
                    int tmpindex = pBar.Items.IndexOf("dockItemDataCheck");
                    pBar.SelectedDockTab = tmpindex;
                }
            }
            catch
            { }
        }
        //双击则创建该线,并弹出缓冲窗体
        public override void OnDblClick()
        {
            //获取折线 并获取当前视图的屏幕显示
            if (m_pNewLineFeedback == null)
            {
                return;
            }

            IPolyline pPolyline = m_pNewLineFeedback.Stop();

            m_pNewLineFeedback = null;
            pPolyline.Project(m_MapControl.Map.SpatialReference);

            if (m_frmQuery == null)
            {
                m_frmQuery             = new frmQuery(m_MapControl, m_enumQueryMode);
                m_frmQuery.Owner       = m_mainFrm;
                m_frmQuery.FormClosed += new FormClosedEventHandler(frmQuery_FormClosed);
            }

            frmBufferSet pFrmBufSet = new frmBufferSet(pPolyline as IGeometry, m_MapControl.Map, m_frmQuery);
            IGeometry    pGeometry  = pFrmBufSet.GetBufferGeometry();

            if (pGeometry == null || pFrmBufSet.Res == false)
            {
                return;
            }

            // m_frmQuery.Show();
            // m_frmQuery.FillData(m_MapControl.ActiveView.FocusMap, pGeometry);
            _QuerBar.m_pMapControl = m_MapControl;
            _QuerBar.EmergeQueryData(m_MapControl.ActiveView.FocusMap, pGeometry, pFrmBufSet.pesriSpatialRelEnum);
            try
            {
                DevComponents.DotNetBar.Bar pBar = _QuerBar.Parent.Parent as DevComponents.DotNetBar.Bar;
                if (pBar != null)
                {
                    pBar.AutoHide = false;
                    //pBar.SelectedDockTab = 1;
                    int tmpindex = pBar.Items.IndexOf("dockItemDataCheck");
                    pBar.SelectedDockTab = tmpindex;
                }
            }
            catch
            { }
        }
Пример #3
0
        public override void OnMouseDown(int Button, int Shift, int X, int Y)
        {
            if (Button != 1)
            {
                return;
            }

            if (m_frmQuery == null)
            {
                m_frmQuery             = new frmQuery(m_MapControl, m_enumQueryMode);
                m_frmQuery.Owner       = m_mainFrm;
                m_frmQuery.FormClosed += new FormClosedEventHandler(frmQuery_FormClosed);
            }

            ESRI.ArcGIS.Geometry.IPoint pPoint = m_MapControl.ActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(X, Y);
            frmBufferSet pFrmBufSet            = new frmBufferSet(pPoint as IGeometry, m_MapControl.Map, m_frmQuery);
            IGeometry    pGeometry             = pFrmBufSet.GetBufferGeometry();

            if (pGeometry == null || pFrmBufSet.Res == false)
            {
                return;
            }

            //m_frmQuery.Show();
            //m_frmQuery.FillData(m_MapControl.ActiveView.FocusMap, pGeometry);
            _QuerBar.m_pMapControl = m_MapControl;
            _QuerBar.EmergeQueryData(m_MapControl.ActiveView.FocusMap, pGeometry, pFrmBufSet.pesriSpatialRelEnum);
            try
            {
                DevComponents.DotNetBar.Bar pBar = _QuerBar.Parent.Parent as DevComponents.DotNetBar.Bar;
                if (pBar != null)
                {
                    pBar.AutoHide = false;
                    //pBar.SelectedDockTab = 1;
                    int tmpindex = pBar.Items.IndexOf("dockItemDataCheck");
                    pBar.SelectedDockTab = tmpindex;
                }
            }
            catch
            { }
        }
Пример #4
0
        public override void OnMouseUp(int Button, int Shift, int X, int Y)
        {
            if (m_pNewEnvelope == null)
            {
                return;
            }

            IEnvelope pEnvelope     = m_pNewEnvelope.Stop();
            int       iPiexl        = 3;
            double    iMapTolerance = ConvertPixelsToMapUnits(m_MapControl.ActiveView, iPiexl);

            IGeometry pGeometry = null;

            if (pEnvelope == null || pEnvelope.IsEmpty)
            {
                ITopologicalOperator pTopo = (ITopologicalOperator)m_pPoint;
                if (pTopo != null)
                {
                    pGeometry = pTopo.Buffer(iMapTolerance);
                }
            }
            else
            {
                pEnvelope.SpatialReference = m_MapControl.ActiveView.FocusMap.SpatialReference;
                pGeometry = pEnvelope;
            }
            m_pNewEnvelope = null;

            if (m_frmQuery == null)
            {
                m_frmQuery             = new frmQuery(m_MapControl, m_enumQueryMode);
                m_frmQuery.Owner       = m_mainFrm;
                m_frmQuery.FormClosed += new FormClosedEventHandler(frmQuery_FormClosed);
            }

            m_frmQuery.Show();
            m_frmQuery.FillData(m_MapControl.ActiveView.FocusMap, pGeometry);
            // _QuerBar.m_pMapControl = m_MapControl;
            // _QuerBar.EmergeQueryData(m_MapControl.ActiveView.FocusMap, pGeometry,esriSpatialRelEnum.esriSpatialRelIntersects);
        }
 private void frmQuery_FormClosed(object sender, FormClosedEventArgs e)
 {
     m_enumQueryMode = m_frmQuery.QueryMode;
     m_frmQuery      = null;
 }