00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef INCL_PLPOINT
00012 #define INCL_PLPOINT
00013
00017 class PLPoint
00018 {
00019 public:
00020 int x;
00021 int y;
00022
00024 PLPoint
00025 ();
00026
00028 PLPoint
00029 ( int X,
00030 int Y
00031 );
00032
00034 bool operator ==
00035 ( const PLPoint & pt
00036 ) const;
00037
00039 bool operator !=
00040 ( const PLPoint & pt
00041 ) const;
00042
00044 void operator +=
00045 ( const PLPoint & pt
00046 );
00047
00049 void operator -=
00050 ( const PLPoint & pt
00051 );
00052
00054 PLPoint operator -
00055 () const;
00056
00058 PLPoint operator +
00059 ( const PLPoint & pt
00060 ) const;
00061
00063 PLPoint operator -
00064 ( const PLPoint & pt
00065 ) const;
00066
00068 PLPoint operator /
00069 ( double f
00070 ) const;
00071 };
00072
00073 inline PLPoint::PLPoint
00074 ()
00075 {}
00076
00077
00078 inline PLPoint::PLPoint
00079 ( int X,
00080 int Y
00081 )
00082 {
00083 x = X;
00084 y = Y;
00085 }
00086
00087 inline bool PLPoint::operator ==
00088 ( const PLPoint & pt
00089 ) const
00090 {
00091 return (x == pt.x && y == pt.y);
00092 }
00093
00094 inline bool PLPoint::operator !=
00095 ( const PLPoint & pt
00096 ) const
00097 {
00098 return (x != pt.x || y != pt.y);
00099 }
00100
00101 inline void PLPoint::operator +=
00102 ( const PLPoint & pt
00103 )
00104 {
00105 x += pt.x;
00106 y += pt.y;
00107 }
00108
00109 inline void PLPoint::operator -=
00110 ( const PLPoint & pt
00111 )
00112 {
00113 x -= pt.x;
00114 y -= pt.y;
00115 }
00116
00117 inline PLPoint PLPoint::operator -
00118 () const
00119 {
00120 return PLPoint(-x, -y);
00121 }
00122
00123 inline PLPoint PLPoint::operator +
00124 ( const PLPoint & pt
00125 ) const
00126 {
00127 return PLPoint(x + pt.x, y + pt.y);
00128 }
00129
00130 inline PLPoint PLPoint::operator -
00131 ( const PLPoint & pt
00132 ) const
00133 {
00134 return PLPoint(x - pt.x, y - pt.y);
00135 }
00136
00137 inline PLPoint PLPoint::operator /
00138 ( double f
00139 ) const
00140 {
00141 return PLPoint (int(x/f), int(y/f));
00142 }
00143
00144 #endif
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179