ionflux.org | Impressum

CairoMatrix.hpp

Go to the documentation of this file.
00001 #ifndef IONFLUX_TOOLS_CAIRO_MATRIX
00002 #define IONFLUX_TOOLS_CAIRO_MATRIX
00003 /* ==========================================================================
00004  * Ionflux Tools
00005  * Copyright (c) 2005 Joern P. Meier
00006  * mail@ionflux.org
00007  * --------------------------------------------------------------------------
00008  * CairoMatrix.hpp                        Cairo matrix.
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 "cairo.h"
00030 #include "ionflux/Matrix3.hpp"
00031 
00032 namespace Ionflux
00033 {
00034 
00035 namespace Tools
00036 {
00037 
00038 namespace Cairo
00039 {
00040 
00044 struct Point
00045 {
00047     double x;
00049     double y;
00050 };
00051 
00055 struct Distance
00056 {
00058     double dx;
00060     double dy;
00061 };
00062 
00071 class Matrix
00072 : public Ionflux::Tools::Matrix3
00073 {
00074     private:
00075         
00076     protected:
00077         
00078     public:
00083         Matrix();
00084         
00091         Matrix(const Matrix& initMatrix);
00092         
00099         Matrix(const cairo_matrix_t& initMatrix);
00100         
00112         Matrix(double xx, double yx, double xy, double yy, double x0, double y0);
00113         
00118         virtual ~Matrix();
00119         
00124          void initIdentity();
00125         
00133          void initTranslate(double tx, double ty);
00134         
00142          void initScale(double sx, double sy);
00143         
00150          void initRotate(double radians);
00151         
00159          void translate(double tx, double ty);
00160         
00168          void scale(double sx, double sy);
00169         
00176          void rotate(double radians);
00177         
00184          void transformDistance(Distance& distance);
00185         
00192          void transformPoint(Point& point);
00193         
00202         virtual Matrix& operator=(const Matrix3& newMatrix);
00203         
00212         virtual Matrix& operator=(const Matrix& newCairoMatrix);
00213         
00222         virtual Matrix& operator=(const cairo_matrix_t& newCairoMatrix);
00223         
00230          void toCairoMatrix(cairo_matrix_t& cairoMatrix) const;
00231 };
00232 
00233 }
00234 
00235 }
00236 
00237 }
00238 
00242 #endif

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