Horizon
tool_draw_connection_line.hpp
1 #pragma once
2 #include "core/tool.hpp"
3 
4 namespace horizon {
5 
7 public:
8  ToolDrawConnectionLine(IDocument *c, ToolID tid);
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 Junction *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
horizon::IDocument
Definition: idocument.hpp:5
horizon::ToolDrawConnectionLine
Definition: tool_draw_connection_line.hpp:6
horizon::ToolDrawConnectionLine::can_begin
bool can_begin() override
Definition: tool_draw_connection_line.cpp:15
horizon::ToolDrawConnectionLine::update
ToolResponse update(const ToolArgs &args) override
Gets called whenever the user generated some sort of input.
Definition: tool_draw_connection_line.cpp:42
horizon::ToolDrawConnectionLine::begin
ToolResponse begin(const ToolArgs &args) override
Gets called right after the constructor has finished.
Definition: tool_draw_connection_line.cpp:20
horizon::Net
Definition: net.hpp:15
horizon::Junction
A Junction is a point in 2D-Space.
Definition: junction.hpp:22
horizon::ToolBase
Common interface for all Tools.
Definition: tool.hpp:121
horizon::ToolResponse
To signal back to the core what the Tool did, a Tool returns a ToolResponse.
Definition: tool.hpp:42
horizon::ToolArgs
This is what a Tool receives when the user did something.
Definition: tool.hpp:23
horizon::ConnectionLine
Definition: connection_line.hpp:15