Exemplo n.º 1
0
        //public static void GetTerrainProfile() {
        //    sgworld.Command.Execute(1043, 0);
        //}

        public static void Snapshot(int width, int height)
        {
            SaveFileDialog saveFileDialog = new SaveFileDialog();

            saveFileDialog.RestoreDirectory = true;
            saveFileDialog.FileName         = "系统截图";
            saveFileDialog.DefaultExt       = "jpg";
            saveFileDialog.Filter           = "JPEG文件|*.jpg";

            if (saveFileDialog.ShowDialog() == DialogResult.OK)
            {
                string filePath         = saveFileDialog.FileName;
                string snapshotFilePath = SGTools.GetSnapshot(width, height);
                System.IO.File.Copy(snapshotFilePath, filePath, true);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// BarButton Click事件
        /// </summary>
        /// <param name="tag"></param>
        private void ButtonClick(string tag)
        {
            switch (tag)
            {
            case TagResources.ZoomIn:
                SGTools.ZoomIn();
                break;

            case TagResources.ZoomOut:
                SGTools.ZoomOut();
                break;

            case TagResources.FaceNorth:
                SGTools.FaceNorth();
                break;

            case TagResources.Rotate:
                SGTools.Rotate();
                break;

            case TagResources.DragMode:
                SGTools.SetDragMode();
                break;

            case TagResources.SlideMode:
                SGTools.SetSlideMode();
                break;

            case TagResources.TurnAndTiltMode:
                SGTools.SetTurnAndTiltMode();
                break;

            case TagResources.Horizontal:
                SGTools.MeasureHorizontal();
                break;

            case TagResources.Aerial:
                SGTools.MeasureAerial();
                break;

            case TagResources.Vertical:
                SGTools.MeasureVertical();
                break;

            case TagResources.TerrainArea:
                SGTools.MeasureArea();
                break;

            case TagResources.DesignRoute:
                if (fpDesignRoute.Visible == true)
                {
                    fpDesignRoute.HidePopup();
                }
                else
                {
                    fpDesignRoute.Options.AnchorType    = DevExpress.Utils.Win.PopupToolWindowAnchor.Manual;
                    fpDesignRoute.Options.AnimationType = DevExpress.Utils.Win.PopupToolWindowAnimation.Fade;
                    int XCoord = dockPanel3.Width / 2 - fpDesignRoute.Width / 2;
                    int YCoord = dockPanel3.Height / 2 - fpDesignRoute.Height / 2;
                    fpDesignRoute.Options.Location = new Point(XCoord, YCoord);
                    fpDesignRoute.ShowPopup();
                }
                break;

            case TagResources.RouteQuery:
                if (fpRouteHistory.Visible == true)
                {
                    fpRouteHistory.HidePopup();
                }
                else
                {
                    routeGridControl.DataSource          = Utils.SQLiteManager.GetNWindData("T_Design");
                    fpRouteHistory.Options.AnchorType    = DevExpress.Utils.Win.PopupToolWindowAnchor.Manual;
                    fpRouteHistory.Options.AnimationType = DevExpress.Utils.Win.PopupToolWindowAnimation.Fade;
                    fpRouteHistory.Options.Location      = new Point(0, 0);
                    fpRouteHistory.ShowPopup();
                }
                break;

            case TagResources.Analysis:
                if (pps.Count > 0 && ppf.Count > 0)
                {
                    SubForms.PicForm pf = new SubForms.PicForm();
                    var frm1            = pf.elementHost1.Child as wpfTerrainProfile;
                    frm1.LDesignPoint = pps;
                    frm1.LFlyPoint    = ppf;
                    frm1.DrawV();
                    pf.ShowDialog(this);
                }
                break;
            }
        }