Horizon
tool_draw_polygon_circle.hpp
1 #pragma once
2 #include "core/tool.hpp"
3 
4 namespace horizon {
5 
7 public:
8  ToolDrawPolygonCircle(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  I::ENTER_DATUM,
20  };
21  }
22 
23 private:
24  Coordi first_pos;
25  Coordi second_pos;
26 
27  int step = 0;
28  class Polygon *temp = nullptr;
29 
30  void update_polygon();
31  void update_tip();
32 };
33 } // namespace horizon
horizon::Polygon
Polygon used in Padstack, Package and Board for specifying filled Regions.
Definition: polygon.hpp:27
horizon::IDocument
Definition: idocument.hpp:5
horizon::ToolDrawPolygonCircle
Definition: tool_draw_polygon_circle.hpp:6
horizon::ToolDrawPolygonCircle::begin
ToolResponse begin(const ToolArgs &args) override
Gets called right after the constructor has finished.
Definition: tool_draw_polygon_circle.cpp:31
horizon::Coord< int64_t >
horizon::ToolDrawPolygonCircle::can_begin
bool can_begin() override
Definition: tool_draw_polygon_circle.cpp:13
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::ToolDrawPolygonCircle::update
ToolResponse update(const ToolArgs &args) override
Gets called whenever the user generated some sort of input.
Definition: tool_draw_polygon_circle.cpp:62