00001 #ifndef _DLRECTSHAPE_H_ 00002 #define _DLRECTSHAPE_H_ 00003 00004 #include "DLShape.h" 00005 #include "DLZone.h" 00006 00031 class DLRectShape : public DLShape 00032 { 00033 public: 00034 00038 DLRectShape( ): DLShape() { }; 00043 DLRectShape(const DLRectShape & orig); 00044 00049 const DLRectShape & operator=(const DLRectShape & right); 00050 00059 DLRectShape(int x1, int y1, int w1, int h1) : DLShape() 00060 { x = x1; y = y1; w = w1; h = h1; }; 00061 00067 DLRectShape(const DLZone & z) : DLShape() 00068 { 00069 x = z.dlGetZoneOrigin().x; 00070 y = z.dlGetZoneOrigin().y; 00071 w = z.dlGetZoneWidth(); 00072 h = z.dlGetZoneHeight(); 00073 }; 00074 00081 DLRectShape(const DLPoint & upperleft, const DLPoint & lowerright) : DLShape() 00082 { 00083 x = upperleft.x; 00084 y = upperleft.y; 00085 w = lowerright.x-upperleft.x; 00086 h = lowerright.y-upperleft.y; 00087 }; 00088 00092 virtual ~DLRectShape() {}; 00093 00098 void dlDrawShape(DLImage* image); 00099 00100 00105 int dlGetX()const{return x;}; 00110 int dlGetY()const{return y;}; 00115 int dlGetWidth()const {return w;} ; 00120 int dlGetHeight()const {return h;}; 00121 00126 void dlSetX(int xPoint){x = xPoint;}; 00131 void dlSetY(int yPoint){y = yPoint;}; 00136 void dlSetHeight(int height){h = height;}; 00141 void dlSetWidth(int width){w = width;}; 00142 00143 protected: 00145 int x; 00147 int y; 00149 int w; 00151 int h; 00152 00153 }; 00154 00155 #endif