1 Star 0 Fork 0

tectim/engine-sim

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
oscilloscope.h 1.17 KB
一键复制 编辑 原始数据 按行查看 历史
Ange Yaghi 提交于 2022-08-15 10:02 +08:00 . [#80] Added automatic chart scaling
#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 */
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/tectim/engine-sim.git
git@gitee.com:tectim/engine-sim.git
tectim
engine-sim
engine-sim
master

搜索帮助