Visual Servoing Platform  version 3.4.0
vpRectOriented Class Reference

#include <vpRectOriented.h>

Public Member Functions

 vpRectOriented ()
 
 vpRectOriented (const vpImagePoint &center, double width, double height, double theta=0)
 
 vpRectOriented (const vpRect &rect)
 
vpRectOrientedoperator= (const vpRectOriented &rect)=default
 
vpRectOrientedoperator= (const vpRect &rect)
 
 operator vpRect ()
 
void setCenter (const vpImagePoint &center)
 
void setPoints (const vpImagePoint &topLeft, const vpImagePoint &topRight, const vpImagePoint &bottomLeft, const vpImagePoint &bottomRight)
 
vpImagePoint getCenter () const
 
vpImagePoint getTopLeft () const
 
vpImagePoint getTopRight () const
 
vpImagePoint getBottomLeft () const
 
vpImagePoint getBottomRight () const
 
void setSize (double width, double height)
 
double getWidth () const
 
double getHeight () const
 
void setOrientation (double theta)
 
double getOrientation () const
 
bool isInside (const vpImagePoint &point) const
 

Detailed Description

Defines an oriented rectangle in the plane.

Definition at line 52 of file vpRectOriented.h.

Constructor & Destructor Documentation

vpRectOriented::vpRectOriented ( )

Default constructor.

Definition at line 44 of file vpRectOriented.cpp.

vpRectOriented::vpRectOriented ( const vpImagePoint center,
double  width,
double  height,
double  theta = 0 
)

Constructor.

Parameters
centerThe rectangle center.
widthThe rectangle width.
heightThe rectangle height.
thetaThe rectangle orientation (rad).

Definition at line 55 of file vpRectOriented.cpp.

References vpImagePoint::get_i(), vpImagePoint::get_j(), vpImagePoint::set_i(), and vpImagePoint::set_j().

Member Function Documentation

vpImagePoint vpRectOriented::getBottomLeft ( ) const

Get the bottom-left corner.

Definition at line 178 of file vpRectOriented.cpp.

Referenced by vpRectOriented().

vpImagePoint vpRectOriented::getBottomRight ( ) const

Get the bottom-right corner.

Definition at line 181 of file vpRectOriented.cpp.

Referenced by vpRectOriented().

vpImagePoint vpRectOriented::getCenter ( ) const

Get the rectangle center point.

Definition at line 169 of file vpRectOriented.cpp.

Referenced by vpRectOriented().

double vpRectOriented::getHeight ( ) const

Get the rectangle height.

Definition at line 202 of file vpRectOriented.cpp.

Referenced by vpImageTools::extract(), and vpRectOriented().

double vpRectOriented::getOrientation ( ) const

Get the rectangle orientation (rad).

Definition at line 219 of file vpRectOriented.cpp.

Referenced by vpImageTools::extract(), and vpRectOriented().

vpImagePoint vpRectOriented::getTopLeft ( ) const

Get the top-left corner.

Definition at line 172 of file vpRectOriented.cpp.

Referenced by vpImageTools::extract(), and vpRectOriented().

vpImagePoint vpRectOriented::getTopRight ( ) const

Get the top-right corner.

Definition at line 175 of file vpRectOriented.cpp.

Referenced by vpRectOriented().

double vpRectOriented::getWidth ( ) const

Get the rectangle width.

Definition at line 199 of file vpRectOriented.cpp.

Referenced by vpImageTools::extract(), and vpRectOriented().

bool vpRectOriented::isInside ( const vpImagePoint point) const

Check whether the point is inside the rectangle.

Definition at line 222 of file vpRectOriented.cpp.

References vpImagePoint::get_i(), and vpImagePoint::get_j().

vpRectOriented::operator vpRect ( )

Conversion to vpRect operator.

Definition at line 130 of file vpRectOriented.cpp.

References vpException::badValue.

vpRectOriented& vpRectOriented::operator= ( const vpRectOriented rect)
default

Referenced by vpRectOriented().

vpRectOriented & vpRectOriented::operator= ( const vpRect rect)

Assignement operator from vpRect.

Parameters
rectRectangle to copy.

Definition at line 111 of file vpRectOriented.cpp.

References vpImagePoint::get_i(), vpImagePoint::get_j(), vpRect::getCenter(), vpRect::getHeight(), vpRect::getWidth(), vpImagePoint::set_i(), and vpImagePoint::set_j().

void vpRectOriented::setCenter ( const vpImagePoint center)

Set the center of the rectangle.

Definition at line 159 of file vpRectOriented.cpp.

void vpRectOriented::setOrientation ( double  theta)

Set the rectangle orientation (rad).

Definition at line 205 of file vpRectOriented.cpp.

References vpImagePoint::get_i(), vpImagePoint::get_j(), vpImagePoint::set_i(), and vpImagePoint::set_j().

void vpRectOriented::setPoints ( const vpImagePoint topLeft,
const vpImagePoint topRight,
const vpImagePoint bottomLeft,
const vpImagePoint bottomRight 
)

Set the corners of the rectangle.

Warning
This method doesn't check whether the 4 points actually form a rectangle! The behaviour is undefined if it is not the case.

Definition at line 142 of file vpRectOriented.cpp.

References vpImagePoint::get_i(), vpImagePoint::get_j(), vpImagePoint::set_i(), and vpImagePoint::set_j().

void vpRectOriented::setSize ( double  width,
double  height 
)

Set the size of the rectangle : performs a homothety relatively to the rectangle center.

Definition at line 184 of file vpRectOriented.cpp.

References vpImagePoint::get_i(), vpImagePoint::get_j(), vpImagePoint::set_i(), and vpImagePoint::set_j().