Exemplo n.º 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;
 }
Exemplo n.º 2
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="other"></param>
 /// <returns></returns>
 public bool Intersects(Interval other)
 {
     return !(other.min > max || other.max < min);
 }
Exemplo n.º 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;
 }
Exemplo n.º 4
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="other"></param>
 public Interval(Interval other) : this(other.min, other.max) { }