This repository has been archived by the owner on Jan 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTransform.hpp
61 lines (53 loc) · 1.77 KB
/
Transform.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#ifndef TRANSFORM_H_
#define TRANSFORM_H_
#include "Point.hpp"
namespace spic {
/**
* @brief Instances of this class represent specific 2D transformations.
* @spicapi
*/
struct Transform {
Point position; // Translation (shift)
double rotation; // Rotation, in radians
double scale; // Multiplication factor
/**
* @brief Operator to add two Transforms.
* @param lhs The left Transform.
* @param rhs The right Transform.
* @return The sum of the two Transforms.
* @sharedapi
*/
friend Transform operator+(Transform lhs, const Transform& rhs);
/**
* @brief Add one Transform to this.
* @param rhs The Transform to add.
* @return The sum of the two Transforms.
* @sharedapi
*/
Transform& operator+=(const Transform& rhs);
/**
* @brief Operator to subtract two Transforms.
* @param lhs The left Transform.
* @param rhs The right Transform.
* @return The subtraction of the two Transforms.
* @sharedapi
*/
friend Transform operator-(Transform lhs, const Transform& rhs);
/**
* @brief Subtract one Transform to this.
* @param rhs The Transform to subtract.
* @return The subtraction of the two Transforms.
* @sharedapi
*/
Transform& operator-=(const Transform& rhs);
/**
* @brief Operator to add a Point to a Transform.
* @param lhs The Transform.
* @param rhs The Point.
* @return The Transform with the added Point.
* @sharedapi
*/
friend Transform operator+(Transform lhs, const Point& rhs);
};
}
#endif // TRANSFORM_H_