-- Rectangular region behaviors

module RectB ( RectB
             , rectFromCorners, rectFromCenterSize, mkRect
             , rectLL, rectUR, rectLR, rectUL
             , rectCenter, rectSize
             , overlapRects,emptyRect,isEmptyRect,unionRect	     
             , intersectRect, expandRect, rectContains
	     , rectWidth, rectHeight,increaseRect
             ) where

import qualified Rect as R
import FRPImpl
import Point2B (Point2B)
import Vector2B (Vector2B)

type RectB = Behavior R.Rect


rectFromCorners    :: Point2B -> Point2B  -> RectB
rectFromCenterSize :: Point2B -> Vector2B -> RectB
intersectRect      :: RectB   -> RectB    -> RectB
unionRect	   :: RectB   -> RectB    -> RectB
rectContains       :: RectB   -> Point2B  -> BoolB
expandRect         :: RealB   -> RectB    -> RectB
overlapRects       :: RectB   -> RectB    -> BoolB
emptyRect          :: RectB
isEmptyRect        :: RectB -> BoolB
rectCenter         :: RectB -> Point2B
rectSize           :: RectB -> Vector2B
increaseRect	   :: Vector2B -> RectB -> RectB
rectLL, rectUR, rectLR, rectUL :: RectB -> Point2B
rectWidth, rectHeight :: RectB -> RealB
mkRect :: Point2B -> Vector2B -> RectB

mkRect = lift2 R.mkRect
rectWidth = lift1 R.rectWidth
rectHeight = lift1 R.rectHeight

rectFromCorners    = lift2 R.rectFromCorners
rectFromCenterSize = lift2 R.rectFromCenterSize
intersectRect      = lift2 R.intersectRect
unionRect	   = lift2 R.unionRect
rectContains       = lift2 R.rectContains
expandRect         = lift2 R.expandRect
overlapRects       = lift2 R.overlapRects
emptyRect          = lift0 R.emptyRect
isEmptyRect        = lift1 R.isEmptyRect
rectCenter         = lift1 R.rectCenter
rectSize           = lift1 R.rectSize
rectLL             = lift1 R.rectLL
rectUR             = lift1 R.rectUR
rectLR             = lift1 R.rectLR
rectUL             = lift1 R.rectUL
increaseRect = lift2 R.increaseRect
