Horizon
Loading...
Searching...
No Matches
tool_map_port.hpp
1#pragma once
2#include "core/tool.hpp"
3
4namespace horizon {
5class ToolMapPort : public ToolBase {
6public:
7 using ToolBase::ToolBase;
8 ToolResponse begin(const ToolArgs &args) override;
9 ToolResponse update(const ToolArgs &args) override;
10 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::ROTATE, I::MIRROR, I::EDIT, I::AUTOPLACE_ALL_PINS, I::AUTOPLACE_NEXT_PIN,
17 };
18 }
19
20private:
21 std::vector<std::pair<const class Net *, bool>> port_nets;
22 unsigned int port_index = 0;
23 class BlockSymbolPort *port = nullptr;
24 BlockSymbolPort *port_last = nullptr;
25 BlockSymbolPort *port_last2 = nullptr;
26 void create_port(const UUID &uu);
27 bool can_autoplace() const;
28 void update_tip();
29 class CanvasAnnotation *annotation = nullptr;
30 void update_annotation();
31 std::optional<UUID> map_port_dialog();
32};
33} // namespace horizon
Definition block_symbol.hpp:20
Definition annotation.hpp:7
This is what a Tool receives when the user did something.
Definition tool_pub.hpp:23
Common interface for all Tools.
Definition tool_pub.hpp:94
Definition tool_map_port.hpp:5
ToolResponse begin(const ToolArgs &args) override
Gets called right after the constructor has finished.
Definition tool_map_port.cpp:38
ToolResponse update(const ToolArgs &args) override
Gets called whenever the user generated some sort of input.
Definition tool_map_port.cpp:154
bool can_begin() override
Definition tool_map_port.cpp:13
To signal back to the core what the Tool did, a Tool returns a ToolResponse.
Definition tool_pub.hpp:40
This class encapsulates a UUID and allows it to be uses as a value type.
Definition uuid.hpp:16