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 <deque>
16 #include <string>
17 
18 #include <glm/glm.hpp>
19 
20 #include <librevenge/librevenge.h>
21 
22 #include "libetonyek_utils.h"
23 
24 namespace libetonyek
25 {
26 
27 class IWORKPath
28 {
29  friend bool approxEqual(const IWORKPath &left, const IWORKPath &right, const double eps);
30 
31 public:
32  class Element;
33 
34 public:
35  IWORKPath();
36  explicit IWORKPath(const std::string &path);
37  IWORKPath(const IWORKPath &other);
38  ~IWORKPath();
39  IWORKPath &operator=(const IWORKPath &other);
40 
41  void swap(IWORKPath &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 glm::dmat3 &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 IWORKPath &left, const IWORKPath &right, double eps = ETONYEK_EPSILON);
66 bool operator==(const IWORKPath &left, const IWORKPath &right);
67 bool operator!=(const IWORKPath &left, const IWORKPath &right);
68 
75 IWORKPath operator*(const IWORKPath &path, const glm::dmat3 &tr);
76 
77 }
78 
79 #endif // IWORKPATH_H_INCLUDED
80 
81 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
IWORKPath & operator=(const IWORKPath &other)
Definition: IWORKPath.cpp:342
IWORKPath operator*(const IWORKPath &path, const glm::dmat3 &tr)
Create a transformed path.
Definition: IWORKPath.cpp:423
double y
Definition: IWORKShape.cpp:43
bool m_closed
Definition: IWORKPath.h:62
void swap(IWORKPath &other)
Definition: IWORKPath.cpp:349
void appendClose()
Definition: IWORKPath.cpp:378
void operator*=(const glm::dmat3 &tr)
Transform all elements of the path.
Definition: IWORKPath.cpp:383
Definition: IWORKToken.h:171
void clear()
Definition: IWORKPath.cpp:355
double x
Definition: IWORKShape.cpp:42
void appendMoveTo(double x, double y)
Definition: IWORKPath.cpp:362
Definition: IWORKPath.h:27
An element of path.
Definition: IWORKPath.cpp:33
Definition: KEY2Token.h:56
bool operator==(const IWORKPath &left, const IWORKPath &right)
Definition: IWORKPath.cpp:413
void appendLineTo(double x, double y)
Definition: IWORKPath.cpp:368
Definition: IWORKToken.h:147
bool operator!=(const IWORKPath &left, const IWORKPath &right)
Definition: IWORKPath.cpp:418
~IWORKPath()
Definition: IWORKPath.cpp:337
IWORKPath()
Definition: IWORKPath.cpp:283
#define ETONYEK_EPSILON
Definition: libetonyek_utils.h:60
std::deque< Element * > m_elements
Definition: IWORKPath.h:61
librevenge::RVNGPropertyListVector toWPG() const
Create WPG representation of this path.
Definition: IWORKPath.cpp:388
friend bool approxEqual(const IWORKPath &left, const IWORKPath &right, const double eps)
Definition: IWORKPath.cpp:405
bool approxEqual(const IWORKPath &left, const IWORKPath &right, const double eps)
Definition: IWORKPath.cpp:405
void appendCurveTo(double x1, double y1, double x2, double y2, double x, double y)
Definition: IWORKPath.cpp:373

Generated for libetonyek by doxygen 1.8.5