Horizon
tool_draw_line_circle.hpp
1 #pragma once
2 #include "tool_helper_line_width_setting.hpp"
3 
4 namespace horizon {
5 
7 public:
8  ToolDrawLineCircle(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, I::CANCEL, I::RMB, I::ENTER_DATUM, I::ENTER_WIDTH,
17  };
18  }
19  void apply_settings() override;
20 
21 
22 private:
23  Coordi first_pos;
24  Coordi second_pos;
25 
26  int step = 0;
27  std::array<class Junction *, 3> junctions = {};
28  std::array<class Arc *, 2> arcs = {};
29  void create();
30 
31  void update_junctions();
32  void update_tip();
33 };
34 } // namespace horizon
horizon::ToolDrawLineCircle::update
ToolResponse update(const ToolArgs &args) override
Gets called whenever the user generated some sort of input.
Definition: tool_draw_line_circle.cpp:79
horizon::IDocument
Definition: idocument.hpp:5
horizon::ToolHelperLineWidthSetting
Definition: tool_helper_line_width_setting.hpp:6
horizon::Coord< int64_t >
horizon::ToolDrawLineCircle
Definition: tool_draw_line_circle.hpp:6
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::ToolDrawLineCircle::can_begin
bool can_begin() override
Definition: tool_draw_line_circle.cpp:13
horizon::ToolDrawLineCircle::begin
ToolResponse begin(const ToolArgs &args) override
Gets called right after the constructor has finished.
Definition: tool_draw_line_circle.cpp:52