2 #ifndef vgl_oriented_box_2d_h_ 3 #define vgl_oriented_box_2d_h_ 100 std::vector<vgl_point_2d<T> >
corners()
const;
104 std::vector<vgl_point_2d<T> > corns = this->
corners();
124 #define VGL_ORIENTED_BOX_2D_INSTANTIATE(T) extern "please include vgl/vgl_point_2d.hxx first" 126 #endif // vgl_oriented_box_2d_h_
T angle_in_rad() const
: orientedation of major axis on the range +- pi (as returned by atan2).
a point in 2D nonhomogeneous space
vgl_oriented_box_2d(vgl_line_segment_2d< T > const &maj, T height)
vgl_oriented_box_2d()
default constructor.
vgl_oriented_box_2d< T > translate(T tx, T ty) const
translate by displacement (tx, ty).
vgl_point_2d< Type > point2() const
The other end-point of the line segment.
std::ostream & operator<<(std::ostream &s, vgl_orient_box_3d< Type > const &p)
Write box to stream.
std::pair< T, T > width_height() const
return width (first) and height (second).
vgl_box_2d< T > enclosing_box() const
axis-aligned bounding box for *this.
T width() const
width - length of major axis.
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.
T height() const
height - length of minor axis.
bool contains(T const &x, T const &y) const
Return true if (x,y) is inside this box.
void set(vgl_line_segment_2d< T > const &major, T half_height)
vgl_point_2d< T > centroid() const
center (midpoint of major axis).
std::vector< vgl_point_2d< T > > corners() const
corners of the orienteded rectangle.
vgl_line_segment_2d< T > major_axis_
std::istream & operator>>(std::istream &is, vgl_orient_box_3d< Type > &p)
Read box from stream.
T aspect_ratio() const
aspsect ratio width/height.
vgl_line_segment_2d< T > major_axis() const
major axis.
bool near_equal(vgl_oriented_box_2d< T > const &ob, T tol=vgl_tolerance< T >::position) const
void set(vgl_point_2d< Type > const &p1, vgl_point_2d< Type > const &p2)
Assignment.
vgl_oriented_box_2d(vgl_line_segment_2d< T > const &maj, vgl_line_segment_2d< T > const &min)
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.
vgl_point_2d< Type > point1() const
One end-point of the line segment.
vgl_polygon< T > obox_boundary() const
polygon corresponding to obox boundary.
vgl_oriented_box_2d< T > rotate(vgl_point_2d< T > const &rot_center, T angle_rad) const
rotate by angle in radians.
bool operator==(vgl_oriented_box_2d< T > const &ob) const