56 {
return static_cast<float>(
vgl_area(b)); }
64 {
return vgl_intersection<T>(b, poly); }
80 Type
const max_position[2])
81 :
vgl_box_2d<Type>(min_position[2], max_position[2]) {}
117 { b.
add(
v.min_point()); b.
add(
v.max_point()); }
125 return resultf||resultr;
131 return resultf||resultr;
135 {
return static_cast<float>(
vgl_area(b)); }
145 template <
class V,
class B,
class C>
148 typedef typename C::t_type
T;
155 bool meets(B
const &b)
const override {
return C::meets(b,
poly_); }
158 #endif // vgl_rtree_c_h_
Set of intersection functions.
static float volume(vgl_box_2d< T > const &b)
vgl_bbox_2d(vgl_point_2d< Type > const &min_pos, vgl_point_2d< Type > const &max_pos)
Construct using two corner points.
bool operator==(vgl_bbox_2d< Type > const &b) const
Equality test.
a point in 2D nonhomogeneous space
static float volume(vgl_box_2d< T > const &b)
bool contains(point_t const &p) const
Returns true if p(x,y) is inside the polygon, else false.
Type min_x() const
Get min x.
T vgl_area(vgl_polygon< T > const &poly)
The area of a polygon.
static void update(vgl_box_2d< T > &b, vgl_point_2d< T > const &p)
vgl_rtree Class C for V=vgl_point_2d<T>, B = vgl_box_2d<T>.
bool meets(B const &b) const override
vgl_point_2d< Type > max_point() const
Return upper right corner of box.
vgl_rtree Class C for V=vgl_box_2d<T>, B = vgl_rbox_2d<T>.
static bool meets(vgl_point_2d< T > const &v, vgl_polygon< T > poly)
~vgl_rtree_point_box_2d()=delete
~vgl_rtree_box_box_2d()=delete
bool contains(vgl_point_2d< Type > const &p) const
Return true iff the point p is inside this box.
vgl_bbox_2d()=default
Default constructor (creates empty box).
static void update(vgl_box_2d< T > &b0, vgl_box_2d< T > const &b1)
static void update(vgl_bbox_2d< T > &b0, vgl_bbox_2d< T > const &b1)
static bool meets(vgl_box_2d< T > const &b, vgl_polygon< T > poly)
static void init(vgl_bbox_2d< T > &b, vgl_box_2d< T > const &v)
vgl_rtree_box_box_2d()=delete
static bool meet(vgl_box_2d< T > const &b0, vgl_box_2d< T > const &b1)
static bool meet(vgl_bbox_2d< T > const &b0, vgl_box_2d< T > const &v)
Contains class to represent a cartesian 2D bounding box.
vgl_bbox_2d(Type xmin, Type xmax, Type ymin, Type ymax)
Construct using ranges in x (first two args) and y (last two).
static bool meet(vgl_bbox_2d< T > const &b0, vgl_bbox_2d< T > const &b1)
vgl_bbox_2d(Type const min_position[2], Type const max_position[2])
Construct using two corner points.
Type min_y() const
Get min y.
bool meets(V const &v) const override
return true if the probe "meets" the given object.
static bool meet(vgl_box_2d< T > const &b, vgl_point_2d< T > const &p)
static bool meets(vgl_box_2d< T > const &b, vgl_polygon< T > poly)
void add(vgl_point_2d< Type > const &p)
Add a point to this box.
static bool meets(vgl_bbox_2d< T > const &b, vgl_polygon< T > poly)
vgl_point_2d< Type > min_point() const
Return lower left corner of box.
vgl_rtree_point_box_2d()=delete
static void init(vgl_box_2d< T > &b, vgl_point_2d< T > const &p)
Type max_y() const
Get max y.
Type max_x() const
Get max x.
Function predicate object for querying the tree.
static void update(vgl_bbox_2d< T > &b, vgl_box_2d< T > const &v)
vgl_rtree_polygon_probe(vgl_polygon< T > const &poly)
bool is_empty() const
Return true if this box is empty.