cloudflight
2023-12-02 c0f9915265878e56e91ee97f7f8d925db1e12626
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
//using CloudWaterNetwork.Magnifier;
//using dict_py_Inner;
using Hydro.MapView;
using Hydro.MapView.Base;
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.Common;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Windows.Forms.DataVisualization.Charting;
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 Cursor = System.Windows.Forms.Cursor;
 
namespace Hydro.MapUI
{
    public partial class empty
    {
 
    }
    public partial class MapViewer_Old
    {
 
        #region 新增管网
        public Template _newTemplate { get; set; } = new Template();
        MapViewNetWork _NewNet
        {
            get
            {
                if (_newTemplate.network == null) _newTemplate.network = new MapViewNetWork(); 
                return _newTemplate.network;
            }
        }
        #endregion
 
        #region 属性
 
 
        private string _StartPoint = null;
        private string _EndPoint = null;
        private bool __isEditMode = true;
        public bool _IsEditMode
        {
            get { return __isEditMode; }
            set
            {
                __isEditMode = value;
                toolStripComboBox_浏览模式.Text = __isEditMode ? "编辑模式" : "浏览模式";
            }
        }
 
        private Template __template = null;
        private Template _Template
        {
            get { return __template; }
            set
            {
                __template = value;
            
                label_file.Text = __template==null?"": __template.filePath;
            }
        }
        public float Link_multiply
        {
            get
            {
                if (_Template == null || _Template.mapOption == null) return 1.0f;
                return _Template.mapOption.Link_multiply;
            }
            set
            {
                if (_Template == null || _Template.mapOption == null) return;
                _Template.mapOption.Link_multiply = value;
            }
        }
        public float junction_multiply
        {
            get
            {
                if (_Template == null || _Template.mapOption == null) return 1.0f;
                return _Template.mapOption.junction_multiply;
            }
            set
            {
                if (_Template == null || _Template.mapOption == null) return;
                _Template.mapOption.junction_multiply = value;
            }
        }
        public bool _ShowValve
        {
            get
            {
                if (_Template == null || _Template.mapOption == null) return true;
                return _Template.mapOption._ShowValve;
            }
            set
            {
                _Template.mapOption._ShowValve = value;
            }
        }
        public bool _ShowJunction
        {
            get
            {
                if (_Template == null || _Template.mapOption == null) return true;
                return _Template.mapOption._ShowJunction;
            }
            set
            {
                _Template.mapOption._ShowJunction = value;
            }
        }
        string _filePath
        {
            get
            {
                if (string.IsNullOrEmpty(_Template?.filePath))
                    return null;
                return
                    Path.Combine(Directory.GetCurrentDirectory(), _Template.filePath);
            }
            //set 
            //{
 
            //    _Template.路径 = value; 
            //} 
        }
        private MapViewNetWork _Network
        {
            get
            {
                return _Template?.network;
            }
        }
 
 
        public List<NodeViewModel> _Nodes
        {
            get { return _Network?.Nodes??new List<NodeViewModel>(); }
 
        }
 
        public List<LinkViewModel> _Links
        {
            get { return _Network?.Links??new List<LinkViewModel>(); }
 
        }
 
        private List<Area> _areas = new List<Area>();
        public List<Area> _Areas
        {
            get { return _areas; }
 
        }
        #endregion
 
 
        #region 基础地图视图选项
 
        MapDimensions mapOption = new MapDimensions();
        MapDimensions mapOption0 = new MapDimensions();
 
        private const float MinZoom = 0.1f;
        private const float MaxZoom = 1000.0f;
 
 
        public float zoom { get { return mapOption.zoom; }set { mapOption.zoom = value; } } 
        public double Rotation { get { return mapOption.rotation; } set { mapOption.rotation = value; } }
        private double Rotation0 = 0;
        public PointF MapCenter { get { return mapOption.Center; } set { mapOption.Center = value; } }
        private PointF MapCenter0;
        private bool is3Dview = false;
        double 俯视角度_start = 90;
     
        /// <summary>
        /// 俯视线与底面的夹角,投影用sin
        /// </summary>
 
        public double RotationF 
        { 
            get {
                if (Lock2DView) mapOption.rotationF = 90;
                
                return mapOption.rotationF; 
            } 
            set { 
                mapOption.rotationF = value;
                if (Lock2DView) mapOption.rotationF = 90;
            } 
        }
       
        public double 俯视弧度
        {
            get
            {
                return RotationF / 180 * Math.PI;
            }
        }
 
 
        public PointF Zoom
        {
            get
            {
                return new PointF(zoom, -zoom);
            }
        }
 
 
        private PointF Z(float z)
        {
            return new PointF(0, 0);
        }
        #endregion
 
 
    }
}