-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTransform.h
55 lines (42 loc) · 1.16 KB
/
Transform.h
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
#ifndef TRANSFORM_H
#define TRANSFORM_H
#include <iostream>
#include <string>
#include <sstream>
#include <regex>
#include <windows.h>
#include <gdiplus.h>
#include "rapidxml.hpp"
#include "Point.h"
#pragma comment (lib,"Gdiplus.lib")
class Transform {
private:
float translateX, translateY;
float scaleX, scaleY;
float rotationAngle;
public:
//Constructor
Transform();
Transform(float translateX, float translateY, float scaleX, float scaleY, float rotationAngle);
//Apply transform
void apply(Gdiplus::Matrix& parentMatrix) const;
//Load transform from file
static Transform loadTransform(rapidxml::xml_node<>* node);
static void parseCommand(const std::string& command, const std::string& values, Transform& transform);
//Getter
float getTranslateX() const;
float getTranslateY() const;
float getScaleX() const;
float getScaleY() const;
float getRotationAngle() const;
//Setter
void setTranslateX(float translateX);
void setTranslateY(float translateY);
void setScaleX(float scaleX);
void setScaleY(float scaleY);
void setRotationAngle(float rotationAngle);
//Operator
bool operator==(const Transform& other) const;
bool isDefault() const;
};
#endif