Visual Servoing Platform  version 3.3.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 51 of file vpRectOriented.h.

Constructor & Destructor Documentation

◆ vpRectOriented() [1/3]

vpRectOriented::vpRectOriented ( )

Default constructor.

Definition at line 43 of file vpRectOriented.cpp.

◆ vpRectOriented() [2/3]

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 54 of file vpRectOriented.cpp.

◆ vpRectOriented() [3/3]

vpRectOriented::vpRectOriented ( const vpRect rect)

Copy constructor.

Parameters
rectRectangle to copy.

Definition at line 73 of file vpRectOriented.cpp.

Member Function Documentation

◆ getBottomLeft()

vpImagePoint vpRectOriented::getBottomLeft ( ) const

Get the bottom-left corner.

Definition at line 177 of file vpRectOriented.cpp.

◆ getBottomRight()

vpImagePoint vpRectOriented::getBottomRight ( ) const

Get the bottom-right corner.

Definition at line 180 of file vpRectOriented.cpp.

◆ getCenter()

vpImagePoint vpRectOriented::getCenter ( ) const

Get the rectangle center point.

Definition at line 168 of file vpRectOriented.cpp.

◆ getHeight()

double vpRectOriented::getHeight ( ) const

Get the rectangle height.

Definition at line 201 of file vpRectOriented.cpp.

◆ getOrientation()

double vpRectOriented::getOrientation ( ) const

Get the rectangle orientation (rad).

Definition at line 218 of file vpRectOriented.cpp.

◆ getTopLeft()

vpImagePoint vpRectOriented::getTopLeft ( ) const

Get the top-left corner.

Definition at line 171 of file vpRectOriented.cpp.

◆ getTopRight()

vpImagePoint vpRectOriented::getTopRight ( ) const

Get the top-right corner.

Definition at line 174 of file vpRectOriented.cpp.

◆ getWidth()

double vpRectOriented::getWidth ( ) const

Get the rectangle width.

Definition at line 198 of file vpRectOriented.cpp.

◆ isInside()

bool vpRectOriented::isInside ( const vpImagePoint point) const

Check whether the point is inside the rectangle.

Definition at line 221 of file vpRectOriented.cpp.

◆ operator vpRect()

vpRectOriented::operator vpRect ( )

Conversion to vpRect operator.

Definition at line 129 of file vpRectOriented.cpp.

◆ operator=() [1/2]

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

Assignement operator from vpRect.

Parameters
rectRectangle to copy.

Definition at line 110 of file vpRectOriented.cpp.

◆ operator=() [2/2]

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

◆ setCenter()

void vpRectOriented::setCenter ( const vpImagePoint center)

Set the center of the rectangle.

Definition at line 158 of file vpRectOriented.cpp.

◆ setOrientation()

void vpRectOriented::setOrientation ( double  theta)

Set the rectangle orientation (rad).

Definition at line 204 of file vpRectOriented.cpp.

◆ setPoints()

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 141 of file vpRectOriented.cpp.

◆ setSize()

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

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

Definition at line 183 of file vpRectOriented.cpp.