forked from ange-yaghi/engine-sim
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathoscilloscope.h
More file actions
55 lines (40 loc) · 1.17 KB
/
oscilloscope.h
File metadata and controls
55 lines (40 loc) · 1.17 KB
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
#ifndef ATG_ENGINE_SIM_OSCILLOSCOPE_H
#define ATG_ENGINE_SIM_OSCILLOSCOPE_H
#include "ui_element.h"
class Oscilloscope : public UiElement {
public:
struct DataPoint {
double x, y;
};
public:
Oscilloscope();
virtual ~Oscilloscope();
virtual void initialize(EngineSimApplication *app);
virtual void destroy();
virtual void update(float dt);
virtual void render();
void render(const Bounds &bounds);
Point dataPointToRenderPosition(
const DataPoint &p,
const Bounds &bounds) const;
void addDataPoint(double x, double y);
void setBufferSize(int n);
void reset();
double m_xMin;
double m_xMax;
double m_yMin;
double m_yMax;
double m_dynamicallyResizeX;
double m_dynamicallyResizeY;
double m_lineWidth;
bool m_drawReverse;
bool m_drawZero;
ysVector i_color;
protected:
DataPoint *m_points;
Point *m_renderBuffer;
int m_writeIndex;
int m_bufferSize;
int m_pointCount;
};
#endif /* ATG_ENGINE_SIM_OSCILLOSCOPE_H */