scatter 0.1.0
Transform.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/PlotOptions.hpp>
23#include <scatter/Point.hpp>
24
25namespace scatter
26{
27 class Ellipse;
28 class Arrow;
29
36 {
37 public:
47 // Transform(const Point &origin, const double &width, const double &height, const double &xmin, const double &xmax, const double &ymin, const
48 // double &ymax);
49 Transform(const Point &origin, const double &width, const double &height, const PlotOptions &options);
50
57 Point operator()(const Point &point) const;
58
65 Ellipse operator()(const Ellipse &ellipse) const;
66
73 Arrow operator()(const Arrow &arrow) const;
74
82 Point operator()(const double &xval, const double &yval) const;
83
91 Point absolute(const double &xscale, const double &yscale) const;
92
100 Point relative(const double &xscale, const double &yscale) const;
101
107 const PlotOptions &getOptions() const;
108
109 private:
111 const Point origin_;
112
114 double width_;
116 double height_;
117
119 double x_min_;
121 double x_max_;
123 double x_scale_;
125 double x_delta_;
126
128 double y_min_;
130 double y_max_;
132 double y_scale_;
134 double y_delta_;
135
137 double p_x_min_;
139 double p_x_max_;
141 double p_y_min_;
143 double p_y_max_;
144
145 PlotOptions options_;
146
154 double x(const double &val) const;
155
163 double y(const double &val) const;
164 };
165} // namespace scatter
[brief description]
Definition Arrow.hpp:32
[brief description]
Definition Ellipse.hpp:31
[brief description]
Definition PlotOptions.hpp:36
[brief description]
Definition Point.hpp:29
[brief description]
Definition Transform.hpp:36
Point operator()(const Point &point) const
[brief description]
Point absolute(const double &xscale, const double &yscale) const
[brief description]
Arrow operator()(const Arrow &arrow) const
[brief description]
Ellipse operator()(const Ellipse &ellipse) const
[brief description]
Point relative(const double &xscale, const double &yscale) const
[brief description]
Point operator()(const double &xval, const double &yval) const
[brief description]
const PlotOptions & getOptions() const
[brief description]
Transform(const Point &origin, const double &width, const double &height, const PlotOptions &options)
[brief description]