RIT VEXU Core API
Loading...
Searching...
No Matches
graph_drawer.h
1#pragma once
2
3#include "core/utils/math/geometry/translation2d.h"
4#include "vex.h"
5#include <cmath>
6#include <stdio.h>
7#include <string>
8#include <vector>
9
10class GraphDrawer {
11public:
18 GraphDrawer(int num_samples, double lower_bound, double upper_bound, std::vector<vex::color> colors,
19 size_t num_series = 1);
24 void add_samples(std::vector<Translation2d> sample);
25
31 void add_samples(std::vector<double> sample);
32
40 void draw(vex::brain::lcd &screen, int x, int y, int width, int height);
41
42private:
43 std::vector<std::vector<Translation2d>> series;
44 int sample_index = 0;
45 std::vector<vex::color> cols;
46 vex::color bgcol = vex::transparent;
47 bool border;
48 double upper;
49 double lower;
50 bool auto_fit = false;
51};