{-# LANGUAGE CApiFFI #-}
module OpenCascade.GP.Dir2d
( Dir2d
, new
, getX
, getY
, setX
, setY 
, isEqual
, isOpposite
, isNormal
, isParallel
, angle
, crossed
, dot
, reverse
, reversed
, mirror
, mirrored
, mirrorAboutAx2d
, mirroredAboutAx2d
, rotate
, rotated
, transform
, transformed
) where


import Prelude hiding (reverse)
import OpenCascade.GP.Types
import OpenCascade.GP.Internal.Destructors
import Foreign.C
import Foreign.Ptr
import Data.Coerce (coerce)
import Data.Acquire 

-- new

foreign import capi unsafe "hs_gp_Dir2d.h hs_new_gp_Dir2d" rawNew :: CDouble -> CDouble -> IO (Ptr Dir2d)

new :: Double -> Double -> Acquire (Ptr Dir2d)
new :: Double -> Double -> Acquire (Ptr Dir2d)
new Double
x Double
y = IO (Ptr Dir2d) -> (Ptr Dir2d -> IO ()) -> Acquire (Ptr Dir2d)
forall a. IO a -> (a -> IO ()) -> Acquire a
mkAcquire (CDouble -> CDouble -> IO (Ptr Dir2d)
rawNew (Double -> CDouble
CDouble Double
x) (Double -> CDouble
CDouble Double
y)) Ptr Dir2d -> IO ()
deleteDir2d

-- getters

foreign import capi unsafe "hs_gp_Dir2d.h hs_gp_Dir2d_X" rawX :: Ptr Dir2d -> IO (CDouble)

getX :: Ptr Dir2d -> IO Double
getX :: Ptr Dir2d -> IO Double
getX = (Ptr Dir2d -> IO CDouble) -> Ptr Dir2d -> IO Double
forall a b. Coercible a b => a -> b
coerce Ptr Dir2d -> IO CDouble
rawX

foreign import capi unsafe "hs_gp_Dir2d.h hs_gp_Dir2d_Y" rawY :: Ptr Dir2d -> IO (CDouble)

getY :: Ptr Dir2d -> IO Double
getY :: Ptr Dir2d -> IO Double
getY = (Ptr Dir2d -> IO CDouble) -> Ptr Dir2d -> IO Double
forall a b. Coercible a b => a -> b
coerce Ptr Dir2d -> IO CDouble
rawY

-- setters

foreign import capi unsafe "hs_gp_Dir2d.h hs_gp_Dir2d_SetX" rawSetX :: Ptr Dir2d -> CDouble -> IO ()

setX :: Ptr Dir2d -> Double -> IO ()
setX :: Ptr Dir2d -> Double -> IO ()
setX = (Ptr Dir2d -> CDouble -> IO ()) -> Ptr Dir2d -> Double -> IO ()
forall a b. Coercible a b => a -> b
coerce Ptr Dir2d -> CDouble -> IO ()
rawSetX


foreign import capi unsafe "hs_gp_Dir2d.h hs_gp_Dir2d_SetY" rawSetY :: Ptr Dir2d -> CDouble -> IO ()

setY :: Ptr Dir2d -> Double -> IO ()
setY :: Ptr Dir2d -> Double -> IO ()
setY = (Ptr Dir2d -> CDouble -> IO ()) -> Ptr Dir2d -> Double -> IO ()
forall a b. Coercible a b => a -> b
coerce Ptr Dir2d -> CDouble -> IO ()
rawSetY

-- tests

-- isEqual

foreign import capi unsafe "hs_gp_Dir2d.h hs_gp_Dir2d_IsEqual" rawIsEqual :: Ptr Dir2d -> Ptr Dir2d -> CDouble -> IO CBool

isEqual :: Ptr Dir2d -> Ptr Dir2d -> Double -> IO Bool
isEqual :: Ptr Dir2d -> Ptr Dir2d -> Double -> IO Bool
isEqual Ptr Dir2d
a Ptr Dir2d
b Double
tolerance = (CBool -> CBool -> Bool
forall a. Eq a => a -> a -> Bool
/= CBool
0) (CBool -> Bool) -> IO CBool -> IO Bool
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Ptr Dir2d -> Ptr Dir2d -> CDouble -> IO CBool
rawIsEqual Ptr Dir2d
a Ptr Dir2d
b (Double -> CDouble
CDouble Double
tolerance)

-- isNormal

foreign import capi unsafe "hs_gp_Dir2d.h hs_gp_Dir2d_IsNormal" rawIsNormal :: Ptr Dir2d -> Ptr Dir2d -> CDouble -> IO CBool

isNormal :: Ptr Dir2d -> Ptr Dir2d -> Double -> IO Bool
isNormal :: Ptr Dir2d -> Ptr Dir2d -> Double -> IO Bool
isNormal Ptr Dir2d
a Ptr Dir2d
b Double
tolerance = (CBool -> CBool -> Bool
forall a. Eq a => a -> a -> Bool
/= CBool
0) (CBool -> Bool) -> IO CBool -> IO Bool
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Ptr Dir2d -> Ptr Dir2d -> CDouble -> IO CBool
rawIsNormal Ptr Dir2d
a Ptr Dir2d
b (Double -> CDouble
CDouble Double
tolerance)


-- isOpposite

foreign import capi unsafe "hs_gp_Dir2d.h hs_gp_Dir2d_IsOpposite" rawIsOpposite :: Ptr Dir2d -> Ptr Dir2d -> CDouble -> IO CBool

isOpposite :: Ptr Dir2d -> Ptr Dir2d -> Double -> IO Bool
isOpposite :: Ptr Dir2d -> Ptr Dir2d -> Double -> IO Bool
isOpposite Ptr Dir2d
a Ptr Dir2d
b Double
tolerance = (CBool -> CBool -> Bool
forall a. Eq a => a -> a -> Bool
/= CBool
0) (CBool -> Bool) -> IO CBool -> IO Bool
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Ptr Dir2d -> Ptr Dir2d -> CDouble -> IO CBool
rawIsOpposite Ptr Dir2d
a Ptr Dir2d
b (Double -> CDouble
CDouble Double
tolerance)

-- isParallel

foreign import capi unsafe "hs_gp_Dir2d.h hs_gp_Dir2d_IsParallel" rawIsParallel :: Ptr Dir2d -> Ptr Dir2d -> CDouble -> IO CBool

isParallel :: Ptr Dir2d -> Ptr Dir2d -> Double -> IO Bool
isParallel :: Ptr Dir2d -> Ptr Dir2d -> Double -> IO Bool
isParallel Ptr Dir2d
a Ptr Dir2d
b Double
tolerance = (CBool -> CBool -> Bool
forall a. Eq a => a -> a -> Bool
/= CBool
0) (CBool -> Bool) -> IO CBool -> IO Bool
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Ptr Dir2d -> Ptr Dir2d -> CDouble -> IO CBool
rawIsParallel Ptr Dir2d
a Ptr Dir2d
b (Double -> CDouble
CDouble Double
tolerance)

-- angle

foreign import capi unsafe "hs_gp_Dir2d.h hs_gp_Dir2d_Angle" rawAngle :: Ptr Dir2d -> Ptr Dir2d -> IO CDouble

angle :: Ptr Dir2d -> Ptr Dir2d -> IO Double
angle :: Ptr Dir2d -> Ptr Dir2d -> IO Double
angle = (Ptr Dir2d -> Ptr Dir2d -> IO CDouble)
-> Ptr Dir2d -> Ptr Dir2d -> IO Double
forall a b. Coercible a b => a -> b
coerce Ptr Dir2d -> Ptr Dir2d -> IO CDouble
rawAngle

-- crossed

foreign import capi unsafe "hs_gp_Dir2d.h hs_gp_Dir2d_Crossed" rawCrossed :: Ptr Dir2d -> Ptr Dir2d -> IO CDouble

crossed :: Ptr Dir2d -> Ptr Dir2d -> IO Double
crossed :: Ptr Dir2d -> Ptr Dir2d -> IO Double
crossed = (Ptr Dir2d -> Ptr Dir2d -> IO CDouble)
-> Ptr Dir2d -> Ptr Dir2d -> IO Double
forall a b. Coercible a b => a -> b
coerce Ptr Dir2d -> Ptr Dir2d -> IO CDouble
rawCrossed

-- dot

foreign import capi unsafe "hs_gp_Dir2d.h hs_gp_Dir2d_Dot" rawDot :: Ptr Dir2d -> Ptr Dir2d -> IO CDouble

dot :: Ptr Dir2d -> Ptr Dir2d -> IO Double
dot :: Ptr Dir2d -> Ptr Dir2d -> IO Double
dot = (Ptr Dir2d -> Ptr Dir2d -> IO CDouble)
-> Ptr Dir2d -> Ptr Dir2d -> IO Double
forall a b. Coercible a b => a -> b
coerce Ptr Dir2d -> Ptr Dir2d -> IO CDouble
rawDot

-- reverse/reversed

foreign import capi unsafe "hs_gp_Dir2d.h hs_gp_Dir2d_Reverse" reverse :: Ptr Dir2d -> IO ()

foreign import capi unsafe "hs_gp_Dir2d.h hs_gp_Dir2d_Reversed" rawReversed :: Ptr Dir2d -> IO (Ptr Dir2d)

reversed :: Ptr Dir2d -> Acquire (Ptr Dir2d)
reversed :: Ptr Dir2d -> Acquire (Ptr Dir2d)
reversed Ptr Dir2d
axis = IO (Ptr Dir2d) -> (Ptr Dir2d -> IO ()) -> Acquire (Ptr Dir2d)
forall a. IO a -> (a -> IO ()) -> Acquire a
mkAcquire (Ptr Dir2d -> IO (Ptr Dir2d)
rawReversed Ptr Dir2d
axis) Ptr Dir2d -> IO ()
deleteDir2d

-- mirror/mirrored

foreign import capi unsafe "hs_gp_Dir2d.h hs_gp_Dir2d_Mirror" mirror :: Ptr Dir2d -> Ptr Dir2d -> IO ()

foreign import capi unsafe "hs_gp_Dir2d.h hs_gp_Dir2d_Mirrored" rawMirrored :: Ptr Dir2d -> Ptr Dir2d -> IO (Ptr Dir2d)

mirrored :: Ptr Dir2d -> Ptr Dir2d -> Acquire (Ptr Dir2d)
mirrored :: Ptr Dir2d -> Ptr Dir2d -> Acquire (Ptr Dir2d)
mirrored Ptr Dir2d
point Ptr Dir2d
axis = IO (Ptr Dir2d) -> (Ptr Dir2d -> IO ()) -> Acquire (Ptr Dir2d)
forall a. IO a -> (a -> IO ()) -> Acquire a
mkAcquire (Ptr Dir2d -> Ptr Dir2d -> IO (Ptr Dir2d)
rawMirrored Ptr Dir2d
point Ptr Dir2d
axis) Ptr Dir2d -> IO ()
deleteDir2d

foreign import capi unsafe "hs_gp_Dir2d.h hs_gp_Dir2d_MirrorAboutAx2d" mirrorAboutAx2d :: Ptr Dir2d -> Ptr Ax2d -> IO ()

foreign import capi unsafe "hs_gp_Dir2d.h hs_gp_Dir2d_MirroredAboutAx2d" rawMirroredAboutAx2d :: Ptr Dir2d -> Ptr Ax2d -> IO (Ptr Dir2d)

mirroredAboutAx2d :: Ptr Dir2d -> Ptr Ax2d -> Acquire (Ptr Dir2d)
mirroredAboutAx2d :: Ptr Dir2d -> Ptr Ax2d -> Acquire (Ptr Dir2d)
mirroredAboutAx2d Ptr Dir2d
point Ptr Ax2d
axis = IO (Ptr Dir2d) -> (Ptr Dir2d -> IO ()) -> Acquire (Ptr Dir2d)
forall a. IO a -> (a -> IO ()) -> Acquire a
mkAcquire (Ptr Dir2d -> Ptr Ax2d -> IO (Ptr Dir2d)
rawMirroredAboutAx2d Ptr Dir2d
point Ptr Ax2d
axis) Ptr Dir2d -> IO ()
deleteDir2d

-- rotate/rotated

foreign import capi unsafe "hs_gp_Dir2d.h hs_gp_Dir2d_Rotate" rotate :: Ptr Dir2d -> CDouble-> IO ()

foreign import capi unsafe "hs_gp_Dir2d.h hs_gp_Dir2d_Rotated" rawRotated :: Ptr Dir2d -> CDouble -> IO (Ptr Dir2d)

rotated :: Ptr Dir2d -> Double -> Acquire (Ptr Dir2d)
rotated :: Ptr Dir2d -> Double -> Acquire (Ptr Dir2d)
rotated Ptr Dir2d
point Double
amount = IO (Ptr Dir2d) -> (Ptr Dir2d -> IO ()) -> Acquire (Ptr Dir2d)
forall a. IO a -> (a -> IO ()) -> Acquire a
mkAcquire (Ptr Dir2d -> CDouble -> IO (Ptr Dir2d)
rawRotated Ptr Dir2d
point (Double -> CDouble
CDouble Double
amount)) Ptr Dir2d -> IO ()
deleteDir2d

-- transform/transformed

foreign import capi unsafe "hs_gp_Dir2d.h hs_gp_Dir2d_Transform" transform :: Ptr Dir2d -> Ptr Trsf2d -> IO ()

foreign import capi unsafe "hs_gp_Dir2d.h hs_gp_Dir2d_Transformed" rawTransformed :: Ptr Dir2d -> Ptr Trsf2d -> IO (Ptr Dir2d)

transformed :: Ptr Dir2d -> Ptr Trsf2d -> Acquire (Ptr Dir2d)
transformed :: Ptr Dir2d -> Ptr Trsf2d -> Acquire (Ptr Dir2d)
transformed Ptr Dir2d
point Ptr Trsf2d
trsf = IO (Ptr Dir2d) -> (Ptr Dir2d -> IO ()) -> Acquire (Ptr Dir2d)
forall a. IO a -> (a -> IO ()) -> Acquire a
mkAcquire (Ptr Dir2d -> Ptr Trsf2d -> IO (Ptr Dir2d)
rawTransformed Ptr Dir2d
point Ptr Trsf2d
trsf) Ptr Dir2d -> IO ()
deleteDir2d