Loading...
Searching...
No Matches
LinearSegment.hpp
1#pragma once
2#include <Curve/Segment/CurveSegmentModel.hpp>
3
5
6namespace Curve
7{
8class LinearSegment;
9}
10
11CURVE_SEGMENT_METADATA(
12 SCORE_PLUGIN_CURVE_EXPORT, Curve::LinearSegment,
13 "a8bd14e2-d7e4-47cd-b76a-6a88fa11f0d2", "Linear", "Linear", "")
14
15namespace Curve
16{
17struct SCORE_PLUGIN_CURVE_EXPORT LinearSegmentData
18{
19};
20
21class SCORE_PLUGIN_CURVE_EXPORT LinearSegment final : public SegmentModel
22{
23 MODEL_METADATA_IMPL(LinearSegment)
24public:
25 using data_type = LinearSegmentData;
26 using SegmentModel::SegmentModel;
27
28 LinearSegment(const LinearSegment& other, const id_type& id, QObject* parent);
29
30 LinearSegment(DataStream::Deserializer& vis, QObject* parent)
31 : SegmentModel{vis, parent}
32 {
33 vis.writeTo(*this);
34 }
35
36 LinearSegment(JSONObject::Deserializer& vis, QObject* parent)
37 : SegmentModel{vis, parent}
38 {
39 vis.writeTo(*this);
40 }
41
42 void on_startChanged() override;
43 void on_endChanged() override;
44
45 void updateData(int numInterp) const override;
46 double valueAt(double x) const override;
47
48 QVariant toSegmentSpecificData() const override;
49
50 ossia::curve_segment<double> makeDoubleFunction() const override;
51 ossia::curve_segment<float> makeFloatFunction() const override;
52 ossia::curve_segment<int> makeIntFunction() const override;
53};
54}
55
56SCORE_SERIALIZE_DATASTREAM_DECLARE(SCORE_PLUGIN_CURVE_EXPORT, Curve::LinearSegmentData)
57Q_DECLARE_METATYPE(Curve::LinearSegmentData)
58W_REGISTER_ARGTYPE(Curve::LinearSegmentData)
Definition DataStreamVisitor.hpp:202
Definition JSONVisitor.hpp:423
Utilities and base classes for 1D curves.
Definition FocusDispatcher.hpp:12