00001 #ifndef _DLSHAPE_H_ 00002 #define _DLSHAPE_H_ 00003 00004 #include "DLImage.h" 00005 #include "DLPoint.h" 00006 #include "DLColor.h" 00007 #include "DLLogger.h" 00008 00009 00017 enum DLLineStyle {DL_SOLID, DL_DASH}; 00018 00026 class DLShape 00027 { 00028 public: 00029 00035 enum DLLineStyle {DL_SOLID, DL_DASH}; 00036 00038 00039 00043 DLShape() ; 00044 00049 DLShape(const DLShape & orig); 00050 00054 virtual ~DLShape() {}; 00055 00060 const DLShape & operator=(const DLShape & right); 00061 00063 00065 00066 00071 void dlSetLineColor(const DLColor& color); 00072 00079 void dlSetLineStyle(int thickness) 00080 { 00081 dlLogger.dlLog(DL_CRITICAL, "DLShape::dlSetLineStyle() has been replaced with dlSetLineThickness()"); 00082 lineThickness = 1; 00083 }; 00084 00085 void dlSetLineThickness(int thickness) {lineThickness = thickness;}; 00090 void dlSetDashStyle(DLShape::DLLineStyle DashStyle) {lineStyle = DashStyle; }; 00091 00096 void dlSetDashLength( int length ) { dashLength = length; }; 00097 00098 00104 void dlSetFillColor(const DLColor& color) ; 00105 00109 void dlSetFillOff() { fillShape = false;} ; 00110 00112 00113 00114 00119 DLColor dlGetLineColor( void ) const { return lineColor;} ; 00120 00127 int dlGetLineStyle( void ) const { 00128 dlLogger.dlLog(DL_CRITICAL, "DLShape::dlGetLineStyle() has been replaced with dlGetLineThickness()"); 00129 return lineThickness; 00130 }; 00131 00136 int dlGetLineThickness( void ) const { return lineThickness;}; 00141 DLShape::DLLineStyle dlGetDashStyle( void ) { return lineStyle;}; 00142 00147 int dlGetDashLength ( void ) { return dashLength; }; 00148 00153 DLColor dlGetFillColor( void ) { return fillColor;}; 00154 00156 00166 virtual void dlDrawShape(DLImage * image) = 0; 00167 00168 protected: 00170 DLColor lineColor; 00171 00173 DLColor fillColor; 00174 00176 //bool fillFlag; 00177 00178 00180 DLShape::DLLineStyle lineStyle; 00181 00183 int dashLength; 00184 00186 int lineThickness; 00192 bool fillShape; 00193 }; 00194 00195 00196 00197 00198 #endif