-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathViewbox.h
46 lines (37 loc) · 1.03 KB
/
Viewbox.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
#ifndef VIEWBOX_H
#define VIEWBOX_H
#include <string>
#include <sstream>
#include <vector>
#include <windows.h>
#include <gdiplus.h>
#include "rapidxml.hpp"
using namespace std;
using namespace rapidxml;
using namespace Gdiplus;
#pragma comment(lib, "Gdiplus.lib")
const float DefaultScale = 1.0f;
class Viewbox {
private:
float viewX, viewY, viewWidth, viewHeight;
float portWidth, portHeight;
std::string preservedForm, preservedMode;
public:
// Constructor
Viewbox();
Viewbox(float viewX, float viewY, float viewWidth, float viewHeight,
float portWidth, float portHeight,
const std::string& preservedForm, const std::string& preservedMode);
// Getter
float getViewX() const;
float getViewY() const;
float getViewWidth() const;
float getViewHeight() const;
float getPortWidth() const;
float getPortHeight() const;
std::string getPreservedForm() const;
std::string getPreservedMode() const;
void parseViewbox(rapidxml::xml_node<>* node);
void render(Graphics& graphics, RECT& window);
};
#endif // VIEWBOX_H