aabb_node_object Derived Type

type, public :: aabb_node_object

type~~aabb_node_object~~InheritsGraph type~aabb_node_object aabb_node_object type~aabb_object aabb_object type~aabb_object->type~aabb_node_object aabb vector_R8P vector_R8P vector_R8P->type~aabb_object bmin, bmax type~facet_object facet_object vector_R8P->type~facet_object normal, vertex_1, vertex_2, vertex_3, E12, E13, bb type~facet_object->type~aabb_object facet
Help


FOSSIL Axis-Aligned Bounding Box (AABB) tree-node class.

Inherited By

type~~aabb_node_object~~InheritedByGraph type~aabb_node_object aabb_node_object type~aabb_tree_object aabb_tree_object type~aabb_node_object->type~aabb_tree_object node type~file_stl_object file_stl_object type~aabb_tree_object->type~file_stl_object aabb
Help

Source Code


Components

TypeVisibility AttributesNameInitial
type(aabb_object), private, allocatable:: aabb

AABB data.


Type-Bound Procedures

procedure, public, pass(self) :: add_facets

Add facets to AABB.

  • private subroutine add_facets(self, facet)

    Add facets to AABB.

    Arguments

    Type IntentOptional AttributesName
    class(aabb_node_object), intent(inout) :: self

    AABB.

    type(facet_object), intent(inout), allocatable:: facet(:)

    Facets list.

procedure, public, pass(self) :: bmin

Return AABB bmin.

  • private pure function bmin(self)

    Return AABB bmin.

    Arguments

    Type IntentOptional AttributesName
    class(aabb_node_object), intent(in) :: self

    AABB box.

    Return Value type(vector_R8P)

    AABB bmin.

procedure, public, pass(self) :: bmax

Return AABB bmax.

  • private pure function bmax(self)

    Return AABB bmax.

    Arguments

    Type IntentOptional AttributesName
    class(aabb_node_object), intent(in) :: self

    AABB box.

    Return Value type(vector_R8P)

    AABB bmax.

procedure, public, pass(self) :: closest_point

Return closest point on AABB from point reference.

  • private pure function closest_point(self, point) result(closest)

    Return closest point on (or in) AABB from point reference.

    Arguments

    Type IntentOptional AttributesName
    class(aabb_node_object), intent(in) :: self

    AABB box.

    type(vector_R8P), intent(in) :: point

    Point reference.

    Return Value type(vector_R8P)

    Closest point on (on in) aabb to point.

procedure, public, pass(self) :: compute_octants

Compute AABB octants.

  • private pure subroutine compute_octants(self, octant)

    Return AABB octants.

    Arguments

    Type IntentOptional AttributesName
    class(aabb_node_object), intent(in) :: self

    AABB.

    type(aabb_object), intent(out) :: octant(8)

    AABB octants.

procedure, public, pass(self) :: destroy

Destroy AABB.

  • private elemental subroutine destroy(self)

    Destroy AABB.

    Arguments

    Type IntentOptional AttributesName
    class(aabb_node_object), intent(inout) :: self

    AABB.

procedure, public, pass(self) :: distance

Return the (square) distance from point to AABB.

  • private pure function distance(self, point)

    Return the (square) distance from point to AABB.

    Arguments

    Type IntentOptional AttributesName
    class(aabb_node_object), intent(in) :: self

    AABB.

    type(vector_R8P), intent(in) :: point

    Point reference.

    Return Value real(kind=R8P)

    Distance from point to AABB.

procedure, public, pass(self) :: distance_from_facets

Return the (square) distance from point to AABB's facets.

  • private pure function distance_from_facets(self, point) result(distance)

    Return the (square) distance from point to AABB's facets.

    Arguments

    Type IntentOptional AttributesName
    class(aabb_node_object), intent(in) :: self

    AABB.

    type(vector_R8P), intent(in) :: point

    Point reference.

    Return Value real(kind=R8P)

    Distance from point to AABB's facets.

procedure, public, pass(self) :: do_ray_intersect

Return true if AABB is intersected by ray.

  • private pure function do_ray_intersect(self, ray_origin, ray_direction) result(do_intersect)

    Return true if AABB is intersected by ray from origin and oriented as ray direction vector.

    Arguments

    Type IntentOptional AttributesName
    class(aabb_node_object), intent(in) :: self

    AABB.

    type(vector_R8P), intent(in) :: ray_origin

    Ray origin.

    type(vector_R8P), intent(in) :: ray_direction

    Ray direction.

    Return Value logical

    Test result.

procedure, public, pass(self) :: has_facets

Return true if AABB has facets.

  • private pure function has_facets(self)

    Return true if AABB has facets.

    Arguments

    Type IntentOptional AttributesName
    class(aabb_node_object), intent(in) :: self

    AABB box.

    Return Value logical

    Check result.

