Horizon
Loading...
Searching...
No Matches
tool_draw_line_net.hpp
1#pragma once
2#include "core/tool.hpp"
3#include "tool_helper_merge.hpp"
4#include "tool_helper_draw_net_setting.hpp"
5
6namespace horizon {
7
9public:
10 ToolDrawLineNet(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 std::set<InToolActionID> get_actions() const override
16 {
17 using I = InToolActionID;
18 return {
19 I::LMB,
20 I::CANCEL,
21 I::RMB,
22 I::PLACE_JUNCTION,
23 I::COMMIT,
24 I::POSTURE,
25 I::ARBITRARY_ANGLE_MODE,
26 I::NET_LABEL_SIZE_INC,
27 I::NET_LABEL_SIZE_DEC,
28 I::ENTER_SIZE,
29 I::ROTATE,
30 I::TOGGLE_NET_LABEL,
31 };
32 }
33
34private:
35 class SchematicJunction *temp_junc_head = 0;
36 SchematicJunction *temp_junc_mid = 0;
37 class LineNet *temp_line_head = 0;
38 class LineNet *temp_line_mid = 0;
39 class NetLabel *net_label = nullptr;
40 enum class BendMode { XY, YX, ARB };
41 BendMode bend_mode = BendMode::XY;
42 void move_temp_junc(const Coordi &c);
43 void update_tip();
44 void restart(const Coordi &c);
45
46 class Component *component_floating = nullptr;
47 UUIDPath<2> connpath_floating;
48 class SymbolPin *pin_start = nullptr;
49
50 class BlockInstance *block_instance_floating = nullptr;
51 UUID net_port_floating;
52 class BlockSymbolPort *port_start = nullptr;
53
54 void cleanup_floating();
55
56 SchematicJunction *make_temp_junc(const Coordi &c);
57 void apply_settings() override;
58 void set_snap_filter();
59 LineNet *insert_line_net();
60};
61} // namespace horizon
Definition block_instance.hpp:29
Definition block_symbol.hpp:20
A Component is an instanced Entity in a Block.
Definition component.hpp:40
Definition idocument.hpp:5
LineNet is similar to Line, except it denotes electrical connection.
Definition line_net.hpp:17
Displays the junction's Net name it is attached to.
Definition net_label.hpp:16
Definition schematic_junction.hpp:6
Definition symbol.hpp:20
This is what a Tool receives when the user did something.
Definition tool_pub.hpp:23
Definition tool_draw_line_net.hpp:8
ToolResponse begin(const ToolArgs &args) override
Gets called right after the constructor has finished.
Definition tool_draw_line_net.cpp:20
ToolResponse update(const ToolArgs &args) override
Gets called whenever the user generated some sort of input.
Definition tool_draw_line_net.cpp:141
bool can_begin() override
Definition tool_draw_line_net.cpp:15
Definition tool_helper_draw_net_setting.hpp:6
Definition tool_helper_merge.hpp:5
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
This class encapsulates a UUID and allows it to be uses as a value type.
Definition uuid.hpp:16