//--------------------------------------
//          Blaze Rasteriser
//
//        For documentation or 
//    if you have any issues, visit
//        powerUI.kulestar.com
//
//    Copyright  2013 Kulestar Ltd
//          www.kulestar.com
//--------------------------------------

using System;


namespace Blaze{

	public partial class VectorPoint{
		
		/// <summary>Slices off anything to the right of the given line.</summary>
		public virtual void SliceRight(float sliceLine,VectorPath path){
			
		}
		
		/// <summary>Slices off anything to the left of the given line.</summary>
		public virtual void SliceLeft(float sliceLine,VectorPath path){
			
		}
		
		/// <summary>Slices off anything below the given line.</summary>
		public virtual void SliceBottom(float sliceLine,VectorPath path){
			
		}
		
		/// <summary>Slices off anything above the given line.</summary>
		public virtual void SliceTop(float sliceLine,VectorPath path){
			
		}
		
		/// <summary>Bounds the given number to being a real number.
		/// NaN is converted to 0 and +ve/-ve infinity are 
		/// mapped to int.MaxValue and int.MinValue.</summary>
		protected static void BoundToReal(ref float value){
			
			if(float.IsNaN(value)){
				
				// NaN will act like 0:
				value=0f;
				
			}else if(value == float.PositiveInfinity){
				
				// Use a high (but not rediculously) number:
				value=(float)int.MaxValue;
				
			}else if(value == float.NegativeInfinity){
				
				// Use a low (but not rediculously) number:
				value=(float)int.MinValue;
				
			}
			
		}
		
		/// <summary>Bounds this point to using real workable numbers.
		/// NaN and infinities are eliminated.</summary>
		public virtual void BoundToReal(){
			
			BoundToReal(ref X);
			BoundToReal(ref Y);
			
		}
		
	}

}