00001 #ifndef IONFLUX_TOOLS_CANVAS
00002 #define IONFLUX_TOOLS_CANVAS
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #include <string>
00030 #include "ionflux/color.hpp"
00031 #include "ionflux/Matrix3.hpp"
00032
00033 namespace Ionflux
00034 {
00035
00036 namespace Tools
00037 {
00038
00044 class Canvas
00045 {
00046 private:
00047
00048 protected:
00050 Color defaultStrokeColor;
00052 Color defaultFillColor;
00054 double defaultStrokeWidth;
00056 std::string defaultFontFamily;
00058 double defaultFontSize;
00060 Matrix3* defaultTransform;
00061
00062 public:
00067 Canvas();
00068
00073 virtual ~Canvas();
00074
00087 virtual void drawLine(double x1, double y1, double x2, double y2, double
00088 width = 0.0, const Color* color = 0, Matrix3* transform = 0) = 0;
00089
00103 virtual void drawRectangle(double x, double y, double width, double
00104 height, double strokeWidth = 0.0, const Color* strokeColor = 0, const
00105 Color* fillColor = 0, Matrix3* transform = 0) = 0;
00106
00122 virtual void drawArc(double x, double y, double width, double height,
00123 double angle1, double angle2, double strokeWidth = 0.0, const Color*
00124 strokeColor = 0, const Color* fillColor = 0, Matrix3* transform = 0) = 0;
00125
00141 virtual void drawArcEc(double xc, double yc, double radius, double
00142 angle1, double angle2, double eccentricity = 0.0, double strokeWidth =
00143 0.0, const Color* strokeColor = 0, const Color* fillColor = 0, Matrix3*
00144 transform = 0) = 0;
00145
00159 virtual void drawEllipse(double x, double y, double width, double height,
00160 double strokeWidth = 0.0, const Color* strokeColor = 0, const Color*
00161 fillColor = 0, Matrix3* transform = 0) = 0;
00162
00176 virtual void drawEllipseEc(double xc, double yc, double radius, double
00177 eccentricity = 0.0, double strokeWidth = 0.0, const Color* strokeColor =
00178 0, const Color* fillColor = 0, Matrix3* transform = 0) = 0;
00179
00192 virtual void drawCircle(double xc, double yc, double radius, double
00193 strokeWidth = 0.0, const Color* strokeColor = 0, const Color* fillColor =
00194 0, Matrix3* transform = 0) = 0;
00195
00210 virtual void drawCurve(double x1, double y1, double x2, double y2, double
00211 x3, double y3, double strokeWidth = 0.0, const Color* color = 0, Matrix3*
00212 transform = 0) = 0;
00213
00226 virtual void drawText(double x, double y, const std::string& text, const
00227 std::string& fontFamily = "", double fontSize = 0.0, const Color* color =
00228 0, Matrix3* transform = 0) = 0;
00229
00236 virtual void setDefaultStrokeColor(const Color& newDefaultStrokeColor);
00237
00244 virtual void setDefaultFillColor(const Color& newDefaultFillColor);
00245
00252 virtual void setDefaultStrokeWidth(double newDefaultStrokeWidth);
00253
00260 virtual void setDefaultFontFamily(const std::string&
00261 newDefaultFontFamily);
00262
00269 virtual void setDefaultFontSize(double newDefaultFontSize);
00270
00277 virtual void setDefaultTransform(Matrix3* newDefaultTransform);
00278
00283 virtual Color getDefaultStrokeColor() const;
00284
00289 virtual Color getDefaultFillColor() const;
00290
00295 virtual double getDefaultStrokeWidth() const;
00296
00301 virtual std::string getDefaultFontFamily() const;
00302
00307 virtual double getDefaultFontSize() const;
00308
00313 virtual Matrix3* getDefaultTransform() const;
00314 };
00315
00316 }
00317
00318 }
00319
00323 #endif