{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson and Iñaki García Etxebarria
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- A sphere, represented by its center and radius.
-- 
-- /Since: 1.2/

#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif

module GI.Graphene.Structs.Sphere
    ( 

-- * Exported types
    Sphere(..)                              ,
    newZeroSphere                           ,


 -- * Methods
-- | 
-- 
--  === __Click to display all available methods, including inherited ones__
-- ==== Methods
-- [containsPoint]("GI.Graphene.Structs.Sphere#g:method:containsPoint"), [distance]("GI.Graphene.Structs.Sphere#g:method:distance"), [equal]("GI.Graphene.Structs.Sphere#g:method:equal"), [free]("GI.Graphene.Structs.Sphere#g:method:free"), [init]("GI.Graphene.Structs.Sphere#g:method:init"), [initFromPoints]("GI.Graphene.Structs.Sphere#g:method:initFromPoints"), [initFromVectors]("GI.Graphene.Structs.Sphere#g:method:initFromVectors"), [isEmpty]("GI.Graphene.Structs.Sphere#g:method:isEmpty"), [translate]("GI.Graphene.Structs.Sphere#g:method:translate").
-- 
-- ==== Getters
-- [getBoundingBox]("GI.Graphene.Structs.Sphere#g:method:getBoundingBox"), [getCenter]("GI.Graphene.Structs.Sphere#g:method:getCenter"), [getRadius]("GI.Graphene.Structs.Sphere#g:method:getRadius").
-- 
-- ==== Setters
-- /None/.

#if defined(ENABLE_OVERLOADING)
    ResolveSphereMethod                     ,
#endif

-- ** alloc #method:alloc#

    sphereAlloc                             ,


-- ** containsPoint #method:containsPoint#

#if defined(ENABLE_OVERLOADING)
    SphereContainsPointMethodInfo           ,
#endif
    sphereContainsPoint                     ,


-- ** distance #method:distance#

#if defined(ENABLE_OVERLOADING)
    SphereDistanceMethodInfo                ,
#endif
    sphereDistance                          ,


-- ** equal #method:equal#

#if defined(ENABLE_OVERLOADING)
    SphereEqualMethodInfo                   ,
#endif
    sphereEqual                             ,


-- ** free #method:free#

#if defined(ENABLE_OVERLOADING)
    SphereFreeMethodInfo                    ,
#endif
    sphereFree                              ,


-- ** getBoundingBox #method:getBoundingBox#

#if defined(ENABLE_OVERLOADING)
    SphereGetBoundingBoxMethodInfo          ,
#endif
    sphereGetBoundingBox                    ,


-- ** getCenter #method:getCenter#

#if defined(ENABLE_OVERLOADING)
    SphereGetCenterMethodInfo               ,
#endif
    sphereGetCenter                         ,


-- ** getRadius #method:getRadius#

#if defined(ENABLE_OVERLOADING)
    SphereGetRadiusMethodInfo               ,
#endif
    sphereGetRadius                         ,


-- ** init #method:init#

#if defined(ENABLE_OVERLOADING)
    SphereInitMethodInfo                    ,
#endif
    sphereInit                              ,


-- ** initFromPoints #method:initFromPoints#

#if defined(ENABLE_OVERLOADING)
    SphereInitFromPointsMethodInfo          ,
#endif
    sphereInitFromPoints                    ,


-- ** initFromVectors #method:initFromVectors#

#if defined(ENABLE_OVERLOADING)
    SphereInitFromVectorsMethodInfo         ,
#endif
    sphereInitFromVectors                   ,


-- ** isEmpty #method:isEmpty#

#if defined(ENABLE_OVERLOADING)
    SphereIsEmptyMethodInfo                 ,
#endif
    sphereIsEmpty                           ,


-- ** translate #method:translate#

#if defined(ENABLE_OVERLOADING)
    SphereTranslateMethodInfo               ,
#endif
    sphereTranslate                         ,




    ) 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.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.Box as Graphene.Box
import {-# SOURCE #-} qualified GI.Graphene.Structs.Point3D as Graphene.Point3D
import {-# SOURCE #-} qualified GI.Graphene.Structs.Vec3 as Graphene.Vec3

-- | Memory-managed wrapper type.
newtype Sphere = Sphere (SP.ManagedPtr Sphere)
    deriving (Sphere -> Sphere -> Bool
(Sphere -> Sphere -> Bool)
-> (Sphere -> Sphere -> Bool) -> Eq Sphere
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Sphere -> Sphere -> Bool
== :: Sphere -> Sphere -> Bool
$c/= :: Sphere -> Sphere -> Bool
/= :: Sphere -> Sphere -> Bool
Eq)

instance SP.ManagedPtrNewtype Sphere where
    toManagedPtr :: Sphere -> ManagedPtr Sphere
toManagedPtr (Sphere ManagedPtr Sphere
p) = ManagedPtr Sphere
p

foreign import ccall "graphene_sphere_get_type" c_graphene_sphere_get_type :: 
    IO GType

type instance O.ParentTypes Sphere = '[]
instance O.HasParentTypes Sphere

instance B.Types.TypedObject Sphere where
    glibType :: IO GType
glibType = IO GType
c_graphene_sphere_get_type

instance B.Types.GBoxed Sphere

-- | Convert 'Sphere' to and from 'Data.GI.Base.GValue.GValue'. See 'Data.GI.Base.GValue.toGValue' and 'Data.GI.Base.GValue.fromGValue'.
instance B.GValue.IsGValue (Maybe Sphere) where
    gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_graphene_sphere_get_type
    gvalueSet_ :: Ptr GValue -> Maybe Sphere -> IO ()
gvalueSet_ Ptr GValue
gv Maybe Sphere
P.Nothing = Ptr GValue -> Ptr Sphere -> IO ()
forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv (Ptr Sphere
forall a. Ptr a
FP.nullPtr :: FP.Ptr Sphere)
    gvalueSet_ Ptr GValue
gv (P.Just Sphere
obj) = Sphere -> (Ptr Sphere -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Sphere
obj (Ptr GValue -> Ptr Sphere -> IO ()
forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv)
    gvalueGet_ :: Ptr GValue -> IO (Maybe Sphere)
gvalueGet_ Ptr GValue
gv = do
        Ptr Sphere
ptr <- Ptr GValue -> IO (Ptr Sphere)
forall b. Ptr GValue -> IO (Ptr b)
B.GValue.get_boxed Ptr GValue
gv :: IO (Ptr Sphere)
        if Ptr Sphere
ptr Ptr Sphere -> Ptr Sphere -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr Sphere
forall a. Ptr a
FP.nullPtr
        then Sphere -> Maybe Sphere
forall a. a -> Maybe a
P.Just (Sphere -> Maybe Sphere) -> IO Sphere -> IO (Maybe Sphere)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr Sphere -> Sphere) -> Ptr Sphere -> IO Sphere
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.newBoxed ManagedPtr Sphere -> Sphere
Sphere Ptr Sphere
ptr
        else Maybe Sphere -> IO (Maybe Sphere)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Sphere
forall a. Maybe a
P.Nothing
        
    

-- | Construct a `Sphere` struct initialized to zero.
newZeroSphere :: MonadIO m => m Sphere
newZeroSphere :: forall (m :: * -> *). MonadIO m => m Sphere
newZeroSphere = IO Sphere -> m Sphere
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Sphere -> m Sphere) -> IO Sphere -> m Sphere
forall a b. (a -> b) -> a -> b
$ Int -> IO (Ptr Sphere)
forall a. GBoxed a => Int -> IO (Ptr a)
callocBoxedBytes Int
20 IO (Ptr Sphere) -> (Ptr Sphere -> IO Sphere) -> IO Sphere
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (ManagedPtr Sphere -> Sphere) -> Ptr Sphere -> IO Sphere
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Sphere -> Sphere
Sphere

instance tag ~ 'AttrSet => Constructible Sphere tag where
    new :: forall (m :: * -> *).
MonadIO m =>
(ManagedPtr Sphere -> Sphere) -> [AttrOp Sphere tag] -> m Sphere
new ManagedPtr Sphere -> Sphere
_ [AttrOp Sphere tag]
attrs = do
        Sphere
o <- m Sphere
forall (m :: * -> *). MonadIO m => m Sphere
newZeroSphere
        Sphere -> [AttrOp Sphere 'AttrSet] -> m ()
forall o (m :: * -> *).
MonadIO m =>
o -> [AttrOp o 'AttrSet] -> m ()
GI.Attributes.set Sphere
o [AttrOp Sphere tag]
[AttrOp Sphere 'AttrSet]
attrs
        Sphere -> m Sphere
forall a. a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return Sphere
o



#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Sphere
type instance O.AttributeList Sphere = SphereAttributeList
type SphereAttributeList = ('[ ] :: [(Symbol, *)])
#endif

-- method Sphere::alloc
-- method type : Constructor
-- Args: []
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Graphene" , name = "Sphere" })
-- throws : False
-- Skip return : False

foreign import ccall "graphene_sphere_alloc" graphene_sphere_alloc :: 
    IO (Ptr Sphere)

-- | Allocates a new t'GI.Graphene.Structs.Sphere.Sphere'.
-- 
-- The contents of the newly allocated structure are undefined.
-- 
-- /Since: 1.2/
sphereAlloc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m Sphere
    -- ^ __Returns:__ the newly allocated t'GI.Graphene.Structs.Sphere.Sphere'. Use
    --   'GI.Graphene.Structs.Sphere.sphereFree' to free the resources allocated by this function
sphereAlloc :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m Sphere
sphereAlloc  = IO Sphere -> m Sphere
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Sphere -> m Sphere) -> IO Sphere -> m Sphere
forall a b. (a -> b) -> a -> b
$ do
    Ptr Sphere
result <- IO (Ptr Sphere)
graphene_sphere_alloc
    Text -> Ptr Sphere -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"sphereAlloc" Ptr Sphere
result
    Sphere
result' <- ((ManagedPtr Sphere -> Sphere) -> Ptr Sphere -> IO Sphere
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Sphere -> Sphere
Sphere) Ptr Sphere
result
    Sphere -> IO Sphere
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Sphere
result'

#if defined(ENABLE_OVERLOADING)
#endif

-- method Sphere::contains_point
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "s"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Sphere" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #graphene_sphere_t"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "point"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Point3D" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #graphene_point3d_t"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "graphene_sphere_contains_point" graphene_sphere_contains_point :: 
    Ptr Sphere ->                           -- s : TInterface (Name {namespace = "Graphene", name = "Sphere"})
    Ptr Graphene.Point3D.Point3D ->         -- point : TInterface (Name {namespace = "Graphene", name = "Point3D"})
    IO CInt

-- | Checks whether the given /@point@/ is contained in the volume
-- of a t'GI.Graphene.Structs.Sphere.Sphere'.
-- 
-- /Since: 1.2/
sphereContainsPoint ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Sphere
    -- ^ /@s@/: a t'GI.Graphene.Structs.Sphere.Sphere'
    -> Graphene.Point3D.Point3D
    -- ^ /@point@/: a t'GI.Graphene.Structs.Point3D.Point3D'
    -> m Bool
    -- ^ __Returns:__ @true@ if the sphere contains the point
sphereContainsPoint :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Sphere -> Point3D -> m Bool
sphereContainsPoint Sphere
s Point3D
point = 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 Sphere
s' <- Sphere -> IO (Ptr Sphere)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Sphere
s
    Ptr Point3D
point' <- Point3D -> IO (Ptr Point3D)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Point3D
point
    CInt
result <- Ptr Sphere -> Ptr Point3D -> IO CInt
graphene_sphere_contains_point Ptr Sphere
s' Ptr Point3D
point'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    Sphere -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Sphere
s
    Point3D -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Point3D
point
    Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data SphereContainsPointMethodInfo
instance (signature ~ (Graphene.Point3D.Point3D -> m Bool), MonadIO m) => O.OverloadedMethod SphereContainsPointMethodInfo Sphere signature where
    overloadedMethod = sphereContainsPoint

instance O.OverloadedMethodInfo SphereContainsPointMethodInfo Sphere where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Graphene.Structs.Sphere.sphereContainsPoint",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Sphere.html#v:sphereContainsPoint"
        })


#endif

-- method Sphere::distance
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "s"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Sphere" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #graphene_sphere_t"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "point"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Point3D" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #graphene_point3d_t"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TFloat)
-- throws : False
-- Skip return : False

foreign import ccall "graphene_sphere_distance" graphene_sphere_distance :: 
    Ptr Sphere ->                           -- s : TInterface (Name {namespace = "Graphene", name = "Sphere"})
    Ptr Graphene.Point3D.Point3D ->         -- point : TInterface (Name {namespace = "Graphene", name = "Point3D"})
    IO CFloat

-- | Computes the distance of the given /@point@/ from the surface of
-- a t'GI.Graphene.Structs.Sphere.Sphere'.
-- 
-- /Since: 1.2/
sphereDistance ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Sphere
    -- ^ /@s@/: a t'GI.Graphene.Structs.Sphere.Sphere'
    -> Graphene.Point3D.Point3D
    -- ^ /@point@/: a t'GI.Graphene.Structs.Point3D.Point3D'
    -> m Float
    -- ^ __Returns:__ the distance of the point
sphereDistance :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Sphere -> Point3D -> m Float
sphereDistance Sphere
s Point3D
point = 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 Sphere
s' <- Sphere -> IO (Ptr Sphere)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Sphere
s
    Ptr Point3D
point' <- Point3D -> IO (Ptr Point3D)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Point3D
point
    CFloat
result <- Ptr Sphere -> Ptr Point3D -> IO CFloat
graphene_sphere_distance Ptr Sphere
s' Ptr Point3D
point'
    let result' :: Float
result' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
result
    Sphere -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Sphere
s
    Point3D -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Point3D
point
    Float -> IO Float
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Float
result'

#if defined(ENABLE_OVERLOADING)
data SphereDistanceMethodInfo
instance (signature ~ (Graphene.Point3D.Point3D -> m Float), MonadIO m) => O.OverloadedMethod SphereDistanceMethodInfo Sphere signature where
    overloadedMethod = sphereDistance

instance O.OverloadedMethodInfo SphereDistanceMethodInfo Sphere where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Graphene.Structs.Sphere.sphereDistance",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Sphere.html#v:sphereDistance"
        })


