summaryrefslogtreecommitdiff
path: root/svg.h
blob: d3f2120b714b88bb098033481032ec57d5eee3b9 (plain)
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
#pragma once

#include <vector>
#include <array>
#include <string>


struct Figure {
	Figure() = default;
	inline virtual ~Figure() {}
	Figure(const Figure &other) = default;
	Figure(Figure &&other) = default;
	Figure& operator=(const Figure &other) = default;
	Figure& operator=(Figure &&other) = default;
	virtual std::string svg() const = 0;
};

struct Polygon final : public Figure {
	std::vector<std::array<double, 2>> pts;
	std::string bg;

	Polygon(std::vector<std::array<double, 2>> pts, std::string bg);

	std::string svg() const override;
};

struct Text final : public Figure {
	double x, y;
	double rotation;
	std::string text;

	Text(double x, double y, double rotation, std::string text);

	std::string svg() const override;
};