nbox_t Class Reference

Collaboration diagram for nbox_t:

Collaboration graph
[legend]
List of all members.

Detailed Description

Spatial object class: n-dimensional box.

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_toperator+= (const nbox_t &other)
nbox_toperator= (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_tNull = __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)


Constructor & Destructor Documentation

nbox_t::nbox_t ( int  dimension = max_dimension  ) 

Create a box.

Parameters:
[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[] 
)

Create a box.

Parameters:
[in] dimension Number of dimensions for the "box".
[in] box Contains the dimensions.

Definition at line 91 of file nbox.cpp.

References array, dim, and w_assert9.

nbox_t::nbox_t ( const nbox_t nbox  ) 

Create a box.

Parameters:
[in] nbox Source for copy constructor.

Definition at line 86 of file nbox.cpp.

nbox_t::nbox_t ( const char *  s,
int  len 
)

Create a box.

Parameters:
[in] s String: used only for Tcl-based tester.
[in] len Length of s; used for Tcl-based tester.

Definition at line 104 of file nbox.cpp.

References array, dim, and w_assert9.


Member Function Documentation

void nbox_t::canonize (  ) 

Make canonical.

First point low in all dimensions, 2nd high in all dimensions

Definition at line 558 of file nbox.cpp.

References array, and dim.

int nbox_t::hcmp ( const nbox_t other,
const nbox_t universe,
int  level = 0 
) const

Comparison function for Hilbert values.

For use with bulk load.

Definition at line 522 of file nbox.cpp.

References bound(), center(), and side().

Here is the call graph for this function:

nbox_t nbox_t::operator^ ( const nbox_t other  )  const

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:


The documentation for this class was generated from the following files:
Generated on Wed Jul 7 17:22:43 2010 for Shore Storage Manager by  doxygen 1.4.7