Geogram Version 1.10.1
A programming library of geometric algorithms
Loading...
Searching...
No Matches
GEO::Box2d Class Reference

Axis-aligned bounding box. More...

#include <geogram/basic/geometry.h>

Public Member Functions

 Box2d ()
 Constructs an uninitialized Box2d.
 
 Box2d (double x1, double y1, double x2, double y2)
 Constructs a box from lower and upper bounds.
 
 Box2d (const vec2 &lo, const vec2 &hi)
 Constructs a box from lower and upper bounds.
 
vec2 lo () const
 Gets the lower bounds.
 
vec2 hi () const
 Gets the higher bounds.
 
bool contains (const vec2 &b) const
 Tests whether a box contains a point.
 
void enlarge (double d)
 Enlarges the box.
 

Public Attributes

double xy_min [2]
 
double xy_max [2]
 

Detailed Description

Axis-aligned bounding box.

Definition at line 817 of file geometry.h.

Constructor & Destructor Documentation

◆ Box2d() [1/3]

GEO::Box2d::Box2d ( )
inline

Constructs an uninitialized Box2d.

Definition at line 825 of file geometry.h.

◆ Box2d() [2/3]

GEO::Box2d::Box2d ( double  x1,
double  y1,
double  x2,
double  y2 
)
inline

Constructs a box from lower and upper bounds.

Parameters
[in]x1,y1the lower bounds
[in]x2,y2the upper bounds

Definition at line 833 of file geometry.h.

◆ Box2d() [3/3]

GEO::Box2d::Box2d ( const vec2 lo,
const vec2 hi 
)
inline

Constructs a box from lower and upper bounds.

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

Definition at line 845 of file geometry.h.

Member Function Documentation

◆ contains()

bool GEO::Box2d::contains ( const vec2 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 873 of file geometry.h.

◆ enlarge()

void GEO::Box2d::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 890 of file geometry.h.

◆ hi()

vec2 GEO::Box2d::hi ( ) const
inline

Gets the higher bounds.

Returns
the higher bounds as a vec2

Definition at line 864 of file geometry.h.

◆ lo()

vec2 GEO::Box2d::lo ( ) const
inline

Gets the lower bounds.

Returns
the lower bounds as a vec2

Definition at line 856 of file geometry.h.

Member Data Documentation

◆ xy_max

double GEO::Box2d::xy_max[2]

Definition at line 820 of file geometry.h.

◆ xy_min

double GEO::Box2d::xy_min[2]

Definition at line 819 of file geometry.h.


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