Loading...
Searching...
No Matches
CurvePointModel.hpp
1#pragma once
2#include <Curve/Palette/CurvePoint.hpp>
3
4#include <score/model/IdentifiedObject.hpp>
5#include <score/model/Identifier.hpp>
6#include <score/selection/Selectable.hpp>
7#include <score/tools/std/Optional.hpp>
8
9#include <score_plugin_curve_export.h>
10
11#include <verdigris>
12
13class QObject;
14namespace Curve
15{
16class SegmentModel;
17class SCORE_PLUGIN_CURVE_EXPORT PointModel final : public IdentifiedObject<PointModel>
18{
19 W_OBJECT(PointModel)
20public:
21 Selectable selection{this};
22 PointModel(const Id<PointModel>& id, QObject* parent);
23
24 const OptionalId<SegmentModel>& previous() const;
25 void setPrevious(const OptionalId<SegmentModel>& previous);
26
27 const OptionalId<SegmentModel>& following() const;
28 void setFollowing(const OptionalId<SegmentModel>& following);
29
30 Curve::Point pos() const;
31 void setPos(const Curve::Point& pos);
32
33public:
34 void posChanged() E_SIGNAL(SCORE_PLUGIN_CURVE_EXPORT, posChanged)
35
36private:
37 OptionalId<SegmentModel> m_previous, m_following;
38
39 Curve::Point m_pos;
40};
41}
42
43W_REGISTER_ARGTYPE(const Curve::PointModel*)
44W_REGISTER_ARGTYPE(Id<Curve::PointModel>)
Definition CurvePointModel.hpp:18
The IdentifiedObject class.
Definition IdentifiedObject.hpp:19
The Selectable class.
Definition Selectable.hpp:14
The id_base_t class.
Definition Identifier.hpp:57
Utilities and base classes for 1D curves.
Definition FocusDispatcher.hpp:12