Horizon
tool_place_via.hpp
1 #pragma once
2 #include "core/tool.hpp"
3 #include "tool_place_junction.hpp"
4 #include <forward_list>
5 
6 namespace horizon {
7 
8 class ToolPlaceVia : public ToolPlaceJunction {
9 public:
10  ToolPlaceVia(IDocument *c, ToolID tid);
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::EDIT,
20  };
21  }
22 
23 protected:
24  void create_attached() override;
25  void delete_attached() override;
26  bool begin_attached() override;
27  bool update_attached(const ToolArgs &args) override;
28  class Via *via = nullptr;
29  class Net *net = nullptr;
30 
31  std::forward_list<class Via *> vias_placed;
32 
33 private:
34  const class BoardRules *rules = nullptr;
35  void update_tip();
36 };
37 } // namespace horizon
horizon::ToolPlaceVia::can_begin
bool can_begin() override