scatter 0.1.0
PlotBase.hpp
1/*
2 * Copyright (C) Tobias Löw (tobi.loew@protonmail.ch)
3 *
4 * This file is part of Scatter
5 *
6 * Scatter is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * Scatter is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with Scatter. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20#pragma once
21
22#include <scatter/Legend.hpp>
23#include <scatter/Plot.hpp>
24
25namespace scatter
26{
28 class Renderer;
29 class Transform;
30
36 {
37 public:
42 PlotBase(const std::string &label);
43
48 virtual ~PlotBase() = default;
49
57 virtual void render(Renderer &renderer, const Transform &transform) = 0;
58
65
70 void setLabel(const std::string &label);
71
76 void setColour(const Colour &colour);
77
82 const std::string &getLabel() const;
83
88 const Colour &getColour() const;
89
95 virtual double getYmax();
96
97 protected:
98 private:
100 std::string label_;
101
103 Colour colour_;
104 };
105
106} // namespace scatter
define a RGBA colour
Definition Colour.hpp:34
[brief description]
Definition PlotBase.hpp:36
void setColour(const Colour &colour)
[brief description]
PlotBase(const std::string &label)
[brief description]
const std::string & getLabel() const
[brief description]
virtual Legend::Entry getLegendEntry()=0
create LegendEntry
virtual double getYmax()
[brief description]
virtual ~PlotBase()=default
[brief description]
const Colour & getColour() const
[brief description]
virtual void render(Renderer &renderer, const Transform &transform)=0
[brief description]
void setLabel(const std::string &label)
[brief description]
[brief description]
Definition Renderer.hpp:38
[brief description]
Definition Transform.hpp:36
[brief description]
Definition Legend.hpp:59