Exemple #1
0
        public static void Normalize <Rect, T>(this Rect r)
            where Rect : IRectangle3Base <T>
            where T : IComparable <T>
        {
            T z1 = r.X1, z2 = r.X2;

            if (r.Z2.CompareTo(r.Z1) < 0)
            {
                r.SetZRange(z2, z1);
            }
            RectangleExt.Normalize <Rect, T>(r);
        }
Exemple #2
0
        public static BoundingBox <T> ToBoundingBox <T>(this IEnumerator <Point <T> > e) where T : IConvertible, IComparable <T>, IEquatable <T>
        {
            if (!e.MoveNext())
            {
                return(null);
            }
            var bb = new BoundingBox <T>(e.Current);

            while (e.MoveNext())
            {
                RectangleExt.ExpandToInclude <BoundingBox <T>, Point <T>, T>(bb, e.Current);
            }
            return(bb);
        }
Exemple #3
0
 public static bool Overlaps <T>(this BoundingBox <T> self, BoundingBox <T> other) where T : IConvertible, IComparable <T>, IEquatable <T>
 {
     return(RectangleExt.Overlaps <BoundingBox <T>, T>(self, other));
 }
Exemple #4
0
 public static bool Contains <T>(this BoundingBox <T> self, Point <T> point) where T : IConvertible, IComparable <T>, IEquatable <T>
 {
     return(RectangleExt.Contains <BoundingBox <T>, Point <T>, T>(self, point));
 }
Exemple #5
0
 public static bool ExpandToInclude <T>(this BoundingBox <T> self, IEnumerable <Point <T> > points) where T : IConvertible, IComparable <T>, IEquatable <T>
 {
     return(RectangleExt.ExpandToInclude <BoundingBox <T>, Point <T>, T>(self, points));
 }
Exemple #6
0
 public static BoundingBox <T> Intersect <T>(this BoundingBox <T> self, BoundingBox <T> b) where T : IConvertible, IComparable <T>, IEquatable <T>
 {
     return(RectangleExt.Intersect <BoundingBox <T>, T>(self, b));
 }
Exemple #7
0
 public static void Normalize <T>(this BoundingBox <T> self) where T : IConvertible, IComparable <T>, IEquatable <T>
 {
     RectangleExt.Normalize <BoundingBox <T>, T>(self);
 }