Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef __CDRPATH_H__
00011 #define __CDRPATH_H__
00012
00013 #include <vector>
00014 #include <librevenge/librevenge.h>
00015
00016 namespace libcdr
00017 {
00018
00019 class CDRTransform;
00020 class CDRTransforms;
00021
00022 class CDRPathElement
00023 {
00024 public:
00025 CDRPathElement() {}
00026 virtual ~CDRPathElement() {}
00027 virtual void writeOut(librevenge::RVNGPropertyListVector &vec) const = 0;
00028 virtual void transform(const CDRTransforms &trafos) = 0;
00029 virtual void transform(const CDRTransform &trafo) = 0;
00030 virtual CDRPathElement *clone() = 0;
00031 };
00032
00033
00034 class CDRPath : public CDRPathElement
00035 {
00036 public:
00037 CDRPath() : m_elements(), m_isClosed(false) {}
00038 CDRPath(const CDRPath &path);
00039 ~CDRPath();
00040
00041 CDRPath &operator=(const CDRPath &path);
00042
00043 void appendMoveTo(double x, double y);
00044 void appendLineTo(double x, double y);
00045 void appendCubicBezierTo(double x1, double y1, double x2, double y2, double x, double y);
00046 void appendQuadraticBezierTo(double x1, double y1, double x, double y);
00047 void appendSplineTo(std::vector<std::pair<double, double> > &points);
00048 void appendArcTo(double rx, double ry, double rotation, bool longAngle, bool sweep, double x, double y);
00049 void appendClosePath();
00050 void appendPath(const CDRPath &path);
00051
00052 void writeOut(librevenge::RVNGPropertyListVector &vec) const;
00053 void writeOut(librevenge::RVNGString &path, librevenge::RVNGString &viewBox, double &width) const;
00054 void transform(const CDRTransforms &trafos);
00055 void transform(const CDRTransform &trafo);
00056 CDRPathElement *clone();
00057
00058 void clear();
00059 bool empty() const;
00060 bool isClosed() const;
00061
00062 private:
00063 std::vector<CDRPathElement *> m_elements;
00064 bool m_isClosed;
00065 };
00066
00067 }
00068
00069 #endif
00070