示例#1
0
        public void EndFlight()
        {
            this.bool_0 = false;
            ISceneGraph sceneGraph = this._plugin.SceneGraph;
            IPoint      point      = new Point();

            System.Drawing.Rectangle rectangle = default(System.Drawing.Rectangle);
            if (ToolSceneFly.GetClientRect(this._plugin.ActiveViewer.hWnd, ref rectangle) != 0)
            {
                object obj;
                object obj2;
                sceneGraph.Locate(sceneGraph.ActiveViewer, rectangle.Right / 2, rectangle.Bottom / 2, esriScenePickMode.esriScenePickAll, true, out point, out obj, out obj2);
            }
            ICamera camera = this._plugin.Camera;

            if (point != null)
            {
                camera.Target   = point;
                camera.Observer = this.ipoint_0;
            }
            camera.RollAngle = 0.0;
            camera.PropertiesChanged();
            ToolSceneFly.SetCursor(this.cursor_1.Handle.ToInt32());
            this.int_0 = 0;
        }
示例#2
0
        public void Flight()
        {
            IMessageDispatcher messageDispatcher = new MessageDispatcher();

            messageDispatcher.CancelOnClick    = false;
            messageDispatcher.CancelOnEscPress = true;
            ISceneGraph  sceneGraph   = this._plugin.SceneGraph;
            ISceneViewer activeViewer = this._plugin.ActiveViewer;
            ICamera      camera       = this._plugin.Camera;

            this.bool_1 = false;
            do
            {
                double num;
                double num2;
                sceneGraph.GetDrawingTimeInfo(out num, out num2);
                if (num < 0.01)
                {
                    num = 0.01;
                }
                if (num > 1.0)
                {
                    num = 1.0;
                }
                System.Drawing.Rectangle rectangle = default(System.Drawing.Rectangle);
                if (ToolSceneFly.GetClientRect(this._plugin.ActiveViewer.hWnd, ref rectangle) == 0)
                {
                    return;
                }
                double num3 = 2.0 * ((double)this.long_0 / (double)rectangle.Right) - 1.0;
                double num4 = 2.0 * ((double)this.long_1 / (double)rectangle.Bottom) - 1.0;
                this.double_2 -= num * num4 * Math.Abs(num4);
                this.double_3 -= num * num3 * Math.Abs(num3);
                if (this.double_2 > 1.4137164000000002)
                {
                    this.double_2 = 1.4137164000000002;
                }
                if (this.double_2 < -1.4137164000000002)
                {
                    this.double_2 = -1.4137164000000002;
                }
                if (this.double_3 < 0.0)
                {
                    this.double_3 += 6.283184;
                }
                if (this.double_3 > 6.283184)
                {
                    this.double_3 -= 6.283184;
                }
                double num5 = Math.Cos(this.double_2) * Math.Cos(this.double_3);
                double num6 = Math.Cos(this.double_2) * Math.Sin(this.double_3);
                double num7 = Math.Sin(this.double_2);
                this.ipoint_1.X  = this.ipoint_0.X + this.double_1 * num5;
                this.ipoint_1.Y  = this.ipoint_0.Y + this.double_1 * num6;
                this.ipoint_1.Z  = this.ipoint_0.Z + this.double_1 * num7;
                this.ipoint_0.X  = this.ipoint_0.X + num * (double)(2 ^ this.int_0) * this.double_0 * num5;
                this.ipoint_0.Y  = this.ipoint_0.Y + num * (double)(2 ^ this.int_0) * this.double_0 * num6;
                this.ipoint_1.X  = this.ipoint_1.X + num * (double)(2 ^ this.int_0) * this.double_0 * num5;
                this.ipoint_1.Y  = this.ipoint_1.Y + num * (double)(2 ^ this.int_0) * this.double_0 * num6;
                this.ipoint_0.Z  = this.ipoint_0.Z + num * (double)(2 ^ this.int_0) * this.double_0 * num7;
                this.ipoint_1.Z  = this.ipoint_1.Z + num * (double)(2 ^ this.int_0) * this.double_0 * num7;
                camera.Observer  = this.ipoint_0;
                camera.Target    = this.ipoint_1;
                camera.RollAngle = 10.0 * num3 * Math.Abs(num3);
                activeViewer.Redraw(true);
                object obj;
                messageDispatcher.Dispatch(this._plugin.ActiveViewer.hWnd, false, out obj);
                if (this.bool_1)
                {
                    this.EndFlight();
                }
            }while (this.bool_0 && !this.bool_1);
            this.bool_1 = false;
        }