#endif

-- method Sphere::equal
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "a"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Sphere" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #graphene_sphere_t"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "b"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Sphere" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #graphene_sphere_t"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "graphene_sphere_equal" graphene_sphere_equal :: 
    Ptr Sphere ->                           -- a : TInterface (Name {namespace = "Graphene", name = "Sphere"})
    Ptr Sphere ->                           -- b : TInterface (Name {namespace = "Graphene", name = "Sphere"})
    IO CInt

-- | Checks whether two t'GI.Graphene.Structs.Sphere.Sphere' are equal.
-- 
-- /Since: 1.2/
sphereEqual ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Sphere
    -- ^ /@a@/: a t'GI.Graphene.Structs.Sphere.Sphere'
    -> Sphere
    -- ^ /@b@/: a t'GI.Graphene.Structs.Sphere.Sphere'
    -> m Bool
    -- ^ __Returns:__ @true@ if the spheres are equal
sphereEqual :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Sphere -> Sphere -> m Bool
sphereEqual Sphere
a Sphere
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 Sphere
a' <- Sphere -> IO (Ptr Sphere)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Sphere
a
    Ptr Sphere
b' <- Sphere -> IO (Ptr Sphere)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Sphere
b
    CInt
result <- Ptr Sphere -> Ptr Sphere -> IO CInt
graphene_sphere_equal Ptr Sphere
a' Ptr Sphere
b'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    Sphere -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Sphere
a
    Sphere -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Sphere
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 SphereEqualMethodInfo
instance (signature ~ (Sphere -> m Bool), MonadIO m) => O.OverloadedMethod SphereEqualMethodInfo Sphere signature where
    overloadedMethod = sphereEqual

