2 #include <Curve/Segment/CurveSegmentModel.hpp>
4 #include <score/model/Identifier.hpp>
6 #include <score/serialization/VisitorInterface.hpp>
7 #include <score/tools/std/Optional.hpp>
16 CURVE_SEGMENT_METADATA(
17 SCORE_PLUGIN_CURVE_EXPORT, Curve::PowerSegment,
18 "1e7cb83f-4e47-4b14-814d-2242a9c75991",
"Power",
"Power",
"")
23 struct SCORE_PLUGIN_CURVE_EXPORT PowerSegmentData
25 PowerSegmentData() =
default;
26 PowerSegmentData(
double d)
32 static const constexpr
double linearGamma = 1;
33 double gamma = linearGamma;
36 class SCORE_PLUGIN_CURVE_EXPORT PowerSegment final :
public SegmentModel
38 W_OBJECT(PowerSegment)
40 MODEL_METADATA_IMPL(PowerSegment)
41 using data_type = PowerSegmentData;
42 using SegmentModel::SegmentModel;
43 PowerSegment(
const SegmentData& dat, QObject* parent);
45 PowerSegment(
const PowerSegment& other,
const id_type&
id, QObject* parent);
48 : SegmentModel{vis, parent}
54 : SegmentModel{vis, parent}
59 double gamma = PowerSegmentData::linearGamma;
61 void on_startChanged()
override;
62 void on_endChanged()
override;
64 void updateData(
int numInterp)
const override;
65 double valueAt(
double x)
const override;
67 std::optional<double> verticalParameter()
const override;
68 void setVerticalParameter(
double p)
override;
70 QVariant toSegmentSpecificData()
const override;
73 ossia::curve_segment<Y> makeFunction()
const;
75 ossia::curve_segment<double> makeDoubleFunction()
const override;
76 ossia::curve_segment<float> makeFloatFunction()
const override;
77 ossia::curve_segment<int> makeIntFunction()
const override;
80 SCORE_PLUGIN_CURVE_EXPORT
84 SCORE_SERIALIZE_DATASTREAM_DECLARE(, Curve::PowerSegmentData)
85 Q_DECLARE_METATYPE(Curve::PowerSegmentData)
86 W_REGISTER_ARGTYPE(Curve::PowerSegmentData)
Definition: DataStreamVisitor.hpp:202
Definition: JSONVisitor.hpp:423
Utilities and base classes for 1D curves.
Definition: FocusDispatcher.hpp:12
Definition: CurveSegmentData.hpp:63