lixiaojun
2024-09-23 4e38ec6e6bdbbe8d8f2921b7a7ea6377cb77d213
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
using DevExpress.CodeParser;
using DevExpress.DataAccess.MongoDB;
 
namespace Yw.WinFrmUI.HydroL3d
{
    /// <summary>
    /// 
    /// </summary>
    public partial class Network
    {
 
        /// <summary>
        /// 判断是否存在
        /// </summary>
        public bool IsExist(string id)
        {
            return _parters.Exists(x => x.Id == id);
        }
 
        /// <summary>
        /// 获取包围盒
        /// </summary>
        public BoundingBox3d GetBoundingBox()
        {
            var bd = new BoundingBox3d();
            bd.Min = new Point3d();
            bd.Max = new Point3d();
 
            foreach (var node in this.Nodes)
            {
                bd.Min.X = Math.Min(bd.Min.X, node.Position.X);
                bd.Max.X = Math.Max(bd.Max.X, node.Position.X);
                bd.Min.Y = Math.Min(bd.Min.Y, node.Position.Y);
                bd.Max.Y = Math.Max(bd.Max.Y, node.Position.Y);
                bd.Min.Z = Math.Min(bd.Min.Z, node.Position.Z);
                bd.Max.Z = Math.Max(bd.Max.Z, node.Position.Z);
            }
 
            return bd;
        }
 
 
 
 
 
 
 
 
 
    }
}