instance O.OverloadedMethodInfo SphereEqualMethodInfo Sphere where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Graphene.Structs.Sphere.sphereEqual",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Sphere.html#v:sphereEqual"
        })


#endif

-- method Sphere::free
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "s"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Sphere" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #graphene_sphere_t"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "graphene_sphere_free" graphene_sphere_free :: 
    Ptr Sphere ->                           -- s : TInterface (Name {namespace = "Graphene", name = "Sphere"})
    IO ()

-- | Frees the resources allocated by 'GI.Graphene.Structs.Sphere.sphereAlloc'.
-- 
-- /Since: 1.2/
sphereFree ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Sphere
    -- ^ /@s@/: a t'GI.Graphene.Structs.Sphere.Sphere'
    -> m ()
sphereFree :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Sphere -> m ()
sphereFree Sphere
s = 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 Sphere
s' <- Sphere -> IO (Ptr Sphere)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Sphere
s
    Ptr Sphere -> IO ()
graphene_sphere_free Ptr Sphere
s'
    Sphere -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Sphere
s
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SphereFreeMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod SphereFreeMethodInfo Sphere signature where
    overloadedMethod = sphereFree

instance O.OverloadedMethodInfo SphereFreeMethodInfo Sphere where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Graphene.Structs.Sphere.sphereFree",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Sphere.html#v:sphereFree"
        })


