2#include <Curve/Palette/CurvePoint.hpp>
4#include <score/model/IdentifiedObject.hpp>
5#include <score/plugins/UuidKey.hpp>
6#include <score/serialization/DataStreamFwd.hpp>
7#include <score/tools/IdentifierGeneration.hpp>
9#include <ossia/detail/algorithms.hpp>
71 Id<SegmentModel> i, Curve::Point s, Curve::Point e, OptionalId<SegmentModel> prev,
77 , previous(std::move(prev))
78 , following(std::move(foll))
80 , specificSegmentData(std::move(data))
86 Curve::Point start, end;
87 OptionalId<SegmentModel> previous, following;
90 QVariant specificSegmentData;
92 double x()
const {
return start.x(); }
97 return lhs.x() < rhs.x();
100inline bool operator<=(
const SegmentData& lhs,
const SegmentData& rhs)
102 return lhs.x() <= rhs.x();
106template <
typename Container>
110 auto end = ids.end();
114 }
while(ids.find(
id) != end);
123 auto end = ids.end();
127 }
while(ossia::find_if(ids, [&](
const auto& other) {
return other.id == id; }) != end);
136 auto end = ids.end();
140 }
while(ossia::find_if(ids, [&](
const auto& other) {
return other == id; }) != end);
149 std::size_t operator()(
const Id<SegmentModel>&
id)
const {
return id.val(); }
162#define CURVE_SEGMENT_FACTORY_METADATA(Export, Model, Uuid) \
164 struct Export Metadata<ConcreteKey_k, Model> \
166 static const auto& get() \
168 static const UuidKey<Curve::SegmentFactory> k{Uuid}; \
173#define CURVE_SEGMENT_METADATA(Export, Model, Uuid, ObjectKey, PrettyName, Category) \
174 OBJECTKEY_METADATA(Export, Model, ObjectKey) \
175 CURVE_SEGMENT_FACTORY_METADATA(Export, Model, Uuid) \
177 struct Export Metadata<PrettyName_k, Model> \
179 static auto get() { return QObject::tr(PrettyName); } \
182 struct Export Metadata<Curve::Category_k, Model> \
184 static auto get() { return QObject::tr(Category); } \
Metadata to categorize objects: curves, audio, etc.
Definition CurveSegmentData.hpp:147
Definition UuidKey.hpp:344
The id_base_t class.
Definition Identifier.hpp:57
Utilities and base classes for 1D curves.
Definition FocusDispatcher.hpp:12
Definition CurveSegmentData.hpp:63
static int32_t getRandomId()
getNextId
Definition IdentifierGeneration.cpp:38