Graphite  Version 3
An experimental 3D geometry processing program
OGF::Box2d Class Reference

A 2d axis aligned box. More...

#include <OGF/basic/math/geometry.h>

Public Member Functions

 Box2d ()
 Constructs a new uninitialized Box2d.
 
void add_point (const vec2 &p)
 Adds a point to this Box2d. More...
 
void add_box (const Box2d &B)
 Adds a box to this Box2d. More...
 
double width () const
 Gets the width of this box. More...
 
double height () const
 Gets the height of this box. More...
 
double x_min () const
 Gets the minimum x coordinate in this box. More...
 
double x_max () const
 Gets the maximum x coordinate in this box. More...
 
double y_min () const
 Gets the minimum y coordinate in this box. More...
 
double y_max () const
 Gets the maximum y coordinate in this box. More...
 
bool initialized () const
 Tests whether the box is initialized. More...
 
void clear ()
 Clears the box.
 

Detailed Description

A 2d axis aligned box.

Definition at line 107 of file geometry.h.

Member Function Documentation

◆ add_box()

void OGF::Box2d::add_box ( const Box2d B)
inline

Adds a box to this Box2d.

On exit, this box is replaced with the union of its previous value and B.

Parameters
[in]Ba const reference to the box to be added.

Definition at line 140 of file geometry.h.

◆ add_point()

void OGF::Box2d::add_point ( const vec2 p)
inline

Adds a point to this Box2d.

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

Definition at line 120 of file geometry.h.

◆ height()

double OGF::Box2d::height ( ) const
inline

Gets the height of this box.

Returns
the width (i.e., ymax() - ymin()) of this box

Definition at line 159 of file geometry.h.

◆ initialized()

bool OGF::Box2d::initialized ( ) const
inline

Tests whether the box is initialized.

At creation, a box is uninitialized. It becomes initialized whenever a add_xxx() function is called.

Definition at line 213 of file geometry.h.

◆ width()

double OGF::Box2d::width ( ) const
inline

Gets the width of this box.

Returns
the width (i.e., xmax() - xmin()) of this box

Definition at line 151 of file geometry.h.

◆ x_max()

double OGF::Box2d::x_max ( ) const
inline

Gets the maximum x coordinate in this box.

Result is undetermined if the box is not initialized.

Returns
the maximum x coordinate
See also
initialized()

Definition at line 181 of file geometry.h.

◆ x_min()

double OGF::Box2d::x_min ( ) const
inline

Gets the minimum x coordinate in this box.

Result is undetermined if the box is not initialized.

Returns
the minimum x coordinate
See also
initialized()

Definition at line 170 of file geometry.h.

◆ y_max()

double OGF::Box2d::y_max ( ) const
inline

Gets the maximum y coordinate in this box.

Result is undetermined if the box is not initialized.

Returns
the maximum y coordinate
See also
initialized()

Definition at line 203 of file geometry.h.

◆ y_min()

double OGF::Box2d::y_min ( ) const
inline

Gets the minimum y coordinate in this box.

Result is undetermined if the box is not initialized.

Returns
the minimum y coordinate
See also
initialized()

Definition at line 192 of file geometry.h.


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