#endif

-- method Sphere::get_bounding_box
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "s"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Sphere" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #graphene_sphere_t"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "box"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Box" }
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "return location for the bounding box"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = True
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "graphene_sphere_get_bounding_box" graphene_sphere_get_bounding_box :: 
    Ptr Sphere ->                           -- s : TInterface (Name {namespace = "Graphene", name = "Sphere"})
    Ptr Graphene.Box.Box ->                 -- box : TInterface (Name {namespace = "Graphene", name = "Box"})
    IO ()

-- | Computes the bounding box capable of containing the
-- given t'GI.Graphene.Structs.Sphere.Sphere'.
-- 
-- /Since: 1.2/
sphereGetBoundingBox ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Sphere
    -- ^ /@s@/: a t'GI.Graphene.Structs.Sphere.Sphere'
    -> m (Graphene.Box.Box)
sphereGetBoundingBox :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Sphere -> m Box
sphereGetBoundingBox Sphere
s = IO Box -> m Box
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Box -> m Box) -> IO Box -> m Box
forall a b. (a -> b) -> a -> b
$ do
    Ptr Sphere
s' <- Sphere -> IO (Ptr Sphere)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Sphere
s
    Ptr Box
box <- Int -> IO (Ptr Box)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
32 :: IO (Ptr Graphene.Box.Box)
    Ptr Sphere -> Ptr Box -> IO ()
graphene_sphere_get_bounding_box Ptr Sphere
s' Ptr Box
box
    Box
box' <- ((ManagedPtr Box -> Box) -> Ptr Box -> IO Box
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Box -> Box
Graphene.Box.Box) Ptr Box
box
    Sphere -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Sphere
s
    Box -> IO Box
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Box
box'

#if defined(ENABLE_OVERLOADING)
data SphereGetBoundingBoxMethodInfo
instance (signature ~ (m (Graphene.Box.Box)), MonadIO m) => O.OverloadedMethod SphereGetBoundingBoxMethodInfo Sphere signature where
    overloadedMethod = sphereGetBoundingBox

instance O.OverloadedMethodInfo SphereGetBoundingBoxMethodInfo Sphere where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Graphene.Structs.Sphere.sphereGetBoundingBox",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Sphere.html#v:sphereGetBoundingBox"
        })


#endif

-- method Sphere::get_center
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "s"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Sphere" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #graphene_sphere_t"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "center"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Point3D" }
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "return location for the coordinates of\n  the center"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = True
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "graphene_sphere_get_center" graphene_sphere_get_center :: 
    Ptr Sphere ->                           -- s : TInterface (Name {namespace = "Graphene", name = "Sphere"})
    Ptr Graphene.Point3D.Point3D ->         -- center : TInterface (Name {namespace = "Graphene", name = "Point3D"})
    IO ()

-- | Retrieves the coordinates of the center of a t'GI.Graphene.Structs.Sphere.Sphere'.
-- 
-- /Since: 1.2/
sphereGetCenter ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Sphere
    -- ^ /@s@/: a t'GI.Graphene.Structs.Sphere.Sphere'
    -> m (Graphene.Point3D.Point3D)
sphereGetCenter :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Sphere -> m Point3D
sphereGetCenter Sphere
s = 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 Sphere
s' <- Sphere -> IO (Ptr Sphere)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Sphere
s
    Ptr Point3D
center <- Int -> IO (Ptr Point3D)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
12 :: IO (Ptr Graphene.Point3D.Point3D)
    Ptr Sphere -> Ptr Point3D -> IO ()
graphene_sphere_get_center Ptr Sphere
s' Ptr Point3D
center
    Point3D
center' <- ((ManagedPtr Point3D -> Point3D) -> Ptr Point3D -> IO Point3D
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Point3D -> Point3D
Graphene.Point3D.Point3D) Ptr Point3D
center
    Sphere -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Sphere
s
    Point3D -> IO Point3D
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Point3D
center'

#if defined(ENABLE_OVERLOADING)
data SphereGetCenterMethodInfo
instance (signature ~ (m (Graphene.Point3D.Point3D)), MonadIO m) => O.OverloadedMethod SphereGetCenterMethodInfo Sphere signature where
    overloadedMethod = sphereGetCenter

instance O.OverloadedMethodInfo SphereGetCenterMethodInfo Sphere where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Graphene.Structs.Sphere.sphereGetCenter",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Sphere.html#v:sphereGetCenter"
        })


#endif

