Loading...
Searching...
No Matches
UpdateCurve.hpp
1#pragma once
2#include <Curve/Commands/CurveCommandFactory.hpp>
3#include <Curve/Segment/CurveSegmentData.hpp>
4
5#include <score/command/Command.hpp>
6#include <score/model/path/Path.hpp>
7#include <score/tools/Unused.hpp>
8
9#include <vector>
10
11namespace Curve
12{
13class Model;
14
15class SCORE_PLUGIN_CURVE_EXPORT UpdateCurve final : public score::Command
16{
17 SCORE_COMMAND_DECL(CommandFactoryName(), UpdateCurve, "Update Curve")
18public:
19 UpdateCurve(const Model& model, std::vector<SegmentData>&& segments);
20
21 void undo(const score::DocumentContext& ctx) const override;
22 void redo(const score::DocumentContext& ctx) const override;
23
24 void update(unused_t, std::vector<SegmentData>&& segments)
25 {
26 m_newCurveData = std::move(segments);
27 }
28
29protected:
30 void serializeImpl(DataStreamInput& s) const override;
31 void deserializeImpl(DataStreamOutput& s) override;
32
33private:
34 Path<Model> m_model;
35 std::vector<SegmentData> m_oldCurveData;
36 std::vector<SegmentData> m_newCurveData;
37};
38}
Definition CurveModel.hpp:25
Definition UpdateCurve.hpp:16
The Path class is a typesafe wrapper around ObjectPath.
Definition Path.hpp:52
The Command class.
Definition Command.hpp:34
Utilities and base classes for 1D curves.
Definition FocusDispatcher.hpp:12
Definition DataStreamHelpers.hpp:99
Definition DataStreamHelpers.hpp:103
Definition DocumentContext.hpp:18
Definition Unused.hpp:3