procedure, public, pass(self) :: initialize

Initialize AABB.

  • private pure subroutine initialize(self, facet, bmin, bmax)

    Initialize AABB.

    Arguments

    Type IntentOptional AttributesName
    class(aabb_node_object), intent(inout) :: self

    AABB.

    type(facet_object), intent(in), optional :: facet(:)

    Facets list.

    type(vector_R8P), intent(in), optional :: bmin

    Minimum point of AABB.

    type(vector_R8P), intent(in), optional :: bmax

    Maximum point of AABB.

procedure, public, pass(self) :: is_allocated

Return true is node is allocated.

  • private pure function is_allocated(self)

    Return true if node is allocated.

    Arguments

    Type IntentOptional AttributesName
    class(aabb_node_object), intent(in) :: self

    AABB box.

    Return Value logical

    Check result.

procedure, public, pass(self) :: ray_intersections_number

Return ray intersections number.

  • private pure function ray_intersections_number(self, ray_origin, ray_direction) result(intersections_number)

    Return ray intersections number.

    Arguments

    Type IntentOptional AttributesName
    class(aabb_node_object), intent(in) :: self

    AABB.

    type(vector_R8P), intent(in) :: ray_origin

    Ray origin.

    type(vector_R8P), intent(in) :: ray_direction

    Ray direction.

    Return Value integer(kind=I4P)

    Intersection number.

procedure, public, pass(self) :: save_geometry_tecplot_ascii

Save AABB geometry into Tecplot ascii file.

  • private subroutine save_geometry_tecplot_ascii(self, file_unit, aabb_name)

    Save AABB geometry into Tecplot ascii file.

    Arguments

    Type IntentOptional AttributesName
    class(aabb_node_object), intent(in) :: self

    AABB.

    integer(kind=I4P), intent(in) :: file_unit

    File unit.

    character(len=*), intent(in), optional :: aabb_name

    Name of AABB.

procedure, public, pass(self) :: save_facets_into_file_stl

Save facets into file STL.

  • private subroutine save_facets_into_file_stl(self, file_name, is_ascii)

    Save facets into file STL.

    Arguments

    Type IntentOptional AttributesName
    class(aabb_node_object), intent(in) :: self

    AABB.

    character(len=*), intent(in) :: file_name

    File name.

    logical, intent(in) :: is_ascii

    Sentinel to check if file is ASCII.

procedure, public, pass(self) :: update_extents

Update AABB bounding box extents.

  • private pure subroutine update_extents(self)

    Update AABB bounding box extents.

    Arguments

    Type IntentOptional AttributesName
    class(aabb_node_object), intent(inout) :: self

    AABB.

generic, public :: assignment(=) => aabb_node_assign_aabb_node

Overload =.

procedure, private, pass(lhs) :: aabb_node_assign_aabb_node

Operator =.

Source Code

type :: aabb_node_object
   !< FOSSIL Axis-Aligned Bounding Box (AABB) tree-node class.
   private
   type(aabb_object), allocatable :: aabb !< AABB data.
   contains
      ! public methods
      procedure, pass(self) :: add_facets                  !< Add facets to AABB.
      procedure, pass(self) :: bmin                        !< Return AABB bmin.
      procedure, pass(self) :: bmax                        !< Return AABB bmax.
      procedure, pass(self) :: closest_point               !< Return closest point on AABB from point reference.
      procedure, pass(self) :: compute_octants             !< Compute AABB octants.
      procedure, pass(self) :: destroy                     !< Destroy AABB.
      procedure, pass(self) :: distance                    !< Return the (square) distance from point to AABB.
      procedure, pass(self) :: distance_from_facets        !< Return the (square) distance from point to AABB's facets.
      procedure, pass(self) :: do_ray_intersect            !< Return true if AABB is intersected by ray.
      procedure, pass(self) :: has_facets                  !< Return true if AABB has facets.
      procedure, pass(self) :: initialize                  !< Initialize AABB.
      procedure, pass(self) :: is_allocated                !< Return true is node is allocated.
      procedure, pass(self) :: ray_intersections_number    !< Return ray intersections number.
      procedure, pass(self) :: save_geometry_tecplot_ascii !< Save AABB geometry into Tecplot ascii file.
      procedure, pass(self) :: save_facets_into_file_stl   !< Save facets into file STL.
      procedure, pass(self) :: update_extents              !< Update AABB bounding box extents.
      ! operators
      generic :: assignment(=) => aabb_node_assign_aabb_node      !< Overload `=`.
      procedure, pass(lhs), private :: aabb_node_assign_aabb_node !< Operator `=`.
endtype aabb_node_object