-- method Sphere::get_radius
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "s"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Sphere" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #graphene_sphere_t"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TFloat)
-- throws : False
-- Skip return : False

foreign import ccall "graphene_sphere_get_radius" graphene_sphere_get_radius :: 
    Ptr Sphere ->                           -- s : TInterface (Name {namespace = "Graphene", name = "Sphere"})
    IO CFloat

-- | Retrieves the radius of a t'GI.Graphene.Structs.Sphere.Sphere'.
-- 
-- /Since: 1.2/
sphereGetRadius ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Sphere
    -- ^ /@s@/: a t'GI.Graphene.Structs.Sphere.Sphere'
    -> m Float
sphereGetRadius :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Sphere -> m Float
sphereGetRadius Sphere
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
$ do
    Ptr Sphere
s' <- Sphere -> IO (Ptr Sphere)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Sphere
s
    CFloat
result <- Ptr Sphere -> IO CFloat
graphene_sphere_get_radius Ptr Sphere
s'
    let result' :: Float
result' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
result
    Sphere -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Sphere
s
    Float -> IO Float
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Float
result'

#if defined(ENABLE_OVERLOADING)
data SphereGetRadiusMethodInfo
instance (signature ~ (m Float), MonadIO m) => O.OverloadedMethod SphereGetRadiusMethodInfo Sphere signature where
    overloadedMethod = sphereGetRadius

instance O.OverloadedMethodInfo SphereGetRadiusMethodInfo Sphere where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Graphene.Structs.Sphere.sphereGetRadius",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Sphere.html#v:sphereGetRadius"
        })


#endif

-- method Sphere::init
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "s"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Sphere" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #graphene_sphere_t to initialize"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "center"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Point3D" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "the coordinates of the center of the sphere, or %NULL\n  for a center in (0, 0, 0)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "radius"
--           , argType = TBasicType TFloat
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the radius of the sphere"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Graphene" , name = "Sphere" })
-- throws : False
-- Skip return : False

foreign import ccall "graphene_sphere_init" graphene_sphere_init :: 
    Ptr Sphere ->                           -- s : TInterface (Name {namespace = "Graphene", name = "Sphere"})
    Ptr Graphene.Point3D.Point3D ->         -- center : TInterface (Name {namespace = "Graphene", name = "Point3D"})
    CFloat ->                               -- radius : TBasicType TFloat
    IO (Ptr Sphere)

-- | Initializes the given t'GI.Graphene.Structs.Sphere.Sphere' with the given /@center@/ and /@radius@/.
-- 
-- /Since: 1.2/
sphereInit ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Sphere
    -- ^ /@s@/: the t'GI.Graphene.Structs.Sphere.Sphere' to initialize
    -> Maybe (Graphene.Point3D.Point3D)
    -- ^ /@center@/: the coordinates of the center of the sphere, or 'P.Nothing'
    --   for a center in (0, 0, 0)
    -> Float
    -- ^ /@radius@/: the radius of the sphere
    -> m Sphere
    -- ^ __Returns:__ the initialized t'GI.Graphene.Structs.Sphere.Sphere'
sphereInit :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Sphere -> Maybe Point3D -> Float -> m Sphere
sphereInit Sphere
s Maybe Point3D
center Float
radius = IO Sphere -> m Sphere
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Sphere -> m Sphere) -> IO Sphere -> m Sphere
forall a b. (a -> b) -> a -> b
$ do
    Ptr Sphere
s' <- Sphere -> IO (Ptr Sphere)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Sphere
s
    Ptr Point3D
maybeCenter <- case Maybe Point3D
center of
        Maybe Point3D
Nothing -> Ptr Point3D -> IO (Ptr Point3D)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Point3D
forall a. Ptr a
nullPtr
        Just Point3D
jCenter -> do
            Ptr Point3D
jCenter' <- Point3D -> IO (Ptr Point3D)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Point3D
jCenter
            Ptr Point3D -> IO (Ptr Point3D)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Point3D
jCenter'
    let radius' :: CFloat
radius' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
radius
    Ptr Sphere
result <- Ptr Sphere -> Ptr Point3D -> CFloat -> IO (Ptr Sphere)
graphene_sphere_init Ptr Sphere
s' Ptr Point3D
maybeCenter CFloat
radius'
    Text -> Ptr Sphere -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"sphereInit" Ptr Sphere
result
    Sphere
result' <- ((ManagedPtr Sphere -> Sphere) -> Ptr Sphere -> IO Sphere
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Sphere -> Sphere
Sphere) Ptr Sphere
result
    Sphere -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Sphere
s
    Maybe Point3D -> (Point3D -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe Point3D
center Point3D -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    Sphere -> IO Sphere
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Sphere
result'

#if defined(ENABLE_OVERLOADING)
data SphereInitMethodInfo
instance (signature ~ (Maybe (Graphene.Point3D.Point3D) -> Float -> m Sphere), MonadIO m) => O.OverloadedMethod SphereInitMethodInfo Sphere signature where
    overloadedMethod = sphereInit

instance O.OverloadedMethodInfo SphereInitMethodInfo Sphere where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Graphene.Structs.Sphere.sphereInit",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Sphere.html#v:sphereInit"
        })


#endif

-- method Sphere::init_from_points
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "s"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Sphere" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #graphene_sphere_t to initialize"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "n_points"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the number of #graphene_point3d_t in the @points array"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "points"
--           , argType =
--               TCArray
--                 False
--                 (-1)
--                 1
--                 (TInterface Name { namespace = "Graphene" , name = "Point3D" })
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an array of #graphene_point3d_t"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "center"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Point3D" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the center of the sphere"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "n_points"
--              , argType = TBasicType TUInt
--              , direction = DirectionIn
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText =
--                        Just "the number of #graphene_point3d_t in the @points array"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferNothing
--              }
--          ]
-- returnType: Just (TInterface Name { namespace = "Graphene" , name = "Sphere" })
-- throws : False
-- Skip return : False

