From 2d793b22ff8038fe62a8be9709084bab578e809c Mon Sep 17 00:00:00 2001 From: Dnomd343 Date: Fri, 20 Jan 2023 21:07:02 +0800 Subject: [PATCH] feat: constructor of SvgRect --- src/graph/graph.cc | 44 -------------------------------------------- src/graph/svg/svg.h | 4 ++++ 2 files changed, 4 insertions(+), 44 deletions(-) diff --git a/src/graph/graph.cc b/src/graph/graph.cc index 64e2ae5..8b93a61 100644 --- a/src/graph/graph.cc +++ b/src/graph/graph.cc @@ -8,50 +8,6 @@ void Graph::svg_demo(Analyse::track_data_t track_data) { - - auto s = new SvgRect(); - - s->left = 50; - s->top = 80; - - s->width = 100; - s->height = 200; - - s->radius = 20; - - s->opacity = 0.8; - s->line_opacity = 0.5; - - s->color = "blue"; - s->line_color = "green"; - -// printf(R"()", 1000, 1000); -// printf("\n"); -// -// std::cout << " " << s.dump() << std::endl; -// -// printf("\n"); - - auto l = new SvgLine(); - l->start_x = 100; - l->start_y = 200; - - l->end_x = 300; - l->end_y = 400; - - auto sg = SvgGraph(1000, 2000); -// sg.insert(&s); -// sg.insert(&l); - - sg.insert(s); - sg.insert(l); - - std::cout << sg.dump() << std::endl; - - return; - - - // // for (uint32_t i = 0; i < track_data.size(); ++i) { // diff --git a/src/graph/svg/svg.h b/src/graph/svg/svg.h index 7808a29..c43c3b6 100644 --- a/src/graph/svg/svg.h +++ b/src/graph/svg/svg.h @@ -32,9 +32,12 @@ public: uint64_t end_x; uint64_t end_y; + // TODO: more options for svg-line + ~SvgLine() override = default; std::string dump() const override; + // TODO: SvgLine(...) }; class SvgRect : public SvgObject { @@ -55,4 +58,5 @@ public: ~SvgRect() override = default; std::string dump() const override; + SvgRect(uint64_t t, uint64_t l, uint64_t w, uint64_t h) : top(t), left(l), width(w), height(h) {} };