Пример #1
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="other"></param>
 /// <returns></returns>
 public virtual bool Intersects(Interval other)
 {
     return !(other.min > max || other.max < min);
 }
Пример #2
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="other"></param>
 public Interval(Interval other) : this(other.min, other.max) { }
Пример #3
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="other"></param>
 /// <returns><c>this</c></returns>
 public virtual Interval ExpandToInclude(Interval other)
 {
     max = Math.Max(max, other.max);
     min = Math.Min(min, other.min);
     return this;
 }
Пример #4
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;
 }