Graphite Version 3
An experimental 3D geometry processing program
Loading...
Searching...
No Matches
GEO::Box Class Reference

Axis-aligned bounding box. More...

#include <geogram/basic/geometry.h>

Inheritance diagram for GEO::Box:
OGF::Box3d

Public Member Functions

 Box ()
 Constructs an uninitialized box.
 Box (double x1, double y1, double z1, double x2, double y2, double z2)
 Constructs a box from lower and upper bounds.
 Box (const vec3 &lo, const vec3 &hi)
 Constructs a box from lower and upper bounds.
vec3 lo () const
 Gets the lower bounds.
vec3 hi () const
 Gets the higher bounds.
bool contains (const vec3 &b) const
 Tests whether a box contains a point.
void enlarge (double d)
 Enlarges the box.
void clear ()
 Makes this box empty.
void add (const vec3 &p)
 Adds a point to this box.

Public Attributes

double xyz_min [3]
double xyz_max [3]

Detailed Description

Axis-aligned bounding box.

Definition at line 689 of file geometry.h.

Constructor & Destructor Documentation

◆ Box() [1/3]

GEO::Box::Box ( )
inline

Constructs an uninitialized box.

Please note that the box is uninitialized. One may call clear() to get an initialized empty box.

Definition at line 699 of file geometry.h.

◆ Box() [2/3]

GEO::Box::Box ( double x1,
double y1,
double z1,
double x2,
double y2,
double z2 )
inline

Constructs a box from lower and upper bounds.

Parameters
[in]x1,y1,z1the lower bounds
[in]x2,y2,z2the upper bounds

Definition at line 707 of file geometry.h.

◆ Box() [3/3]

GEO::Box::Box ( const vec3 & lo,
const vec3 & hi )
inline

Constructs a box from lower and upper bounds.

Parameters
[in]lothe lower bound as a vec3
[in]hithe upper bound as a vec3

Definition at line 721 of file geometry.h.

Member Function Documentation

◆ add()

void GEO::Box::add ( const vec3 & p)
inline

Adds a point to this box.

Parameters
[in]pa const reference to the point to be added

The box is the smallest axis-aligned box enclosing all added points

Definition at line 796 of file geometry.h.

◆ clear()

void GEO::Box::clear ( )
inline

Makes this box empty.

Initializes the lower bounds to the greatest floating point number and the higher bounds to minus the greatest floating point number

Definition at line 783 of file geometry.h.

◆ contains()

bool GEO::Box::contains ( const vec3 & b) const
inline

Tests whether a box contains a point.

Parameters
[in]bthe point
Returns
true if this box contains b, false otherwise

Definition at line 751 of file geometry.h.

◆ enlarge()

void GEO::Box::enlarge ( double d)
inline

Enlarges the box.

Parameters
[in]dthe amount that should be subtracted from the lower bounds and added to the upper bounds

Definition at line 768 of file geometry.h.

◆ hi()

vec3 GEO::Box::hi ( ) const
inline

Gets the higher bounds.

Returns
the higher bounds as a vec3

Definition at line 742 of file geometry.h.

◆ lo()

vec3 GEO::Box::lo ( ) const
inline

Gets the lower bounds.

Returns
the lower bounds as a vec3

Definition at line 734 of file geometry.h.

Member Data Documentation

◆ xyz_max

double GEO::Box::xyz_max[3]

Definition at line 692 of file geometry.h.

◆ xyz_min

double GEO::Box::xyz_min[3]

Definition at line 691 of file geometry.h.


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