A rectangle_region implements the region concept for rectangular regions defined by a lower left-hand corner and an upper right-hand corner. More...
#include <rectangle_region.h>
Public Member Functions | |
rectangle_region () | |
rectangle_region (const Point &lower, const Point &upper) | |
bool | contains (const Point &point) const |
Returns true if a given point is contained within the region. | |
Static Public Member Functions | |
static bool | contains (const Point &point, const Point &lower, const Point &upper) |
Public Attributes | |
Point | lower |
Point | upper |
Detailed Description
template<typename Point, const unsigned int i = NS_TR1::tuple_size<Point>::value - 1>
struct spatial::rectangle_region< Point, i >
A rectangle_region implements the region concept for rectangular regions defined by a lower left-hand corner and an upper right-hand corner.
The region concept is not yet fully defined and may change in a future version. Currently, a region must define a bounding box consisting of two public member variables—lower and upper—which specify the lower left and upper right corners of the box. In addition, a public non-static member function must be defined with with the signature: bool contains(const Point &)
Region classes are intended to allow iteration over ranges within arbitrarily shaped regions without post-filtering a rectangular range, reducing the total number of comparisions. Such range searches can be performed with the kd_tree::begin<Region>(const Region &) and kd_tree<Region>::end() functions. rectangle_region is the default region type used by kd_tree for range searches.
Definition at line 52 of file rectangle_region.h.
Constructor & Destructor Documentation
spatial::rectangle_region< Point, i >::rectangle_region | ( | ) | [inline] |
Definition at line 56 of file rectangle_region.h.
spatial::rectangle_region< Point, i >::rectangle_region | ( | const Point & | lower, |
const Point & | upper | ||
) | [inline] |
Definition at line 58 of file rectangle_region.h.
Member Function Documentation
static bool spatial::rectangle_region< Point, i >::contains | ( | const Point & | point, |
const Point & | lower, | ||
const Point & | upper | ||
) | [inline, static] |
Definition at line 64 of file rectangle_region.h.
bool spatial::rectangle_region< Point, i >::contains | ( | const Point & | point | ) | const [inline] |
Returns true if a given point is contained within the region.
The point must lie within or on the boundary defining the region.
- Parameters:
-
point The point to test.
- Returns:
- True if a given point is contained within the region, false otherwise.
Definition at line 79 of file rectangle_region.h.
Member Data Documentation
Point spatial::rectangle_region< Point, i >::lower |
Definition at line 53 of file rectangle_region.h.
Point spatial::rectangle_region< Point, i >::upper |
Definition at line 53 of file rectangle_region.h.
The documentation for this struct was generated from the following file:
Copyright © 2006-2009 Savarese Software Research Corporation.