00001 /* AbiWord 00002 * Copyright (C) 2003 Dom Lachowicz 00003 * 00004 * This program is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU General Public License 00006 * as published by the Free Software Foundation; either version 2 00007 * of the License, or (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00017 * 02110-1301 USA. 00018 */ 00019 00020 #ifndef GR_TRANSFORM_H 00021 #define GR_TRANSFORM_H 00022 00023 #include "ut_types.h" 00024 00025 class ABI_EXPORT GR_Transform 00026 { 00027 public: 00028 GR_Transform(); 00029 GR_Transform (double a, double b, double c, double d, double e, double f); 00030 GR_Transform (const GR_Transform & op2); 00031 00032 static GR_Transform scale (double x, double y); 00033 static GR_Transform linearScale (double p) { 00034 return scale (p, p); 00035 } 00036 static GR_Transform rotate (double theta); 00037 static GR_Transform translate (double x, double y); 00038 00039 inline double getA() const {return m_A;} 00040 inline double getB() const {return m_B;} 00041 inline double getC() const {return m_C;} 00042 inline double getD() const {return m_D;} 00043 inline double getE() const {return m_E;} 00044 inline double getF() const {return m_F;} 00045 00046 bool operator == (const GR_Transform & op2) const; 00047 bool operator != (const GR_Transform & op2) const; 00048 00049 GR_Transform & operator = (const GR_Transform &op2); 00050 GR_Transform operator + (const GR_Transform &op2) const; 00051 GR_Transform & operator += (const GR_Transform &op2); 00052 00053 private: 00054 double m_A; 00055 double m_B; 00056 double m_C; 00057 double m_D; 00058 double m_E; 00059 double m_F; 00060 }; 00061 00062 #endif // GR_TRANSFORM_H