foreign import ccall "graphene_sphere_init_from_points" graphene_sphere_init_from_points :: 
    Ptr Sphere ->                           -- s : TInterface (Name {namespace = "Graphene", name = "Sphere"})
    Word32 ->                               -- n_points : TBasicType TUInt
    Ptr Graphene.Point3D.Point3D ->         -- points : TCArray False (-1) 1 (TInterface (Name {namespace = "Graphene", name = "Point3D"}))
    Ptr Graphene.Point3D.Point3D ->         -- center : TInterface (Name {namespace = "Graphene", name = "Point3D"})
    IO (Ptr Sphere)

-- | Initializes the given t'GI.Graphene.Structs.Sphere.Sphere' using the given array
-- of 3D coordinates so that the sphere includes them.
-- 
-- The center of the sphere can either be specified, or will be center
-- of the 3D volume that encompasses all /@points@/.
-- 
-- /Since: 1.2/
sphereInitFromPoints ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Sphere
    -- ^ /@s@/: the t'GI.Graphene.Structs.Sphere.Sphere' to initialize
    -> [Graphene.Point3D.Point3D]
    -- ^ /@points@/: an array of t'GI.Graphene.Structs.Point3D.Point3D'
    -> Maybe (Graphene.Point3D.Point3D)
    -- ^ /@center@/: the center of the sphere
    -> m Sphere
    -- ^ __Returns:__ the initialized t'GI.Graphene.Structs.Sphere.Sphere'
sphereInitFromPoints :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Sphere -> [Point3D] -> Maybe Point3D -> m Sphere
sphereInitFromPoints Sphere
s [Point3D]
points Maybe Point3D
center = IO Sphere -> m Sphere
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Sphere -> m Sphere) -> IO Sphere -> m Sphere
forall a b. (a -> b) -> a -> b
$ do
    let nPoints :: Word32
nPoints = Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Word32) -> Int -> Word32
forall a b. (a -> b) -> a -> b
$ [Point3D] -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
P.length [Point3D]
points
    Ptr Sphere
s' <- Sphere -> IO (Ptr Sphere)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Sphere
s
    [Ptr Point3D]
points' <- (Point3D -> IO (Ptr Point3D)) -> [Point3D] -> IO [Ptr Point3D]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
forall (m :: * -> *) a b. Monad m => (a -> m b) -> [a] -> m [b]
mapM Point3D -> IO (Ptr Point3D)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr [Point3D]
points
    Ptr Point3D
points'' <- Int -> [Ptr Point3D] -> IO (Ptr Point3D)
forall a. Int -> [Ptr a] -> IO (Ptr a)
packBlockArray Int
12 [Ptr Point3D]
points'
    Ptr Point3D
maybeCenter <- case Maybe Point3D
center of
        Maybe Point3D
Nothing -> Ptr Point3D -> IO (Ptr Point3D)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Point3D
forall a. Ptr a
nullPtr
        Just Point3D
jCenter -> do
            Ptr Point3D
jCenter' <- Point3D -> IO (Ptr Point3D)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Point3D
jCenter
            Ptr Point3D -> IO (Ptr Point3D)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Point3D
jCenter'
    Ptr Sphere
result <- Ptr Sphere
-> Word32 -> Ptr Point3D -> Ptr Point3D -> IO (Ptr Sphere)
graphene_sphere_init_from_points Ptr Sphere
s' Word32
nPoints Ptr Point3D
points'' Ptr Point3D
maybeCenter
    Text -> Ptr Sphere -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"sphereInitFromPoints" Ptr Sphere
result
    Sphere
result' <- ((ManagedPtr Sphere -> Sphere) -> Ptr Sphere -> IO Sphere
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Sphere -> Sphere
Sphere) Ptr Sphere
result
    Sphere -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Sphere
s
    (Point3D -> IO ()) -> [Point3D] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ Point3D -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr [Point3D]
points
    Maybe Point3D -> (Point3D -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe Point3D
center Point3D -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    Ptr Point3D -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Point3D
points''
    Sphere -> IO Sphere
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Sphere
result'

#if defined(ENABLE_OVERLOADING)
data SphereInitFromPointsMethodInfo
instance (signature ~ ([Graphene.Point3D.Point3D] -> Maybe (Graphene.Point3D.Point3D) -> m Sphere), MonadIO m) => O.OverloadedMethod SphereInitFromPointsMethodInfo Sphere signature where
    overloadedMethod = sphereInitFromPoints

instance O.OverloadedMethodInfo SphereInitFromPointsMethodInfo Sphere where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Graphene.Structs.Sphere.sphereInitFromPoints",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Sphere.html#v:sphereInitFromPoints"
        })


#endif

-- method Sphere::init_from_vectors
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "s"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Sphere" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #graphene_sphere_t to initialize"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "n_vectors"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the number of #graphene_vec3_t in the @vectors array"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "vectors"
--           , argType =
--               TCArray
--                 False
--                 (-1)
--                 1
--                 (TInterface Name { namespace = "Graphene" , name = "Vec3" })
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an array of #graphene_vec3_t"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "center"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Point3D" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the center of the sphere"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "n_vectors"
--              , argType = TBasicType TUInt
--              , direction = DirectionIn
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText =
--                        Just "the number of #graphene_vec3_t in the @vectors array"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferNothing
--              }
--          ]
-- returnType: Just (TInterface Name { namespace = "Graphene" , name = "Sphere" })
-- throws : False
-- Skip return : False

