score
Home
Classes
Namespaces
Files
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>
11
struct
DataStreamInput
;
12
struct
DataStreamOutput
;
13
14
namespace
Curve
15
{
16
class
Model;
17
class
PointModel;
18
class
SegmentModel;
19
class
SCORE_PLUGIN_CURVE_EXPORT
MovePoint
final :
public
score::Command
20
{
21
SCORE_COMMAND_DECL(CommandFactoryName(),
MovePoint
,
"Move a point"
)
22
public
:
23
MovePoint
(
const
Model
& curve,
const
Id<PointModel>
& pointId, Curve::Point newPoint);
24
25
void
undo(
const
score::DocumentContext
& ctx)
const override
;
26
void
redo(
const
score::DocumentContext
& ctx)
const override
;
27
28
void
29
update(
const
Model
& obj,
const
Id<PointModel>
& pointId,
const
Curve::Point& newPoint);
30
31
protected
:
32
void
serializeImpl(
DataStreamInput
& s)
const override
;
33
void
deserializeImpl(
DataStreamOutput
& s)
override
;
34
35
private
:
36
Path<Model>
m_model;
37
// Point ids are not kept across the rebuilds of the curve: its segments are.
38
OptionalId<SegmentModel> m_previous, m_following;
39
Curve::Point m_newPoint;
40
Curve::Point m_oldPoint;
41
};
42
}
Curve::Model
Definition
CurveModel.hpp:26
Curve::MovePoint
Definition
MovePoint.hpp:20
Path
The Path class is a typesafe wrapper around ObjectPath.
Definition
Path.hpp:52
id_base_t
The id_base_t class.
Definition
Identifier.hpp:59
score::Command
The Command class.
Definition
Command.hpp:34
Curve
Utilities and base classes for 1D curves.
Definition
FocusDispatcher.hpp:12
DataStreamInput
Definition
DataStreamHelpers.hpp:99
DataStreamOutput
Definition
DataStreamHelpers.hpp:103
score::DocumentContext
Definition
DocumentContext.hpp:18