Horizon
tool_round_off_vertex.hpp
1 #pragma once
2 #include "common/polygon.hpp"
3 #include "core/tool.hpp"
4 #include <forward_list>
5 
6 namespace horizon {
7 
8 class ToolRoundOffVertex : public ToolBase {
9 public:
10  ToolRoundOffVertex(IDocument *c, ToolID tid);
11  ToolResponse begin(const ToolArgs &args) override;
12  ToolResponse update(const ToolArgs &args) override;
13  bool can_begin() override;
14  bool is_specific() override
15  {
16  return true;
17  }
18 
19 private:
20  Polygon *poly = nullptr;
21  int wrap_index(int i) const;
22 
23  Polygon::Vertex *vxn = nullptr;
24  Polygon::Vertex *vxp = nullptr;
25 
26  Coord<double> p0;
27  Coord<double> vp;
28  Coord<double> vn;
29  Coord<double> vh;
30  double delta_max = 0;
31  double r_max = 0;
32  double alpha = 0;
33  double radius_current = 0;
34 
35  void update_poly(double r);
36  void update_cursor(const Coordi &c);
37  void update_tip();
38 
39  bool orientation = false;
40 };
41 } // 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::ToolRoundOffVertex::is_specific
bool is_specific() override
Definition: tool_round_off_vertex.hpp:14
horizon::ToolRoundOffVertex::begin
ToolResponse begin(const ToolArgs &args) override
Gets called right after the constructor has finished.
Definition: tool_round_off_vertex.cpp:44
horizon::Polygon::Vertex
Definition: polygon.hpp:29
horizon::ToolRoundOffVertex
Definition: tool_round_off_vertex.hpp:8
horizon::ToolRoundOffVertex::can_begin
bool can_begin() override
Definition: tool_round_off_vertex.cpp:17
horizon::Coord< double >
horizon::ToolBase
Common interface for all Tools.
Definition: tool.hpp:136
horizon::ToolResponse
To signal back to the core what the Tool did, a Tool returns a ToolResponse.
Definition: tool.hpp:48
horizon::ToolArgs
This is what a Tool receives when the user did something.
Definition: tool.hpp:22
horizon::ToolRoundOffVertex::update
ToolResponse update(const ToolArgs &args) override
Gets called whenever the user generated some sort of input.
Definition: tool_round_off_vertex.cpp:134