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 {
11 public:
19 GraphDrawer(
20 int num_samples, double lower_bound, double upper_bound, std::vector<vex::color> colors, size_t num_series = 1
21 );
26 void add_samples(std::vector<Translation2d> sample);
27
33 void add_samples(std::vector<double> sample);
34
42 void draw(vex::brain::lcd &screen, int x, int y, int width, int height);
43
44 private:
45 std::vector<std::vector<Translation2d>> series;
46 int sample_index = 0;
47 std::vector<vex::color> cols;
48 vex::color bgcol = vex::transparent;
49 bool border;
50 double upper;
51 double lower;
52 bool auto_fit = false;
53};