foreign import ccall "graphene_sphere_init_from_vectors" graphene_sphere_init_from_vectors :: 
    Ptr Sphere ->                           -- s : TInterface (Name {namespace = "Graphene", name = "Sphere"})
    Word32 ->                               -- n_vectors : TBasicType TUInt
    Ptr Graphene.Vec3.Vec3 ->               -- vectors : TCArray False (-1) 1 (TInterface (Name {namespace = "Graphene", name = "Vec3"}))
    Ptr Graphene.Point3D.Point3D ->         -- center : TInterface (Name {namespace = "Graphene", name = "Point3D"})
    IO (Ptr Sphere)

-- | Initializes the given t'GI.Graphene.Structs.Sphere.Sphere' using the given array
-- of 3D coordinates so that the sphere includes them.
-- 
-- The center of the sphere can either be specified, or will be center
-- of the 3D volume that encompasses all /@vectors@/.
-- 
-- /Since: 1.2/
sphereInitFromVectors ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Sphere
    -- ^ /@s@/: the t'GI.Graphene.Structs.Sphere.Sphere' to initialize
    -> [Graphene.Vec3.Vec3]
    -- ^ /@vectors@/: an array of t'GI.Graphene.Structs.Vec3.Vec3'
    -> Maybe (Graphene.Point3D.Point3D)
    -- ^ /@center@/: the center of the sphere
    -> m Sphere
    -- ^ __Returns:__ the initialized t'GI.Graphene.Structs.Sphere.Sphere'
sphereInitFromVectors :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Sphere -> [Vec3] -> Maybe Point3D -> m Sphere
sphereInitFromVectors Sphere
s [Vec3]
vectors Maybe Point3D
center = IO Sphere -> m Sphere
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Sphere -> m Sphere) -> IO Sphere -> m Sphere
forall a b. (a -> b) -> a -> b
$ do
    let nVectors :: Word32
nVectors = Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Word32) -> Int -> Word32
forall a b. (a -> b) -> a -> b
$ [Vec3] -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
P.length [Vec3]
vectors
    Ptr Sphere
s' <- Sphere -> IO (Ptr Sphere)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Sphere
s
    [Ptr Vec3]
vectors' <- (Vec3 -> IO (Ptr Vec3)) -> [Vec3] -> IO [Ptr Vec3]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
forall (m :: * -> *) a b. Monad m => (a -> m b) -> [a] -> m [b]
mapM Vec3 -> IO (Ptr Vec3)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr [Vec3]
vectors
    Ptr Vec3
vectors'' <- Int -> [Ptr Vec3] -> IO (Ptr Vec3)
forall a. Int -> [Ptr a] -> IO (Ptr a)
packBlockArray Int
16 [Ptr Vec3]
vectors'
    Ptr Point3D
maybeCenter <- case Maybe Point3D
center of
        Maybe Point3D
Nothing -> Ptr Point3D -> IO (Ptr Point3D)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Point3D
forall a. Ptr a
nullPtr
        Just Point3D
jCenter -> do
            Ptr Point3D
jCenter' <- Point3D -> IO (Ptr Point3D)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Point3D
jCenter
            Ptr Point3D -> IO (Ptr Point3D)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Point3D
jCenter'
    Ptr Sphere
result <- Ptr Sphere -> Word32 -> Ptr Vec3 -> Ptr Point3D -> IO (Ptr Sphere)
graphene_sphere_init_from_vectors Ptr Sphere
s' Word32
nVectors Ptr Vec3
vectors'' Ptr Point3D
maybeCenter
    Text -> Ptr Sphere -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"sphereInitFromVectors" Ptr Sphere
result
    Sphere
result' <- ((ManagedPtr Sphere -> Sphere) -> Ptr Sphere -> IO Sphere
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Sphere -> Sphere
Sphere) Ptr Sphere
result
    Sphere -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Sphere
s
    (Vec3 -> IO ()) -> [Vec3] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ Vec3 -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr [Vec3]
vectors
    Maybe Point3D -> (Point3D -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe Point3D
center Point3D -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    Ptr Vec3 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Vec3
vectors''
    Sphere -> IO Sphere
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Sphere
result'

#if defined(ENABLE_OVERLOADING)
data SphereInitFromVectorsMethodInfo
instance (signature ~ ([Graphene.Vec3.Vec3] -> Maybe (Graphene.Point3D.Point3D) -> m Sphere), MonadIO m) => O.OverloadedMethod SphereInitFromVectorsMethodInfo Sphere signature where
    overloadedMethod = sphereInitFromVectors

instance O.OverloadedMethodInfo SphereInitFromVectorsMethodInfo Sphere where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Graphene.Structs.Sphere.sphereInitFromVectors",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Sphere.html#v:sphereInitFromVectors"
        })


#endif

-- method Sphere::is_empty
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "s"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Sphere" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #graphene_sphere_t"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "graphene_sphere_is_empty" graphene_sphere_is_empty :: 
    Ptr Sphere ->                           -- s : TInterface (Name {namespace = "Graphene", name = "Sphere"})
    IO CInt

-- | Checks whether the sphere has a zero radius.
-- 
-- /Since: 1.2/
sphereIsEmpty ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Sphere
    -- ^ /@s@/: a t'GI.Graphene.Structs.Sphere.Sphere'
    -> m Bool
    -- ^ __Returns:__ @true@ if the sphere is empty
