Esempio n. 1
0
        void axRenderControl1_RcMouseClickSelect3(IPickResult PickResult, IPoint IntersectPoint, gviModKeyMask Mask, gviMouseSelectMode EventSender)
        {
            if (IntersectPoint == null)
            {
                return;
            }

            if (EventSender.Equals(gviMouseSelectMode.gviMouseSelectClick))
            {
                this.axRenderControl1.InteractMode        = gviInteractMode.gviInteractNormal;
                this.axRenderControl1.RcMouseClickSelect -= new Gvitech.CityMaker.Controls._IRenderControlEvents_RcMouseClickSelectEventHandler(axRenderControl1_RcMouseClickSelect3);


                IViewshedPickResult pr = PickResult as IViewshedPickResult;
                if (pr == null)
                {
                    return;
                }

                IViewshed v = pr.Viewshed;
                if (v == null)
                {
                    return;
                }
                v.Highlight(System.Drawing.Color.Red);
            }
        }
Esempio n. 2
0
        void axRenderControl1_RcMouseClickSelect2(IPickResult PickResult, IPoint IntersectPoint, gviModKeyMask Mask, gviMouseSelectMode EventSender)
        {
            if (IntersectPoint == null)
            {
                return;
            }

            if (EventSender.Equals(gviMouseSelectMode.gviMouseSelectClick))
            {
                this.axRenderControl1.InteractMode        = gviInteractMode.gviInteractNormal;
                this.axRenderControl1.RcMouseClickSelect -= new _IRenderControlEvents_RcMouseClickSelectEventHandler(axRenderControl1_RcMouseClickSelect2);


                ISimplePointSymbol ps = new SimplePointSymbol();
                ps.Size      = 20;
                ps.FillColor = System.Drawing.Color.Red;
                this.axRenderControl1.ObjectManager.CreateRenderPoint(IntersectPoint, ps, rootId);

                for (int i = 0; i < videoList.Count; i++)
                {
                    IViewshed v = videoList[i];
                    v.Unhighlight();
                    double wx, wy;
                    bool   isIn = v.WorldToScreen(IntersectPoint, 1, out wx, out wy);
                    if (isIn)
                    {
                        v.Highlight(System.Drawing.Color.Red);

                        IPoint poiInWorld = v.ScreenToWorld(wx, wy);
                        if (poiInWorld != null)
                        {
                            this.axRenderControl1.InteractMode = gviInteractMode.gviInteractFocus;
                            bool bFocus = this.axRenderControl1.Camera.SetFocus(poiInWorld);
                            if (bFocus)
                            {
                                MessageBox.Show("set focus success!");
                            }
                        }
                    }
                }
            }
        }