Read@CVL
rdf::Vector2D Class Reference

#include <Shapes.h>

Public Member Functions

 Vector2D ()
 
 Vector2D (double x, double y)
 
 Vector2D (const QPoint &p)
 
 Vector2D (const QPointF &p)
 
 Vector2D (const QSize &s)
 
 Vector2D (const QSizeF &s)
 
 Vector2D (const cv::Point &v)
 
 Vector2D (const cv::Size &s)
 
void operator+= (const Vector2D &vec)
 
void operator-= (const Vector2D &vec)
 
void operator*= (const double &scalar)
 
void operator/= (const double &scalar)
 
void operator+= (const double &scalar)
 
void operator-= (const double &scalar)
 
bool isNull () const
 
void setX (double x)
 
double x () const
 
void setY (double y)
 
double y () const
 
Vector2D normalVec () const
 
QPoint toQPoint () const
 
QPointF toQPointF () const
 
QSize toQSize () const
 
QSizeF toQSizeF () const
 
cv::Point toCvPoint () const
 
cv::Point2d toCvPoint2d () const
 
cv::Point2f toCvPoint2f () const
 
cv::Size toCvSize () const
 
cv::Mat toMatRow () const
 Converts the vector into a row cv::Mat. More...
 
cv::Mat toMatCol () const
 Converts the vector into a column cv::Mat. More...
 
QString toString () const
 
void draw (QPainter &p) const
 
double angle () const
 
double sqLength () const
 Returns the vector's squared length. More...
 
double length () const
 
void rotate (double angle)
 
double theta (const Vector2D &o) const
 Computes the length normalized dot product between the vector and o. More...
 
bool isNeighbor (const Vector2D &other, double radius) const
 

Static Public Member Functions

static Vector2D max (const Vector2D &v1, const Vector2D &v2)
 
static Vector2D min (const Vector2D &v1, const Vector2D &v2)
 
static Vector2D max ()
 
static Vector2D min ()
 

Protected Attributes

bool mIsNull = true
 
double mX = 0
 
double mY = 0
 

Friends

DllCoreExport friend QDataStream & operator<< (QDataStream &s, const Vector2D &v)
 
DllCoreExport friend QDebug operator<< (QDebug d, const Vector2D &v)
 
DllCoreExport friend bool operator== (const Vector2D &l, const Vector2D &r)
 
DllCoreExport friend bool operator!= (const Vector2D &l, const Vector2D &r)
 
DllCoreExport friend Vector2D operator+ (const Vector2D &l, const Vector2D &r)
 
DllCoreExport friend Vector2D operator- (const Vector2D &l, const Vector2D &r)
 
DllCoreExport friend double operator* (const Vector2D &l, const Vector2D &r)
 Computes the scalar product between l and r. More...
 
DllCoreExport friend Vector2D operator* (const Vector2D &l, double s)
 
DllCoreExport friend Vector2D operator* (double s, const Vector2D &l)
 
DllCoreExport friend Vector2D operator/ (const Vector2D &l, double s)
 

Constructor & Destructor Documentation

rdf::Vector2D::Vector2D ( )
rdf::Vector2D::Vector2D ( double  x,
double  y 
)
rdf::Vector2D::Vector2D ( const QPoint &  p)
rdf::Vector2D::Vector2D ( const QPointF &  p)
rdf::Vector2D::Vector2D ( const QSize &  s)
rdf::Vector2D::Vector2D ( const QSizeF &  s)
rdf::Vector2D::Vector2D ( const cv::Point &  v)
rdf::Vector2D::Vector2D ( const cv::Size &  s)

Member Function Documentation

double rdf::Vector2D::angle ( ) const
void rdf::Vector2D::draw ( QPainter &  p) const
bool rdf::Vector2D::isNeighbor ( const Vector2D other,
double  radius 
) const
bool rdf::Vector2D::isNull ( ) const
double rdf::Vector2D::length ( ) const
Vector2D rdf::Vector2D::max ( const Vector2D v1,
const Vector2D v2 
)
static
Vector2D rdf::Vector2D::max ( )
static
Vector2D rdf::Vector2D::min ( const Vector2D v1,
const Vector2D v2 
)
static
Vector2D rdf::Vector2D::min ( )
static
Vector2D rdf::Vector2D::normalVec ( ) const
void rdf::Vector2D::operator*= ( const double &  scalar)
inline
void rdf::Vector2D::operator+= ( const Vector2D vec)
inline
void rdf::Vector2D::operator+= ( const double &  scalar)
inline
void rdf::Vector2D::operator-= ( const Vector2D vec)
inline
void rdf::Vector2D::operator-= ( const double &  scalar)
inline
void rdf::Vector2D::operator/= ( const double &  scalar)
inline
void rdf::Vector2D::rotate ( double  angle)
void rdf::Vector2D::setX ( double  x)
void rdf::Vector2D::setY ( double  y)
double rdf::Vector2D::sqLength ( ) const

Returns the vector's squared length.

Returns
double rdf::Vector2D::theta ( const Vector2D o) const

Computes the length normalized dot product between the vector and o.

Parameters
oAnother vector.
Returns
The cosinus of theta, the angle between both vectors
cv::Point rdf::Vector2D::toCvPoint ( ) const
cv::Point2d rdf::Vector2D::toCvPoint2d ( ) const
cv::Point2f rdf::Vector2D::toCvPoint2f ( ) const
cv::Size rdf::Vector2D::toCvSize ( ) const
cv::Mat rdf::Vector2D::toMatCol ( ) const

Converts the vector into a column cv::Mat.

Returns
a 1 x 2 CV_64FC2 mat.
cv::Mat rdf::Vector2D::toMatRow ( ) const

Converts the vector into a row cv::Mat.

Returns
a 2 x 1 CV_64FC1 mat.
QPoint rdf::Vector2D::toQPoint ( ) const
QPointF rdf::Vector2D::toQPointF ( ) const
QSize rdf::Vector2D::toQSize ( ) const
QSizeF rdf::Vector2D::toQSizeF ( ) const
QString rdf::Vector2D::toString ( ) const
double rdf::Vector2D::x ( ) const
inline
double rdf::Vector2D::y ( ) const
inline

Friends And Related Function Documentation

DllCoreExport friend bool operator!= ( const Vector2D l,
const Vector2D r 
)
friend
DllCoreExport friend double operator* ( const Vector2D l,
const Vector2D r 
)
friend

Computes the scalar product between l and r.

Parameters
lA vector l.
rA vector r.
Returns
DllCoreExport friend Vector2D operator* ( const Vector2D l,
double  s 
)
friend
DllCoreExport friend Vector2D operator* ( double  s,
const Vector2D l 
)
friend
DllCoreExport friend Vector2D operator+ ( const Vector2D l,
const Vector2D r 
)
friend
DllCoreExport friend Vector2D operator- ( const Vector2D l,
const Vector2D r 
)
friend
DllCoreExport friend Vector2D operator/ ( const Vector2D l,
double  s 
)
friend
DllCoreExport friend QDataStream& operator<< ( QDataStream &  s,
const Vector2D v 
)
friend
DllCoreExport friend QDebug operator<< ( QDebug  d,
const Vector2D v 
)
friend
DllCoreExport friend bool operator== ( const Vector2D l,
const Vector2D r 
)
friend

Member Data Documentation

bool rdf::Vector2D::mIsNull = true
protected
double rdf::Vector2D::mX = 0
protected
double rdf::Vector2D::mY = 0
protected

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