Horizon
Loading...
Searching...
No Matches
tool_map_symbol.hpp
1#pragma once
2#include "core/tool.hpp"
3#include "tool_helper_map_symbol.hpp"
4#include "tool_helper_move.hpp"
5#include <list>
6
7namespace horizon {
9public:
10 ToolMapSymbol(IDocument *c, ToolID tid);
11 ToolResponse begin(const ToolArgs &args) override;
12 ToolResponse update(const ToolArgs &args) override;
13 bool can_begin() override;
14
15 class ToolDataMapSymbol : public ToolData {
16 public:
17 ToolDataMapSymbol(const std::vector<UUIDPath<2>> &g) : gates(g)
18 {
19 }
20 const std::vector<UUIDPath<2>> gates;
21 };
22
23 std::set<InToolActionID> get_actions() const override
24 {
25 using I = InToolActionID;
26 return {
27 I::LMB, I::CANCEL, I::RMB, I::ROTATE, I::MIRROR, I::EDIT,
28 };
29 }
30
31private:
32 std::map<UUIDPath<2>, std::string> gates_out;
33 class SchematicSymbol *sym_current = nullptr;
34 std::list<UUIDPath<2>> gates_from_data;
35 bool data_mode = false;
36};
37} // namespace horizon
Definition idocument.hpp:5
This is what a Tool receives when the user did something.
Definition tool_pub.hpp:23
Definition tool_data.hpp:4
Definition tool_helper_map_symbol.hpp:5
Definition tool_helper_move.hpp:6
Definition tool_map_symbol.hpp:15
Definition tool_map_symbol.hpp:8
ToolResponse begin(const ToolArgs &args) override
Gets called right after the constructor has finished.
Definition tool_map_symbol.cpp:20
bool can_begin() override
Definition tool_map_symbol.cpp:15
ToolResponse update(const ToolArgs &args) override
Gets called whenever the user generated some sort of input.
Definition tool_map_symbol.cpp:80
To signal back to the core what the Tool did, a Tool returns a ToolResponse.
Definition tool_pub.hpp:40
Stores a sequence of up to 3 UUIDs.
Definition uuid_path.hpp:12