KHTML
SVGPathSegCurvetoCubic.h
Go to the documentation of this file.
00001 /* 00002 Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> 00003 2004, 2005, 2006 Rob Buis <buis@kde.org> 00004 00005 This file is part of the KDE project 00006 00007 This library is free software; you can redistribute it and/or 00008 modify it under the terms of the GNU Library General Public 00009 License as published by the Free Software Foundation; either 00010 version 2 of the License, or (at your option) any later version. 00011 00012 This library is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 Library General Public License for more details. 00016 00017 You should have received a copy of the GNU Library General Public License 00018 along with this library; see the file COPYING.LIB. If not, write to 00019 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00020 Boston, MA 02110-1301, USA. 00021 */ 00022 00023 #ifndef SVGPathSegCurvetoCubic_h 00024 #define SVGPathSegCurvetoCubic_h 00025 00026 #if ENABLE(SVG) 00027 00028 #include "SVGPathSeg.h" 00029 00030 namespace WebCore { 00031 class SVGPathSegCurvetoCubicAbs : public SVGPathSeg { 00032 public: 00033 static PassRefPtr<SVGPathSegCurvetoCubicAbs> create(float x, float y, float x1, float y1, float x2, float y2) 00034 { 00035 return adoptRef(new SVGPathSegCurvetoCubicAbs(x, y, x1, y1, x2, y2)); 00036 } 00037 00038 virtual ~SVGPathSegCurvetoCubicAbs(); 00039 00040 virtual unsigned short pathSegType() const { return PATHSEG_CURVETO_CUBIC_ABS; } 00041 virtual String pathSegTypeAsLetter() const { return "C"; } 00042 virtual String toString() const { return String::format("C %.6lg %.6lg %.6lg %.6lg %.6lg %.6lg", m_x1, m_y1, m_x2, m_y2, m_x, m_y); } 00043 00044 void setX(float); 00045 float x() const; 00046 00047 void setY(float); 00048 float y() const; 00049 00050 void setX1(float); 00051 float x1() const; 00052 00053 void setY1(float); 00054 float y1() const; 00055 00056 void setX2(float); 00057 float x2() const; 00058 00059 void setY2(float); 00060 float y2() const; 00061 00062 private: 00063 SVGPathSegCurvetoCubicAbs(float x, float y, float x1, float y1, float x2, float y2); 00064 00065 float m_x; 00066 float m_y; 00067 float m_x1; 00068 float m_y1; 00069 float m_x2; 00070 float m_y2; 00071 }; 00072 00073 class SVGPathSegCurvetoCubicRel : public SVGPathSeg { 00074 public: 00075 static PassRefPtr<SVGPathSegCurvetoCubicRel> create(float x, float y, float x1, float y1, float x2, float y2) 00076 { 00077 return adoptRef(new SVGPathSegCurvetoCubicRel(x, y, x1, y1, x2, y2)); 00078 } 00079 virtual ~SVGPathSegCurvetoCubicRel(); 00080 00081 virtual unsigned short pathSegType() const { return PATHSEG_CURVETO_CUBIC_REL; } 00082 virtual String pathSegTypeAsLetter() const { return "c"; } 00083 virtual String toString() const { return String::format("c %.6lg %.6lg %.6lg %.6lg %.6lg %.6lg", m_x1, m_y1, m_x2, m_y2, m_x, m_y); } 00084 00085 void setX(float); 00086 float x() const; 00087 00088 void setY(float); 00089 float y() const; 00090 00091 void setX1(float); 00092 float x1() const; 00093 00094 void setY1(float); 00095 float y1() const; 00096 00097 void setX2(float); 00098 float x2() const; 00099 00100 void setY2(float); 00101 float y2() const; 00102 00103 private: 00104 SVGPathSegCurvetoCubicRel(float x, float y, float x1, float y1, float x2, float y2); 00105 00106 float m_x; 00107 float m_y; 00108 float m_x1; 00109 float m_y1; 00110 float m_x2; 00111 float m_y2; 00112 }; 00113 00114 } // namespace WebCore 00115 00116 #endif // ENABLE(SVG) 00117 #endif 00118 00119 // vim:ts=4:noet
KDE 4.6 API Reference