-
Notifications
You must be signed in to change notification settings - Fork 0
/
plot.h
102 lines (86 loc) · 2.64 KB
/
plot.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#ifndef PLOT_H
#define PLOT_H
#include <vector>
#include <map>
#include <string>
#include "bounds.h"
#include "image.h"
#include "func.h"
#include "fill.h"
class Plot {
private:
Bounds *bounds;
Image *image;
std::vector<Function*> functions;
std::vector<Fill*> fills;
// value semantics are prohibited
Plot(const Plot &);
Plot &operator=(const Plot &);
public:
Plot();
~Plot();
/** function to set the bounds of a plot
* @param x_min minimum x value
* @param x_max maximum x value
* @param y_min minimum y value
* @param y_max maximum y value
*/
void set_bounds(float xmin, float xmax, float ymin, float ymax);
/** sets the bounds for an Image
* @param width of the image
* @param height of the image
*/
void set_image(int width, int height);
/** adds a Function to the vector of Functions
* @param name name of function
* @param expr function expression
*/
void add_function(std::string &name, Expr *expr);
/** member function to set color values for a function
* @param f_name function name
* @param ri integer color value
* @param gi integer color value
* @param bi integer color value
*/
void set_color(std::string f_name, int ri, int gi, int bi);
/** function for setting the FillAbove and FillBelow fills
* @param f1 function name
* @param opacity opacity
* @param ri integer color value
* @param gi integer color value
* @param bi integer color value
* @param type of fill, 1 for FillAbove, 2 for FillBelow, 3 for FillBetween
*/
void add_fill(std::string f1, float opacity, int ri, int gi, int bi, int type);
/** function for setting the FillBetween fills
* @param f1 first function
* @param f2 second function
* @param opacity opacity
* @param ri integer color value
* @param gi integer color value
* @param bi integer color value
* @param type of fill
*/
void add_fill_2(std::string f1, std::string f2, float opacity, int ri, int gi, int bi, int type);
/** function to retrieve the vector of Fills
* @return vector of Fills
*/
std::vector<Fill*> get_fills() const { return fills; }
/** function to retrieve the vector of Functions
* @return vector of Functions
*/
std::vector<Function*> get_func() const { return functions; }
/** function to retrieve the the Bounds of the plot
* @return Bounds of the image
*/
Bounds *get_bounds() const { return bounds; }
/** function to retrieve the width of the plot
* @return width
*/
int get_width() const;
/** function to retrieve the height of the plot
* @return height
*/
int get_height() const;
};
#endif // PLOT_H