{-# LANGUAGE CApiFFI #-}
module OpenCascade.GP.Ax2
( Ax2
, new
, newAutoX
, location
, direction
, xDirection
, yDirection
, axis
, setLocation
, setDirection
, setXDirection
, setYDirection
, setAxis
, isCoplanar
, isCoplanarWithAx1
, mirror
, mirrored
, mirrorAboutPnt
, mirroredAboutPnt
, mirrorAboutAx1
, mirroredAboutAx1
, rotate
, rotated
, scale
, scaled
, transform
, transformed
, translate
, translated
, translateRelative
, translatedRelative
) where

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

-- new and delete

foreign import capi unsafe "hs_gp_Ax2.h hs_new_gp_Ax2" rawNew :: Ptr Pnt -> Ptr Dir -> Ptr Dir -> IO (Ptr Ax2)

new :: Ptr Pnt -> Ptr Dir -> Ptr Dir -> Acquire (Ptr Ax2)
new :: Ptr Pnt -> Ptr Dir -> Ptr Dir -> Acquire (Ptr Ax2)
new Ptr Pnt
origin Ptr Dir
vAxis Ptr Dir
vX = IO (Ptr Ax2) -> (Ptr Ax2 -> IO ()) -> Acquire (Ptr Ax2)
forall a. IO a -> (a -> IO ()) -> Acquire a
mkAcquire (Ptr Pnt -> Ptr Dir -> Ptr Dir -> IO (Ptr Ax2)
rawNew Ptr Pnt
origin Ptr Dir
vAxis Ptr Dir
vX) Ptr Ax2 -> IO ()
deleteAx2

foreign import capi unsafe "hs_gp_Ax2.h hs_new_gp_Ax2_autoX" rawNewAutoX :: Ptr Pnt -> Ptr Dir -> IO (Ptr Ax2)

newAutoX :: Ptr Pnt -> Ptr Dir -> Acquire (Ptr Ax2)
newAutoX :: Ptr Pnt -> Ptr Dir -> Acquire (Ptr Ax2)
newAutoX Ptr Pnt
origin Ptr Dir
dir = IO (Ptr Ax2) -> (Ptr Ax2 -> IO ()) -> Acquire (Ptr Ax2)
forall a. IO a -> (a -> IO ()) -> Acquire a
mkAcquire (Ptr Pnt -> Ptr Dir -> IO (Ptr Ax2)
rawNewAutoX Ptr Pnt
origin Ptr Dir
dir) Ptr Ax2 -> IO ()
deleteAx2


-- getters

foreign import capi unsafe "hs_gp_Ax2.h hs_gp_Ax2_Location" rawLocation :: Ptr Ax2 -> IO (Ptr Pnt)

location :: Ptr Ax2 -> Acquire (Ptr Pnt)
location :: Ptr Ax2 -> Acquire (Ptr Pnt)
location Ptr Ax2
ax2 = IO (Ptr Pnt) -> (Ptr Pnt -> IO ()) -> Acquire (Ptr Pnt)
forall a. IO a -> (a -> IO ()) -> Acquire a
mkAcquire (Ptr Ax2 -> IO (Ptr Pnt)
rawLocation Ptr Ax2
ax2) Ptr Pnt -> IO ()
deletePnt

foreign import capi unsafe "hs_gp_Ax2.h hs_gp_Ax2_Direction" rawDirection :: Ptr Ax2 -> IO (Ptr Dir)

direction :: Ptr Ax2 -> Acquire (Ptr Dir)
direction :: Ptr Ax2 -> Acquire (Ptr Dir)
direction Ptr Ax2
ax2 = IO (Ptr Dir) -> (Ptr Dir -> IO ()) -> Acquire (Ptr Dir)
forall a. IO a -> (a -> IO ()) -> Acquire a
mkAcquire (Ptr Ax2 -> IO (Ptr Dir)
rawDirection Ptr Ax2
ax2) Ptr Dir -> IO ()
deleteDir

foreign import capi unsafe "hs_gp_Ax2.h hs_gp_Ax2_XDirection" rawXDirection :: Ptr Ax2 -> IO (Ptr Dir)

xDirection :: Ptr Ax2 -> Acquire (Ptr Dir)
xDirection :: Ptr Ax2 -> Acquire (Ptr Dir)
xDirection Ptr Ax2
ax2 = IO (Ptr Dir) -> (Ptr Dir -> IO ()) -> Acquire (Ptr Dir)
forall a. IO a -> (a -> IO ()) -> Acquire a
mkAcquire (Ptr Ax2 -> IO (Ptr Dir)
rawXDirection Ptr Ax2
ax2) Ptr Dir -> IO ()
deleteDir

foreign import capi unsafe "hs_gp_Ax2.h hs_gp_Ax2_YDirection" rawYDirection :: Ptr Ax2 -> IO (Ptr Dir)

yDirection :: Ptr Ax2 -> Acquire (Ptr Dir)
yDirection :: Ptr Ax2 -> Acquire (Ptr Dir)
yDirection Ptr Ax2
ax2 = IO (Ptr Dir) -> (Ptr Dir -> IO ()) -> Acquire (Ptr Dir)
forall a. IO a -> (a -> IO ()) -> Acquire a
mkAcquire (Ptr Ax2 -> IO (Ptr Dir)
rawYDirection Ptr Ax2
ax2) Ptr Dir -> IO ()
deleteDir

foreign import capi unsafe "hs_gp_Ax2.h hs_gp_Ax2_Axis" rawAxis :: Ptr Ax2 -> IO (Ptr Ax1)

axis :: Ptr Ax2 -> Acquire (Ptr Ax1)
axis :: Ptr Ax2 -> Acquire (Ptr Ax1)
axis Ptr Ax2
ax2 = IO (Ptr Ax1) -> (Ptr Ax1 -> IO ()) -> Acquire (Ptr Ax1)
forall a. IO a -> (a -> IO ()) -> Acquire a
mkAcquire (Ptr Ax2 -> IO (Ptr Ax1)
rawAxis Ptr Ax2
ax2) Ptr Ax1 -> IO ()
deleteAx1

-- setters

foreign import capi unsafe "hs_gp_Ax2.h hs_gp_Ax2_SetDirection" setDirection :: Ptr Ax2 -> Ptr Dir -> IO ()

foreign import capi unsafe "hs_gp_Ax2.h hs_gp_Ax2_SetLocation" setLocation :: Ptr Ax2 -> Ptr Pnt -> IO ()

foreign import capi unsafe "hs_gp_Ax2.h hs_gp_Ax2_SetXDirection" setXDirection :: Ptr Ax2 -> Ptr Dir -> IO ()

foreign import capi unsafe "hs_gp_Ax2.h hs_gp_Ax2_SetYDirection" setYDirection :: Ptr Ax2 -> Ptr Dir -> IO ()

foreign import capi unsafe "hs_gp_Ax2.h hs_gp_Ax2_SetAxis" setAxis :: Ptr Ax2 -> Ptr Ax1 -> IO ()

-- isCoplanar

foreign import capi unsafe "hs_gp_Ax2.h hs_gp_Ax2_IsCoplanar" rawIsCoplanar :: Ptr Ax2 -> Ptr Ax2 -> CDouble -> CDouble -> IO CBool

isCoplanar :: Ptr Ax2 -> Ptr Ax2 -> Double -> Double -> IO Bool
isCoplanar :: Ptr Ax2 -> Ptr Ax2 -> Double -> Double -> IO Bool
isCoplanar Ptr Ax2
a Ptr Ax2
b Double
linearTolerance Double
angularTolerance = (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 Ax2 -> Ptr Ax2 -> CDouble -> CDouble -> IO CBool
rawIsCoplanar Ptr Ax2
a Ptr Ax2
b (Double -> CDouble
CDouble Double
linearTolerance) (Double -> CDouble
CDouble Double
angularTolerance)

foreign import capi unsafe "hs_gp_Ax2.h hs_gp_Ax2_IsCoplanarWithAx1" rawIsCoplanarWithAx1 :: Ptr Ax2 -> Ptr Ax1 -> CDouble -> CDouble -> IO CBool

isCoplanarWithAx1 :: Ptr Ax2 -> Ptr Ax1 -> Double -> Double -> IO Bool
isCoplanarWithAx1 :: Ptr Ax2 -> Ptr Ax1 -> Double -> Double -> IO Bool
isCoplanarWithAx1 Ptr Ax2
a Ptr Ax1
b Double
linearTolerance Double
angularTolerance = (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 Ax2 -> Ptr Ax1 -> CDouble -> CDouble -> IO CBool
rawIsCoplanarWithAx1 Ptr Ax2
a Ptr Ax1
b (Double -> CDouble
CDouble Double
linearTolerance) (Double -> CDouble
CDouble Double
angularTolerance)

-- mirror/mirrored

foreign import capi unsafe "hs_gp_Ax2.h hs_gp_Ax2_Mirror" mirror :: Ptr Ax2 -> Ptr Ax2 -> IO ()

foreign import capi unsafe "hs_gp_Ax2.h hs_gp_Ax2_Mirrored" rawMirrored :: Ptr Ax2 -> Ptr Ax2 -> IO (Ptr Ax2)

mirrored :: Ptr Ax2 -> Ptr Ax2 -> Acquire (Ptr Ax2)
mirrored :: Ptr Ax2 -> Ptr Ax2 -> Acquire (Ptr Ax2)
mirrored Ptr Ax2
ax Ptr Ax2
mirrorAxis = IO (Ptr Ax2) -> (Ptr Ax2 -> IO ()) -> Acquire (Ptr Ax2)
forall a. IO a -> (a -> IO ()) -> Acquire a
mkAcquire (Ptr Ax2 -> Ptr Ax2 -> IO (Ptr Ax2)
rawMirrored Ptr Ax2
ax Ptr Ax2
mirrorAxis) Ptr Ax2 -> IO ()
deleteAx2


foreign import capi unsafe "hs_gp_Ax2.h hs_gp_Ax2_MirrorAboutPnt" mirrorAboutPnt :: Ptr Ax2 -> Ptr Pnt -> IO ()

foreign import capi unsafe "hs_gp_Ax2.h hs_gp_Ax2_MirroredAboutPnt" rawMirroredAboutPnt :: Ptr Ax2 -> Ptr Pnt -> IO (Ptr Ax2)

mirroredAboutPnt :: Ptr Ax2 -> Ptr Pnt -> Acquire (Ptr Ax2)
mirroredAboutPnt :: Ptr Ax2 -> Ptr Pnt -> Acquire (Ptr Ax2)
mirroredAboutPnt Ptr Ax2
ax Ptr Pnt
mirrorAxis = IO (Ptr Ax2) -> (Ptr Ax2 -> IO ()) -> Acquire (Ptr Ax2)
forall a. IO a -> (a -> IO ()) -> Acquire a
mkAcquire (Ptr Ax2 -> Ptr Pnt -> IO (Ptr Ax2)
rawMirroredAboutPnt Ptr Ax2
ax Ptr Pnt
mirrorAxis) Ptr Ax2 -> IO ()
deleteAx2


foreign import capi unsafe "hs_gp_Ax2.h hs_gp_Ax2_MirrorAboutAx1" mirrorAboutAx1 :: Ptr Ax2 -> Ptr Ax1 -> IO ()

foreign import capi unsafe "hs_gp_Ax2.h hs_gp_Ax2_MirroredAboutAx1" rawMirroredAboutAx1 :: Ptr Ax2 -> Ptr Ax1 -> IO (Ptr Ax2)

mirroredAboutAx1 :: Ptr Ax2 -> Ptr Ax1 -> Acquire (Ptr Ax2)
mirroredAboutAx1 :: Ptr Ax2 -> Ptr Ax1 -> Acquire (Ptr Ax2)
mirroredAboutAx1 Ptr Ax2
ax Ptr Ax1
mirrorAxis = IO (Ptr Ax2) -> (Ptr Ax2 -> IO ()) -> Acquire (Ptr Ax2)
forall a. IO a -> (a -> IO ()) -> Acquire a
mkAcquire (Ptr Ax2 -> Ptr Ax1 -> IO (Ptr Ax2)
rawMirroredAboutAx1 Ptr Ax2
ax Ptr Ax1
mirrorAxis) Ptr Ax2 -> IO ()
deleteAx2


-- rotate/rotated 

foreign import capi unsafe "hs_gp_Ax2.h hs_gp_Ax2_Rotate" rawRotate :: Ptr Ax2 -> Ptr Ax1 -> CDouble -> IO ()

rotate :: Ptr Ax2 -> Ptr Ax1 -> Double -> IO ()
rotate :: Ptr Ax2 -> Ptr Ax1 -> Double -> IO ()
rotate = (Ptr Ax2 -> Ptr Ax1 -> CDouble -> IO ())
-> Ptr Ax2 -> Ptr Ax1 -> Double -> IO ()
forall a b. Coercible a b => a -> b
coerce Ptr Ax2 -> Ptr Ax1 -> CDouble -> IO ()
rawRotate

foreign import capi unsafe "hs_gp_Ax2.h hs_gp_Ax2_Rotated" rawRotated :: Ptr Ax2 -> Ptr Ax1 -> CDouble -> IO (Ptr Ax2)

rotated :: Ptr Ax2 -> Ptr Ax1 -> Double -> Acquire (Ptr Ax2)
rotated :: Ptr Ax2 -> Ptr Ax1 -> Double -> Acquire (Ptr Ax2)
rotated Ptr Ax2
ax Ptr Ax1
axisOfRotation Double
angle = IO (Ptr Ax2) -> (Ptr Ax2 -> IO ()) -> Acquire (Ptr Ax2)
forall a. IO a -> (a -> IO ()) -> Acquire a
mkAcquire (Ptr Ax2 -> Ptr Ax1 -> CDouble -> IO (Ptr Ax2)
rawRotated Ptr Ax2
ax Ptr Ax1
axisOfRotation (Double -> CDouble
CDouble Double
angle)) Ptr Ax2 -> IO ()
deleteAx2

-- scale/scaled 

foreign import capi unsafe "hs_gp_Ax2.h hs_gp_Ax2_Scale" rawScale :: Ptr Ax2 -> Ptr Pnt -> CDouble -> IO ()

scale :: Ptr Ax2 -> Ptr Pnt -> Double -> IO ()
scale :: Ptr Ax2 -> Ptr Pnt -> Double -> IO ()
scale = (Ptr Ax2 -> Ptr Pnt -> CDouble -> IO ())
-> Ptr Ax2 -> Ptr Pnt -> Double -> IO ()
forall a b. Coercible a b => a -> b
coerce Ptr Ax2 -> Ptr Pnt -> CDouble -> IO ()
rawScale

foreign import capi unsafe "hs_gp_Ax2.h hs_gp_Ax2_Scaled" rawScaled :: Ptr Ax2 -> Ptr Pnt -> CDouble -> IO (Ptr Ax2)

scaled :: Ptr Ax2 -> Ptr Pnt -> Double -> Acquire (Ptr Ax2)
scaled :: Ptr Ax2 -> Ptr Pnt -> Double -> Acquire (Ptr Ax2)
scaled Ptr Ax2
ax Ptr Pnt
origin Double
amount = IO (Ptr Ax2) -> (Ptr Ax2 -> IO ()) -> Acquire (Ptr Ax2)
forall a. IO a -> (a -> IO ()) -> Acquire a
mkAcquire (Ptr Ax2 -> Ptr Pnt -> CDouble -> IO (Ptr Ax2)
rawScaled Ptr Ax2
ax Ptr Pnt
origin (Double -> CDouble
CDouble Double
amount)) Ptr Ax2 -> IO ()
deleteAx2

-- transform/transformed 

foreign import capi unsafe "hs_gp_Ax2.h hs_gp_Ax2_Transform" transform :: Ptr Ax2 -> Ptr Trsf -> IO ()

foreign import capi unsafe "hs_gp_Ax2.h hs_gp_Ax2_Transformed" rawTransformed :: Ptr Ax2 -> Ptr Trsf -> IO (Ptr Ax2)

transformed :: Ptr Ax2 -> Ptr Trsf -> Acquire (Ptr Ax2)
transformed :: Ptr Ax2 -> Ptr Trsf -> Acquire (Ptr Ax2)
transformed Ptr Ax2
ax Ptr Trsf
trsf = IO (Ptr Ax2) -> (Ptr Ax2 -> IO ()) -> Acquire (Ptr Ax2)
forall a. IO a -> (a -> IO ()) -> Acquire a
mkAcquire (Ptr Ax2 -> Ptr Trsf -> IO (Ptr Ax2)
rawTransformed Ptr Ax2
ax Ptr Trsf
trsf) Ptr Ax2 -> IO ()
deleteAx2


-- translate/translated

foreign import capi unsafe "hs_gp_Ax2.h hs_gp_Ax2_Translate" translate :: Ptr Ax2 -> Ptr Vec -> IO ()

foreign import capi unsafe "hs_gp_Ax2.h hs_gp_Ax2_Translated" rawTranslated :: Ptr Ax2 -> Ptr Vec -> IO (Ptr Ax2)

translated :: Ptr Ax2 -> Ptr Vec -> Acquire (Ptr Ax2)
translated :: Ptr Ax2 -> Ptr Vec -> Acquire (Ptr Ax2)
translated Ptr Ax2
ax Ptr Vec
vec = IO (Ptr Ax2) -> (Ptr Ax2 -> IO ()) -> Acquire (Ptr Ax2)
forall a. IO a -> (a -> IO ()) -> Acquire a
mkAcquire (Ptr Ax2 -> Ptr Vec -> IO (Ptr Ax2)
rawTranslated Ptr Ax2
ax Ptr Vec
vec) Ptr Ax2 -> IO ()
deleteAx2


foreign import capi unsafe "hs_gp_Ax2.h hs_gp_Ax2_TranslateRelative" translateRelative :: Ptr Ax2 -> Ptr Pnt -> Ptr Pnt -> IO ()

foreign import capi unsafe "hs_gp_Ax2.h hs_gp_Ax2_TranslatedRelative" rawTranslatedRelative :: Ptr Ax2 -> Ptr Pnt -> Ptr Pnt -> IO (Ptr Ax2)

translatedRelative :: Ptr Ax2 -> Ptr Pnt -> Ptr Pnt -> Acquire (Ptr Ax2)
translatedRelative :: Ptr Ax2 -> Ptr Pnt -> Ptr Pnt -> Acquire (Ptr Ax2)
translatedRelative Ptr Ax2
ax Ptr Pnt
from Ptr Pnt
to = IO (Ptr Ax2) -> (Ptr Ax2 -> IO ()) -> Acquire (Ptr Ax2)
forall a. IO a -> (a -> IO ()) -> Acquire a
mkAcquire (Ptr Ax2 -> Ptr Pnt -> Ptr Pnt -> IO (Ptr Ax2)
rawTranslatedRelative Ptr Ax2
ax Ptr Pnt
from Ptr Pnt
to) Ptr Ax2 -> IO ()
deleteAx2