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

Generated for libetonyek by doxygen 1.9.3