lixiaojun
2025-04-07 33efd807b5f5aac98ce736ccec002e190e5dd175
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
using System.Windows.Forms.Integration;
 
namespace Yw.WinFrmUI.Hydro
{
    public partial class ViewerL3d2 : UserControl
    {
        public ViewerL3d2()
        {
            InitializeComponent();
        }
 
        #region 事件集合
 
        /// <summary>
        /// 选择改变事件
        /// </summary>
        public event Action<List<Yw.WpfUI.Hydro.VisualL3d>> SelectionChangedEvent;
 
        #endregion
 
        #region 私有字段
 
        private Yw.WpfUI.Hydro.ViewerL3d _wpfViewer = null;//wpf控件 
 
        #endregion
 
 
        //初始化wpf控件
        private void InitialWpfControl()
        {
            _wpfViewer = new WpfUI.Hydro.ViewerL3d();
            _wpfViewer.SelectionChangedEvent += (visuals) => this.SelectionChangedEvent?.Invoke(visuals);
            var elementHost = new ElementHost();
            elementHost.Dock = DockStyle.Fill;
            elementHost.Child = _wpfViewer;
            this.Controls.Clear();
            this.Controls.Add(elementHost);
        }
 
 
        /// <summary>
        /// 初始化
        /// </summary>
        public void Initial(Yw.WpfUI.Hydro.NetworkL3d nw)
        {
            InitialWpfControl();
            _wpfViewer.Initial(nw);
        }
 
 
 
    }
}