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