lixiaojun
2024-09-24 512c687a0f94bc7fd70264fc9c325054c74c5952
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 DevExpress.CodeParser;
using DevExpress.Mvvm.POCO;
 
namespace Yw.WinFrmUI.HydroL3d
{
    /// <summary>
    /// 
    /// </summary>
    [TypeConverter(typeof(PropertySorter))]
    public class BoundingBox3d
    {
        /// <summary>
        /// 
        /// </summary>
        public BoundingBox3d() { }
 
        /// <summary>
        /// 
        /// </summary>
        public BoundingBox3d(Point3d min, Point3d max)
        {
            this.Min = new Point3d(min);
            this.Max = new Point3d(max);
        }
 
        /// <summary>
        /// 
        /// </summary>
        [DisplayName("Min")]
        [PropertyOrder(1)]
        public Point3d Min { get; set; }
 
        /// <summary>
        /// 
        /// </summary>
        [DisplayName("Max")]
        [PropertyOrder(2)]
        public Point3d Max { get; set; }
 
        /// <summary>
        /// 获取中心
        /// </summary>
        public Point3d GetCenter()
        {
            return new Point3d()
            {
                X = (this.Min.X + this.Max.X) / 2f,
                Y = (this.Min.Y + this.Max.Y) / 2f,
                Z = (this.Min.Z + this.Max.Z) / 2f
            };
        }
    }
}