Package: graphene

Macro graphene:with-box

Lambda List

graphene:with-box ((var &rest args) &body body)

Syntax

(graphene:with-box (box) body) => result
(graphene:with-box (box box1) body) => result
(graphene:with-box (box pmin pmax) body) => result
(graphene:with-box (box (vmin graphene:vec3-t) vmax) body) => result

Arguments

box -- a graphene:box-t instance to create and initialize
box1 -- a graphene:box-t instance to use for initialization
pmin -- a graphene:point3d-t instance to use for initialization
pmax -- a graphene:point3d-t instance to use for initialization
vmin -- a graphene:vec3-t instance to use for initialization
vmax -- a graphene:vec3-t instance to use for initialization

Details

The graphene:with-box macro allocates a new graphene:box-t instance, initializes the box with the given values and executes the body that uses the box. After execution of the body the allocated memory for the box is released.

When no argument is given the components of the box are initialized to zero. The initialization with two points uses the graphene:box-init function. If the first value has the graphene:vec3-t type the graphene:box-init-from-vec3 function is used for initialization with two vectors. The initialization from another box is done with the graphene:box-init-from-box function.

Note

The memory is allocated with the graphene:box-alloc function and released with the graphene:box-free function.
 

See also

2024-11-12