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(); }
99 return lhs.x() < rhs.x();
102inline bool operator<=(
const SegmentData& lhs,
const SegmentData& rhs)
104 return lhs.x() <= rhs.x();
108template <
typename Container>
112 auto end = ids.end();
116 }
while(ids.find(
id) != end);
125 auto end = ids.end();
129 }
while(ossia::find_if(ids, [&](
const auto& other) {
return other.id == id; }) != end);
138 auto end = ids.end();
142 }
while(ossia::find_if(ids, [&](
const auto& other) {
return other == id; }) != end);
151 std::size_t operator()(
const Id<SegmentModel>&
id)
const {
return id.val(); }
164#define CURVE_SEGMENT_FACTORY_METADATA(Export, Model, Uuid) \
166 struct Export Metadata<ConcreteKey_k, Model> \
168 static const auto& get() \
170 static const UuidKey<Curve::SegmentFactory> k{Uuid}; \
175#define CURVE_SEGMENT_METADATA(Export, Model, Uuid, ObjectKey, PrettyName, Category) \
176 OBJECTKEY_METADATA(Export, Model, ObjectKey) \
177 CURVE_SEGMENT_FACTORY_METADATA(Export, Model, Uuid) \
179 struct Export Metadata<PrettyName_k, Model> \
181 static auto get() { return QObject::tr(PrettyName); } \
184 struct Export Metadata<Curve::Category_k, Model> \
186 static auto get() { return QObject::tr(Category); } \
Metadata to categorize objects: curves, audio, etc.
Definition CurveSegmentData.hpp:149
Definition UuidKey.hpp:344
The id_base_t class.
Definition Identifier.hpp:59
Utilities and base classes for 1D curves.
Definition FocusDispatcher.hpp:12
Definition CurveSegmentData.hpp:63
static int32_t getRandomId()
getNextId
Definition IdentifierGeneration.cpp:38