- 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 };
30
31
32 class FHPath : public FHPathElement
33 {
34 public:
35 FHPath() : m_elements(), m_isClosed(false) {}
36 FHPath(const FHPath &path);
37 ~FHPath();
38
39 FHPath &operator=(const FHPath &path);
40
41 void appendMoveTo(double x, double y);
42 void appendLineTo(double x, double y);
43 void appendCubicBezierTo(double x1, double y1, double x2, double y2, double x, double y);
44 void appendQuadraticBezierTo(double x1, double y1, double x, double y);
45 void appendArcTo(double rx, double ry, double rotation, bool longAngle, bool sweep, double x, double y);
46 void appendClosePath();
47 void appendPath(const FHPath &path);
48
49 void writeOut(librevenge::RVNGPropertyListVector &vec) const;
50 void transform(const FHTransform &trafo);
51 FHPathElement *clone();
52
53 void clear();
54 bool empty() const;
55 bool isClosed() const;
56
57 private:
58 std::vector<FHPathElement *> m_elements;
59 bool m_isClosed;
60 };
61
62 } // namespace libfreehand
63
64 #endif /* __FHPATH_H__ */
65 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libfreehand::FHPath::appendLineTo
void appendLineTo(double x, double y)
Definition: FHPath.cpp:241
libfreehand::FHPathElement::clone
virtual FHPathElement * clone()=0
libfreehand::FHPath::FHPath
FHPath()
Definition: FHPath.h:35
libfreehand::FHPath::m_elements
std::vector< FHPathElement * > m_elements
Definition: FHPath.h:58
libfreehand::FHPathElement::writeOut
virtual void writeOut(librevenge::RVNGPropertyListVector &vec) const =0
libfreehand::FHPath::isClosed
bool isClosed() const
Definition: FHPath.cpp:328
libfreehand::FHPath::m_isClosed
bool m_isClosed
Definition: FHPath.h:59
libfreehand
Definition: FHCollector.h:19
libfreehand::FHPath::empty
bool empty() const
Definition: FHPath.cpp:323
libfreehand::FHPath::appendMoveTo
void appendMoveTo(double x, double y)
Definition: FHPath.cpp:236
libfreehand::FHPath::appendArcTo
void appendArcTo(double rx, double ry, double rotation, bool longAngle, bool sweep, double x, double y)
Definition: FHPath.cpp:256
libfreehand::FHPath::appendPath
void appendPath(const FHPath &path)
Definition: FHPath.cpp:291
libfreehand::FHPath::operator=
FHPath & operator=(const FHPath &path)
Definition: FHPath.cpp:273
libfreehand::FHTransform
Definition: FHTransform.h:18
libfreehand::FHPath::appendClosePath
void appendClosePath()
Definition: FHPath.cpp:261
libfreehand::FHPathElement::FHPathElement
FHPathElement()
Definition: FHPath.h:24
libfreehand::FHPath::clear
void clear()
Definition: FHPath.cpp:314
libfreehand::FHPath::transform
void transform(const FHTransform &trafo)
Definition: FHPath.cpp:303
libfreehand::FHPathElement
Definition: FHPath.h:21
libfreehand::FHPath::~FHPath
~FHPath()
Definition: FHPath.cpp:286
libfreehand::FHPathElement::transform
virtual void transform(const FHTransform &trafo)=0
libfreehand::FHPath::clone
FHPathElement * clone()
Definition: FHPath.cpp:309
libfreehand::FHPath::appendCubicBezierTo
void appendCubicBezierTo(double x1, double y1, double x2, double y2, double x, double y)
Definition: FHPath.cpp:246
libfreehand::FHPath::appendQuadraticBezierTo
void appendQuadraticBezierTo(double x1, double y1, double x, double y)
Definition: FHPath.cpp:251
libfreehand::FHPath
Definition: FHPath.h:32
libfreehand::FHPath::writeOut
void writeOut(librevenge::RVNGPropertyListVector &vec) const
Definition: FHPath.cpp:297
libfreehand::FHPathElement::~FHPathElement
virtual ~FHPathElement()
Definition: FHPath.h:25