Loading...
Searching...
No Matches
score-plugin-spline3d/Spline3D/Model.hpp
1#pragma once
2#include <score_plugin_spline3d_export.h>
3#include <State/Address.hpp>
4#include <State/Unit.hpp>
5
6#include <Process/Process.hpp>
7
9
10#include <ossia/dataflow/nodes/spline/spline3d.hpp>
11
12#include <Spline3D/Metadata.hpp>
13
14#include <verdigris>
15
16namespace Spline3D
17{
18
19class SCORE_PLUGIN_SPLINE3D_EXPORT ProcessModel final : public Process::ProcessModel
20{
21 SCORE_SERIALIZE_FRIENDS
22 PROCESS_METADATA_IMPL(Spline3D::ProcessModel)
23
24 W_OBJECT(ProcessModel)
25
26public:
27 static constexpr bool hasExternalUI() noexcept { return true; }
29 const TimeVal& duration, const Id<Process::ProcessModel>& id, QObject* parent);
30 ~ProcessModel() override;
31
32 template <typename Impl>
33 ProcessModel(Impl& vis, QObject* parent)
34 : Process::ProcessModel{vis, parent}
35 {
36 vis.writeTo(*this);
37 init();
38 }
39
40 void init();
41 State::AddressAccessor address() const;
42 void setAddress(const State::AddressAccessor& arg);
43 State::Unit unit() const;
44 void setUnit(const State::Unit&);
45
46 bool tween() const { return m_tween; }
47 void setTween(bool tween)
48 {
49 if(m_tween == tween)
50 return;
51
52 m_tween = tween;
53 tweenChanged(tween);
54 }
55
56 QString prettyName() const noexcept override;
57
58 const ossia::spline3d_data& spline() const noexcept { return m_spline; }
59 void setSpline(const ossia::spline3d_data& c)
60 {
61 if(m_spline != c)
62 {
63 m_spline = c;
64 splineChanged();
65 }
66 }
67
68 std::unique_ptr<Process::Outlet> outlet;
69
70 void addressChanged(const ::State::AddressAccessor& arg_1)
71 W_SIGNAL(addressChanged, arg_1);
72 void tweenChanged(bool tween) W_SIGNAL(tweenChanged, tween);
73 void unitChanged(const State::Unit& arg_1) W_SIGNAL(unitChanged, arg_1);
74 void splineChanged() W_SIGNAL(splineChanged);
75
76private:
77 TimeVal contentDuration() const noexcept override;
78 void loadPreset(const Process::Preset& preset) override;
79 Process::Preset savePreset() const noexcept override;
80
81 ossia::spline3d_data m_spline;
82
83 bool m_tween = false;
84
85 W_PROPERTY(State::Unit, unit READ unit WRITE setUnit NOTIFY unitChanged)
86
87 W_PROPERTY(bool, tween READ tween WRITE setTween NOTIFY tweenChanged)
88
89 W_PROPERTY(
91 address READ address WRITE setAddress NOTIFY addressChanged)
92};
93}
The Process class.
Definition score-lib-process/Process/Process.hpp:80
Definition score-plugin-spline3d/Spline3D/Model.hpp:20
The id_base_t class.
Definition Identifier.hpp:59
Definition Preset.hpp:32
Definition Address.hpp:136
Definition Unit.hpp:18
Definition TimeValue.hpp:21