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 __VECTORTRANSFORMATION2D_H__
11#define __VECTORTRANSFORMATION2D_H__
12
13namespace libmspub
14{
16{
17 double m_x;
18 double m_y;
19 Vector2D(double x, double y) : m_x(x), m_y(y)
20 {
21 }
22};
23Vector2D operator+(const Vector2D &l, const Vector2D &r);
24Vector2D operator-(const Vector2D &l, const Vector2D &r);
26{
28 double m_x, m_y;
29public:
31 Vector2D transform(Vector2D original) 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 /* __VECTORTRANSFORMATION2D_H__ */
46/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
Definition: VectorTransformation2D.h:26
friend VectorTransformation2D operator*(const VectorTransformation2D &l, const VectorTransformation2D &r)
Definition: VectorTransformation2D.cpp:23
double m_m11
Definition: VectorTransformation2D.h:27
double m_m12
Definition: VectorTransformation2D.h:27
static VectorTransformation2D fromTranslate(double x, double y)
Definition: VectorTransformation2D.cpp:44
double m_y
Definition: VectorTransformation2D.h:28
double m_x
Definition: VectorTransformation2D.h:28
double m_m22
Definition: VectorTransformation2D.h:27
static VectorTransformation2D fromFlips(bool flipH, bool flipV)
Definition: VectorTransformation2D.cpp:35
bool orientationReversing() const
Definition: VectorTransformation2D.cpp:113
static VectorTransformation2D fromCounterRadians(double theta)
Definition: VectorTransformation2D.cpp:54
Vector2D transform(Vector2D original) const
Definition: VectorTransformation2D.cpp:64
VectorTransformation2D()
Definition: VectorTransformation2D.cpp:18
double getHorizontalScaling() const
Definition: VectorTransformation2D.cpp:103
double getVerticalScaling() const
Definition: VectorTransformation2D.cpp:108
double m_m21
Definition: VectorTransformation2D.h:27
double getRotation() const
Definition: VectorTransformation2D.cpp:90
Vector2D transformWithOrigin(Vector2D v, Vector2D origin) const
Definition: VectorTransformation2D.cpp:71
Definition: Arrow.h:14
Vector2D operator-(const Vector2D &l, const Vector2D &r)
Definition: VectorTransformation2D.cpp:83
Vector2D operator+(const Vector2D &l, const Vector2D &r)
Definition: VectorTransformation2D.cpp:76
VectorTransformation2D operator*(const VectorTransformation2D &l, const VectorTransformation2D &r)
Definition: VectorTransformation2D.cpp:23
Definition: VectorTransformation2D.h:16
double m_x
Definition: VectorTransformation2D.h:17
Vector2D(double x, double y)
Definition: VectorTransformation2D.h:19
double m_y
Definition: VectorTransformation2D.h:18

Generated for libmspub by doxygen 1.9.3