示例#1
0
			protected override object ComputeBounds() 
			{
				Interval bounds = null;
				foreach(object obj in GetChildBoundables() ) 
				{
					IBoundable childBoundable = (IBoundable) obj;
					if (bounds == null) 
					{
						bounds = new Interval((Interval)childBoundable.GetBounds());
					}
					else 
					{
						bounds.ExpandToInclude((Interval)childBoundable.GetBounds());
					}
				}
				return bounds;
			}
示例#2
0
		/**
		 * @return this
		 */
		public Interval ExpandToInclude(Interval other) 
		{
			_max = Math.Max(_max, other.Max);
			_min = Math.Min(_min, other.Min);
			return this;
		}
示例#3
0
		public bool Intersects(Interval other) 
		{
			return !(other.Min > _max || other.Max < _min);
		}
示例#4
0
		public Interval(Interval other) :this(other._min, other._max)
		{
		
		}