FHPath.h Source File documentation

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

FHPath.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /*
3 * This file is part of the libfreehand project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
9
10 #ifndef __FHPATH_H__
11 #define __FHPATH_H__
12
13 #include <vector>
14 #include <librevenge/librevenge.h>
15
16 namespace libfreehand
17 {
18
19 class FHTransform;
20
21 class FHPathElement
22 {
23 public:
24 FHPathElement() {}
25 virtual ~FHPathElement() {}
26 virtual void writeOut(librevenge::RVNGPropertyListVector &vec) const = 0;
27 virtual void transform(const FHTransform &trafo) = 0;
28 virtual FHPathElement *clone() = 0;
29 virtual void getBoundingBox(double x0, double y0, double &px, double &py, double &qx, double &qy) const = 0;
30 virtual double getX() const = 0;
31 virtual double getY() const = 0;
32 };
33
34
35 class FHPath : public FHPathElement
36 {
37 public:
38 FHPath() : m_elements(), m_isClosed(false), m_xFormId(0), m_graphicStyleId(0), m_evenOdd(false) {}
39 FHPath(const FHPath &path);
40 ~FHPath();
41
42 FHPath &operator=(const FHPath &path);
43
44 void appendMoveTo(double x, double y);
45 void appendLineTo(double x, double y);
46 void appendCubicBezierTo(double x1, double y1, double x2, double y2, double x, double y);
47 void appendQuadraticBezierTo(double x1, double y1, double x, double y);
48 void appendArcTo(double rx, double ry, double rotation, bool longAngle, bool sweep, double x, double y);
49 void appendClosePath();
50 void appendPath(const FHPath &path);
51 void setXFormId(unsigned xFormId);
52 void setGraphicStyleId(unsigned graphicStyleId);
53 void setEvenOdd(bool evenOdd);
54
55 void writeOut(librevenge::RVNGPropertyListVector &vec) const;
56 void transform(const FHTransform &trafo);
57 FHPathElement *clone();
58 void getBoundingBox(double x0, double y0, double &xmin, double &ymin, double &xmax, double &ymax) const;
59 double getX() const;
60 double getY() const;
61
62 void clear();
63 bool empty() const;
64 bool isClosed() const;
65 unsigned getXFormId() const;
66 unsigned getGraphicStyleId() const;
67 bool getEvenOdd() const;
68 void getBoundingBox(double &xmin, double &ymin, double &xmax, double &ymax) const;
69
70 private:
71 std::vector<FHPathElement *> m_elements;
72 bool m_isClosed;
73 unsigned m_xFormId;
74 unsigned m_graphicStyleId;
75 bool m_evenOdd;
76 };
77
78 } // namespace libfreehand
79
80 #endif /* __FHPATH_H__ */
81 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libfreehand::FHPathElement::clone
virtual FHPathElement * clone()=0
libfreehand::FHPathElement::getX
virtual double getX() const =0
libfreehand::FHPathElement::getY
virtual double getY() const =0
libfreehand::FHPath::FHPath
FHPath()
Definition: FHPath.h:38
libfreehand::FHPath::m_elements
std::vector< FHPathElement * > m_elements
Definition: FHPath.h:71
libfreehand::FHPathElement::writeOut
virtual void writeOut(librevenge::RVNGPropertyListVector &vec) const =0
libfreehand::FHPath::m_isClosed
bool m_isClosed
Definition: FHPath.h:72
libfreehand
Definition: FHCollector.h:21
libfreehand::FHPath::m_xFormId
unsigned m_xFormId
Definition: FHPath.h:73
libfreehand::FHPathElement::FHPathElement
FHPathElement()
Definition: FHPath.h:24
libfreehand::FHPathElement::getBoundingBox
virtual void getBoundingBox(double x0, double y0, double &px, double &py, double &qx, double &qy) const =0
libfreehand::FHTransform
Definition: FHTransform.h:18
libfreehand::FHPathElement
Definition: FHPath.h:21
libfreehand::FHPathElement::transform
virtual void transform(const FHTransform &trafo)=0
libfreehand::FHPath::m_evenOdd
bool m_evenOdd
Definition: FHPath.h:75
libfreehand::FHPath
Definition: FHPath.h:35
libfreehand::FHPath::m_graphicStyleId
unsigned m_graphicStyleId
Definition: FHPath.h:74
libfreehand::FHPathElement::~FHPathElement
virtual ~FHPathElement()
Definition: FHPath.h:25