gi-graphene-1.0.2: Graphene bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Graphene.Structs.Box

Description

A 3D box, described as the volume between a minimum and a maximum vertices.

Since: 1.2

Synopsis

Exported types

newtype Box Source #

Memory-managed wrapper type.

Constructors

Box (ManagedPtr Box) 

Instances

Instances details
Eq Box Source # 
Instance details

Defined in GI.Graphene.Structs.Box

Methods

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

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

IsGValue Box Source #

Convert Box to and from GValue with toGValue and fromGValue.

Instance details

Defined in GI.Graphene.Structs.Box

ManagedPtrNewtype Box Source # 
Instance details

Defined in GI.Graphene.Structs.Box

TypedObject Box Source # 
Instance details

Defined in GI.Graphene.Structs.Box

Methods

glibType :: IO GType #

GBoxed Box Source # 
Instance details

Defined in GI.Graphene.Structs.Box

HasParentTypes Box Source # 
Instance details

Defined in GI.Graphene.Structs.Box

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

Defined in GI.Graphene.Structs.Box

Methods

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

type ParentTypes Box Source # 
Instance details

Defined in GI.Graphene.Structs.Box

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

newZeroBox :: MonadIO m => m Box Source #

Construct a Box struct initialized to zero.

Methods

Overloaded methods

alloc

boxAlloc Source #

Arguments

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

Returns: the newly allocated Box structure. Use boxFree to free the resources allocated by this function

Allocates a new Box.

The contents of the returned structure are undefined.

Since: 1.2

containsBox

boxContainsBox Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Box

a: a Box

-> Box

b: a Box

-> m Bool

Returns: true if the box is contained in the given box

Checks whether the Box a contains the given Box b.

Since: 1.2

containsPoint

boxContainsPoint Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Box

box: a Box

-> Point3D

point: the coordinates to check

-> m Bool

Returns: true if the point is contained in the given box

Checks whether box contains the given point.

Since: 1.2

empty

boxEmpty Source #

Arguments

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

Returns: a Box

A degenerate Box that can only be expanded.

The returned value is owned by Graphene and should not be modified or freed.

Since: 1.2

equal

boxEqual Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Box

a: a Box

-> Box

b: a Box

-> m Bool

Returns: true if the boxes are equal

Checks whether the two given boxes are equal.

Since: 1.2

expand

boxExpand Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Box

box: a Box

-> Point3D

point: the coordinates of the point to include

-> m Box 

Expands the dimensions of box to include the coordinates at point.

Since: 1.2

expandScalar

boxExpandScalar Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Box

box: a Box

-> Float

scalar: a scalar value

-> m Box 

Expands the dimensions of box by the given scalar value.

If scalar is positive, the Box will grow; if scalar is negative, the Box will shrink.

Since: 1.2

expandVec3

boxExpandVec3 Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Box

box: a Box

-> Vec3

vec: the coordinates of the point to include, as a Vec3

-> m Box 

Expands the dimensions of box to include the coordinates of the given vector.

Since: 1.2

free

boxFree Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Box

box: a Box

-> m () 

Frees the resources allocated by boxAlloc.

Since: 1.2

getBoundingSphere

boxGetBoundingSphere Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Box

box: a Box

-> m Sphere 

Computes the bounding Sphere capable of containing the given Box.

Since: 1.2

getCenter

boxGetCenter Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Box

box: a Box

-> m Point3D 

Retrieves the coordinates of the center of a Box.

Since: 1.2

getDepth

boxGetDepth Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Box

box: a Box

-> m Float

Returns: the depth of the box

Retrieves the size of the box on the Z axis.

Since: 1.2

getHeight

boxGetHeight Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Box

box: a Box

-> m Float

Returns: the height of the box

Retrieves the size of the box on the Y axis.

Since: 1.2

getMax

boxGetMax Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Box

box: a Box

-> m Point3D 

Retrieves the coordinates of the maximum point of the given Box.

Since: 1.2

getMin

boxGetMin Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Box

box: a Box

-> m Point3D 

Retrieves the coordinates of the minimum point of the given Box.

Since: 1.2

getSize

boxGetSize Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Box

box: a Box

-> m Vec3 

Retrieves the size of the box on all three axes, and stores it into the given size vector.

Since: 1.2

getWidth

boxGetWidth Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Box

box: a Box

-> m Float

Returns: the width of the box

Retrieves the size of the box on the X axis.

Since: 1.2

infinite

boxInfinite Source #

Arguments

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

Returns: a Box

A degenerate Box that cannot be expanded.

The returned value is owned by Graphene and should not be modified or freed.

Since: 1.2

init

boxInit Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Box

box: the Box to initialize

-> Maybe Point3D

min: the coordinates of the minimum vertex

-> Maybe Point3D

max: the coordinates of the maximum vertex

-> m Box

Returns: the initialized Box

Initializes the given Box with two vertices.

Since: 1.2

initFromBox

boxInitFromBox Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Box

box: the Box to initialize

-> Box

src: a Box

-> m Box

Returns: the initialized Box

Initializes the given Box with the vertices of another Box.

Since: 1.2

initFromPoints

boxInitFromPoints Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Box

box: the Box to initialize

-> [Point3D]

points: an array of Point3D

-> m Box

Returns: the initialized Box

Initializes the given Box with the given array of vertices.

If nPoints is 0, the returned box is initialized with boxEmpty.

Since: 1.2

initFromVec3

boxInitFromVec3 Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Box

box: the Box to initialize

-> Maybe Vec3

min: the coordinates of the minimum vertex

-> Maybe Vec3

max: the coordinates of the maximum vertex

-> m Box

Returns: the initialized Box

Initializes the given Box with two vertices stored inside Vec3.

Since: 1.2

initFromVectors

boxInitFromVectors Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Box

box: the Box to initialize

-> [Vec3]

vectors: an array of Vec3

-> m Box

Returns: the initialized Box

Initializes the given Box with the given array of vertices.

If nVectors is 0, the returned box is initialized with boxEmpty.

Since: 1.2

intersection

boxIntersection Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Box

a: a Box

-> Box

b: a Box

-> m (Bool, Box)

Returns: true if the two boxes intersect

Intersects the two given Box.

If the two boxes do not intersect, res will contain a degenerate box initialized with boxEmpty.

Since: 1.2

minusOne

boxMinusOne Source #

Arguments

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

Returns: a Box

A Box with the minimum vertex set at (-1, -1, -1) and the maximum vertex set at (0, 0, 0).

The returned value is owned by Graphene and should not be modified or freed.

Since: 1.2

one

boxOne Source #

Arguments

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

Returns: a Box

A Box with the minimum vertex set at (0, 0, 0) and the maximum vertex set at (1, 1, 1).

The returned value is owned by Graphene and should not be modified or freed.

Since: 1.2

oneMinusOne

boxOneMinusOne Source #

Arguments

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

Returns: a Box

A Box with the minimum vertex set at (-1, -1, -1) and the maximum vertex set at (1, 1, 1).

The returned value is owned by Graphene and should not be modified or freed.

Since: 1.2

union

boxUnion Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Box

a: a Box

-> Box

b: the box to union to a

-> m Box 

Unions the two given Box.

Since: 1.2

zero

boxZero Source #

Arguments

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

Returns: a Box

A Box with both the minimum and maximum vertices set at (0, 0, 0).

The returned value is owned by Graphene and should not be modified or freed.

Since: 1.2