5 #define ABS(x) ( x>0 ? x : -x )
12 ePoint(
int xpos,
int ypos );
13 ePoint(
float xpos,
float ypos );
14 ePoint(
float xpos,
int ypos );
15 ePoint(
int xpos,
float ypos );
69 { xp=(int)xpos; yp=(int)ypos; }
72 { xp=(int)xpos; yp=(int)ypos; }
75 { xp=(int)xpos; yp=(int)ypos; }
78 { xp=(int)xpos; yp=(int)ypos; }
81 {
return xp == 0 && yp == 0; }
102 { xp+=
p.xp; yp+=
p.yp;
return *
this; }
105 { xp-=
p.xp; yp-=
p.yp;
return *
this; }
108 { xp*=(int)c; yp*=(int)c;
return *
this; }
111 { xp=(int)(xp*c); yp=(int)(yp*c);
return *
this; }
114 {
return p1.xp == p2.xp && p1.yp == p2.yp; }
117 {
return p1.xp != p2.xp || p1.yp != p2.yp; }
120 {
return ePoint(p1.xp+p2.xp, p1.yp+p2.yp); }
123 {
return ePoint(p1.xp-p2.xp, p1.yp-p2.yp); }
138 {
return ePoint((
int)(
p.xp*c), (
int)(
p.yp*c)); }
141 {
return ePoint((
int)(
p.xp*c), (
int)(
p.yp*c)); }
167 return ePoint((
int)(
p.xp/c), (
int)(
p.yp/c));
int manhattanLength() const
Definition: epoint.h:55
bool isNull() const
Definition: epoint.h:80
friend ePoint operator-(const ePoint &, const ePoint &)
Definition: epoint.h:122
friend ePoint operator+(const ePoint &, const ePoint &)
Definition: epoint.h:119
int y() const
Definition: epoint.h:86
ePoint & operator/=(int c)
Definition: epoint.h:146
friend ePoint operator*(const ePoint &, int)
Definition: epoint.h:131
ePoint & operator+=(const ePoint &p)
Definition: epoint.h:101
void setY(int y)
Definition: epoint.h:92
int & rx()
Definition: epoint.h:95
ePoint & operator*=(int c)
Definition: epoint.h:107
friend bool operator==(const ePoint &, const ePoint &)
Definition: epoint.h:113
int x() const
Definition: epoint.h:83
ePoint & operator-=(const ePoint &p)
Definition: epoint.h:104
int & ry()
Definition: epoint.h:98
ePoint()
Definition: epoint.h:65
friend ePoint operator/(const ePoint &, int)
Definition: epoint.h:160
friend bool operator!=(const ePoint &, const ePoint &)
Definition: epoint.h:116
void setX(int x)
Definition: epoint.h:89
int width() const
Definition: esize.h:72
int height() const
Definition: esize.h:75
ePoint operator+(const ePoint &p1, const ePoint &p2)
Definition: epoint.h:119
ePoint operator/(const ePoint &p, int c)
Definition: epoint.h:160
bool operator==(const ePoint &p1, const ePoint &p2)
Definition: epoint.h:113
ePoint operator*(const ePoint &p, int c)
Definition: epoint.h:131
#define ABS(x)
Definition: epoint.h:5
bool operator!=(const ePoint &p1, const ePoint &p2)
Definition: epoint.h:116
ePoint operator-(const ePoint &p1, const ePoint &p2)
Definition: epoint.h:122
p
Definition: upgrade.py:63
std::string int int y
Definition: picload.cpp:1503
std::string int x
Definition: picload.cpp:1503