VectorTransformation2D.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 libmspub 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 INCLUDED_VECTORTRANSFORMATION2D_H
11 #define INCLUDED_VECTORTRANSFORMATION2D_H
12 
13 namespace libmspub
14 {
15 struct Vector2D
16 {
17  double m_x;
18  double m_y;
19  Vector2D(double x, double y) : m_x(x), m_y(y)
20  {
21  }
22 };
23 Vector2D operator+(const Vector2D &l, const Vector2D &r);
24 Vector2D operator-(const Vector2D &l, const Vector2D &r);
26 {
27  double m_m11, m_m12, m_m21, m_m22;
28  double m_x, m_y;
29 public:
31  Vector2D transform(Vector2D original) const;
32  Vector2D transformWithOrigin(Vector2D v, Vector2D origin) const;
33  double getRotation() const;
34  double getHorizontalScaling() const;
35  double getVerticalScaling() const;
36  bool orientationReversing() const;
38  static VectorTransformation2D fromFlips(bool flipH, bool flipV);
39  static VectorTransformation2D fromTranslate(double x, double y);
40  static VectorTransformation2D fromCounterRadians(double theta);
41 };
43 } // namespace libmspub
44 
45 #endif /* INCLUDED_VECTORTRANSFORMATION2D_H */
46 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
Vector2D(double x, double y)
Definition: VectorTransformation2D.h:19
Vector2D operator+(const Vector2D &l, const Vector2D &r)
Definition: VectorTransformation2D.cpp:77
double m_y
Definition: VectorTransformation2D.h:28
Vector2D operator-(const Vector2D &l, const Vector2D &r)
Definition: VectorTransformation2D.cpp:84
VectorTransformation2D operator*(const VectorTransformation2D &l, const VectorTransformation2D &r)
Definition: VectorTransformation2D.cpp:24
Definition: Arrow.h:13
double m_m22
Definition: VectorTransformation2D.h:27
Definition: VectorTransformation2D.h:25
Definition: VectorTransformation2D.h:15
double m_x
Definition: VectorTransformation2D.h:17
double m_y
Definition: VectorTransformation2D.h:18

Generated for libmspub by doxygen 1.8.13