- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

CDRPath.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 libcdr 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 __CDRPATH_H__
11 #define __CDRPATH_H__
12
13 #include <vector>
14 #include <librevenge/librevenge.h>
15
16 namespace libcdr
17 {
18
19 class CDRTransform;
20 class CDRTransforms;
21
22 class CDRPathElement
23 {
24 public:
25 CDRPathElement() {}
26 virtual ~CDRPathElement() {}
27 virtual void writeOut(librevenge::RVNGPropertyListVector &vec) const = 0;
28 virtual void transform(const CDRTransforms &trafos) = 0;
29 virtual void transform(const CDRTransform &trafo) = 0;
30 virtual CDRPathElement *clone() = 0;
31 };
32
33
34 class CDRPath : public CDRPathElement
35 {
36 public:
37 CDRPath() : m_elements(), m_isClosed(false) {}
38 CDRPath(const CDRPath &path);
39 ~CDRPath();
40
41 CDRPath &operator=(const CDRPath &path);
42
43 void appendMoveTo(double x, double y);
44 void appendLineTo(double x, double y);
45 void appendCubicBezierTo(double x1, double y1, double x2, double y2, double x, double y);
46 void appendQuadraticBezierTo(double x1, double y1, double x, double y);
47 void appendSplineTo(std::vector<std::pair<double, double> > &points);
48 void appendArcTo(double rx, double ry, double rotation, bool longAngle, bool sweep, double x, double y);
49 void appendClosePath();
50 void appendPath(const CDRPath &path);
51
52 void writeOut(librevenge::RVNGPropertyListVector &vec) const;
53 void writeOut(librevenge::RVNGString &path, librevenge::RVNGString &viewBox, double &width) const;
54 void transform(const CDRTransforms &trafos);
55 void transform(const CDRTransform &trafo);
56 CDRPathElement *clone();
57
58 void clear();
59 bool empty() const;
60 bool isClosed() const;
61
62 private:
63 std::vector<CDRPathElement *> m_elements;
64 bool m_isClosed;
65 };
66
67 } // namespace libcdr
68
69 #endif /* __CDRPATH_H__ */
70 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libcdr::CDRPath::operator=
CDRPath & operator=(const CDRPath &path)
Definition: CDRPath.cpp:685
libcdr::CDRPath::clear
void clear()
Definition: CDRPath.cpp:874
libcdr::CDRPathElement::~CDRPathElement
virtual ~CDRPathElement()
Definition: CDRPath.h:26
libcdr::CDRPath
Definition: CDRPath.h:34
libcdr::CDRPath::empty
bool empty() const
Definition: CDRPath.cpp:883
libcdr::CDRPath::appendLineTo
void appendLineTo(double x, double y)
Definition: CDRPath.cpp:647
libcdr::CDRPath::~CDRPath
~CDRPath()
Definition: CDRPath.cpp:698
libcdr::CDRPath::CDRPath
CDRPath()
Definition: CDRPath.h:37
libcdr::CDRPath::appendSplineTo
void appendSplineTo(std::vector< std::pair< double, double > > &points)
Definition: CDRPath.cpp:667
libcdr::CDRPath::appendMoveTo
void appendMoveTo(double x, double y)
Definition: CDRPath.cpp:642
libcdr::CDRPath::appendPath
void appendPath(const CDRPath &path)
Definition: CDRPath.cpp:703
libcdr::CDRPath::isClosed
bool isClosed() const
Definition: CDRPath.cpp:888
libcdr::CDRTransform
Definition: CDRTransforms.h:20
libcdr::CDRPath::appendCubicBezierTo
void appendCubicBezierTo(double x1, double y1, double x2, double y2, double x, double y)
Definition: CDRPath.cpp:652
libcdr::CDRPath::appendQuadraticBezierTo
void appendQuadraticBezierTo(double x1, double y1, double x, double y)
Definition: CDRPath.cpp:657
libcdr::CDRPathElement::transform
virtual void transform(const CDRTransforms &trafos)=0
libcdr::CDRPath::transform
void transform(const CDRTransforms &trafos)
Definition: CDRPath.cpp:857
libcdr::CDRPath::appendArcTo
void appendArcTo(double rx, double ry, double rotation, bool longAngle, bool sweep, double x, double y)
Definition: CDRPath.cpp:662
libcdr::CDRPath::appendClosePath
void appendClosePath()
Definition: CDRPath.cpp:672
libcdr
Definition: CDRCollector.h:29
libcdr::CDRPath::writeOut
void writeOut(librevenge::RVNGPropertyListVector &vec) const
Definition: CDRPath.cpp:709
libcdr::CDRPathElement::clone
virtual CDRPathElement * clone()=0
libcdr::CDRPathElement::CDRPathElement
CDRPathElement()
Definition: CDRPath.h:25
libcdr::CDRPath::m_isClosed
bool m_isClosed
Definition: CDRPath.h:64
libcdr::CDRPathElement
Definition: CDRPath.h:22
libcdr::CDRPath::m_elements
std::vector< CDRPathElement * > m_elements
Definition: CDRPath.h:63
libcdr::CDRPathElement::writeOut
virtual void writeOut(librevenge::RVNGPropertyListVector &vec) const =0
libcdr::CDRPath::clone
CDRPathElement * clone()
Definition: CDRPath.cpp:869
libcdr::CDRTransforms
Definition: CDRTransforms.h:39