QPoint Class Reference

QPoint Class Reference

#include <qpoint.h>

Class Description

Definition at line 53 of file qpoint.h.

Public Member Functions

 QPoint ()
 
 QPoint (int xpos, int ypos)
 
bool isNull () const
 
int x () const
 
int y () const
 
void setX (int x)
 
void setY (int y)
 
int manhattanLength () const
 
intrx ()
 
intry ()
 
QPointoperator+= (const QPoint &p)
 
QPointoperator-= (const QPoint &p)
 
QPointoperator*= (float c)
 
QPointoperator*= (double c)
 
QPointoperator*= (int c)
 
QPointoperator/= (qreal c)
 

Friends

class QTransform
 
bool operator== (const QPoint &, const QPoint &)
 
bool operator!= (const QPoint &, const QPoint &)
 
const QPoint operator+ (const QPoint &, const QPoint &)
 
const QPoint operator- (const QPoint &, const QPoint &)
 
const QPoint operator* (const QPoint &, float)
 
const QPoint operator* (float, const QPoint &)
 
const QPoint operator* (const QPoint &, double)
 
const QPoint operator* (double, const QPoint &)
 
const QPoint operator* (const QPoint &, int)
 
const QPoint operator* (int, const QPoint &)
 
const QPoint operator- (const QPoint &)
 
const QPoint operator/ (const QPoint &, qreal)
 

Constructor & Destructor Documentation

QPoint ( )
inline

Definition at line 119 of file qpoint.h.

120 { xp=0; yp=0; }
QPoint ( int  xpos,
int  ypos 
)
inline

Definition at line 122 of file qpoint.h.

123 { xp = xpos; yp = ypos; }

Member Function Documentation

bool isNull ( ) const
inline

Definition at line 125 of file qpoint.h.

126 { return xp == 0 && yp == 0; }
int x ( ) const
inline

Definition at line 128 of file qpoint.h.

129 { return xp; }
int y ( ) const
inline

Definition at line 131 of file qpoint.h.

132 { return yp; }
void setX ( int  x)
inline

Definition at line 134 of file qpoint.h.

135 { xp = xpos; }
void setY ( int  y)
inline

Definition at line 137 of file qpoint.h.

138 { yp = ypos; }
int manhattanLength ( ) const
int & rx ( )
inline

Definition at line 140 of file qpoint.h.

141 { return xp; }
int & ry ( )
inline

Definition at line 143 of file qpoint.h.

144 { return yp; }
QPoint & operator+= ( const QPoint p)
inline

Definition at line 146 of file qpoint.h.

147 { xp+=p.xp; yp+=p.yp; return *this; }
QPoint & operator-= ( const QPoint p)
inline

Definition at line 149 of file qpoint.h.

150 { xp-=p.xp; yp-=p.yp; return *this; }
QPoint & operator*= ( float  c)
inline

Definition at line 152 of file qpoint.h.

153 { xp = qRound(xp*c); yp = qRound(yp*c); return *this; }
const GLubyte * c
Definition: GLee.h:5419
QPoint & operator*= ( double  c)
inline

Definition at line 155 of file qpoint.h.

156 { xp = qRound(xp*c); yp = qRound(yp*c); return *this; }
const GLubyte * c
Definition: GLee.h:5419
QPoint & operator*= ( int  c)
inline

Definition at line 158 of file qpoint.h.

159 { xp = xp*c; yp = yp*c; return *this; }
const GLubyte * c
Definition: GLee.h:5419
QPoint & operator/= ( qreal  c)
inline

Definition at line 194 of file qpoint.h.

195 {
196  xp = qRound(xp/c);
197  yp = qRound(yp/c);
198  return *this;
199 }
const GLubyte * c
Definition: GLee.h:5419

Friends And Related Function Documentation

friend class QTransform
friend

Definition at line 94 of file qpoint.h.

bool operator== ( const QPoint p1,
const QPoint p2 
)
friend

Definition at line 161 of file qpoint.h.

162 { return p1.xp == p2.xp && p1.yp == p2.yp; }
bool operator!= ( const QPoint p1,
const QPoint p2 
)
friend

Definition at line 164 of file qpoint.h.

165 { return p1.xp != p2.xp || p1.yp != p2.yp; }
const QPoint operator+ ( const QPoint p1,
const QPoint p2 
)
friend

Definition at line 167 of file qpoint.h.

168 { return QPoint(p1.xp+p2.xp, p1.yp+p2.yp); }
QPoint()
Definition: qpoint.h:119
const QPoint operator- ( const QPoint p1,
const QPoint p2 
)
friend

Definition at line 170 of file qpoint.h.

171 { return QPoint(p1.xp-p2.xp, p1.yp-p2.yp); }
QPoint()
Definition: qpoint.h:119
const QPoint operator* ( const QPoint p,
float  c 
)
friend

Definition at line 173 of file qpoint.h.

174 { return QPoint(qRound(p.xp*c), qRound(p.yp*c)); }
QPoint()
Definition: qpoint.h:119
const GLubyte * c
Definition: GLee.h:5419
const QPoint operator* ( float  c,
const QPoint p 
)
friend

Definition at line 182 of file qpoint.h.

183 { return QPoint(qRound(p.xp*c), qRound(p.yp*c)); }
QPoint()
Definition: qpoint.h:119
const GLubyte * c
Definition: GLee.h:5419
const QPoint operator* ( const QPoint p,
double  c 
)
friend

Definition at line 176 of file qpoint.h.

177 { return QPoint(qRound(p.xp*c), qRound(p.yp*c)); }
QPoint()
Definition: qpoint.h:119
const GLubyte * c
Definition: GLee.h:5419
const QPoint operator* ( double  c,
const QPoint p 
)
friend

Definition at line 185 of file qpoint.h.

186 { return QPoint(qRound(p.xp*c), qRound(p.yp*c)); }
QPoint()
Definition: qpoint.h:119
const GLubyte * c
Definition: GLee.h:5419
const QPoint operator* ( const QPoint p,
int  c 
)
friend

Definition at line 179 of file qpoint.h.

180 { return QPoint(p.xp*c, p.yp*c); }
QPoint()
Definition: qpoint.h:119
const GLubyte * c
Definition: GLee.h:5419
const QPoint operator* ( int  c,
const QPoint p 
)
friend

Definition at line 188 of file qpoint.h.

189 { return QPoint(p.xp*c, p.yp*c); }
QPoint()
Definition: qpoint.h:119
const GLubyte * c
Definition: GLee.h:5419
const QPoint operator- ( const QPoint p)
friend

Definition at line 191 of file qpoint.h.

192 { return QPoint(-p.xp, -p.yp); }
QPoint()
Definition: qpoint.h:119
const QPoint operator/ ( const QPoint p,
qreal  c 
)
friend

Definition at line 201 of file qpoint.h.

202 {
203  return QPoint(qRound(p.xp/c), qRound(p.yp/c));
204 }
QPoint()
Definition: qpoint.h:119
const GLubyte * c
Definition: GLee.h:5419

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