Horizon
tool_draw_connection_line.hpp
1 #pragma once
2 #include "core/tool.hpp"
3 
4 namespace horizon {
5 
7 public:
8  using ToolBase::ToolBase;
9  ToolResponse begin(const ToolArgs &args) override;
10  ToolResponse update(const ToolArgs &args) override;
11  bool can_begin() override;
12  std::set<InToolActionID> get_actions() const override
13  {
14  using I = InToolActionID;
15  return {
16  I::LMB,
17  I::CANCEL,
18  I::RMB,
19  };
20  }
21 
22 private:
23  class BoardJunction *temp_junc = 0;
24  class ConnectionLine *temp_line = 0;
25  class ConnectionLine *temp_line_last = 0;
26  class ConnectionLine *temp_line_last2 = 0;
27  class Net *temp_net = nullptr;
28 
29  void update_tip();
30 };
31 } // namespace horizon
Definition: board_junction.hpp:6
Definition: connection_line.hpp:15
Definition: net.hpp:15
This is what a Tool receives when the user did something.
Definition: tool.hpp:23
Common interface for all Tools.
Definition: tool.hpp:121
Definition: tool_draw_connection_line.hpp:6
ToolResponse begin(const ToolArgs &args) override
Gets called right after the constructor has finished.
Definition: tool_draw_connection_line.cpp:16
ToolResponse update(const ToolArgs &args) override
Gets called whenever the user generated some sort of input.
Definition: tool_draw_connection_line.cpp:39
bool can_begin() override
Definition: tool_draw_connection_line.cpp:11
To signal back to the core what the Tool did, a Tool returns a ToolResponse.
Definition: tool.hpp:42