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