29 lines
657 B
C++
29 lines
657 B
C++
#pragma once
|
|
|
|
#include "renderer.hpp"
|
|
|
|
#include <filesystem>
|
|
#include <sstream>
|
|
|
|
/**
|
|
* @brief SVG Renderer
|
|
*
|
|
* Draws shapes to an SVG format.
|
|
*/
|
|
class SvgRenderer final : public Renderer
|
|
{
|
|
public:
|
|
SvgRenderer(size_t width, size_t height);
|
|
|
|
void DrawLine(const math::Vector& p0, const math::Vector& p1) override;
|
|
void DrawRectangle(const math::Vector& pos, const math::Vector& size, float angle) override;
|
|
void DrawCircle(const math::Vector& center, float radius) override;
|
|
|
|
void Save(const std::filesystem::path& path);
|
|
|
|
~SvgRenderer() override = default;
|
|
|
|
private:
|
|
size_t m_width, m_height;
|
|
std::ostringstream m_out;
|
|
}; |