- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List
- File Members

KEYPath.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 libetonyek 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 KEYPATH_H_INCLUDED
11 #define KEYPATH_H_INCLUDED
12
13 #include <deque>
14 #include <string>
15
16 #include <librevenge/librevenge.h>
17
18 #include "libetonyek_utils.h"
19 #include "KEYObject.h"
20 #include "KEYPath_fwd.h"
21
22 namespace libetonyek
23 {
24
25 class KEYTransformation;
26
27 class KEYPath
28 {
29 friend bool approxEqual(const KEYPath &left, const KEYPath &right, const double eps);
30
31 public:
32 class Element;
33
34 public:
35 KEYPath();
36 explicit KEYPath(const std::string &path);
37 KEYPath(const KEYPath &other);
38 ~KEYPath();
39 KEYPath &operator=(const KEYPath &other);
40
41 void swap(KEYPath &other);
42
43 void clear();
44
45 void appendMoveTo(double x, double y);
46 void appendLineTo(double x, double y);
47 void appendCurveTo(double x1, double y1, double x2, double y2, double x, double y);
48 void appendClose();
49
54 void operator*=(const KEYTransformation &tr);
55
58 librevenge::RVNGPropertyListVector toWPG() const;
59
60 private:
61 std::deque<Element *> m_elements;
62 bool m_closed;
63 };
64
65 bool approxEqual(const KEYPath &left, const KEYPath &right, double eps = KEY_EPSILON);
66 bool operator==(const KEYPath &left, const KEYPath &right);
67 bool operator!=(const KEYPath &left, const KEYPath &right);
68
75 KEYPath operator*(const KEYPath &path, const KEYTransformation &tr);
76
77 }
78
79 #endif // KEYPATH_H_INCLUDED
80
81 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libetonyek::approxEqual
bool approxEqual(const KEYPath &left, const KEYPath &right, const double eps)
Definition: KEYPath.cpp:385
libetonyek::KEYPath::operator=
KEYPath & operator=(const KEYPath &other)
Definition: KEYPath.cpp:322
y
double y
Definition: KEYShape.cpp:100
libetonyek::operator==
bool operator==(const KEYPath &left, const KEYPath &right)
Definition: KEYPath.cpp:393
libetonyek::KEYPath::Element
An element of path.
Definition: KEYPath.cpp:32
libetonyek::KEYPath::KEYPath
KEYPath()
Definition: KEYPath.cpp:263
libetonyek::KEYPath::~KEYPath
~KEYPath()
Definition: KEYPath.cpp:317
libetonyek::operator!=
bool operator!=(const KEYPath &left, const KEYPath &right)
Definition: KEYPath.cpp:398
libetonyek::KEYPath::appendMoveTo
void appendMoveTo(double x, double y)
Definition: KEYPath.cpp:342
libetonyek::KEYPath::operator*=
void operator*=(const KEYTransformation &tr)
Transform all elements of the path.
Definition: KEYPath.cpp:363
libetonyek::KEYPath::appendClose
void appendClose()
Definition: KEYPath.cpp:358
x
double x
Definition: KEYShape.cpp:99
KEYObject.h
libetonyek::operator*
KEYPath operator*(const KEYPath &path, const KEYTransformation &tr)
Create a transformed path.
Definition: KEYPath.cpp:403
libetonyek::KEYPath::approxEqual
friend bool approxEqual(const KEYPath &left, const KEYPath &right, const double eps)
Definition: KEYPath.cpp:385
KEY_EPSILON
#define KEY_EPSILON
Definition: libetonyek_utils.h:57
libetonyek::KEYPath::appendLineTo
void appendLineTo(double x, double y)
Definition: KEYPath.cpp:348
libetonyek::KEYPath::m_closed
bool m_closed
Definition: KEYPath.h:62
libetonyek::KEY2Token::right
Definition: KEY2Token.h:1068
libetonyek::KEYPath::swap
void swap(KEYPath &other)
Definition: KEYPath.cpp:329
libetonyek::KEY2Token::left
Definition: KEY2Token.h:1014
libetonyek::KEYPath::m_elements
std::deque< Element * > m_elements
Definition: KEYPath.h:61
libetonyek::KEYPath::clear
void clear()
Definition: KEYPath.cpp:335
libetonyek::KEYPath
Definition: KEYPath.h:27
libetonyek::KEYTransformation
Represents an affine transformation.
Definition: KEYTransformation.h:29
libetonyek_utils.h
KEYPath_fwd.h
libetonyek::KEY1Token::string
Definition: KEY1Token.h:75
libetonyek::KEY2Token::path
Definition: KEY2Token.h:357
libetonyek::KEYPath::appendCurveTo
void appendCurveTo(double x1, double y1, double x2, double y2, double x, double y)
Definition: KEYPath.cpp:353
libetonyek::KEYPath::toWPG
librevenge::RVNGPropertyListVector toWPG() const
Create WPG representation of this path.
Definition: KEYPath.cpp:368