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