An n-dimensional box is represented as: -xlow, ylow, (lower left point) -xhigh, yhigh. (higher right point). Only integer coordinates are supported for the points. This is used in the API for R*-trees.
Definition at line 52 of file nbox.h.
Public Types | |
typedef w_base_t::int4_t | int4_t |
enum | |
enum | sob_cmp_t |
Enum to describe comparisons. | |
Public Member Functions | |
bool | is_Null () const |
nbox_t (int dimension=max_dimension) | |
nbox_t (int dimension, int box[]) | |
nbox_t (const nbox_t &nbox) | |
nbox_t (const char *s, int len) | |
virtual | ~nbox_t () |
int | dimension () const |
return given dimension | |
int | bound (int n) const |
return highest value for nth dimension | |
int | side (int n) const |
return length of nth side | |
int | center (int n) const |
return middle of nth side | |
bool | empty () const |
void | squared () |
void | nullify () |
void | canonize () |
Make canonical. | |
int | hvalue (const nbox_t &universe, int level=0) const |
Return Hilbert value. | |
int | hcmp (const nbox_t &other, const nbox_t &universe, int level=0) const |
Comparison function for Hilbert values. | |
void | print (ostream &, int level) const |
void | draw (int level, ostream &DrawFile, const nbox_t &CoverAll) const |
double | area () const |
Area of a box Return value: >0 : valid box =0 : a point <0 : empty box. | |
int | margin () |
Margin of a Rectangle. | |
nbox_t | operator^ (const nbox_t &other) const |
nbox_t | operator+ (const nbox_t &other) const |
nbox_t & | operator+= (const nbox_t &other) |
nbox_t & | operator= (const nbox_t &other) |
bool | operator== (const nbox_t &other) const |
bool | operator/ (const nbox_t &other) const |
bool | contains (const nbox_t &other) const |
bool | operator|| (const nbox_t &other) const |
bool | operator> (const nbox_t &other) const |
bool | operator< (const nbox_t &other) const |
double | operator * (const nbox_t &other) const |
nbox_t (const char *s) | |
For Tcl/smsh use only. | |
operator char * () | |
For Tcl/smsh use only. | |
void | put (const char *) |
For Tcl/smsh use only. | |
void | bytes2box (const char *key, int klen) |
conversion from key to box | |
const void * | kval () const |
conversion from box to key | |
int | klen () const |
conversion from box to key | |
Static Public Attributes | |
static const int4_t | max_int4 = w_base_t::int4_max |
static const int4_t | min_int4 = w_base_t::int4_min |
static nbox_t & | Null = __Null__ |
Special marker for queries. This is not a box with area 0, but rather, a non-box i.e., not a legit value. | |
Protected Attributes | |
int4_t | array [2 *max_dimension] |
int | dim |
Friends | |
ostream & | operator<< (ostream &os, const nbox_t &box) |
nbox_t::nbox_t | ( | int | dimension = max_dimension |
) |
Create a box.
[in] | dimension | Number of dimensions for the "box". |
Definition at line 76 of file nbox.cpp.
References array, nullify(), and w_assert9.
Referenced by operator+(), and operator^().
Here is the call graph for this function:
Here is the caller graph for this function:
nbox_t::nbox_t | ( | int | dimension, | |
int | box[] | |||
) |
nbox_t::nbox_t | ( | const nbox_t & | nbox | ) |
nbox_t::nbox_t | ( | const char * | s, | |
int | len | |||
) |
void nbox_t::canonize | ( | ) |
Some binary operations: ^: intersection -> box +: bounding box -> box (result of addition) +=: enlarge by adding the new box ==: exact match -> boolean /: containment -> boolean ||: overlap -> boolean >: bigger (comapre low values) -> boolean <: smaller (comapre low values) -> boolean *: square of distance between centers of two boxes
Definition at line 294 of file nbox.cpp.
References array, dim, nbox_t(), and w_assert1.
Here is the call graph for this function: