cloudflight
2024-05-07 2646029d2b97f6835062d45d2cfa632838c527ca
WinfrmUI/Hydro.WinfrmUI.Browser/Viewer.Model.cs
@@ -1,5 +1,4 @@
//using CloudWaterNetwork.Magnifier;
//using dict_py_Inner;

using Hydro.Core.Model;
using Hydro.MapView;
using Hydro.MapView.Base;
@@ -27,8 +26,7 @@
using static System.Windows.Forms.LinkLabel;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.Button;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.TrackBar;
using Cursor = System.Windows.Forms.Cursor;
namespace Hydro.WinfrmUI
{
 
@@ -78,9 +76,7 @@
            get {return TC.template; }
            set
            {
                TC.template = value;
                label_file.Text = TC.template?.filePath;
                TC.template = value;
            }
        }
@@ -121,7 +117,7 @@
        bool _isInsertingObject = false;
        bool _isMovingObject = false;
        bool _isPastingObject = false;
        Cursor _lastCursor;
        System.Windows.Forms.Cursor _lastCursor;
        object _undoOldValue = null;
        private List<PointF> polygonPoints = new List<PointF>();
@@ -274,7 +270,10 @@
            }
            set
            {
                label_zoom.Text = $"Zoom:{zoom.ToString("0.000")}";
                if (OnChangeViewZoom != null)
                {
                    OnChangeViewZoom.Invoke(zoom);
                }
                mapOption.zoom = value; 
            } 
        }
@@ -287,7 +286,10 @@
            } 
            set 
            {
                toolStripStatusLabel_rotation.Text = $"Rotation:({Rotation.ToString("0")},{RotationF.ToString("0")})";
                if (OnChangeViewRotation != null)
                {
                    OnChangeViewRotation.Invoke(Rotation, RotationF);
                }
                mapOption.rotation = value; 
            } 
        }
@@ -302,7 +304,10 @@
            } 
            set 
            {
                label_center.Text = $"center:({MapCenter.X.ToString("0.00")} ,{MapCenter.Y.ToString("0.00")})";
                if (OnChangeViewCenter != null)
                {
                    OnChangeViewCenter.Invoke(MapCenter);
                }
                mapOption.Center = value; 
            } 
        }
@@ -379,11 +384,12 @@
                return _Template?.Colours?.FirstOrDefault(cl => cl.isChoosed && cl.Type == mapOption.ColourLink);
            }
        }
        //private bool __isOrtho = true;
        #endregion
        #region 正交模式
        public Action<bool> OnChangeViewOrtho = null;
        private bool _isOrtho
        {
            get
@@ -393,14 +399,11 @@
            set
            {
                mapOption.IsOrtho = value;
                if (mapOption.IsOrtho)
                if(OnChangeViewOrtho != null)
                {
                    label_ZZ.Text = "正交模式:开";
                    OnChangeViewOrtho.Invoke(mapOption.IsOrtho);
                }
                else
                {
                    label_ZZ.Text = "正交模式:关";
                }
            }
        }
        #endregion