Horizon
tool_draw_line.hpp
1 #pragma once
2 #include "core.hpp"
3 #include "tool_helper_line_width_setting.hpp"
4 #include "tool_helper_restrict.hpp"
5 
6 namespace horizon {
7 
9 public:
10  ToolDrawLine(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  void apply_settings() override;
20 
21 private:
22  Junction *temp_junc = 0;
23  Line *temp_line = 0;
24  void update_tip();
25  bool first_line = true;
26  std::set<const Junction *> junctions_created;
27  void do_move(const Coordi &c);
28 };
29 } // namespace horizon
horizon::Line
Graphical line.
Definition: line.hpp:19
horizon::ToolHelperRestrict
Definition: tool_helper_restrict.hpp:6
horizon::ToolHelperLineWidthSetting
Definition: tool_helper_line_width_setting.hpp:6
horizon::ToolDrawLine::handles_esc
bool handles_esc() override
Definition: tool_draw_line.hpp:14
horizon::Coord
Your typical coordinate class.
Definition: common.hpp:72
horizon::Core
Where Tools and and documents meet.
Definition: core.hpp:240
horizon::Junction
A Junction is a point in 2D-Space.
Definition: junction.hpp:25
horizon::ToolDrawLine::begin
ToolResponse begin(const ToolArgs &args) override
Gets called right after the constructor has finished.
Definition: tool_draw_line.cpp:24
horizon::ToolDrawLine
Definition: tool_draw_line.hpp:8
horizon::ToolResponse
To signal back to the core what the Tool did, a Tool returns a ToolResponse.
Definition: core.hpp:52
horizon::ToolArgs
This is what a Tool receives when the user did something.
Definition: core.hpp:26
horizon::ToolDrawLine::can_begin
bool can_begin() override
Definition: tool_draw_line.cpp:13
horizon::ToolDrawLine::update
ToolResponse update(const ToolArgs &args) override
Gets called whenever the user generated some sort of input.
Definition: tool_draw_line.cpp:64