IWORKPath.h Source File documentation

IWORKPath.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 IWORKPATH_H_INCLUDED
11 #define IWORKPATH_H_INCLUDED
12
13 #include "IWORKPath_fwd.h"
14
15 #include <string>
16
17 #include <glm/glm.hpp>
18
19 #include <librevenge/librevenge.h>
20
21 #include "libetonyek_utils.h"
22
23 namespace libetonyek
24 {
25
26 class IWORKPath
27 {
28 friend bool approxEqual(const IWORKPath &left, const IWORKPath &right, const double eps);
29
30 public:
31 struct Impl;
32 struct InvalidException {};
33
34 public:
35 IWORKPath();
36 explicit IWORKPath(const std::string &path);
37 IWORKPath(const IWORKPath &other);
38 IWORKPath &operator=(const IWORKPath &other);
39
40 void swap(IWORKPath &other);
41
42 void clear();
43
44 void appendMoveTo(double x, double y);
45 void appendLineTo(double x, double y);
46 void appendCurveTo(double x1, double y1, double x2, double y2, double x, double y);
47 void appendClose();
48
53 void operator*=(const glm::dmat3 &tr);
54
55 /* Create a string representation of this path.
56 *
57 * @return an SVG path representing this.
58 */
59 const std::string str() const;
60
63 void write(librevenge::RVNGPropertyListVector &vec) const;
64
65 private:
66 boost::shared_ptr<Impl> m_impl;
67 };
68
69 bool approxEqual(const IWORKPath &left, const IWORKPath &right, double eps = ETONYEK_EPSILON);
70 bool operator==(const IWORKPath &left, const IWORKPath &right);
71 bool operator!=(const IWORKPath &left, const IWORKPath &right);
72
79 IWORKPath operator*(const IWORKPath &path, const glm::dmat3 &tr);
80
81 }
82
83 #endif // IWORKPATH_H_INCLUDED
84
85 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libetonyek
Definition: IWORKBezierElement.cpp:18
libetonyek::IWORKToken::path
Definition: IWORKToken.h:216
libetonyek::operator*
IWORKPath operator*(const IWORKPath &path, const glm::dmat3 &tr)
Create a transformed path.
y
double y
Definition: IWORKShape.cpp:43
libetonyek::IWORKPath::swap
void swap(IWORKPath &other)
libetonyek::IWORKPath::appendClose
void appendClose()
libetonyek::IWORKPath::operator*=
void operator*=(const glm::dmat3 &tr)
Transform all elements of the path.
libetonyek::IWORKToken::left
Definition: IWORKToken.h:320
libetonyek::IWORKPath::clear
void clear()
libetonyek::IWORKPath::m_impl
boost::shared_ptr< Impl > m_impl
Definition: IWORKPath.h:66
x
double x
Definition: IWORKShape.cpp:42
libetonyek::IWORKPath::appendMoveTo
void appendMoveTo(double x, double y)
libetonyek::IWORKPath::str
const std::string str() const
libetonyek::IWORKPath
Definition: IWORKPath.h:26
libetonyek::IWORKPath::InvalidException
Definition: IWORKPath.h:32
libetonyek::IWORKToken::right
Definition: IWORKToken.h:335
libetonyek::operator==
bool operator==(const IWORKPath &left, const IWORKPath &right)
IWORKPath_fwd.h
libetonyek::IWORKPath::appendLineTo
void appendLineTo(double x, double y)
libetonyek::operator!=
bool operator!=(const IWORKPath &left, const IWORKPath &right)
libetonyek::IWORKPath::write
void write(librevenge::RVNGPropertyListVector &vec) const
Create librevenge representation of this path.
libetonyek::IWORKToken::string
Definition: IWORKToken.h:252
libetonyek::IWORKPath::IWORKPath
IWORKPath()
ETONYEK_EPSILON
#define ETONYEK_EPSILON
Definition: libetonyek_utils.h:56
libetonyek::IWORKPath::Impl
Definition: IWORKPath.cpp:62
libetonyek_utils.h
libetonyek::IWORKPath::approxEqual
friend bool approxEqual(const IWORKPath &left, const IWORKPath &right, const double eps)
libetonyek::IWORKPath::appendCurveTo
void appendCurveTo(double x1, double y1, double x2, double y2, double x, double y)
libetonyek::IWORKPath::operator=
IWORKPath & operator=(const IWORKPath &other)