Files
Renderive/YSGraphic_Core/plottable/Afterglow.h
T
2026-06-16 13:33:27 +08:00

66 lines
2.0 KiB
C++

#pragma once
#include "../RenderAble.h"
#include "../Axis/FrequentAxis.h"
namespace YSG {
class FrequentAxis;
class AfterglowPlot;
struct AfterglowPrivate;
class LIB_DECL Afterglow : public RenderAble {
public:
Q_Ptr2(Afterglow)
PROP(FrequentAxis*, frequentAxis)
PROP(Axis*, powerAxis)
PROP(Range, frequentRange)
PROP(Range, powerRange)
PROP(int, frequentPointSize)
PROP(int, powerPointSize)
PROP(int, bufferSize)
PROP(bool, interpolate)
PROP(double, attenuationRate)
PROP(int, initStrongValue)
void giveData(const QVector<double> &powerRangeData);
template <typename That> struct BuilderT;
struct Builder;
};
struct Afterglow_Prop {
FrequentAxis *frequentAxis{};
Axis *powerAxis{};
Range frequentRange{0,10};
Range powerRange{0, 10};
int frequentPointSize{};
int powerPointSize{};
int bufferSize{};
bool interpolate = true; //线性插值
double attenuationRate = 0.2; //衰减率 衰减率为 1.0代表 不使用衰减
int initStrongValue = 100; //初始强度
};
template <typename That>
struct Afterglow::BuilderT {
PROP_BT(FrequentAxis*, frequentAxis)
PROP_BT(Axis*, powerAxis)
PROP_BT(Range, frequentRange)
PROP_BT(Range, powerRange)
PROP_BT(int, frequentPointSize)
PROP_BT(int, powerPointSize)
PROP_BT(int, bufferSize)
PROP_BT(bool, interpolate)
PROP_BT(double, attenuationRate)
PROP_BT(int, initStrongValue)
SETTER_T(QString, layerName, "plottable")
void init(FrequentAxis* frequentAxis, Axis* powerAxis);
void set(Afterglow* t);
protected:
Plot *plot{};
};
struct LIB_DECL Afterglow::Builder : Afterglow::BuilderT<Afterglow::Builder>, Afterglow_Prop {
Afterglow* build();
Builder(FrequentAxis* frequentAxis, Axis* powerAxis);
};
}