Example #1
0
        void m_sceneControl_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            // 鼠标左键
            if (e.Button == System.Windows.Forms.MouseButtons.Left &&
                !Double.IsNaN(scontrol.Scene.PixelToGlobe(e.Location).X))
            {
                //RouteStop stop = new RouteStop();
                //TreeNode treeNode = new TreeNode();
                //m_treeView.Nodes[0].Nodes.Add(treeNode);
                //if (treeNode.Index > 0)
                //{
                //    treeNode.Text = GetStopName(treeNode.PrevNode.Text);
                //    //stop.Name = GetStopName(treeNode.PrevNode.Text);
                //}
                //else
                //{
                //    treeNode.Text = "Stop1";
                //    //stop.Name = "Stop1";

                //}
                //m_treeView.Nodes[0].ExpandAll();

                Point3D point3D = scontrol.Scene.PixelToGlobe(e.Location);
                point3D.Z = scontrol.Scene.GetAltitude(point3D.X, point3D.Y) + 30;
                m_point3Ds.Add(point3D);

                //stop.Camera = new Camera(point3D.X,point3D.Y,point3D.Z);



                GeoPoint3D geoPoint3D = new GeoPoint3D(point3D);
                geoPoint3D.Style3D = GetPointGeoStyle3D(geoPoint3D.Z);
                geoPoint3D.Z       = 0;

                //m_routeStops.Add(stop);

                scontrol.Scene.TrackingLayer.Add(geoPoint3D, m_pointName);
            }
            //鼠标右键,结束绘制,将实时生成的路线加到FlyManager中
            else if (e.Button == System.Windows.Forms.MouseButtons.Right)
            {
                if (m_point3Ds.Count > 1)
                {
                    SetGeoLine3DToTrackingLayer(m_point3Ds.ToPoint2Ds(), 20);

                    m_flyManager.Routes.Add(GetRoute());
                }
                else
                {
                    ResumeDefault();
                }
                RegisterEvents(false);
            }
        }