plugins/score-plugin-spline/Spline/commands.hpp
1 #pragma once
2 #include <score/command/Command.hpp>
3 #include <score/model/path/Path.hpp>
4 
5 #include <ossia/dataflow/nodes/spline/spline2d.hpp>
6 
7 namespace Spline
8 {
9 class ProcessModel;
10 const CommandGroupKey& CommandFactoryName();
11 
12 class ChangeSpline final : public score::Command
13 {
14  SCORE_COMMAND_DECL(Spline::CommandFactoryName(), ChangeSpline, "Change Spline")
15 public:
16  ChangeSpline(const ProcessModel& autom, const ossia::spline_data& newval);
17 
18 public:
19  void undo(const score::DocumentContext& ctx) const override;
20  void redo(const score::DocumentContext& ctx) const override;
21 
22  void update(const ProcessModel&, const ossia::spline_data& newval);
23  void update(const ProcessModel&, ossia::spline_data&& newval);
24 
25 protected:
26  void serializeImpl(DataStreamInput& s) const override;
27  void deserializeImpl(DataStreamOutput& s) override;
28 
29 private:
30  Path<ProcessModel> m_path;
31  ossia::spline_data m_old, m_new;
32 };
33 }
Definition: plugins/score-plugin-spline/Spline/commands.hpp:13
Definition: score-plugin-spline/Spline/Model.hpp:19
The Command class.
Definition: Command.hpp:34
Definition: DataStreamHelpers.hpp:99
Definition: DataStreamHelpers.hpp:103
Definition: DocumentContext.hpp:18