Horizon
horizon-eda-1.3.0
src
core
tools
tool_resize_symbol.hpp
1
#pragma once
2
#include "core/tool.hpp"
3
4
namespace
horizon {
5
6
class
ToolResizeSymbol
:
public
ToolBase
{
7
public
:
8
ToolResizeSymbol
(
IDocument
*c, ToolID tid);
9
ToolResponse
begin
(
const
ToolArgs
&args)
override
;
10
ToolResponse
update
(
const
ToolArgs
&args)
override
;
11
bool
can_begin
()
override
;
12
std::set<InToolActionID> get_actions()
const override
13
{
14
using
I = InToolActionID;
15
return
{
16
I::LMB, I::CANCEL, I::RMB, I::MOVE_UP, I::MOVE_DOWN, I::MOVE_LEFT, I::MOVE_RIGHT,
17
};
18
}
19
20
21
private
:
22
Coordi
pos_orig;
23
Coordi
delta_key;
24
std::map<std::pair<ObjectType, UUID>,
Coordi
> positions;
25
26
void
update_positions(
const
Coordi
&ac);
27
};
28
}
// namespace horizon
horizon::IDocument
Definition:
idocument.hpp:5
horizon::ToolResizeSymbol::update
ToolResponse update(const ToolArgs &args) override
Gets called whenever the user generated some sort of input.
Definition:
tool_resize_symbol.cpp:101
horizon::ToolResizeSymbol
Definition:
tool_resize_symbol.hpp:6
horizon::ToolResizeSymbol::can_begin
bool can_begin() override
Definition:
tool_resize_symbol.cpp:13
horizon::Coord
Your typical coordinate class.
Definition:
common.hpp:78
horizon::ToolBase
Common interface for all Tools.
Definition:
tool.hpp:121
horizon::ToolResponse
To signal back to the core what the Tool did, a Tool returns a ToolResponse.
Definition:
tool.hpp:42
horizon::ToolArgs
This is what a Tool receives when the user did something.
Definition:
tool.hpp:23
horizon::ToolResizeSymbol::begin
ToolResponse begin(const ToolArgs &args) override
Gets called right after the constructor has finished.
Definition:
tool_resize_symbol.cpp:18
Generated by
1.8.20