Horizon
src
core
tools
tool_map_pin.hpp
1
#pragma once
2
#include "core/tool.hpp"
3
4
namespace
horizon {
5
class
ToolMapPin :
public
ToolBase {
6
public
:
7
ToolMapPin(IDocument *c, ToolID tid);
8
ToolResponse
begin
(
const
ToolArgs
&args)
override
;
9
ToolResponse
update
(
const
ToolArgs
&args)
override
;
10
bool
can_begin
()
override
;
11
~
ToolMapPin
();
12
std::set<InToolActionID> get_actions()
const override
13
{
14
using
I = InToolActionID;
15
return
{
16
I::LMB, I::CANCEL, I::RMB, I::ROTATE, I::MIRROR, I::EDIT, I::AUTOPLACE_ALL_PINS, I::AUTOPLACE_NEXT_PIN,
17
};
18
}
19
20
private
:
21
std::vector<std::pair<const class Pin *, bool>> pins;
22
unsigned
int
pin_index = 0;
23
class
SymbolPin *pin =
nullptr
;
24
SymbolPin *pin_last =
nullptr
;
25
SymbolPin *pin_last2 =
nullptr
;
26
void
create_pin(
const
UUID &uu);
27
bool
can_autoplace()
const
;
28
void
update_tip();
29
class
CanvasAnnotation *annotation =
nullptr
;
30
void
update_annotation();
31
};
32
}
// namespace horizon
horizon::ToolMapPin::update
ToolResponse update(const ToolArgs &args) override
Gets called whenever the user generated some sort of input.
horizon::ToolMapPin::can_begin
bool can_begin() override
horizon::ToolMapPin::begin
ToolResponse begin(const ToolArgs &args) override
Gets called right after the constructor has finished.
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::ToolMapPin
Definition:
tool_map_pin.hpp:5
Generated by
1.8.20