test_sdk/script/gtl_scr_spec_humps.h

63 lines
1.2 KiB
C
Raw Normal View History

#ifndef SPEC_HUMPS_H
#define SPEC_HUMPS_H
#include <QObject>
#include "math/gtl_math_spec.h"
#include "script_global.h"
namespace gtl
{
namespace scr
{
class SCRIPT_EXPORT spec_humps : public QObject
{
Q_OBJECT
public:
struct hump
{
hump() : area(0){}
qreal area;
int left_idx;
int right_idx;
qreal bgnd;
qreal net;
};
public:
explicit spec_humps(QObject *parent, const QJsonObject &args);
void update();
void get_line(std::back_insert_iterator<std::vector<qreal>> line);
qreal x0() const;
qreal dx() const;
int color() const;
int count() const;
const hump& operator[](int idx) const;
private:
qreal _left;
qreal _right;
int _color;
int _smoothing_factor;
int _smoothing_passes;
int _left_idx;
int _right_idx;
qreal _x0;
qreal _dx;
std::vector<qreal> _line;
std::vector<hump> _humps;
signals:
};
}
}
#endif // SPEC_HUMPS_H