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  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:
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);
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: */
void appendLineTo(double x, double y)
Definition: FHPath.cpp:582
virtual FHPathElement * clone()=0
FHPath()
Definition: FHPath.h:38
std::vector< FHPathElement * > m_elements
Definition: FHPath.h:71
virtual void writeOut(librevenge::RVNGPropertyListVector &vec) const =0
bool isClosed() const
Definition: FHPath.cpp:689
void setGraphicStyleId(unsigned graphicStyleId)
Definition: FHPath.cpp:646
virtual double getX() const =0
unsigned getXFormId() const
Definition: FHPath.cpp:708
void setEvenOdd(bool evenOdd)
Definition: FHPath.cpp:651
bool m_isClosed
Definition: FHPath.h:72
bool empty() const
Definition: FHPath.cpp:684
void appendMoveTo(double x, double y)
Definition: FHPath.cpp:577
unsigned m_xFormId
Definition: FHPath.h:73
void setXFormId(unsigned xFormId)
Definition: FHPath.cpp:641
void appendArcTo(double rx, double ry, double rotation, bool longAngle, bool sweep, double x, double y)
Definition: FHPath.cpp:597
void appendPath(const FHPath &path)
Definition: FHPath.cpp:630
unsigned getGraphicStyleId() const
Definition: FHPath.cpp:713
FHPath & operator=(const FHPath &path)
Definition: FHPath.cpp:615
virtual double getY() const =0
void getBoundingBox(double x0, double y0, double &xmin, double &ymin, double &xmax, double &ymax) const
Definition: FHPath.cpp:723
double getY() const
Definition: FHPath.cpp:701
void appendClosePath()
Definition: FHPath.cpp:602
FHPathElement()
Definition: FHPath.h:24
void clear()
Definition: FHPath.cpp:673
Definition: FHTransform.h:18
void transform(const FHTransform &trafo)
Definition: FHPath.cpp:662
virtual void getBoundingBox(double x0, double y0, double &px, double &py, double &qx, double &qy) const =0
Definition: FHPath.h:21
~FHPath()
Definition: FHPath.cpp:636
virtual void transform(const FHTransform &trafo)=0
bool m_evenOdd
Definition: FHPath.h:75
double getX() const
Definition: FHPath.cpp:694
FHPathElement * clone()
Definition: FHPath.cpp:668
bool getEvenOdd() const
Definition: FHPath.cpp:718
void appendCubicBezierTo(double x1, double y1, double x2, double y2, double x, double y)
Definition: FHPath.cpp:587
void appendQuadraticBezierTo(double x1, double y1, double x, double y)
Definition: FHPath.cpp:592
Definition: FHPath.h:35
unsigned m_graphicStyleId
Definition: FHPath.h:74
void writeOut(librevenge::RVNGPropertyListVector &vec) const
Definition: FHPath.cpp:656
virtual ~FHPathElement()
Definition: FHPath.h:25

Generated for libfreehand by doxygen 1.8.5