- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

CDRTransforms.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 __CDRTRANSFORMS_H__
11 #define __CDRTRANSFORMS_H__
12
13 #include <vector>
14 #include <math.h>
15
16 namespace libcdr
17 {
18 class CDRPath;
19
20 class CDRTransform
21 {
22 public:
23 CDRTransform();
24 CDRTransform(double v0, double v1, double x0, double v3, double v4, double y0);
25 CDRTransform(const CDRTransform &trafo);
26
27 void applyToPoint(double &x, double &y) const;
28 void applyToArc(double &rx, double &ry, double &rotation, bool &sweep, double &endx, double &endy) const;
29
30 private:
31 double m_v0;
32 double m_v1;
33 double m_x0;
34 double m_v3;
35 double m_v4;
36 double m_y0;
37 };
38
39 class CDRTransforms
40 {
41 public:
42 CDRTransforms();
43 CDRTransforms(const CDRTransforms &trafos);
44 ~CDRTransforms();
45
46 void append(double v0, double v1, double x0, double v3, double v4, double y0);
47 void append(const CDRTransform &trafo);
48 void clear();
49 bool empty() const;
50
51 void applyToPoint(double &x, double &y) const;
52 void applyToArc(double &rx, double &ry, double &rotation, bool &sweep, double &x, double &y) const;
53 double getScaleX() const;
54 double getScaleY() const;
55 double getTranslateX() const;
56 double getTranslateY() const;
57 bool getFlipX() const;
58 bool getFlipY() const;
59
60 private:
61 double _getScaleX() const;
62 double _getScaleY() const;
63 std::vector<CDRTransform> m_trafos;
64 };
65
66 } // namespace libcdr
67
68 #endif /* __CDRTRANSFORMS_H__ */
69 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libcdr::CDRTransforms::applyToArc
void applyToArc(double &rx, double &ry, double &rotation, bool &sweep, double &x, double &y) const
Definition: CDRTransforms.cpp:195
libcdr::CDRTransforms::getTranslateY
double getTranslateY() const
Definition: CDRTransforms.cpp:251
libcdr::CDRTransforms::empty
bool empty() const
Definition: CDRTransforms.cpp:184
libcdr::CDRTransforms::_getScaleY
double _getScaleY() const
Definition: CDRTransforms.cpp:222
libcdr::CDRTransforms::getScaleX
double getScaleX() const
Definition: CDRTransforms.cpp:212
libcdr::CDRTransforms::applyToPoint
void applyToPoint(double &x, double &y) const
Definition: CDRTransforms.cpp:189
libcdr::CDRTransform::m_v1
double m_v1
Definition: CDRTransforms.h:32
libcdr::CDRTransforms::CDRTransforms
CDRTransforms()
Definition: CDRTransforms.cpp:155
libcdr::CDRTransform
Definition: CDRTransforms.h:20
libcdr::CDRTransform::applyToPoint
void applyToPoint(double &x, double &y) const
Definition: CDRTransforms.cpp:31
libcdr::CDRTransforms::append
void append(double v0, double v1, double x0, double v3, double v4, double y0)
Definition: CDRTransforms.cpp:169
libcdr::CDRTransform::applyToArc
void applyToArc(double &rx, double &ry, double &rotation, bool &sweep, double &endx, double &endy) const
Definition: CDRTransforms.cpp:38
libcdr::CDRTransforms::getScaleY
double getScaleY() const
Definition: CDRTransforms.cpp:233
libcdr::CDRTransforms::getFlipX
bool getFlipX() const
Definition: CDRTransforms.cpp:217
libcdr::CDRTransform::CDRTransform
CDRTransform()
Definition: CDRTransforms.cpp:15
libcdr
Definition: CDRCollector.h:29
libcdr::CDRTransform::m_v3
double m_v3
Definition: CDRTransforms.h:34
libcdr::CDRTransforms::clear
void clear()
Definition: CDRTransforms.cpp:179
libcdr::CDRTransform::m_v4
double m_v4
Definition: CDRTransforms.h:35
libcdr::CDRTransform::m_v0
double m_v0
Definition: CDRTransforms.h:31
libcdr::CDRTransforms::getFlipY
bool getFlipY() const
Definition: CDRTransforms.cpp:238
libcdr::CDRTransform::m_y0
double m_y0
Definition: CDRTransforms.h:36
libcdr::CDRTransforms::_getScaleX
double _getScaleX() const
Definition: CDRTransforms.cpp:201
libcdr::CDRTransform::m_x0
double m_x0
Definition: CDRTransforms.h:33
libcdr::CDRTransforms::getTranslateX
double getTranslateX() const
Definition: CDRTransforms.cpp:243
libcdr::CDRTransforms::m_trafos
std::vector< CDRTransform > m_trafos
Definition: CDRTransforms.h:63
libcdr::CDRTransforms::~CDRTransforms
~CDRTransforms()
Definition: CDRTransforms.cpp:165
libcdr::CDRTransforms
Definition: CDRTransforms.h:39