gi-graphene-1.0.5: Graphene bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Graphene.Structs.Sphere

Description

A sphere, represented by its center and radius.

Since: 1.2

Synopsis

Exported types

newtype Sphere Source #

Memory-managed wrapper type.

Constructors

Sphere (ManagedPtr Sphere) 

Instances

Instances details
Eq Sphere Source # 
Instance details

Defined in GI.Graphene.Structs.Sphere

Methods

(==) :: Sphere -> Sphere -> Bool #

(/=) :: Sphere -> Sphere -> Bool #

GBoxed Sphere Source # 
Instance details

Defined in GI.Graphene.Structs.Sphere

ManagedPtrNewtype Sphere Source # 
Instance details

Defined in GI.Graphene.Structs.Sphere

Methods

toManagedPtr :: Sphere -> ManagedPtr Sphere

TypedObject Sphere Source # 
Instance details

Defined in GI.Graphene.Structs.Sphere

Methods

glibType :: IO GType

HasParentTypes Sphere Source # 
Instance details

Defined in GI.Graphene.Structs.Sphere

tag ~ 'AttrSet => Constructible Sphere tag Source # 
Instance details

Defined in GI.Graphene.Structs.Sphere

Methods

new :: MonadIO m => (ManagedPtr Sphere -> Sphere) -> [AttrOp Sphere tag] -> m Sphere

IsGValue (Maybe Sphere) Source #

Convert Sphere to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Graphene.Structs.Sphere

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe Sphere -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe Sphere)

type ParentTypes Sphere Source # 
Instance details

Defined in GI.Graphene.Structs.Sphere

type ParentTypes Sphere = '[] :: [Type]

newZeroSphere :: MonadIO m => m Sphere Source #

Construct a Sphere struct initialized to zero.

Methods

Click to display all available methods, including inherited ones

Expand

Methods

containsPoint, distance, equal, free, init, initFromPoints, initFromVectors, isEmpty, translate.

Getters

getBoundingBox, getCenter, getRadius.

Setters

None.

alloc

sphereAlloc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m Sphere

Returns: the newly allocated Sphere. Use sphereFree to free the resources allocated by this function

Allocates a new Sphere.

The contents of the newly allocated structure are undefined.

Since: 1.2

containsPoint

sphereContainsPoint Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Sphere

s: a Sphere

-> Point3D

point: a Point3D

-> m Bool

Returns: true if the sphere contains the point

Checks whether the given point is contained in the volume of a Sphere.

Since: 1.2

distance

sphereDistance Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Sphere

s: a Sphere

-> Point3D

point: a Point3D

-> m Float

Returns: the distance of the point

Computes the distance of the given point from the surface of a Sphere.

Since: 1.2

equal

sphereEqual Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Sphere

a: a Sphere

-> Sphere

b: a Sphere

-> m Bool

Returns: true if the spheres are equal

Checks whether two Sphere are equal.

Since: 1.2

free

sphereFree Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Sphere

s: a Sphere

-> m () 

Frees the resources allocated by sphereAlloc.

Since: 1.2

getBoundingBox

sphereGetBoundingBox Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Sphere

s: a Sphere

-> m Box 

Computes the bounding box capable of containing the given Sphere.

Since: 1.2

getCenter

sphereGetCenter Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Sphere

s: a Sphere

-> m Point3D 

Retrieves the coordinates of the center of a Sphere.

Since: 1.2

getRadius

sphereGetRadius Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Sphere

s: a Sphere

-> m Float 

Retrieves the radius of a Sphere.

Since: 1.2

init

sphereInit Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Sphere

s: the Sphere to initialize

-> Maybe Point3D

center: the coordinates of the center of the sphere, or Nothing for a center in (0, 0, 0)

-> Float

radius: the radius of the sphere

-> m Sphere

Returns: the initialized Sphere

Initializes the given Sphere with the given center and radius.

Since: 1.2

initFromPoints

sphereInitFromPoints Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Sphere

s: the Sphere to initialize

-> [Point3D]

points: an array of Point3D

-> Maybe Point3D

center: the center of the sphere

-> m Sphere

Returns: the initialized Sphere

Initializes the given 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

initFromVectors

sphereInitFromVectors Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Sphere

s: the Sphere to initialize

-> [Vec3]

vectors: an array of Vec3

-> Maybe Point3D

center: the center of the sphere

-> m Sphere

Returns: the initialized Sphere

Initializes the given 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

isEmpty

sphereIsEmpty Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Sphere

s: a Sphere

-> m Bool

Returns: true if the sphere is empty

Checks whether the sphere has a zero radius.

Since: 1.2

translate

sphereTranslate Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Sphere

s: a Sphere

-> Point3D

point: the coordinates of the translation

-> m Sphere 

Translates the center of the given Sphere using the point coordinates as the delta of the translation.

Since: 1.2