package ocgtk

  1. Overview
  2. Docs
OCaml bindings for GTK 4

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v0.1-preview2.tar.gz
sha256=4e50fdb5093136a10fc8ffbe388e44cbcb70d52f8afdd48863ec7e22580ff054

doc/ocgtk.graphene/Ocgtk_graphene/Graphene/Wrappers/Box/index.html

Module Wrappers.Box

type t = [ `box ] Gobject.obj
val alloc : unit -> t

Create a new Box

val union : t -> t -> t

Unions the two given #graphene_box_t.

val intersection : t -> t -> bool * t

Intersects the two given #graphene_box_t.

If the two boxes do not intersect, @res will contain a degenerate box initialized with graphene_box_empty().

val init_from_vectors : t -> int -> [ `vec3 ] Gobject.obj array -> t

Initializes the given #graphene_box_t with the given array of vertices.

If @n_vectors is 0, the returned box is initialized with graphene_box_empty().

val init_from_vec3 : t -> [ `vec3 ] Gobject.obj option -> [ `vec3 ] Gobject.obj option -> t

Initializes the given #graphene_box_t with two vertices stored inside #graphene_vec3_t.

val init_from_points : t -> int -> [ `point3_d ] Gobject.obj array -> t

Initializes the given #graphene_box_t with the given array of vertices.

If @n_points is 0, the returned box is initialized with graphene_box_empty().

val init_from_box : t -> t -> t

Initializes the given #graphene_box_t with the vertices of another #graphene_box_t.

val init : t -> [ `point3_d ] Gobject.obj option -> [ `point3_d ] Gobject.obj option -> t

Initializes the given #graphene_box_t with two vertices.

val get_width : t -> float

Retrieves the size of the @box on the X axis.

val get_vertices : t -> [ `vec3 ] Gobject.obj array

Computes the vertices of the given #graphene_box_t.

val get_size : t -> [ `vec3 ] Gobject.obj

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

val get_min : t -> [ `point3_d ] Gobject.obj

Retrieves the coordinates of the minimum point of the given #graphene_box_t.

val get_max : t -> [ `point3_d ] Gobject.obj

Retrieves the coordinates of the maximum point of the given #graphene_box_t.

val get_height : t -> float

Retrieves the size of the @box on the Y axis.

val get_depth : t -> float

Retrieves the size of the @box on the Z axis.

val get_center : t -> [ `point3_d ] Gobject.obj

Retrieves the coordinates of the center of a #graphene_box_t.

val get_bounding_sphere : t -> [ `sphere ] Gobject.obj

Computes the bounding #graphene_sphere_t capable of containing the given #graphene_box_t.

val expand_vec3 : t -> [ `vec3 ] Gobject.obj -> t

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

val expand_scalar : t -> float -> t

Expands the dimensions of @box by the given @scalar value.

If @scalar is positive, the #graphene_box_t will grow; if @scalar is negative, the #graphene_box_t will shrink.

val expand : t -> [ `point3_d ] Gobject.obj -> t

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

val equal : t -> t -> bool

Checks whether the two given boxes are equal.

val contains_point : t -> [ `point3_d ] Gobject.obj -> bool

Checks whether @box contains the given @point.

val contains_box : t -> t -> bool

Checks whether the #graphene_box_t @a contains the given #graphene_box_t @b.