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
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 /* INCLUDED_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:24
double m_m11
Definition VectorTransformation2D.h:27
double m_m12
Definition VectorTransformation2D.h:27
static VectorTransformation2D fromTranslate(double x, double y)
Definition VectorTransformation2D.cpp:45
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:36
bool orientationReversing() const
Definition VectorTransformation2D.cpp:114
static VectorTransformation2D fromCounterRadians(double theta)
Definition VectorTransformation2D.cpp:55
Vector2D transform(Vector2D original) const
Definition VectorTransformation2D.cpp:65
VectorTransformation2D()
Definition VectorTransformation2D.cpp:19
double getHorizontalScaling() const
Definition VectorTransformation2D.cpp:104
double getVerticalScaling() const
Definition VectorTransformation2D.cpp:109
double m_m21
Definition VectorTransformation2D.h:27
double getRotation() const
Definition VectorTransformation2D.cpp:91
Vector2D transformWithOrigin(Vector2D v, Vector2D origin) const
Definition VectorTransformation2D.cpp:72
Definition Arrow.h:14
Vector2D operator-(const Vector2D &l, const Vector2D &r)
Definition VectorTransformation2D.cpp:84
Vector2D operator+(const Vector2D &l, const Vector2D &r)
Definition VectorTransformation2D.cpp:77
VectorTransformation2D operator*(const VectorTransformation2D &l, const VectorTransformation2D &r)
Definition VectorTransformation2D.cpp:24
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.14.0