KHTML
SVGPathSegCurvetoCubic.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
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 }
00115
00116 #endif // ENABLE(SVG)
00117 #endif
00118
00119