00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef INCL_PLRECT
00012 #define INCL_PLRECT
00013
00014 #include "plpoint.h"
00015
00017 class PLRect
00018 {
00019 public:
00020 PLPoint tl;
00021 PLPoint br;
00022
00024 PLRect
00025 ();
00026
00028 PLRect
00029 ( int left,
00030 int top,
00031 int right,
00032 int bottom
00033 );
00034
00036 PLRect
00037 ( const PLPoint& TL,
00038 const PLPoint& BR
00039 );
00040
00042 bool operator ==
00043 ( const PLRect & rect
00044 ) const;
00045
00047 bool operator !=
00048 ( const PLRect & rect
00049 ) const;
00050
00052 int Width
00053 () const;
00054
00056 int Height
00057 () const;
00058
00059 };
00060
00061 inline PLRect::PLRect
00062 ()
00063 {}
00064
00065 inline PLRect::PLRect
00066 ( const PLPoint& TL,
00067 const PLPoint& BR
00068 ): tl(TL), br(BR)
00069 {}
00070
00071 inline PLRect::PLRect
00072 ( int left,
00073 int top,
00074 int right,
00075 int bottom
00076 ) : tl(left, top),
00077 br (right, bottom)
00078 {}
00079
00080 inline bool PLRect::operator ==
00081 ( const PLRect & rect
00082 ) const
00083 {
00084 return (tl == rect.tl && br == rect.br);
00085 }
00086
00087 inline bool PLRect::operator !=
00088 ( const PLRect & rect
00089 ) const
00090 {
00091 return !(rect==*this);
00092 }
00093
00094 inline int PLRect::Width
00095 () const
00096 {
00097 return br.x-tl.x;
00098 }
00099
00100 inline int PLRect::Height
00101 () const
00102 {
00103 return br.y-tl.y;
00104 }
00105
00106 #endif
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138