| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=rp), | public, | dimension(3) | :: | lbnd | |||
| real(kind=rp), | public, | dimension(3) | :: | ubnd | |||
| real(kind=rp), | public, | dimension(3) | :: | center | |||
| real(kind=rp), | public | :: | srfarea |
Initializes an aabb_t instance from lower and upper bounds.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(aabb_t), | intent(out) | :: | this |
An aabb_t instance. |
||
| real(kind=rp), | intent(in), | dimension(3) | :: | lbnd |
Lower bound |
|
| real(kind=rp), | intent(in), | dimension(3) | :: | ubnd |
Upper bound |
Prints an AABB.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(aabb_t), | intent(in) | :: | this |
An aabb_t instance. |
||
| character(len=*), | intent(in), | optional | :: | frmt |
Fortran-style format string for a real number. Default: (g0.6). |
|
| character(len=:), | intent(out), | optional, | allocatable | :: | str |
If present, the output is printed to this string instead of STDOUT. |
Clears all attributes of an AABB and sets them to zero.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(aabb_t), | intent(inout) | :: | this |
An aabb_t instance. |
Calculates the extent of an aabb. The extent of an AABB is defined as the difference between its upper and lower bounds.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(aabb_t), | intent(in) | :: | this |
An aabb_t instance. |
||
| real(kind=rp), | intent(out), | dimension(3) | :: | extent |
Extent of an AABB. |
Updates an AABB with new bounds.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(aabb_t), | intent(inout) | :: | this |
An aabb_t instance. |
||
| real(kind=rp), | intent(in), | optional, | dimension(3) | :: | lbnd |
Lower bound |
| real(kind=rp), | intent(in), | optional, | dimension(3) | :: | ubnd |
Upper bound |
Fattens an AABB by a fraction of its base extent.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(aabb_t), | intent(inout) | :: | this |
An aabb_t instance. |
||
| real(kind=rp), | intent(in) | :: | frac |
Fraction of AABB base extent. |
Returns true if this includes other, false otherwise. Inclusion is considered in a strict sense.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(aabb_t), | intent(in) | :: | this |
An aabb_t instance. |
||
| type(aabb_t), | intent(in) | :: | other |
An aabb_t instance. |
Returns true if this overlaps other, false otherwise. Touching does not count as an overlap.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(aabb_t), | intent(in) | :: | this |
An aabb_t instance. |
||
| type(aabb_t), | intent(in) | :: | other |
An aabb_t instance. |
Calculates the center of an aabb.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(aabb_t), | intent(inout) | :: | this |
An aabb_t instance. |
Calculates the surface area of an aabb.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(aabb_t), | intent(inout) | :: | this |
An aabb_t instance. |
type aabb_t real(rp), dimension(3) :: lbnd real(rp), dimension(3) :: ubnd real(rp), dimension(3) :: center real(rp) :: srfarea contains procedure :: init => aabb_init procedure :: print => aabb_print procedure :: clear => aabb_clear procedure :: get_extent => aabb_get_extent procedure :: update => aabb_update procedure :: fatten => aabb_fatten procedure :: includes => aabb_includes procedure :: overlaps => aabb_overlaps procedure, private :: calc_center => aabb_calc_center procedure, private :: calc_srfarea => aabb_calc_srfarea end type aabb_t