Horizon
tool_draw_line_net.hpp
1 #pragma once
2 #include "core.hpp"
3 #include "tool_helper_merge.hpp"
4 #include "tool_helper_draw_net_setting.hpp"
5 
6 namespace horizon {
7 
9 public:
10  ToolDrawLineNet(Core *c, ToolID tid);
11  ToolResponse begin(const ToolArgs &args) override;
12  ToolResponse update(const ToolArgs &args) override;
13  bool can_begin() override;
14  bool handles_esc() override
15  {
16  return true;
17  }
18 
19 private:
20  Junction *temp_junc_head = 0;
21  Junction *temp_junc_mid = 0;
22  class LineNet *temp_line_head = 0;
23  class LineNet *temp_line_mid = 0;
24  class NetLabel *net_label = nullptr;
25  enum class BendMode { XY, YX, ARB };
26  BendMode bend_mode = BendMode::XY;
27  void move_temp_junc(const Coordi &c);
28  void update_tip();
29  void restart(const Coordi &c);
30 
31  class Component *component_floating = nullptr;
32  UUIDPath<2> connpath_floating;
33  class SymbolPin *pin_start = nullptr;
34 
35  Junction *make_temp_junc(const Coordi &c);
36  void apply_settings() override;
37 };
38 } // namespace horizon
bool handles_esc() override
Definition: tool_draw_line_net.hpp:14
ToolResponse update(const ToolArgs &args) override
Gets called whenever the user generated some sort of input.
Definition: tool_draw_line_net.cpp:116
Definition: symbol.hpp:22
bool can_begin() override
Definition: tool_draw_line_net.cpp:14
Definition: tool_helper_merge.hpp:5
This is what a Tool receives when the user did something.
Definition: core.hpp:26
A Component is an instanced Entity in a Block.
Definition: component.hpp:39
LineNet is similar to Line, except it denotes electrical connection.
Definition: line_net.hpp:24
Displays the junction&#39;s Net name it is attached to.
Definition: net_label.hpp:21
Where Tools and and documents meet.
Definition: core.hpp:240
Definition: tool_draw_line_net.hpp:8
Definition: tool_helper_draw_net_setting.hpp:6
To signal back to the core what the Tool did, a Tool returns a ToolResponse.
Definition: core.hpp:52
Definition: block.cpp:9
A Junction is a point in 2D-Space.
Definition: junction.hpp:25
ToolResponse begin(const ToolArgs &args) override
Gets called right after the constructor has finished.
Definition: tool_draw_line_net.cpp:19