sphereIsEmpty :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Sphere -> m Bool
sphereIsEmpty Sphere
s = 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 Sphere
s' <- Sphere -> IO (Ptr Sphere)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Sphere
s
    CInt
result <- Ptr Sphere -> IO CInt
graphene_sphere_is_empty Ptr Sphere
s'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    Sphere -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Sphere
s
    Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data SphereIsEmptyMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.OverloadedMethod SphereIsEmptyMethodInfo Sphere signature where
    overloadedMethod = sphereIsEmpty

instance O.OverloadedMethodInfo SphereIsEmptyMethodInfo Sphere where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Graphene.Structs.Sphere.sphereIsEmpty",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Sphere.html#v:sphereIsEmpty"
        })


#endif

-- method Sphere::translate
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "s"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Sphere" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #graphene_sphere_t"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "point"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Point3D" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the coordinates of the translation"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "res"
--           , argType =
--               TInterface Name { namespace = "Graphene" , name = "Sphere" }
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "return location for the translated sphere"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = True
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "graphene_sphere_translate" graphene_sphere_translate :: 
    Ptr Sphere ->                           -- s : TInterface (Name {namespace = "Graphene", name = "Sphere"})
    Ptr Graphene.Point3D.Point3D ->         -- point : TInterface (Name {namespace = "Graphene", name = "Point3D"})
    Ptr Sphere ->                           -- res : TInterface (Name {namespace = "Graphene", name = "Sphere"})
    IO ()

-- | Translates the center of the given t'GI.Graphene.Structs.Sphere.Sphere' using the /@point@/
-- coordinates as the delta of the translation.
-- 
-- /Since: 1.2/
sphereTranslate ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Sphere
    -- ^ /@s@/: a t'GI.Graphene.Structs.Sphere.Sphere'
    -> Graphene.Point3D.Point3D
    -- ^ /@point@/: the coordinates of the translation
    -> m (Sphere)
sphereTranslate :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Sphere -> Point3D -> m Sphere
sphereTranslate Sphere
s Point3D
point = IO Sphere -> m Sphere
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Sphere -> m Sphere) -> IO Sphere -> m Sphere
forall a b. (a -> b) -> a -> b
$ do
    Ptr Sphere
s' <- Sphere -> IO (Ptr Sphere)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Sphere
s
    Ptr Point3D
point' <- Point3D -> IO (Ptr Point3D)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Point3D
point
    Ptr Sphere
res <- Int -> IO (Ptr Sphere)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
20 :: IO (Ptr Sphere)
    Ptr Sphere -> Ptr Point3D -> Ptr Sphere -> IO ()
graphene_sphere_translate Ptr Sphere
s' Ptr Point3D
point' Ptr Sphere
res
    Sphere
res' <- ((ManagedPtr Sphere -> Sphere) -> Ptr Sphere -> IO Sphere
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Sphere -> Sphere
Sphere) Ptr Sphere
res
    Sphere -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Sphere
s
    Point3D -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Point3D
point
    Sphere -> IO Sphere
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Sphere
res'

#if defined(ENABLE_OVERLOADING)
data SphereTranslateMethodInfo
instance (signature ~ (Graphene.Point3D.Point3D -> m (Sphere)), MonadIO m) => O.OverloadedMethod SphereTranslateMethodInfo Sphere signature where
    overloadedMethod = sphereTranslate

instance O.OverloadedMethodInfo SphereTranslateMethodInfo Sphere where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Graphene.Structs.Sphere.sphereTranslate",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-graphene-1.0.5/docs/GI-Graphene-Structs-Sphere.html#v:sphereTranslate"
        })


#endif

#if defined(ENABLE_OVERLOADING)
type family ResolveSphereMethod (t :: Symbol) (o :: *) :: * where
    ResolveSphereMethod "containsPoint" o = SphereContainsPointMethodInfo
    ResolveSphereMethod "distance" o = SphereDistanceMethodInfo
    ResolveSphereMethod "equal" o = SphereEqualMethodInfo
    ResolveSphereMethod "free" o = SphereFreeMethodInfo
    ResolveSphereMethod "init" o = SphereInitMethodInfo
    ResolveSphereMethod "initFromPoints" o = SphereInitFromPointsMethodInfo
    ResolveSphereMethod "initFromVectors" o = SphereInitFromVectorsMethodInfo
    ResolveSphereMethod "isEmpty" o = SphereIsEmptyMethodInfo
    ResolveSphereMethod "translate" o = SphereTranslateMethodInfo
    ResolveSphereMethod "getBoundingBox" o = SphereGetBoundingBoxMethodInfo
    ResolveSphereMethod "getCenter" o = SphereGetCenterMethodInfo
    ResolveSphereMethod "getRadius" o = SphereGetRadiusMethodInfo
    ResolveSphereMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveSphereMethod t Sphere, O.OverloadedMethod info Sphere p) => OL.IsLabel t (Sphere -> 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 ~ ResolveSphereMethod t Sphere, O.OverloadedMethod info Sphere p, R.HasField t Sphere p) => R.HasField t Sphere p where
    getField = O.overloadedMethod @info

#endif

instance (info ~ ResolveSphereMethod t Sphere, O.OverloadedMethodInfo info Sphere) => OL.IsLabel t (O.MethodProxy info Sphere) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.MethodProxy
#else
    fromLabel _ = O.MethodProxy
#endif

#endif