ReadFramework
rdf::Rect Class Reference

#include <Shapes.h>

Collaboration diagram for rdf::Rect:

Public Member Functions

 Rect ()
 
 Rect (const QRect &rect)
 
 Rect (const QRectF &rect)
 
 Rect (const cv::Rect &rect)
 
 Rect (const Vector2D &topLeft, const Vector2D &size)
 
 Rect (double x, double y, double width, double height)
 
 Rect (const cv::Mat &img)
 
bool isNull () const
 
double width () const
 
double height () const
 
Vector2D size () const
 
Vector2D diagonal () const
 
double top () const
 
double bottom () const
 
double left () const
 
double right () const
 
Vector2D topLeft () const
 
Vector2D topRight () const
 
Vector2D bottomLeft () const
 
Vector2D bottomRight () const
 
Vector2D center () const
 
void move (const Vector2D &vec)
 
void scale (double factor)
 
void expand (double v)
 
void setTopLeft (const Vector2D &topLeft)
 
void setSize (const Vector2D &newSize)
 
QRect toQRect () const
 
QRectF toQRectF () const
 
cv::Rect toCvRect () const
 
bool contains (const Rect &o) const
 
bool contains (const Vector2D &pt) const
 
bool isProximate (const Rect &o, double eps=10.0) const
 Returns true if the centers are closer than eps. NOTE: the city block metric is used to compare the centers. More...
 
double area () const
 
Rect clipped (const Vector2D &size) const
 
Rect joined (const Rect &o) const
 
Rect intersected (const Rect &o) const
 
bool intersects (const Rect &o) const
 
void draw (QPainter &p) const
 
virtual QString toString () const
 

Static Public Member Functions

static Rect fromPoints (const QVector< Vector2D > &pts)
 Returns a bounding rectangle that encloses all points. More...
 

Protected Attributes

bool mIsNull = true
 
Vector2D mTopLeft
 
Vector2D mSize
 

Friends

DllCoreExport friend bool operator== (const Rect &l, const Rect &r)
 
DllCoreExport friend bool operator!= (const Rect &l, const Rect &r)
 

Constructor & Destructor Documentation

rdf::Rect::Rect ( )
rdf::Rect::Rect ( const QRect &  rect)
rdf::Rect::Rect ( const QRectF &  rect)
rdf::Rect::Rect ( const cv::Rect &  rect)
rdf::Rect::Rect ( const Vector2D topLeft,
const Vector2D size 
)
rdf::Rect::Rect ( double  x,
double  y,
double  width,
double  height 
)
rdf::Rect::Rect ( const cv::Mat &  img)

Member Function Documentation

double rdf::Rect::area ( ) const
double rdf::Rect::bottom ( ) const

Here is the caller graph for this function:

Vector2D rdf::Rect::bottomLeft ( ) const

Here is the caller graph for this function:

Vector2D rdf::Rect::bottomRight ( ) const

Here is the caller graph for this function:

Vector2D rdf::Rect::center ( ) const

Here is the caller graph for this function:

Rect rdf::Rect::clipped ( const Vector2D size) const

Here is the caller graph for this function:

bool rdf::Rect::contains ( const Rect o) const

Here is the caller graph for this function:

bool rdf::Rect::contains ( const Vector2D pt) const
Vector2D rdf::Rect::diagonal ( ) const
void rdf::Rect::draw ( QPainter &  p) const

Here is the caller graph for this function:

void rdf::Rect::expand ( double  v)

Here is the caller graph for this function:

Rect rdf::Rect::fromPoints ( const QVector< Vector2D > &  pts)
static

Returns a bounding rectangle that encloses all points.

Parameters
ptsThe point set.
Returns

Here is the caller graph for this function:

double rdf::Rect::height ( ) const

Here is the caller graph for this function:

Rect rdf::Rect::intersected ( const Rect o) const
bool rdf::Rect::intersects ( const Rect o) const

Here is the caller graph for this function:

bool rdf::Rect::isNull ( ) const

Here is the caller graph for this function:

bool rdf::Rect::isProximate ( const Rect o,
double  eps = 10.0 
) const

Returns true if the centers are closer than eps. NOTE: the city block metric is used to compare the centers.

Parameters
oThe other rect.
epsThe epsilon region.
Returns
true if the specified o is close; otherwise, false.
Rect rdf::Rect::joined ( const Rect o) const

Here is the caller graph for this function:

double rdf::Rect::left ( ) const

Here is the caller graph for this function:

void rdf::Rect::move ( const Vector2D vec)

Here is the caller graph for this function:

double rdf::Rect::right ( ) const

Here is the caller graph for this function:

void rdf::Rect::scale ( double  factor)

Here is the caller graph for this function:

void rdf::Rect::setSize ( const Vector2D newSize)
void rdf::Rect::setTopLeft ( const Vector2D topLeft)
Vector2D rdf::Rect::size ( ) const

Here is the caller graph for this function:

cv::Rect rdf::Rect::toCvRect ( ) const

Here is the caller graph for this function:

double rdf::Rect::top ( ) const

Here is the caller graph for this function:

Vector2D rdf::Rect::topLeft ( ) const

Here is the caller graph for this function:

Vector2D rdf::Rect::topRight ( ) const

Here is the caller graph for this function:

QRect rdf::Rect::toQRect ( ) const

Here is the caller graph for this function:

QRectF rdf::Rect::toQRectF ( ) const
QString rdf::Rect::toString ( ) const
virtual
double rdf::Rect::width ( ) const

Here is the caller graph for this function:

Friends And Related Function Documentation

DllCoreExport friend bool operator!= ( const Rect l,
const Rect r 
)
friend
DllCoreExport friend bool operator== ( const Rect l,
const Rect r 
)
friend

Member Data Documentation

bool rdf::Rect::mIsNull = true
protected
Vector2D rdf::Rect::mSize
protected
Vector2D rdf::Rect::mTopLeft
protected

The documentation for this class was generated from the following files: