Пример #1
0
 /// <summary>
 /// 
 /// </summary>
 /// <returns></returns>
 protected override object ComputeBounds()
 {
     Interval bounds = null;
     for (IEnumerator i = ChildBoundables.GetEnumerator(); i.MoveNext(); )
     {
         IBoundable childBoundable = (IBoundable)i.Current;
         if (bounds == null)
              bounds = new Interval((Interval)childBoundable.Bounds);
         else bounds.ExpandToInclude((Interval)childBoundable.Bounds);
     }
     return bounds;
 }
Пример #2
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="other"></param>
 /// <returns></returns>
 public bool Intersects(Interval other)
 {
     return !(other.min > max || other.max < min);
 }
Пример #3
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="other"></param>
 /// <returns><c>this</c></returns>
 public Interval ExpandToInclude(Interval other)
 {
     max = Math.Max(max, other.max);
     min = Math.Min(min, other.min);
     return this;
 }
Пример #4
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="other"></param>
 public Interval(Interval other) : this(other.min, other.max) { }