aabb_tree_object Derived Type

type, public :: aabb_tree_object

type~~aabb_tree_object~~InheritsGraph type~aabb_tree_object aabb_tree_object type~aabb_node_object aabb_node_object type~aabb_node_object->type~aabb_tree_object node 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 class.

Inherited By

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

Source Code


Components

TypeVisibility AttributesNameInitial
integer(kind=I4P), public :: refinement_levels =0

Total number of refinement levels used.

integer(kind=I4P), public :: nodes_number =0

Total number of tree nodes.

type(aabb_node_object), public, allocatable:: node(:)

AABB tree nodes [0:nodes_number-1].

logical, public :: is_initialized =.false.

Sentinel to check is AABB tree is initialized.


Type-Bound Procedures

procedure, public, pass(self) :: destroy

Destroy AABB tree.

  • private elemental subroutine destroy(self)

    Destroy AABB tree.

    Arguments

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

    AABB tree.

procedure, public, pass(self) :: distance

Compute the (minimum) distance from point to triangulated surface.

  • private pure function distance(self, point)

    Compute the (minimum) distance from a point to the triangulated surface.

    Arguments

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

    AABB tree.

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

    Point coordinates.

    Return Value real(kind=R8P)

    Minimum distance from point to the triangulated surface.

procedure, public, pass(self) :: initialize

Initialize AABB tree.

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

    Initialize AABB tree.

    Arguments

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

    AABB tree.

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

    Total number of refinement levels used.

    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) :: 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_tree_object), intent(in) :: self

    AABB tree.

    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 tree boxes geometry into Tecplot ascii file.

  • private subroutine save_geometry_tecplot_ascii(self, file_name)

    Save AABB tree boxes geometry into Tecplot ascii file.

    Arguments

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

    AABB tree.

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

    File name.

procedure, public, pass(self) :: save_into_file_stl

Save AABB tree boxes facets into files STL.

  • private subroutine save_into_file_stl(self, base_file_name, is_ascii)

    Save AABB tree boxes facets into files STL.

    Arguments

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

    AABB tree.

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

    File name.

    logical, intent(in), optional :: is_ascii

    Sentinel to check if file is ASCII.

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

Overload =.

procedure, private, pass(lhs) :: aabb_tree_assign_aabb_tree

Operator =.

Source Code

type :: aabb_tree_object
   !< FOSSIL Axis-Aligned Bounding Box (AABB) tree class.
   !<
   !< @note The tree is assumed to be an **octree**.
   integer(I4P)                        :: refinement_levels=0    !< Total number of refinement levels used.
   integer(I4P)                        :: nodes_number=0         !< Total number of tree nodes.
   type(aabb_node_object), allocatable :: node(:)                !< AABB tree nodes [0:nodes_number-1].
   logical                             :: is_initialized=.false. !< Sentinel to check is AABB tree is initialized.
   contains
      ! public methods
      procedure, pass(self) :: destroy                     !< Destroy AABB tree.
      procedure, pass(self) :: distance                    !< Compute the (minimum) distance from point to triangulated surface.
      procedure, pass(self) :: initialize                  !< Initialize AABB tree.
      procedure, pass(self) :: ray_intersections_number    !< Return ray intersections number.
      procedure, pass(self) :: save_geometry_tecplot_ascii !< Save AABB tree boxes geometry into Tecplot ascii file.
      procedure, pass(self) :: save_into_file_stl          !< Save  AABB tree boxes facets into files STL.
      ! operators
      generic :: assignment(=) => aabb_tree_assign_aabb_tree      !< Overload `=`.
      procedure, pass(lhs), private :: aabb_tree_assign_aabb_tree !< Operator `=`.
endtype aabb_tree_object