using DevExpress.CodeParser; using DevExpress.DataAccess.MongoDB; namespace Yw.WinFrmUI.HydroL3d { /// /// /// public partial class Network { /// /// 判断是否存在 /// public bool IsExist(string id) { return _parters.Exists(x => x.Id == id); } /// /// 获取包围盒 /// 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; } } }