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 
22 {
23 public:
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);
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: */
void appendLineTo(double x, double y)
Definition: FHPath.cpp:241
virtual FHPathElement * clone()=0
FHPath()
Definition: FHPath.h:35
std::vector< FHPathElement * > m_elements
Definition: FHPath.h:58
virtual void writeOut(librevenge::RVNGPropertyListVector &vec) const =0
bool isClosed() const
Definition: FHPath.cpp:328
bool m_isClosed
Definition: FHPath.h:59
Definition: FHCollector.h:19
bool empty() const
Definition: FHPath.cpp:323
void appendMoveTo(double x, double y)
Definition: FHPath.cpp:236
void appendArcTo(double rx, double ry, double rotation, bool longAngle, bool sweep, double x, double y)
Definition: FHPath.cpp:256
void appendPath(const FHPath &path)
Definition: FHPath.cpp:291
FHPath & operator=(const FHPath &path)
Definition: FHPath.cpp:273
Definition: FHTransform.h:18
void appendClosePath()
Definition: FHPath.cpp:261
FHPathElement()
Definition: FHPath.h:24
void clear()
Definition: FHPath.cpp:314
void transform(const FHTransform &trafo)
Definition: FHPath.cpp:303
Definition: FHPath.h:21
~FHPath()
Definition: FHPath.cpp:286
virtual void transform(const FHTransform &trafo)=0
FHPathElement * clone()
Definition: FHPath.cpp:309
void appendCubicBezierTo(double x1, double y1, double x2, double y2, double x, double y)
Definition: FHPath.cpp:246
void appendQuadraticBezierTo(double x1, double y1, double x, double y)
Definition: FHPath.cpp:251
Definition: FHPath.h:32
void writeOut(librevenge::RVNGPropertyListVector &vec) const
Definition: FHPath.cpp:297
virtual ~FHPathElement()
Definition: FHPath.h:25

Generated for libfreehand by doxygen 1.8.8