RIT VEXU Core API
Loading...
Searching...
No Matches
graph_drawer.h
1#pragma once
2
3#include "vex/vex.h"
4#include "core/math/eigen_interface.h"
5
6#include <stdio.h>
7#include <vector>
8
9class GraphDrawer {
10 public:
20 GraphDrawer(
21 int num_samples, double lower_bound, double upper_bound, std::vector<vex::color> colors, size_t num_series = 1
22 );
27 void add_samples(std::vector<EVec<2>> sample);
28
34 void add_samples(std::vector<double> sample);
35
43 void draw(vex::brain::lcd &screen, int x, int y, int width, int height);
44
45 private:
46 std::vector<std::vector<EVec<2>>> series;
47 int sample_index = 0;
48 std::vector<vex::color> cols;
49 vex::color bgcol = vex::transparent;
50 bool border;
51 double upper;
52 double lower;
53 bool auto_fit = false;
54};