Horizon
tool_place_via.hpp
1 #pragma once
2 #include "core/tool.hpp"
3 #include "tool_place_junction.hpp"
4 #include "board/board_junction.hpp"
5 #include <forward_list>
6 
7 namespace horizon {
8 
9 class ToolPlaceVia : public ToolPlaceJunctionT<class BoardJunction> {
10 public:
12  bool can_begin() override;
13  std::set<InToolActionID> get_actions() const override
14  {
15  using I = InToolActionID;
16  return {
17  I::LMB,
18  I::CANCEL,
19  I::RMB,
20  I::EDIT,
21  };
22  }
23 
24 protected:
25  void insert_junction() override;
26  void create_attached() override;
27  void delete_attached() override;
28  bool begin_attached() override;
29  void finish() override;
30  bool update_attached(const ToolArgs &args) override;
31  class Via *via = nullptr;
32  class Net *net = nullptr;
33  std::set<UUID> nets;
34 
35  std::forward_list<class Via *> vias_placed;
36 
37 private:
38  const class BoardRules *rules = nullptr;
39  void update_tip();
40 };
41 } // namespace horizon
Definition: board_rules.hpp:22
Definition: net.hpp:15
This is what a Tool receives when the user did something.
Definition: tool.hpp:23
Definition: tool_place_junction.hpp:57
Definition: tool_place_via.hpp:9
bool can_begin() override
Definition: tool_place_via.cpp:10
Definition: via.hpp:16