OOFEM 3.0
Loading...
Searching...
No Matches
oofem::AABB Class Reference

Axis-aligned bounding box. More...

#include <aabb.h>

Collaboration diagram for oofem::AABB:

Public Member Functions

 AABB ()=default
 Default constructor.
 AABB (const Vector &min, const Vector &max)
 Constructs an axis-aligned bounding box from corner coordinates.
bool contains (const Vector &v)
 Checks whether a point is contained within the bounding box.
bool contains (double x, double y, double z)
void merge (const Vector &v)
 Expands the bounding box to include a given point.
void merge (double x, double y, double z)
 Expands the bounding box to include a given point.

Public Attributes

Vector min
Vector max

Detailed Description

Axis-aligned bounding box.

The AABB class represents an axis-aligned bounding box defined in global coordinates. It is primarily used in contact detection and spatial search algorithms to efficiently test for spatial proximity and overlap between geometric entities.

An AABB is characterized by its minimum and maximum corner coordinates aligned with the global coordinate axes. This alignment enables fast intersection tests and simple updates as objects move or deform.

The class provides basic operations for initializing, updating, and querying bounding boxes, and serves as a lightweight geometric utility within the contact and search infrastructure.

Definition at line 65 of file aabb.h.

Constructor & Destructor Documentation

◆ AABB() [1/2]

oofem::AABB::AABB ( )
default

Default constructor.

Creates an empty or uninitialized axis-aligned bounding box. The bounding box is typically initialized later by expanding it to include points or other bounding boxes.

References max, and min.

◆ AABB() [2/2]

oofem::AABB::AABB ( const Vector & min,
const Vector & max )

Constructs an axis-aligned bounding box from corner coordinates.

Initializes the bounding box using the given minimum and maximum corner coordinates in global space.

Parameters
minCornerVector of minimum coordinates along each axis.
maxCornerVector of maximum coordinates along each axis.

Definition at line 56 of file aabb.C.

References max, and min.

Member Function Documentation

◆ contains() [1/2]

bool oofem::AABB::contains ( const Vector & v)

Checks whether a point is contained within the bounding box.

Tests if the given point lies inside or on the boundary of this axis-aligned bounding box. The check is performed independently along each coordinate axis.

Parameters
vVector in global coordinates.
Returns
True if the point is inside or on the boundary of the box, false otherwise.

Definition at line 63 of file aabb.C.

References min, oofem::Vector::x, oofem::Vector::y, and oofem::Vector::z.

◆ contains() [2/2]

bool oofem::AABB::contains ( double x,
double y,
double z )

Definition at line 81 of file aabb.C.

References contains().

◆ merge() [1/2]

void oofem::AABB::merge ( const Vector & v)

Expands the bounding box to include a given point.

Updates the minimum and maximum corner coordinates of the bounding box such that the point v is contained within the box. For each coordinate direction, the bounds are enlarged only if the point lies outside the current extent.

Parameters
vPoint in global coordinates to be merged into the bounding box.

Definition at line 93 of file aabb.C.

References max, min, oofem::Vector::x, oofem::Vector::y, and oofem::Vector::z.

Referenced by oofem::ContactElement::computeAABB(), and merge().

◆ merge() [2/2]

void oofem::AABB::merge ( double x,
double y,
double z )

Expands the bounding box to include a given point.

Updates the minimum and maximum corner coordinates of the bounding box such that the point v is contained within the box. For each coordinate direction, the bounds are enlarged only if the point lies outside the current extent.

Parameters
xX-coordinate of the point.
yY-coordinate of the point.
zZ-coordinate of the point.

Definition at line 87 of file aabb.C.

References merge().

Member Data Documentation

◆ max

Vector oofem::AABB::max

Definition at line 68 of file aabb.h.

Referenced by AABB(), AABB(), oofem::ContactPair::computeSlaveAABB(), and merge().

◆ min

Vector oofem::AABB::min

Definition at line 67 of file aabb.h.

Referenced by AABB(), AABB(), oofem::ContactPair::computeSlaveAABB(), contains(), and merge().


The documentation for this class was generated from the following files:

This page is part of the OOFEM-3.0 documentation. Copyright Copyright (C) 1994-2025 Borek Patzak Bořek Patzák
Project e-mail: oofem@fsv.cvut.cz
Generated at for OOFEM by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2011