summaryrefslogtreecommitdiff
path: root/svg.h
diff options
context:
space:
mode:
Diffstat (limited to 'svg.h')
-rw-r--r--svg.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/svg.h b/svg.h
new file mode 100644
index 0000000..d3f2120
--- /dev/null
+++ b/svg.h
@@ -0,0 +1,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;
+};