#include <vgl_area.h>
Public Member Functions | |
| vgl_oriented_box_2d () | |
| default constructor. More... | |
| vgl_oriented_box_2d (T width, T height, vgl_point_2d< T > const ¢er, T angle_in_rad) | |
| construct from center, width (major axis), height and orientedation with respect to x-axis. More... | |
| vgl_oriented_box_2d (vgl_point_2d< T > const &maj_p1, vgl_point_2d< T > const &maj_p2, T height) | |
| construct from major axis and height. More... | |
| vgl_oriented_box_2d (vgl_line_segment_2d< T > const &maj, T height) | |
| vgl_oriented_box_2d (vgl_point_2d< T > const &maj_p1, vgl_point_2d< T > const &maj_p2, vgl_point_2d< T > const &min_p1, vgl_point_2d< T > const &min_p2) | |
| the minor axis line need not be orthogonal to the major axis, and. More... | |
| vgl_oriented_box_2d (vgl_line_segment_2d< T > const &maj, vgl_line_segment_2d< T > const &min) | |
| vgl_oriented_box_2d (const vgl_box_2d< T > &box) | |
| construct from an axis aligned box. More... | |
| vgl_oriented_box_2d (const vgl_box_2d< T > &box, T angle_in_rad) | |
| construct from an axis aligned box with orientedation. More... | |
| vgl_oriented_box_2d (vgl_point_2d< T > const &p0, vgl_point_2d< T > const &p1, vgl_point_2d< T > const &p2) | |
| constructor from three corner points. More... | |
| vgl_line_segment_2d< T > | major_axis () const |
| major axis. More... | |
| vgl_point_2d< T > | centroid () const |
| center (midpoint of major axis). More... | |
| std::pair< T, T > | width_height () const |
| return width (first) and height (second). More... | |
| T | width () const |
| width - length of major axis. More... | |
| T | height () const |
| height - length of minor axis. More... | |
| T | aspect_ratio () const |
| aspsect ratio width/height. More... | |
| T | angle_in_rad () const |
| : orientedation of major axis on the range +- pi (as returned by atan2). More... | |
| bool | operator== (vgl_oriented_box_2d< T > const &ob) const |
| bool | near_equal (vgl_oriented_box_2d< T > const &ob, T tol=vgl_tolerance< T >::position) const |
| bool | contains (T const &x, T const &y) const |
| Return true if (x,y) is inside this box. More... | |
| bool | contains (vgl_point_2d< T > const &p) const |
| Return true if point is inside this box. More... | |
| void | set (vgl_line_segment_2d< T > const &major, T half_height) |
| vgl_box_2d< T > | enclosing_box () const |
| axis-aligned bounding box for *this. More... | |
| std::vector< vgl_point_2d< T > > | corners () const |
| corners of the orienteded rectangle. More... | |
| vgl_polygon< T > | obox_boundary () const |
| polygon corresponding to obox boundary. More... | |
| vgl_point_2d< T > | transform_to_obox (vgl_point_2d< T > const &p) const |
| map a point to the (u, v) coordinate system of the orienteded box. More... | |
| vgl_oriented_box_2d< T > | rotate (vgl_point_2d< T > const &rot_center, T angle_rad) const |
| rotate by angle in radians. More... | |
| vgl_oriented_box_2d< T > | translate (T tx, T ty) const |
| translate by displacement (tx, ty). More... | |
Private Attributes | |
| vgl_line_segment_2d< T > | major_axis_ |
| T | half_height_ |
Definition at line 9 of file vgl_area.h.
|
inline |
default constructor.
Definition at line 23 of file vgl_oriented_box_2d.h.
| vgl_oriented_box_2d< T >::vgl_oriented_box_2d | ( | T | width, |
| T | height, | ||
| vgl_point_2d< T > const & | center, | ||
| T | angle_in_rad | ||
| ) |
construct from center, width (major axis), height and orientedation with respect to x-axis.
rotation is around the center point. width must be greater than height!!
Definition at line 12 of file vgl_oriented_box_2d.hxx.
|
inline |
construct from major axis and height.
the center is the midpoint of the major axis
Definition at line 31 of file vgl_oriented_box_2d.h.
|
inline |
Definition at line 34 of file vgl_oriented_box_2d.h.
| vgl_oriented_box_2d< T >::vgl_oriented_box_2d | ( | vgl_point_2d< T > const & | maj_p1, |
| vgl_point_2d< T > const & | maj_p2, | ||
| vgl_point_2d< T > const & | min_p1, | ||
| vgl_point_2d< T > const & | min_p2 | ||
| ) |
the minor axis line need not be orthogonal to the major axis, and.
the major axis passes through the midpoint of the minor line segment box height is defined by the projection of the minor line segment onto the perpendicular to the major axis
Definition at line 72 of file vgl_oriented_box_2d.hxx.
|
inline |
Definition at line 42 of file vgl_oriented_box_2d.h.
| vgl_oriented_box_2d< T >::vgl_oriented_box_2d | ( | const vgl_box_2d< T > & | box | ) |
construct from an axis aligned box.
Definition at line 35 of file vgl_oriented_box_2d.hxx.
| vgl_oriented_box_2d< T >::vgl_oriented_box_2d | ( | const vgl_box_2d< T > & | box, |
| T | angle_in_rad | ||
| ) |
construct from an axis aligned box with orientedation.
the major axis of the box is rotated by angle_in_rad around the centroid
Definition at line 40 of file vgl_oriented_box_2d.hxx.
| vgl_oriented_box_2d< T >::vgl_oriented_box_2d | ( | vgl_point_2d< T > const & | p0, |
| vgl_point_2d< T > const & | p1, | ||
| vgl_point_2d< T > const & | p2 | ||
| ) |
constructor from three corner points.
The two directions from p0 to the two other points must be mutually orthogonal, i.e., a local box coordinate frame centered on p0
Definition at line 53 of file vgl_oriented_box_2d.hxx.
| T vgl_oriented_box_2d< T >::angle_in_rad | ( | ) | const |
: orientedation of major axis on the range +- pi (as returned by atan2).
Definition at line 197 of file vgl_oriented_box_2d.hxx.
|
inline |
aspsect ratio width/height.
Definition at line 74 of file vgl_oriented_box_2d.h.
| vgl_point_2d< T > vgl_oriented_box_2d< T >::centroid | ( | ) | const |
center (midpoint of major axis).
Definition at line 128 of file vgl_oriented_box_2d.hxx.
|
inline |
Return true if (x,y) is inside this box.
Definition at line 85 of file vgl_oriented_box_2d.h.
| bool vgl_oriented_box_2d< T >::contains | ( | vgl_point_2d< T > const & | p | ) | const |
Return true if point is inside this box.
Definition at line 163 of file vgl_oriented_box_2d.hxx.
| std::vector< vgl_point_2d< T > > vgl_oriented_box_2d< T >::corners | ( | ) | const |
corners of the orienteded rectangle.
Definition at line 109 of file vgl_oriented_box_2d.hxx.
| vgl_box_2d< T > vgl_oriented_box_2d< T >::enclosing_box | ( | ) | const |
axis-aligned bounding box for *this.
Definition at line 92 of file vgl_oriented_box_2d.hxx.
|
inline |
height - length of minor axis.
Definition at line 71 of file vgl_oriented_box_2d.h.
|
inline |
major axis.
Definition at line 59 of file vgl_oriented_box_2d.h.
| bool vgl_oriented_box_2d< T >::near_equal | ( | vgl_oriented_box_2d< T > const & | ob, |
| T | tol = vgl_tolerance<T>::position |
||
| ) | const |
Definition at line 175 of file vgl_oriented_box_2d.hxx.
|
inline |
polygon corresponding to obox boundary.
Definition at line 103 of file vgl_oriented_box_2d.h.
|
inline |
Definition at line 79 of file vgl_oriented_box_2d.h.
| vgl_oriented_box_2d< T > vgl_oriented_box_2d< T >::rotate | ( | vgl_point_2d< T > const & | rot_center, |
| T | angle_rad | ||
| ) | const |
rotate by angle in radians.
Definition at line 215 of file vgl_oriented_box_2d.hxx.
|
inline |
Definition at line 91 of file vgl_oriented_box_2d.h.
| vgl_point_2d< T > vgl_oriented_box_2d< T >::transform_to_obox | ( | vgl_point_2d< T > const & | p | ) | const |
map a point to the (u, v) coordinate system of the orienteded box.
Definition at line 151 of file vgl_oriented_box_2d.hxx.
| vgl_oriented_box_2d< T > vgl_oriented_box_2d< T >::translate | ( | T | tx, |
| T | ty | ||
| ) | const |
translate by displacement (tx, ty).
Definition at line 223 of file vgl_oriented_box_2d.hxx.
|
inline |
width - length of major axis.
Definition at line 68 of file vgl_oriented_box_2d.h.
| std::pair< T, T > vgl_oriented_box_2d< T >::width_height | ( | ) | const |
return width (first) and height (second).
Definition at line 101 of file vgl_oriented_box_2d.hxx.
|
private |
Definition at line 117 of file vgl_oriented_box_2d.h.
|
private |
Definition at line 116 of file vgl_oriented_box_2d.h.
1.8.15