| | |
| | | //using CloudWaterNetwork.Magnifier; |
| | | //using dict_py_Inner; |
| | | using Yw.WinFrmUI.Q3d; |
| | | |
| | | |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using System.Windows.Forms; |
| | | //using System.Windows.Forms.DataVisualization.Charting; |
| | | using static Yw.WinFrmUI.Q3d.MapViewEnum; |
| | | using Yw.WinFrmUI.Q3d; |
| | | using static System.Net.Mime.MediaTypeNames; |
| | | using static System.Windows.Forms.AxHost; |
| | | using static System.Windows.Forms.LinkLabel; |
| | | using static System.Windows.Forms.VisualStyles.VisualStyleElement.Button; |
| | | using static System.Windows.Forms.VisualStyles.VisualStyleElement.TrackBar; |
| | | //using System.Windows.Forms.DataVisualization.Charting; |
| | | using static Yw.WinFrmUI.Q3d.MapViewEnum; |
| | | using Cursor = System.Windows.Forms.Cursor; |
| | | |
| | | namespace Yw.WinFrmUI.Q3d |
| | |
| | | |
| | | public MapDimensions mapOption = new MapDimensions(); |
| | | |
| | | public Settings newTemplate = null; |
| | | public Settings newTemplate = null; |
| | | |
| | | public Settings settings = null; |
| | | |
| | |
| | | /// <summary> |
| | | /// 地图选项 |
| | | /// </summary> |
| | | public MapDimensions mapOption |
| | | public MapDimensions mapOption |
| | | { |
| | | get { return TC.mapOption; } |
| | | set { TC.mapOption = value; } |
| | |
| | | [Browsable(false)] |
| | | private Settings _Template |
| | | { |
| | | get {return TC.settings; } |
| | | get { return TC.settings; } |
| | | set |
| | | { |
| | | TC.settings = value; |
| | |
| | | bool _isDragging; |
| | | bool _isRotating; |
| | | bool _isPainting; |
| | | |
| | | |
| | | |
| | | PointF mousePosition; |
| | | // control+鼠标中间按下缩放 |
| | |
| | | [Browsable(false)] |
| | | public bool IsEditMode |
| | | { |
| | | get { return this.mapOption?.isEditMode??true; } |
| | | get { return this.mapOption?.isEditMode ?? true; } |
| | | set |
| | | { |
| | | if (this.mapOption!=null) this.mapOption.isEditMode = value; |
| | | if (this.mapOption != null) this.mapOption.isEditMode = value; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | [Browsable(false)] |
| | | private float Link_multiply |
| | | { |
| | |
| | | } |
| | | set |
| | | { |
| | | if (_Template == null || _Template.mapOption == null) return;_Template.mapOption.Link_multiply = value; |
| | | if (_Template == null || _Template.mapOption == null) return; _Template.mapOption.Link_multiply = value; |
| | | } |
| | | } |
| | | [Browsable(false)] |
| | |
| | | } |
| | | set |
| | | { |
| | | if (_Template == null || _Template.mapOption == null) return;_Template.mapOption.junction_multiply = value; |
| | | if (_Template == null || _Template.mapOption == null) return; _Template.mapOption.junction_multiply = value; |
| | | } |
| | | } |
| | | [DisplayName("显示阀门")] |
| | |
| | | } |
| | | set |
| | | { |
| | | if (_Template == null || _Template.mapOption == null) return;_Template.mapOption._ShowValve = value; |
| | | if (_Template == null || _Template.mapOption == null) return; _Template.mapOption._ShowValve = value; |
| | | } |
| | | } |
| | | [DisplayName("显示节点")] |
| | |
| | | } |
| | | set |
| | | { |
| | | |
| | | if (_Template == null || _Template.mapOption == null) return;_Template.mapOption._ShowJunction = value; |
| | | |
| | | if (_Template == null || _Template.mapOption == null) return; _Template.mapOption._ShowJunction = value; |
| | | } |
| | | } |
| | | string _filePath |
| | |
| | | { |
| | | if (string.IsNullOrEmpty(_Template?.filePath)) |
| | | return null; |
| | | string path=_Template.filePath.TrimStart('\\'); |
| | | string path = _Template.filePath.TrimStart('\\'); |
| | | return |
| | | Path.Combine(Directory.GetCurrentDirectory(), path); |
| | | } |
| | |
| | | #endregion |
| | | #region 管网属性(辅助) |
| | | [Browsable(false)] |
| | | public List<Q3DNodeCalcModel> _Nodes |
| | | public NodeViewModelList _Nodes |
| | | { |
| | | get { return Network?.Nodes??new List<Q3DNodeCalcModel>(); } |
| | | get { return Network?.Nodes ?? new NodeViewModelList(); } |
| | | |
| | | } |
| | | [Browsable(false)] |
| | | public List<Q3DLinkCalcModel> _Links |
| | | public LinkViewModelList _Links |
| | | { |
| | | get { return Network?.Links??new List<Q3DLinkCalcModel>(); } |
| | | get { return Network?.Links ?? new LinkViewModelList(); } |
| | | |
| | | } |
| | | |
| | |
| | | #endregion |
| | | #region 视角设置(辅助) |
| | | |
| | | |
| | | |
| | | |
| | | private const float MinZoom = 0.1f; |
| | | private const float MaxZoom = 1000.0f; |
| | | |
| | | [DisplayName("缩放系数")] |
| | | public float zoom |
| | | { |
| | | public float zoom |
| | | { |
| | | get |
| | | { |
| | | { |
| | | return mapOption.zoom; |
| | | } |
| | | set |
| | | { |
| | | ZoomChanged?.Invoke(this, zoom.ToString("0.000")); |
| | | mapOption.zoom = value; |
| | | } |
| | | mapOption.zoom = value; |
| | | } |
| | | } |
| | | [DisplayName("旋转角度")] |
| | | private double Rotation |
| | | private double Rotation |
| | | { |
| | | get |
| | | { |
| | | return mapOption.rotation; |
| | | } |
| | | set |
| | | return mapOption.rotation; |
| | | } |
| | | set |
| | | { |
| | | |
| | | |
| | | |
| | | |
| | | //将旋转角度转换为-180~180 |
| | |
| | | if (value > 180) |
| | | value -= 360; |
| | | else if (value < -180) |
| | | value += 360; |
| | | mapOption.rotation = value; |
| | | } |
| | | value += 360; |
| | | mapOption.rotation = value; |
| | | } |
| | | } |
| | | |
| | | |
| | | private double Rotation0 = 0; |
| | | [Browsable(false)] |
| | | public PointF3D MapCenter |
| | | { |
| | | get |
| | | public PointF3D MapCenter |
| | | { |
| | | get |
| | | { |
| | | if (mapOption?.Center == null) return new PointF3D(0, 0, 0); |
| | | return mapOption.Center; |
| | | } |
| | | set |
| | | } |
| | | set |
| | | { |
| | | //将$"{MapCenter.X.ToString("0.00")},{MapCenter.Y.ToString("0.00")}"通过CenterChanged传出 |
| | | CenterChanged?.Invoke(this, $"{MapCenter.X.ToString("0.00")},{MapCenter.Y.ToString("0.00")}"); |
| | | mapOption.Center = value; |
| | | } |
| | | } |
| | | } |
| | | private PointF3D MapCenter0; |
| | | private bool is3Dview = false; |
| | |
| | | /// 俯视线与底面的夹角,投影用sin |
| | | /// </summary> |
| | | [DisplayName("俯视角度")] |
| | | private double RotationF |
| | | { |
| | | get |
| | | private double RotationF |
| | | { |
| | | get |
| | | { |
| | | return mapOption.rotationF; |
| | | } |
| | | set |
| | | { |
| | | return mapOption.rotationF; |
| | | } |
| | | set |
| | | { |
| | | mapOption.rotationF = value; |
| | | } |
| | | } |
| | | } |
| | | [Browsable(false)] |
| | | private double 俯视弧度 |
| | |
| | | return _Template?.Colours?.FirstOrDefault(cl => cl.isChoosed && cl.Type == mapOption.ColourLink); |
| | | } |
| | | } |
| | | |
| | | |
| | | //private bool __isOrtho = true; |
| | | |
| | | #endregion |