ionflux.org | Impressum

Canvas.hpp

Go to the documentation of this file.
00001 #ifndef IONFLUX_TOOLS_CANVAS
00002 #define IONFLUX_TOOLS_CANVAS
00003 /* ==========================================================================
00004  * Ionflux Tools
00005  * Copyright (c) 2005 Joern P. Meier
00006  * mail@ionflux.org
00007  * --------------------------------------------------------------------------
00008  * Canvas.hpp                        Drawing canvas.
00009  * ==========================================================================
00010  * 
00011  * This file is part of Ionflux Tools.
00012  * 
00013  * Ionflux Tools is free software; you can redistribute it and/or modify it
00014  * under the terms of the GNU General Public License as published by the 
00015  * Free Software Foundation; either version 2 of the License, or (at your 
00016  * option) any later version.
00017  * 
00018  * Ionflux Tools is distributed in the hope that it will be useful, but 
00019  * WITHOUT ANY WARRANTY; without even the implied warranty of 
00020  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
00021  * General Public License for more details.
00022  * 
00023  * You should have received a copy of the GNU General Public License along 
00024  * with Ionflux Tools; if not, write to the Free Software Foundation, Inc.,
00025  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
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

Generated on Tue Mar 14 20:58:29 2006 for Ionflux Tools Class Library (iftools) by  doxygen 1.4.6