{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Graphene.Structs.Point3D
(
Point3D(..) ,
newZeroPoint3D ,
#if defined(ENABLE_OVERLOADING)
ResolvePoint3DMethod ,
#endif
point3DAlloc ,
#if defined(ENABLE_OVERLOADING)
Point3DCrossMethodInfo ,
#endif
point3DCross ,
#if defined(ENABLE_OVERLOADING)
Point3DDistanceMethodInfo ,
#endif
point3DDistance ,
#if defined(ENABLE_OVERLOADING)
Point3DDotMethodInfo ,
#endif
point3DDot ,
#if defined(ENABLE_OVERLOADING)
Point3DEqualMethodInfo ,
#endif
point3DEqual ,
#if defined(ENABLE_OVERLOADING)
Point3DFreeMethodInfo ,
#endif
point3DFree ,
#if defined(ENABLE_OVERLOADING)
Point3DInitMethodInfo ,
#endif
point3DInit ,
#if defined(ENABLE_OVERLOADING)
Point3DInitFromPointMethodInfo ,
#endif
point3DInitFromPoint ,
#if defined(ENABLE_OVERLOADING)
Point3DInitFromVec3MethodInfo ,
#endif
point3DInitFromVec3 ,
#if defined(ENABLE_OVERLOADING)
Point3DInterpolateMethodInfo ,
#endif
point3DInterpolate ,
#if defined(ENABLE_OVERLOADING)
Point3DLengthMethodInfo ,
#endif
point3DLength ,
#if defined(ENABLE_OVERLOADING)
Point3DNearMethodInfo ,
#endif
point3DNear ,
#if defined(ENABLE_OVERLOADING)
Point3DNormalizeMethodInfo ,
#endif
point3DNormalize ,
#if defined(ENABLE_OVERLOADING)
Point3DNormalizeViewportMethodInfo ,
#endif
point3DNormalizeViewport ,
#if defined(ENABLE_OVERLOADING)
Point3DScaleMethodInfo ,
#endif
point3DScale ,
#if defined(ENABLE_OVERLOADING)
Point3DToVec3MethodInfo ,
#endif
point3DToVec3 ,
point3DZero ,
getPoint3DX ,
#if defined(ENABLE_OVERLOADING)
point3D_x ,
#endif
setPoint3DX ,
getPoint3DY ,
#if defined(ENABLE_OVERLOADING)
point3D_y ,
#endif
setPoint3DY ,
getPoint3DZ ,
#if defined(ENABLE_OVERLOADING)
point3D_z ,
#endif
setPoint3DZ ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.Kind as DK
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GHC.Records as R
import {-# SOURCE #-} qualified GI.Graphene.Structs.Rect as Graphene.Rect
import {-# SOURCE #-} qualified GI.Graphene.Structs.Vec3 as Graphene.Vec3
newtype Point3D = Point3D (SP.ManagedPtr Point3D)
deriving (Point3D -> Point3D -> Bool
(Point3D -> Point3D -> Bool)
-> (Point3D -> Point3D -> Bool) -> Eq Point3D
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Point3D -> Point3D -> Bool
== :: Point3D -> Point3D -> Bool
$c/= :: Point3D -> Point3D -> Bool
/= :: Point3D -> Point3D -> Bool
Eq)
instance SP.ManagedPtrNewtype Point3D where
toManagedPtr :: Point3D -> ManagedPtr Point3D
toManagedPtr (Point3D ManagedPtr Point3D
p) = ManagedPtr Point3D
p
foreign import ccall "graphene_point3d_get_type" c_graphene_point3d_get_type ::
IO GType
type instance O.ParentTypes Point3D = '[]
instance O.HasParentTypes Point3D
instance B.Types.TypedObject Point3D where
glibType :: IO GType
glibType = IO GType
c_graphene_point3d_get_type
instance B.Types.GBoxed Point3D
instance B.GValue.IsGValue (Maybe Point3D) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_graphene_point3d_get_type
gvalueSet_ :: Ptr GValue -> Maybe Point3D -> IO ()
gvalueSet_ Ptr GValue
gv Maybe Point3D
P.Nothing = Ptr GValue -> Ptr Point3D -> IO ()
forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv (Ptr Point3D
forall a. Ptr a
FP.nullPtr :: FP.Ptr Point3D)
gvalueSet_ Ptr GValue
gv (P.Just Point3D
obj) = Point3D -> (Ptr Point3D -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Point3D
obj (Ptr GValue -> Ptr Point3D -> IO ()
forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe Point3D)
gvalueGet_ Ptr GValue
gv = do
Ptr Point3D
ptr <- Ptr GValue -> IO (Ptr Point3D)
forall b. Ptr GValue -> IO (Ptr b)
B.GValue.get_boxed Ptr GValue
gv :: IO (Ptr Point3D)
if Ptr Point3D
ptr Ptr Point3D -> Ptr Point3D -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr Point3D
forall a. Ptr a
FP.nullPtr
then Point3D -> Maybe Point3D
forall a. a -> Maybe a
P.Just (Point3D -> Maybe Point3D) -> IO Point3D -> IO (Maybe Point3D)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr Point3D -> Point3D) -> Ptr Point3D -> IO Point3D
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.newBoxed ManagedPtr Point3D -> Point3D
Point3D Ptr Point3D
ptr
else Maybe Point3D -> IO (Maybe Point3D)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Point3D
forall a. Maybe a
P.Nothing
newZeroPoint3D :: MonadIO m => m Point3D
newZeroPoint3D :: forall (m :: * -> *). MonadIO m => m Point3D
newZeroPoint3D = IO Point3D -> m Point3D
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Point3D -> m Point3D) -> IO Point3D -> m Point3D
forall a b. (a -> b) -> a -> b
$ Int -> IO (Ptr Point3D)
forall a. GBoxed a => Int -> IO (Ptr a)
callocBoxedBytes Int
12 IO (Ptr Point3D) -> (Ptr Point3D -> IO Point3D) -> IO Point3D
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (ManagedPtr Point3D -> Point3D) -> Ptr Point3D -> IO Point3D
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Point3D -> Point3D
Point3D
instance tag ~ 'AttrSet => Constructible Point3D tag where
new :: forall (m :: * -> *).
MonadIO m =>
(ManagedPtr Point3D -> Point3D)
-> [AttrOp Point3D tag] -> m Point3D
new ManagedPtr Point3D -> Point3D
_ [AttrOp Point3D tag]
attrs = do
Point3D
o <- m Point3D
forall (m :: * -> *). MonadIO m => m Point3D
newZeroPoint3D
Point3D -> [AttrOp Point3D 'AttrSet] -> m ()
forall o (m :: * -> *).
MonadIO m =>
o -> [AttrOp o 'AttrSet] -> m ()
GI.Attributes.set Point3D
o [AttrOp Point3D tag]
[AttrOp Point3D 'AttrSet]
attrs
Point3D -> m Point3D
forall a. a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return Point3D
o
getPoint3DX :: MonadIO m => Point3D -> m Float
getPoint3DX :: forall (m :: * -> *). MonadIO m => Point3D -> m Float
getPoint3DX Point3D
s = IO Float -> m Float
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Float -> m Float) -> IO Float -> m Float
forall a b. (a -> b) -> a -> b
$ Point3D -> (Ptr Point3D -> IO Float) -> IO Float
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Point3D
s ((Ptr Point3D -> IO Float) -> IO Float)
-> (Ptr Point3D -> IO Float) -> IO Float
forall a b. (a -> b) -> a -> b
$ \Ptr Point3D
ptr -> do
CFloat
val <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek (Ptr Point3D
ptr Ptr Point3D -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) :: IO CFloat
let val' :: Float
val' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
val
Float -> IO Float
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Float
val'
setPoint3DX :: MonadIO m => Point3D -> Float -> m ()
setPoint3DX :: forall (m :: * -> *). MonadIO m => Point3D -> Float -> m ()
setPoint3DX Point3D
s Float
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ Point3D -> (Ptr Point3D -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Point3D
s ((Ptr Point3D -> IO ()) -> IO ())
-> (Ptr Point3D -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Point3D
ptr -> do
let val' :: CFloat
val' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
val
Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Point3D
ptr Ptr Point3D -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) (CFloat
val' :: CFloat)
#if defined(ENABLE_OVERLOADING)
data Point3DXFieldInfo
instance AttrInfo Point3DXFieldInfo where
type AttrBaseTypeConstraint Point3DXFieldInfo = (~) Point3D
type AttrAllowedOps Point3DXFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint Point3DXFieldInfo = (~) Float
type AttrTransferTypeConstraint Point3DXFieldInfo = (~)Float
type AttrTransferType Point3DXFieldInfo = Float
type AttrGetType Point3DXFieldInfo = Float
type AttrLabel Point3DXFieldInfo = "x"
type AttrOrigin Point3DXFieldInfo = Point3D
attrGet = getPoint3DX
attrSet = setPoint3DX
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Point3D.x"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.7/docs/GI-Graphene-Structs-Point3D.html#g:attr:x"
})
point3D_x :: AttrLabelProxy "x"
point3D_x = AttrLabelProxy
#endif
getPoint3DY :: MonadIO m => Point3D -> m Float
getPoint3DY :: forall (m :: * -> *). MonadIO m => Point3D -> m Float
getPoint3DY Point3D
s = IO Float -> m Float
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Float -> m Float) -> IO Float -> m Float
forall a b. (a -> b) -> a -> b
$ Point3D -> (Ptr Point3D -> IO Float) -> IO Float
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Point3D
s ((Ptr Point3D -> IO Float) -> IO Float)
-> (Ptr Point3D -> IO Float) -> IO Float
forall a b. (a -> b) -> a -> b
$ \Ptr Point3D
ptr -> do
CFloat
val <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek (Ptr Point3D
ptr Ptr Point3D -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4) :: IO CFloat
let val' :: Float
val' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
val
Float -> IO Float
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Float
val'
setPoint3DY :: MonadIO m => Point3D -> Float -> m ()
setPoint3DY :: forall (m :: * -> *). MonadIO m => Point3D -> Float -> m ()
setPoint3DY Point3D
s Float
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ Point3D -> (Ptr Point3D -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Point3D
s ((Ptr Point3D -> IO ()) -> IO ())
-> (Ptr Point3D -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Point3D
ptr -> do
let val' :: CFloat
val' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
val
Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Point3D
ptr Ptr Point3D -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
4) (CFloat
val' :: CFloat)
#if defined(ENABLE_OVERLOADING)
data Point3DYFieldInfo
instance AttrInfo Point3DYFieldInfo where
type AttrBaseTypeConstraint Point3DYFieldInfo = (~) Point3D
type AttrAllowedOps Point3DYFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint Point3DYFieldInfo = (~) Float
type AttrTransferTypeConstraint Point3DYFieldInfo = (~)Float
type AttrTransferType Point3DYFieldInfo = Float
type AttrGetType Point3DYFieldInfo = Float
type AttrLabel Point3DYFieldInfo = "y"
type AttrOrigin Point3DYFieldInfo = Point3D
attrGet = getPoint3DY
attrSet = setPoint3DY
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Point3D.y"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.7/docs/GI-Graphene-Structs-Point3D.html#g:attr:y"
})
point3D_y :: AttrLabelProxy "y"
point3D_y = AttrLabelProxy
#endif
getPoint3DZ :: MonadIO m => Point3D -> m Float
getPoint3DZ :: forall (m :: * -> *). MonadIO m => Point3D -> m Float
getPoint3DZ Point3D
s = IO Float -> m Float
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Float -> m Float) -> IO Float -> m Float
forall a b. (a -> b) -> a -> b
$ Point3D -> (Ptr Point3D -> IO Float) -> IO Float
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Point3D
s ((Ptr Point3D -> IO Float) -> IO Float)
-> (Ptr Point3D -> IO Float) -> IO Float
forall a b. (a -> b) -> a -> b
$ \Ptr Point3D
ptr -> do
CFloat
val <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek (Ptr Point3D
ptr Ptr Point3D -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8) :: IO CFloat
let val' :: Float
val' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
val
Float -> IO Float
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Float
val'
setPoint3DZ :: MonadIO m => Point3D -> Float -> m ()
setPoint3DZ :: forall (m :: * -> *). MonadIO m => Point3D -> Float -> m ()
setPoint3DZ Point3D
s Float
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ Point3D -> (Ptr Point3D -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Point3D
s ((Ptr Point3D -> IO ()) -> IO ())
-> (Ptr Point3D -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Point3D
ptr -> do
let val' :: CFloat
val' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
val
Ptr CFloat -> CFloat -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Point3D
ptr Ptr Point3D -> Int -> Ptr CFloat
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8) (CFloat
val' :: CFloat)
#if defined(ENABLE_OVERLOADING)
data Point3DZFieldInfo
instance AttrInfo Point3DZFieldInfo where
type AttrBaseTypeConstraint Point3DZFieldInfo = (~) Point3D
type AttrAllowedOps Point3DZFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint Point3DZFieldInfo = (~) Float
type AttrTransferTypeConstraint Point3DZFieldInfo = (~)Float
type AttrTransferType Point3DZFieldInfo = Float
type AttrGetType Point3DZFieldInfo = Float
type AttrLabel Point3DZFieldInfo = "z"
type AttrOrigin Point3DZFieldInfo = Point3D
attrGet = getPoint3DZ
attrSet = setPoint3DZ
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Point3D.z"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.7/docs/GI-Graphene-Structs-Point3D.html#g:attr:z"
})
point3D_z :: AttrLabelProxy "z"
point3D_z = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Point3D
type instance O.AttributeList Point3D = Point3DAttributeList
type Point3DAttributeList = ('[ '("x", Point3DXFieldInfo), '("y", Point3DYFieldInfo), '("z", Point3DZFieldInfo)] :: [(Symbol, DK.Type)])
#endif
foreign import ccall "graphene_point3d_alloc" graphene_point3d_alloc ::
IO (Ptr Point3D)
point3DAlloc ::
(B.CallStack.HasCallStack, MonadIO m) =>
m Point3D
point3DAlloc :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m Point3D
point3DAlloc = IO Point3D -> m Point3D
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Point3D -> m Point3D) -> IO Point3D -> m Point3D
forall a b. (a -> b) -> a -> b
$ do
Ptr Point3D
result <- IO (Ptr Point3D)
graphene_point3d_alloc
Text -> Ptr Point3D -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"point3DAlloc" Ptr Point3D
result
Point3D
result' <- ((ManagedPtr Point3D -> Point3D) -> Ptr Point3D -> IO Point3D
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Point3D -> Point3D
Point3D) Ptr Point3D
result
Point3D -> IO Point3D
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Point3D
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "graphene_point3d_cross" graphene_point3d_cross ::
Ptr Point3D ->
Ptr Point3D ->
Ptr Point3D ->
IO ()
point3DCross ::
(B.CallStack.HasCallStack, MonadIO m) =>
Point3D
-> Point3D
-> m (Point3D)
point3DCross :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Point3D -> Point3D -> m Point3D
point3DCross Point3D
a Point3D
b = IO Point3D -> m Point3D
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Point3D -> m Point3D) -> IO Point3D -> m Point3D
forall a b. (a -> b) -> a -> b
$ do
Ptr Point3D
a' <- Point3D -> IO (Ptr Point3D)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Point3D
a
Ptr Point3D
b' <- Point3D -> IO (Ptr Point3D)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Point3D
b
Ptr Point3D
res <- Int -> IO (Ptr Point3D)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
12 :: IO (Ptr Point3D)
Ptr Point3D -> Ptr Point3D -> Ptr Point3D -> IO ()
graphene_point3d_cross Ptr Point3D
a' Ptr Point3D
b' Ptr Point3D
res
Point3D
res' <- ((ManagedPtr Point3D -> Point3D) -> Ptr Point3D -> IO Point3D
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Point3D -> Point3D
Point3D) Ptr Point3D
res
Point3D -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Point3D
a
Point3D -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Point3D
b
Point3D -> IO Point3D
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Point3D
res'
#if defined(ENABLE_OVERLOADING)
data Point3DCrossMethodInfo
instance (signature ~ (Point3D -> m (Point3D)), MonadIO m) => O.OverloadedMethod Point3DCrossMethodInfo Point3D signature where
overloadedMethod = point3DCross
instance O.OverloadedMethodInfo Point3DCrossMethodInfo Point3D where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Point3D.point3DCross",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.7/docs/GI-Graphene-Structs-Point3D.html#v:point3DCross"
})
#endif
foreign import ccall "graphene_point3d_distance" graphene_point3d_distance ::
Ptr Point3D ->
Ptr Point3D ->
Ptr Graphene.Vec3.Vec3 ->
IO CFloat
point3DDistance ::
(B.CallStack.HasCallStack, MonadIO m) =>
Point3D
-> Point3D
-> m ((Float, Graphene.Vec3.Vec3))
point3DDistance :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Point3D -> Point3D -> m (Float, Vec3)
point3DDistance Point3D
a Point3D
b = IO (Float, Vec3) -> m (Float, Vec3)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Float, Vec3) -> m (Float, Vec3))
-> IO (Float, Vec3) -> m (Float, Vec3)
forall a b. (a -> b) -> a -> b
$ do
Ptr Point3D
a' <- Point3D -> IO (Ptr Point3D)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Point3D
a
Ptr Point3D
b' <- Point3D -> IO (Ptr Point3D)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Point3D
b
Ptr Vec3
delta <- Int -> IO (Ptr Vec3)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
16 :: IO (Ptr Graphene.Vec3.Vec3)
CFloat
result <- Ptr Point3D -> Ptr Point3D -> Ptr Vec3 -> IO CFloat
graphene_point3d_distance Ptr Point3D
a' Ptr Point3D
b' Ptr Vec3
delta
let result' :: Float
result' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
result
Vec3
delta' <- ((ManagedPtr Vec3 -> Vec3) -> Ptr Vec3 -> IO Vec3
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Vec3 -> Vec3
Graphene.Vec3.Vec3) Ptr Vec3
delta
Point3D -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Point3D
a
Point3D -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Point3D
b
(Float, Vec3) -> IO (Float, Vec3)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Float
result', Vec3
delta')
#if defined(ENABLE_OVERLOADING)
data Point3DDistanceMethodInfo
instance (signature ~ (Point3D -> m ((Float, Graphene.Vec3.Vec3))), MonadIO m) => O.OverloadedMethod Point3DDistanceMethodInfo Point3D signature where
overloadedMethod = point3DDistance
instance O.OverloadedMethodInfo Point3DDistanceMethodInfo Point3D where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Point3D.point3DDistance",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.7/docs/GI-Graphene-Structs-Point3D.html#v:point3DDistance"
})
#endif
foreign import ccall "graphene_point3d_dot" graphene_point3d_dot ::
Ptr Point3D ->
Ptr Point3D ->
IO CFloat
point3DDot ::
(B.CallStack.HasCallStack, MonadIO m) =>
Point3D
-> Point3D
-> m Float
point3DDot :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Point3D -> Point3D -> m Float
point3DDot Point3D
a Point3D
b = IO Float -> m Float
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Float -> m Float) -> IO Float -> m Float
forall a b. (a -> b) -> a -> b
$ do
Ptr Point3D
a' <- Point3D -> IO (Ptr Point3D)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Point3D
a
Ptr Point3D
b' <- Point3D -> IO (Ptr Point3D)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Point3D
b
CFloat
result <- Ptr Point3D -> Ptr Point3D -> IO CFloat
graphene_point3d_dot Ptr Point3D
a' Ptr Point3D
b'
let result' :: Float
result' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
result
Point3D -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Point3D
a
Point3D -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Point3D
b
Float -> IO Float
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Float
result'
#if defined(ENABLE_OVERLOADING)
data Point3DDotMethodInfo
instance (signature ~ (Point3D -> m Float), MonadIO m) => O.OverloadedMethod Point3DDotMethodInfo Point3D signature where
overloadedMethod = point3DDot
instance O.OverloadedMethodInfo Point3DDotMethodInfo Point3D where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Point3D.point3DDot",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.7/docs/GI-Graphene-Structs-Point3D.html#v:point3DDot"
})
#endif
foreign import ccall "graphene_point3d_equal" graphene_point3d_equal ::
Ptr Point3D ->
Ptr Point3D ->
IO CInt
point3DEqual ::
(B.CallStack.HasCallStack, MonadIO m) =>
Point3D
-> Point3D
-> m Bool
point3DEqual :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Point3D -> Point3D -> m Bool
point3DEqual Point3D
a Point3D
b = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr Point3D
a' <- Point3D -> IO (Ptr Point3D)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Point3D
a
Ptr Point3D
b' <- Point3D -> IO (Ptr Point3D)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Point3D
b
CInt
result <- Ptr Point3D -> Ptr Point3D -> IO CInt
graphene_point3d_equal Ptr Point3D
a' Ptr Point3D
b'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Point3D -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Point3D
a
Point3D -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Point3D
b
Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data Point3DEqualMethodInfo
instance (signature ~ (Point3D -> m Bool), MonadIO m) => O.OverloadedMethod Point3DEqualMethodInfo Point3D signature where
overloadedMethod = point3DEqual
instance O.OverloadedMethodInfo Point3DEqualMethodInfo Point3D where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Point3D.point3DEqual",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.7/docs/GI-Graphene-Structs-Point3D.html#v:point3DEqual"
})
#endif
foreign import ccall "graphene_point3d_free" graphene_point3d_free ::
Ptr Point3D ->
IO ()
point3DFree ::
(B.CallStack.HasCallStack, MonadIO m) =>
Point3D
-> m ()
point3DFree :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Point3D -> m ()
point3DFree Point3D
p = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Point3D
p' <- Point3D -> IO (Ptr Point3D)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Point3D
p
Ptr Point3D -> IO ()
graphene_point3d_free Ptr Point3D
p'
Point3D -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Point3D
p
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data Point3DFreeMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod Point3DFreeMethodInfo Point3D signature where
overloadedMethod = point3DFree
instance O.OverloadedMethodInfo Point3DFreeMethodInfo Point3D where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Point3D.point3DFree",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.7/docs/GI-Graphene-Structs-Point3D.html#v:point3DFree"
})
#endif
foreign import ccall "graphene_point3d_init" graphene_point3d_init ::
Ptr Point3D ->
CFloat ->
CFloat ->
CFloat ->
IO (Ptr Point3D)
point3DInit ::
(B.CallStack.HasCallStack, MonadIO m) =>
Point3D
-> Float
-> Float
-> Float
-> m Point3D
point3DInit :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Point3D -> Float -> Float -> Float -> m Point3D
point3DInit Point3D
p Float
x Float
y Float
z = IO Point3D -> m Point3D
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Point3D -> m Point3D) -> IO Point3D -> m Point3D
forall a b. (a -> b) -> a -> b
$ do
Ptr Point3D
p' <- Point3D -> IO (Ptr Point3D)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Point3D
p
let x' :: CFloat
x' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
x
let y' :: CFloat
y' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
y
let z' :: CFloat
z' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
z
Ptr Point3D
result <- Ptr Point3D -> CFloat -> CFloat -> CFloat -> IO (Ptr Point3D)
graphene_point3d_init Ptr Point3D
p' CFloat
x' CFloat
y' CFloat
z'
Text -> Ptr Point3D -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"point3DInit" Ptr Point3D
result
Point3D
result' <- ((ManagedPtr Point3D -> Point3D) -> Ptr Point3D -> IO Point3D
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Point3D -> Point3D
Point3D) Ptr Point3D
result
Point3D -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Point3D
p
Point3D -> IO Point3D
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Point3D
result'
#if defined(ENABLE_OVERLOADING)
data Point3DInitMethodInfo
instance (signature ~ (Float -> Float -> Float -> m Point3D), MonadIO m) => O.OverloadedMethod Point3DInitMethodInfo Point3D signature where
overloadedMethod = point3DInit
instance O.OverloadedMethodInfo Point3DInitMethodInfo Point3D where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Point3D.point3DInit",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.7/docs/GI-Graphene-Structs-Point3D.html#v:point3DInit"
})
#endif
foreign import ccall "graphene_point3d_init_from_point" graphene_point3d_init_from_point ::
Ptr Point3D ->
Ptr Point3D ->
IO (Ptr Point3D)
point3DInitFromPoint ::
(B.CallStack.HasCallStack, MonadIO m) =>
Point3D
-> Point3D
-> m Point3D
point3DInitFromPoint :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Point3D -> Point3D -> m Point3D
point3DInitFromPoint Point3D
p Point3D
src = IO Point3D -> m Point3D
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Point3D -> m Point3D) -> IO Point3D -> m Point3D
forall a b. (a -> b) -> a -> b
$ do
Ptr Point3D
p' <- Point3D -> IO (Ptr Point3D)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Point3D
p
Ptr Point3D
src' <- Point3D -> IO (Ptr Point3D)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Point3D
src
Ptr Point3D
result <- Ptr Point3D -> Ptr Point3D -> IO (Ptr Point3D)
graphene_point3d_init_from_point Ptr Point3D
p' Ptr Point3D
src'
Text -> Ptr Point3D -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"point3DInitFromPoint" Ptr Point3D
result
Point3D
result' <- ((ManagedPtr Point3D -> Point3D) -> Ptr Point3D -> IO Point3D
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Point3D -> Point3D
Point3D) Ptr Point3D
result
Point3D -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Point3D
p
Point3D -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Point3D
src
Point3D -> IO Point3D
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Point3D
result'
#if defined(ENABLE_OVERLOADING)
data Point3DInitFromPointMethodInfo
instance (signature ~ (Point3D -> m Point3D), MonadIO m) => O.OverloadedMethod Point3DInitFromPointMethodInfo Point3D signature where
overloadedMethod = point3DInitFromPoint
instance O.OverloadedMethodInfo Point3DInitFromPointMethodInfo Point3D where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Point3D.point3DInitFromPoint",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.7/docs/GI-Graphene-Structs-Point3D.html#v:point3DInitFromPoint"
})
#endif
foreign import ccall "graphene_point3d_init_from_vec3" graphene_point3d_init_from_vec3 ::
Ptr Point3D ->
Ptr Graphene.Vec3.Vec3 ->
IO (Ptr Point3D)
point3DInitFromVec3 ::
(B.CallStack.HasCallStack, MonadIO m) =>
Point3D
-> Graphene.Vec3.Vec3
-> m Point3D
point3DInitFromVec3 :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Point3D -> Vec3 -> m Point3D
point3DInitFromVec3 Point3D
p Vec3
v = IO Point3D -> m Point3D
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Point3D -> m Point3D) -> IO Point3D -> m Point3D
forall a b. (a -> b) -> a -> b
$ do
Ptr Point3D
p' <- Point3D -> IO (Ptr Point3D)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Point3D
p
Ptr Vec3
v' <- Vec3 -> IO (Ptr Vec3)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Vec3
v
Ptr Point3D
result <- Ptr Point3D -> Ptr Vec3 -> IO (Ptr Point3D)
graphene_point3d_init_from_vec3 Ptr Point3D
p' Ptr Vec3
v'
Text -> Ptr Point3D -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"point3DInitFromVec3" Ptr Point3D
result
Point3D
result' <- ((ManagedPtr Point3D -> Point3D) -> Ptr Point3D -> IO Point3D
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Point3D -> Point3D
Point3D) Ptr Point3D
result
Point3D -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Point3D
p
Vec3 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Vec3
v
Point3D -> IO Point3D
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Point3D
result'
#if defined(ENABLE_OVERLOADING)
data Point3DInitFromVec3MethodInfo
instance (signature ~ (Graphene.Vec3.Vec3 -> m Point3D), MonadIO m) => O.OverloadedMethod Point3DInitFromVec3MethodInfo Point3D signature where
overloadedMethod = point3DInitFromVec3
instance O.OverloadedMethodInfo Point3DInitFromVec3MethodInfo Point3D where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Point3D.point3DInitFromVec3",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.7/docs/GI-Graphene-Structs-Point3D.html#v:point3DInitFromVec3"
})
#endif
foreign import ccall "graphene_point3d_interpolate" graphene_point3d_interpolate ::
Ptr Point3D ->
Ptr Point3D ->
CDouble ->
Ptr Point3D ->
IO ()
point3DInterpolate ::
(B.CallStack.HasCallStack, MonadIO m) =>
Point3D
-> Point3D
-> Double
-> m (Point3D)
point3DInterpolate :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Point3D -> Point3D -> Double -> m Point3D
point3DInterpolate Point3D
a Point3D
b Double
factor = IO Point3D -> m Point3D
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Point3D -> m Point3D) -> IO Point3D -> m Point3D
forall a b. (a -> b) -> a -> b
$ do
Ptr Point3D
a' <- Point3D -> IO (Ptr Point3D)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Point3D
a
Ptr Point3D
b' <- Point3D -> IO (Ptr Point3D)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Point3D
b
let factor' :: CDouble
factor' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
factor
Ptr Point3D
res <- Int -> IO (Ptr Point3D)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
12 :: IO (Ptr Point3D)
Ptr Point3D -> Ptr Point3D -> CDouble -> Ptr Point3D -> IO ()
graphene_point3d_interpolate Ptr Point3D
a' Ptr Point3D
b' CDouble
factor' Ptr Point3D
res
Point3D
res' <- ((ManagedPtr Point3D -> Point3D) -> Ptr Point3D -> IO Point3D
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Point3D -> Point3D
Point3D) Ptr Point3D
res
Point3D -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Point3D
a
Point3D -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Point3D
b
Point3D -> IO Point3D
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Point3D
res'
#if defined(ENABLE_OVERLOADING)
data Point3DInterpolateMethodInfo
instance (signature ~ (Point3D -> Double -> m (Point3D)), MonadIO m) => O.OverloadedMethod Point3DInterpolateMethodInfo Point3D signature where
overloadedMethod = point3DInterpolate
instance O.OverloadedMethodInfo Point3DInterpolateMethodInfo Point3D where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Point3D.point3DInterpolate",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.7/docs/GI-Graphene-Structs-Point3D.html#v:point3DInterpolate"
})
#endif
foreign import ccall "graphene_point3d_length" graphene_point3d_length ::
Ptr Point3D ->
IO CFloat
point3DLength ::
(B.CallStack.HasCallStack, MonadIO m) =>
Point3D
-> m Float
point3DLength :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Point3D -> m Float
point3DLength Point3D
p = IO Float -> m Float
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Float -> m Float) -> IO Float -> m Float
forall a b. (a -> b) -> a -> b
$ do
Ptr Point3D
p' <- Point3D -> IO (Ptr Point3D)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Point3D
p
CFloat
result <- Ptr Point3D -> IO CFloat
graphene_point3d_length Ptr Point3D
p'
let result' :: Float
result' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
result
Point3D -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Point3D
p
Float -> IO Float
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Float
result'
#if defined(ENABLE_OVERLOADING)
data Point3DLengthMethodInfo
instance (signature ~ (m Float), MonadIO m) => O.OverloadedMethod Point3DLengthMethodInfo Point3D signature where
overloadedMethod = point3DLength
instance O.OverloadedMethodInfo Point3DLengthMethodInfo Point3D where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Point3D.point3DLength",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.7/docs/GI-Graphene-Structs-Point3D.html#v:point3DLength"
})
#endif
foreign import ccall "graphene_point3d_near" graphene_point3d_near ::
Ptr Point3D ->
Ptr Point3D ->
CFloat ->
IO CInt
point3DNear ::
(B.CallStack.HasCallStack, MonadIO m) =>
Point3D
-> Point3D
-> Float
-> m Bool
point3DNear :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Point3D -> Point3D -> Float -> m Bool
point3DNear Point3D
a Point3D
b Float
epsilon = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr Point3D
a' <- Point3D -> IO (Ptr Point3D)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Point3D
a
Ptr Point3D
b' <- Point3D -> IO (Ptr Point3D)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Point3D
b
let epsilon' :: CFloat
epsilon' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
epsilon
CInt
result <- Ptr Point3D -> Ptr Point3D -> CFloat -> IO CInt
graphene_point3d_near Ptr Point3D
a' Ptr Point3D
b' CFloat
epsilon'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Point3D -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Point3D
a
Point3D -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Point3D
b
Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data Point3DNearMethodInfo
instance (signature ~ (Point3D -> Float -> m Bool), MonadIO m) => O.OverloadedMethod Point3DNearMethodInfo Point3D signature where
overloadedMethod = point3DNear
instance O.OverloadedMethodInfo Point3DNearMethodInfo Point3D where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Point3D.point3DNear",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.7/docs/GI-Graphene-Structs-Point3D.html#v:point3DNear"
})
#endif
foreign import ccall "graphene_point3d_normalize" graphene_point3d_normalize ::
Ptr Point3D ->
Ptr Point3D ->
IO ()
point3DNormalize ::
(B.CallStack.HasCallStack, MonadIO m) =>
Point3D
-> m (Point3D)
point3DNormalize :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Point3D -> m Point3D
point3DNormalize Point3D
p = IO Point3D -> m Point3D
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Point3D -> m Point3D) -> IO Point3D -> m Point3D
forall a b. (a -> b) -> a -> b
$ do
Ptr Point3D
p' <- Point3D -> IO (Ptr Point3D)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Point3D
p
Ptr Point3D
res <- Int -> IO (Ptr Point3D)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
12 :: IO (Ptr Point3D)
Ptr Point3D -> Ptr Point3D -> IO ()
graphene_point3d_normalize Ptr Point3D
p' Ptr Point3D
res
Point3D
res' <- ((ManagedPtr Point3D -> Point3D) -> Ptr Point3D -> IO Point3D
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Point3D -> Point3D
Point3D) Ptr Point3D
res
Point3D -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Point3D
p
Point3D -> IO Point3D
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Point3D
res'
#if defined(ENABLE_OVERLOADING)
data Point3DNormalizeMethodInfo
instance (signature ~ (m (Point3D)), MonadIO m) => O.OverloadedMethod Point3DNormalizeMethodInfo Point3D signature where
overloadedMethod = point3DNormalize
instance O.OverloadedMethodInfo Point3DNormalizeMethodInfo Point3D where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Point3D.point3DNormalize",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.7/docs/GI-Graphene-Structs-Point3D.html#v:point3DNormalize"
})
#endif
foreign import ccall "graphene_point3d_normalize_viewport" graphene_point3d_normalize_viewport ::
Ptr Point3D ->
Ptr Graphene.Rect.Rect ->
CFloat ->
CFloat ->
Ptr Point3D ->
IO ()
point3DNormalizeViewport ::
(B.CallStack.HasCallStack, MonadIO m) =>
Point3D
-> Graphene.Rect.Rect
-> Float
-> Float
-> m (Point3D)
point3DNormalizeViewport :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Point3D -> Rect -> Float -> Float -> m Point3D
point3DNormalizeViewport Point3D
p Rect
viewport Float
zNear Float
zFar = IO Point3D -> m Point3D
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Point3D -> m Point3D) -> IO Point3D -> m Point3D
forall a b. (a -> b) -> a -> b
$ do
Ptr Point3D
p' <- Point3D -> IO (Ptr Point3D)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Point3D
p
Ptr Rect
viewport' <- Rect -> IO (Ptr Rect)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Rect
viewport
let zNear' :: CFloat
zNear' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
zNear
let zFar' :: CFloat
zFar' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
zFar
Ptr Point3D
res <- Int -> IO (Ptr Point3D)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
12 :: IO (Ptr Point3D)
Ptr Point3D -> Ptr Rect -> CFloat -> CFloat -> Ptr Point3D -> IO ()
graphene_point3d_normalize_viewport Ptr Point3D
p' Ptr Rect
viewport' CFloat
zNear' CFloat
zFar' Ptr Point3D
res
Point3D
res' <- ((ManagedPtr Point3D -> Point3D) -> Ptr Point3D -> IO Point3D
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Point3D -> Point3D
Point3D) Ptr Point3D
res
Point3D -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Point3D
p
Rect -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Rect
viewport
Point3D -> IO Point3D
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Point3D
res'
#if defined(ENABLE_OVERLOADING)
data Point3DNormalizeViewportMethodInfo
instance (signature ~ (Graphene.Rect.Rect -> Float -> Float -> m (Point3D)), MonadIO m) => O.OverloadedMethod Point3DNormalizeViewportMethodInfo Point3D signature where
overloadedMethod = point3DNormalizeViewport
instance O.OverloadedMethodInfo Point3DNormalizeViewportMethodInfo Point3D where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Point3D.point3DNormalizeViewport",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.7/docs/GI-Graphene-Structs-Point3D.html#v:point3DNormalizeViewport"
})
#endif
foreign import ccall "graphene_point3d_scale" graphene_point3d_scale ::
Ptr Point3D ->
CFloat ->
Ptr Point3D ->
IO ()
point3DScale ::
(B.CallStack.HasCallStack, MonadIO m) =>
Point3D
-> Float
-> m (Point3D)
point3DScale :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Point3D -> Float -> m Point3D
point3DScale Point3D
p Float
factor = IO Point3D -> m Point3D
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Point3D -> m Point3D) -> IO Point3D -> m Point3D
forall a b. (a -> b) -> a -> b
$ do
Ptr Point3D
p' <- Point3D -> IO (Ptr Point3D)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Point3D
p
let factor' :: CFloat
factor' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
factor
Ptr Point3D
res <- Int -> IO (Ptr Point3D)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
12 :: IO (Ptr Point3D)
Ptr Point3D -> CFloat -> Ptr Point3D -> IO ()
graphene_point3d_scale Ptr Point3D
p' CFloat
factor' Ptr Point3D
res
Point3D
res' <- ((ManagedPtr Point3D -> Point3D) -> Ptr Point3D -> IO Point3D
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Point3D -> Point3D
Point3D) Ptr Point3D
res
Point3D -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Point3D
p
Point3D -> IO Point3D
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Point3D
res'
#if defined(ENABLE_OVERLOADING)
data Point3DScaleMethodInfo
instance (signature ~ (Float -> m (Point3D)), MonadIO m) => O.OverloadedMethod Point3DScaleMethodInfo Point3D signature where
overloadedMethod = point3DScale
instance O.OverloadedMethodInfo Point3DScaleMethodInfo Point3D where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Point3D.point3DScale",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.7/docs/GI-Graphene-Structs-Point3D.html#v:point3DScale"
})
#endif
foreign import ccall "graphene_point3d_to_vec3" graphene_point3d_to_vec3 ::
Ptr Point3D ->
Ptr Graphene.Vec3.Vec3 ->
IO ()
point3DToVec3 ::
(B.CallStack.HasCallStack, MonadIO m) =>
Point3D
-> m (Graphene.Vec3.Vec3)
point3DToVec3 :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Point3D -> m Vec3
point3DToVec3 Point3D
p = IO Vec3 -> m Vec3
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Vec3 -> m Vec3) -> IO Vec3 -> m Vec3
forall a b. (a -> b) -> a -> b
$ do
Ptr Point3D
p' <- Point3D -> IO (Ptr Point3D)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Point3D
p
Ptr Vec3
v <- Int -> IO (Ptr Vec3)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
16 :: IO (Ptr Graphene.Vec3.Vec3)
Ptr Point3D -> Ptr Vec3 -> IO ()
graphene_point3d_to_vec3 Ptr Point3D
p' Ptr Vec3
v
Vec3
v' <- ((ManagedPtr Vec3 -> Vec3) -> Ptr Vec3 -> IO Vec3
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Vec3 -> Vec3
Graphene.Vec3.Vec3) Ptr Vec3
v
Point3D -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Point3D
p
Vec3 -> IO Vec3
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Vec3
v'
#if defined(ENABLE_OVERLOADING)
data Point3DToVec3MethodInfo
instance (signature ~ (m (Graphene.Vec3.Vec3)), MonadIO m) => O.OverloadedMethod Point3DToVec3MethodInfo Point3D signature where
overloadedMethod = point3DToVec3
instance O.OverloadedMethodInfo Point3DToVec3MethodInfo Point3D where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Graphene.Structs.Point3D.point3DToVec3",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.7/docs/GI-Graphene-Structs-Point3D.html#v:point3DToVec3"
})
#endif
foreign import ccall "graphene_point3d_zero" graphene_point3d_zero ::
IO (Ptr Point3D)
point3DZero ::
(B.CallStack.HasCallStack, MonadIO m) =>
m Point3D
point3DZero :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m Point3D
point3DZero = IO Point3D -> m Point3D
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Point3D -> m Point3D) -> IO Point3D -> m Point3D
forall a b. (a -> b) -> a -> b
$ do
Ptr Point3D
result <- IO (Ptr Point3D)
graphene_point3d_zero
Text -> Ptr Point3D -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"point3DZero" Ptr Point3D
result
Point3D
result' <- ((ManagedPtr Point3D -> Point3D) -> Ptr Point3D -> IO Point3D
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Point3D -> Point3D
Point3D) Ptr Point3D
result
Point3D -> IO Point3D
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Point3D
result'
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolvePoint3DMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolvePoint3DMethod "cross" o = Point3DCrossMethodInfo
ResolvePoint3DMethod "distance" o = Point3DDistanceMethodInfo
ResolvePoint3DMethod "dot" o = Point3DDotMethodInfo
ResolvePoint3DMethod "equal" o = Point3DEqualMethodInfo
ResolvePoint3DMethod "free" o = Point3DFreeMethodInfo
ResolvePoint3DMethod "init" o = Point3DInitMethodInfo
ResolvePoint3DMethod "initFromPoint" o = Point3DInitFromPointMethodInfo
ResolvePoint3DMethod "initFromVec3" o = Point3DInitFromVec3MethodInfo
ResolvePoint3DMethod "interpolate" o = Point3DInterpolateMethodInfo
ResolvePoint3DMethod "length" o = Point3DLengthMethodInfo
ResolvePoint3DMethod "near" o = Point3DNearMethodInfo
ResolvePoint3DMethod "normalize" o = Point3DNormalizeMethodInfo
ResolvePoint3DMethod "normalizeViewport" o = Point3DNormalizeViewportMethodInfo
ResolvePoint3DMethod "scale" o = Point3DScaleMethodInfo
ResolvePoint3DMethod "toVec3" o = Point3DToVec3MethodInfo
ResolvePoint3DMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolvePoint3DMethod t Point3D, O.OverloadedMethod info Point3D p) => OL.IsLabel t (Point3D -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolvePoint3DMethod t Point3D, O.OverloadedMethod info Point3D p, R.HasField t Point3D p) => R.HasField t Point3D p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolvePoint3DMethod t Point3D, O.OverloadedMethodInfo info Point3D) => OL.IsLabel t (O.MethodProxy info Point3D) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif