diff options
Diffstat (limited to 'svg.h')
-rw-r--r-- | svg.h | 35 |
1 files changed, 35 insertions, 0 deletions
@@ -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; +}; |