Loading...
Searching...
No Matches
MovePoint.hpp
1#pragma once
2#include <Curve/Commands/CurveCommandFactory.hpp>
3#include <Curve/Palette/CurvePoint.hpp>
4
5#include <score/command/Command.hpp>
6#include <score/model/Identifier.hpp>
7#include <score/model/path/Path.hpp>
8#include <score/tools/std/Optional.hpp>
9
10#include <score_plugin_curve_export.h>
11struct DataStreamInput;
12struct DataStreamOutput;
13
14namespace Curve
15{
16class Model;
17class PointModel;
18class SCORE_PLUGIN_CURVE_EXPORT MovePoint final : public score::Command
19{
20 SCORE_COMMAND_DECL(CommandFactoryName(), MovePoint, "Move a point")
21public:
22 MovePoint(const Model& curve, const Id<PointModel>& pointId, Curve::Point newPoint);
23
24 void undo(const score::DocumentContext& ctx) const override;
25 void redo(const score::DocumentContext& ctx) const override;
26
27 void
28 update(const Model& obj, const Id<PointModel>& pointId, const Curve::Point& newPoint);
29
30protected:
31 void serializeImpl(DataStreamInput& s) const override;
32 void deserializeImpl(DataStreamOutput& s) override;
33
34private:
35 Path<Model> m_model;
36 Id<PointModel> m_pointId;
37 Curve::Point m_newPoint;
38 Curve::Point m_oldPoint;
39};
40}
Definition CurveModel.hpp:25
Definition MovePoint.hpp:19
The Path class is a typesafe wrapper around ObjectPath.
Definition Path.hpp:52
The id_base_t class.
Definition Identifier.hpp:57
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