Horizon
tool_draw_line.hpp
1 #pragma once
2 #include "core.hpp"
3 #include "tool_helper_line_width_setting.hpp"
4 
5 namespace horizon {
6 
8 public:
9  ToolDrawLine(Core *c, ToolID tid);
10  ToolResponse begin(const ToolArgs &args) override;
11  ToolResponse update(const ToolArgs &args) override;
12  bool can_begin() override;
13  bool handles_esc() override
14  {
15  return true;
16  }
17 
18  void apply_settings() override;
19 
20 private:
21  Junction *temp_junc = 0;
22  Line *temp_line = 0;
23  void update_tip();
24  bool first_line = true;
25  std::set<const Junction *> junctions_created;
26  enum class Mode { X, Y, ARB };
27  Mode mode = Mode::ARB;
28  void do_move(const Coordi &c);
29 };
30 } // namespace horizon
Definition: tool_helper_line_width_setting.hpp:6
This is what a Tool receives when the user did something.
Definition: core.hpp:27
Graphical line.
Definition: line.hpp:19
bool handles_esc() override
Definition: tool_draw_line.hpp:13
ToolResponse update(const ToolArgs &args) override
Gets called whenever the user generated some sort of input.
Definition: tool_draw_line.cpp:78
bool can_begin() override
Definition: tool_draw_line.cpp:13
Definition: tool_draw_line.hpp:7
Where Tools and and documents meet.
Definition: core.hpp:232
ToolResponse begin(const ToolArgs &args) override
Gets called right after the constructor has finished.
Definition: tool_draw_line.cpp:24
To signal back to the core what the Tool did, a Tool returns a ToolResponse.
Definition: core.hpp:46
Definition: block.cpp:9
A Junction is a point in 2D-Space.
Definition: junction.hpp:25