Пример #1
0
        /// <summary>
        /// set this box to the bounding box of this and point
        /// </summary>
        public void Include([NotNull] Pnt point, int dimension)
        {
            if (Min == Max)
            {
                Min = Min.ClonePnt();
                Max = Max.ClonePnt();
            }

            for (var i = 0; i < dimension; i++)
            {
                if (point[i] < Min[i])
                {
                    Min[i] = point[i];
                }
                else if (point[i] > Max[i])
                {
                    Max[i] = point[i];
                }
            }
        }
Пример #2
0
        /// <summary>
        /// set this box to the bounding box of this and box
        /// </summary>
        /// <param name="box"></param>
        /// <param name="dimension"></param>
        public void Include([NotNull] IBox box, int dimension)
        {
            if (Min == Max)
            {
                Min = Min.ClonePnt();
                Max = Max.ClonePnt();
            }

            for (var i = 0; i < dimension; i++)
            {
                if (box.Min[i] < Min[i])
                {
                    Min[i] = box.Min[i];
                }

                if (box.Max[i] > Max[i])
                {
                    Max[i] = box.Max[i];
                }
            }
        }
Пример #3
0
 public Box Clone()
 {
     return(new Box(Min.ClonePnt(), Max.ClonePnt()));
 }